Architecture specific change in rpms/widelands.git
by githook-noreply@fedoraproject.org
The package rpms/widelands.git has added or updated architecture specific content in its
spec file (ExclusiveArch/ExcludeArch or %ifarch/%ifnarch) in commit(s):
https://src.fedoraproject.org/cgit/rpms/widelands.git/commit/?id=c362e4d7....
Change:
+%ifarch ppc64le
Thanks.
Full change:
============
commit c362e4d73ce4b0ea0817c710ed7cfd353f6f9422
Author: Nils Philippsen <nils(a)redhat.com>
Date: Tue Feb 20 23:04:09 2018 +0100
FTBFS: build with --std=gnu++11 on ppc64le
diff --git a/widelands-build19-ppc64le.patch b/widelands-build19-ppc64le.patch
new file mode 100644
index 0000000..dc5b881
--- /dev/null
+++ b/widelands-build19-ppc64le.patch
@@ -0,0 +1,12 @@
+diff -up widelands-build19-src-gcc7/CMakeLists.txt.ppc64le widelands-build19-src-gcc7/CMakeLists.txt
+--- widelands-build19-src-gcc7/CMakeLists.txt.ppc64le 2017-06-20 10:33:11.000000000 +0200
++++ widelands-build19-src-gcc7/CMakeLists.txt 2018-02-20 23:01:39.680715037 +0100
+@@ -102,7 +102,7 @@ else()
+ message(FATAL_ERROR "Unknown CMAKE_BUILD_TYPE: ${CMAKE_BUILD_TYPE}")
+ endif()
+
+-wl_add_flag(WL_GENERIC_CXX_FLAGS "-std=c++11")
++wl_add_flag(WL_GENERIC_CXX_FLAGS "-std=gnu++11")
+
+ if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
+ wl_add_flag(WL_COMPILE_DIAGNOSTICS "-Weverything")
diff --git a/widelands.spec b/widelands.spec
index 6e794d2..95d2b63 100644
--- a/widelands.spec
+++ b/widelands.spec
@@ -10,6 +10,7 @@ Group: Amusements/Games
License: GPLv2+
URL: http://www.widelands.org
Source0: https://launchpad.net/widelands/%{buildid}/%{buildid}/+download/widelands...
+Patch0: widelands-build19-ppc64le.patch
BuildRequires: SDL2-devel
BuildRequires: SDL2_image-devel
@@ -45,6 +46,10 @@ perhaps will have a thought, what Widelands is all about.
%prep
%setup -q -n widelands-%{buildid}-src-gcc7
+%ifarch ppc64le
+%patch0 -p1 -b .ppc64le
+%endif
+
%build
mkdir build
@@ -119,6 +124,7 @@ popd
%changelog
* Tue Feb 20 2018 Nils Philippsen <nils(a)tiptoe.de> - 0-0.62.build19
- require gcc, gcc-c++ for building
+- FTBFS: build with --std=gnu++11 on ppc64le
* Thu Feb 08 2018 Hans de Goede <hdegoede(a)redhat.com> - 0-0.61.build19
- Update to new upstream Build19 release (rhbz#1397883)
6 years, 4 months
Architecture specific change in rpms/freeipa.git
by githook-noreply@fedoraproject.org
The package rpms/freeipa.git has added or updated architecture specific content in its
spec file (ExclusiveArch/ExcludeArch or %ifarch/%ifnarch) in commit(s):
https://src.fedoraproject.org/cgit/rpms/freeipa.git/commit/?id=5e4d8ce49d....
Change:
+%ifarch %{ix86}
Thanks.
Full change:
============
commit 5e4d8ce49dfaf38fd80c62bf25ebad627ef0a266
Author: Rob Crittenden <rcritten(a)redhat.com>
Date: Tue Feb 20 13:24:55 2018 -0500
Disable i686 server build: 389-ds no longer provides that arch
Build only the client pieces.
Resolves: #1544386
diff --git a/0002-ipa-kdb-support-KDB-DAL-version-7.0.patch b/0002-ipa-kdb-support-KDB-DAL-version-7.0.patch
deleted file mode 100644
index 4f098c2..0000000
--- a/0002-ipa-kdb-support-KDB-DAL-version-7.0.patch
+++ /dev/null
@@ -1,75 +0,0 @@
-From f940bd8923f04d5646c3915b453c9cfe5e0507c4 Mon Sep 17 00:00:00 2001
-From: Robbie Harwood <rharwood(a)redhat.com>
-Date: Mon, 9 Oct 2017 11:39:09 -0400
-Subject: [PATCH] ipa-kdb: support KDB DAL version 7.0
-
-krb5-1.16 includes DAL version 7, which changes the signature of
-audit_as_req to include local and remote address parameters.
-
-This patch just enables building against the new DAL version, but
-doesn't use the new information for anything.
----
- daemons/ipa-kdb/ipa_kdb.c | 9 ++++++---
- daemons/ipa-kdb/ipa_kdb.h | 4 ++++
- daemons/ipa-kdb/ipa_kdb_audit_as.c | 4 ++++
- 3 files changed, 14 insertions(+), 3 deletions(-)
-
-diff --git a/daemons/ipa-kdb/ipa_kdb.c b/daemons/ipa-kdb/ipa_kdb.c
-index c0f1e276ca32ecb318add3a0d36f57acc3d17d51..b11153eccdcc70e86e109a0106ef548f0594835d 100644
---- a/daemons/ipa-kdb/ipa_kdb.c
-+++ b/daemons/ipa-kdb/ipa_kdb.c
-@@ -709,7 +709,9 @@ kdb_vftabl kdb_function_table = {
- };
- #endif
-
--#if (KRB5_KDB_DAL_MAJOR_VERSION == 6) && defined(HAVE_KDB_FREEPRINCIPAL_EDATA)
-+#if ((KRB5_KDB_DAL_MAJOR_VERSION == 6) || \
-+ (KRB5_KDB_DAL_MAJOR_VERSION == 7)) && \
-+ defined(HAVE_KDB_FREEPRINCIPAL_EDATA)
- kdb_vftabl kdb_function_table = {
- .maj_ver = KRB5_KDB_DAL_MAJOR_VERSION,
- .min_ver = 1,
-@@ -742,7 +744,8 @@ kdb_vftabl kdb_function_table = {
- };
- #endif
-
--#if (KRB5_KDB_DAL_MAJOR_VERSION != 5) && (KRB5_KDB_DAL_MAJOR_VERSION != 6)
-+#if (KRB5_KDB_DAL_MAJOR_VERSION != 5) && \
-+ (KRB5_KDB_DAL_MAJOR_VERSION != 6) && \
-+ (KRB5_KDB_DAL_MAJOR_VERSION != 7)
- #error unsupported DAL major version
- #endif
--
-diff --git a/daemons/ipa-kdb/ipa_kdb.h b/daemons/ipa-kdb/ipa_kdb.h
-index 72573a61adecfae152796d61b88b6c43b3a975a3..be2f457522bfb172fa887645de3df4c77b5c82ee 100644
---- a/daemons/ipa-kdb/ipa_kdb.h
-+++ b/daemons/ipa-kdb/ipa_kdb.h
-@@ -326,6 +326,10 @@ krb5_error_code ipadb_check_allowed_to_delegate(krb5_context kcontext,
-
- void ipadb_audit_as_req(krb5_context kcontext,
- krb5_kdc_req *request,
-+#if (KRB5_KDB_DAL_MAJOR_VERSION == 7)
-+ const krb5_address *local_addr,
-+ const krb5_address *remote_addr,
-+#endif
- krb5_db_entry *client,
- krb5_db_entry *server,
- krb5_timestamp authtime,
-diff --git a/daemons/ipa-kdb/ipa_kdb_audit_as.c b/daemons/ipa-kdb/ipa_kdb_audit_as.c
-index 5f59bf33a761905d69d2d3167a206766457796fb..c68a67aa2a0ca9a2dc9e7a2d39c60d8b105fcc06 100644
---- a/daemons/ipa-kdb/ipa_kdb_audit_as.c
-+++ b/daemons/ipa-kdb/ipa_kdb_audit_as.c
-@@ -26,6 +26,10 @@
-
- void ipadb_audit_as_req(krb5_context kcontext,
- krb5_kdc_req *request,
-+#if (KRB5_KDB_DAL_MAJOR_VERSION == 7)
-+ const krb5_address *local_addr,
-+ const krb5_address *remote_addr,
-+#endif
- krb5_db_entry *client,
- krb5_db_entry *server,
- krb5_timestamp authtime,
---
-2.13.3
-
diff --git a/freeipa.spec b/freeipa.spec
index ec89c84..ddeb5d7 100644
--- a/freeipa.spec
+++ b/freeipa.spec
@@ -1,3 +1,11 @@
+# 389-ds-base 1.4 no longer supports i686 platform, build only client
+# packages, https://bugzilla.redhat.com/show_bug.cgi?id=1544386
+%if 0%{?fedora} >= 28 || 0%{?rhel} > 7
+%ifarch %{ix86}
+%{!?ONLY_CLIENT:%global ONLY_CLIENT 1}
+%endif
+%endif
+
# Define ONLY_CLIENT to only make the ipa-client and ipa-python
# subpackages
%{!?ONLY_CLIENT:%global ONLY_CLIENT 0}
@@ -88,7 +96,7 @@
Name: freeipa
Version: %{VERSION}
-Release: 4%{?dist}
+Release: 5%{?dist}
Summary: The Identity, Policy and Audit system
Group: System Environment/Base
@@ -1773,6 +1781,10 @@ fi
%endif # with_ipatests
%changelog
+* Tue Feb 20 2018 Rob Crittenden <rcritten(a)redhat.com> - 4.6.3-5
+- Disable i686 server builds because 389-ds no longer provides
+ builds on that arch. (#1544386)
+
* Fri Feb 09 2018 Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> - 4.6.3-4
- Escape macros in %%changelog
6 years, 4 months
Architecture specific change in rpms/gc.git
by githook-noreply@fedoraproject.org
The package rpms/gc.git has added or updated architecture specific content in its
spec file (ExclusiveArch/ExcludeArch or %ifarch/%ifnarch) in commit(s):
https://src.fedoraproject.org/cgit/rpms/gc.git/commit/?id=6de65dd8645a261....
Change:
-%ifarch %{ix86}
Thanks.
Full change:
============
commit 6de65dd8645a261cf6c1e65dfab17f6c36822050
Author: Rex Dieter <rdieter(a)gmail.com>
Date: Tue Feb 20 13:22:13 2018 -0600
7.6.4, reverts abi bump, compat-gc no longer needed
diff --git a/.gitignore b/.gitignore
index 5eb2ff1..5c6bc97 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,2 +1,3 @@
/gc-7.6.0.tar.gz
/gc-7.6.2.tar.gz
+/gc-7.6.4.tar.gz
diff --git a/gc.spec b/gc.spec
index 6e089c8..689602f 100644
--- a/gc.spec
+++ b/gc.spec
@@ -1,17 +1,12 @@
-%global compat 1
-
Summary: A garbage collector for C and C++
Name: gc
-Version: 7.6.2
-Release: 4%{?dist}
+Version: 7.6.4
+Release: 1%{?dist}
License: BSD
Url: http://www.hboehm.info/gc/
Source0: http://www.hboehm.info/gc/gc_source/gc-%{version}%{?pre}.tar.gz
-%if 0%{?compat}
-Source1: http://www.hboehm.info/gc/gc_source/gc-7.6.0.tar.gz
-%endif
## upstreamable patches
@@ -38,11 +33,6 @@ Provides: libgc-devel = %{version}-%{release}
%description devel
%{summary}.
-%package -n compat-gc
-Summary: Compat gc-7.6.0 runtime library
-%description -n compat-gc
-%{summary} to ease transition to gc-7.6.2+.
-
%prep
%autosetup -n gc-%{version}%{?pre}
@@ -51,17 +41,8 @@ Summary: Compat gc-7.6.0 runtime library
rm -f libtool libtool.m4
autoreconf -i -f
-%if 0%{?compat}
-tar xzf %{SOURCE1}
-pushd gc-7.6.0
-rm -f libtool libtool.m4
-autoreconf -i -f
-popd
-%endif
-
%build
-
# see bugzilla.redhat.com/689877
CPPFLAGS="-DUSE_GET_STACKBASE_FOR_MAIN"; export CPPFLAGS
@@ -77,32 +58,8 @@ CPPFLAGS="-DUSE_GET_STACKBASE_FOR_MAIN"; export CPPFLAGS
%{make_build}
-%if 0%{?compat}
-pushd gc-7.6.0
-%configure \
- --disable-static \
- --enable-cplusplus \
- --enable-large-config \
-%ifarch %{ix86}
- --enable-parallel-mark \
-%endif
- --enable-threads=posix
-
-%{make_build}
-popd
-%endif
-
%install
-
-%if 0%{?compat}
-%{make_install} -C gc-7.6.0
-
-rm -rfv %{buildroot}{%{_includedir},%{_datadir}}
-rm -fv %{buildroot}%{_libdir}/lib{cord,gcccpp}*
-rm -fv %{buildroot}%{_libdir}/libgc.so
-%endif
-
%{make_install}
install -p -D -m644 doc/gc.man %{buildroot}%{_mandir}/man3/gc.3
@@ -128,7 +85,7 @@ make check %{?arch_ignore}
%files
%{_libdir}/libcord.so.1*
-%{_libdir}/libgc.so.2*
+%{_libdir}/libgc.so.1*
%{_libdir}/libgccpp.so.1*
%files devel
@@ -143,15 +100,11 @@ make check %{?arch_ignore}
%{_libdir}/pkgconfig/bdw-gc.pc
%{_mandir}/man3/gc.3*
-%if 0%{?compat}
-%ldconfig_scriptlets -n compat-gc
-
-%files -n compat-gc
-%{_libdir}/libgc.so.1*
-%endif
-
%changelog
+* Tue Feb 20 2018 Rex Dieter <rdieter(a)fedoraproject.org> - 7.6.4-1
+- 7.6.4, reverts abi bump, compat-gc no longer needed
+
* Tue Feb 20 2018 Rex Dieter <rdieter(a)fedoraproject.org> - 7.6.2-4
- BR: gcc-c++
- add (temporary) compat-gc
diff --git a/sources b/sources
index cb036ae..e7bef4e 100644
--- a/sources
+++ b/sources
@@ -1,2 +1 @@
-SHA512 (gc-7.6.2.tar.gz) = 7b54812903929b0d5d1d696beac54629a7667997b41ef45299373bc18b2153d5755286b25e11cc90ffc572239e52a02900927bc60b0ad3593162b8c8e259fd50
-SHA512 (gc-7.6.0.tar.gz) = 511e8c01287b1ee9dbec87f0573377de77038b7af053a3f33afed9b3ffa30e2402d6a9bb0ca4f4b81cd808209b47b5718d498cff3de6632a057fe03fad51fc43
+SHA512 (gc-7.6.4.tar.gz) = 2c85be3e24b85732b3dc6f08fe98cf1a82b6fb2a22ec73090f80920721c737ef92cee8f0cd7ea7228d686005d164e7da54ce3907c3a1ba5eefa43355a472085e
6 years, 4 months
Architecture specific change in rpms/dmlite.git
by githook-noreply@fedoraproject.org
The package rpms/dmlite.git has added or updated architecture specific content in its
spec file (ExclusiveArch/ExcludeArch or %ifarch/%ifnarch) in commit(s):
https://src.fedoraproject.org/cgit/rpms/dmlite.git/commit/?id=00b93253283...
https://src.fedoraproject.org/cgit/rpms/dmlite.git/commit/?id=e83c2ad6032....
Change:
+ExcludeArch: s390x
-ExcludeArch: s390x
Thanks.
Full change:
============
commit af346ab0788249913dd6201a8cab13bee01b2759
Merge: 88a044d 6743b5f
Author: andreamanzi <andrea.manzi(a)gmail.com>
Date: Tue Feb 20 20:00:38 2018 +0100
fix merge
diff --cc dmlite.spec
index 762d173,583e172..ac77ecc
--- a/dmlite.spec
+++ b/dmlite.spec
@@@ -17,7 -17,7 +17,11 @@@
%endif
Name: dmlite
++<<<<<<< HEAD
+Version: 0.8.8
++=======
+ Version: 1.10.0
++>>>>>>> master
Release: 1%{?dist}
Summary: Lcgdm grid data management and storage framework
Group: Applications/Internet
@@@ -267,6 -272,7 +276,10 @@@ dmlite plugins only, no API compatibili
Summary: The dpm tester tool
Group: Applications/Internet
Requires: python
++<<<<<<< HEAD
++=======
+ Requires: python-argparse
++>>>>>>> master
Requires: gfal2-python
Requires: gfal2-plugin-http
Requires: gfal2-plugin-xrootd
@@@ -573,14 -572,39 +579,40 @@@ rm -rf %{buildroot}/%{_libdir}/dmlite/t
%defattr(-,root,root,-)
%{_libdir}/dmlite/plugin_domeadapter.so
%doc LICENSE README RELEASE-NOTES
- %config(noreplace) %{_sysconfdir}/dmlite.conf.d/domeadapter.example
+ %config(noreplace) %{_sysconfdir}/dmlite.conf.d/domeadapter.conf
%changelog
- * Mon Jul 31 2017 Andrea Manzi <amanzi(a)cern.ch> - 0.8.8-1
- - New upstream release
+ * Fri Feb 16 2018 Andrea Manzi <amanzi(a)cern.ch> - 1.10.0-1
+ - new upstream release
+
+ * Wed Feb 07 2018 Fedora Release Engineering <releng(a)fedoraproject.org> - 0.8.8-7
+ - Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
+
+ * Wed Nov 29 2017 Igor Gnatenko <ignatenko(a)redhat.com> - 0.8.8-5
+ - Rebuild for protobuf 3.5
+
+ * Tue Nov 14 2017 Andrea Manzi <amanzi(a)cern.ch> - 0.8.8-4
+ - new version to fix build with rawhide
+
+ * Mon Nov 13 2017 Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> - 0.8.8-3
+ - Rebuild for protobuf 3.4
+
+ * Thu Sep 21 2017 Andrea Manzi <amanzi(a)cern.ch> - 0.8.8-2
+ - change mysql-devel to mariadb-connector-c-devel
+
+ * Sat Aug 19 2017 Zbigniew Jędrzejewski-Szmek <zbyszek(a)in.waw.pl> - 0.8.7-6
+ - Python 2 binary package renamed to python2-dmlite
+ See https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3
+
+ * Wed Aug 02 2017 Fedora Release Engineering <releng(a)fedoraproject.org> - 0.8.7-5
+ - Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild
+
+ * Wed Jul 26 2017 Fedora Release Engineering <releng(a)fedoraproject.org> - 0.8.7-4
+ - Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
- * Wed Jun 28 2017 Andrea Manzi <amanzi(a)cern.ch> - 0.8.7-2
- - remove pyhon-argparse in f26
+ * Mon Jul 24 2017 Björn Esser <besser82(a)fedoraproject.org> - 0.8.7-3
+ - Rebuilt for Boost 1.64
++>>>>>>> master
* Wed Jun 28 2017 Andrea Manzi <amanzi(a)cern.ch> - 0.8.7-1
- New upstream release
commit 6743b5f3fe972612d7a4fb5dce23209233dc94c0
Author: andreamanzi <andrea.manzi(a)gmail.com>
Date: Tue Feb 20 18:33:50 2018 +0100
new upstream release
diff --git a/dmlite.spec b/dmlite.spec
index 60da0e2..583e172 100644
--- a/dmlite.spec
+++ b/dmlite.spec
@@ -489,6 +489,7 @@ rm -rf %{buildroot}/%{_libdir}/dmlite/test
%files dome
%defattr(-,root,root,-)
%{_bindir}/dome-checksum
+%{_libdir}/libdome*.so
%files devel
%defattr(-,root,root,-)
commit de4ed211be25b15162fc8537a8ea8840ac100851
Author: andreamanzi <andrea.manzi(a)gmail.com>
Date: Tue Feb 20 18:09:37 2018 +0100
new upstream release
diff --git a/dmlite.spec b/dmlite.spec
index 8444e7c..60da0e2 100644
--- a/dmlite.spec
+++ b/dmlite.spec
@@ -571,7 +571,7 @@ rm -rf %{buildroot}/%{_libdir}/dmlite/test
%defattr(-,root,root,-)
%{_libdir}/dmlite/plugin_domeadapter.so
%doc LICENSE README RELEASE-NOTES
-%config(noreplace) %{_sysconfdir}/dmlite.conf.d/domeadapter.example
+%config(noreplace) %{_sysconfdir}/dmlite.conf.d/domeadapter.conf
%changelog
* Fri Feb 16 2018 Andrea Manzi <amanzi(a)cern.ch> - 1.10.0-1
commit 51b1758a19f8329373a575c4c27bb4fe40a71f0c
Author: andreamanzi <andrea.manzi(a)gmail.com>
Date: Tue Feb 20 17:51:05 2018 +0100
new upstream release
diff --git a/dmlite.spec b/dmlite.spec
index 4f4d9fe..8444e7c 100644
--- a/dmlite.spec
+++ b/dmlite.spec
@@ -551,7 +551,7 @@ rm -rf %{buildroot}/%{_libdir}/dmlite/test
%{_bindir}/dmlite-mysql-dirspaces.pyc
%{_bindir}/dmlite-mysql-dirspaces.pyo
%endif
-%{python_sitearch}/dmliteshell
+%{python_sitelib}/dmliteshell
%doc LICENSE README RELEASE-NOTES
commit d50236c8bb422dafdf25eb643cbb0c6b92e9733e
Author: andreamanzi <andrea.manzi(a)gmail.com>
Date: Tue Feb 20 17:40:28 2018 +0100
new upstream release
diff --git a/sources b/sources
index 1f1dcf1..3934fd7 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-SHA512 (dmlite-1.10.0.tar.gz) = d27d2fe84ed9dca60ad3beb8e90959f8b9a53d69bf31e25dcece196d8bc392528733a72f7c037d99c766199c27982167a1ae975c40cac78b70cf2ed440ee24f0
+SHA512 (dmlite-1.10.0.tar.gz) = f4241fb68f5c85c8e084aa6ea4b3adb08cf263d52679deeec5368f194bd82fc53a38ec5be0dc1078903a7ad1c2c385c5b8536937803b0d4d0d82174b129730d5
commit 6697d12fd770b12bf6dcf1e94318cf0a397890c3
Author: andreamanzi <andrea.manzi(a)gmail.com>
Date: Tue Feb 20 17:28:17 2018 +0100
new upstream release
diff --git a/dmlite.spec b/dmlite.spec
index 7675a8f..4f4d9fe 100644
--- a/dmlite.spec
+++ b/dmlite.spec
@@ -401,9 +401,9 @@ dome and does not depend on the old LcgDM DPNS and DPM daemons.
%build
%if %{?fedora}%{!?fedora:0} >= 28
-%cmake . -DCMAKE_INSTALL_PREFIX=/ -DRUN_ONLY_STANDALONE_TESTS=ON -DBUILD_TESTS=OFF -DBUILD_MEMCACHE=OFF
+%cmake . -DCMAKE_INSTALL_PREFIX=/ -DRUN_ONLY_STANDALONE_TESTS=ON -DOVERWRITE_CONFIGFILES=ON -DBUILD_TESTS=OFF -DBUILD_MEMCACHE=OFF
%else
-%cmake . -DCMAKE_INSTALL_PREFIX=/ -DRUN_ONLY_STANDALONE_TESTS=ON -DBUILD_TESTS=OFF
+%cmake . -DCMAKE_INSTALL_PREFIX=/ -DRUN_ONLY_STANDALONE_TESTS=ON -DOVERWRITE_CONFIGFILES=ON -DBUILD_TESTS=OFF
%endif
make %{?_smp_mflags}
commit 40081ceee7fd7cdef24c02885df8c811260ad7d6
Author: andreamanzi <andrea.manzi(a)gmail.com>
Date: Fri Feb 16 15:21:44 2018 +0100
fix
diff --git a/dmlite.spec b/dmlite.spec
index 6ab7ca5..7675a8f 100644
--- a/dmlite.spec
+++ b/dmlite.spec
@@ -455,13 +455,13 @@ rm -rf %{buildroot}/%{_libdir}/dmlite/test
/sbin/ldconfig
/sbin/service rsyslog condrestart || true
-%files dpmhead-dome
+%files dpmhead-domeonly
%defattr(-,root,root,-)
%{_prefix}/share/dmlite/dbscripts
%{_prefix}/share/dmlite/filepull
-%files dpmdisk-dome
+%files dpmdisk-domeonly
%defattr(-,root,root,-)
%{_prefix}/share/dmlite/filepull
commit af72f0ebaf9bdeeb4fce5fce27ec776a5eb9eb6d
Author: andreamanzi <andrea.manzi(a)gmail.com>
Date: Fri Feb 16 15:20:22 2018 +0100
new upstream release
diff --git a/dmlite.spec b/dmlite.spec
index 4978f5d..6ab7ca5 100644
--- a/dmlite.spec
+++ b/dmlite.spec
@@ -17,8 +17,8 @@
%endif
Name: dmlite
-Version: 0.8.8
-Release: 7%{?dist}
+Version: 1.10.0
+Release: 1%{?dist}
Summary: Lcgdm grid data management and storage framework
Group: Applications/Internet
License: ASL 2.0
@@ -51,9 +51,13 @@ BuildRequires: zlib-devel
BuildRequires: dpm-devel
BuildRequires: lcgdm-devel
BuildRequires: libmemcached-devel
-BuildRequires: mariadb-connector-c-devel
+%if %{?fedora}%{!?fedora:0} >= 28
+BuildRequires: mariadb-connector-c-devel
+%else
+BuildRequires: mysql-devel
+%endif
BuildRequires: protobuf-devel
-BuildRequires: davix-devel >= 0.6.5
+BuildRequires: davix-devel >= 0.6.7
BuildRequires: fcgi-devel
%description
@@ -85,7 +89,7 @@ Requires: fetch-crl
Requires: finger
Requires: lcgdm-dav
Requires: lcgdm-dav-server
-Requires: davix >= 0.6.5
+Requires: davix >= 0.6.7
Obsoletes: emi-dpm_mysql
@@ -115,7 +119,7 @@ Requires: fetch-crl
Requires: finger
Requires: lcgdm-dav
Requires: lcgdm-dav-server
-Requires: davix >= 0.6.5
+Requires: davix >= 0.6.7
Obsoletes: emi-dpm_disk
@@ -127,7 +131,7 @@ This is a virtual package providing all required daemons for a DPM
Disk Node.
-%package dpmhead-dome
+%package dpmhead-domeonly
Summary: DPM Head Node (MySQL)
Group: Applications/Internet
Requires: bdii
@@ -142,7 +146,8 @@ Requires: fetch-crl
Requires: finger
Requires: lcgdm-dav
Requires: lcgdm-dav-server
-Requires: davix >= 0.6.5
+Requires: davix >= 0.6.7
+Requires: xrootd >= 1:4.8.1
Obsoletes: emi-dpm_mysql
Obsoletes: dpmhead
@@ -155,13 +160,13 @@ Conflicts: dpm-server-mysql%{?_isa}
Conflicts: dpm-srm-server-mysql%{?_isa}
Conflicts: dmlite-plugins-adapter
-%description dpmhead-dome
+%description dpmhead-domeonly
The Disk Pool Manager (DPM) creates a Grid storage element from a set
of disk servers. It provides several interfaces for storing and retrieving
data such as HTTP, Xrootd, GridFTP
This is a metapackage providing all required daemons for a DPM Head Node.
-%package dpmdisk-dome
+%package dpmdisk-domeonly
Summary: DPM Disk Node
Group: Applications/Internet
@@ -174,7 +179,7 @@ Requires: fetch-crl
Requires: finger
Requires: lcgdm-dav
Requires: lcgdm-dav-server
-Requires: davix >= 0.6.5
+Requires: davix >= 0.6.7
Obsoletes: emi-dpm_disk
Obsoletes: dpmdisk
@@ -184,7 +189,7 @@ Conflicts: dpm-perl%{?_isa}
Conflicts: dpm-rfio-server%{?_isa}
Conflicts: dmlite-plugins-adapter = %{version}
-%description dpmdisk-dome
+%description dpmdisk-domeonly
The Disk Pool Manager (DPM) creates a Grid storage element from a set
of disk servers. It provides several interfaces for storing and retrieving
data such as HTTP, Xrootd, GridFTP
@@ -220,9 +225,10 @@ This package provides the core libraries used by dmlite.
Summary: The dome daemon
Group: Applications/Internet
Requires: httpd
-%if %systemd == 0
-Requires: mod_proxy_fcgi
-%endif
+Requires: xrootd >= 1:4.8.1
+BuildRequires: xrootd-devel >= 1:4.8.1
+BuildRequires: xrootd-server-devel >= 1:4.8.1
+BuildRequires: xrootd-private-devel >= 1:4.8.1
%description dome
This package provides the binaries necessary to run the dome daemon.
@@ -266,12 +272,13 @@ dmlite plugins only, no API compatibility is guaranteed on these headers.
Summary: The dpm tester tool
Group: Applications/Internet
Requires: python
+Requires: python-argparse
Requires: gfal2-python
Requires: gfal2-plugin-http
Requires: gfal2-plugin-xrootd
Requires: gfal2-plugin-srm
Requires: gfal2-plugin-gridftp
-
+Requires: gfal2-plugin-file
%description dpm-tester
Tool that is useful to test the main features of a DPM setup
@@ -428,15 +435,6 @@ make install DESTDIR=%{buildroot}
rm -rf %{buildroot}/%{_libdir}/dmlite/test
%endif
-%post dome
-%if %systemd
- /bin/systemctl try-restart domehead.service || true
- /bin/systemctl try-restart domedisk.service || true
-%else
- /sbin/service domehead condrestart || true
- /sbin/service domedisk condrestart || true
-%endif
-
%post libs
/sbin/ldconfig
/sbin/service rsyslog condrestart || true
@@ -490,17 +488,7 @@ rm -rf %{buildroot}/%{_libdir}/dmlite/test
%files dome
%defattr(-,root,root,-)
-%dir %{_localstatedir}/www/fcgi-bin
%{_bindir}/dome-checksum
-%if %systemd
-/usr/lib/systemd/system/domehead.service
-/usr/lib/systemd/system/domedisk.service
-%else
-%{_sysconfdir}/rc.d/init.d/domehead
-%{_sysconfdir}/rc.d/init.d/domedisk
-%endif
-
-%{_localstatedir}/www/fcgi-bin/dome
%files devel
%defattr(-,root,root,-)
@@ -556,10 +544,17 @@ rm -rf %{buildroot}/%{_libdir}/dmlite/test
%files shell
%defattr(-,root,root,-)
-%{_bindir}/*
-%{python_sitelib}/dmliteshell
+%{_bindir}/dmlite-shell
+%{_bindir}/dpm-storage-summary.py
+%{_bindir}/dmlite-mysql-dirspaces.py
+%if %{?rhel}%{!?rhel:99} <= 5
+%{_bindir}/dmlite-mysql-dirspaces.pyc
+%{_bindir}/dmlite-mysql-dirspaces.pyo
+%endif
+%{python_sitearch}/dmliteshell
%doc LICENSE README RELEASE-NOTES
+
%files plugins-mysql
%defattr(-,root,root,-)
%{_libdir}/dmlite/plugin_mysql.so
@@ -579,6 +574,9 @@ rm -rf %{buildroot}/%{_libdir}/dmlite/test
%config(noreplace) %{_sysconfdir}/dmlite.conf.d/domeadapter.example
%changelog
+* Fri Feb 16 2018 Andrea Manzi <amanzi(a)cern.ch> - 1.10.0-1
+- new upstream release
+
* Wed Feb 07 2018 Fedora Release Engineering <releng(a)fedoraproject.org> - 0.8.8-7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
diff --git a/sources b/sources
index c6ede78..1f1dcf1 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-SHA512 (dmlite-0.8.8.tar.gz) = 3056970178309900fb64aa29c97c30d053a0df94c800713dc8d04e167158be80bcd0b6b8b5a9098b7b38a3b62f6c1d74ea106e071179b0ac6a9d5acd62a9aac8
+SHA512 (dmlite-1.10.0.tar.gz) = d27d2fe84ed9dca60ad3beb8e90959f8b9a53d69bf31e25dcece196d8bc392528733a72f7c037d99c766199c27982167a1ae975c40cac78b70cf2ed440ee24f0
commit bbce88e2bc1d4337b8d9e8cad5fd83c298971995
Author: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org>
Date: Wed Feb 14 07:06:23 2018 +0100
Remove %clean section
None of currently supported distributions need that.
Last one was EL5 which is EOL for a while.
Signed-off-by: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org>
diff --git a/dmlite.spec b/dmlite.spec
index 06cc326..4978f5d 100644
--- a/dmlite.spec
+++ b/dmlite.spec
@@ -428,9 +428,6 @@ make install DESTDIR=%{buildroot}
rm -rf %{buildroot}/%{_libdir}/dmlite/test
%endif
-%clean
-rm -rf %{buildroot}
-
%post dome
%if %systemd
/bin/systemctl try-restart domehead.service || true
commit ec3d656addf06e622e1481d8cc4c99368ed9b16a
Author: Fedora Release Engineering <releng(a)fedoraproject.org>
Date: Wed Feb 7 07:00:36 2018 +0000
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng(a)fedoraproject.org>
diff --git a/dmlite.spec b/dmlite.spec
index e38e25a..06cc326 100644
--- a/dmlite.spec
+++ b/dmlite.spec
@@ -18,7 +18,7 @@
Name: dmlite
Version: 0.8.8
-Release: 6%{?dist}
+Release: 7%{?dist}
Summary: Lcgdm grid data management and storage framework
Group: Applications/Internet
License: ASL 2.0
@@ -582,6 +582,9 @@ rm -rf %{buildroot}
%config(noreplace) %{_sysconfdir}/dmlite.conf.d/domeadapter.example
%changelog
+* Wed Feb 07 2018 Fedora Release Engineering <releng(a)fedoraproject.org> - 0.8.8-7
+- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
+
* Wed Nov 29 2017 Igor Gnatenko <ignatenko(a)redhat.com> - 0.8.8-5
- Rebuild for protobuf 3.5
commit 54b63be1a7f9542c0373989b800d08c45bbd3afa
Author: andreamanzi <andrea.manzi(a)gmail.com>
Date: Mon Jan 8 10:49:38 2018 +0100
disable memcache on rawhide
diff --git a/dmlite.spec b/dmlite.spec
index 51d36ca..e38e25a 100644
--- a/dmlite.spec
+++ b/dmlite.spec
@@ -393,7 +393,11 @@ dome and does not depend on the old LcgDM DPNS and DPM daemons.
%patch1
%build
+%if %{?fedora}%{!?fedora:0} >= 28
+%cmake . -DCMAKE_INSTALL_PREFIX=/ -DRUN_ONLY_STANDALONE_TESTS=ON -DBUILD_TESTS=OFF -DBUILD_MEMCACHE=OFF
+%else
%cmake . -DCMAKE_INSTALL_PREFIX=/ -DRUN_ONLY_STANDALONE_TESTS=ON -DBUILD_TESTS=OFF
+%endif
make %{?_smp_mflags}
make doc
@@ -535,9 +539,11 @@ rm -rf %{buildroot}
%files plugins-memcache
%defattr(-,root,root,-)
+%if %{?fedora}%{!?fedora:0} < 28
%{_libdir}/dmlite/plugin_memcache.so
%doc LICENSE README RELEASE-NOTES
%config(noreplace) %{_sysconfdir}/dmlite.conf.d/zmemcache.conf
+%endif
%files plugins-profiler
%defattr(-,root,root,-)
commit e83c2ad60326a65a15af23b3756ed1c50e4ec241
Author: andreamanzi <andrea.manzi(a)gmail.com>
Date: Mon Jan 8 10:05:14 2018 +0100
enable arch s390x
diff --git a/dmlite.spec b/dmlite.spec
index afd1bb9..51d36ca 100644
--- a/dmlite.spec
+++ b/dmlite.spec
@@ -18,7 +18,7 @@
Name: dmlite
Version: 0.8.8
-Release: 5%{?dist}
+Release: 6%{?dist}
Summary: Lcgdm grid data management and storage framework
Group: Applications/Internet
License: ASL 2.0
@@ -32,7 +32,6 @@ Source0: %{name}-%{version}.tar.gz
Patch0: patch_memcache_fix.patch
Patch1: %{name}-shell-location.patch
Buildroot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
-ExcludeArch: s390x
%if %{?fedora}%{!?fedora:0} >= 17 || %{?rhel}%{!?rhel:0} >= 7
BuildRequires: boost-devel >= 1.48.0
%else
commit 00b9325328390966feac7a5f3d9dfa4010c4a97b
Author: andreamanzi <andrea.manzi(a)gmail.com>
Date: Thu Dec 21 16:16:15 2017 +0100
exclude arch s390x
diff --git a/dmlite.spec b/dmlite.spec
index 270df64..afd1bb9 100644
--- a/dmlite.spec
+++ b/dmlite.spec
@@ -32,7 +32,7 @@ Source0: %{name}-%{version}.tar.gz
Patch0: patch_memcache_fix.patch
Patch1: %{name}-shell-location.patch
Buildroot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
-
+ExcludeArch: s390x
%if %{?fedora}%{!?fedora:0} >= 17 || %{?rhel}%{!?rhel:0} >= 7
BuildRequires: boost-devel >= 1.48.0
%else
commit 438f2aabc42b0c3ab83e21cab625b3247bcf1dd6
Author: Igor Gnatenko <ignatenko(a)redhat.com>
Date: Wed Nov 29 12:08:37 2017 +0100
Rebuild for protobuf 3.5
Signed-off-by: Igor Gnatenko <ignatenko(a)redhat.com>
diff --git a/dmlite.spec b/dmlite.spec
index ca08a48..270df64 100644
--- a/dmlite.spec
+++ b/dmlite.spec
@@ -18,7 +18,7 @@
Name: dmlite
Version: 0.8.8
-Release: 4%{?dist}
+Release: 5%{?dist}
Summary: Lcgdm grid data management and storage framework
Group: Applications/Internet
License: ASL 2.0
@@ -577,6 +577,9 @@ rm -rf %{buildroot}
%config(noreplace) %{_sysconfdir}/dmlite.conf.d/domeadapter.example
%changelog
+* Wed Nov 29 2017 Igor Gnatenko <ignatenko(a)redhat.com> - 0.8.8-5
+- Rebuild for protobuf 3.5
+
* Tue Nov 14 2017 Andrea Manzi <amanzi(a)cern.ch> - 0.8.8-4
- new version to fix build with rawhide
commit 5c8db6294976cd9bd3e942e3ce1f8a2ce3c36355
Author: andreamanzi <andrea.manzi(a)gmail.com>
Date: Tue Nov 14 14:17:14 2017 +0100
fix for rahwide build
diff --git a/dmlite.spec b/dmlite.spec
index b130e6a..ca08a48 100644
--- a/dmlite.spec
+++ b/dmlite.spec
@@ -18,7 +18,7 @@
Name: dmlite
Version: 0.8.8
-Release: 3%{?dist}
+Release: 4%{?dist}
Summary: Lcgdm grid data management and storage framework
Group: Applications/Internet
License: ASL 2.0
@@ -394,7 +394,7 @@ dome and does not depend on the old LcgDM DPNS and DPM daemons.
%patch1
%build
-%cmake . -DCMAKE_INSTALL_PREFIX=/ -DRUN_ONLY_STANDALONE_TESTS=ON #-DBUILD_CPP11=%{cpp11}
+%cmake . -DCMAKE_INSTALL_PREFIX=/ -DRUN_ONLY_STANDALONE_TESTS=ON -DBUILD_TESTS=OFF
make %{?_smp_mflags}
make doc
@@ -577,6 +577,9 @@ rm -rf %{buildroot}
%config(noreplace) %{_sysconfdir}/dmlite.conf.d/domeadapter.example
%changelog
+* Tue Nov 14 2017 Andrea Manzi <amanzi(a)cern.ch> - 0.8.8-4
+- new version to fix build with rawhide
+
* Mon Nov 13 2017 Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> - 0.8.8-3
- Rebuild for protobuf 3.4
diff --git a/sources b/sources
index e481b2f..c6ede78 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-SHA512 (dmlite-0.8.8.tar.gz) = bed56f4673266fccb316709d5d9aaed789545abed7f6390d3a2ec15d41ec04c6ee7d917d03804a778ffbe7c511185346407618f37e4f3cf66562e90276fd1211
+SHA512 (dmlite-0.8.8.tar.gz) = 3056970178309900fb64aa29c97c30d053a0df94c800713dc8d04e167158be80bcd0b6b8b5a9098b7b38a3b62f6c1d74ea106e071179b0ac6a9d5acd62a9aac8
commit d325c40e2e290f8b0cb375f265190b385fab60df
Author: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org>
Date: Mon Nov 13 23:27:41 2017 +0100
Rebuild for protobuf 3.4
Signed-off-by: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org>
diff --git a/dmlite.spec b/dmlite.spec
index c1a08fc..b130e6a 100644
--- a/dmlite.spec
+++ b/dmlite.spec
@@ -18,7 +18,7 @@
Name: dmlite
Version: 0.8.8
-Release: 2%{?dist}
+Release: 3%{?dist}
Summary: Lcgdm grid data management and storage framework
Group: Applications/Internet
License: ASL 2.0
@@ -577,6 +577,9 @@ rm -rf %{buildroot}
%config(noreplace) %{_sysconfdir}/dmlite.conf.d/domeadapter.example
%changelog
+* Mon Nov 13 2017 Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> - 0.8.8-3
+- Rebuild for protobuf 3.4
+
* Thu Sep 21 2017 Andrea Manzi <amanzi(a)cern.ch> - 0.8.8-2
- change mysql-devel to mariadb-connector-c-devel
commit b976a35d12b643ae61bf448cb008a83e8d50a22a
Author: andreamanzi <andrea.manzi(a)gmail.com>
Date: Thu Sep 21 11:21:38 2017 +0200
new sources
diff --git a/sources b/sources
index 0685e7f..e481b2f 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-SHA512 (dmlite-0.8.7.tar.gz) = 25f317b01606d999fda694c24fe1467bc8ff3f464b47b40333845fd850064fcb5ff186d5da2f5a0f2024bf5ae21b12c04b3636c3dbf82459dfaa9dcd55eadcb6
+SHA512 (dmlite-0.8.8.tar.gz) = bed56f4673266fccb316709d5d9aaed789545abed7f6390d3a2ec15d41ec04c6ee7d917d03804a778ffbe7c511185346407618f37e4f3cf66562e90276fd1211
commit 29fc593d6e79e885796501eb783a163eae441eab
Author: andreamanzi <andrea.manzi(a)gmail.com>
Date: Thu Sep 21 11:15:23 2017 +0200
move to mariadb-connector-c-devel
diff --git a/dmlite.spec b/dmlite.spec
index 8bac00c..c1a08fc 100644
--- a/dmlite.spec
+++ b/dmlite.spec
@@ -17,8 +17,8 @@
%endif
Name: dmlite
-Version: 0.8.7
-Release: 6%{?dist}
+Version: 0.8.8
+Release: 2%{?dist}
Summary: Lcgdm grid data management and storage framework
Group: Applications/Internet
License: ASL 2.0
@@ -52,7 +52,7 @@ BuildRequires: zlib-devel
BuildRequires: dpm-devel
BuildRequires: lcgdm-devel
BuildRequires: libmemcached-devel
-BuildRequires: mysql-devel
+BuildRequires: mariadb-connector-c-devel
BuildRequires: protobuf-devel
BuildRequires: davix-devel >= 0.6.5
BuildRequires: fcgi-devel
@@ -577,6 +577,9 @@ rm -rf %{buildroot}
%config(noreplace) %{_sysconfdir}/dmlite.conf.d/domeadapter.example
%changelog
+* Thu Sep 21 2017 Andrea Manzi <amanzi(a)cern.ch> - 0.8.8-2
+- change mysql-devel to mariadb-connector-c-devel
+
* Sat Aug 19 2017 Zbigniew Jędrzejewski-Szmek <zbyszek(a)in.waw.pl> - 0.8.7-6
- Python 2 binary package renamed to python2-dmlite
See https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3
commit 254e7f5b310b02f1a421eaf1b0482e43b498984d
Author: Zbigniew Jędrzejewski-Szmek <zbyszek(a)in.waw.pl>
Date: Sat Aug 19 09:38:13 2017 -0400
Python 2 binary package renamed to python2-dmlite
diff --git a/dmlite.spec b/dmlite.spec
index e5ed61b..8bac00c 100644
--- a/dmlite.spec
+++ b/dmlite.spec
@@ -18,7 +18,7 @@
Name: dmlite
Version: 0.8.7
-Release: 5%{?dist}
+Release: 6%{?dist}
Summary: Lcgdm grid data management and storage framework
Group: Applications/Internet
License: ASL 2.0
@@ -281,11 +281,12 @@ Tool that is useful to test the main features of a DPM setup
-%package -n python-dmlite
+%package -n python2-dmlite
+%{?python_provide:%python_provide python2-dmlite}
Summary: Python wrapper for dmlite
Group: Development/Libraries
-%description -n python-dmlite
+%description -n python2-dmlite
This package provides a python wrapper for dmlite.
%package test
@@ -521,7 +522,7 @@ rm -rf %{buildroot}
%{_mandir}/man3/*
%{_defaultdocdir}/%{name}-%{version}
-%files -n python-dmlite
+%files -n python2-dmlite
%defattr(-,root,root,-)
%{python_sitearch}/pydmlite.so
@@ -576,6 +577,10 @@ rm -rf %{buildroot}
%config(noreplace) %{_sysconfdir}/dmlite.conf.d/domeadapter.example
%changelog
+* Sat Aug 19 2017 Zbigniew Jędrzejewski-Szmek <zbyszek(a)in.waw.pl> - 0.8.7-6
+- Python 2 binary package renamed to python2-dmlite
+ See https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3
+
* Wed Aug 02 2017 Fedora Release Engineering <releng(a)fedoraproject.org> - 0.8.7-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild
commit 3c6b32afd6eace921686618f48e730f92740f70e
Author: Fedora Release Engineering <releng(a)fedoraproject.org>
Date: Wed Aug 2 19:39:40 2017 +0000
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild
diff --git a/dmlite.spec b/dmlite.spec
index 4572e61..e5ed61b 100644
--- a/dmlite.spec
+++ b/dmlite.spec
@@ -18,7 +18,7 @@
Name: dmlite
Version: 0.8.7
-Release: 4%{?dist}
+Release: 5%{?dist}
Summary: Lcgdm grid data management and storage framework
Group: Applications/Internet
License: ASL 2.0
@@ -576,6 +576,9 @@ rm -rf %{buildroot}
%config(noreplace) %{_sysconfdir}/dmlite.conf.d/domeadapter.example
%changelog
+* Wed Aug 02 2017 Fedora Release Engineering <releng(a)fedoraproject.org> - 0.8.7-5
+- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild
+
* Wed Jul 26 2017 Fedora Release Engineering <releng(a)fedoraproject.org> - 0.8.7-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
commit 7e4c35c8ff9c1cc56699970d06992c830c6c395b
Author: Fedora Release Engineering <releng(a)fedoraproject.org>
Date: Wed Jul 26 06:19:43 2017 +0000
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
diff --git a/dmlite.spec b/dmlite.spec
index e06cf29..4572e61 100644
--- a/dmlite.spec
+++ b/dmlite.spec
@@ -18,7 +18,7 @@
Name: dmlite
Version: 0.8.7
-Release: 3%{?dist}
+Release: 4%{?dist}
Summary: Lcgdm grid data management and storage framework
Group: Applications/Internet
License: ASL 2.0
@@ -576,6 +576,9 @@ rm -rf %{buildroot}
%config(noreplace) %{_sysconfdir}/dmlite.conf.d/domeadapter.example
%changelog
+* Wed Jul 26 2017 Fedora Release Engineering <releng(a)fedoraproject.org> - 0.8.7-4
+- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
+
* Mon Jul 24 2017 Björn Esser <besser82(a)fedoraproject.org> - 0.8.7-3
- Rebuilt for Boost 1.64
commit 689bdb38ae33472d92548805705981ae96d02d6a
Author: Björn Esser <besser82(a)fedoraproject.org>
Date: Mon Jul 24 14:21:48 2017 +0200
Rebuilt for Boost 1.64
diff --git a/dmlite.spec b/dmlite.spec
index 11783a4..e06cf29 100644
--- a/dmlite.spec
+++ b/dmlite.spec
@@ -18,7 +18,7 @@
Name: dmlite
Version: 0.8.7
-Release: 2%{?dist}
+Release: 3%{?dist}
Summary: Lcgdm grid data management and storage framework
Group: Applications/Internet
License: ASL 2.0
@@ -576,6 +576,9 @@ rm -rf %{buildroot}
%config(noreplace) %{_sysconfdir}/dmlite.conf.d/domeadapter.example
%changelog
+* Mon Jul 24 2017 Björn Esser <besser82(a)fedoraproject.org> - 0.8.7-3
+- Rebuilt for Boost 1.64
+
* Wed Jun 28 2017 Andrea Manzi <amanzi(a)cern.ch> - 0.8.7-1
- New upstream release
commit 585ab5a2ca2d01d6e116c601eae1e3020c90af37
Author: andreamanzi <andrea.manzi(a)gmail.com>
Date: Tue Jul 11 17:56:29 2017 +0200
remove argparse on f27
diff --git a/dmlite.spec b/dmlite.spec
index ff9d5e5..11783a4 100644
--- a/dmlite.spec
+++ b/dmlite.spec
@@ -18,7 +18,7 @@
Name: dmlite
Version: 0.8.7
-Release: 1%{?dist}
+Release: 2%{?dist}
Summary: Lcgdm grid data management and storage framework
Group: Applications/Internet
License: ASL 2.0
@@ -268,7 +268,6 @@ Summary: The dpm tester tool
Group: Applications/Internet
Requires: python
Requires: gfal2-python
-Requires: python-argparse
Requires: gfal2-plugin-http
Requires: gfal2-plugin-xrootd
Requires: gfal2-plugin-srm
commit 3d2c2738e70d6a370367b60549973f233976c4fb
Author: andreamanzi <andrea.manzi(a)gmail.com>
Date: Mon Jul 10 16:52:54 2017 +0200
disable tests to fix build for cppunit
diff --git a/sources b/sources
index dc59d4c..0685e7f 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-SHA512 (dmlite-0.8.7.tar.gz) = 612939d97e8829c432bb75fb3937a118fd25fecee9a2e191d06f3bd1f4b884065a1a5a388e5647b0a5ae668fa1a96b08f0a70a9abe8273599419ddfc35969de9
+SHA512 (dmlite-0.8.7.tar.gz) = 25f317b01606d999fda694c24fe1467bc8ff3f464b47b40333845fd850064fcb5ff186d5da2f5a0f2024bf5ae21b12c04b3636c3dbf82459dfaa9dcd55eadcb6
commit 58e2e472f1c09f0750cfea37a81a18135bca75c7
Author: andreamanzi <andrea.manzi(a)gmail.com>
Date: Mon Jul 10 16:38:30 2017 +0200
disable tests to fix build for cppunit
diff --git a/sources b/sources
index cfbb51d..dc59d4c 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-SHA512 (dmlite-0.8.7.tar.gz) = d596a553556fcecf998a3b92eb83dcff0ea4c67ed98cc6e2ee6b1eed277d9eb5daf00b23b098b8eb148fd4aaed356a6a757219cf208c4fc5c10fc2efab59bd08
+SHA512 (dmlite-0.8.7.tar.gz) = 612939d97e8829c432bb75fb3937a118fd25fecee9a2e191d06f3bd1f4b884065a1a5a388e5647b0a5ae668fa1a96b08f0a70a9abe8273599419ddfc35969de9
commit c269e56b704f9d78d1e38973bbab8a97b985de91
Author: andreamanzi <andrea.manzi(a)gmail.com>
Date: Mon Jul 10 16:09:03 2017 +0200
disable tests to fix build for cppunit
diff --git a/sources b/sources
index b3fe55b..cfbb51d 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-SHA512 (dmlite-0.8.7.tar.gz) = 9c23ddb22fa7f90c73264c293d354bd81c1145562226c67baac718da737b36ab9205f5ee11e0aee098325906291ac866d15b654a7dde50bcda0db5ab2b7ba134
+SHA512 (dmlite-0.8.7.tar.gz) = d596a553556fcecf998a3b92eb83dcff0ea4c67ed98cc6e2ee6b1eed277d9eb5daf00b23b098b8eb148fd4aaed356a6a757219cf208c4fc5c10fc2efab59bd08
6 years, 4 months
Architecture specific change in rpms/dmlite.git
by githook-noreply@fedoraproject.org
The package rpms/dmlite.git has added or updated architecture specific content in its
spec file (ExclusiveArch/ExcludeArch or %ifarch/%ifnarch) in commit(s):
https://src.fedoraproject.org/cgit/rpms/dmlite.git/commit/?id=00b93253283...
https://src.fedoraproject.org/cgit/rpms/dmlite.git/commit/?id=e83c2ad6032....
Change:
+ExcludeArch: s390x
-ExcludeArch: s390x
Thanks.
Full change:
============
commit 6743b5f3fe972612d7a4fb5dce23209233dc94c0
Author: andreamanzi <andrea.manzi(a)gmail.com>
Date: Tue Feb 20 18:33:50 2018 +0100
new upstream release
diff --git a/dmlite.spec b/dmlite.spec
index 60da0e2..583e172 100644
--- a/dmlite.spec
+++ b/dmlite.spec
@@ -489,6 +489,7 @@ rm -rf %{buildroot}/%{_libdir}/dmlite/test
%files dome
%defattr(-,root,root,-)
%{_bindir}/dome-checksum
+%{_libdir}/libdome*.so
%files devel
%defattr(-,root,root,-)
commit de4ed211be25b15162fc8537a8ea8840ac100851
Author: andreamanzi <andrea.manzi(a)gmail.com>
Date: Tue Feb 20 18:09:37 2018 +0100
new upstream release
diff --git a/dmlite.spec b/dmlite.spec
index 8444e7c..60da0e2 100644
--- a/dmlite.spec
+++ b/dmlite.spec
@@ -571,7 +571,7 @@ rm -rf %{buildroot}/%{_libdir}/dmlite/test
%defattr(-,root,root,-)
%{_libdir}/dmlite/plugin_domeadapter.so
%doc LICENSE README RELEASE-NOTES
-%config(noreplace) %{_sysconfdir}/dmlite.conf.d/domeadapter.example
+%config(noreplace) %{_sysconfdir}/dmlite.conf.d/domeadapter.conf
%changelog
* Fri Feb 16 2018 Andrea Manzi <amanzi(a)cern.ch> - 1.10.0-1
commit 51b1758a19f8329373a575c4c27bb4fe40a71f0c
Author: andreamanzi <andrea.manzi(a)gmail.com>
Date: Tue Feb 20 17:51:05 2018 +0100
new upstream release
diff --git a/dmlite.spec b/dmlite.spec
index 4f4d9fe..8444e7c 100644
--- a/dmlite.spec
+++ b/dmlite.spec
@@ -551,7 +551,7 @@ rm -rf %{buildroot}/%{_libdir}/dmlite/test
%{_bindir}/dmlite-mysql-dirspaces.pyc
%{_bindir}/dmlite-mysql-dirspaces.pyo
%endif
-%{python_sitearch}/dmliteshell
+%{python_sitelib}/dmliteshell
%doc LICENSE README RELEASE-NOTES
commit d50236c8bb422dafdf25eb643cbb0c6b92e9733e
Author: andreamanzi <andrea.manzi(a)gmail.com>
Date: Tue Feb 20 17:40:28 2018 +0100
new upstream release
diff --git a/sources b/sources
index 1f1dcf1..3934fd7 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-SHA512 (dmlite-1.10.0.tar.gz) = d27d2fe84ed9dca60ad3beb8e90959f8b9a53d69bf31e25dcece196d8bc392528733a72f7c037d99c766199c27982167a1ae975c40cac78b70cf2ed440ee24f0
+SHA512 (dmlite-1.10.0.tar.gz) = f4241fb68f5c85c8e084aa6ea4b3adb08cf263d52679deeec5368f194bd82fc53a38ec5be0dc1078903a7ad1c2c385c5b8536937803b0d4d0d82174b129730d5
commit 6697d12fd770b12bf6dcf1e94318cf0a397890c3
Author: andreamanzi <andrea.manzi(a)gmail.com>
Date: Tue Feb 20 17:28:17 2018 +0100
new upstream release
diff --git a/dmlite.spec b/dmlite.spec
index 7675a8f..4f4d9fe 100644
--- a/dmlite.spec
+++ b/dmlite.spec
@@ -401,9 +401,9 @@ dome and does not depend on the old LcgDM DPNS and DPM daemons.
%build
%if %{?fedora}%{!?fedora:0} >= 28
-%cmake . -DCMAKE_INSTALL_PREFIX=/ -DRUN_ONLY_STANDALONE_TESTS=ON -DBUILD_TESTS=OFF -DBUILD_MEMCACHE=OFF
+%cmake . -DCMAKE_INSTALL_PREFIX=/ -DRUN_ONLY_STANDALONE_TESTS=ON -DOVERWRITE_CONFIGFILES=ON -DBUILD_TESTS=OFF -DBUILD_MEMCACHE=OFF
%else
-%cmake . -DCMAKE_INSTALL_PREFIX=/ -DRUN_ONLY_STANDALONE_TESTS=ON -DBUILD_TESTS=OFF
+%cmake . -DCMAKE_INSTALL_PREFIX=/ -DRUN_ONLY_STANDALONE_TESTS=ON -DOVERWRITE_CONFIGFILES=ON -DBUILD_TESTS=OFF
%endif
make %{?_smp_mflags}
commit 40081ceee7fd7cdef24c02885df8c811260ad7d6
Author: andreamanzi <andrea.manzi(a)gmail.com>
Date: Fri Feb 16 15:21:44 2018 +0100
fix
diff --git a/dmlite.spec b/dmlite.spec
index 6ab7ca5..7675a8f 100644
--- a/dmlite.spec
+++ b/dmlite.spec
@@ -455,13 +455,13 @@ rm -rf %{buildroot}/%{_libdir}/dmlite/test
/sbin/ldconfig
/sbin/service rsyslog condrestart || true
-%files dpmhead-dome
+%files dpmhead-domeonly
%defattr(-,root,root,-)
%{_prefix}/share/dmlite/dbscripts
%{_prefix}/share/dmlite/filepull
-%files dpmdisk-dome
+%files dpmdisk-domeonly
%defattr(-,root,root,-)
%{_prefix}/share/dmlite/filepull
commit af72f0ebaf9bdeeb4fce5fce27ec776a5eb9eb6d
Author: andreamanzi <andrea.manzi(a)gmail.com>
Date: Fri Feb 16 15:20:22 2018 +0100
new upstream release
diff --git a/dmlite.spec b/dmlite.spec
index 4978f5d..6ab7ca5 100644
--- a/dmlite.spec
+++ b/dmlite.spec
@@ -17,8 +17,8 @@
%endif
Name: dmlite
-Version: 0.8.8
-Release: 7%{?dist}
+Version: 1.10.0
+Release: 1%{?dist}
Summary: Lcgdm grid data management and storage framework
Group: Applications/Internet
License: ASL 2.0
@@ -51,9 +51,13 @@ BuildRequires: zlib-devel
BuildRequires: dpm-devel
BuildRequires: lcgdm-devel
BuildRequires: libmemcached-devel
-BuildRequires: mariadb-connector-c-devel
+%if %{?fedora}%{!?fedora:0} >= 28
+BuildRequires: mariadb-connector-c-devel
+%else
+BuildRequires: mysql-devel
+%endif
BuildRequires: protobuf-devel
-BuildRequires: davix-devel >= 0.6.5
+BuildRequires: davix-devel >= 0.6.7
BuildRequires: fcgi-devel
%description
@@ -85,7 +89,7 @@ Requires: fetch-crl
Requires: finger
Requires: lcgdm-dav
Requires: lcgdm-dav-server
-Requires: davix >= 0.6.5
+Requires: davix >= 0.6.7
Obsoletes: emi-dpm_mysql
@@ -115,7 +119,7 @@ Requires: fetch-crl
Requires: finger
Requires: lcgdm-dav
Requires: lcgdm-dav-server
-Requires: davix >= 0.6.5
+Requires: davix >= 0.6.7
Obsoletes: emi-dpm_disk
@@ -127,7 +131,7 @@ This is a virtual package providing all required daemons for a DPM
Disk Node.
-%package dpmhead-dome
+%package dpmhead-domeonly
Summary: DPM Head Node (MySQL)
Group: Applications/Internet
Requires: bdii
@@ -142,7 +146,8 @@ Requires: fetch-crl
Requires: finger
Requires: lcgdm-dav
Requires: lcgdm-dav-server
-Requires: davix >= 0.6.5
+Requires: davix >= 0.6.7
+Requires: xrootd >= 1:4.8.1
Obsoletes: emi-dpm_mysql
Obsoletes: dpmhead
@@ -155,13 +160,13 @@ Conflicts: dpm-server-mysql%{?_isa}
Conflicts: dpm-srm-server-mysql%{?_isa}
Conflicts: dmlite-plugins-adapter
-%description dpmhead-dome
+%description dpmhead-domeonly
The Disk Pool Manager (DPM) creates a Grid storage element from a set
of disk servers. It provides several interfaces for storing and retrieving
data such as HTTP, Xrootd, GridFTP
This is a metapackage providing all required daemons for a DPM Head Node.
-%package dpmdisk-dome
+%package dpmdisk-domeonly
Summary: DPM Disk Node
Group: Applications/Internet
@@ -174,7 +179,7 @@ Requires: fetch-crl
Requires: finger
Requires: lcgdm-dav
Requires: lcgdm-dav-server
-Requires: davix >= 0.6.5
+Requires: davix >= 0.6.7
Obsoletes: emi-dpm_disk
Obsoletes: dpmdisk
@@ -184,7 +189,7 @@ Conflicts: dpm-perl%{?_isa}
Conflicts: dpm-rfio-server%{?_isa}
Conflicts: dmlite-plugins-adapter = %{version}
-%description dpmdisk-dome
+%description dpmdisk-domeonly
The Disk Pool Manager (DPM) creates a Grid storage element from a set
of disk servers. It provides several interfaces for storing and retrieving
data such as HTTP, Xrootd, GridFTP
@@ -220,9 +225,10 @@ This package provides the core libraries used by dmlite.
Summary: The dome daemon
Group: Applications/Internet
Requires: httpd
-%if %systemd == 0
-Requires: mod_proxy_fcgi
-%endif
+Requires: xrootd >= 1:4.8.1
+BuildRequires: xrootd-devel >= 1:4.8.1
+BuildRequires: xrootd-server-devel >= 1:4.8.1
+BuildRequires: xrootd-private-devel >= 1:4.8.1
%description dome
This package provides the binaries necessary to run the dome daemon.
@@ -266,12 +272,13 @@ dmlite plugins only, no API compatibility is guaranteed on these headers.
Summary: The dpm tester tool
Group: Applications/Internet
Requires: python
+Requires: python-argparse
Requires: gfal2-python
Requires: gfal2-plugin-http
Requires: gfal2-plugin-xrootd
Requires: gfal2-plugin-srm
Requires: gfal2-plugin-gridftp
-
+Requires: gfal2-plugin-file
%description dpm-tester
Tool that is useful to test the main features of a DPM setup
@@ -428,15 +435,6 @@ make install DESTDIR=%{buildroot}
rm -rf %{buildroot}/%{_libdir}/dmlite/test
%endif
-%post dome
-%if %systemd
- /bin/systemctl try-restart domehead.service || true
- /bin/systemctl try-restart domedisk.service || true
-%else
- /sbin/service domehead condrestart || true
- /sbin/service domedisk condrestart || true
-%endif
-
%post libs
/sbin/ldconfig
/sbin/service rsyslog condrestart || true
@@ -490,17 +488,7 @@ rm -rf %{buildroot}/%{_libdir}/dmlite/test
%files dome
%defattr(-,root,root,-)
-%dir %{_localstatedir}/www/fcgi-bin
%{_bindir}/dome-checksum
-%if %systemd
-/usr/lib/systemd/system/domehead.service
-/usr/lib/systemd/system/domedisk.service
-%else
-%{_sysconfdir}/rc.d/init.d/domehead
-%{_sysconfdir}/rc.d/init.d/domedisk
-%endif
-
-%{_localstatedir}/www/fcgi-bin/dome
%files devel
%defattr(-,root,root,-)
@@ -556,10 +544,17 @@ rm -rf %{buildroot}/%{_libdir}/dmlite/test
%files shell
%defattr(-,root,root,-)
-%{_bindir}/*
-%{python_sitelib}/dmliteshell
+%{_bindir}/dmlite-shell
+%{_bindir}/dpm-storage-summary.py
+%{_bindir}/dmlite-mysql-dirspaces.py
+%if %{?rhel}%{!?rhel:99} <= 5
+%{_bindir}/dmlite-mysql-dirspaces.pyc
+%{_bindir}/dmlite-mysql-dirspaces.pyo
+%endif
+%{python_sitearch}/dmliteshell
%doc LICENSE README RELEASE-NOTES
+
%files plugins-mysql
%defattr(-,root,root,-)
%{_libdir}/dmlite/plugin_mysql.so
@@ -579,6 +574,9 @@ rm -rf %{buildroot}/%{_libdir}/dmlite/test
%config(noreplace) %{_sysconfdir}/dmlite.conf.d/domeadapter.example
%changelog
+* Fri Feb 16 2018 Andrea Manzi <amanzi(a)cern.ch> - 1.10.0-1
+- new upstream release
+
* Wed Feb 07 2018 Fedora Release Engineering <releng(a)fedoraproject.org> - 0.8.8-7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
diff --git a/sources b/sources
index c6ede78..1f1dcf1 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-SHA512 (dmlite-0.8.8.tar.gz) = 3056970178309900fb64aa29c97c30d053a0df94c800713dc8d04e167158be80bcd0b6b8b5a9098b7b38a3b62f6c1d74ea106e071179b0ac6a9d5acd62a9aac8
+SHA512 (dmlite-1.10.0.tar.gz) = d27d2fe84ed9dca60ad3beb8e90959f8b9a53d69bf31e25dcece196d8bc392528733a72f7c037d99c766199c27982167a1ae975c40cac78b70cf2ed440ee24f0
commit bbce88e2bc1d4337b8d9e8cad5fd83c298971995
Author: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org>
Date: Wed Feb 14 07:06:23 2018 +0100
Remove %clean section
None of currently supported distributions need that.
Last one was EL5 which is EOL for a while.
Signed-off-by: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org>
diff --git a/dmlite.spec b/dmlite.spec
index 06cc326..4978f5d 100644
--- a/dmlite.spec
+++ b/dmlite.spec
@@ -428,9 +428,6 @@ make install DESTDIR=%{buildroot}
rm -rf %{buildroot}/%{_libdir}/dmlite/test
%endif
-%clean
-rm -rf %{buildroot}
-
%post dome
%if %systemd
/bin/systemctl try-restart domehead.service || true
commit ec3d656addf06e622e1481d8cc4c99368ed9b16a
Author: Fedora Release Engineering <releng(a)fedoraproject.org>
Date: Wed Feb 7 07:00:36 2018 +0000
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng(a)fedoraproject.org>
diff --git a/dmlite.spec b/dmlite.spec
index e38e25a..06cc326 100644
--- a/dmlite.spec
+++ b/dmlite.spec
@@ -18,7 +18,7 @@
Name: dmlite
Version: 0.8.8
-Release: 6%{?dist}
+Release: 7%{?dist}
Summary: Lcgdm grid data management and storage framework
Group: Applications/Internet
License: ASL 2.0
@@ -582,6 +582,9 @@ rm -rf %{buildroot}
%config(noreplace) %{_sysconfdir}/dmlite.conf.d/domeadapter.example
%changelog
+* Wed Feb 07 2018 Fedora Release Engineering <releng(a)fedoraproject.org> - 0.8.8-7
+- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
+
* Wed Nov 29 2017 Igor Gnatenko <ignatenko(a)redhat.com> - 0.8.8-5
- Rebuild for protobuf 3.5
commit 54b63be1a7f9542c0373989b800d08c45bbd3afa
Author: andreamanzi <andrea.manzi(a)gmail.com>
Date: Mon Jan 8 10:49:38 2018 +0100
disable memcache on rawhide
diff --git a/dmlite.spec b/dmlite.spec
index 51d36ca..e38e25a 100644
--- a/dmlite.spec
+++ b/dmlite.spec
@@ -393,7 +393,11 @@ dome and does not depend on the old LcgDM DPNS and DPM daemons.
%patch1
%build
+%if %{?fedora}%{!?fedora:0} >= 28
+%cmake . -DCMAKE_INSTALL_PREFIX=/ -DRUN_ONLY_STANDALONE_TESTS=ON -DBUILD_TESTS=OFF -DBUILD_MEMCACHE=OFF
+%else
%cmake . -DCMAKE_INSTALL_PREFIX=/ -DRUN_ONLY_STANDALONE_TESTS=ON -DBUILD_TESTS=OFF
+%endif
make %{?_smp_mflags}
make doc
@@ -535,9 +539,11 @@ rm -rf %{buildroot}
%files plugins-memcache
%defattr(-,root,root,-)
+%if %{?fedora}%{!?fedora:0} < 28
%{_libdir}/dmlite/plugin_memcache.so
%doc LICENSE README RELEASE-NOTES
%config(noreplace) %{_sysconfdir}/dmlite.conf.d/zmemcache.conf
+%endif
%files plugins-profiler
%defattr(-,root,root,-)
commit e83c2ad60326a65a15af23b3756ed1c50e4ec241
Author: andreamanzi <andrea.manzi(a)gmail.com>
Date: Mon Jan 8 10:05:14 2018 +0100
enable arch s390x
diff --git a/dmlite.spec b/dmlite.spec
index afd1bb9..51d36ca 100644
--- a/dmlite.spec
+++ b/dmlite.spec
@@ -18,7 +18,7 @@
Name: dmlite
Version: 0.8.8
-Release: 5%{?dist}
+Release: 6%{?dist}
Summary: Lcgdm grid data management and storage framework
Group: Applications/Internet
License: ASL 2.0
@@ -32,7 +32,6 @@ Source0: %{name}-%{version}.tar.gz
Patch0: patch_memcache_fix.patch
Patch1: %{name}-shell-location.patch
Buildroot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
-ExcludeArch: s390x
%if %{?fedora}%{!?fedora:0} >= 17 || %{?rhel}%{!?rhel:0} >= 7
BuildRequires: boost-devel >= 1.48.0
%else
commit 00b9325328390966feac7a5f3d9dfa4010c4a97b
Author: andreamanzi <andrea.manzi(a)gmail.com>
Date: Thu Dec 21 16:16:15 2017 +0100
exclude arch s390x
diff --git a/dmlite.spec b/dmlite.spec
index 270df64..afd1bb9 100644
--- a/dmlite.spec
+++ b/dmlite.spec
@@ -32,7 +32,7 @@ Source0: %{name}-%{version}.tar.gz
Patch0: patch_memcache_fix.patch
Patch1: %{name}-shell-location.patch
Buildroot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
-
+ExcludeArch: s390x
%if %{?fedora}%{!?fedora:0} >= 17 || %{?rhel}%{!?rhel:0} >= 7
BuildRequires: boost-devel >= 1.48.0
%else
commit 438f2aabc42b0c3ab83e21cab625b3247bcf1dd6
Author: Igor Gnatenko <ignatenko(a)redhat.com>
Date: Wed Nov 29 12:08:37 2017 +0100
Rebuild for protobuf 3.5
Signed-off-by: Igor Gnatenko <ignatenko(a)redhat.com>
diff --git a/dmlite.spec b/dmlite.spec
index ca08a48..270df64 100644
--- a/dmlite.spec
+++ b/dmlite.spec
@@ -18,7 +18,7 @@
Name: dmlite
Version: 0.8.8
-Release: 4%{?dist}
+Release: 5%{?dist}
Summary: Lcgdm grid data management and storage framework
Group: Applications/Internet
License: ASL 2.0
@@ -577,6 +577,9 @@ rm -rf %{buildroot}
%config(noreplace) %{_sysconfdir}/dmlite.conf.d/domeadapter.example
%changelog
+* Wed Nov 29 2017 Igor Gnatenko <ignatenko(a)redhat.com> - 0.8.8-5
+- Rebuild for protobuf 3.5
+
* Tue Nov 14 2017 Andrea Manzi <amanzi(a)cern.ch> - 0.8.8-4
- new version to fix build with rawhide
commit 5c8db6294976cd9bd3e942e3ce1f8a2ce3c36355
Author: andreamanzi <andrea.manzi(a)gmail.com>
Date: Tue Nov 14 14:17:14 2017 +0100
fix for rahwide build
diff --git a/dmlite.spec b/dmlite.spec
index b130e6a..ca08a48 100644
--- a/dmlite.spec
+++ b/dmlite.spec
@@ -18,7 +18,7 @@
Name: dmlite
Version: 0.8.8
-Release: 3%{?dist}
+Release: 4%{?dist}
Summary: Lcgdm grid data management and storage framework
Group: Applications/Internet
License: ASL 2.0
@@ -394,7 +394,7 @@ dome and does not depend on the old LcgDM DPNS and DPM daemons.
%patch1
%build
-%cmake . -DCMAKE_INSTALL_PREFIX=/ -DRUN_ONLY_STANDALONE_TESTS=ON #-DBUILD_CPP11=%{cpp11}
+%cmake . -DCMAKE_INSTALL_PREFIX=/ -DRUN_ONLY_STANDALONE_TESTS=ON -DBUILD_TESTS=OFF
make %{?_smp_mflags}
make doc
@@ -577,6 +577,9 @@ rm -rf %{buildroot}
%config(noreplace) %{_sysconfdir}/dmlite.conf.d/domeadapter.example
%changelog
+* Tue Nov 14 2017 Andrea Manzi <amanzi(a)cern.ch> - 0.8.8-4
+- new version to fix build with rawhide
+
* Mon Nov 13 2017 Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> - 0.8.8-3
- Rebuild for protobuf 3.4
diff --git a/sources b/sources
index e481b2f..c6ede78 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-SHA512 (dmlite-0.8.8.tar.gz) = bed56f4673266fccb316709d5d9aaed789545abed7f6390d3a2ec15d41ec04c6ee7d917d03804a778ffbe7c511185346407618f37e4f3cf66562e90276fd1211
+SHA512 (dmlite-0.8.8.tar.gz) = 3056970178309900fb64aa29c97c30d053a0df94c800713dc8d04e167158be80bcd0b6b8b5a9098b7b38a3b62f6c1d74ea106e071179b0ac6a9d5acd62a9aac8
commit d325c40e2e290f8b0cb375f265190b385fab60df
Author: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org>
Date: Mon Nov 13 23:27:41 2017 +0100
Rebuild for protobuf 3.4
Signed-off-by: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org>
diff --git a/dmlite.spec b/dmlite.spec
index c1a08fc..b130e6a 100644
--- a/dmlite.spec
+++ b/dmlite.spec
@@ -18,7 +18,7 @@
Name: dmlite
Version: 0.8.8
-Release: 2%{?dist}
+Release: 3%{?dist}
Summary: Lcgdm grid data management and storage framework
Group: Applications/Internet
License: ASL 2.0
@@ -577,6 +577,9 @@ rm -rf %{buildroot}
%config(noreplace) %{_sysconfdir}/dmlite.conf.d/domeadapter.example
%changelog
+* Mon Nov 13 2017 Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> - 0.8.8-3
+- Rebuild for protobuf 3.4
+
* Thu Sep 21 2017 Andrea Manzi <amanzi(a)cern.ch> - 0.8.8-2
- change mysql-devel to mariadb-connector-c-devel
commit b976a35d12b643ae61bf448cb008a83e8d50a22a
Author: andreamanzi <andrea.manzi(a)gmail.com>
Date: Thu Sep 21 11:21:38 2017 +0200
new sources
diff --git a/sources b/sources
index 0685e7f..e481b2f 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-SHA512 (dmlite-0.8.7.tar.gz) = 25f317b01606d999fda694c24fe1467bc8ff3f464b47b40333845fd850064fcb5ff186d5da2f5a0f2024bf5ae21b12c04b3636c3dbf82459dfaa9dcd55eadcb6
+SHA512 (dmlite-0.8.8.tar.gz) = bed56f4673266fccb316709d5d9aaed789545abed7f6390d3a2ec15d41ec04c6ee7d917d03804a778ffbe7c511185346407618f37e4f3cf66562e90276fd1211
commit 29fc593d6e79e885796501eb783a163eae441eab
Author: andreamanzi <andrea.manzi(a)gmail.com>
Date: Thu Sep 21 11:15:23 2017 +0200
move to mariadb-connector-c-devel
diff --git a/dmlite.spec b/dmlite.spec
index 8bac00c..c1a08fc 100644
--- a/dmlite.spec
+++ b/dmlite.spec
@@ -17,8 +17,8 @@
%endif
Name: dmlite
-Version: 0.8.7
-Release: 6%{?dist}
+Version: 0.8.8
+Release: 2%{?dist}
Summary: Lcgdm grid data management and storage framework
Group: Applications/Internet
License: ASL 2.0
@@ -52,7 +52,7 @@ BuildRequires: zlib-devel
BuildRequires: dpm-devel
BuildRequires: lcgdm-devel
BuildRequires: libmemcached-devel
-BuildRequires: mysql-devel
+BuildRequires: mariadb-connector-c-devel
BuildRequires: protobuf-devel
BuildRequires: davix-devel >= 0.6.5
BuildRequires: fcgi-devel
@@ -577,6 +577,9 @@ rm -rf %{buildroot}
%config(noreplace) %{_sysconfdir}/dmlite.conf.d/domeadapter.example
%changelog
+* Thu Sep 21 2017 Andrea Manzi <amanzi(a)cern.ch> - 0.8.8-2
+- change mysql-devel to mariadb-connector-c-devel
+
* Sat Aug 19 2017 Zbigniew Jędrzejewski-Szmek <zbyszek(a)in.waw.pl> - 0.8.7-6
- Python 2 binary package renamed to python2-dmlite
See https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3
commit 254e7f5b310b02f1a421eaf1b0482e43b498984d
Author: Zbigniew Jędrzejewski-Szmek <zbyszek(a)in.waw.pl>
Date: Sat Aug 19 09:38:13 2017 -0400
Python 2 binary package renamed to python2-dmlite
diff --git a/dmlite.spec b/dmlite.spec
index e5ed61b..8bac00c 100644
--- a/dmlite.spec
+++ b/dmlite.spec
@@ -18,7 +18,7 @@
Name: dmlite
Version: 0.8.7
-Release: 5%{?dist}
+Release: 6%{?dist}
Summary: Lcgdm grid data management and storage framework
Group: Applications/Internet
License: ASL 2.0
@@ -281,11 +281,12 @@ Tool that is useful to test the main features of a DPM setup
-%package -n python-dmlite
+%package -n python2-dmlite
+%{?python_provide:%python_provide python2-dmlite}
Summary: Python wrapper for dmlite
Group: Development/Libraries
-%description -n python-dmlite
+%description -n python2-dmlite
This package provides a python wrapper for dmlite.
%package test
@@ -521,7 +522,7 @@ rm -rf %{buildroot}
%{_mandir}/man3/*
%{_defaultdocdir}/%{name}-%{version}
-%files -n python-dmlite
+%files -n python2-dmlite
%defattr(-,root,root,-)
%{python_sitearch}/pydmlite.so
@@ -576,6 +577,10 @@ rm -rf %{buildroot}
%config(noreplace) %{_sysconfdir}/dmlite.conf.d/domeadapter.example
%changelog
+* Sat Aug 19 2017 Zbigniew Jędrzejewski-Szmek <zbyszek(a)in.waw.pl> - 0.8.7-6
+- Python 2 binary package renamed to python2-dmlite
+ See https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3
+
* Wed Aug 02 2017 Fedora Release Engineering <releng(a)fedoraproject.org> - 0.8.7-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild
6 years, 4 months
Architecture specific change in rpms/insight.git
by githook-noreply@fedoraproject.org
The package rpms/insight.git has added or updated architecture specific content in its
spec file (ExclusiveArch/ExcludeArch or %ifarch/%ifnarch) in commit(s):
https://src.fedoraproject.org/cgit/rpms/insight.git/commit/?id=53c380ae8f....
Change:
+%ifarch %{arm}
Thanks.
Full change:
============
commit 53c380ae8f834738c708fb03fe2754f228e10c3d
Author: Patrick Monnerat <patrick(a)monnerat.net>
Date: Tue Feb 20 19:56:02 2018 +0100
- New upstream release.
- Modernize spec file (BZ #1545189).
diff --git a/.gitignore b/.gitignore
index 80d07b6..c3c46c5 100644
--- a/.gitignore
+++ b/.gitignore
@@ -4,3 +4,4 @@ insight-6.8-1.tar.bz2
/insight-7.8.50.20140827.tar.bz2
/insight-7.10.50.20160208.tar.xz
/insight-7.12.50.20170416.tar.xz
+/insight-8.1.50.20180216.tar.xz
diff --git a/gdb-6.3-gstack-20050411.patch b/gdb-6.3-gstack-20050411.patch
index 1a4140e..3619504 100644
--- a/gdb-6.3-gstack-20050411.patch
+++ b/gdb-6.3-gstack-20050411.patch
@@ -1,14 +1,34 @@
+From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
+From: Andrew Cagney <cagney(a)gnu.org>
+Date: Fri, 27 Oct 2017 21:07:50 +0200
+Subject: gdb-6.3-gstack-20050411.patch
+
+FileName: gdb-6.3-gstack-20050411.patch
+
+;; Add a wrapper script to GDB that implements pstack using the
+;; --readnever option.
+;;=push
+
2004-11-23 Andrew Cagney <cagney(a)redhat.com>
* Makefile.in (uninstall-gstack, install-gstack): New rules, add
to install and uninstall.
* gstack.sh, gstack.1: New files.
+---
+ gdb/Makefile.in | 34 ++++++++++++++++++--
+ gdb/gstack.sh | 43 +++++++++++++++++++++++++
+ gdb/testsuite/gdb.base/gstack.c | 43 +++++++++++++++++++++++++
+ gdb/testsuite/gdb.base/gstack.exp | 66 +++++++++++++++++++++++++++++++++++++++
+ 4 files changed, 184 insertions(+), 2 deletions(-)
+ create mode 100644 gdb/gstack.sh
+ create mode 100644 gdb/testsuite/gdb.base/gstack.c
+ create mode 100644 gdb/testsuite/gdb.base/gstack.exp
-Index: gdb-7.7/gdb/Makefile.in
-===================================================================
---- gdb-7.7.orig/gdb/Makefile.in 2014-02-06 20:29:09.401214339 +0100
-+++ gdb-7.7/gdb/Makefile.in 2014-02-06 20:29:09.501214360 +0100
-@@ -1067,7 +1067,7 @@ info install-info clean-info dvi pdf ins
+diff --git a/gdb/Makefile.in b/gdb/Makefile.in
+index 17b71c6e7c..e77d6a5c03 100644
+--- a/gdb/Makefile.in
++++ b/gdb/Makefile.in
+@@ -1744,7 +1744,7 @@ info install-info clean-info dvi pdf install-pdf html install-html: force
install: all
@$(MAKE) $(FLAGS_TO_PASS) install-only
@@ -17,7 +37,7 @@ Index: gdb-7.7/gdb/Makefile.in
transformed_name=`t='$(program_transform_name)'; \
echo gdb | sed -e "$$t"` ; \
if test "x$$transformed_name" = x; then \
-@@ -1104,7 +1104,25 @@ install-strip:
+@@ -1784,7 +1784,25 @@ install-guile:
install-python:
$(SHELL) $(srcdir)/../mkinstalldirs $(DESTDIR)$(GDB_DATADIR)/python/gdb
@@ -44,7 +64,7 @@ Index: gdb-7.7/gdb/Makefile.in
transformed_name=`t='$(program_transform_name)'; \
echo gdb | sed -e $$t` ; \
if test "x$$transformed_name" = x; then \
-@@ -1127,6 +1145,18 @@ uninstall: force $(CONFIG_UNINSTALL)
+@@ -1807,6 +1825,18 @@ uninstall: force $(CONFIG_UNINSTALL)
fi
@$(MAKE) DO=uninstall "DODIRS=$(SUBDIRS)" $(FLAGS_TO_PASS) subdir_do
@@ -63,10 +83,11 @@ Index: gdb-7.7/gdb/Makefile.in
# The C++ name parser can be built standalone for testing.
test-cp-name-parser.o: cp-name-parser.c
$(COMPILE) -DTEST_CPNAMES cp-name-parser.c
-Index: gdb-7.7/gdb/gstack.sh
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ gdb-7.7/gdb/gstack.sh 2014-02-06 20:29:09.501214360 +0100
+diff --git a/gdb/gstack.sh b/gdb/gstack.sh
+new file mode 100644
+index 0000000000..f7f07248f7
+--- /dev/null
++++ b/gdb/gstack.sh
@@ -0,0 +1,43 @@
+#!/bin/sh
+
@@ -111,10 +132,60 @@ Index: gdb-7.7/gdb/gstack.sh
+ -e 's/^\((gdb) \)*//' \
+ -e '/^#/p' \
+ -e '/^Thread/p'
-Index: gdb-7.7/gdb/testsuite/gdb.base/gstack.exp
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ gdb-7.7/gdb/testsuite/gdb.base/gstack.exp 2014-02-06 20:43:17.774747352 +0100
+diff --git a/gdb/testsuite/gdb.base/gstack.c b/gdb/testsuite/gdb.base/gstack.c
+new file mode 100644
+index 0000000000..dc10813f04
+--- /dev/null
++++ b/gdb/testsuite/gdb.base/gstack.c
+@@ -0,0 +1,43 @@
++/* This testcase is part of GDB, the GNU debugger.
++
++ Copyright 2005, 2007, 2008, 2009 Free Software Foundation, Inc.
++
++ This program is free software; you can redistribute it and/or modify
++ it under the terms of the GNU General Public License as published by
++ the Free Software Foundation; either version 3 of the License, or
++ (at your option) any later version.
++
++ This program is distributed in the hope that it will be useful,
++ but WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++ GNU General Public License for more details.
++
++ You should have received a copy of the GNU General Public License
++ along with this program. If not, see <http://www.gnu.org/licenses/>. */
++
++#include <stdio.h>
++#include <unistd.h>
++#include <string.h>
++
++void
++func (void)
++{
++ const char msg[] = "looping\n";
++
++ /* Use the most simple notification not to get caught by attach on exiting
++ the function. */
++ write (1, msg, strlen (msg));
++
++ for (;;);
++}
++
++int
++main (void)
++{
++ alarm (60);
++ nice (100);
++
++ func ();
++
++ return 0;
++}
+diff --git a/gdb/testsuite/gdb.base/gstack.exp b/gdb/testsuite/gdb.base/gstack.exp
+new file mode 100644
+index 0000000000..1186ec57bc
+--- /dev/null
++++ b/gdb/testsuite/gdb.base/gstack.exp
@@ -0,0 +1,66 @@
+# Copyright (C) 2012 Free Software Foundation, Inc.
+
@@ -182,51 +253,6 @@ Index: gdb-7.7/gdb/testsuite/gdb.base/gstack.exp
+gdb_exit
+
+remote_exec host "kill -9 $pid"
-Index: gdb-7.7/gdb/testsuite/gdb.base/gstack.c
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ gdb-7.7/gdb/testsuite/gdb.base/gstack.c 2014-02-06 20:29:09.502214360 +0100
-@@ -0,0 +1,43 @@
-+/* This testcase is part of GDB, the GNU debugger.
-+
-+ Copyright 2005, 2007, 2008, 2009 Free Software Foundation, Inc.
-+
-+ This program is free software; you can redistribute it and/or modify
-+ it under the terms of the GNU General Public License as published by
-+ the Free Software Foundation; either version 3 of the License, or
-+ (at your option) any later version.
-+
-+ This program is distributed in the hope that it will be useful,
-+ but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ GNU General Public License for more details.
-+
-+ You should have received a copy of the GNU General Public License
-+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
-+
-+#include <stdio.h>
-+#include <unistd.h>
-+#include <string.h>
-+
-+void
-+func (void)
-+{
-+ const char msg[] = "looping\n";
-+
-+ /* Use the most simple notification not to get caught by attach on exiting
-+ the function. */
-+ write (1, msg, strlen (msg));
-+
-+ for (;;);
-+}
-+
-+int
-+main (void)
-+{
-+ alarm (60);
-+ nice (100);
-+
-+ func ();
-+
-+ return 0;
-+}
+--
+2.14.3
+
diff --git a/gdb-6.3-ppc64displaysymbol-20041124.patch b/gdb-6.3-ppc64displaysymbol-20041124.patch
index 8e94e00..9dcb927 100644
--- a/gdb-6.3-ppc64displaysymbol-20041124.patch
+++ b/gdb-6.3-ppc64displaysymbol-20041124.patch
@@ -1,13 +1,27 @@
+From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
+From: Andrew Cagney <cagney(a)gnu.org>
+Date: Fri, 27 Oct 2017 21:07:50 +0200
+Subject: gdb-6.3-ppc64displaysymbol-20041124.patch
+
+FileName: gdb-6.3-ppc64displaysymbol-20041124.patch
+
+;; Include the pc's section when doing a symbol lookup so that the
+;; correct symbol is found.
+;;=push: Write new testcase.
+
2004-11-24 Andrew Cagney <cagney(a)gnu.org>
* printcmd.c (build_address_symbolic): Find a section for the
address.
+---
+ gdb/printcmd.c | 8 ++++++++
+ 1 file changed, 8 insertions(+)
-Index: gdb-6.8.50.20081128/gdb/printcmd.c
-===================================================================
---- gdb-6.8.50.20081128.orig/gdb/printcmd.c 2008-12-04 01:36:05.000000000 +0100
-+++ gdb-6.8.50.20081128/gdb/printcmd.c 2008-12-04 01:37:18.000000000 +0100
-@@ -616,6 +616,14 @@ build_address_symbolic (CORE_ADDR addr,
+diff --git a/gdb/printcmd.c b/gdb/printcmd.c
+index 6256f35baa..c52e39f7fc 100644
+--- a/gdb/printcmd.c
++++ b/gdb/printcmd.c
+@@ -602,6 +602,14 @@ build_address_symbolic (struct gdbarch *gdbarch,
addr = overlay_mapped_address (addr, section);
}
}
@@ -22,3 +36,6 @@ Index: gdb-6.8.50.20081128/gdb/printcmd.c
/* First try to find the address in the symbol table, then
in the minsyms. Take the closest one. */
+--
+2.14.3
+
diff --git a/gdb-6.3-ppc64syscall-20040622.patch b/gdb-6.3-ppc64syscall-20040622.patch
index a237cc1..b77b888 100644
--- a/gdb-6.3-ppc64syscall-20040622.patch
+++ b/gdb-6.3-ppc64syscall-20040622.patch
@@ -1,3 +1,13 @@
+From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
+From: Andrew Cagney <cagney(a)gnu.org>
+Date: Fri, 27 Oct 2017 21:07:50 +0200
+Subject: gdb-6.3-ppc64syscall-20040622.patch
+
+FileName: gdb-6.3-ppc64syscall-20040622.patch
+
+;; Better parse 64-bit PPC system call prologues.
+;;=push: Write new testcase.
+
2004-06-22 Andrew Cagney <cagney(a)gnu.org>
* rs6000-tdep.c (struct rs6000_framedata): Add field "func_start".
@@ -5,12 +15,15 @@
"func_start". Add local variable "num_skip_linux_syscall_insn",
use to skip over first half of a GNU/Linux syscall and update
"func_start".
+---
+ gdb/rs6000-tdep.c | 57 ++++++++++++++++++++++++++++++++++++++++++++++++++++---
+ 1 file changed, 54 insertions(+), 3 deletions(-)
-Index: gdb-7.2.50.20110117/gdb/rs6000-tdep.c
-===================================================================
---- gdb-7.2.50.20110117.orig/gdb/rs6000-tdep.c 2011-01-11 20:23:02.000000000 +0100
-+++ gdb-7.2.50.20110117/gdb/rs6000-tdep.c 2011-01-17 15:48:19.000000000 +0100
-@@ -126,6 +126,7 @@ static const char *powerpc_vector_abi_st
+diff --git a/gdb/rs6000-tdep.c b/gdb/rs6000-tdep.c
+index e5a265dbcb..23d0db3b8f 100644
+--- a/gdb/rs6000-tdep.c
++++ b/gdb/rs6000-tdep.c
+@@ -134,6 +134,7 @@ static const char *powerpc_vector_abi_string = "auto";
struct rs6000_framedata
{
@@ -18,7 +31,7 @@ Index: gdb-7.2.50.20110117/gdb/rs6000-tdep.c
int offset; /* total size of frame --- the distance
by which we decrement sp to allocate
the frame */
-@@ -1496,7 +1497,6 @@ static CORE_ADDR
+@@ -1577,7 +1578,6 @@ static CORE_ADDR
skip_prologue (struct gdbarch *gdbarch, CORE_ADDR pc, CORE_ADDR lim_pc,
struct rs6000_framedata *fdata)
{
@@ -26,7 +39,7 @@ Index: gdb-7.2.50.20110117/gdb/rs6000-tdep.c
CORE_ADDR last_prologue_pc = pc;
CORE_ADDR li_found_pc = 0;
gdb_byte buf[4];
-@@ -1514,12 +1514,14 @@ skip_prologue (struct gdbarch *gdbarch,
+@@ -1595,12 +1595,14 @@ skip_prologue (struct gdbarch *gdbarch, CORE_ADDR pc, CORE_ADDR lim_pc,
int minimal_toc_loaded = 0;
int prev_insn_was_prologue_insn = 1;
int num_skip_non_prologue_insns = 0;
@@ -41,7 +54,7 @@ Index: gdb-7.2.50.20110117/gdb/rs6000-tdep.c
fdata->saved_gpr = -1;
fdata->saved_fpr = -1;
fdata->saved_vr = -1;
-@@ -1553,6 +1555,55 @@ skip_prologue (struct gdbarch *gdbarch,
+@@ -1634,6 +1636,55 @@ skip_prologue (struct gdbarch *gdbarch, CORE_ADDR pc, CORE_ADDR lim_pc,
break;
op = extract_unsigned_integer (buf, 4, byte_order);
@@ -97,7 +110,7 @@ Index: gdb-7.2.50.20110117/gdb/rs6000-tdep.c
if ((op & 0xfc1fffff) == 0x7c0802a6)
{ /* mflr Rx */
/* Since shared library / PIC code, which needs to get its
-@@ -1734,9 +1785,9 @@ skip_prologue (struct gdbarch *gdbarch,
+@@ -1825,9 +1876,9 @@ skip_prologue (struct gdbarch *gdbarch, CORE_ADDR pc, CORE_ADDR lim_pc,
we have no line table information or the line info tells
us that the subroutine call is not part of the line
associated with the prologue. */
@@ -109,3 +122,6 @@ Index: gdb-7.2.50.20110117/gdb/rs6000-tdep.c
struct symtab_and_line this_sal = find_pc_line (pc, 0);
if ((prologue_sal.line == 0)
+--
+2.14.3
+
diff --git a/gdb-6.3-readnever-20050907.patch b/gdb-6.3-readnever-20050907.patch
new file mode 100644
index 0000000..964bcf6
--- /dev/null
+++ b/gdb-6.3-readnever-20050907.patch
@@ -0,0 +1,44 @@
+From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
+From: Andrew Cagney <cagney(a)gnu.org>
+Date: Fri, 27 Oct 2017 21:07:50 +0200
+Subject: gdb-6.3-readnever-20050907.patch
+
+FileName: gdb-6.3-readnever-20050907.patch
+
+;; Add readnever option
+;;=push
+
+2004-11-18 Andrew Cagney <cagney(a)gnu.org>
+
+ * dwarf2read.c: Include "top.c".
+ (dwarf2_has_info): Check for readnever_symbol_files.
+ * symfile.c (readnever_symbol_files): Define.
+ * top.h (readnever_symbol_files): Declare.
+ * main.c (captured_main): Add --readnever option.
+ (print_gdb_help): Ditto.
+
+2004-11-18 Andrew Cagney <cagney(a)gnu.org>
+
+ * gdb.texinfo (File Options): Document --readnever.
+
+Pushed upstream: https://sourceware.org/ml/gdb-cvs/2017-12/msg00007.html
+---
+ gdb/gcore.in | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/gdb/gcore.in b/gdb/gcore.in
+index b7f57cd341..c7e0dec574 100644
+--- a/gdb/gcore.in
++++ b/gdb/gcore.in
+@@ -97,7 +97,7 @@ for pid in $*
+ do
+ # `</dev/null' to avoid touching interactive terminal if it is
+ # available but not accessible as GDB would get stopped on SIGTTIN.
+- $binary_path/@GDB_TRANSFORM_NAME@ </dev/null --nx --batch \
++ $binary_path/@GDB_TRANSFORM_NAME@ </dev/null --nx --batch --readnever \
+ -ex "set pagination off" -ex "set height 0" -ex "set width 0" \
+ "${dump_all_cmds[@]}" \
+ -ex "attach $pid" -ex "gcore $name.$pid" -ex detach -ex quit
+--
+2.14.3
+
diff --git a/gdb-6.3-rh-dummykfail-20041202.patch b/gdb-6.3-rh-dummykfail-20041202.patch
deleted file mode 100644
index 1f0bc9d..0000000
--- a/gdb-6.3-rh-dummykfail-20041202.patch
+++ /dev/null
@@ -1,22 +0,0 @@
-2003-07-11 Elena Zannoni <ezannoni(a)redhat.com>
-
- * lib/gdb.exp (setup_kfail, kfail): Redefine procedures.
-
---- ./gdb/testsuite/lib/gdb.exp.1 2004-11-24 15:59:46.131394720 -0500
-+++ ./gdb/testsuite/lib/gdb.exp 2004-11-24 16:01:06.304206600 -0500
-@@ -63,6 +63,15 @@
-
- ### Only procedures should come after this point.
-
-+if {![llength [info procs kfail]]} {
-+ proc setup_kfail { args } {
-+ #setup_xfail args
-+ }
-+ proc kfail { bugid message } {
-+ fail $message
-+ }
-+}
-+
- #
- # gdb_version -- extract and print the version number of GDB
- #
diff --git a/gdb-6.3-rh-testversion-20041202.patch b/gdb-6.3-rh-testversion-20041202.patch
index 8b9a4bf..72ce7a5 100644
--- a/gdb-6.3-rh-testversion-20041202.patch
+++ b/gdb-6.3-rh-testversion-20041202.patch
@@ -1,13 +1,27 @@
+From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
+From: Elena Zannoni <ezannoni(a)redhat.com>
+Date: Fri, 27 Oct 2017 21:07:50 +0200
+Subject: gdb.gdb/selftest.exp: Add matching on specific Red Hat only version
+ string
+
+FileName: gdb-6.3-rh-testversion-20041202.patch
+
+;; Match the Fedora's version info.
+;;=fedora
+
2003-02-24 Elena Zannoni <ezannoni(a)redhat.com>
* gdb.gdb/selftest.exp: Add matching on specific Red Hat only version
string.
+---
+ gdb/testsuite/gdb.gdb/selftest.exp | 3 +++
+ 1 file changed, 3 insertions(+)
-Index: gdb-7.12.50.20170207/gdb/testsuite/gdb.gdb/selftest.exp
-===================================================================
---- gdb-7.12.50.20170207.orig/gdb/testsuite/gdb.gdb/selftest.exp 2017-02-07 19:47:06.472874620 +0100
-+++ gdb-7.12.50.20170207/gdb/testsuite/gdb.gdb/selftest.exp 2017-02-07 19:48:12.593380575 +0100
-@@ -53,6 +53,9 @@
+diff --git a/gdb/testsuite/gdb.gdb/selftest.exp b/gdb/testsuite/gdb.gdb/selftest.exp
+index 20f34983ef..4108e088a9 100644
+--- a/gdb/testsuite/gdb.gdb/selftest.exp
++++ b/gdb/testsuite/gdb.gdb/selftest.exp
+@@ -53,6 +53,9 @@ proc test_with_self { } {
-re ".\[0-9\]+ = +.+ +0x.*\[0-9.\]+.*$gdb_prompt $" {
pass "printed version with cast"
}
@@ -17,3 +31,6 @@ Index: gdb-7.12.50.20170207/gdb/testsuite/gdb.gdb/selftest.exp
}
# start the "xgdb" process
+--
+2.14.3
+
diff --git a/gdb-6.5-bz185337-resolve-tls-without-debuginfo-v2.patch b/gdb-6.5-bz185337-resolve-tls-without-debuginfo-v2.patch
index aa1a646..b00b3d0 100644
--- a/gdb-6.5-bz185337-resolve-tls-without-debuginfo-v2.patch
+++ b/gdb-6.5-bz185337-resolve-tls-without-debuginfo-v2.patch
@@ -1,3 +1,13 @@
+From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
+From: Jan Kratochvil <jan.kratochvil(a)redhat.com>
+Date: Fri, 27 Oct 2017 21:07:50 +0200
+Subject: gdb-6.5-bz185337-resolve-tls-without-debuginfo-v2.patch
+
+FileName: gdb-6.5-bz185337-resolve-tls-without-debuginfo-v2.patch
+
+;; Support TLS symbols (+`errno' suggestion if no pthread is found) (BZ 185337).
+;;=push+jan: It should be replaced by Infinity project.
+
https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=185337
2008-02-24 Jan Kratochvil <jan.kratochvil(a)redhat.com>
@@ -24,7 +34,6 @@ call invalidates `struct frame *' in the callers - RH BZ 690908.
https://bugzilla.redhat.com/show_bug.cgi?id=1166549
-
2007-11-03 Jan Kratochvil <jan.kratochvil(a)redhat.com>
* ./gdb/dwarf2read.c (read_partial_die, dwarf2_linkage_name): Prefer
@@ -33,12 +42,23 @@ https://bugzilla.redhat.com/show_bug.cgi?id=1166549
glibc-debuginfo-2.7-2.x86_64: /usr/lib/debug/lib64/libc.so.6.debug:
<81a2> DW_AT_name : (indirect string, offset: 0x280e): __errno_location
<81a8> DW_AT_MIPS_linkage_name: (indirect string, offset: 0x2808): *__GI___errno_location
+---
+ gdb/printcmd.c | 4 ++
+ gdb/testsuite/gdb.dwarf2/dw2-errno.c | 28 +++++++++++++
+ gdb/testsuite/gdb.dwarf2/dw2-errno.exp | 60 ++++++++++++++++++++++++++++
+ gdb/testsuite/gdb.dwarf2/dw2-errno2.c | 28 +++++++++++++
+ gdb/testsuite/gdb.dwarf2/dw2-errno2.exp | 71 +++++++++++++++++++++++++++++++++
+ 5 files changed, 191 insertions(+)
+ create mode 100644 gdb/testsuite/gdb.dwarf2/dw2-errno.c
+ create mode 100644 gdb/testsuite/gdb.dwarf2/dw2-errno.exp
+ create mode 100644 gdb/testsuite/gdb.dwarf2/dw2-errno2.c
+ create mode 100644 gdb/testsuite/gdb.dwarf2/dw2-errno2.exp
-Index: gdb-7.12.50.20170207/gdb/printcmd.c
-===================================================================
---- gdb-7.12.50.20170207.orig/gdb/printcmd.c 2017-02-07 21:06:20.196593884 +0100
-+++ gdb-7.12.50.20170207/gdb/printcmd.c 2017-02-07 21:07:10.230973906 +0100
-@@ -1258,6 +1258,10 @@
+diff --git a/gdb/printcmd.c b/gdb/printcmd.c
+index c52e39f7fc..ad80b1bebf 100644
+--- a/gdb/printcmd.c
++++ b/gdb/printcmd.c
+@@ -1210,6 +1210,10 @@ print_command_1 (const char *exp, int voidprint)
if (exp && *exp)
{
@@ -49,10 +69,11 @@ Index: gdb-7.12.50.20170207/gdb/printcmd.c
expression_up expr = parse_expression (exp);
val = evaluate_expression (expr.get ());
}
-Index: gdb-7.12.50.20170207/gdb/testsuite/gdb.dwarf2/dw2-errno.c
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ gdb-7.12.50.20170207/gdb/testsuite/gdb.dwarf2/dw2-errno.c 2017-02-07 21:06:20.196593884 +0100
+diff --git a/gdb/testsuite/gdb.dwarf2/dw2-errno.c b/gdb/testsuite/gdb.dwarf2/dw2-errno.c
+new file mode 100644
+index 0000000000..7bd10d0978
+--- /dev/null
++++ b/gdb/testsuite/gdb.dwarf2/dw2-errno.c
@@ -0,0 +1,28 @@
+/* This testcase is part of GDB, the GNU debugger.
+
@@ -82,10 +103,11 @@ Index: gdb-7.12.50.20170207/gdb/testsuite/gdb.dwarf2/dw2-errno.c
+
+ return 0; /* breakpoint */
+}
-Index: gdb-7.12.50.20170207/gdb/testsuite/gdb.dwarf2/dw2-errno.exp
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ gdb-7.12.50.20170207/gdb/testsuite/gdb.dwarf2/dw2-errno.exp 2017-02-07 21:06:20.196593884 +0100
+diff --git a/gdb/testsuite/gdb.dwarf2/dw2-errno.exp b/gdb/testsuite/gdb.dwarf2/dw2-errno.exp
+new file mode 100644
+index 0000000000..1f13cc1323
+--- /dev/null
++++ b/gdb/testsuite/gdb.dwarf2/dw2-errno.exp
@@ -0,0 +1,60 @@
+# Copyright 2007 Free Software Foundation, Inc.
+
@@ -147,10 +169,11 @@ Index: gdb-7.12.50.20170207/gdb/testsuite/gdb.dwarf2/dw2-errno.exp
+
+# TODO: Test the error on resolving ERRNO with only libc loaded.
+# Just how to find the current libc filename?
-Index: gdb-7.12.50.20170207/gdb/testsuite/gdb.dwarf2/dw2-errno2.c
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ gdb-7.12.50.20170207/gdb/testsuite/gdb.dwarf2/dw2-errno2.c 2017-02-07 21:06:20.196593884 +0100
+diff --git a/gdb/testsuite/gdb.dwarf2/dw2-errno2.c b/gdb/testsuite/gdb.dwarf2/dw2-errno2.c
+new file mode 100644
+index 0000000000..7bd10d0978
+--- /dev/null
++++ b/gdb/testsuite/gdb.dwarf2/dw2-errno2.c
@@ -0,0 +1,28 @@
+/* This testcase is part of GDB, the GNU debugger.
+
@@ -180,10 +203,11 @@ Index: gdb-7.12.50.20170207/gdb/testsuite/gdb.dwarf2/dw2-errno2.c
+
+ return 0; /* breakpoint */
+}
-Index: gdb-7.12.50.20170207/gdb/testsuite/gdb.dwarf2/dw2-errno2.exp
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ gdb-7.12.50.20170207/gdb/testsuite/gdb.dwarf2/dw2-errno2.exp 2017-02-07 21:06:20.197593892 +0100
+diff --git a/gdb/testsuite/gdb.dwarf2/dw2-errno2.exp b/gdb/testsuite/gdb.dwarf2/dw2-errno2.exp
+new file mode 100644
+index 0000000000..0f6e66870b
+--- /dev/null
++++ b/gdb/testsuite/gdb.dwarf2/dw2-errno2.exp
@@ -0,0 +1,71 @@
+# Copyright 2007 Free Software Foundation, Inc.
+
@@ -225,7 +249,7 @@ Index: gdb-7.12.50.20170207/gdb/testsuite/gdb.dwarf2/dw2-errno2.exp
+ if $do_xfail {
+ setup_xfail "*-*-*"
+ }
-+ gdb_test "print errno" ".* = 42" "print errno for core"
++ gdb_test "print (int) errno" ".* = 42" "print errno for core"
+}}
+
+set variant g2thrN
@@ -256,3 +280,6 @@ Index: gdb-7.12.50.20170207/gdb/testsuite/gdb.dwarf2/dw2-errno2.exp
+
+# TODO: Test the error on resolving ERRNO with only libc loaded.
+# Just how to find the current libc filename?
+--
+2.14.3
+
diff --git a/gdb-6.5-bz203661-emit-relocs.patch b/gdb-6.5-bz203661-emit-relocs.patch
index cc8e515..56107b2 100644
--- a/gdb-6.5-bz203661-emit-relocs.patch
+++ b/gdb-6.5-bz203661-emit-relocs.patch
@@ -1,8 +1,21 @@
-Index: gdb-7.4.50.20120602/gdb/symfile.c
-===================================================================
---- gdb-7.4.50.20120602.orig/gdb/symfile.c 2012-06-02 18:25:20.000000000 +0200
-+++ gdb-7.4.50.20120602/gdb/symfile.c 2012-06-02 18:26:36.145232057 +0200
-@@ -3630,6 +3630,12 @@ default_symfile_relocate (struct objfile
+From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
+From: Fedora GDB patches <invalid(a)email.com>
+Date: Fri, 27 Oct 2017 21:07:50 +0200
+Subject: gdb-6.5-bz203661-emit-relocs.patch
+
+FileName: gdb-6.5-bz203661-emit-relocs.patch
+
+;; Fix debuginfo addresses resolving for --emit-relocs Linux kernels (BZ 203661).
+;;=push+jan: There was some mail thread about it, this patch may be a hack.
+---
+ gdb/symfile.c | 6 ++++++
+ 1 file changed, 6 insertions(+)
+
+diff --git a/gdb/symfile.c b/gdb/symfile.c
+index f7f75b05d3..7cda615e74 100644
+--- a/gdb/symfile.c
++++ b/gdb/symfile.c
+@@ -3629,6 +3629,12 @@ default_symfile_relocate (struct objfile *objfile, asection *sectp,
DWO file. */
bfd *abfd = sectp->owner;
@@ -15,3 +28,6 @@ Index: gdb-7.4.50.20120602/gdb/symfile.c
/* We're only interested in sections with relocation
information. */
if ((sectp->flags & SEC_RELOC) == 0)
+--
+2.14.3
+
diff --git a/gdb-6.5-bz216711-clone-is-outermost.patch b/gdb-6.5-bz216711-clone-is-outermost.patch
index 657eeb4..d4fb116 100644
--- a/gdb-6.5-bz216711-clone-is-outermost.patch
+++ b/gdb-6.5-bz216711-clone-is-outermost.patch
@@ -1,3 +1,13 @@
+From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
+From: Jan Kratochvil <jan.kratochvil(a)redhat.com>
+Date: Fri, 27 Oct 2017 21:07:50 +0200
+Subject: gdb-6.5-bz216711-clone-is-outermost.patch
+
+FileName: gdb-6.5-bz216711-clone-is-outermost.patch
+
+;; Fix bogus 0x0 unwind of the thread's topmost function clone(3) (BZ 216711).
+;;=fedora
+
https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=216711
FIXME: This workaround should be dropped and
@@ -22,12 +32,22 @@ instead.
2007-10-16 Jan Kratochvil <jan.kratochvil(a)redhat.com>
Port to GDB-6.7.
+---
+ gdb/amd64-linux-tdep.c | 76 +++++++++++++++++++++++++++++
+ gdb/amd64-tdep.c | 11 +++++
+ gdb/i386-tdep.c | 3 ++
+ gdb/i386-tdep.h | 3 ++
+ gdb/testsuite/gdb.threads/bt-clone-stop.c | 39 +++++++++++++++
+ gdb/testsuite/gdb.threads/bt-clone-stop.exp | 61 +++++++++++++++++++++++
+ 6 files changed, 193 insertions(+)
+ create mode 100644 gdb/testsuite/gdb.threads/bt-clone-stop.c
+ create mode 100644 gdb/testsuite/gdb.threads/bt-clone-stop.exp
-Index: gdb-7.10.90.20160211/gdb/amd64-linux-tdep.c
-===================================================================
---- gdb-7.10.90.20160211.orig/gdb/amd64-linux-tdep.c 2016-02-15 23:37:06.936501443 +0100
-+++ gdb-7.10.90.20160211/gdb/amd64-linux-tdep.c 2016-02-15 23:37:39.928735691 +0100
-@@ -292,6 +292,80 @@
+diff --git a/gdb/amd64-linux-tdep.c b/gdb/amd64-linux-tdep.c
+index 2bd3d31b75..2623bae42d 100644
+--- a/gdb/amd64-linux-tdep.c
++++ b/gdb/amd64-linux-tdep.c
+@@ -291,6 +291,80 @@ amd64_linux_register_reggroup_p (struct gdbarch *gdbarch, int regnum,
/* Set the program counter for process PTID to PC. */
@@ -108,7 +128,7 @@ Index: gdb-7.10.90.20160211/gdb/amd64-linux-tdep.c
static void
amd64_linux_write_pc (struct regcache *regcache, CORE_ADDR pc)
{
-@@ -1800,6 +1874,8 @@
+@@ -1807,6 +1881,8 @@ amd64_linux_init_abi_common(struct gdbarch_info info, struct gdbarch *gdbarch)
tdep->xsave_xcr0_offset = I386_LINUX_XSAVE_XCR0_OFFSET;
@@ -117,11 +137,11 @@ Index: gdb-7.10.90.20160211/gdb/amd64-linux-tdep.c
/* Add the %orig_rax register used for syscall restarting. */
set_gdbarch_write_pc (gdbarch, amd64_linux_write_pc);
-Index: gdb-7.10.90.20160211/gdb/amd64-tdep.c
-===================================================================
---- gdb-7.10.90.20160211.orig/gdb/amd64-tdep.c 2016-02-15 23:37:06.936501443 +0100
-+++ gdb-7.10.90.20160211/gdb/amd64-tdep.c 2016-02-15 23:37:39.929735698 +0100
-@@ -2494,6 +2494,7 @@
+diff --git a/gdb/amd64-tdep.c b/gdb/amd64-tdep.c
+index 7b2851f0a6..7c70792b3f 100644
+--- a/gdb/amd64-tdep.c
++++ b/gdb/amd64-tdep.c
+@@ -2595,6 +2595,7 @@ amd64_frame_unwind_stop_reason (struct frame_info *this_frame,
{
struct amd64_frame_cache *cache =
amd64_frame_cache (this_frame, this_cache);
@@ -129,7 +149,7 @@ Index: gdb-7.10.90.20160211/gdb/amd64-tdep.c
if (!cache->base_p)
return UNWIND_UNAVAILABLE;
-@@ -2502,6 +2503,10 @@
+@@ -2603,6 +2604,10 @@ amd64_frame_unwind_stop_reason (struct frame_info *this_frame,
if (cache->base == 0)
return UNWIND_OUTERMOST;
@@ -140,7 +160,7 @@ Index: gdb-7.10.90.20160211/gdb/amd64-tdep.c
return UNWIND_NO_REASON;
}
-@@ -2636,6 +2641,7 @@
+@@ -2737,6 +2742,7 @@ amd64_sigtramp_frame_this_id (struct frame_info *this_frame,
{
struct amd64_frame_cache *cache =
amd64_sigtramp_frame_cache (this_frame, this_cache);
@@ -148,7 +168,7 @@ Index: gdb-7.10.90.20160211/gdb/amd64-tdep.c
if (!cache->base_p)
(*this_id) = frame_id_build_unavailable_stack (get_frame_pc (this_frame));
-@@ -2644,6 +2650,11 @@
+@@ -2745,6 +2751,11 @@ amd64_sigtramp_frame_this_id (struct frame_info *this_frame,
/* This marks the outermost frame. */
return;
}
@@ -160,11 +180,11 @@ Index: gdb-7.10.90.20160211/gdb/amd64-tdep.c
else
(*this_id) = frame_id_build (cache->base + 16, get_frame_pc (this_frame));
}
-Index: gdb-7.10.90.20160211/gdb/i386-tdep.c
-===================================================================
---- gdb-7.10.90.20160211.orig/gdb/i386-tdep.c 2016-02-15 23:37:06.936501443 +0100
-+++ gdb-7.10.90.20160211/gdb/i386-tdep.c 2016-02-15 23:37:39.931735713 +0100
-@@ -8305,6 +8305,9 @@
+diff --git a/gdb/i386-tdep.c b/gdb/i386-tdep.c
+index 9ce329eb20..d1b461b538 100644
+--- a/gdb/i386-tdep.c
++++ b/gdb/i386-tdep.c
+@@ -8401,6 +8401,9 @@ i386_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
tdep->xsave_xcr0_offset = -1;
@@ -174,11 +194,11 @@ Index: gdb-7.10.90.20160211/gdb/i386-tdep.c
tdep->record_regmap = i386_record_regmap;
set_gdbarch_long_long_align_bit (gdbarch, 32);
-Index: gdb-7.10.90.20160211/gdb/i386-tdep.h
-===================================================================
---- gdb-7.10.90.20160211.orig/gdb/i386-tdep.h 2016-02-15 23:37:06.936501443 +0100
-+++ gdb-7.10.90.20160211/gdb/i386-tdep.h 2016-02-15 23:37:39.932735720 +0100
-@@ -240,6 +240,9 @@
+diff --git a/gdb/i386-tdep.h b/gdb/i386-tdep.h
+index a71c103a88..5ee336b8cb 100644
+--- a/gdb/i386-tdep.h
++++ b/gdb/i386-tdep.h
+@@ -251,6 +251,9 @@ struct gdbarch_tdep
/* Regsets. */
const struct regset *fpregset;
@@ -188,10 +208,11 @@ Index: gdb-7.10.90.20160211/gdb/i386-tdep.h
};
/* Floating-point registers. */
-Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.threads/bt-clone-stop.c
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ gdb-7.10.90.20160211/gdb/testsuite/gdb.threads/bt-clone-stop.c 2016-02-15 23:37:39.932735720 +0100
+diff --git a/gdb/testsuite/gdb.threads/bt-clone-stop.c b/gdb/testsuite/gdb.threads/bt-clone-stop.c
+new file mode 100644
+index 0000000000..2ac93f8664
+--- /dev/null
++++ b/gdb/testsuite/gdb.threads/bt-clone-stop.c
@@ -0,0 +1,39 @@
+/* This testcase is part of GDB, the GNU debugger.
+
@@ -232,10 +253,11 @@ Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.threads/bt-clone-stop.c
+ for (;;)
+ pause();
+}
-Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.threads/bt-clone-stop.exp
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ gdb-7.10.90.20160211/gdb/testsuite/gdb.threads/bt-clone-stop.exp 2016-02-15 23:37:56.197851204 +0100
+diff --git a/gdb/testsuite/gdb.threads/bt-clone-stop.exp b/gdb/testsuite/gdb.threads/bt-clone-stop.exp
+new file mode 100644
+index 0000000000..02728e05b9
+--- /dev/null
++++ b/gdb/testsuite/gdb.threads/bt-clone-stop.exp
@@ -0,0 +1,61 @@
+# Copyright 2006 Free Software Foundation, Inc.
+
@@ -298,3 +320,6 @@ Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.threads/bt-clone-stop.exp
+ pass "0x0 entry not found"
+ }
+}
+--
+2.14.3
+
diff --git a/gdb-6.5-bz218379-solib-trampoline-lookup-lock-fix.patch b/gdb-6.5-bz218379-solib-trampoline-lookup-lock-fix.patch
index 58aadbf..e1b718d 100644
--- a/gdb-6.5-bz218379-solib-trampoline-lookup-lock-fix.patch
+++ b/gdb-6.5-bz218379-solib-trampoline-lookup-lock-fix.patch
@@ -1,11 +1,23 @@
-https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=218379
+From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
+From: Fedora GDB patches <invalid(a)email.com>
+Date: Fri, 27 Oct 2017 21:07:50 +0200
+Subject: gdb-6.5-bz218379-solib-trampoline-lookup-lock-fix.patch
+
+FileName: gdb-6.5-bz218379-solib-trampoline-lookup-lock-fix.patch
+;; Fix lockup on trampoline vs. its function lookup; unreproducible (BZ 218379).
+;;=fedora
-Index: gdb-7.7.90.20140613/gdb/symtab.c
-===================================================================
---- gdb-7.7.90.20140613.orig/gdb/symtab.c 2014-06-13 21:52:06.219338401 +0200
-+++ gdb-7.7.90.20140613/gdb/symtab.c 2014-06-13 21:55:02.753531885 +0200
-@@ -2394,6 +2394,13 @@ find_pc_sect_line (CORE_ADDR pc, struct
+https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=218379
+---
+ gdb/symtab.c | 7 +++++++
+ 1 file changed, 7 insertions(+)
+
+diff --git a/gdb/symtab.c b/gdb/symtab.c
+index 146dc2e421..e7223a9a98 100644
+--- a/gdb/symtab.c
++++ b/gdb/symtab.c
+@@ -3167,6 +3167,13 @@ find_pc_sect_line (CORE_ADDR pc, struct obj_section *section, int notcurrent)
SYMBOL_LINKAGE_NAME (msymbol)); */
;
/* fall through */
@@ -19,3 +31,6 @@ Index: gdb-7.7.90.20140613/gdb/symtab.c
else
return find_pc_line (BMSYMBOL_VALUE_ADDRESS (mfunsym), 0);
}
+--
+2.14.3
+
diff --git a/gdb-6.6-buildid-locate-misleading-warning-missing-debuginfo-rhbz981154.patch b/gdb-6.6-buildid-locate-misleading-warning-missing-debuginfo-rhbz981154.patch
deleted file mode 100644
index 32f2a83..0000000
--- a/gdb-6.6-buildid-locate-misleading-warning-missing-debuginfo-rhbz981154.patch
+++ /dev/null
@@ -1,135 +0,0 @@
-Comments by Sergio Durigan Junior <sergiodj(a)redhat.com>:
-
- This is the fix for RH BZ #981154
-
- It is mainly a testcase addition, but a minor fix in the gdb/build-id.c
- file was also needed.
-
- gdb/build-id.c was added by:
-
- commit dc294be54c96414035eed7d53dafdea0a6f31a72
- Author: Tom Tromey <tromey(a)redhat.com>
- Date: Tue Oct 8 19:56:15 2013 +0000
-
- and had a little thinko there. The variable 'filename' needs to be set to
- NULL after it is free'd, otherwise the code below thinks that it is still
- valid and doesn't print the necessary warning ("Try: yum install ...").
-
-Index: gdb-7.12.50.20170207/gdb/testsuite/gdb.base/rhbz981154-misleading-yum-install-warning.exp
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ gdb-7.12.50.20170207/gdb/testsuite/gdb.base/rhbz981154-misleading-yum-install-warning.exp 2017-02-26 19:14:58.492609659 +0100
-@@ -0,0 +1,97 @@
-+# Copyright (C) 2014 Free Software Foundation, Inc.
-+
-+# This program is free software; you can redistribute it and/or modify
-+# it under the terms of the GNU General Public License as published by
-+# the Free Software Foundation; either version 3 of the License, or
-+# (at your option) any later version.
-+#
-+# This program is distributed in the hope that it will be useful,
-+# but WITHOUT ANY WARRANTY; without even the implied warranty of
-+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+# GNU General Public License for more details.
-+#
-+# You should have received a copy of the GNU General Public License
-+# along with this program. If not, see <http://www.gnu.org/licenses/>.
-+
-+standard_testfile "normal.c"
-+
-+if { [prepare_for_testing ${testfile}.exp ${testfile} ${srcfile}] } {
-+ return -1
-+}
-+
-+# Get the build-id of the file
-+set build_id_debug_file [build_id_debug_filename_get $binfile]
-+regsub -all ".debug$" $build_id_debug_file "" build_id_without_debug
-+
-+# Run to main
-+if { ![runto_main] } {
-+ return -1
-+}
-+
-+# We first need to generate a corefile
-+set escapedfilename [string_to_regexp [standard_output_file gcore.test]]
-+set core_supported 0
-+gdb_test_multiple "gcore [standard_output_file gcore.test]" \
-+ "save a corefile" \
-+{
-+ -re "Saved corefile ${escapedfilename}\[\r\n\]+$gdb_prompt $" {
-+ pass "save a corefile"
-+ global core_supported
-+ set core_supported 1
-+ }
-+ -re "Can't create a corefile\[\r\n\]+$gdb_prompt $" {
-+ unsupported "save a corefile"
-+ global core_supported
-+ set core_supported 0
-+ }
-+}
-+
-+if {!$core_supported} {
-+ return -1
-+}
-+
-+# Move the binfile to a temporary name
-+remote_exec build "mv $binfile ${binfile}.old"
-+
-+# Reinitialize GDB and see if we get a yum/dnf warning
-+gdb_exit
-+gdb_start
-+gdb_reinitialize_dir $srcdir/$subdir
-+
-+with_test_prefix "first run:" {
-+ gdb_test "set build-id-verbose 1" "" \
-+ "set build-id-verbose"
-+
-+ gdb_test "set debug-file-directory [file dirname [standard_output_file gcore.test]]" "" \
-+ "set debug-file-directory"
-+
-+ gdb_test "core-file [standard_output_file gcore.test]" \
-+ "Missing separate debuginfo for the main executable file\r\nTry: (yum|dnf) --enablerepo='\\*debug\\*' install [standard_output_file $build_id_without_debug]\r\n.*" \
-+ "test first yum/dnf warning"
-+}
-+
-+# Now we define and create our .build-id
-+file mkdir [file dirname [standard_output_file ${build_id_without_debug}]]
-+# Cannot use "file link" (from TCL) because it requires the target file to
-+# exist.
-+remote_exec build "ln -s $binfile [standard_output_file ${build_id_without_debug}]"
-+
-+# Reinitialize GDB to get the second yum/dnf warning
-+gdb_exit
-+gdb_start
-+gdb_reinitialize_dir $srcdir/$subdir
-+
-+with_test_prefix "second run:" {
-+ gdb_test "set build-id-verbose 1" "" \
-+ "set build-id-verbose"
-+
-+ gdb_test "set debug-file-directory [file dirname [standard_output_file gcore.test]]" "" \
-+ "set debug-file-directory"
-+
-+ gdb_test "core-file [standard_output_file gcore.test]" \
-+ "Missing separate debuginfo for the main executable file\r\nTry: (yum|dnf) --enablerepo='\\*debug\\*' install $binfile\r\n.*" \
-+ "test second yum/dnf warning"
-+}
-+
-+# Leaving the link there will cause breakage in the next run.
-+remote_exec build "rm -f [standard_output_file ${build_id_without_debug}]"
-Index: gdb-7.12.50.20170207/gdb/build-id.c
-===================================================================
---- gdb-7.12.50.20170207.orig/gdb/build-id.c 2017-02-26 19:14:51.943562799 +0100
-+++ gdb-7.12.50.20170207/gdb/build-id.c 2017-02-26 19:14:58.492609659 +0100
-@@ -589,7 +589,10 @@
- do_cleanups (inner);
-
- if (abfd == NULL)
-- continue;
-+ {
-+ filename = NULL;
-+ continue;
-+ }
-
- if (build_id_verify (abfd.get(), build_id_len, build_id))
- break;
diff --git a/gdb-6.6-buildid-locate-rpm-librpm-workaround.patch b/gdb-6.6-buildid-locate-rpm-librpm-workaround.patch
index 3378717..b94cc1f 100644
--- a/gdb-6.6-buildid-locate-rpm-librpm-workaround.patch
+++ b/gdb-6.6-buildid-locate-rpm-librpm-workaround.patch
@@ -1,20 +1,22 @@
-Index: gdb-7.6.90.20140127/gdb/proc-service.list
-===================================================================
---- gdb-7.6.90.20140127.orig/gdb/proc-service.list 2014-02-06 17:32:42.810640320 +0100
-+++ gdb-7.6.90.20140127/gdb/proc-service.list 2014-02-06 17:33:35.406696964 +0100
-@@ -37,4 +37,7 @@
- ps_pstop;
- ps_ptread;
- ps_ptwrite;
-+
-+ /* gdb-6.6-buildid-locate-rpm.patch */
-+ rpmsqEnable;
- };
-Index: gdb-7.6.90.20140127/gdb/build-id.c
-===================================================================
---- gdb-7.6.90.20140127.orig/gdb/build-id.c 2014-02-06 17:30:14.230480264 +0100
-+++ gdb-7.6.90.20140127/gdb/build-id.c 2014-02-06 17:34:28.846754283 +0100
-@@ -677,6 +677,19 @@ build_id_to_filename (const struct elf_b
+From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
+From: Fedora GDB patches <invalid(a)email.com>
+Date: Fri, 27 Oct 2017 21:07:50 +0200
+Subject: gdb-6.6-buildid-locate-rpm-librpm-workaround.patch
+
+FileName: gdb-6.6-buildid-locate-rpm-librpm-workaround.patch
+
+;; Workaround librpm BZ 643031 due to its unexpected exit() calls (BZ 642879).
+;;=push+jan
+---
+ gdb/build-id.c | 13 +++++++++++++
+ gdb/proc-service.list | 3 +++
+ 2 files changed, 16 insertions(+)
+
+diff --git a/gdb/build-id.c b/gdb/build-id.c
+index d60cf622dc..409a5b8c54 100644
+--- a/gdb/build-id.c
++++ b/gdb/build-id.c
+@@ -678,6 +678,19 @@ build_id_to_filename (const struct bfd_build_id *build_id, char **link_return)
#include <dlfcn.h>
#endif
@@ -34,3 +36,18 @@ Index: gdb-7.6.90.20140127/gdb/build-id.c
/* This MISSING_RPM_HASH tracker is used to collect all the missing rpm files
and avoid their duplicities during a single inferior run. */
+diff --git a/gdb/proc-service.list b/gdb/proc-service.list
+index 53f7ed8b1e..323f5e83c2 100644
+--- a/gdb/proc-service.list
++++ b/gdb/proc-service.list
+@@ -37,4 +37,7 @@
+ ps_pstop;
+ ps_ptread;
+ ps_ptwrite;
++
++ /* gdb-6.6-buildid-locate-rpm.patch */
++ rpmsqEnable;
+ };
+--
+2.14.3
+
diff --git a/gdb-6.6-buildid-locate-rpm-scl.patch b/gdb-6.6-buildid-locate-rpm-scl.patch
index f2f605d..9d76821 100644
--- a/gdb-6.6-buildid-locate-rpm-scl.patch
+++ b/gdb-6.6-buildid-locate-rpm-scl.patch
@@ -1,10 +1,25 @@
+From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
+From: Fedora GDB patches <invalid(a)email.com>
+Date: Fri, 27 Oct 2017 21:07:50 +0200
+Subject: gdb-6.6-buildid-locate-rpm-scl.patch
+
+FileName: gdb-6.6-buildid-locate-rpm-scl.patch
+
+;; [SCL] Skip deprecated .gdb_index warning for Red Hat built files (BZ 953585).
+;;=push+jan
+
warning: Skipping deprecated .gdb_index section
https://bugzilla.redhat.com/show_bug.cgi?id=953585
+---
+ gdb/build-id.c | 54 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
+ gdb/dwarf2read.c | 14 ++++++++++++++
+ 2 files changed, 68 insertions(+)
-diff -dup -rup gdb-7.10.50.20160106-orig/gdb/build-id.c gdb-7.10.50.20160106/gdb/build-id.c
---- gdb-7.10.50.20160106-orig/gdb/build-id.c 2016-01-09 14:40:39.420385241 +0100
-+++ gdb-7.10.50.20160106/gdb/build-id.c 2016-01-09 14:41:05.944549393 +0100
-@@ -713,7 +713,11 @@ static int missing_rpm_list_entries;
+diff --git a/gdb/build-id.c b/gdb/build-id.c
+index e2c1e81266..1b75530f91 100644
+--- a/gdb/build-id.c
++++ b/gdb/build-id.c
+@@ -715,7 +715,11 @@ static int missing_rpm_list_entries;
/* Returns the count of newly added rpms. */
static int
@@ -16,7 +31,7 @@ diff -dup -rup gdb-7.10.50.20160106-orig/gdb/build-id.c gdb-7.10.50.20160106/gdb
{
static int rpm_init_done = 0;
rpmts ts;
-@@ -817,7 +821,11 @@ missing_rpm_enlist (const char *filename
+@@ -822,7 +826,11 @@ missing_rpm_enlist (const char *filename)
mi = rpmtsInitIterator_p (ts, RPMTAG_BASENAMES, filename, 0);
if (mi != NULL)
{
@@ -28,7 +43,7 @@ diff -dup -rup gdb-7.10.50.20160106-orig/gdb/build-id.c gdb-7.10.50.20160106/gdb
{
Header h;
char *debuginfo, **slot, *s, *s2;
-@@ -935,6 +943,37 @@ missing_rpm_enlist (const char *filename
+@@ -940,6 +948,37 @@ missing_rpm_enlist (const char *filename)
xfree (debuginfo);
count++;
}
@@ -66,7 +81,7 @@ diff -dup -rup gdb-7.10.50.20160106-orig/gdb/build-id.c gdb-7.10.50.20160106/gdb
rpmdbFreeIterator_p (mi);
}
-@@ -945,6 +984,21 @@ missing_rpm_enlist (const char *filename
+@@ -950,6 +989,21 @@ missing_rpm_enlist (const char *filename)
}
static int
@@ -88,10 +103,11 @@ diff -dup -rup gdb-7.10.50.20160106-orig/gdb/build-id.c gdb-7.10.50.20160106/gdb
missing_rpm_list_compar (const char *const *ap, const char *const *bp)
{
return strcoll (*ap, *bp);
-diff -dup -rup gdb-7.10.50.20160106-orig/gdb/dwarf2read.c gdb-7.10.50.20160106/gdb/dwarf2read.c
---- gdb-7.10.50.20160106-orig/gdb/dwarf2read.c 2016-01-09 14:40:39.416385216 +0100
-+++ gdb-7.10.50.20160106/gdb/dwarf2read.c 2016-01-09 14:41:05.942549381 +0100
-@@ -3111,6 +3111,16 @@ read_index_from_section (struct objfile
+diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c
+index ebded1753f..ba3bed6c63 100644
+--- a/gdb/dwarf2read.c
++++ b/gdb/dwarf2read.c
+@@ -3725,6 +3725,16 @@ read_index_from_section (struct objfile *objfile,
"set use-deprecated-index-sections on". */
if (version < 6 && !deprecated_ok)
{
@@ -108,7 +124,7 @@ diff -dup -rup gdb-7.10.50.20160106-orig/gdb/dwarf2read.c gdb-7.10.50.20160106/g
static int warning_printed = 0;
if (!warning_printed)
{
-@@ -3122,6 +3132,10 @@ to use the section anyway."),
+@@ -3736,6 +3746,10 @@ to use the section anyway."),
warning_printed = 1;
}
return 0;
@@ -119,3 +135,6 @@ diff -dup -rup gdb-7.10.50.20160106-orig/gdb/dwarf2read.c gdb-7.10.50.20160106/g
}
/* Version 7 indices generated by gold refer to the CU for a symbol instead
of the TU (for symbols coming from TUs),
+--
+2.14.3
+
diff --git a/gdb-6.6-buildid-locate-solib-missing-ids.patch b/gdb-6.6-buildid-locate-solib-missing-ids.patch
deleted file mode 100644
index f4dccc9..0000000
--- a/gdb-6.6-buildid-locate-solib-missing-ids.patch
+++ /dev/null
@@ -1,222 +0,0 @@
-gdb returns an incorrect back trace when applying a debuginfo
-https://bugzilla.redhat.com/show_bug.cgi?id=1339862
-
-Index: gdb-7.9.90.20150709/gdb/solib-svr4.c
-===================================================================
---- gdb-7.9.90.20150709.orig/gdb/solib-svr4.c 2015-07-09 18:18:54.526417766 +0200
-+++ gdb-7.9.90.20150709/gdb/solib-svr4.c 2015-07-09 18:19:33.074746586 +0200
-@@ -1381,14 +1381,27 @@ svr4_read_so_list (CORE_ADDR lm, CORE_AD
- }
-
- {
-- struct bfd_build_id *build_id;
-+ struct bfd_build_id *build_id = NULL;
-
- strncpy (newobj->so_original_name, buffer, SO_NAME_MAX_PATH_SIZE - 1);
- newobj->so_original_name[SO_NAME_MAX_PATH_SIZE - 1] = '\0';
- /* May get overwritten below. */
- strcpy (newobj->so_name, newobj->so_original_name);
-
-- build_id = build_id_addr_get (newobj->lm_info->l_ld);
-+ /* In the case the main executable was found according to its build-id
-+ (from a core file) prevent loading a different build of a library
-+ with accidentally the same SO_NAME.
-+
-+ It suppresses bogus backtraces (and prints "??" there instead) if
-+ the on-disk files no longer match the running program version.
-+
-+ If the main executable was not loaded according to its build-id do
-+ not do any build-id checking of the libraries. There may be missing
-+ build-ids dumped in the core file and we would map all the libraries
-+ to the only existing file loaded that time - the executable. */
-+ if (symfile_objfile != NULL
-+ && (symfile_objfile->flags & OBJF_BUILD_ID_CORE_LOADED) != 0)
-+ build_id = build_id_addr_get (newobj->lm_info->l_ld);
- if (build_id != NULL)
- {
- char *name, *build_id_filename;
-@@ -1403,23 +1416,7 @@ svr4_read_so_list (CORE_ADDR lm, CORE_AD
- xfree (name);
- }
- else
-- {
-- debug_print_missing (newobj->so_name, build_id_filename);
--
-- /* In the case the main executable was found according to
-- its build-id (from a core file) prevent loading
-- a different build of a library with accidentally the
-- same SO_NAME.
--
-- It suppresses bogus backtraces (and prints "??" there
-- instead) if the on-disk files no longer match the
-- running program version. */
--
-- if (symfile_objfile != NULL
-- && (symfile_objfile->flags
-- & OBJF_BUILD_ID_CORE_LOADED) != 0)
-- newobj->so_name[0] = 0;
-- }
-+ debug_print_missing (newobj->so_name, build_id_filename);
-
- xfree (build_id_filename);
- xfree (build_id);
---- /dev/null 2016-07-02 20:29:01.679404943 +0200
-+++ gdb-7.11.50.20160721/gdb/testsuite/gdb.base/gcore-buildid-exec-but-not-solib.exp 2016-07-31 23:04:49.062753722 +0200
-@@ -0,0 +1,105 @@
-+# Copyright 2016 Free Software Foundation, Inc.
-+
-+# This program is free software; you can redistribute it and/or modify
-+# it under the terms of the GNU General Public License as published by
-+# the Free Software Foundation; either version 3 of the License, or
-+# (at your option) any later version.
-+#
-+# This program is distributed in the hope that it will be useful,
-+# but WITHOUT ANY WARRANTY; without even the implied warranty of
-+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+# GNU General Public License for more details.
-+#
-+# You should have received a copy of the GNU General Public License
-+# along with this program. If not, see <http://www.gnu.org/licenses/>.
-+
-+if {[skip_shlib_tests]} {
-+ return 0
-+}
-+
-+set testfile "gcore-buildid-exec-but-not-solib"
-+set srcmainfile ${testfile}-main.c
-+set srclibfile ${testfile}-lib.c
-+set libfile [standard_output_file ${testfile}-lib.so]
-+set objfile [standard_output_file ${testfile}-main.o]
-+set executable ${testfile}-main
-+set binfile [standard_output_file ${executable}]
-+set gcorefile [standard_output_file ${executable}.gcore]
-+set outdir [file dirname $binfile]
-+
-+if { [gdb_compile_shlib ${srcdir}/${subdir}/${srclibfile} ${libfile} "debug additional_flags=-Wl,--build-id"] != ""
-+ || [gdb_compile ${srcdir}/${subdir}/${srcmainfile} ${objfile} object {debug}] != "" } {
-+ unsupported "-Wl,--build-id compilation failed"
-+ return -1
-+}
-+set opts [list debug shlib=${libfile} "additional_flags=-Wl,--build-id"]
-+if { [gdb_compile ${objfile} ${binfile} executable $opts] != "" } {
-+ unsupported "-Wl,--build-id compilation failed"
-+ return -1
-+}
-+
-+clean_restart $executable
-+gdb_load_shlib $libfile
-+
-+# Does this gdb support gcore?
-+set test "help gcore"
-+gdb_test_multiple $test $test {
-+ -re "Undefined command: .gcore.*\r\n$gdb_prompt $" {
-+ # gcore command not supported -- nothing to test here.
-+ unsupported "gdb does not support gcore on this target"
-+ return -1;
-+ }
-+ -re "Save a core file .*\r\n$gdb_prompt $" {
-+ pass $test
-+ }
-+}
-+
-+if { ![runto lib] } then {
-+ return -1
-+}
-+
-+set escapedfilename [string_to_regexp ${gcorefile}]
-+
-+set test "save a corefile"
-+gdb_test_multiple "gcore ${gcorefile}" $test {
-+ -re "Saved corefile ${escapedfilename}\r\n$gdb_prompt $" {
-+ pass $test
-+ }
-+ -re "Can't create a corefile\r\n$gdb_prompt $" {
-+ unsupported $test
-+ return -1
-+ }
-+}
-+
-+# Now restart gdb and load the corefile.
-+
-+clean_restart $executable
-+gdb_load_shlib $libfile
-+
-+set buildid [build_id_debug_filename_get $libfile]
-+
-+regsub {\.debug$} $buildid {} buildid
-+
-+set debugdir [standard_output_file ${testfile}-debugdir]
-+file delete -force -- $debugdir
-+
-+file mkdir $debugdir/[file dirname $libfile]
-+file copy $libfile $debugdir/${libfile}
-+
-+file mkdir $debugdir/[file dirname $buildid]
-+file copy $libfile $debugdir/${buildid}
-+
-+remote_exec build "ln -s /lib ${debugdir}/"
-+remote_exec build "ln -s /lib64 ${debugdir}/"
-+# /usr is not needed, all the libs are in /lib64: libm.so.6 libc.so.6 ld-linux-x86-64.so.2
-+
-+gdb_test "set solib-absolute-prefix $debugdir"
-+
-+gdb_test_no_output "set debug-file-directory $debugdir" "set debug-file-directory"
-+
-+gdb_test "core ${gcorefile}" "Core was generated by .*" "re-load generated corefile"
-+
-+gdb_test "frame" "#0 \[^\r\n\]* lib .*" "library got loaded"
-+
-+gdb_test "bt"
-+gdb_test "info shared"
---- /dev/null 2016-07-02 20:29:01.679404943 +0200
-+++ gdb-7.11.50.20160721/gdb/testsuite/gdb.base/gcore-buildid-exec-but-not-solib-main.c 2016-07-28 21:06:40.977786922 +0200
-@@ -0,0 +1,25 @@
-+/* Copyright 2010 Free Software Foundation, Inc.
-+
-+ This file is part of GDB.
-+
-+ This program is free software; you can redistribute it and/or modify
-+ it under the terms of the GNU General Public License as published by
-+ the Free Software Foundation; either version 3 of the License, or
-+ (at your option) any later version.
-+
-+ This program is distributed in the hope that it will be useful,
-+ but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ GNU General Public License for more details.
-+
-+ You should have received a copy of the GNU General Public License
-+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
-+
-+extern void lib (void);
-+
-+int
-+main (void)
-+{
-+ lib ();
-+ return 0;
-+}
---- /dev/null 2016-07-02 20:29:01.679404943 +0200
-+++ gdb-7.11.50.20160721/gdb/testsuite/gdb.base/gcore-buildid-exec-but-not-solib-lib.c 2016-07-28 21:06:40.977786922 +0200
-@@ -0,0 +1,21 @@
-+/* Copyright 2010 Free Software Foundation, Inc.
-+
-+ This file is part of GDB.
-+
-+ This program is free software; you can redistribute it and/or modify
-+ it under the terms of the GNU General Public License as published by
-+ the Free Software Foundation; either version 3 of the License, or
-+ (at your option) any later version.
-+
-+ This program is distributed in the hope that it will be useful,
-+ but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ GNU General Public License for more details.
-+
-+ You should have received a copy of the GNU General Public License
-+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
-+
-+void
-+lib (void)
-+{
-+}
diff --git a/gdb-6.6-bz235197-fork-detach-info.patch b/gdb-6.6-bz235197-fork-detach-info.patch
index 660fa74..57971e8 100644
--- a/gdb-6.6-bz235197-fork-detach-info.patch
+++ b/gdb-6.6-bz235197-fork-detach-info.patch
@@ -1,12 +1,66 @@
+From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
+From: Jan Kratochvil <jan.kratochvil(a)redhat.com>
+Date: Fri, 27 Oct 2017 21:07:50 +0200
+Subject: gdb-6.6-bz235197-fork-detach-info.patch
+
+FileName: gdb-6.6-bz235197-fork-detach-info.patch
+
+;; Notify user of a child forked process being detached (BZ 235197).
+;;=push+jan: This is more about discussion if/what should be printed.
+
2008-03-01 Jan Kratochvil <jan.kratochvil(a)redhat.com>
Port to GDB-6.8pre.
Remove the `[' character from the GDB-6.8 default message.
+---
+ gdb/infrun.c | 2 +-
+ gdb/testsuite/gdb.base/catch-syscall.exp | 4 +--
+ gdb/testsuite/gdb.base/fork-detach.c | 57 ++++++++++++++++++++++++++++++++
+ gdb/testsuite/gdb.base/fork-detach.exp | 36 ++++++++++++++++++++
+ 4 files changed, 96 insertions(+), 3 deletions(-)
+ create mode 100644 gdb/testsuite/gdb.base/fork-detach.c
+ create mode 100644 gdb/testsuite/gdb.base/fork-detach.exp
-Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.base/fork-detach.c
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ gdb-7.10.90.20160211/gdb/testsuite/gdb.base/fork-detach.c 2016-02-15 23:25:36.686600598 +0100
+diff --git a/gdb/infrun.c b/gdb/infrun.c
+index 7e8d8da588..13d0fd2ad9 100644
+--- a/gdb/infrun.c
++++ b/gdb/infrun.c
+@@ -461,7 +461,7 @@ holding the child stopped. Try \"set detach-on-fork\" or \
+ remove_breakpoints_pid (ptid_get_pid (inferior_ptid));
+ }
+
+- if (info_verbose || debug_infrun)
++ if (1 /* Fedora Bug 235197 */ || info_verbose || debug_infrun)
+ {
+ /* Ensure that we have a process ptid. */
+ ptid_t process_ptid = pid_to_ptid (ptid_get_pid (child_ptid));
+diff --git a/gdb/testsuite/gdb.base/catch-syscall.exp b/gdb/testsuite/gdb.base/catch-syscall.exp
+index 2a8bf27e5c..20fa041155 100644
+--- a/gdb/testsuite/gdb.base/catch-syscall.exp
++++ b/gdb/testsuite/gdb.base/catch-syscall.exp
+@@ -179,7 +179,7 @@ proc check_for_program_end {} {
+ # Deleting the catchpoints
+ delete_breakpoints
+
+- gdb_continue_to_end
++ gdb_continue_to_end "" continue 1
+ }
+
+ proc test_catch_syscall_without_args {} {
+@@ -250,7 +250,7 @@ proc test_catch_syscall_with_wrong_args {} {
+ # If it doesn't, everything is right (since we don't have
+ # a syscall named "mlock" in it). Otherwise, this is a failure.
+ set thistest "catch syscall with unused syscall ($syscall_name)"
+- gdb_continue_to_end $thistest
++ gdb_continue_to_end $thistest continue 1
+ }
+ }
+
+diff --git a/gdb/testsuite/gdb.base/fork-detach.c b/gdb/testsuite/gdb.base/fork-detach.c
+new file mode 100644
+index 0000000000..0ba8f465f3
+--- /dev/null
++++ b/gdb/testsuite/gdb.base/fork-detach.c
@@ -0,0 +1,57 @@
+/* This testcase is part of GDB, the GNU debugger.
+
@@ -65,10 +119,11 @@ Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.base/fork-detach.c
+ }
+ return 0;
+}
-Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.base/fork-detach.exp
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ gdb-7.10.90.20160211/gdb/testsuite/gdb.base/fork-detach.exp 2016-02-15 23:27:55.792588265 +0100
+diff --git a/gdb/testsuite/gdb.base/fork-detach.exp b/gdb/testsuite/gdb.base/fork-detach.exp
+new file mode 100644
+index 0000000000..1f1fcef6c4
+--- /dev/null
++++ b/gdb/testsuite/gdb.base/fork-detach.exp
@@ -0,0 +1,36 @@
+# Copyright 2007 Free Software Foundation, Inc.
+
@@ -106,38 +161,6 @@ Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.base/fork-detach.exp
+gdb_test "" \
+ "Detaching after fork from child process.*\\\[Inferior .* exited normally\\\]" \
+ "Info message caught"
-Index: gdb-7.10.90.20160211/gdb/infrun.c
-===================================================================
---- gdb-7.10.90.20160211.orig/gdb/infrun.c 2016-02-15 23:25:01.432350289 +0100
-+++ gdb-7.10.90.20160211/gdb/infrun.c 2016-02-15 23:27:49.274541986 +0100
-@@ -478,7 +478,7 @@
- remove_breakpoints_pid (ptid_get_pid (inferior_ptid));
- }
-
-- if (info_verbose || debug_infrun)
-+ if (1 /* Fedora Bug 235197 */ || info_verbose || debug_infrun)
- {
- /* Ensure that we have a process ptid. */
- ptid_t process_ptid = pid_to_ptid (ptid_get_pid (child_ptid));
-Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.base/catch-syscall.exp
-===================================================================
---- gdb-7.10.90.20160211.orig/gdb/testsuite/gdb.base/catch-syscall.exp 2016-02-15 23:25:01.432350289 +0100
-+++ gdb-7.10.90.20160211/gdb/testsuite/gdb.base/catch-syscall.exp 2016-02-15 23:25:36.689600619 +0100
-@@ -165,7 +165,7 @@
- # Deleting the catchpoints
- delete_breakpoints
-
-- gdb_continue_to_end
-+ gdb_continue_to_end "" continue 1
- }
-
- proc test_catch_syscall_without_args {} {
-@@ -236,7 +236,7 @@
- # If it doesn't, everything is right (since we don't have
- # a syscall named "mlock" in it). Otherwise, this is a failure.
- set thistest "catch syscall with unused syscall ($syscall_name)"
-- gdb_continue_to_end $thistest
-+ gdb_continue_to_end $thistest continue 1
- }
- }
-
+--
+2.14.3
+
diff --git a/gdb-6.6-scheduler_locking-step-is-default.patch b/gdb-6.6-scheduler_locking-step-is-default.patch
index ad9f643..6cb23ab 100644
--- a/gdb-6.6-scheduler_locking-step-is-default.patch
+++ b/gdb-6.6-scheduler_locking-step-is-default.patch
@@ -1,8 +1,25 @@
-Index: gdb-7.12.50.20170207/gdb/infrun.c
-===================================================================
---- gdb-7.12.50.20170207.orig/gdb/infrun.c 2017-02-07 21:07:40.321202448 +0100
-+++ gdb-7.12.50.20170207/gdb/infrun.c 2017-02-07 21:07:42.680220365 +0100
-@@ -2218,7 +2218,7 @@
+From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
+From: Fedora GDB patches <invalid(a)email.com>
+Date: Fri, 27 Oct 2017 21:07:50 +0200
+Subject: gdb-6.6-scheduler_locking-step-is-default.patch
+
+FileName: gdb-6.6-scheduler_locking-step-is-default.patch
+
+;; Make upstream `set scheduler-locking step' as default.
+;;=push+jan: How much is scheduler-locking relevant after non-stop?
+---
+ gdb/infrun.c | 2 +-
+ gdb/testsuite/gdb.mi/mi-cli.exp | 2 +-
+ gdb/testsuite/gdb.mi/mi-console.exp | 3 +++
+ gdb/testsuite/gdb.mi/mi-logging.exp | 4 ++--
+ gdb/testsuite/gdb.opt/inline-cmds.exp | 2 +-
+ 5 files changed, 8 insertions(+), 5 deletions(-)
+
+diff --git a/gdb/infrun.c b/gdb/infrun.c
+index 13d0fd2ad9..8e30aed3b8 100644
+--- a/gdb/infrun.c
++++ b/gdb/infrun.c
+@@ -2202,7 +2202,7 @@ static const char *const scheduler_enums[] = {
schedlock_replay,
NULL
};
@@ -11,11 +28,11 @@ Index: gdb-7.12.50.20170207/gdb/infrun.c
static void
show_scheduler_mode (struct ui_file *file, int from_tty,
struct cmd_list_element *c, const char *value)
-Index: gdb-7.12.50.20170207/gdb/testsuite/gdb.mi/mi-cli.exp
-===================================================================
---- gdb-7.12.50.20170207.orig/gdb/testsuite/gdb.mi/mi-cli.exp 2017-02-07 21:07:40.322202455 +0100
-+++ gdb-7.12.50.20170207/gdb/testsuite/gdb.mi/mi-cli.exp 2017-02-07 21:07:42.680220365 +0100
-@@ -199,7 +199,7 @@
+diff --git a/gdb/testsuite/gdb.mi/mi-cli.exp b/gdb/testsuite/gdb.mi/mi-cli.exp
+index 6ce6439eb7..4f405b5fc1 100644
+--- a/gdb/testsuite/gdb.mi/mi-cli.exp
++++ b/gdb/testsuite/gdb.mi/mi-cli.exp
+@@ -199,7 +199,7 @@ mi_expect_stop "breakpoint-hit" "main" "" ".*basics.c" \
# Test that the token is output even for CLI commands
# Also test that *stopped includes frame information.
mi_gdb_test "34 next" \
@@ -24,11 +41,25 @@ Index: gdb-7.12.50.20170207/gdb/testsuite/gdb.mi/mi-cli.exp
"34 next: run"
# Test that the new current source line is output to the console
-Index: gdb-7.12.50.20170207/gdb/testsuite/gdb.mi/mi-logging.exp
-===================================================================
---- gdb-7.12.50.20170207.orig/gdb/testsuite/gdb.mi/mi-logging.exp 2017-02-07 21:07:42.681220372 +0100
-+++ gdb-7.12.50.20170207/gdb/testsuite/gdb.mi/mi-logging.exp 2017-02-07 21:09:36.950088269 +0100
-@@ -53,7 +53,7 @@
+diff --git a/gdb/testsuite/gdb.mi/mi-console.exp b/gdb/testsuite/gdb.mi/mi-console.exp
+index ec4b006018..05cf7fb889 100644
+--- a/gdb/testsuite/gdb.mi/mi-console.exp
++++ b/gdb/testsuite/gdb.mi/mi-console.exp
+@@ -60,6 +60,9 @@ if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {deb
+
+ mi_run_to_main
+
++# thread-id=\"all\" vs. thread-id=\"1\" below:
++mi_gdb_test "210-gdb-set scheduler-locking off" "210\\^done" "set scheduler-locking off"
++
+ # The output we get from the target depends on how it is hosted. If
+ # we are semihosted (e.g., the sim or a remote target that supports
+ # the File I/O remote protocol extension), we see the target I/O
+diff --git a/gdb/testsuite/gdb.mi/mi-logging.exp b/gdb/testsuite/gdb.mi/mi-logging.exp
+index b09cde2d37..e51d46edb5 100644
+--- a/gdb/testsuite/gdb.mi/mi-logging.exp
++++ b/gdb/testsuite/gdb.mi/mi-logging.exp
+@@ -53,7 +53,7 @@ close $chan
set mi_log_prompt "\[(\]gdb\[)\] \[\r\n\]+"
@@ -37,7 +68,7 @@ Index: gdb-7.12.50.20170207/gdb/testsuite/gdb.mi/mi-logging.exp
pass "log file contents"
} else {
fail "log file contents"
-@@ -76,7 +76,7 @@
+@@ -76,7 +76,7 @@ set chan [open $milogfile]
set logcontent [read $chan]
close $chan
@@ -46,25 +77,11 @@ Index: gdb-7.12.50.20170207/gdb/testsuite/gdb.mi/mi-logging.exp
pass "redirect log file contents"
} else {
fail "redirect log file contents"
-Index: gdb-7.12.50.20170207/gdb/testsuite/gdb.mi/mi-console.exp
-===================================================================
---- gdb-7.12.50.20170207.orig/gdb/testsuite/gdb.mi/mi-console.exp 2017-02-07 21:07:40.323202463 +0100
-+++ gdb-7.12.50.20170207/gdb/testsuite/gdb.mi/mi-console.exp 2017-02-07 21:07:42.681220372 +0100
-@@ -60,6 +60,9 @@
-
- mi_run_to_main
-
-+# thread-id=\"all\" vs. thread-id=\"1\" below:
-+mi_gdb_test "210-gdb-set scheduler-locking off" "210\\^done" "set scheduler-locking off"
-+
- # The output we get from the target depends on how it is hosted. If
- # we are semihosted (e.g., the sim or a remote target that supports
- # the File I/O remote protocol extension), we see the target I/O
-Index: gdb-7.12.50.20170207/gdb/testsuite/gdb.opt/inline-cmds.exp
-===================================================================
---- gdb-7.12.50.20170207.orig/gdb/testsuite/gdb.opt/inline-cmds.exp 2017-02-07 21:07:40.323202463 +0100
-+++ gdb-7.12.50.20170207/gdb/testsuite/gdb.opt/inline-cmds.exp 2017-02-07 21:07:42.681220372 +0100
-@@ -331,7 +331,7 @@
+diff --git a/gdb/testsuite/gdb.opt/inline-cmds.exp b/gdb/testsuite/gdb.opt/inline-cmds.exp
+index 5227d63f5d..782f31c080 100644
+--- a/gdb/testsuite/gdb.opt/inline-cmds.exp
++++ b/gdb/testsuite/gdb.opt/inline-cmds.exp
+@@ -331,7 +331,7 @@ proc mi_cli_step {cli_output_re message} {
send_gdb "interpreter-exec console \"step\"\n"
gdb_expect {
@@ -73,3 +90,6 @@ Index: gdb-7.12.50.20170207/gdb/testsuite/gdb.opt/inline-cmds.exp
pass $message
}
timeout {
+--
+2.14.3
+
diff --git a/gdb-6.8-bz436037-reg-no-longer-active.patch b/gdb-6.8-bz436037-reg-no-longer-active.patch
new file mode 100644
index 0000000..177e024
--- /dev/null
+++ b/gdb-6.8-bz436037-reg-no-longer-active.patch
@@ -0,0 +1,46 @@
+From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
+From: Fedora GDB patches <invalid(a)email.com>
+Date: Fri, 27 Oct 2017 21:07:50 +0200
+Subject: gdb-6.8-bz436037-reg-no-longer-active.patch
+
+FileName: gdb-6.8-bz436037-reg-no-longer-active.patch
+
+;; Fix register assignments with no GDB stack frames (BZ 436037).
+;;=push+jan: This fix is incorrect.
+---
+ gdb/valops.c | 12 ++++++++++--
+ 1 file changed, 10 insertions(+), 2 deletions(-)
+
+diff --git a/gdb/valops.c b/gdb/valops.c
+index 9b25980090..7aacd17d70 100644
+--- a/gdb/valops.c
++++ b/gdb/valops.c
+@@ -1103,6 +1103,8 @@ value_assign (struct value *toval, struct value *fromval)
+ struct gdbarch *gdbarch;
+ int value_reg;
+
++ value_reg = VALUE_REGNUM (toval);
++
+ /* Figure out which frame this is in currently.
+
+ We use VALUE_FRAME_ID for obtaining the value's frame id instead of
+@@ -1112,8 +1114,14 @@ value_assign (struct value *toval, struct value *fromval)
+ frame. */
+ frame = frame_find_by_id (VALUE_FRAME_ID (toval));
+
+- value_reg = VALUE_REGNUM (toval);
+-
++ /* "set $reg+=1" should work on programs with no debug info,
++ but frame_find_by_id returns NULL here (RH bug 436037).
++ Use current frame, it represents CPU state in this case.
++ If frame_find_by_id is changed to do it internally
++ (it is contemplated there), remove this. */
++ if (!frame)
++ frame = get_current_frame ();
++ /* Probably never happens. */
+ if (!frame)
+ error (_("Value being assigned to is no longer active."));
+
+--
+2.14.3
+
diff --git a/gdb-6.8-quit-never-aborts.patch b/gdb-6.8-quit-never-aborts.patch
deleted file mode 100644
index 0dc71b8..0000000
--- a/gdb-6.8-quit-never-aborts.patch
+++ /dev/null
@@ -1,74 +0,0 @@
-We may abort the process of detaching threads with multiple SIGINTs - which are
-being sent during a testcase terminating its child GDB.
-
-Some of the threads may not be properly PTRACE_DETACHed which hurts if they
-should have been detached with SIGSTOP (as they are accidentally left running
-on the debugger termination).
-
-Index: gdb-7.12.50.20170207/gdb/defs.h
-===================================================================
---- gdb-7.12.50.20170207.orig/gdb/defs.h 2017-02-26 21:11:35.654350580 +0100
-+++ gdb-7.12.50.20170207/gdb/defs.h 2017-02-26 21:11:52.932473129 +0100
-@@ -169,6 +169,10 @@
- /* Flag that function quit should call quit_force. */
- extern volatile int sync_quit_force_run;
-
-+#ifdef NEED_DETACH_SIGSTOP
-+extern int quit_flag_cleanup;
-+#endif
-+
- extern void quit (void);
-
- /* Helper for the QUIT macro. */
-Index: gdb-7.12.50.20170207/gdb/extension.c
-===================================================================
---- gdb-7.12.50.20170207.orig/gdb/extension.c 2017-02-26 21:11:35.655350587 +0100
-+++ gdb-7.12.50.20170207/gdb/extension.c 2017-02-26 21:11:52.933473136 +0100
-@@ -830,6 +830,11 @@
- int i, result = 0;
- const struct extension_language_defn *extlang;
-
-+#ifdef NEED_DETACH_SIGSTOP
-+ if (quit_flag_cleanup)
-+ return 0;
-+#endif
-+
- ALL_ENABLED_EXTENSION_LANGUAGES (i, extlang)
- {
- if (extlang->ops->check_quit_flag != NULL)
-Index: gdb-7.12.50.20170207/gdb/top.c
-===================================================================
---- gdb-7.12.50.20170207.orig/gdb/top.c 2017-02-26 21:11:35.655350587 +0100
-+++ gdb-7.12.50.20170207/gdb/top.c 2017-02-26 21:11:52.933473136 +0100
-@@ -1619,7 +1619,13 @@
- qt.args = NULL;
- qt.from_tty = from_tty;
-
-+#ifndef NEED_DETACH_SIGSTOP
- /* We want to handle any quit errors and exit regardless. */
-+#else
-+ /* We want to handle any quit errors and exit regardless but we should never
-+ get user-interrupted to properly detach the inferior. */
-+ quit_flag_cleanup = 1;
-+#endif
-
- /* Get out of tfind mode, and kill or detach all inferiors. */
- TRY
-Index: gdb-7.12.50.20170207/gdb/utils.c
-===================================================================
---- gdb-7.12.50.20170207.orig/gdb/utils.c 2017-02-26 21:11:35.657350601 +0100
-+++ gdb-7.12.50.20170207/gdb/utils.c 2017-02-26 21:11:52.934473143 +0100
-@@ -106,6 +106,13 @@
-
- int job_control;
-
-+#ifdef NEED_DETACH_SIGSTOP
-+/* Nonzero means we are already processing the quitting cleanups and we should
-+ no longer get aborted. */
-+
-+int quit_flag_cleanup;
-+#endif
-+
- /* Nonzero means that strings with character values >0x7F should be printed
- as octal escapes. Zero means just print the value (e.g. it's an
- international character, and the terminal or window can cope.) */
diff --git a/gdb-6.8-sparc64-silence-memcpy-check.patch b/gdb-6.8-sparc64-silence-memcpy-check.patch
index 6df8c9a..a150442 100644
--- a/gdb-6.8-sparc64-silence-memcpy-check.patch
+++ b/gdb-6.8-sparc64-silence-memcpy-check.patch
@@ -1,8 +1,21 @@
-Index: gdb-7.4.50.20111218/gdb/sparc-tdep.c
-===================================================================
---- gdb-7.4.50.20111218.orig/gdb/sparc-tdep.c 2011-09-28 19:59:42.000000000 +0200
-+++ gdb-7.4.50.20111218/gdb/sparc-tdep.c 2011-12-19 01:25:29.294046199 +0100
-@@ -1316,6 +1316,7 @@ sparc32_store_return_value (struct type
+From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
+From: Fedora GDB patches <invalid(a)email.com>
+Date: Fri, 27 Oct 2017 21:07:50 +0200
+Subject: gdb-6.8-sparc64-silence-memcpy-check.patch
+
+FileName: gdb-6.8-sparc64-silence-memcpy-check.patch
+
+;; Silence memcpy check which returns false positive (sparc64)
+;;=push: But it is just a GCC workaround, look up the existing GCC PR for it.
+---
+ gdb/sparc-tdep.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/gdb/sparc-tdep.c b/gdb/sparc-tdep.c
+index 12fd5b9e64..e304ba8dbc 100644
+--- a/gdb/sparc-tdep.c
++++ b/gdb/sparc-tdep.c
+@@ -1444,6 +1444,7 @@ sparc32_store_return_value (struct type *type, struct regcache *regcache,
if (sparc_floating_p (type) || sparc_complex_floating_p (type))
{
/* Floating return values. */
@@ -10,3 +23,6 @@ Index: gdb-7.4.50.20111218/gdb/sparc-tdep.c
memcpy (buf, valbuf, len);
regcache_cooked_write (regcache, SPARC_F0_REGNUM, buf);
if (len > 4)
+--
+2.14.3
+
diff --git a/gdb-7.2.50-sparc-add-workaround-to-broken-debug-files.patch b/gdb-7.2.50-sparc-add-workaround-to-broken-debug-files.patch
index 53ed2cb..cd64dc1 100644
--- a/gdb-7.2.50-sparc-add-workaround-to-broken-debug-files.patch
+++ b/gdb-7.2.50-sparc-add-workaround-to-broken-debug-files.patch
@@ -1,7 +1,30 @@
-Index: gdb-7.9.90.20150709/gdb/gdb_bfd.c
-===================================================================
---- gdb-7.9.90.20150709.orig/gdb/gdb_bfd.c 2015-07-09 18:23:59.344017882 +0200
-+++ gdb-7.9.90.20150709/gdb/gdb_bfd.c 2015-07-09 18:24:06.986083071 +0200
+From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
+From: Fedora GDB patches <invalid(a)email.com>
+Date: Fri, 27 Oct 2017 21:07:50 +0200
+Subject: gdb-7.2.50-sparc-add-workaround-to-broken-debug-files.patch
+
+FileName: gdb-7.2.50-sparc-add-workaround-to-broken-debug-files.patch
+
+;; Toolchain on sparc is slightly broken and debuginfo files are generated
+;; with non 64bit aligned tables/offsets.
+;; See for example readelf -S ../Xvnc.debug.
+;;
+;; As a consenquence calculation of sectp->filepos as used in
+;; dwarf2_read_section (gdb/dwarf2read.c:1525) will return a non aligned buffer
+;; that cannot be used directly as done with MMAP.
+;; Usage will result in a BusError.
+;;
+;; While we figure out what's wrong in the toolchain and do a full archive
+;; rebuild to fix it, we need to be able to use gdb :)
+;;=push
+---
+ gdb/gdb_bfd.c | 6 ++++++
+ 1 file changed, 6 insertions(+)
+
+diff --git a/gdb/gdb_bfd.c b/gdb/gdb_bfd.c
+index 80ddd427af..3e4d3e4444 100644
+--- a/gdb/gdb_bfd.c
++++ b/gdb/gdb_bfd.c
@@ -24,12 +24,14 @@
#include "hashtab.h"
#include "filestuff.h"
@@ -17,7 +40,7 @@ Index: gdb-7.9.90.20150709/gdb/gdb_bfd.c
#include "target.h"
#include "gdb/fileio.h"
#include "inferior.h"
-@@ -397,6 +399,7 @@ free_one_bfd_section (bfd *abfd, asectio
+@@ -484,6 +486,7 @@ free_one_bfd_section (bfd *abfd, asection *sectp, void *ignore)
if (sect != NULL && sect->data != NULL)
{
@@ -25,15 +48,15 @@ Index: gdb-7.9.90.20150709/gdb/gdb_bfd.c
#ifdef HAVE_MMAP
if (sect->map_addr != NULL)
{
-@@ -407,6 +410,7 @@ free_one_bfd_section (bfd *abfd, asectio
+@@ -493,6 +496,7 @@ free_one_bfd_section (bfd *abfd, asection *sectp, void *ignore)
+ gdb_assert (res == 0);
}
else
- #endif
+#endif
+ #endif
xfree (sect->data);
}
- }
-@@ -558,6 +562,7 @@ gdb_bfd_map_section (asection *sectp, bf
+@@ -659,6 +663,7 @@ gdb_bfd_map_section (asection *sectp, bfd_size_type *size)
if (descriptor->data != NULL)
goto done;
@@ -41,7 +64,7 @@ Index: gdb-7.9.90.20150709/gdb/gdb_bfd.c
#ifdef HAVE_MMAP
if (!bfd_is_section_compressed (abfd, sectp))
{
-@@ -592,6 +597,7 @@ gdb_bfd_map_section (asection *sectp, bf
+@@ -693,6 +698,7 @@ gdb_bfd_map_section (asection *sectp, bfd_size_type *size)
}
}
#endif /* HAVE_MMAP */
@@ -49,3 +72,6 @@ Index: gdb-7.9.90.20150709/gdb/gdb_bfd.c
/* Handle compressed sections, or ordinary uncompressed sections in
the no-mmap case. */
+--
+2.14.3
+
diff --git a/gdb-add-index-chmod.patch b/gdb-add-index-chmod.patch
deleted file mode 100644
index 00b37c4..0000000
--- a/gdb-add-index-chmod.patch
+++ /dev/null
@@ -1,69 +0,0 @@
-http://sourceware.org/ml/gdb-patches/2017-01/msg00110.html
-Subject: [patch] contrib/gdb-add-index.sh: chmod u+w
-
-
---AhhlLboLdkugWU4S
-Content-Type: text/plain; charset=us-ascii
-Content-Disposition: inline
-
-Hi,
-
-in Fedora 24 it still worked, in Fedora 25 it does not - *-debuginfo.rpm
-no longer have the .gdb_index accelerating section now.
-
-It happens because:
-objcopy: unable to copy file 'foo.debug'; reason: Permission denied
-
-*.debug files in Fedora were always 444 but the time gdb-add-index is run is
-still before the *.debug split and in Fedora 24 the files were -rwxr-xr-x
-that time while in Fedora 25 they are apparently no longer w.
-
-OK for check-in?
-
-
-Jan
-
---AhhlLboLdkugWU4S
-Content-Type: text/plain; charset=us-ascii
-Content-Disposition: inline; filename=1
-
-gdb/ChangeLog
-2017-01-06 Jan Kratochvil <jan.kratochvil(a)redhat.com>
-
- * contrib/gdb-add-index.sh: Use chmod u+w for $file.
-
-diff --git a/gdb/contrib/gdb-add-index.sh b/gdb/contrib/gdb-add-index.sh
-index 0cd4ce3..5a190a0 100755
---- a/gdb/contrib/gdb-add-index.sh
-+++ b/gdb/contrib/gdb-add-index.sh
-@@ -38,10 +38,11 @@ fi
- dir="${file%/*}"
- test "$dir" = "$file" && dir="."
- index="${file}.gdb-index"
-+mode="${file}.mode"
-
--rm -f $index
-+rm -f $index $mode
- # Ensure intermediate index file is removed when we exit.
--trap "rm -f $index" 0
-+trap "rm -f $index $mode" 0
-
- $GDB --batch -nx -iex 'set auto-load no' \
- -ex "file $file" -ex "save gdb-index $dir" || {
-@@ -58,8 +59,13 @@ $GDB --batch -nx -iex 'set auto-load no' \
- status=0
-
- if test -f "$index"; then
-+ touch "$mode"
-+ chmod --reference="$file" "$mode"
-+ # objcopy: unable to copy file 'foo.debug'; reason: Permission denied
-+ chmod u+w "$file"
- $OBJCOPY --add-section .gdb_index="$index" \
- --set-section-flags .gdb_index=readonly "$file" "$file"
-+ chmod --reference="$mode" "$file"
- status=$?
- else
- echo "$myname: No index was created for $file" 1>&2
-
---AhhlLboLdkugWU4S--
-
diff --git a/gdb-archer-pie-addons-keep-disabled.patch b/gdb-archer-pie-addons-keep-disabled.patch
new file mode 100644
index 0000000..bb5aa1f
--- /dev/null
+++ b/gdb-archer-pie-addons-keep-disabled.patch
@@ -0,0 +1,102 @@
+From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
+From: Fedora GDB patches <invalid(a)email.com>
+Date: Fri, 27 Oct 2017 21:07:50 +0200
+Subject: gdb-archer-pie-addons-keep-disabled.patch
+
+FileName: gdb-archer-pie-addons-keep-disabled.patch
+
+;;=push+jan: Breakpoints disabling matching should not be based on address.
+---
+ gdb/breakpoint.c | 44 ++++++++++++++++++++++++++++++++++++++++++++
+ gdb/breakpoint.h | 3 +++
+ gdb/objfiles.c | 5 +++++
+ 3 files changed, 52 insertions(+)
+
+diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c
+index 2b5eebbbee..814802a0a1 100644
+--- a/gdb/breakpoint.c
++++ b/gdb/breakpoint.c
+@@ -15590,6 +15590,50 @@ initialize_breakpoint_ops (void)
+
+ static struct cmd_list_element *enablebreaklist = NULL;
+
++void
++breakpoints_relocate (struct objfile *objfile, struct section_offsets *delta)
++{
++ struct bp_location *bl, **blp_tmp;
++ int changed = 0;
++
++ gdb_assert (objfile->separate_debug_objfile_backlink == NULL);
++
++ ALL_BP_LOCATIONS (bl, blp_tmp)
++ {
++ struct obj_section *osect;
++
++ /* BL->SECTION can be correctly NULL for breakpoints with multiple
++ locations expanded through symtab. */
++
++ ALL_OBJFILE_OSECTIONS (objfile, osect)
++ {
++ CORE_ADDR relocated_address;
++ CORE_ADDR delta_offset;
++
++ delta_offset = ANOFFSET (delta, osect->the_bfd_section->index);
++ if (delta_offset == 0)
++ continue;
++ relocated_address = bl->address + delta_offset;
++
++ if (obj_section_addr (osect) <= relocated_address
++ && relocated_address < obj_section_endaddr (osect))
++ {
++ if (bl->inserted)
++ remove_breakpoint (bl);
++
++ bl->address += delta_offset;
++ bl->requested_address += delta_offset;
++
++ changed = 1;
++ }
++ }
++ }
++
++ if (changed)
++ qsort (bp_locations, bp_locations_count, sizeof (*bp_locations),
++ bp_locations_compare);
++}
++
+ void
+ _initialize_breakpoint (void)
+ {
+diff --git a/gdb/breakpoint.h b/gdb/breakpoint.h
+index 8bb81d8d17..3fddbaa713 100644
+--- a/gdb/breakpoint.h
++++ b/gdb/breakpoint.h
+@@ -1656,6 +1656,9 @@ extern const char *ep_parse_optional_if_clause (const char **arg);
+ UIOUT iff debugging multiple threads. */
+ extern void maybe_print_thread_hit_breakpoint (struct ui_out *uiout);
+
++extern void breakpoints_relocate (struct objfile *objfile,
++ struct section_offsets *delta);
++
+ /* Print the specified breakpoint. */
+ extern void print_breakpoint (breakpoint *bp);
+
+diff --git a/gdb/objfiles.c b/gdb/objfiles.c
+index 7adaef119d..2f061b47f7 100644
+--- a/gdb/objfiles.c
++++ b/gdb/objfiles.c
+@@ -879,6 +879,11 @@ objfile_relocate1 (struct objfile *objfile,
+ obj_section_addr (s));
+ }
+
++ /* Final call of breakpoint_re_set can keep breakpoint locations disabled if
++ their addresses match. */
++ if (objfile->separate_debug_objfile_backlink == NULL)
++ breakpoints_relocate (objfile, delta);
++
+ /* Data changed. */
+ return 1;
+ }
+--
+2.14.3
+
diff --git a/gdb-archer-pie-addons.patch b/gdb-archer-pie-addons.patch
index 240b17e..8052547 100644
--- a/gdb-archer-pie-addons.patch
+++ b/gdb-archer-pie-addons.patch
@@ -1,8 +1,21 @@
-Index: gdb-7.9.50.20150520/gdb/gdbtypes.h
-===================================================================
---- gdb-7.9.50.20150520.orig/gdb/gdbtypes.h 2015-05-31 16:55:29.723475485 +0200
-+++ gdb-7.9.50.20150520/gdb/gdbtypes.h 2015-05-31 16:55:49.716601669 +0200
-@@ -462,6 +462,7 @@ enum field_loc_kind
+From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
+From: Fedora GDB patches <invalid(a)email.com>
+Date: Fri, 27 Oct 2017 21:07:50 +0200
+Subject: gdb-archer-pie-addons.patch
+
+FileName: gdb-archer-pie-addons.patch
+
+;;=push+jan: May get obsoleted by Tom's unrelocated objfiles patch.
+---
+ gdb/gdbtypes.h | 5 +++++
+ gdb/value.c | 3 ++-
+ 2 files changed, 7 insertions(+), 1 deletion(-)
+
+diff --git a/gdb/gdbtypes.h b/gdb/gdbtypes.h
+index 923ba101ca..9703d966a7 100644
+--- a/gdb/gdbtypes.h
++++ b/gdb/gdbtypes.h
+@@ -443,6 +443,7 @@ enum field_loc_kind
{
FIELD_LOC_KIND_BITPOS, /**< bitpos */
FIELD_LOC_KIND_ENUMVAL, /**< enumval */
@@ -10,7 +23,7 @@ Index: gdb-7.9.50.20150520/gdb/gdbtypes.h
FIELD_LOC_KIND_PHYSADDR, /**< physaddr */
FIELD_LOC_KIND_PHYSNAME, /**< physname */
FIELD_LOC_KIND_DWARF_BLOCK /**< dwarf_block */
-@@ -513,6 +514,7 @@ union field_location
+@@ -494,6 +495,7 @@ union field_location
field. Otherwise, physname is the mangled label of the
static field. */
@@ -18,7 +31,7 @@ Index: gdb-7.9.50.20150520/gdb/gdbtypes.h
CORE_ADDR physaddr;
const char *physname;
-@@ -1386,6 +1388,7 @@ extern void set_type_vptr_basetype (stru
+@@ -1342,6 +1344,7 @@ extern void set_type_vptr_basetype (struct type *, struct type *);
#define FIELD_ENUMVAL_LVAL(thisfld) ((thisfld).loc.enumval)
#define FIELD_ENUMVAL(thisfld) (FIELD_ENUMVAL_LVAL (thisfld) + 0)
#define FIELD_STATIC_PHYSNAME(thisfld) ((thisfld).loc.physname)
@@ -26,7 +39,7 @@ Index: gdb-7.9.50.20150520/gdb/gdbtypes.h
#define FIELD_STATIC_PHYSADDR(thisfld) ((thisfld).loc.physaddr)
#define FIELD_DWARF_BLOCK(thisfld) ((thisfld).loc.dwarf_block)
#define SET_FIELD_BITPOS(thisfld, bitpos) \
-@@ -1397,6 +1400,7 @@ extern void set_type_vptr_basetype (stru
+@@ -1353,6 +1356,7 @@ extern void set_type_vptr_basetype (struct type *, struct type *);
#define SET_FIELD_PHYSNAME(thisfld, name) \
(FIELD_LOC_KIND (thisfld) = FIELD_LOC_KIND_PHYSNAME, \
FIELD_STATIC_PHYSNAME (thisfld) = (name))
@@ -34,7 +47,7 @@ Index: gdb-7.9.50.20150520/gdb/gdbtypes.h
#define SET_FIELD_PHYSADDR(thisfld, addr) \
(FIELD_LOC_KIND (thisfld) = FIELD_LOC_KIND_PHYSADDR, \
FIELD_STATIC_PHYSADDR (thisfld) = (addr))
-@@ -1413,6 +1417,7 @@ extern void set_type_vptr_basetype (stru
+@@ -1369,6 +1373,7 @@ extern void set_type_vptr_basetype (struct type *, struct type *);
#define TYPE_FIELD_BITPOS(thistype, n) FIELD_BITPOS (TYPE_FIELD (thistype, n))
#define TYPE_FIELD_ENUMVAL(thistype, n) FIELD_ENUMVAL (TYPE_FIELD (thistype, n))
#define TYPE_FIELD_STATIC_PHYSNAME(thistype, n) FIELD_STATIC_PHYSNAME (TYPE_FIELD (thistype, n))
@@ -42,11 +55,11 @@ Index: gdb-7.9.50.20150520/gdb/gdbtypes.h
#define TYPE_FIELD_STATIC_PHYSADDR(thistype, n) FIELD_STATIC_PHYSADDR (TYPE_FIELD (thistype, n))
#define TYPE_FIELD_DWARF_BLOCK(thistype, n) FIELD_DWARF_BLOCK (TYPE_FIELD (thistype, n))
#define TYPE_FIELD_ARTIFICIAL(thistype, n) FIELD_ARTIFICIAL(TYPE_FIELD(thistype,n))
-Index: gdb-7.9.50.20150520/gdb/value.c
-===================================================================
---- gdb-7.9.50.20150520.orig/gdb/value.c 2015-05-31 16:55:29.725475497 +0200
-+++ gdb-7.9.50.20150520/gdb/value.c 2015-05-31 16:55:30.821482415 +0200
-@@ -2951,7 +2951,8 @@ value_static_field (struct type *type, i
+diff --git a/gdb/value.c b/gdb/value.c
+index d4b4673f66..558d0bbd7a 100644
+--- a/gdb/value.c
++++ b/gdb/value.c
+@@ -2966,7 +2966,8 @@ value_static_field (struct type *type, int fieldno)
{
case FIELD_LOC_KIND_PHYSADDR:
retval = value_at_lazy (TYPE_FIELD_TYPE (type, fieldno),
@@ -56,3 +69,6 @@ Index: gdb-7.9.50.20150520/gdb/value.c
break;
case FIELD_LOC_KIND_PHYSNAME:
{
+--
+2.14.3
+
diff --git a/gdb-archer-vla-tests.patch b/gdb-archer-vla-tests.patch
deleted file mode 100644
index 6c8a3a6..0000000
--- a/gdb-archer-vla-tests.patch
+++ /dev/null
@@ -1,3735 +0,0 @@
-Index: gdb-7.12.50.20170207/gdb/testsuite/gdb.ada/packed_array.exp
-===================================================================
---- gdb-7.12.50.20170207.orig/gdb/testsuite/gdb.ada/packed_array.exp 2017-02-26 19:15:28.552824751 +0100
-+++ gdb-7.12.50.20170207/gdb/testsuite/gdb.ada/packed_array.exp 2017-02-26 19:15:36.597882316 +0100
-@@ -56,5 +56,11 @@
- # are. Observed with (FSF GNU Ada 4.5.3 20110124).
- xfail $test
- }
-+ -re "= \\(\\)\[\r\n\]+$gdb_prompt $" {
-+ # archer-jankratochvil-vla resolves it as a dynamic type resolved as an
-+ # empty array [0..-1].
-+ # DW_AT_upper_bound : (DW_OP_fbreg: -48; DW_OP_deref)
-+ xfail $test
-+ }
- }
-
-Index: gdb-7.12.50.20170207/gdb/testsuite/gdb.arch/x86_64-vla-pointer-foo.S
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ gdb-7.12.50.20170207/gdb/testsuite/gdb.arch/x86_64-vla-pointer-foo.S 2017-02-26 19:15:36.598882323 +0100
-@@ -0,0 +1,358 @@
-+ .file "x86_64-vla-pointer.c"
-+ .text
-+.Ltext0:
-+ .globl foo
-+ .type foo, @function
-+foo:
-+.LFB0:
-+ .file 1 "gdb.arch/x86_64-vla-pointer.c"
-+ # gdb.arch/x86_64-vla-pointer.c:22
-+ .loc 1 22 0
-+ .cfi_startproc
-+# BLOCK 2 seq:0
-+# PRED: ENTRY (FALLTHRU)
-+ pushq %rbp
-+ .cfi_def_cfa_offset 16
-+ .cfi_offset 6, -16
-+ movq %rsp, %rbp
-+ .cfi_def_cfa_register 6
-+ pushq %rbx
-+ subq $56, %rsp
-+ .cfi_offset 3, -24
-+ movl %edi, -52(%rbp)
-+ # gdb.arch/x86_64-vla-pointer.c:22
-+ .loc 1 22 0
-+ movq %rsp, %rax
-+ movq %rax, %rsi
-+ # gdb.arch/x86_64-vla-pointer.c:23
-+ .loc 1 23 0
-+ movl -52(%rbp), %eax
-+ movslq %eax, %rdx
-+ subq $1, %rdx
-+ movq %rdx, -32(%rbp)
-+ movslq %eax, %rdx
-+ movq %rdx, %r8
-+ movl $0, %r9d
-+ # gdb.arch/x86_64-vla-pointer.c:24
-+ .loc 1 24 0
-+ movslq %eax, %rdx
-+ movq %rdx, %rcx
-+ movl $0, %ebx
-+ cltq
-+ movl $16, %edx
-+ subq $1, %rdx
-+ addq %rdx, %rax
-+ movl $16, %ebx
-+ movl $0, %edx
-+ divq %rbx
-+ imulq $16, %rax, %rax
-+ subq %rax, %rsp
-+ movq %rsp, %rax
-+ addq $0, %rax
-+ movq %rax, -40(%rbp)
-+ # gdb.arch/x86_64-vla-pointer.c:27
-+ .loc 1 27 0
-+ movl $0, -20(%rbp)
-+# SUCC: 4 [100.0%]
-+ jmp .L2
-+# BLOCK 3 seq:1
-+# PRED: 4
-+.L3:
-+ # gdb.arch/x86_64-vla-pointer.c:28
-+ .loc 1 28 0 discriminator 3
-+ movl -20(%rbp), %eax
-+ movl %eax, %ecx
-+ movq -40(%rbp), %rdx
-+ movl -20(%rbp), %eax
-+ cltq
-+ movb %cl, (%rdx,%rax)
-+# SUCC: 4 (FALLTHRU,DFS_BACK)
-+ # gdb.arch/x86_64-vla-pointer.c:27
-+ .loc 1 27 0 discriminator 3
-+ addl $1, -20(%rbp)
-+# BLOCK 4 seq:2
-+# PRED: 3 (FALLTHRU,DFS_BACK) 2 [100.0%]
-+.L2:
-+ # gdb.arch/x86_64-vla-pointer.c:27
-+ .loc 1 27 0 is_stmt 0 discriminator 1
-+ movl -20(%rbp), %eax
-+ cmpl -52(%rbp), %eax
-+# SUCC: 3 5 (FALLTHRU)
-+ jl .L3
-+# BLOCK 5 seq:3
-+# PRED: 4 (FALLTHRU)
-+ # gdb.arch/x86_64-vla-pointer.c:30
-+ .loc 1 30 0 is_stmt 1
-+ movq -40(%rbp), %rax
-+ movb $0, (%rax)
-+ movq %rsi, %rsp
-+ # gdb.arch/x86_64-vla-pointer.c:31
-+ .loc 1 31 0
-+ nop
-+ movq -8(%rbp), %rbx
-+ leave
-+ .cfi_def_cfa 7, 8
-+# SUCC: EXIT [100.0%]
-+ ret
-+ .cfi_endproc
-+.LFE0:
-+ .size foo, .-foo
-+.Letext0:
-+ .section .debug_info,"",@progbits
-+.Ldebug_info0:
-+ .long 0xa5 # Length of Compilation Unit Info
-+ .value 0x4 # DWARF version number
-+ .long .Ldebug_abbrev0 # Offset Into Abbrev. Section
-+ .byte 0x8 # Pointer Size (in bytes)
-+ .uleb128 0x1 # (DIE (0xb) DW_TAG_compile_unit)
-+ .long .LASF3 # DW_AT_producer: "GNU C11 6.2.1 20160916 (Red Hat 6.2.1-2) -mtune=generic -march=x86-64 -g"
-+ .byte 0xc # DW_AT_language
-+ .long .LASF4 # DW_AT_name: "gdb.arch/x86_64-vla-pointer.c"
-+ .long .LASF5 # DW_AT_comp_dir: "/home/jkratoch/redhat/fedora/gdb/master/gdb-7.12/gdb/testsuite"
-+ .quad .Ltext0 # DW_AT_low_pc
-+ .quad .Letext0-.Ltext0 # DW_AT_high_pc
-+ .long .Ldebug_line0 # DW_AT_stmt_list
-+ .uleb128 0x2 # (DIE (0x2d) DW_TAG_subprogram)
-+ # DW_AT_external
-+ .ascii "foo\0" # DW_AT_name
-+ .byte 0x1 # DW_AT_decl_file (gdb.arch/x86_64-vla-pointer.c)
-+ .byte 0x15 # DW_AT_decl_line
-+ # DW_AT_prototyped
-+ .quad .LFB0 # DW_AT_low_pc
-+ .quad .LFE0-.LFB0 # DW_AT_high_pc
-+ .uleb128 0x1 # DW_AT_frame_base
-+ .byte 0x9c # DW_OP_call_frame_cfa
-+ # DW_AT_GNU_all_call_sites
-+ .long 0x80 # DW_AT_sibling
-+ .uleb128 0x3 # (DIE (0x4a) DW_TAG_formal_parameter)
-+ .long .LASF6 # DW_AT_name: "size"
-+ .byte 0x1 # DW_AT_decl_file (gdb.arch/x86_64-vla-pointer.c)
-+ .byte 0x15 # DW_AT_decl_line
-+ .long 0x80 # DW_AT_type
-+ .uleb128 0x3 # DW_AT_location
-+ .byte 0x91 # DW_OP_fbreg
-+ .sleb128 -68
-+ .uleb128 0x4 # (DIE (0x59) DW_TAG_typedef)
-+ .long .LASF7 # DW_AT_name: "array_t"
-+ .byte 0x1 # DW_AT_decl_file (gdb.arch/x86_64-vla-pointer.c)
-+ .byte 0x17 # DW_AT_decl_line
-+ .long 0x87 # DW_AT_type
-+ .uleb128 0x5 # (DIE (0x64) DW_TAG_variable)
-+ .long .LASF0 # DW_AT_name: "array"
-+ .byte 0x1 # DW_AT_decl_file (gdb.arch/x86_64-vla-pointer.c)
-+ .byte 0x18 # DW_AT_decl_line
-+ .long 0x59 # DW_AT_type
-+ .uleb128 0x3 # DW_AT_location
-+ .byte 0x91 # DW_OP_fbreg
-+ .sleb128 -56
-+ .byte 0x6 # DW_OP_deref
-+ .uleb128 0x6 # (DIE (0x73) DW_TAG_variable)
-+ .ascii "i\0" # DW_AT_name
-+ .byte 0x1 # DW_AT_decl_file (gdb.arch/x86_64-vla-pointer.c)
-+ .byte 0x19 # DW_AT_decl_line
-+ .long 0x80 # DW_AT_type
-+ .uleb128 0x2 # DW_AT_location
-+ .byte 0x91 # DW_OP_fbreg
-+ .sleb128 -36
-+ .byte 0 # end of children of DIE 0x2d
-+ .uleb128 0x7 # (DIE (0x80) DW_TAG_base_type)
-+ .byte 0x4 # DW_AT_byte_size
-+ .byte 0x5 # DW_AT_encoding
-+ .ascii "int\0" # DW_AT_name
-+ .uleb128 0x8 # (DIE (0x87) DW_TAG_array_type)
-+ .long 0xa1 # DW_AT_type
-+ .long 0x9a # DW_AT_sibling
-+ .uleb128 0x9 # (DIE (0x90) DW_TAG_subrange_type)
-+ .long 0x9a # DW_AT_type
-+ .uleb128 0x3 # DW_AT_upper_bound
-+ .byte 0x91 # DW_OP_fbreg
-+ .sleb128 -48
-+ .byte 0x6 # DW_OP_deref
-+ .byte 0 # end of children of DIE 0x87
-+ .uleb128 0xa # (DIE (0x9a) DW_TAG_base_type)
-+ .byte 0x8 # DW_AT_byte_size
-+ .byte 0x7 # DW_AT_encoding
-+ .long .LASF1 # DW_AT_name: "sizetype"
-+ .uleb128 0xa # (DIE (0xa1) DW_TAG_base_type)
-+ .byte 0x1 # DW_AT_byte_size
-+ .byte 0x6 # DW_AT_encoding
-+ .long .LASF2 # DW_AT_name: "char"
-+ .byte 0 # end of children of DIE 0xb
-+ .section .debug_abbrev,"",@progbits
-+.Ldebug_abbrev0:
-+ .uleb128 0x1 # (abbrev code)
-+ .uleb128 0x11 # (TAG: DW_TAG_compile_unit)
-+ .byte 0x1 # DW_children_yes
-+ .uleb128 0x25 # (DW_AT_producer)
-+ .uleb128 0xe # (DW_FORM_strp)
-+ .uleb128 0x13 # (DW_AT_language)
-+ .uleb128 0xb # (DW_FORM_data1)
-+ .uleb128 0x3 # (DW_AT_name)
-+ .uleb128 0xe # (DW_FORM_strp)
-+ .uleb128 0x1b # (DW_AT_comp_dir)
-+ .uleb128 0xe # (DW_FORM_strp)
-+ .uleb128 0x11 # (DW_AT_low_pc)
-+ .uleb128 0x1 # (DW_FORM_addr)
-+ .uleb128 0x12 # (DW_AT_high_pc)
-+ .uleb128 0x7 # (DW_FORM_data8)
-+ .uleb128 0x10 # (DW_AT_stmt_list)
-+ .uleb128 0x17 # (DW_FORM_sec_offset)
-+ .byte 0
-+ .byte 0
-+ .uleb128 0x2 # (abbrev code)
-+ .uleb128 0x2e # (TAG: DW_TAG_subprogram)
-+ .byte 0x1 # DW_children_yes
-+ .uleb128 0x3f # (DW_AT_external)
-+ .uleb128 0x19 # (DW_FORM_flag_present)
-+ .uleb128 0x3 # (DW_AT_name)
-+ .uleb128 0x8 # (DW_FORM_string)
-+ .uleb128 0x3a # (DW_AT_decl_file)
-+ .uleb128 0xb # (DW_FORM_data1)
-+ .uleb128 0x3b # (DW_AT_decl_line)
-+ .uleb128 0xb # (DW_FORM_data1)
-+ .uleb128 0x27 # (DW_AT_prototyped)
-+ .uleb128 0x19 # (DW_FORM_flag_present)
-+ .uleb128 0x11 # (DW_AT_low_pc)
-+ .uleb128 0x1 # (DW_FORM_addr)
-+ .uleb128 0x12 # (DW_AT_high_pc)
-+ .uleb128 0x7 # (DW_FORM_data8)
-+ .uleb128 0x40 # (DW_AT_frame_base)
-+ .uleb128 0x18 # (DW_FORM_exprloc)
-+ .uleb128 0x2117 # (DW_AT_GNU_all_call_sites)
-+ .uleb128 0x19 # (DW_FORM_flag_present)
-+ .uleb128 0x1 # (DW_AT_sibling)
-+ .uleb128 0x13 # (DW_FORM_ref4)
-+ .byte 0
-+ .byte 0
-+ .uleb128 0x3 # (abbrev code)
-+ .uleb128 0x5 # (TAG: DW_TAG_formal_parameter)
-+ .byte 0 # DW_children_no
-+ .uleb128 0x3 # (DW_AT_name)
-+ .uleb128 0xe # (DW_FORM_strp)
-+ .uleb128 0x3a # (DW_AT_decl_file)
-+ .uleb128 0xb # (DW_FORM_data1)
-+ .uleb128 0x3b # (DW_AT_decl_line)
-+ .uleb128 0xb # (DW_FORM_data1)
-+ .uleb128 0x49 # (DW_AT_type)
-+ .uleb128 0x13 # (DW_FORM_ref4)
-+ .uleb128 0x2 # (DW_AT_location)
-+ .uleb128 0x18 # (DW_FORM_exprloc)
-+ .byte 0
-+ .byte 0
-+ .uleb128 0x4 # (abbrev code)
-+ .uleb128 0x16 # (TAG: DW_TAG_typedef)
-+ .byte 0 # DW_children_no
-+ .uleb128 0x3 # (DW_AT_name)
-+ .uleb128 0xe # (DW_FORM_strp)
-+ .uleb128 0x3a # (DW_AT_decl_file)
-+ .uleb128 0xb # (DW_FORM_data1)
-+ .uleb128 0x3b # (DW_AT_decl_line)
-+ .uleb128 0xb # (DW_FORM_data1)
-+ .uleb128 0x49 # (DW_AT_type)
-+ .uleb128 0x13 # (DW_FORM_ref4)
-+ .byte 0
-+ .byte 0
-+ .uleb128 0x5 # (abbrev code)
-+ .uleb128 0x34 # (TAG: DW_TAG_variable)
-+ .byte 0 # DW_children_no
-+ .uleb128 0x3 # (DW_AT_name)
-+ .uleb128 0xe # (DW_FORM_strp)
-+ .uleb128 0x3a # (DW_AT_decl_file)
-+ .uleb128 0xb # (DW_FORM_data1)
-+ .uleb128 0x3b # (DW_AT_decl_line)
-+ .uleb128 0xb # (DW_FORM_data1)
-+ .uleb128 0x49 # (DW_AT_type)
-+ .uleb128 0x13 # (DW_FORM_ref4)
-+ .uleb128 0x2 # (DW_AT_location)
-+ .uleb128 0x18 # (DW_FORM_exprloc)
-+ .byte 0
-+ .byte 0
-+ .uleb128 0x6 # (abbrev code)
-+ .uleb128 0x34 # (TAG: DW_TAG_variable)
-+ .byte 0 # DW_children_no
-+ .uleb128 0x3 # (DW_AT_name)
-+ .uleb128 0x8 # (DW_FORM_string)
-+ .uleb128 0x3a # (DW_AT_decl_file)
-+ .uleb128 0xb # (DW_FORM_data1)
-+ .uleb128 0x3b # (DW_AT_decl_line)
-+ .uleb128 0xb # (DW_FORM_data1)
-+ .uleb128 0x49 # (DW_AT_type)
-+ .uleb128 0x13 # (DW_FORM_ref4)
-+ .uleb128 0x2 # (DW_AT_location)
-+ .uleb128 0x18 # (DW_FORM_exprloc)
-+ .byte 0
-+ .byte 0
-+ .uleb128 0x7 # (abbrev code)
-+ .uleb128 0x24 # (TAG: DW_TAG_base_type)
-+ .byte 0 # DW_children_no
-+ .uleb128 0xb # (DW_AT_byte_size)
-+ .uleb128 0xb # (DW_FORM_data1)
-+ .uleb128 0x3e # (DW_AT_encoding)
-+ .uleb128 0xb # (DW_FORM_data1)
-+ .uleb128 0x3 # (DW_AT_name)
-+ .uleb128 0x8 # (DW_FORM_string)
-+ .byte 0
-+ .byte 0
-+ .uleb128 0x8 # (abbrev code)
-+ .uleb128 0x1 # (TAG: DW_TAG_array_type)
-+ .byte 0x1 # DW_children_yes
-+ .uleb128 0x49 # (DW_AT_type)
-+ .uleb128 0x13 # (DW_FORM_ref4)
-+ .uleb128 0x1 # (DW_AT_sibling)
-+ .uleb128 0x13 # (DW_FORM_ref4)
-+ .byte 0
-+ .byte 0
-+ .uleb128 0x9 # (abbrev code)
-+ .uleb128 0x21 # (TAG: DW_TAG_subrange_type)
-+ .byte 0 # DW_children_no
-+ .uleb128 0x49 # (DW_AT_type)
-+ .uleb128 0x13 # (DW_FORM_ref4)
-+ .uleb128 0x2f # (DW_AT_upper_bound)
-+ .uleb128 0x18 # (DW_FORM_exprloc)
-+ .byte 0
-+ .byte 0
-+ .uleb128 0xa # (abbrev code)
-+ .uleb128 0x24 # (TAG: DW_TAG_base_type)
-+ .byte 0 # DW_children_no
-+ .uleb128 0xb # (DW_AT_byte_size)
-+ .uleb128 0xb # (DW_FORM_data1)
-+ .uleb128 0x3e # (DW_AT_encoding)
-+ .uleb128 0xb # (DW_FORM_data1)
-+ .uleb128 0x3 # (DW_AT_name)
-+ .uleb128 0xe # (DW_FORM_strp)
-+ .byte 0
-+ .byte 0
-+ .byte 0
-+ .section .debug_aranges,"",@progbits
-+ .long 0x2c # Length of Address Ranges Info
-+ .value 0x2 # DWARF Version
-+ .long .Ldebug_info0 # Offset of Compilation Unit Info
-+ .byte 0x8 # Size of Address
-+ .byte 0 # Size of Segment Descriptor
-+ .value 0 # Pad to 16 byte boundary
-+ .value 0
-+ .quad .Ltext0 # Address
-+ .quad .Letext0-.Ltext0 # Length
-+ .quad 0
-+ .quad 0
-+ .section .debug_line,"",@progbits
-+.Ldebug_line0:
-+ .section .debug_str,"MS",@progbits,1
-+.LASF4:
-+ .string "gdb.arch/x86_64-vla-pointer.c"
-+.LASF7:
-+ .string "array_t"
-+.LASF3:
-+ .string "GNU C11 6.2.1 20160916 (Red Hat 6.2.1-2) -mtune=generic -march=x86-64 -g"
-+.LASF2:
-+ .string "char"
-+.LASF1:
-+ .string "sizetype"
-+.LASF5:
-+ .string "/home/jkratoch/redhat/fedora/gdb/master/gdb-7.12/gdb/testsuite"
-+.LASF6:
-+ .string "size"
-+.LASF0:
-+ .string "array"
-+ .ident "GCC: (GNU) 6.2.1 20160916 (Red Hat 6.2.1-2)"
-+ .section .note.GNU-stack,"",@progbits
-Index: gdb-7.12.50.20170207/gdb/testsuite/gdb.arch/x86_64-vla-pointer.c
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ gdb-7.12.50.20170207/gdb/testsuite/gdb.arch/x86_64-vla-pointer.c 2017-02-26 19:15:36.598882323 +0100
-@@ -0,0 +1,45 @@
-+/* This testcase is part of GDB, the GNU debugger.
-+
-+ Copyright 2009 Free Software Foundation, Inc.
-+
-+ This program is free software; you can redistribute it and/or modify
-+ it under the terms of the GNU General Public License as published by
-+ the Free Software Foundation; either version 3 of the License, or
-+ (at your option) any later version.
-+
-+ This program is distributed in the hope that it will be useful,
-+ but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ GNU General Public License for more details.
-+
-+ You should have received a copy of the GNU General Public License
-+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
-+
-+#if 0
-+
-+void
-+foo (int size)
-+{
-+ typedef char array_t[size];
-+ array_t array;
-+ int i;
-+
-+ for (i = 0; i < size; i++)
-+ array[i] = i;
-+
-+ array[0] = 0; /* break-here */
-+}
-+
-+#else
-+
-+void foo (int size);
-+
-+int
-+main (void)
-+{
-+ foo (26);
-+ foo (78);
-+ return 0;
-+}
-+
-+#endif
-Index: gdb-7.12.50.20170207/gdb/testsuite/gdb.arch/x86_64-vla-pointer.exp
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ gdb-7.12.50.20170207/gdb/testsuite/gdb.arch/x86_64-vla-pointer.exp 2017-02-26 19:15:36.598882323 +0100
-@@ -0,0 +1,65 @@
-+# Copyright 2009 Free Software Foundation, Inc.
-+
-+# This program is free software; you can redistribute it and/or modify
-+# it under the terms of the GNU General Public License as published by
-+# the Free Software Foundation; either version 3 of the License, or
-+# (at your option) any later version.
-+#
-+# This program is distributed in the hope that it will be useful,
-+# but WITHOUT ANY WARRANTY; without even the implied warranty of
-+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+# GNU General Public License for more details.
-+#
-+# You should have received a copy of the GNU General Public License
-+# along with this program. If not, see <http://www.gnu.org/licenses/>.
-+
-+if ![istarget "x86_64-*-*"] then {
-+ verbose "Skipping over gdb.arch/x86_64-vla-pointer.exp test made only for x86_64."
-+ return
-+}
-+
-+set testfile x86_64-vla-pointer
-+set srcasmfile ${testfile}-foo.S
-+set srcfile ${testfile}.c
-+set binfile [standard_output_file ${testfile}]
-+set binobjfile [standard_output_file ${testfile}-foo.o]
-+if { [gdb_compile "${srcdir}/${subdir}/${srcasmfile}" "${binobjfile}" object {}] != "" } {
-+ untested "Couldn't compile test program"
-+ return -1
-+}
-+if { [gdb_compile "${srcdir}/${subdir}/${srcfile} ${binobjfile}" "${binfile}" executable {}] != "" } {
-+ untested "Couldn't compile test program"
-+ return -1
-+}
-+
-+gdb_exit
-+gdb_start
-+gdb_reinitialize_dir $srcdir/$subdir
-+gdb_load ${binfile}
-+
-+if ![runto_main] {
-+ untested x86_64-vla-pointer
-+ return -1
-+}
-+
-+gdb_breakpoint $srcfile:[gdb_get_line_number "break-here"]
-+
-+gdb_continue_to_breakpoint "break-here"
-+
-+gdb_test "whatis array" "type = array_t" "first: whatis array"
-+gdb_test "whatis array_t" "type = char \\\[variable length\\\]" "first: whatis array_t"
-+gdb_test "ptype array" "type = char \\\[26\\\]" "first: ptype array"
-+
-+gdb_test "whatis *array" "type = char" "first: whatis *array"
-+gdb_test "ptype *array" "type = char" "first: ptype *array"
-+
-+gdb_test "p array\[1\]" "\\$\[0-9\] = 1 '\\\\001'"
-+gdb_test "p array\[2\]" "\\$\[0-9\] = 2 '\\\\002'"
-+gdb_test "p array\[3\]" "\\$\[0-9\] = 3 '\\\\003'"
-+gdb_test "p array\[4\]" "\\$\[0-9\] = 4 '\\\\004'"
-+
-+gdb_continue_to_breakpoint "break_here"
-+
-+gdb_test "whatis array" "type = array_t" "second: whatis array"
-+gdb_test "whatis array_t" "type = char \\\[variable length\\\]" "second: whatis array_t"
-+gdb_test "ptype array" "type = char \\\[78\\\]" "second: ptype array"
-Index: gdb-7.12.50.20170207/gdb/testsuite/gdb.arch/x86_64-vla-typedef-foo.S
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ gdb-7.12.50.20170207/gdb/testsuite/gdb.arch/x86_64-vla-typedef-foo.S 2017-02-26 19:15:36.598882323 +0100
-@@ -0,0 +1,455 @@
-+ .file "x86_64-vla-typedef.c"
-+ .section .debug_abbrev,"",@progbits
-+.Ldebug_abbrev0:
-+ .section .debug_info,"",@progbits
-+.Ldebug_info0:
-+ .section .debug_line,"",@progbits
-+.Ldebug_line0:
-+ .text
-+.Ltext0:
-+.globl foo
-+ .type foo, @function
-+foo:
-+.LFB2:
-+ .file 1 "x86_64-vla-typedef.c"
-+ .loc 1 22 0
-+ pushq %rbp
-+.LCFI0:
-+ movq %rsp, %rbp
-+.LCFI1:
-+ subq $64, %rsp
-+.LCFI2:
-+ movl %edi, -36(%rbp)
-+ .loc 1 22 0
-+ movq %rsp, %rax
-+ movq %rax, -48(%rbp)
-+ .loc 1 23 0
-+ movl -36(%rbp), %edx
-+ movslq %edx,%rax
-+ subq $1, %rax
-+ movq %rax, -24(%rbp)
-+ .loc 1 24 0
-+ movslq %edx,%rax
-+ addq $15, %rax
-+ addq $15, %rax
-+ shrq $4, %rax
-+ salq $4, %rax
-+ subq %rax, %rsp
-+ movq %rsp, -56(%rbp)
-+ movq -56(%rbp), %rax
-+ addq $15, %rax
-+ shrq $4, %rax
-+ salq $4, %rax
-+ movq %rax, -56(%rbp)
-+ movq -56(%rbp), %rax
-+ movq %rax, -16(%rbp)
-+ .loc 1 27 0
-+ movl $0, -4(%rbp)
-+ jmp .L2
-+.L3:
-+ .loc 1 28 0
-+ movl -4(%rbp), %esi
-+ movl -4(%rbp), %eax
-+ movl %eax, %ecx
-+ movq -16(%rbp), %rdx
-+ movslq %esi,%rax
-+ movb %cl, (%rdx,%rax)
-+ .loc 1 27 0
-+ addl $1, -4(%rbp)
-+.L2:
-+ movl -4(%rbp), %eax
-+ cmpl -36(%rbp), %eax
-+ jl .L3
-+ .loc 1 30 0
-+ .globl break_here
-+break_here:
-+ movq -16(%rbp), %rax
-+ movb $0, (%rax)
-+ movq -48(%rbp), %rsp
-+ .loc 1 31 0
-+ leave
-+ ret
-+.LFE2:
-+ .size foo, .-foo
-+ .section .debug_frame,"",@progbits
-+.Lframe0:
-+ .long .LECIE0-.LSCIE0
-+.LSCIE0:
-+ .long 0xffffffff
-+ .byte 0x1
-+ .string ""
-+ .uleb128 0x1
-+ .sleb128 -8
-+ .byte 0x10
-+ .byte 0xc
-+ .uleb128 0x7
-+ .uleb128 0x8
-+ .byte 0x90
-+ .uleb128 0x1
-+ .align 8
-+.LECIE0:
-+.LSFDE0:
-+ .long .LEFDE0-.LASFDE0
-+.LASFDE0:
-+ .long .Lframe0
-+ .quad .LFB2
-+ .quad .LFE2-.LFB2
-+ .byte 0x4
-+ .long .LCFI0-.LFB2
-+ .byte 0xe
-+ .uleb128 0x10
-+ .byte 0x86
-+ .uleb128 0x2
-+ .byte 0x4
-+ .long .LCFI1-.LCFI0
-+ .byte 0xd
-+ .uleb128 0x6
-+ .align 8
-+.LEFDE0:
-+ .section .eh_frame,"a",@progbits
-+.Lframe1:
-+ .long .LECIE1-.LSCIE1
-+.LSCIE1:
-+ .long 0x0
-+ .byte 0x1
-+ .string "zR"
-+ .uleb128 0x1
-+ .sleb128 -8
-+ .byte 0x10
-+ .uleb128 0x1
-+ .byte 0x3
-+ .byte 0xc
-+ .uleb128 0x7
-+ .uleb128 0x8
-+ .byte 0x90
-+ .uleb128 0x1
-+ .align 8
-+.LECIE1:
-+.LSFDE1:
-+ .long .LEFDE1-.LASFDE1
-+.LASFDE1:
-+ .long .LASFDE1-.Lframe1
-+ .long .LFB2
-+ .long .LFE2-.LFB2
-+ .uleb128 0x0
-+ .byte 0x4
-+ .long .LCFI0-.LFB2
-+ .byte 0xe
-+ .uleb128 0x10
-+ .byte 0x86
-+ .uleb128 0x2
-+ .byte 0x4
-+ .long .LCFI1-.LCFI0
-+ .byte 0xd
-+ .uleb128 0x6
-+ .align 8
-+.LEFDE1:
-+ .text
-+.Letext0:
-+ .section .debug_loc,"",@progbits
-+.Ldebug_loc0:
-+.LLST0:
-+ .quad .LFB2-.Ltext0
-+ .quad .LCFI0-.Ltext0
-+ .value 0x2
-+ .byte 0x77
-+ .sleb128 8
-+ .quad .LCFI0-.Ltext0
-+ .quad .LCFI1-.Ltext0
-+ .value 0x2
-+ .byte 0x77
-+ .sleb128 16
-+ .quad .LCFI1-.Ltext0
-+ .quad .LFE2-.Ltext0
-+ .value 0x2
-+ .byte 0x76
-+ .sleb128 16
-+ .quad 0x0
-+ .quad 0x0
-+ .section .debug_info
-+ .long .Ldebug_end - .Ldebug_start
-+.Ldebug_start:
-+ .value 0x2
-+ .long .Ldebug_abbrev0
-+ .byte 0x8
-+ .uleb128 0x1
-+ .long .LASF2
-+ .byte 0x1
-+ .long .LASF3
-+ .long .LASF4
-+ .quad .Ltext0
-+ .quad .Letext0
-+ .long .Ldebug_line0
-+ .uleb128 0x2
-+ .byte 0x1
-+ .string "foo"
-+ .byte 0x1
-+ .byte 0x16
-+ .byte 0x1
-+ .quad .LFB2
-+ .quad .LFE2
-+ .long .LLST0
-+ .long 0x83
-+ .uleb128 0x3
-+ .long .LASF5
-+ .byte 0x1
-+ .byte 0x15
-+ .long 0x83
-+ .byte 0x2
-+ .byte 0x91
-+ .sleb128 -52
-+.Ltag_typedef:
-+ .uleb128 0x4
-+ .long .LASF6
-+ .byte 0x1
-+ .byte 0x17
-+ .long .Ltag_array_type - .debug_info
-+ .uleb128 0x5 /* Abbrev Number: 5 (DW_TAG_variable) */
-+ .long .LASF0
-+ .byte 0x1
-+ .byte 0x18
-+#if 1
-+ .long .Ltag_typedef - .debug_info
-+#else
-+ /* Debugging only: Skip the typedef indirection. */
-+ .long .Ltag_array_type - .debug_info
-+#endif
-+ /* DW_AT_location: DW_FORM_block1: start */
-+ .byte 0x3
-+ .byte 0x91
-+ .sleb128 -32
-+#if 0
-+ .byte 0x6 /* DW_OP_deref */
-+#else
-+ .byte 0x96 /* DW_OP_nop */
-+#endif
-+ /* DW_AT_location: DW_FORM_block1: end */
-+ .uleb128 0x6
-+ .string "i"
-+ .byte 0x1
-+ .byte 0x19
-+ .long 0x83
-+ .byte 0x2
-+ .byte 0x91
-+ .sleb128 -20
-+ .byte 0x0
-+ .uleb128 0x7
-+ .byte 0x4
-+ .byte 0x5
-+ .string "int"
-+.Ltag_array_type:
-+ .uleb128 0x8 /* Abbrev Number: 8 (DW_TAG_array_type) */
-+ .long 0xa0 + (2f - 1f) /* DW_AT_type: DW_FORM_ref4 */
-+ .long 0x9d + (2f - 1f) /* DW_AT_sibling: DW_FORM_ref4 */
-+1: /* DW_AT_data_location: DW_FORM_block1: start */
-+ .byte 2f - 3f /* length */
-+3:
-+ .byte 0x97 /* DW_OP_push_object_address */
-+ .byte 0x6 /* DW_OP_deref */
-+2: /* DW_AT_data_location: DW_FORM_block1: end */
-+ .uleb128 0x9
-+ .long 0x9d + (2b - 1b) /* DW_AT_type: DW_FORM_ref4 */
-+ .byte 0x3
-+ .byte 0x91
-+ .sleb128 -40
-+ .byte 0x6
-+ .byte 0x0
-+ .uleb128 0xa
-+ .byte 0x8
-+ .byte 0x7
-+ .uleb128 0xb
-+ .byte 0x1
-+ .byte 0x6
-+ .long .LASF1
-+ .byte 0x0
-+.Ldebug_end:
-+ .section .debug_abbrev
-+ .uleb128 0x1
-+ .uleb128 0x11
-+ .byte 0x1
-+ .uleb128 0x25
-+ .uleb128 0xe
-+ .uleb128 0x13
-+ .uleb128 0xb
-+ .uleb128 0x3
-+ .uleb128 0xe
-+ .uleb128 0x1b
-+ .uleb128 0xe
-+ .uleb128 0x11
-+ .uleb128 0x1
-+ .uleb128 0x12
-+ .uleb128 0x1
-+ .uleb128 0x10
-+ .uleb128 0x6
-+ .byte 0x0
-+ .byte 0x0
-+ .uleb128 0x2
-+ .uleb128 0x2e
-+ .byte 0x1
-+ .uleb128 0x3f
-+ .uleb128 0xc
-+ .uleb128 0x3
-+ .uleb128 0x8
-+ .uleb128 0x3a
-+ .uleb128 0xb
-+ .uleb128 0x3b
-+ .uleb128 0xb
-+ .uleb128 0x27
-+ .uleb128 0xc
-+ .uleb128 0x11
-+ .uleb128 0x1
-+ .uleb128 0x12
-+ .uleb128 0x1
-+ .uleb128 0x40
-+ .uleb128 0x6
-+ .uleb128 0x1
-+ .uleb128 0x13
-+ .byte 0x0
-+ .byte 0x0
-+ .uleb128 0x3
-+ .uleb128 0x5
-+ .byte 0x0
-+ .uleb128 0x3
-+ .uleb128 0xe
-+ .uleb128 0x3a
-+ .uleb128 0xb
-+ .uleb128 0x3b
-+ .uleb128 0xb
-+ .uleb128 0x49
-+ .uleb128 0x13
-+ .uleb128 0x2
-+ .uleb128 0xa
-+ .byte 0x0
-+ .byte 0x0
-+ .uleb128 0x4
-+ .uleb128 0x16
-+ .byte 0x0
-+ .uleb128 0x3
-+ .uleb128 0xe
-+ .uleb128 0x3a
-+ .uleb128 0xb
-+ .uleb128 0x3b
-+ .uleb128 0xb
-+ .uleb128 0x49
-+ .uleb128 0x13
-+ .byte 0x0
-+ .byte 0x0
-+ .uleb128 0x5
-+ .uleb128 0x34
-+ .byte 0x0
-+ .uleb128 0x3
-+ .uleb128 0xe
-+ .uleb128 0x3a
-+ .uleb128 0xb
-+ .uleb128 0x3b
-+ .uleb128 0xb
-+ .uleb128 0x49
-+ .uleb128 0x13
-+ .uleb128 0x2
-+ .uleb128 0xa
-+ .byte 0x0
-+ .byte 0x0
-+ .uleb128 0x6
-+ .uleb128 0x34
-+ .byte 0x0
-+ .uleb128 0x3
-+ .uleb128 0x8
-+ .uleb128 0x3a
-+ .uleb128 0xb
-+ .uleb128 0x3b
-+ .uleb128 0xb
-+ .uleb128 0x49
-+ .uleb128 0x13
-+ .uleb128 0x2
-+ .uleb128 0xa
-+ .byte 0x0
-+ .byte 0x0
-+ .uleb128 0x7
-+ .uleb128 0x24
-+ .byte 0x0
-+ .uleb128 0xb
-+ .uleb128 0xb
-+ .uleb128 0x3e
-+ .uleb128 0xb
-+ .uleb128 0x3
-+ .uleb128 0x8
-+ .byte 0x0
-+ .byte 0x0
-+ .uleb128 0x8 /* Abbrev Number: 8 (DW_TAG_array_type) */
-+ .uleb128 0x1
-+ .byte 0x1
-+ .uleb128 0x49 /* DW_AT_type */
-+ .uleb128 0x13 /* DW_FORM_ref4 */
-+ .uleb128 0x1 /* DW_AT_sibling */
-+ .uleb128 0x13 /* DW_FORM_ref4 */
-+ .uleb128 0x50 /* DW_AT_data_location */
-+ .uleb128 0xa /* DW_FORM_block1 */
-+ .byte 0x0
-+ .byte 0x0
-+ .uleb128 0x9
-+ .uleb128 0x21
-+ .byte 0x0
-+ .uleb128 0x49 /* DW_AT_type */
-+ .uleb128 0x13 /* DW_FORM_ref4 */
-+ .uleb128 0x2f
-+ .uleb128 0xa
-+ .byte 0x0
-+ .byte 0x0
-+ .uleb128 0xa
-+ .uleb128 0x24
-+ .byte 0x0
-+ .uleb128 0xb
-+ .uleb128 0xb
-+ .uleb128 0x3e
-+ .uleb128 0xb
-+ .byte 0x0
-+ .byte 0x0
-+ .uleb128 0xb
-+ .uleb128 0x24
-+ .byte 0x0
-+ .uleb128 0xb
-+ .uleb128 0xb
-+ .uleb128 0x3e
-+ .uleb128 0xb
-+ .uleb128 0x3
-+ .uleb128 0xe
-+ .byte 0x0
-+ .byte 0x0
-+ .byte 0x0
-+ .section .debug_pubnames,"",@progbits
-+ .long 0x16
-+ .value 0x2
-+ .long .Ldebug_info0
-+ .long 0xa8
-+ .long 0x2d
-+ .string "foo"
-+ .long 0x0
-+ .section .debug_aranges,"",@progbits
-+ .long 0x2c
-+ .value 0x2
-+ .long .Ldebug_info0
-+ .byte 0x8
-+ .byte 0x0
-+ .value 0x0
-+ .value 0x0
-+ .quad .Ltext0
-+ .quad .Letext0-.Ltext0
-+ .quad 0x0
-+ .quad 0x0
-+ .section .debug_str,"MS",@progbits,1
-+.LASF0:
-+ .string "array"
-+.LASF5:
-+ .string "size"
-+.LASF3:
-+ .string "x86_64-vla-typedef.c"
-+.LASF6:
-+ .string "array_t"
-+.LASF1:
-+ .string "char"
-+.LASF4:
-+ .string "gdb.arch"
-+.LASF2:
-+ .string "GNU C 4.3.2 20081105 (Red Hat 4.3.2-7)"
-+ .ident "GCC: (GNU) 4.3.2 20081105 (Red Hat 4.3.2-7)"
-+ .section .note.GNU-stack,"",@progbits
-Index: gdb-7.12.50.20170207/gdb/testsuite/gdb.arch/x86_64-vla-typedef.c
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ gdb-7.12.50.20170207/gdb/testsuite/gdb.arch/x86_64-vla-typedef.c 2017-02-26 19:15:36.599882330 +0100
-@@ -0,0 +1,45 @@
-+/* This testcase is part of GDB, the GNU debugger.
-+
-+ Copyright 2008 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/>. */
-+
-+#if 0
-+
-+void
-+foo (int size)
-+{
-+ typedef char array_t[size];
-+ array_t array;
-+ int i;
-+
-+ for (i = 0; i < size; i++)
-+ array[i] = i;
-+
-+ array[0] = 0; /* break-here */
-+}
-+
-+#else
-+
-+void foo (int size);
-+
-+int
-+main (void)
-+{
-+ foo (26);
-+ foo (78);
-+ return 0;
-+}
-+
-+#endif
-Index: gdb-7.12.50.20170207/gdb/testsuite/gdb.arch/x86_64-vla-typedef.exp
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ gdb-7.12.50.20170207/gdb/testsuite/gdb.arch/x86_64-vla-typedef.exp 2017-02-26 19:15:36.599882330 +0100
-@@ -0,0 +1,64 @@
-+# Copyright 2009 Free Software Foundation, Inc.
-+
-+# This program is free software; you can redistribute it and/or modify
-+# it under the terms of the GNU General Public License as published by
-+# the Free Software Foundation; either version 3 of the License, or
-+# (at your option) any later version.
-+#
-+# This program is distributed in the hope that it will be useful,
-+# but WITHOUT ANY WARRANTY; without even the implied warranty of
-+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+# GNU General Public License for more details.
-+#
-+# You should have received a copy of the GNU General Public License
-+# along with this program. If not, see <http://www.gnu.org/licenses/>.
-+
-+# Test DW_AT_data_location accessed through DW_TAG_typedef intermediate.
-+
-+if ![istarget "x86_64-*-*"] then {
-+ verbose "Skipping over gdb.arch/x86_64-vla-typedef.exp test made only for x86_64."
-+ return
-+}
-+
-+set testfile x86_64-vla-typedef
-+set srcasmfile ${testfile}-foo.S
-+set srcfile ${testfile}.c
-+set binfile [standard_output_file ${testfile}]
-+set binobjfile [standard_output_file ${testfile}-foo.o]
-+if { [gdb_compile "${srcdir}/${subdir}/${srcasmfile}" "${binobjfile}" object {}] != "" } {
-+ untested "Couldn't compile test program"
-+ return -1
-+}
-+if { [gdb_compile "${srcdir}/${subdir}/${srcfile} ${binobjfile}" "${binfile}" executable {debug}] != "" } {
-+ untested "Couldn't compile test program"
-+ return -1
-+}
-+
-+gdb_exit
-+gdb_start
-+gdb_reinitialize_dir $srcdir/$subdir
-+gdb_load ${binfile}
-+
-+if ![runto_main] {
-+ untested x86_64-vla-typedef
-+ return -1
-+}
-+
-+gdb_breakpoint "break_here"
-+
-+gdb_continue_to_breakpoint "break_here"
-+
-+gdb_test "whatis array" "type = array_t" "first: whatis array"
-+
-+gdb_test "ptype array" "type = char \\\[26\\\]" "first: ptype array"
-+
-+gdb_test "p array\[1\]" "\\$\[0-9\] = 1 '\\\\001'"
-+gdb_test "p array\[2\]" "\\$\[0-9\] = 2 '\\\\002'"
-+gdb_test "p array\[3\]" "\\$\[0-9\] = 3 '\\\\003'"
-+gdb_test "p array\[4\]" "\\$\[0-9\] = 4 '\\\\004'"
-+
-+gdb_continue_to_breakpoint "break_here"
-+
-+gdb_test "whatis array" "type = array_t" "second: whatis array"
-+
-+gdb_test "ptype array" "type = char \\\[78\\\]" "second: ptype array"
-Index: gdb-7.12.50.20170207/gdb/testsuite/gdb.base/arrayidx.c
-===================================================================
---- gdb-7.12.50.20170207.orig/gdb/testsuite/gdb.base/arrayidx.c 2017-02-26 19:15:28.555824772 +0100
-+++ gdb-7.12.50.20170207/gdb/testsuite/gdb.base/arrayidx.c 2017-02-26 19:15:36.599882330 +0100
-@@ -17,6 +17,13 @@
-
- int array[] = {1, 2, 3, 4};
-
-+#ifdef __GNUC__
-+struct
-+ {
-+ int a[0];
-+ } unbound;
-+#endif
-+
- int
- main (void)
- {
-Index: gdb-7.12.50.20170207/gdb/testsuite/gdb.base/arrayidx.exp
-===================================================================
---- gdb-7.12.50.20170207.orig/gdb/testsuite/gdb.base/arrayidx.exp 2017-02-26 19:15:28.555824772 +0100
-+++ gdb-7.12.50.20170207/gdb/testsuite/gdb.base/arrayidx.exp 2017-02-26 19:15:36.599882330 +0100
-@@ -49,4 +49,12 @@
- "\\{\\\[0\\\] = 1, \\\[1\\\] = 2, \\\[2\\\] = 3, \\\[3\\\] = 4\\}" \
- "print array with array-indexes on"
-
--
-+set test "p unbound.a == &unbound.a\[0\]"
-+gdb_test_multiple $test $test {
-+ -re " = 1\r\n$gdb_prompt $" {
-+ pass $test
-+ }
-+ -re "No symbol \"unbound\" in current context.\r\n$gdb_prompt $" {
-+ unsupported "$test (no GCC)"
-+ }
-+}
-Index: gdb-7.12.50.20170207/gdb/testsuite/gdb.base/internal-var-field-address.c
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ gdb-7.12.50.20170207/gdb/testsuite/gdb.base/internal-var-field-address.c 2017-02-26 19:15:36.599882330 +0100
-@@ -0,0 +1,20 @@
-+/* This testcase is part of GDB, the GNU debugger.
-+
-+ Copyright 2009 Free Software Foundation, Inc.
-+
-+ This program is free software; you can redistribute it and/or modify
-+ it under the terms of the GNU General Public License as published by
-+ the Free Software Foundation; either version 3 of the License, or
-+ (at your option) any later version.
-+
-+ This program is distributed in the hope that it will be useful,
-+ but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ GNU General Public License for more details.
-+
-+ You should have received a copy of the GNU General Public License
-+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
-+
-+struct {
-+ int field;
-+} staticstruct = { 1 };
-Index: gdb-7.12.50.20170207/gdb/testsuite/gdb.base/internal-var-field-address.exp
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ gdb-7.12.50.20170207/gdb/testsuite/gdb.base/internal-var-field-address.exp 2017-02-26 19:15:36.600882337 +0100
-@@ -0,0 +1,26 @@
-+# Copyright 2009 Free Software Foundation, Inc.
-+
-+# This program is free software; you can redistribute it and/or modify
-+# it under the terms of the GNU General Public License as published by
-+# the Free Software Foundation; either version 3 of the License, or
-+# (at your option) any later version.
-+#
-+# This program is distributed in the hope that it will be useful,
-+# but WITHOUT ANY WARRANTY; without even the implied warranty of
-+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+# GNU General Public License for more details.
-+#
-+# You should have received a copy of the GNU General Public License
-+# along with this program. If not, see <http://www.gnu.org/licenses/>.
-+
-+set test internal-var-field-address
-+set binfile ${test}.x
-+if { [gdb_compile "${srcdir}/${subdir}/${test}.c" "[standard_output_file ${binfile}]" object {debug}] != "" } {
-+ untested "Couldn't compile test program"
-+ return -1
-+}
-+
-+clean_restart $binfile
-+
-+gdb_test {set $varstruct = staticstruct}
-+gdb_test {p $varstruct.field} " = 1"
-Index: gdb-7.12.50.20170207/gdb/testsuite/gdb.base/vla-frame.c
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ gdb-7.12.50.20170207/gdb/testsuite/gdb.base/vla-frame.c 2017-02-26 19:15:36.600882337 +0100
-@@ -0,0 +1,31 @@
-+/* This testcase is part of GDB, the GNU debugger.
-+
-+ Copyright 2011 Free Software Foundation, Inc.
-+
-+ This program is free software; you can redistribute it and/or modify
-+ it under the terms of the GNU General Public License as published by
-+ the Free Software Foundation; either version 3 of the License, or
-+ (at your option) any later version.
-+
-+ This program is distributed in the hope that it will be useful,
-+ but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ GNU General Public License for more details.
-+
-+ You should have received a copy of the GNU General Public License
-+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
-+
-+#include <string.h>
-+
-+int
-+main (int argc, char **argv)
-+{
-+ char s[2 + argc];
-+ void (*f) (char *) = 0;
-+
-+ memset (s, 0, sizeof (s));
-+ s[0] = 'X';
-+
-+ f (s);
-+ return 0;
-+}
-Index: gdb-7.12.50.20170207/gdb/testsuite/gdb.base/vla-frame.exp
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ gdb-7.12.50.20170207/gdb/testsuite/gdb.base/vla-frame.exp 2017-02-26 19:15:36.600882337 +0100
-@@ -0,0 +1,38 @@
-+# Copyright 2011 Free Software Foundation, Inc.
-+#
-+# This program is free software; you can redistribute it and/or modify
-+# it under the terms of the GNU General Public License as published by
-+# the Free Software Foundation; either version 3 of the License, or
-+# (at your option) any later version.
-+#
-+# This program is distributed in the hope that it will be useful,
-+# but WITHOUT ANY WARRANTY; without even the implied warranty of
-+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+# GNU General Public License for more details.
-+#
-+# You should have received a copy of the GNU General Public License
-+# along with this program. If not, see <http://www.gnu.org/licenses/>.
-+
-+set testfile vla-frame
-+set executable ${testfile}
-+
-+if { [prepare_for_testing ${testfile}.exp ${executable}] } {
-+ return -1
-+}
-+
-+if ![runto_main] {
-+ return -1
-+}
-+
-+set test "continue"
-+gdb_test_multiple $test $test {
-+ -re "Continuing\\.\r\n\r\nProgram received signal SIGSEGV, Segmentation fault\\.\r\n0x0+ in \\?\\? \\(\\)\r\n$gdb_prompt $" {
-+ pass $test
-+ }
-+ -re "\r\n$gdb_prompt $" {
-+ untested ${testfile}.exp
-+ return
-+ }
-+}
-+
-+gdb_test "bt full" "\r\n +s = \"X\\\\000\"\r\n.*"
-Index: gdb-7.12.50.20170207/gdb/testsuite/gdb.base/vla-overflow.c
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ gdb-7.12.50.20170207/gdb/testsuite/gdb.base/vla-overflow.c 2017-02-26 19:15:36.600882337 +0100
-@@ -0,0 +1,30 @@
-+/* This testcase is part of GDB, the GNU debugger.
-+
-+ Copyright 2008 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/>. */
-+
-+#include <stdlib.h>
-+
-+int
-+main (int argc, char **argv)
-+{
-+ int array[argc];
-+
-+ array[0] = array[0];
-+
-+ abort ();
-+
-+ return 0;
-+}
-Index: gdb-7.12.50.20170207/gdb/testsuite/gdb.base/vla-overflow.exp
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ gdb-7.12.50.20170207/gdb/testsuite/gdb.base/vla-overflow.exp 2017-02-26 19:15:36.600882337 +0100
-@@ -0,0 +1,109 @@
-+# Copyright 2008 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/>.
-+
-+# We could crash in:
-+# #0 block_linkage_function (bl=0x0) at ../../gdb/block.c:69
-+# #1 in dwarf_block_get_frame_base (...) at ../../gdb/dwarf2block.c:97
-+# 97 framefunc = block_linkage_function (get_frame_block (frame, NULL));
-+# #2 in execute_stack_op (...) at ../../gdb/dwarf2expr.c:496
-+# #3 in dwarf_block_exec_core () at ../../gdb/dwarf2block.c:156
-+# #4 dwarf_block_exec (...) at ../../gdb/dwarf2block.c:206
-+# #5 in range_type_count_bound_internal (...) at ../../gdb/gdbtypes.c:1430
-+# #6 in create_array_type (...) at ../../gdb/gdbtypes.c:840
-+# ...
-+# #21 in psymtab_to_symtab (...) at ../../gdb/symfile.c:292
-+# ...
-+# #29 in backtrace_command_1 () at ../../gdb/stack.c:1273
-+
-+set testfile vla-overflow
-+set shfile [standard_output_file ${testfile}-gdb.sh]
-+set srcfile ${testfile}.c
-+set binfile [standard_output_file ${testfile}]
-+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
-+ untested "Couldn't compile test program"
-+ return -1
-+}
-+
-+set f [open "|getconf PAGESIZE" "r"]
-+gets $f pagesize
-+close $f
-+
-+gdb_exit
-+gdb_start
-+gdb_reinitialize_dir $srcdir/$subdir
-+gdb_load ${binfile}
-+
-+set pid_of_gdb [exp_pid -i [board_info host fileid]]
-+
-+if { [runto_main] < 0 } {
-+ untested vla-overflow
-+ return -1
-+}
-+
-+# Get the GDB memory size when we stay at main.
-+
-+proc memory_v_pages_get {} {
-+ global pid_of_gdb pagesize
-+ set fd [open "/proc/$pid_of_gdb/statm"]
-+ gets $fd line
-+ close $fd
-+ # number of pages of virtual memory
-+ scan $line "%d" drs
-+ return $drs
-+}
-+
-+set pages_found [memory_v_pages_get]
-+
-+# s390x with glibc-debuginfo.s390x installed used approx. 16MB.
-+set mb_reserve 40
-+verbose -log "pages_found = $pages_found, mb_reserve = $mb_reserve"
-+set kb_found [expr $pages_found * $pagesize / 1024]
-+set kb_permit [expr $kb_found + 1 * 1024 + $mb_reserve * 1024]
-+verbose -log "kb_found = $kb_found, kb_permit = $kb_permit"
-+
-+# Create the ulimit wrapper.
-+set f [open $shfile "w"]
-+puts $f "#! /bin/sh"
-+puts $f "ulimit -v $kb_permit"
-+puts $f "exec $GDB \"\$@\""
-+close $f
-+remote_exec host "chmod +x $shfile"
-+
-+gdb_exit
-+set GDBold $GDB
-+set GDB "$shfile"
-+gdb_start
-+set GDB $GDBold
-+
-+gdb_reinitialize_dir $srcdir/$subdir
-+gdb_load ${binfile}
-+
-+set pid_of_gdb [exp_pid -i [board_info host fileid]]
-+
-+# Check the size again after the second run.
-+# We must not stop in main as it would cache `array' and never crash later.
-+
-+gdb_run_cmd
-+
-+verbose -log "kb_found before abort() = [expr [memory_v_pages_get] * $pagesize / 1024]"
-+
-+gdb_test "" "Program received signal SIGABRT, Aborted..*" "Enter abort()"
-+
-+verbose -log "kb_found in abort() = [expr [memory_v_pages_get] * $pagesize / 1024]"
-+
-+# `abort' can get expressed as `*__GI_abort'.
-+gdb_test "bt" "in \[^ \]*abort \\(.* in main \\(.*" "Backtrace after abort()"
-+
-+verbose -log "kb_found in bt after abort() = [expr [memory_v_pages_get] * $pagesize / 1024]"
-Index: gdb-7.12.50.20170207/gdb/testsuite/gdb.base/vla.c
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ gdb-7.12.50.20170207/gdb/testsuite/gdb.base/vla.c 2017-02-26 19:15:36.600882337 +0100
-@@ -0,0 +1,55 @@
-+/* This testcase is part of GDB, the GNU debugger.
-+
-+ Copyright 2008 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/>. */
-+
-+#include <string.h>
-+
-+void
-+marker (void)
-+{
-+}
-+
-+void
-+bar (char *a, char *b, char *c, int size)
-+{
-+ memset (a, '1', size);
-+ memset (b, '2', size);
-+ memset (c, '3', 48);
-+}
-+
-+void
-+foo (int size)
-+{
-+ char temp1[size];
-+ char temp3[48];
-+
-+ temp1[size - 1] = '\0';
-+ {
-+ char temp2[size];
-+
-+ bar (temp1, temp2, temp3, size);
-+
-+ marker (); /* break-here */
-+ }
-+}
-+
-+int
-+main (void)
-+{
-+ foo (26);
-+ foo (78);
-+ return 0;
-+}
-Index: gdb-7.12.50.20170207/gdb/testsuite/gdb.base/vla.exp
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ gdb-7.12.50.20170207/gdb/testsuite/gdb.base/vla.exp 2017-02-26 19:15:36.600882337 +0100
-@@ -0,0 +1,62 @@
-+# Copyright 2008 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/>.
-+
-+set testfile vla
-+set srcfile ${testfile}.c
-+set binfile [standard_output_file ${testfile}]
-+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
-+ untested "Couldn't compile test program"
-+ return -1
-+}
-+
-+gdb_exit
-+gdb_start
-+gdb_reinitialize_dir $srcdir/$subdir
-+gdb_load ${binfile}
-+
-+if ![runto_main] {
-+ untested vla
-+ return -1
-+}
-+
-+gdb_breakpoint [gdb_get_line_number "break-here"]
-+
-+gdb_continue_to_breakpoint "break-here"
-+
-+gdb_test "whatis temp1" "type = char \\\[26\\\]" "first: whatis temp1"
-+gdb_test "whatis temp2" "type = char \\\[26\\\]" "first: whatis temp2"
-+gdb_test "whatis temp3" "type = char \\\[48\\\]" "first: whatis temp3"
-+
-+gdb_test "ptype temp1" "type = char \\\[26\\\]" "first: ptype temp1"
-+gdb_test "ptype temp2" "type = char \\\[26\\\]" "first: ptype temp2"
-+gdb_test "ptype temp3" "type = char \\\[48\\\]" "first: ptype temp3"
-+
-+gdb_test "p temp1" " = '1' <repeats 26 times>" "first: print temp1"
-+gdb_test "p temp2" " = '2' <repeats 26 times>" "first: print temp2"
-+gdb_test "p temp3" " = '3' <repeats 48 times>" "first: print temp3"
-+
-+gdb_continue_to_breakpoint "break-here"
-+
-+gdb_test "whatis temp1" "type = char \\\[78\\\]" "second: whatis temp1"
-+gdb_test "whatis temp2" "type = char \\\[78\\\]" "second: whatis temp2"
-+gdb_test "whatis temp3" "type = char \\\[48\\\]" "second: whatis temp3"
-+
-+gdb_test "ptype temp1" "type = char \\\[78\\\]" "second: ptype temp1"
-+gdb_test "ptype temp2" "type = char \\\[78\\\]" "second: ptype temp2"
-+gdb_test "ptype temp3" "type = char \\\[48\\\]" "second: ptype temp3"
-+
-+gdb_test "p temp1" " = '1' <repeats 78 times>" "second: print temp1"
-+gdb_test "p temp2" " = '2' <repeats 78 times>" "second: print temp2"
-+gdb_test "p temp3" " = '3' <repeats 48 times>" "second: print temp3"
-Index: gdb-7.12.50.20170207/gdb/testsuite/gdb.cp/gdb9593.cc
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ gdb-7.12.50.20170207/gdb/testsuite/gdb.cp/gdb9593.cc 2017-02-26 19:15:36.601882344 +0100
-@@ -0,0 +1,180 @@
-+/* This testcase is part of GDB, the GNU debugger.
-+
-+ Copyright 2008, 2009 Free Software Foundation, Inc.
-+
-+ This program is free software; you can redistribute it and/or modify
-+ it under the terms of the GNU General Public License as published by
-+ the Free Software Foundation; either version 3 of the License, or
-+ (at your option) any later version.
-+
-+ This program is distributed in the hope that it will be useful,
-+ but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ GNU General Public License for more details.
-+
-+ You should have received a copy of the GNU General Public License
-+ along with this program. If not, see <http://www.gnu.org/licenses/>.
-+ */
-+#include <iostream>
-+
-+using namespace std;
-+
-+class NextOverThrowDerivates
-+{
-+
-+public:
-+
-+
-+ // Single throw an exception in this function.
-+ void function1()
-+ {
-+ throw 20;
-+ }
-+
-+ // Throw an exception in another function.
-+ void function2()
-+ {
-+ function1();
-+ }
-+
-+ // Throw an exception in another function, but handle it
-+ // locally.
-+ void function3 ()
-+ {
-+ {
-+ try
-+ {
-+ function1 ();
-+ }
-+ catch (...)
-+ {
-+ cout << "Caught and handled function1 exception" << endl;
-+ }
-+ }
-+ }
-+
-+ void rethrow ()
-+ {
-+ try
-+ {
-+ function1 ();
-+ }
-+ catch (...)
-+ {
-+ throw;
-+ }
-+ }
-+
-+ void finish ()
-+ {
-+ // We use this to test that a "finish" here does not end up in
-+ // this frame, but in the one above.
-+ try
-+ {
-+ function1 ();
-+ }
-+ catch (int x)
-+ {
-+ }
-+ function1 (); // marker for until
-+ }
-+
-+ void until ()
-+ {
-+ function1 ();
-+ function1 (); // until here
-+ }
-+
-+};
-+NextOverThrowDerivates next_cases;
-+
-+
-+int main ()
-+{
-+ try
-+ {
-+ next_cases.function1 ();
-+ }
-+ catch (...)
-+ {
-+ // Discard
-+ }
-+
-+ try
-+ {
-+ next_cases.function2 ();
-+ }
-+ catch (...)
-+ {
-+ // Discard
-+ }
-+
-+ try
-+ {
-+ // This is duplicated so we can next over one but step into
-+ // another.
-+ next_cases.function2 ();
-+ }
-+ catch (...)
-+ {
-+ // Discard
-+ }
-+
-+ next_cases.function3 ();
-+
-+ try
-+ {
-+ next_cases.rethrow ();
-+ }
-+ catch (...)
-+ {
-+ // Discard
-+ }
-+
-+ try
-+ {
-+ // Another duplicate so we can test "finish".
-+ next_cases.function2 ();
-+ }
-+ catch (...)
-+ {
-+ // Discard
-+ }
-+
-+ // Another test for "finish".
-+ try
-+ {
-+ next_cases.finish ();
-+ }
-+ catch (...)
-+ {
-+ }
-+
-+ // Test of "until".
-+ try
-+ {
-+ next_cases.finish ();
-+ }
-+ catch (...)
-+ {
-+ }
-+
-+ // Test of "until" with an argument.
-+ try
-+ {
-+ next_cases.until ();
-+ }
-+ catch (...)
-+ {
-+ }
-+
-+ // Test of "advance".
-+ try
-+ {
-+ next_cases.until ();
-+ }
-+ catch (...)
-+ {
-+ }
-+}
-+
-Index: gdb-7.12.50.20170207/gdb/testsuite/gdb.cp/gdb9593.exp
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ gdb-7.12.50.20170207/gdb/testsuite/gdb.cp/gdb9593.exp 2017-02-26 19:15:36.601882344 +0100
-@@ -0,0 +1,182 @@
-+# Copyright 2008, 2009 Free Software Foundation, Inc.
-+
-+# This program is free software; you can redistribute it and/or modify
-+# it under the terms of the GNU General Public License as published by
-+# the Free Software Foundation; either version 3 of the License, or
-+# (at your option) any later version.
-+#
-+# This program is distributed in the hope that it will be useful,
-+# but WITHOUT ANY WARRANTY; without even the implied warranty of
-+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+# GNU General Public License for more details.
-+#
-+# You should have received a copy of the GNU General Public License
-+# along with this program. If not, see <http://www.gnu.org/licenses/>.
-+
-+
-+if $tracelevel then {
-+ strace $tracelevel
-+}
-+
-+if { [skip_cplus_tests] } { continue }
-+
-+set testfile "gdb9593"
-+set srcfile ${testfile}.cc
-+set binfile [standard_output_file $testfile]
-+
-+# Create and source the file that provides information about the compiler
-+# used to compile the test case.
-+if [get_compiler_info "c++"] {
-+ untested gdb9593.exp
-+ return -1
-+}
-+
-+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug c++}] != "" } {
-+ untested gdb9593.exp
-+ return -1
-+}
-+
-+# Some targets can't do function calls, so don't even bother with this
-+# test.
-+if [target_info exists gdb,cannot_call_functions] {
-+ setup_xfail "*-*-*" 9593
-+ fail "This target can not call functions"
-+ continue
-+}
-+
-+gdb_exit
-+gdb_start
-+gdb_reinitialize_dir $srcdir/$subdir
-+gdb_load ${binfile}
-+
-+if ![runto_main] then {
-+ perror "couldn't run to main"
-+ continue
-+}
-+
-+# See whether we have the needed unwinder hooks.
-+set ok 1
-+gdb_test_multiple "print _Unwind_DebugHook" "check for unwinder hook" {
-+ -re "= .*_Unwind_DebugHook.*\r\n$gdb_prompt $" {
-+ pass "check for unwinder hook"
-+ }
-+ -re "No symbol .* in current context.\r\n$gdb_prompt $" {
-+ # Pass the test so we don't get bogus fails in the results.
-+ pass "check for unwinder hook"
-+ set ok 0
-+ }
-+}
-+if {!$ok} {
-+ untested gdb9593.exp
-+ return -1
-+}
-+
-+# See http://sourceware.org/bugzilla/show_bug.cgi?id=9593
-+
-+gdb_test "next" \
-+ ".*catch (...).*" \
-+ "next over a throw 1"
-+
-+gdb_test "next" \
-+ ".*next_cases.function2.*" \
-+ "next past catch 1"
-+
-+gdb_test "next" \
-+ ".*catch (...).*" \
-+ "next over a throw 2"
-+
-+gdb_test "next" \
-+ ".*next_cases.function2.*" \
-+ "next past catch 2"
-+
-+gdb_test "step" \
-+ ".*function1().*" \
-+ "step into function2 1"
-+
-+gdb_test "next" \
-+ ".*catch (...).*" \
-+ "next over a throw 3"
-+
-+gdb_test "next" \
-+ ".*next_cases.function3.*" \
-+ "next past catch 3"
-+
-+gdb_test "next" \
-+ ".*next_cases.rethrow.*" \
-+ "next over a throw 4"
-+
-+gdb_test "next" \
-+ ".*catch (...).*" \
-+ "next over a rethrow"
-+
-+gdb_test "next" \
-+ ".*next_cases.function2.*" \
-+ "next after a rethrow"
-+
-+gdb_test "step" \
-+ ".*function1().*" \
-+ "step into function2 2"
-+
-+gdb_test "finish" \
-+ ".*catch (...).*" \
-+ "finish 1"
-+
-+gdb_test "next" \
-+ ".*next_cases.finish ().*" \
-+ "next past catch 4"
-+
-+gdb_test "step" \
-+ ".*function1 ().*" \
-+ "step into finish method"
-+
-+gdb_test "finish" \
-+ ".*catch (...).*" \
-+ "finish 2"
-+
-+gdb_test "next" \
-+ ".*next_cases.finish ().*" \
-+ "next past catch 5"
-+
-+gdb_test "step" \
-+ ".*function1 ().*" \
-+ "step into finish, for until"
-+
-+gdb_test "until" \
-+ ".*function1 ().*" \
-+ "until with no argument 1"
-+
-+set line [gdb_get_line_number "marker for until" $testfile.cc]
-+
-+gdb_test "until $line" \
-+ ".*function1 ().*" \
-+ "next past catch 6"
-+
-+gdb_test "until" \
-+ ".*catch (...).*" \
-+ "until with no argument 2"
-+
-+set line [gdb_get_line_number "until here" $testfile.cc]
-+
-+gdb_test "next" \
-+ ".*next_cases.until ().*" \
-+ "next past catch 6"
-+
-+gdb_test "step" \
-+ ".*function1 ().*" \
-+ "step into until"
-+
-+gdb_test "until $line" \
-+ ".*catch (...).*" \
-+ "until-over-throw"
-+
-+gdb_test "next" \
-+ ".*next_cases.until ().*" \
-+ "next past catch 7"
-+
-+gdb_test "step" \
-+ ".*function1 ().*" \
-+ "step into until, for advance"
-+
-+gdb_test "advance $line" \
-+ ".*catch (...).*" \
-+ "advance-over-throw"
-Index: gdb-7.12.50.20170207/gdb/testsuite/gdb.dwarf2/dw2-bound-loclist.S
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ gdb-7.12.50.20170207/gdb/testsuite/gdb.dwarf2/dw2-bound-loclist.S 2017-02-26 19:15:36.601882344 +0100
-@@ -0,0 +1,246 @@
-+/* This testcase is part of GDB, the GNU debugger.
-+
-+ Copyright 2010 Free Software Foundation, Inc.
-+
-+ This program is free software; you can redistribute it and/or modify
-+ it under the terms of the GNU General Public License as published by
-+ the Free Software Foundation; either version 3 of the License, or
-+ (at your option) any later version.
-+
-+ This program is distributed in the hope that it will be useful,
-+ but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ GNU General Public License for more details.
-+
-+ You should have received a copy of the GNU General Public License
-+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
-+
-+/* Debug information */
-+
-+/* We will `break *main' at the very first instruction. */
-+#define main_length 1
-+
-+ .section .data
-+vardata:
-+ /* See DW_OP_lit3 + 1 (0-based). */
-+ .string "seennotseen"
-+
-+ .section .debug_info
-+.Lcu1_begin:
-+ .4byte .Lcu1_end - .Lcu1_start /* Length of Compilation Unit */
-+.Lcu1_start:
-+ .2byte 2 /* DWARF version number */
-+ .4byte .Ldebug_abbrev0 /* Offset Into Abbrev. Section */
-+ .byte 4 /* Pointer Size (in bytes) */
-+
-+ /* CU die */
-+ .uleb128 1 /* Abbrev: DW_TAG_compile_unit */
-+ .4byte .Lproducer /* DW_AT_producer */
-+ /* Use C++ to exploit a bug in parsing DW_AT_name "". */
-+ .byte 4 /* DW_AT_language (C++) - */
-+ .4byte main /* DW_AT_low_pc */
-+ .byte main_length /* DW_AT_high_pc */
-+
-+.Larray_type:
-+ .uleb128 2 /* Abbrev: DW_TAG_array_type */
-+ .4byte .Lchar_type-.Lcu1_begin /* DW_AT_type */
-+
-+ .uleb128 3 /* Abbrev: DW_TAG_subrange_type */
-+ .4byte .Luint_type-.Lcu1_begin /* DW_AT_type */
-+ .byte 0 /* DW_AT_lower_bound */
-+ .4byte .Llen_var-.Lcu1_begin /* DW_AT_upper_bound */
-+ .byte 0 /* End of children of die */
-+
-+ /* DW_AT_upper_bound is referencing an optimized-out variable. */
-+.Larrayb_type:
-+ .uleb128 2 /* Abbrev: DW_TAG_array_type */
-+ .4byte .Lchar_type-.Lcu1_begin /* DW_AT_type */
-+
-+ .uleb128 3 /* Abbrev: DW_TAG_subrange_type */
-+ .4byte .Luint_type-.Lcu1_begin /* DW_AT_type */
-+ .byte 0 /* DW_AT_lower_bound */
-+ .4byte .Llenb_var-.Lcu1_begin /* DW_AT_upper_bound */
-+ .byte 0 /* End of children of die */
-+
-+ /* DW_AT_upper_bound is referencing register. */
-+.Larrayreg_type:
-+ .uleb128 2 /* Abbrev: DW_TAG_array_type */
-+ .4byte .Lchar_type-.Lcu1_begin /* DW_AT_type */
-+
-+ .uleb128 8 /* Abbrev: DW_TAG_subrange_type with block */
-+ .4byte .Luint_type-.Lcu1_begin /* DW_AT_type */
-+ .byte 0 /* DW_AT_lower_bound */
-+ .byte 2f - 1f /* DW_AT_upper_bound */
-+1: .byte 0x50 /* DW_OP_reg0 */
-+2:
-+ .byte 0 /* End of children of die */
-+
-+.Luint_type:
-+ .uleb128 4 /* Abbrev: DW_TAG_base_type */
-+ .4byte .Luint_str /* DW_AT_name */
-+ .byte 4 /* DW_AT_byte_size */
-+ .byte 7 /* DW_AT_encoding */
-+
-+.Lchar_type:
-+ .uleb128 4 /* Abbrev: DW_TAG_base_type */
-+ .4byte .Lchar_str /* DW_AT_name */
-+ .byte 1 /* DW_AT_byte_size */
-+ .byte 6 /* DW_AT_encoding */
-+
-+.Llen_var:
-+ .uleb128 5 /* Abbrev: DW_TAG_variable artificial */
-+ .byte 1 /* DW_AT_artificial */
-+ .4byte .Luint_type-.Lcu1_begin /* DW_AT_type */
-+ .4byte .Llen_loclist-.Lloclist /* DW_AT_location */
-+
-+ /* optimized-out variable for b_string. */
-+.Llenb_var:
-+ .uleb128 7 /* Abbrev: DW_TAG_variable artificial no DW_AT_location */
-+ .byte 1 /* DW_AT_artificial */
-+ .4byte .Luint_type-.Lcu1_begin /* DW_AT_type */
-+
-+ .uleb128 6 /* Abbrev: DW_TAG_variable DW_FORM_string */
-+ .string "a_string" /* DW_AT_name */
-+ .4byte .Larray_type-.Lcu1_begin /* DW_AT_type */
-+ .byte 2f - 1f /* DW_AT_location */
-+1: .byte 3 /* DW_OP_addr */
-+ .4byte vardata /* <addr> */
-+2:
-+
-+ /* DW_AT_upper_bound is referencing an optimized-out variable. */
-+ .uleb128 6 /* Abbrev: DW_TAG_variable DW_FORM_string */
-+ .string "b_string" /* DW_AT_name */
-+ .4byte .Larrayb_type-.Lcu1_begin /* DW_AT_type */
-+ .byte 2f - 1f /* DW_AT_location */
-+1: .byte 3 /* DW_OP_addr */
-+ .4byte vardata /* <addr> */
-+2:
-+
-+ /* DW_AT_upper_bound is referencing register. */
-+ .uleb128 6 /* Abbrev: DW_TAG_variable DW_FORM_string */
-+ .string "reg_string" /* DW_AT_name */
-+ .4byte .Larrayreg_type-.Lcu1_begin /* DW_AT_type */
-+ .byte 2f - 1f /* DW_AT_location */
-+1: .byte 3 /* DW_OP_addr */
-+ .4byte vardata /* <addr> */
-+2:
-+
-+ .byte 0 /* End of children of CU */
-+.Lcu1_end:
-+
-+ .section .debug_loc
-+.Lloclist:
-+.Llen_loclist:
-+ .4byte 0 # Location list begin address
-+ .4byte main_length # Location list end address
-+ .value 2f-1f # Location expression size
-+1: .byte 0x33 # DW_OP_lit3
-+ .byte 0x9f # DW_OP_stack_value
-+2:
-+ .quad 0x0 # Location list terminator begin (*.LLST2)
-+ .quad 0x0 # Location list terminator end (*.LLST2)
-+
-+ .section .debug_abbrev
-+.Ldebug_abbrev0:
-+ .uleb128 1 /* Abbrev code */
-+ .uleb128 0x11 /* DW_TAG_compile_unit */
-+ .byte 0x1 /* has_children */
-+ .uleb128 0x25 /* DW_AT_producer */
-+ .uleb128 0xe /* DW_FORM_strp */
-+ .uleb128 0x13 /* DW_AT_language */
-+ .uleb128 0xb /* DW_FORM_data1 */
-+ .uleb128 0x11 /* DW_AT_low_pc */
-+ .uleb128 0x1 /* DW_FORM_addr */
-+ .uleb128 0x12 /* DW_AT_high_pc */
-+ .uleb128 0xb /* DW_FORM_data1 */
-+ .byte 0x0 /* Terminator */
-+ .byte 0x0 /* Terminator */
-+
-+ .uleb128 2 /* Abbrev code */
-+ .uleb128 0x1 /* TAG: DW_TAG_array_type */
-+ .byte 0x1 /* DW_children_yes */
-+ .uleb128 0x49 /* DW_AT_type */
-+ .uleb128 0x13 /* DW_FORM_ref4 */
-+ .byte 0x0 /* Terminator */
-+ .byte 0x0 /* Terminator */
-+
-+ .uleb128 3 /* Abbrev code */
-+ .uleb128 0x21 /* DW_TAG_subrange_type */
-+ .byte 0x0 /* no children */
-+ .uleb128 0x49 /* DW_AT_type */
-+ .uleb128 0x13 /* DW_FORM_ref4 */
-+ .uleb128 0x22 /* DW_AT_lower_bound */
-+ .uleb128 0xb /* DW_FORM_data1 */
-+ .uleb128 0x2f /* DW_AT_upper_bound */
-+ .uleb128 0x13 /* DW_FORM_ref4 */
-+ .byte 0x0 /* Terminator */
-+ .byte 0x0 /* Terminator */
-+
-+ .uleb128 4 /* Abbrev code */
-+ .uleb128 0x24 /* DW_TAG_base_type */
-+ .byte 0x0 /* no_children */
-+ .uleb128 0x3 /* DW_AT_name */
-+ .uleb128 0xe /* DW_FORM_strp */
-+ .uleb128 0xb /* DW_AT_byte_size */
-+ .uleb128 0xb /* DW_FORM_data1 */
-+ .uleb128 0x3e /* DW_AT_encoding */
-+ .uleb128 0xb /* DW_FORM_data1 */
-+ .byte 0x0 /* Terminator */
-+ .byte 0x0 /* Terminator */
-+
-+ .uleb128 5 /* Abbrev code */
-+ .uleb128 0x34 /* DW_TAG_variable */
-+ .byte 0x0 /* no_children */
-+ .uleb128 0x34 /* DW_AT_artificial */
-+ .uleb128 0x0c /* DW_FORM_flag */
-+ .uleb128 0x49 /* DW_AT_type */
-+ .uleb128 0x13 /* DW_FORM_ref4 */
-+ .uleb128 0x02 /* DW_AT_location */
-+ .uleb128 0x06 /* DW_FORM_data4 */
-+ .byte 0x0 /* Terminator */
-+ .byte 0x0 /* Terminator */
-+
-+ .uleb128 6 /* Abbrev code */
-+ .uleb128 0x34 /* DW_TAG_variable */
-+ .byte 0x0 /* no_children */
-+ .uleb128 0x3 /* DW_AT_name */
-+ .uleb128 0x8 /* DW_FORM_string */
-+ .uleb128 0x49 /* DW_AT_type */
-+ .uleb128 0x13 /* DW_FORM_ref4 */
-+ .uleb128 0x2 /* DW_AT_location */
-+ .uleb128 0xa /* DW_FORM_block1 */
-+ .byte 0x0 /* Terminator */
-+ .byte 0x0 /* Terminator */
-+
-+ .uleb128 7 /* Abbrev code */
-+ .uleb128 0x34 /* DW_TAG_variable */
-+ .byte 0x0 /* no_children */
-+ .uleb128 0x34 /* DW_AT_artificial */
-+ .uleb128 0x0c /* DW_FORM_flag */
-+ .uleb128 0x49 /* DW_AT_type */
-+ .uleb128 0x13 /* DW_FORM_ref4 */
-+ .byte 0x0 /* Terminator */
-+ .byte 0x0 /* Terminator */
-+
-+ .uleb128 8 /* Abbrev code */
-+ .uleb128 0x21 /* DW_TAG_subrange_type with block */
-+ .byte 0x0 /* no children */
-+ .uleb128 0x49 /* DW_AT_type */
-+ .uleb128 0x13 /* DW_FORM_ref4 */
-+ .uleb128 0x22 /* DW_AT_lower_bound */
-+ .uleb128 0xb /* DW_FORM_data1 */
-+ .uleb128 0x2f /* DW_AT_upper_bound */
-+ .uleb128 0xa /* DW_FORM_block1 */
-+ .byte 0x0 /* Terminator */
-+ .byte 0x0 /* Terminator */
-+
-+ .byte 0x0 /* Terminator */
-+
-+/* String table */
-+ .section .debug_str
-+.Lproducer:
-+ .string "GNU C 3.3.3"
-+.Lchar_str:
-+ .string "char"
-+.Luint_str:
-+ .string "unsigned int"
-Index: gdb-7.12.50.20170207/gdb/testsuite/gdb.dwarf2/dw2-bound-loclist.exp
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ gdb-7.12.50.20170207/gdb/testsuite/gdb.dwarf2/dw2-bound-loclist.exp 2017-02-26 19:15:36.602882352 +0100
-@@ -0,0 +1,66 @@
-+# Copyright 2010 Free Software Foundation, Inc.
-+
-+# This program is free software; you can redistribute it and/or modify
-+# it under the terms of the GNU General Public License as published by
-+# the Free Software Foundation; either version 3 of the License, or
-+# (at your option) any later version.
-+#
-+# This program is distributed in the hope that it will be useful,
-+# but WITHOUT ANY WARRANTY; without even the implied warranty of
-+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+# GNU General Public License for more details.
-+#
-+# You should have received a copy of the GNU General Public License
-+# along with this program. If not, see <http://www.gnu.org/licenses/>.
-+
-+# Test printing variable with dynamic bounds which reference a different
-+# (artificial in the GCC case) variable containing loclist as its location.
-+# This testcase uses value (not address) of the referenced variable:
-+# http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43762
-+
-+# This test can only be run on targets which support DWARF-2 and use gas.
-+# For now pick a sampling of likely targets.
-+if {![istarget *-*-linux*]
-+ && ![istarget *-*-gnu*]
-+ && ![istarget *-*-elf*]
-+ && ![istarget *-*-openbsd*]
-+ && ![istarget arm-*-eabi*]
-+ && ![istarget powerpc-*-eabi*]} {
-+ return 0
-+}
-+
-+set testfile dw2-bound-loclist
-+if { [prepare_for_testing ${testfile}.exp ${testfile} [list ${testfile}.S main.c] {}] } {
-+ return -1
-+}
-+
-+# Verify it behaves at least as an unbound array without inferior.
-+
-+# FIXME: FSF GDB crashes due to !has_stack_frames ().
-+# But in practice that should not happen.
-+# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=43762
-+#set test "p a_string"
-+#gdb_test_multiple $test $test {
-+# -re " = 0x\[0-9a-f\]+ \"seennotseen\"\r\n$gdb_prompt $" {
-+# pass $test
-+# }
-+# -re "No registers\\.\r\n$gdb_prompt $" {
-+# kfail "vlaregression" $test
-+# }
-+#}
-+#
-+#gdb_test "ptype a_string" {type = char \[variable length\]}
-+
-+# Not runto_main as dw2-bound-loclist.S handles only the first byte of main.
-+if ![runto "*main"] {
-+ return -1
-+}
-+
-+gdb_test "p a_string" { = "seen"}
-+gdb_test "ptype a_string" {type = char \[4\]}
-+
-+gdb_test "p b_string" { = (0x[0-9a-f]+ )?"seennotseen"}
-+gdb_test "ptype b_string" {type = char \[\]}
-+
-+# The register contains unpredictable value - the array size.
-+gdb_test "ptype reg_string" {type = char \[-?[0-9]+\]}
-Index: gdb-7.12.50.20170207/gdb/testsuite/gdb.dwarf2/dw2-stripped.c
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ gdb-7.12.50.20170207/gdb/testsuite/gdb.dwarf2/dw2-stripped.c 2017-02-26 19:15:36.602882352 +0100
-@@ -0,0 +1,42 @@
-+/* This testcase is part of GDB, the GNU debugger.
-+
-+ Copyright 2004 Free Software Foundation, Inc.
-+
-+ This program is free software; you can redistribute it and/or modify
-+ it under the terms of the GNU General Public License as published by
-+ the Free Software Foundation; either version 2 of the License, or
-+ (at your option) any later version.
-+
-+ This program is distributed in the hope that it will be useful,
-+ but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ GNU General Public License for more details.
-+
-+ You should have received a copy of the GNU General Public License
-+ along with this program; if not, write to the Free Software
-+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
-+ USA. */
-+
-+
-+/* The function `func1' traced into must have debug info on offset > 0;
-+ (DW_UNSND (attr)). This is the reason of `func0' existence. */
-+
-+void
-+func0(int a, int b)
-+{
-+}
-+
-+/* `func1' being traced into must have some arguments to dump. */
-+
-+void
-+func1(int a, int b)
-+{
-+ func0 (a,b);
-+}
-+
-+int
-+main(void)
-+{
-+ func1 (1, 2);
-+ return 0;
-+}
-Index: gdb-7.12.50.20170207/gdb/testsuite/gdb.dwarf2/dw2-stripped.exp
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ gdb-7.12.50.20170207/gdb/testsuite/gdb.dwarf2/dw2-stripped.exp 2017-02-26 19:15:36.602882352 +0100
-@@ -0,0 +1,79 @@
-+# Copyright 2006 Free Software Foundation, Inc.
-+
-+# This program is free software; you can redistribute it and/or modify
-+# it under the terms of the GNU General Public License as published by
-+# the Free Software Foundation; either version 2 of the License, or
-+# (at your option) any later version.
-+#
-+# This program is distributed in the hope that it will be useful,
-+# but WITHOUT ANY WARRANTY; without even the implied warranty of
-+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+# GNU General Public License for more details.
-+#
-+# You should have received a copy of the GNU General Public License
-+# along with this program; if not, write to the Free Software
-+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-+
-+# Minimal DWARF-2 unit test
-+
-+# This test can only be run on targets which support DWARF-2.
-+# For now pick a sampling of likely targets.
-+if {![istarget *-*-linux*]
-+ && ![istarget *-*-gnu*]
-+ && ![istarget *-*-elf*]
-+ && ![istarget *-*-openbsd*]
-+ && ![istarget arm-*-eabi*]
-+ && ![istarget powerpc-*-eabi*]} {
-+ return 0
-+}
-+
-+set testfile "dw2-stripped"
-+set srcfile ${testfile}.c
-+set binfile [standard_output_file ${testfile}.x]
-+
-+remote_exec build "rm -f ${binfile}"
-+
-+# get the value of gcc_compiled
-+if [get_compiler_info ${binfile}] {
-+ return -1
-+}
-+
-+# This test can only be run on gcc as we use additional_flags=FIXME
-+if {$gcc_compiled == 0} {
-+ return 0
-+}
-+
-+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug additional_flags=-ggdb3}] != "" } {
-+ return -1
-+}
-+
-+remote_exec build "objcopy -R .debug_loc ${binfile}"
-+set strip_output [remote_exec build "objdump -h ${binfile}"]
-+
-+set test "stripping test file preservation"
-+if [ regexp ".debug_info " $strip_output] {
-+ pass "$test (.debug_info preserved)"
-+} else {
-+ fail "$test (.debug_info got also stripped)"
-+}
-+
-+set test "stripping test file functionality"
-+if [ regexp ".debug_loc " $strip_output] {
-+ fail "$test (.debug_loc still present)"
-+} else {
-+ pass "$test (.debug_loc stripped)"
-+}
-+
-+gdb_exit
-+gdb_start
-+gdb_reinitialize_dir $srcdir/$subdir
-+gdb_load ${binfile}
-+
-+# For C programs, "start" should stop in main().
-+
-+gdb_test "start" \
-+ ".*main \\(\\) at .*" \
-+ "start"
-+gdb_test "step" \
-+ "func.* \\(.*\\) at .*" \
-+ "step"
-Index: gdb-7.12.50.20170207/gdb/testsuite/gdb.dwarf2/dw2-struct-member-data-location.S
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ gdb-7.12.50.20170207/gdb/testsuite/gdb.dwarf2/dw2-struct-member-data-location.S 2017-02-26 19:15:36.602882352 +0100
-@@ -0,0 +1,83 @@
-+/* This testcase is part of GDB, the GNU debugger.
-+
-+ Copyright 2009 Free Software Foundation, Inc.
-+
-+ This program is free software; you can redistribute it and/or modify
-+ it under the terms of the GNU General Public License as published by
-+ the Free Software Foundation; either version 3 of the License, or
-+ (at your option) any later version.
-+
-+ This program is distributed in the hope that it will be useful,
-+ but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ GNU General Public License for more details.
-+
-+ You should have received a copy of the GNU General Public License
-+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
-+
-+/* Debug information */
-+
-+ .section .debug_info
-+.Lcu1_begin:
-+ /* CU header */
-+ .4byte .Lcu1_end - .Lcu1_start /* Length of Compilation Unit */
-+.Lcu1_start:
-+ .2byte 2 /* DWARF Version */
-+ .4byte .Labbrev1_begin /* Offset into abbrev section */
-+ .byte 4 /* Pointer size */
-+
-+ /* CU die */
-+ .uleb128 1 /* Abbrev: DW_TAG_compile_unit */
-+ .ascii "dw2-struct-member-data-location.c\0" /* DW_AT_name */
-+ .ascii "GNU C 4.3.2\0" /* DW_AT_producer */
-+ .byte 1 /* DW_AT_language (C) */
-+
-+.Ltype_uchar:
-+ .uleb128 2 /* Abbrev: DW_TAG_structure_type */
-+ .ascii "some_struct\0" /* DW_AT_name */
-+
-+ .uleb128 3 /* Abbrev: DW_TAG_member */
-+ .ascii "field\0" /* DW_AT_name */
-+ .byte 0 /* DW_AT_data_member_location */
-+
-+ .byte 0 /* End of children of some_struct */
-+
-+ .byte 0 /* End of children of CU */
-+
-+.Lcu1_end:
-+
-+/* Abbrev table */
-+ .section .debug_abbrev
-+.Labbrev1_begin:
-+ .uleb128 1 /* Abbrev code */
-+ .uleb128 0x11 /* DW_TAG_compile_unit */
-+ .byte 1 /* has_children */
-+ .uleb128 0x3 /* DW_AT_name */
-+ .uleb128 0x8 /* DW_FORM_string */
-+ .uleb128 0x25 /* DW_AT_producer */
-+ .uleb128 0x8 /* DW_FORM_string */
-+ .uleb128 0x13 /* DW_AT_language */
-+ .uleb128 0xb /* DW_FORM_data1 */
-+ .byte 0x0 /* Terminator */
-+ .byte 0x0 /* Terminator */
-+
-+ .uleb128 2 /* Abbrev code */
-+ .uleb128 0x13 /* DW_TAG_structure_type */
-+ .byte 1 /* has_children */
-+ .uleb128 0x3 /* DW_AT_name */
-+ .uleb128 0x8 /* DW_FORM_string */
-+ .byte 0x0 /* Terminator */
-+ .byte 0x0 /* Terminator */
-+
-+ .uleb128 3 /* Abbrev code */
-+ .uleb128 0x0d /* DW_TAG_member */
-+ .byte 0 /* has_children */
-+ .uleb128 0x3 /* DW_AT_name */
-+ .uleb128 0x8 /* DW_FORM_string */
-+ .uleb128 0x38 /* DW_AT_data_member_location */
-+ .uleb128 0x0b /* DW_FORM_data1 */
-+ .byte 0x0 /* Terminator */
-+ .byte 0x0 /* Terminator */
-+
-+ .byte 0x0 /* Terminator */
-+ .byte 0x0 /* Terminator */
-Index: gdb-7.12.50.20170207/gdb/testsuite/gdb.dwarf2/dw2-struct-member-data-location.exp
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ gdb-7.12.50.20170207/gdb/testsuite/gdb.dwarf2/dw2-struct-member-data-location.exp 2017-02-26 19:15:36.602882352 +0100
-@@ -0,0 +1,37 @@
-+# Copyright 2009 Free Software Foundation, Inc.
-+
-+# This program is free software; you can redistribute it and/or modify
-+# it under the terms of the GNU General Public License as published by
-+# the Free Software Foundation; either version 3 of the License, or
-+# (at your option) any later version.
-+#
-+# This program is distributed in the hope that it will be useful,
-+# but WITHOUT ANY WARRANTY; without even the implied warranty of
-+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+# GNU General Public License for more details.
-+#
-+# You should have received a copy of the GNU General Public License
-+# along with this program. If not, see <http://www.gnu.org/licenses/>.
-+
-+# This test can only be run on targets which support DWARF-2 and use gas.
-+# For now pick a sampling of likely targets.
-+if {![istarget *-*-linux*]
-+ && ![istarget *-*-gnu*]
-+ && ![istarget *-*-elf*]
-+ && ![istarget *-*-openbsd*]
-+ && ![istarget arm-*-eabi*]
-+ && ![istarget powerpc-*-eabi*]} {
-+ return 0
-+}
-+
-+set testfile "dw2-struct-member-data-location"
-+set srcfile ${testfile}.S
-+set binfile ${testfile}.x
-+
-+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "[standard_output_file ${binfile}]" object {nodebug}] != "" } {
-+ return -1
-+}
-+
-+clean_restart $binfile
-+
-+gdb_test "ptype struct some_struct" "type = struct some_struct {\[\r\n \t\]*void field;\[\r\n \t\]*}"
-Index: gdb-7.12.50.20170207/gdb/testsuite/gdb.dwarf2/dw2-subrange-no-type.S
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ gdb-7.12.50.20170207/gdb/testsuite/gdb.dwarf2/dw2-subrange-no-type.S 2017-02-26 19:15:36.602882352 +0100
-@@ -0,0 +1,121 @@
-+/* This testcase is part of GDB, the GNU debugger.
-+
-+ Copyright 2012 Free Software Foundation, Inc.
-+
-+ This program is free software; you can redistribute it and/or modify
-+ it under the terms of the GNU General Public License as published by
-+ the Free Software Foundation; either version 3 of the License, or
-+ (at your option) any later version.
-+
-+ This program is distributed in the hope that it will be useful,
-+ but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ GNU General Public License for more details.
-+
-+ You should have received a copy of the GNU General Public License
-+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
-+
-+/* Debug information */
-+
-+ .section .data
-+vardata:
-+ .rept 129
-+ .ascii "x"
-+ .endr
-+ .ascii "UNSEEN\0"
-+
-+ .section .debug_info
-+.Lcu1_begin:
-+ .4byte .Lcu1_end - .Lcu1_start /* Length of Compilation Unit */
-+.Lcu1_start:
-+ .2byte 2 /* DWARF version number */
-+ .4byte .Ldebug_abbrev0 /* Offset Into Abbrev. Section */
-+ .byte 4 /* Pointer Size (in bytes) */
-+
-+ /* CU die */
-+ .uleb128 1 /* Abbrev: DW_TAG_compile_unit */
-+ .ascii "GNU C 3.3.3\0" /* DW_AT_producer */
-+ .byte 2 /* DW_AT_language (C) - */
-+
-+.Larray_type:
-+ .uleb128 2 /* Abbrev: DW_TAG_array_type */
-+ .4byte .Lchar_type-.Lcu1_begin /* DW_AT_type */
-+
-+ .uleb128 8 /* Abbrev: DW_TAG_subrange_type without DW_AT_type */
-+ .byte 0 /* DW_AT_lower_bound */
-+ .byte 128 /* DW_AT_upper_bound */
-+
-+ .byte 0 /* End of children of die */
-+
-+.Lchar_type:
-+ .uleb128 4 /* Abbrev: DW_TAG_base_type */
-+ .ascii "char\0" /* DW_AT_name */
-+ .byte 1 /* DW_AT_byte_size */
-+ .byte 6 /* DW_AT_encoding */
-+
-+ .uleb128 6 /* Abbrev: DW_TAG_variable DW_FORM_string */
-+ .ascii "notype_string\0" /* DW_AT_name */
-+ .4byte .Larray_type-.Lcu1_begin /* DW_AT_type */
-+ .byte 2f - 1f /* DW_AT_location */
-+1: .byte 3 /* DW_OP_addr */
-+ .4byte vardata /* <addr> */
-+2:
-+
-+ .byte 0 /* End of children of CU */
-+.Lcu1_end:
-+
-+ .section .debug_abbrev
-+.Ldebug_abbrev0:
-+ .uleb128 1 /* Abbrev code */
-+ .uleb128 0x11 /* DW_TAG_compile_unit */
-+ .byte 0x1 /* has_children */
-+ .uleb128 0x25 /* DW_AT_producer */
-+ .uleb128 0x8 /* DW_FORM_string */
-+ .uleb128 0x13 /* DW_AT_language */
-+ .uleb128 0xb /* DW_FORM_data1 */
-+ .byte 0x0 /* Terminator */
-+ .byte 0x0 /* Terminator */
-+
-+ .uleb128 2 /* Abbrev code */
-+ .uleb128 0x1 /* TAG: DW_TAG_array_type */
-+ .byte 0x1 /* DW_children_yes */
-+ .uleb128 0x49 /* DW_AT_type */
-+ .uleb128 0x13 /* DW_FORM_ref4 */
-+ .byte 0x0 /* Terminator */
-+ .byte 0x0 /* Terminator */
-+
-+ .uleb128 4 /* Abbrev code */
-+ .uleb128 0x24 /* DW_TAG_base_type */
-+ .byte 0x0 /* no_children */
-+ .uleb128 0x3 /* DW_AT_name */
-+ .uleb128 0x8 /* DW_FORM_string */
-+ .uleb128 0xb /* DW_AT_byte_size */
-+ .uleb128 0xb /* DW_FORM_data1 */
-+ .uleb128 0x3e /* DW_AT_encoding */
-+ .uleb128 0xb /* DW_FORM_data1 */
-+ .byte 0x0 /* Terminator */
-+ .byte 0x0 /* Terminator */
-+
-+ .uleb128 6 /* Abbrev code */
-+ .uleb128 0x34 /* DW_TAG_variable */
-+ .byte 0x0 /* no_children */
-+ .uleb128 0x3 /* DW_AT_name */
-+ .uleb128 0x8 /* DW_FORM_string */
-+ .uleb128 0x49 /* DW_AT_type */
-+ .uleb128 0x13 /* DW_FORM_ref4 */
-+ .uleb128 0x2 /* DW_AT_location */
-+ .uleb128 0xa /* DW_FORM_block1 */
-+ .byte 0x0 /* Terminator */
-+ .byte 0x0 /* Terminator */
-+
-+ .uleb128 8 /* Abbrev code */
-+ .uleb128 0x21 /* DW_TAG_subrange_type without DW_AT_type */
-+ .byte 0x0 /* no children */
-+ .uleb128 0x22 /* DW_AT_lower_bound */
-+ .uleb128 0xb /* DW_FORM_data1 */
-+ .uleb128 0x2f /* DW_AT_upper_bound */
-+ .uleb128 0xb /* DW_FORM_data1 */
-+ .byte 0x0 /* Terminator */
-+ .byte 0x0 /* Terminator */
-+
-+ .byte 0x0 /* Terminator */
-Index: gdb-7.12.50.20170207/gdb/testsuite/gdb.dwarf2/dw2-subrange-no-type.exp
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ gdb-7.12.50.20170207/gdb/testsuite/gdb.dwarf2/dw2-subrange-no-type.exp 2017-02-26 19:15:36.603882359 +0100
-@@ -0,0 +1,39 @@
-+# Copyright 2012 Free Software Foundation, Inc.
-+
-+# This program is free software; you can redistribute it and/or modify
-+# it under the terms of the GNU General Public License as published by
-+# the Free Software Foundation; either version 3 of the License, or
-+# (at your option) any later version.
-+#
-+# This program is distributed in the hope that it will be useful,
-+# but WITHOUT ANY WARRANTY; without even the implied warranty of
-+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+# GNU General Public License for more details.
-+#
-+# You should have received a copy of the GNU General Public License
-+# along with this program. If not, see <http://www.gnu.org/licenses/>.
-+load_lib dwarf.exp
-+
-+# https://bugzilla.redhat.com/show_bug.cgi?id=806920
-+# read_subrange_type <TYPE_CODE (base_type) == TYPE_CODE_VOID> reinitialization
-+# of BASE_TYPE was done too late, it affects DW_TAG_subrange_type without
-+# specified DW_AT_type, present only in XLF produced code.
-+
-+# This test can only be run on targets which support DWARF-2 and use gas.
-+if {![dwarf2_support]} {
-+ return 0
-+}
-+
-+set testfile dw2-subrange-no-type
-+set srcfile ${testfile}.S
-+set executable ${testfile}.x
-+set binfile [standard_output_file ${executable}]
-+
-+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" object {}] != "" } {
-+ return -1
-+}
-+
-+clean_restart $executable
-+
-+gdb_test "ptype notype_string" {type = char \[129\]}
-+gdb_test "p notype_string" " = 'x' <repeats 129 times>"
-Index: gdb-7.12.50.20170207/gdb/testsuite/gdb.fortran/dwarf-stride.exp
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ gdb-7.12.50.20170207/gdb/testsuite/gdb.fortran/dwarf-stride.exp 2017-02-26 19:15:36.603882359 +0100
-@@ -0,0 +1,42 @@
-+# Copyright 2009 Free Software Foundation, Inc.
-+
-+# This program is free software; you can redistribute it and/or modify
-+# it under the terms of the GNU General Public License as published by
-+# the Free Software Foundation; either version 2 of the License, or
-+# (at your option) any later version.
-+#
-+# This program is distributed in the hope that it will be useful,
-+# but WITHOUT ANY WARRANTY; without even the implied warranty of
-+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+# GNU General Public License for more details.
-+#
-+# You should have received a copy of the GNU General Public License
-+# along with this program; if not, write to the Free Software
-+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-+
-+# This file was written by Jan Kratochvil <jan.kratochvil(a)redhat.com>.
-+
-+# This file is part of the gdb testsuite. Array element stride must not be
-+# specified in the number of elements but in a number of bytes instead.
-+# Original problem:
-+# (gdb) p c40pt(1)
-+# $1 = '0-hello', ' ' <repeats 33 times>
-+# (gdb) p c40pt(2)
-+# warning: Fortran array stride not divisible by the element size
-+
-+set testfile dwarf-stride
-+set srcfile ${testfile}.f90
-+
-+if { [prepare_for_testing ${testfile}.exp ${testfile} ${srcfile} {debug f90}] } {
-+ return -1
-+}
-+
-+if ![runto MAIN__] then {
-+ perror "couldn't run to breakpoint MAIN__"
-+ continue
-+}
-+
-+gdb_breakpoint [gdb_get_line_number "break-here"]
-+gdb_continue_to_breakpoint "break-here" ".*break-here.*"
-+gdb_test "p c40pt(1)" " = '0-hello.*"
-+gdb_test "p c40pt(2)" " = '1-hello.*"
-Index: gdb-7.12.50.20170207/gdb/testsuite/gdb.fortran/dwarf-stride.f90
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ gdb-7.12.50.20170207/gdb/testsuite/gdb.fortran/dwarf-stride.f90 2017-02-26 19:15:36.603882359 +0100
-@@ -0,0 +1,40 @@
-+! Copyright 2009 Free Software Foundation, Inc.
-+!
-+! This program is free software; you can redistribute it and/or modify
-+! it under the terms of the GNU General Public License as published by
-+! the Free Software Foundation; either version 2 of the License, or
-+! (at your option) any later version.
-+!
-+! This program is distributed in the hope that it will be useful,
-+! but WITHOUT ANY WARRANTY; without even the implied warranty of
-+! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+! GNU General Public License for more details.
-+!
-+! You should have received a copy of the GNU General Public License
-+! along with this program; if not, write to the Free Software
-+! Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-+!
-+! File written by Alan Matsuoka.
-+
-+program repro
-+
-+ type small_stride
-+ character*40 long_string
-+ integer small_pad
-+ end type small_stride
-+
-+ type(small_stride), dimension (20), target :: unpleasant
-+ character*40, pointer, dimension(:):: c40pt
-+
-+ integer i
-+
-+ do i = 0,19
-+ unpleasant(i+1)%small_pad = i+1
-+ unpleasant(i+1)%long_string = char (ichar('0') + i) // '-hello'
-+ end do
-+
-+ c40pt => unpleasant%long_string
-+
-+ print *, c40pt ! break-here
-+
-+end program repro
-Index: gdb-7.12.50.20170207/gdb/testsuite/gdb.fortran/dynamic.exp
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ gdb-7.12.50.20170207/gdb/testsuite/gdb.fortran/dynamic.exp 2017-02-26 19:15:36.603882359 +0100
-@@ -0,0 +1,154 @@
-+# Copyright 2007 Free Software Foundation, Inc.
-+
-+# This program is free software; you can redistribute it and/or modify
-+# it under the terms of the GNU General Public License as published by
-+# the Free Software Foundation; either version 2 of the License, or
-+# (at your option) any later version.
-+#
-+# This program is distributed in the hope that it will be useful,
-+# but WITHOUT ANY WARRANTY; without even the implied warranty of
-+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+# GNU General Public License for more details.
-+#
-+# You should have received a copy of the GNU General Public License
-+# along with this program; if not, write to the Free Software
-+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-+
-+# This file was written by Jan Kratochvil <jan.kratochvil(a)redhat.com>.
-+
-+# This file is part of the gdb testsuite. It contains tests for dynamically
-+# allocated Fortran arrays.
-+# It depends on the GCC dynamic Fortran arrays DWARF support:
-+# http://gcc.gnu.org/bugzilla/show_bug.cgi?id=22244
-+
-+set testfile "dynamic"
-+set srcfile ${testfile}.f90
-+set binfile [standard_output_file ${testfile}]
-+
-+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug f90 quiet}] != "" } {
-+ untested "Couldn't compile ${srcfile}"
-+ return -1
-+}
-+
-+gdb_exit
-+gdb_start
-+gdb_reinitialize_dir $srcdir/$subdir
-+gdb_load ${binfile}
-+
-+if ![runto MAIN__] then {
-+ perror "couldn't run to breakpoint MAIN__"
-+ continue
-+}
-+
-+gdb_breakpoint [gdb_get_line_number "varx-init"]
-+gdb_continue_to_breakpoint "varx-init"
-+
-+# http://www.cs.rpi.edu/~szymansk/OOF90/bugs.html#5
-+# Do not: gdb_test "p varx" "\\$\[0-9\]* = <not allocated>" "p varx unallocated"
-+# Do not: gdb_test "ptype varx" {type = real\(kind=4\) \(:,:,:\)} "ptype varx unallocated"
-+# Do not: gdb_test "p varx(1,5,17)" {no such vector element \(vector not allocated\)} "p varx(1,5,17) unallocated"
-+# Do not: gdb_test "p varx(1,5,17)=1" {no such vector element \(vector not allocated\)} "p varx(1,5,17)=1 unallocated"
-+# Do not: gdb_test "ptype varx(1,5,17)" {no such vector element \(vector not allocated\)} "ptype varx(1,5,17) unallocated"
-+
-+gdb_breakpoint [gdb_get_line_number "varx-allocated"]
-+gdb_continue_to_breakpoint "varx-allocated"
-+# $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"
-+# 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"
-+
-+gdb_breakpoint [gdb_get_line_number "varx-filled"]
-+gdb_continue_to_breakpoint "varx-filled"
-+gdb_test "p varx(2, 5, 17)" "\\$\[0-9\]* = 6"
-+gdb_test "p varx(1, 5, 17)" "\\$\[0-9\]* = 7"
-+gdb_test "p varx(2, 6, 18)" "\\$\[0-9\]* = 8"
-+gdb_test "p varx(6, 15, 28)" "\\$\[0-9\]* = 9"
-+# http://www.cs.rpi.edu/~szymansk/OOF90/bugs.html#5
-+# Do not: gdb_test "p varv" "\\$\[0-9\]* = <not associated>" "p varv unassociated"
-+# Do not: gdb_test "ptype varv" {type = real\(kind=4\) \(:,:,:\)} "ptype varv unassociated"
-+
-+set test "output varx"
-+gdb_test_multiple $test $test {
-+ -re "^output varx\r\n\[() ,6789.\]*$gdb_prompt $" {
-+ pass $test
-+ }
-+}
-+
-+gdb_breakpoint [gdb_get_line_number "varv-associated"]
-+gdb_continue_to_breakpoint "varv-associated"
-+gdb_test "p varx(3, 7, 19)" "\\$\[0-9\]* = 6" "p varx(3, 7, 19) with varv associated"
-+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"
-+# 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"
-+
-+gdb_breakpoint [gdb_get_line_number "varv-filled"]
-+gdb_continue_to_breakpoint "varv-filled"
-+gdb_test "p varx(3, 7, 19)" "\\$\[0-9\]* = 10" "p varx(3, 7, 19) with varv filled"
-+gdb_test "p varv(3, 7, 19)" "\\$\[0-9\]* = 10" "p varv(3, 7, 19) filled"
-+
-+gdb_breakpoint [gdb_get_line_number "varv-deassociated"]
-+gdb_continue_to_breakpoint "varv-deassociated"
-+# The latter one is for the Intel Fortran Compiler 10.1.008 pointer type.
-+gdb_test "p varv" "\\$\[0-9\]* = (<not associated>|.*(Cannot access it|Unable to access the object) because the object is not associated.)" "p varv deassociated"
-+gdb_test "ptype varv" {type = real\(kind=4\) \(:,:,:\)} "ptype varv deassociated"
-+gdb_test "p l" "\\$\[0-9\]* = \\.FALSE\\." "p l if varv deassociated"
-+gdb_test "p varv(1,5,17)" {no such vector element \(vector not associated\)}
-+gdb_test "ptype varv(1,5,17)" {no such vector element \(vector not associated\)}
-+
-+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 "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"
-+
-+gdb_breakpoint [gdb_get_line_number "vary-passed"]
-+gdb_continue_to_breakpoint "vary-passed"
-+# $1 = (( ( 1, 1, 1, 1, 1, 1) ( 1, 1, 1, 1, 1, 1) --- , 1) ) ( ( 1, 1, ...) ...) ...)
-+gdb_test "p vary" "\\$\[0-9\]* = \\(\[()1, .\]*\\)"
-+
-+gdb_breakpoint [gdb_get_line_number "vary-filled"]
-+gdb_continue_to_breakpoint "vary-filled"
-+gdb_test "ptype vary" "type = real(\\(kind=4\\)|\\*4) \\(10,10\\)"
-+gdb_test "p vary(1, 1)" "\\$\[0-9\]* = 8"
-+gdb_test "p vary(2, 2)" "\\$\[0-9\]* = 9"
-+gdb_test "p vary(1, 3)" "\\$\[0-9\]* = 10"
-+# $1 = (( ( 3, 3, 3, 3, 3, 3) ( 3, 3, 3, 3, 3, 3) --- , 3) ) ( ( 3, 3, ...) ...) ...)
-+gdb_test "p varw" "\\$\[0-9\]* = \\(\[()3, .\]*\\)"
-+
-+gdb_breakpoint [gdb_get_line_number "varw-almostfilled"]
-+gdb_continue_to_breakpoint "varw-almostfilled"
-+gdb_test "ptype varw" "type = real(\\(kind=4\\)|\\*4) \\(5,4,3\\)"
-+gdb_test "p varw(3,1,1)=1" "\\$\[0-9\]* = 1"
-+# $1 = (( ( 6, 5, 1, 5, 5, 5) ( 5, 5, 5, 5, 5, 5) --- , 5) ) ( ( 5, 5, ...) ...) ...)
-+gdb_test "p varw" "\\$\[0-9\]* = \\( *\\( *\\( *6, *5, *1,\[()5, .\]*\\)" "p varw filled"
-+# "up" works with GCC but other Fortran compilers may copy the values into the
-+# outer function only on the exit of the inner function.
-+# We need both variants as depending on the arch we optionally may still be
-+# executing the caller line or not after `finish'.
-+gdb_test "finish" ".*(call bar \\(y, x\\)|call foo \\(x, z\\(2:6, 4:7, 6:8\\)\\))"
-+gdb_test "p z(2,4,5)" "\\$\[0-9\]* = 3"
-+gdb_test "p z(2,4,6)" "\\$\[0-9\]* = 6"
-+gdb_test "p z(2,4,7)" "\\$\[0-9\]* = 5"
-+gdb_test "p z(4,4,6)" "\\$\[0-9\]* = 1"
-+
-+gdb_breakpoint [gdb_get_line_number "varz-almostfilled"]
-+gdb_continue_to_breakpoint "varz-almostfilled"
-+# GCC uses the pointer type here, Intel Fortran Compiler 10.1.008 does not.
-+gdb_test "ptype varz" "type = (PTR TO -> \\( )?real(\\(kind=4\\)|\\*4) \\(\\*\\)\\)?"
-+# Intel Fortran Compiler 10.1.008 has a bug here - (2:11,7:7)
-+# as it produces DW_AT_lower_bound == DW_AT_upper_bound == 7.
-+gdb_test "ptype vart" "type = (PTR TO -> \\( )?real(\\(kind=4\\)|\\*4) \\(2:11,7:\\*\\)\\)?"
-+gdb_test "p varz" "\\$\[0-9\]* = \\(\\)"
-+gdb_test "p vart" "\\$\[0-9\]* = \\(\\)"
-+gdb_test "p varz(3)" "\\$\[0-9\]* = 4"
-+# maps to foo::vary(1,1)
-+gdb_test "p vart(2,7)" "\\$\[0-9\]* = 8"
-+# maps to foo::vary(2,2)
-+gdb_test "p vart(3,8)" "\\$\[0-9\]* = 9"
-+# maps to foo::vary(1,3)
-+gdb_test "p vart(2,9)" "\\$\[0-9\]* = 10"
-Index: gdb-7.12.50.20170207/gdb/testsuite/gdb.fortran/dynamic.f90
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ gdb-7.12.50.20170207/gdb/testsuite/gdb.fortran/dynamic.f90 2017-02-26 19:15:36.603882359 +0100
-@@ -0,0 +1,98 @@
-+! Copyright 2007 Free Software Foundation, Inc.
-+!
-+! This program is free software; you can redistribute it and/or modify
-+! it under the terms of the GNU General Public License as published by
-+! the Free Software Foundation; either version 2 of the License, or
-+! (at your option) any later version.
-+!
-+! This program is distributed in the hope that it will be useful,
-+! but WITHOUT ANY WARRANTY; without even the implied warranty of
-+! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+! GNU General Public License for more details.
-+!
-+! You should have received a copy of the GNU General Public License
-+! along with this program; if not, write to the Free Software
-+! Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-+!
-+! Ihis file is the Fortran source file for dynamic.exp.
-+! Original file written by Jakub Jelinek <jakub(a)redhat.com>.
-+! Modified for the GDB testcase by Jan Kratochvil <jan.kratochvil(a)redhat.com>.
-+
-+subroutine baz
-+ real, target, allocatable :: varx (:, :, :)
-+ real, pointer :: varv (:, :, :)
-+ real, target :: varu (1, 2, 3)
-+ logical :: l
-+ allocate (varx (1:6, 5:15, 17:28)) ! varx-init
-+ l = allocated (varx)
-+ varx(:, :, :) = 6 ! varx-allocated
-+ varx(1, 5, 17) = 7
-+ varx(2, 6, 18) = 8
-+ varx(6, 15, 28) = 9
-+ varv => varx ! varx-filled
-+ l = associated (varv)
-+ varv(3, 7, 19) = 10 ! varv-associated
-+ varv => null () ! varv-filled
-+ l = associated (varv)
-+ deallocate (varx) ! varv-deassociated
-+ l = allocated (varx)
-+ varu(:, :, :) = 10 ! varx-deallocated
-+ allocate (varv (1:6, 5:15, 17:28))
-+ l = associated (varv)
-+ varv(:, :, :) = 6
-+ varv(1, 5, 17) = 7
-+ varv(2, 6, 18) = 8
-+ varv(6, 15, 28) = 9
-+ deallocate (varv)
-+ l = associated (varv)
-+ varv => varu
-+ varv(1, 1, 1) = 6
-+ varv(1, 2, 3) = 7
-+ l = associated (varv)
-+end subroutine baz
-+subroutine foo (vary, varw)
-+ real :: vary (:, :)
-+ real :: varw (:, :, :)
-+ vary(:, :) = 4 ! vary-passed
-+ vary(1, 1) = 8
-+ vary(2, 2) = 9
-+ vary(1, 3) = 10
-+ varw(:, :, :) = 5 ! vary-filled
-+ varw(1, 1, 1) = 6
-+ varw(2, 2, 2) = 7 ! varw-almostfilled
-+end subroutine foo
-+subroutine bar (varz, vart)
-+ real :: varz (*)
-+ real :: vart (2:11, 7:*)
-+ varz(1:3) = 4
-+ varz(2) = 5 ! varz-almostfilled
-+ vart(2,7) = vart(2,7)
-+end subroutine bar
-+program test
-+ interface
-+ subroutine foo (vary, varw)
-+ real :: vary (:, :)
-+ real :: varw (:, :, :)
-+ end subroutine
-+ end interface
-+ interface
-+ subroutine bar (varz, vart)
-+ real :: varz (*)
-+ real :: vart (2:11, 7:*)
-+ end subroutine
-+ end interface
-+ real :: x (10, 10), y (5), z(8, 8, 8)
-+ x(:,:) = 1
-+ y(:) = 2
-+ z(:,:,:) = 3
-+ call baz
-+ call foo (x, z(2:6, 4:7, 6:8))
-+ call bar (y, x)
-+ if (x (1, 1) .ne. 8 .or. x (2, 2) .ne. 9 .or. x (1, 2) .ne. 4) call abort
-+ if (x (1, 3) .ne. 10) call abort
-+ if (z (2, 4, 6) .ne. 6 .or. z (3, 5, 7) .ne. 7 .or. z (2, 4, 7) .ne. 5) call abort
-+ if (any (y .ne. (/4, 5, 4, 2, 2/))) call abort
-+ call foo (transpose (x), z)
-+ if (x (1, 1) .ne. 8 .or. x (2, 2) .ne. 9 .or. x (1, 2) .ne. 4) call abort
-+ if (x (3, 1) .ne. 10) call abort
-+end
-Index: gdb-7.12.50.20170207/gdb/testsuite/gdb.fortran/string.exp
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ gdb-7.12.50.20170207/gdb/testsuite/gdb.fortran/string.exp 2017-02-26 19:15:36.604882366 +0100
-@@ -0,0 +1,59 @@
-+# Copyright 2008 Free Software Foundation, Inc.
-+
-+# This program is free software; you can redistribute it and/or modify
-+# it under the terms of the GNU General Public License as published by
-+# the Free Software Foundation; either version 2 of the License, or
-+# (at your option) any later version.
-+#
-+# This program is distributed in the hope that it will be useful,
-+# but WITHOUT ANY WARRANTY; without even the implied warranty of
-+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+# GNU General Public License for more details.
-+#
-+# You should have received a copy of the GNU General Public License
-+# along with this program; if not, write to the Free Software
-+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-+
-+# This file was written by Jan Kratochvil <jan.kratochvil(a)redhat.com>.
-+
-+# This file is part of the gdb testsuite. It contains tests for Fortran
-+# strings with dynamic length.
-+
-+set testfile "string"
-+set srcfile ${testfile}.f90
-+set binfile [standard_output_file ${testfile}]
-+
-+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug f90 quiet}] != "" } {
-+ untested "Couldn't compile ${srcfile}"
-+ return -1
-+}
-+
-+gdb_exit
-+gdb_start
-+gdb_reinitialize_dir $srcdir/$subdir
-+gdb_load ${binfile}
-+
-+if ![runto MAIN__] then {
-+ perror "couldn't run to breakpoint MAIN__"
-+ continue
-+}
-+
-+gdb_breakpoint [gdb_get_line_number "var-init"]
-+gdb_continue_to_breakpoint "var-init"
-+gdb_test "ptype c" "type = character(\\(kind=1\\)|\\*1)"
-+gdb_test "ptype d" "type = character(\\(kind=8\\)|\\*8)"
-+gdb_test "ptype e" "type = character(\\(kind=4\\)|\\*4)"
-+gdb_test "ptype f" "type = character(\\(kind=4\\)|\\*4) \\(7,8:10\\)"
-+gdb_test "ptype *e" "Attempt to take contents of a non-pointer value."
-+gdb_test "ptype *f" "type = character(\\(kind=4\\)|\\*4) \\(7\\)"
-+gdb_test "p c" "\\$\[0-9\]* = 'c'"
-+gdb_test "p d" "\\$\[0-9\]* = 'd '"
-+gdb_test "p e" "\\$\[0-9\]* = 'g '"
-+gdb_test "p f" "\\$\[0-9\]* = \\(\\( 'h ', 'h ', 'h ', 'h ', 'h ', 'h ', 'h '\\) \\( 'h ', 'h ', 'h ', 'h ', 'h ', 'h ', 'h '\\) \\( 'h ', 'h ', 'h ', 'h ', 'h ', 'h ', 'h '\\) \\)"
-+gdb_test "p *e" "Attempt to take contents of a non-pointer value."
-+gdb_test "p *f" "Attempt to take contents of a non-pointer value."
-+
-+gdb_breakpoint [gdb_get_line_number "var-finish"]
-+gdb_continue_to_breakpoint "var-finish"
-+gdb_test "p e" "\\$\[0-9\]* = 'e '" "p e re-set"
-+gdb_test "p f" "\\$\[0-9\]* = \\(\\( 'f ', 'f ', 'f ', 'f ', 'f ', 'f ', 'f '\\) \\( 'f2 ', 'f ', 'f ', 'f ', 'f ', 'f ', 'f '\\) \\( 'f ', 'f ', 'f ', 'f ', 'f ', 'f ', 'f '\\) \\)" "p *f re-set"
-Index: gdb-7.12.50.20170207/gdb/testsuite/gdb.fortran/string.f90
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ gdb-7.12.50.20170207/gdb/testsuite/gdb.fortran/string.f90 2017-02-26 19:15:36.604882366 +0100
-@@ -0,0 +1,37 @@
-+! Copyright 2008 Free Software Foundation, Inc.
-+!
-+! This program is free software; you can redistribute it and/or modify
-+! it under the terms of the GNU General Public License as published by
-+! the Free Software Foundation; either version 2 of the License, or
-+! (at your option) any later version.
-+!
-+! This program is distributed in the hope that it will be useful,
-+! but WITHOUT ANY WARRANTY; without even the implied warranty of
-+! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+! GNU General Public License for more details.
-+!
-+! You should have received a copy of the GNU General Public License
-+! along with this program; if not, write to the Free Software
-+! Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-+!
-+! Ihis file is the Fortran source file for dynamic.exp.
-+! Original file written by Jakub Jelinek <jakub(a)redhat.com>.
-+! Modified for the GDB testcase by Jan Kratochvil <jan.kratochvil(a)redhat.com>.
-+
-+subroutine foo (e, f)
-+ character (len=1) :: c
-+ character (len=8) :: d
-+ character (len=*) :: e
-+ character (len=*) :: f (1:7, 8:10)
-+ c = 'c'
-+ d = 'd'
-+ e = 'e' ! var-init
-+ f = 'f'
-+ f(1,9) = 'f2'
-+ c = 'c' ! var-finish
-+end subroutine foo
-+ character (len=4) :: g, h (1:7, 8:10)
-+ g = 'g'
-+ h = 'h'
-+ call foo (g, h)
-+end
-Index: gdb-7.12.50.20170207/gdb/testsuite/gdb.fortran/subrange.exp
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ gdb-7.12.50.20170207/gdb/testsuite/gdb.fortran/subrange.exp 2017-02-26 19:15:36.604882366 +0100
-@@ -0,0 +1,72 @@
-+# Copyright 2011 Free Software Foundation, Inc.
-+
-+# This program is free software; you can redistribute it and/or modify
-+# it under the terms of the GNU General Public License as published by
-+# the Free Software Foundation; either version 3 of the License, or
-+# (at your option) any later version.
-+#
-+# This program is distributed in the hope that it will be useful,
-+# but WITHOUT ANY WARRANTY; without even the implied warranty of
-+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+# GNU General Public License for more details.
-+#
-+# You should have received a copy of the GNU General Public License
-+# along with this program. If not, see <http://www.gnu.org/licenses/>.
-+
-+if { [skip_fortran_tests] } { return -1 }
-+
-+set testfile "subrange"
-+set srcfile ${testfile}.f90
-+if { [prepare_for_testing ${testfile}.exp ${testfile} ${srcfile} {debug f90}] } {
-+ return -1
-+}
-+
-+if ![runto MAIN__] {
-+ perror "Couldn't run to MAIN__"
-+ continue
-+}
-+
-+# Depending on the compiler version being used, the name of the 4-byte integer
-+# and real types can be printed differently. For instance, gfortran-4.1 uses
-+# "int4" whereas gfortran-4.3 uses "int(kind=4)".
-+set int4 "(int4|integer\\(kind=4\\))"
-+
-+gdb_breakpoint [gdb_get_line_number "break-static"]
-+gdb_continue_to_breakpoint "break-static" ".*break-static.*"
-+
-+foreach var {a alloc ptr} {
-+ global pf_prefix
-+ set old_prefix $pf_prefix
-+ lappend pf_prefix "$var:"
-+
-+ setup_kfail "*-*-*" "vlaregression/9999"
-+ gdb_test "p $var (2, 2:3)" { = \(22, 32\)}
-+ setup_kfail "*-*-*" "vlaregression/9999"
-+ gdb_test "p $var (2:3, 3)" { = \(32, 33\)}
-+ setup_kfail "*-*-*" "vlaregression/9999"
-+ gdb_test "p $var (1, 2:)" { = \(21, 31\)}
-+ setup_kfail "*-*-*" "vlaregression/9999"
-+ gdb_test "p $var (2, :2)" { = \(12, 22\)}
-+ setup_kfail "*-*-*" "vlaregression/9999"
-+ gdb_test "p $var (3, 2:2)" { = \(23\)}
-+ setup_kfail "*-*-*" "vlaregression/9999"
-+ gdb_test "ptype $var (3, 2:2)" " = $int4 \\(2:2\\)"
-+ setup_kfail "*-*-*" "vlaregression/9999"
-+ gdb_test "p $var (4, :)" { = \(14, 24, 34\)}
-+ setup_kfail "*-*-*" "vlaregression/9999"
-+ gdb_test "p $var (:, :)" { = \(\( *11, 12, 13, 14\) \( *21, 22, 23, 24\) \( *31, 32, 33, 34\) *\)}
-+ setup_kfail "*-*-*" "vlaregression/9999"
-+ gdb_test "ptype $var (:, :)" " = $int4 \\(4,3\\)"
-+ setup_kfail "*-*-*" "vlaregression/9999"
-+ gdb_test "p $var (:)" "Wrong number of subscripts"
-+ setup_kfail "*-*-*" "vlaregression/9999"
-+ gdb_test "p $var (:, :, :)" "Wrong number of subscripts"
-+
-+ set pf_prefix $old_prefix
-+}
-+
-+gdb_test_no_output {set $a=a}
-+delete_breakpoints
-+gdb_unload
-+setup_kfail "*-*-*" "vlaregression/9999"
-+gdb_test {p $a (3, 2:2)} { = \(23\)}
-Index: gdb-7.12.50.20170207/gdb/testsuite/gdb.fortran/subrange.f90
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ gdb-7.12.50.20170207/gdb/testsuite/gdb.fortran/subrange.f90 2017-02-26 19:15:36.604882366 +0100
-@@ -0,0 +1,28 @@
-+! Copyright 2011 Free Software Foundation, Inc.
-+!
-+! This program is free software; you can redistribute it and/or modify
-+! it under the terms of the GNU General Public License as published by
-+! the Free Software Foundation; either version 3 of the License, or
-+! (at your option) any later version.
-+!
-+! This program is distributed in the hope that it will be useful,
-+! but WITHOUT ANY WARRANTY; without even the implied warranty of
-+! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+! GNU General Public License for more details.
-+!
-+! You should have received a copy of the GNU General Public License
-+! along with this program. If not, see <http://www.gnu.org/licenses/>.
-+
-+program test
-+ integer, target :: a (4, 3)
-+ integer, allocatable :: alloc (:, :)
-+ integer, pointer :: ptr (:, :)
-+ do 1 i = 1, 4
-+ do 1 j = 1, 3
-+ a (i, j) = j * 10 + i
-+1 continue
-+ allocate (alloc (4, 3))
-+ alloc = a
-+ ptr => a
-+ write (*,*) a ! break-static
-+end
-Index: gdb-7.12.50.20170207/gdb/testsuite/gdb.mi/mi2-var-stale-type.c
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ gdb-7.12.50.20170207/gdb/testsuite/gdb.mi/mi2-var-stale-type.c 2017-02-26 19:15:36.604882366 +0100
-@@ -0,0 +1,26 @@
-+/* Copyright 2011 Free Software Foundation, Inc.
-+
-+ This file is part of GDB.
-+
-+ This program is free software; you can redistribute it and/or modify
-+ it under the terms of the GNU General Public License as published by
-+ the Free Software Foundation; either version 3 of the License, or
-+ (at your option) any later version.
-+
-+ This program is distributed in the hope that it will be useful,
-+ but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ GNU General Public License for more details.
-+
-+ You should have received a copy of the GNU General Public License
-+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
-+
-+int
-+main (int argc, char **argv)
-+{
-+ char vla[argc];
-+
-+ vla[0] = 0; /* break-here */
-+
-+ return 0;
-+}
-Index: gdb-7.12.50.20170207/gdb/testsuite/gdb.mi/mi2-var-stale-type.exp
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ gdb-7.12.50.20170207/gdb/testsuite/gdb.mi/mi2-var-stale-type.exp 2017-02-26 19:15:36.604882366 +0100
-@@ -0,0 +1,57 @@
-+# Copyright 2011 Free Software Foundation, Inc.
-+#
-+# This program is free software; you can redistribute it and/or modify
-+# it under the terms of the GNU General Public License as published by
-+# the Free Software Foundation; either version 3 of the License, or
-+# (at your option) any later version.
-+#
-+# This program is distributed in the hope that it will be useful,
-+# but WITHOUT ANY WARRANTY; without even the implied warranty of
-+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+# GNU General Public License for more details.
-+#
-+# You should have received a copy of the GNU General Public License
-+# along with this program. If not, see <http://www.gnu.org/licenses/>.
-+
-+load_lib mi-support.exp
-+set MIFLAGS "-i=mi2"
-+
-+gdb_exit
-+if [mi_gdb_start] {
-+ continue
-+}
-+
-+set testfile "mi2-var-stale-type"
-+set srcfile ${testfile}.c
-+set binfile [standard_output_file ${testfile}]
-+if {[build_executable ${testfile}.exp $testfile $srcfile] == -1} {
-+ return -1
-+}
-+
-+mi_delete_breakpoints
-+mi_gdb_reinitialize_dir $srcdir/$subdir
-+mi_gdb_load ${binfile}
-+
-+mi_gdb_test {-interpreter-exec console "maintenance set internal-error quit yes"} \
-+ {\^done} \
-+ "maintenance set internal-error quit yes"
-+
-+mi_gdb_test {-interpreter-exec console "maintenance set internal-error corefile yes"} \
-+ {\^done} \
-+ "maintenance set internal-error corefile yes"
-+
-+set line [gdb_get_line_number "break-here"]
-+set func "main"
-+
-+mi_gdb_test "-break-insert -t $srcfile:$line" \
-+ "\\^done,bkpt=\{number=\"\[0-9\]+\",type=\"breakpoint\",disp=\"del\",enabled=\"y\",addr=\"$hex\",func=\"$func\(\\\(.*\\\)\)?\",file=\".*\",fullname=\".*\",line=\"$line\",\[^\r\n\]*,original-location=\".*\"\}" \
-+ "breakpoint at $func"
-+
-+if { [mi_run_cmd] < 0 } {
-+ return -1
-+}
-+mi_expect_stop "breakpoint-hit" $func ".*" ".*" "\[0-9\]+" { "" "disp=\"del\"" } "stop after initializing vla"
-+
-+mi_create_varobj "vla" "vla" "create local variable vla"
-+
-+mi_gdb_test "-var-update *" "\\^done,changelist=.*" "-var-update *"
-Index: gdb-7.12.50.20170207/gdb/testsuite/gdb.opt/array-from-register-func.c
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ gdb-7.12.50.20170207/gdb/testsuite/gdb.opt/array-from-register-func.c 2017-02-26 19:15:36.604882366 +0100
-@@ -0,0 +1,22 @@
-+/* This file is part of GDB, the GNU debugger.
-+
-+ Copyright 2009 Free Software Foundation, Inc.
-+
-+ This program is free software; you can redistribute it and/or modify
-+ it under the terms of the GNU General Public License as published by
-+ the Free Software Foundation; either version 3 of the License, or
-+ (at your option) any later version.
-+
-+ This program is distributed in the hope that it will be useful,
-+ but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ GNU General Public License for more details.
-+
-+ You should have received a copy of the GNU General Public License
-+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
-+
-+int
-+func (int *arr)
-+{
-+ return arr[0];
-+}
-Index: gdb-7.12.50.20170207/gdb/testsuite/gdb.opt/array-from-register.c
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ gdb-7.12.50.20170207/gdb/testsuite/gdb.opt/array-from-register.c 2017-02-26 19:15:36.605882373 +0100
-@@ -0,0 +1,28 @@
-+/* This file is part of GDB, the GNU debugger.
-+
-+ Copyright 2009 Free Software Foundation, Inc.
-+
-+ This program is free software; you can redistribute it and/or modify
-+ it under the terms of the GNU General Public License as published by
-+ the Free Software Foundation; either version 3 of the License, or
-+ (at your option) any later version.
-+
-+ This program is distributed in the hope that it will be useful,
-+ but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ GNU General Public License for more details.
-+
-+ You should have received a copy of the GNU General Public License
-+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
-+
-+extern int func (int *arr);
-+
-+int
-+main (void)
-+{
-+ int arr[] = { 42 };
-+
-+ func (arr);
-+
-+ return 0;
-+}
-Index: gdb-7.12.50.20170207/gdb/testsuite/gdb.opt/array-from-register.exp
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ gdb-7.12.50.20170207/gdb/testsuite/gdb.opt/array-from-register.exp 2017-02-26 19:15:36.605882373 +0100
-@@ -0,0 +1,33 @@
-+# Copyright 2009 Free Software Foundation, Inc.
-+#
-+# This program is free software; you can redistribute it and/or modify
-+# it under the terms of the GNU General Public License as published by
-+# the Free Software Foundation; either version 2 of the License, or
-+# (at your option) any later version.
-+#
-+# This program is distributed in the hope that it will be useful,
-+# but WITHOUT ANY WARRANTY; without even the implied warranty of
-+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+# GNU General Public License for more details.
-+#
-+# You should have received a copy of the GNU General Public License
-+# along with this program; if not, write to the Free Software
-+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-+#
-+# This file is part of the gdb testsuite.
-+
-+if { [prepare_for_testing array-from-register.exp "array-from-register" \
-+ {array-from-register.c array-from-register-func.c} \
-+ {debug optimize=-O2}] } {
-+ return -1
-+}
-+
-+if ![runto func] then {
-+ return -1
-+}
-+
-+gdb_test "p arr" "\\$\[0-9\]+ = \\(int \\*\\) *0x\[0-9a-f\]+"
-+
-+# Seen regression:
-+# Address requested for identifier "arr" which is in register $rdi
-+gdb_test "p arr\[0\]" "\\$\[0-9\]+ = 42"
-Index: gdb-7.12.50.20170207/gdb/testsuite/gdb.opt/fortran-string.exp
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ gdb-7.12.50.20170207/gdb/testsuite/gdb.opt/fortran-string.exp 2017-02-26 19:15:36.605882373 +0100
-@@ -0,0 +1,39 @@
-+# Copyright 2009 Free Software Foundation, Inc.
-+
-+# This program is free software; you can redistribute it and/or modify
-+# it under the terms of the GNU General Public License as published by
-+# the Free Software Foundation; either version 2 of the License, or
-+# (at your option) any later version.
-+#
-+# This program is distributed in the hope that it will be useful,
-+# but WITHOUT ANY WARRANTY; without even the implied warranty of
-+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+# GNU General Public License for more details.
-+#
-+# You should have received a copy of the GNU General Public License
-+# along with this program; if not, write to the Free Software
-+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-+
-+# This file was written by Jan Kratochvil <jan.kratochvil(a)redhat.com>.
-+
-+# Test GDB can cope with Fortran strings having their length present in a CPU
-+# register. With -O0 the string length is passed on the stack. To make this
-+# test meaningful the follow assertion should pass. It is not being checked
-+# here as the "_s" symbol is compiler dependent:
-+# (gdb) info address _s
-+# Symbol "_s" is a variable in register XX.
-+
-+set test fortran-string
-+set srcfile ${test}.f90
-+if { [prepare_for_testing ${test}.exp ${test} ${srcfile} {debug f90 additional_flags=-O2}] } {
-+ return -1
-+}
-+
-+if ![runto $srcfile:[gdb_get_line_number "s = s"]] then {
-+ perror "couldn't run to breakpoint MAIN__"
-+ continue
-+}
-+
-+gdb_test "frame" ".*s='foo'.*"
-+gdb_test "ptype s" "type = character\\*3"
-+gdb_test "p s" "\\$\[0-9\]* = 'foo'"
-Index: gdb-7.12.50.20170207/gdb/testsuite/gdb.opt/fortran-string.f90
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ gdb-7.12.50.20170207/gdb/testsuite/gdb.opt/fortran-string.f90 2017-02-26 19:15:36.605882373 +0100
-@@ -0,0 +1,28 @@
-+! Copyright 2009 Free Software Foundation, Inc.
-+!
-+! This program is free software; you can redistribute it and/or modify
-+! it under the terms of the GNU General Public License as published by
-+! the Free Software Foundation; either version 2 of the License, or
-+! (at your option) any later version.
-+!
-+! This program is distributed in the hope that it will be useful,
-+! but WITHOUT ANY WARRANTY; without even the implied warranty of
-+! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+! GNU General Public License for more details.
-+!
-+! You should have received a copy of the GNU General Public License
-+! along with this program; if not, write to the Free Software
-+! Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-+!
-+! Ihis file is the Fortran source file for dynamic.exp.
-+! Original file written by Jakub Jelinek <jakub(a)redhat.com>.
-+! Modified for the GDB testcase by Jan Kratochvil <jan.kratochvil(a)redhat.com>.
-+
-+ subroutine f(s)
-+ character*(*) s
-+ s = s
-+ end
-+
-+ program main
-+ call f ('foo')
-+ end
-Index: gdb-7.12.50.20170207/gdb/testsuite/gdb.pascal/arrays.exp
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ gdb-7.12.50.20170207/gdb/testsuite/gdb.pascal/arrays.exp 2017-02-26 19:15:36.605882373 +0100
-@@ -0,0 +1,104 @@
-+# Copyright 2008, 2009 Free Software Foundation, Inc.
-+#
-+# This program is free software; you can redistribute it and/or modify
-+# it under the terms of the GNU General Public License as published by
-+# the Free Software Foundation; either version 3 of the License, or
-+# (at your option) any later version.
-+#
-+# This program is distributed in the hope that it will be useful,
-+# but WITHOUT ANY WARRANTY; without even the implied warranty of
-+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+# GNU General Public License for more details.
-+#
-+# You should have received a copy of the GNU General Public License
-+# along with this program. If not, see <http://www.gnu.org/licenses/>.
-+
-+if $tracelevel then {
-+ strace $tracelevel
-+}
-+
-+load_lib "pascal.exp"
-+
-+set testfile "arrays"
-+set srcfile ${testfile}.pas
-+set binfile [standard_output_file ${testfile}$EXEEXT]
-+
-+# These tests only work with fpc, using the -gw3 compile-option
-+pascal_init
-+if { $pascal_compiler_is_fpc != 1 } {
-+ return -1
-+}
-+
-+# Detect if the fpc version is below 2.3.0
-+set fpc_generates_dwarf_for_dynamic_arrays 1
-+if { ($fpcversion_major < 2) || ( ($fpcversion_major == 2) && ($fpcversion_minor < 3))} {
-+ set fpc_generates_dwarf_for_dynamic_arrays 0
-+}
-+
-+
-+if {[gdb_compile_pascal "-gw3 ${srcdir}/${subdir}/${srcfile}" "${binfile}" executable [list debug ]] != "" } {
-+ return -1
-+}
-+
-+gdb_exit
-+gdb_start
-+gdb_reinitialize_dir $srcdir/$subdir
-+gdb_load ${binfile}
-+set bp_location1 [gdb_get_line_number "set breakpoint 1 here"]
-+set bp_location2 [gdb_get_line_number "set breakpoint 2 here"]
-+
-+
-+if { [gdb_breakpoint ${srcfile}:${bp_location1}] } {
-+ pass "setting breakpoint 1"
-+}
-+if { [gdb_breakpoint ${srcfile}:${bp_location2}] } {
-+ pass "setting breakpoint 2"
-+}
-+
-+# Verify that "start" lands inside the right procedure.
-+if { [gdb_start_cmd] < 0 } {
-+ untested start
-+ return -1
-+}
-+
-+gdb_test "" ".* at .*${srcfile}.*" "start"
-+
-+gdb_test "cont" "Breakpoint .*:${bp_location1}.*" "Going to first breakpoint"
-+
-+gdb_test "print StatArrInt" ".* = \\{50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61\\}" "Print static array of integer type"
-+gdb_test "print StatArrInt_" ".* = \\{50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61\\}" "Print static array of integer"
-+
-+gdb_test "cont" "Breakpoint .*:${bp_location2}.*" "Going to second breakpoint"
-+
-+gdb_test "print StatArrChar" ".* = 'abcdefghijkl'" "Print static array of char"
-+gdb_test "print Stat2dArrInt" ".* = \\{\\{0, 1, 2, 3, 4\\}, \\{1, 2, 3, 4, 5\\}, \\{2, 3, 4, 5, 6\\}, \\{3, 4, 5, 6, 7\\}, \\{4, 5, 6, 7, 8\\}, \\{5, 6, 7, 8, 9\\}, \\{6, 7, 8, 9, 10\\}, \\{7, 8, 9, 10, 11\\}, \\{8, 9, 10, 11, 12\\}, \\{9, 10, 11, 12, 13\\}, \\{10, 11, 12, 13, 14\\}, \\{11, 12, 13, 14, 15\\}\\}" "Print static 2-dimensional array of integer"
-+
-+if { $fpc_generates_dwarf_for_dynamic_arrays == 0} {
-+ setup_xfail "*-*-*"
-+}
-+gdb_test "print DynArrInt" ".* = \\{50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62\\}" "Print dynamic array of integer type"
-+if { $fpc_generates_dwarf_for_dynamic_arrays == 0} {
-+ setup_xfail "*-*-*"
-+}
-+gdb_test "print DynArrInt_" ".* = \\{50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62\\}" "Print dynamic array of integer"
-+
-+if { $fpc_generates_dwarf_for_dynamic_arrays == 0} {
-+ setup_xfail "*-*-*"
-+}
-+gdb_test "print s" ".* = 'test'#0'string'" "Print string containing null-char"
-+
-+if { $fpc_generates_dwarf_for_dynamic_arrays == 0} {
-+ setup_xfail "*-*-*"
-+}
-+gdb_test "print DynArrStr" ".* = \\{'dstr0', 'dstr1', 'dstr2', 'dstr3', 'dstr4', 'dstr5', 'dstr6', 'dstr7', 'dstr8', 'dstr9', 'dstr10', 'dstr11', 'dstr12'\\}" "Print dynamic array of string"
-+
-+if { $fpc_generates_dwarf_for_dynamic_arrays == 0} {
-+ setup_xfail "*-*-*"
-+}
-+gdb_test "print StatArrStr" ".* = \\{'str0', 'str1', 'str2', 'str3', 'str4', 'str5', 'str6', 'str7', 'str8', 'str9', 'str10', 'str11', 'str12'\\}" "Print static array of string"
-+
-+if { $fpc_generates_dwarf_for_dynamic_arrays == 0} {
-+ setup_xfail "*-*-*"
-+}
-+gdb_test "print DynArrChar" ".* = 'abcdefghijklm'" "Print dynamic array of char"
-+
-Index: gdb-7.12.50.20170207/gdb/testsuite/gdb.pascal/arrays.pas
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ gdb-7.12.50.20170207/gdb/testsuite/gdb.pascal/arrays.pas 2017-02-26 19:15:36.605882373 +0100
-@@ -0,0 +1,82 @@
-+{
-+ Copyright 2008, 2009 Free Software Foundation, Inc.
-+
-+ This program is free software; you can redistribute it and/or modify
-+ it under the terms of the GNU General Public License as published by
-+ the Free Software Foundation; either version 3 of the License, or
-+ (at your option) any later version.
-+
-+ This program is distributed in the hope that it will be useful,
-+ but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ GNU General Public License for more details.
-+
-+ You should have received a copy of the GNU General Public License
-+ along with this program. If not, see <http://www.gnu.org/licenses/>.
-+}
-+
-+program arrays;
-+
-+{$mode objfpc}{$h+}
-+
-+uses sysutils;
-+
-+type TStatArrInt= array[0..11] of integer;
-+ TDynArrInt= array of integer;
-+ TStatArrStr= array[0..12] of string;
-+ TDynArrStr= array of string;
-+ TDynArrChar = array of char;
-+ TStatArrChar = array [0..11] of char;
-+
-+ TStat2dArrInt = array[0..11,0..4] of integer;
-+
-+var StatArrInt: TStatArrInt;
-+ StatArrInt_: Array[0..11] of integer;
-+ DynArrInt: TDynArrInt;
-+ DynArrInt_: Array of integer;
-+ StatArrStr: TStatArrStr;
-+ DynArrStr: TDynArrStr;
-+ StatArrChar: TStatArrChar;
-+ DynArrChar: TDynArrChar;
-+
-+ Stat2dArrInt: TStat2dArrInt;
-+
-+ s: string;
-+
-+ i,j : integer;
-+
-+begin
-+ for i := 0 to 11 do
-+ begin
-+ StatArrInt[i]:= i+50;
-+ StatArrInt_[i]:= i+50;
-+ StatArrChar[i]:= chr(ord('a')+i);
-+ for j := 0 to 4 do
-+ Stat2dArrInt[i,j]:=i+j;
-+ end;
-+ writeln(StatArrInt_[0]);
-+ writeln(StatArrInt[0]); { set breakpoint 1 here }
-+ writeln(StatArrChar[0]);
-+ writeln(Stat2dArrInt[0,0]);
-+
-+ setlength(DynArrInt,13);
-+ setlength(DynArrInt_,13);
-+ setlength(DynArrStr,13);
-+ setlength(DynArrChar,13);
-+ for i := 0 to 12 do
-+ begin
-+ DynArrInt[i]:= i+50;
-+ DynArrInt_[i]:= i+50;
-+ DynArrChar[i]:= chr(ord('a')+i);
-+ StatArrStr[i]:='str'+inttostr(i);
-+ DynArrStr[i]:='dstr'+inttostr(i);
-+ end;
-+ writeln(DynArrInt_[1]);
-+ writeln(DynArrInt[1]);
-+ writeln(DynArrStr[1]);
-+ writeln(StatArrStr[1]);
-+ writeln(DynArrChar[1]);
-+
-+ s := 'test'#0'string';
-+ writeln(s); { set breakpoint 2 here }
-+end.
-Index: gdb-7.12.50.20170207/gdb/testsuite/lib/gdb.exp
-===================================================================
---- gdb-7.12.50.20170207.orig/gdb/testsuite/lib/gdb.exp 2017-02-26 19:15:28.564824836 +0100
-+++ gdb-7.12.50.20170207/gdb/testsuite/lib/gdb.exp 2017-02-26 19:15:36.607882387 +0100
-@@ -178,6 +178,11 @@
- send_gdb "y\n"
- exp_continue
- }
-+ -re "A program is being debugged already..*Are you sure you want to change the file.*y or n. $"\
-+ { send_gdb "y\n"
-+ verbose "\t\tUnloading symbols for program being debugged"
-+ exp_continue
-+ }
- -re "Discard symbol table from .*y or n.*$" {
- send_gdb "y\n"
- exp_continue
-Index: gdb-7.12.50.20170207/gdb/testsuite/lib/pascal.exp
-===================================================================
---- gdb-7.12.50.20170207.orig/gdb/testsuite/lib/pascal.exp 2017-02-26 19:15:28.565824844 +0100
-+++ gdb-7.12.50.20170207/gdb/testsuite/lib/pascal.exp 2017-02-26 19:15:36.607882387 +0100
-@@ -37,6 +37,9 @@
- global pascal_compiler_is_fpc
- global gpc_compiler
- global fpc_compiler
-+ global fpcversion_major
-+ global fpcversion_minor
-+ global fpcversion_release
- global env
-
- if { $pascal_init_done == 1 } {
-@@ -64,6 +67,20 @@
- set pascal_compiler_is_fpc 1
- verbose -log "Free Pascal compiler found"
- }
-+
-+ # Detect the fpc-version
-+ if { $pascal_compiler_is_fpc == 1 } {
-+ set fpcversion_major 1
-+ set fpcversion_minor 0
-+ set fpcversion_release 0
-+ set fpcversion [ remote_exec host $fpc_compiler "-iV" ]
-+ if [regexp {.*([0-9]+)\.([0-9]+)\.([0-9]+).?} $fpcversion] {
-+ regsub {.*([0-9]+)\.([0-9]+)\.([0-9]+).?\n?.?} $fpcversion {\1} fpcversion_major
-+ regsub {.*([0-9]+)\.([0-9]+)\.([0-9]+).?\n?.?} $fpcversion {\2} fpcversion_minor
-+ regsub {.*([0-9]+)\.([0-9]+)\.([0-9]+).?\n?.?} $fpcversion {\3} fpcversion_release
-+ }
-+ verbose -log "Freepascal version: $fpcversion_major.$fpcversion_minor.$fpcversion_release"
-+ }
- }
- set pascal_init_done 1
- }
diff --git a/gdb-archer.patch b/gdb-archer.patch
new file mode 100644
index 0000000..9128744
--- /dev/null
+++ b/gdb-archer.patch
@@ -0,0 +1,729 @@
+From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
+From: Fedora GDB patches <invalid(a)email.com>
+Date: Fri, 27 Oct 2017 21:07:50 +0200
+Subject: gdb-archer.patch
+
+FileName: gdb-archer.patch
+
+;; Python patches of: http://sourceware.org/gdb/wiki/ProjectArcher
+;;=push
+
+http://sourceware.org/gdb/wiki/ProjectArcher
+http://sourceware.org/gdb/wiki/ArcherBranchManagement
+
+GIT snapshot:
+commit 718a1618b2f691a7f407213bb50f100ac59f91c3
+
+tromey/python
+---
+ gdb/Makefile.in | 6 ++
+ gdb/data-directory/Makefile.in | 4 +
+ gdb/doc/gdb.texinfo | 10 +++
+ gdb/doc/python.texi | 2 -
+ gdb/gdb-gdb.gdb.in | 10 +++
+ gdb/main.c | 93 ++++++++++++++++++-----
+ gdb/python/lib/gdb/command/ignore_errors.py | 37 +++++++++
+ gdb/python/lib/gdb/command/pahole.py | 81 ++++++++++++++++++++
+ gdb/python/lib/gdb/function/in_scope.py | 47 ++++++++++++
+ gdb/python/python-internal.h | 3 +
+ gdb/python/python.c | 113 ++++++++++++++++++++++++++++
+ gdb/python/python.h | 2 +
+ gdb/testsuite/gdb.python/py-frame.exp | 2 +
+ gdb/testsuite/gdb.python/py-value.exp | 10 +++
+ gdb/varobj.c | 8 ++
+ gdb/varobj.h | 2 +
+ 16 files changed, 411 insertions(+), 19 deletions(-)
+ create mode 100644 gdb/python/lib/gdb/command/ignore_errors.py
+ create mode 100644 gdb/python/lib/gdb/command/pahole.py
+ create mode 100644 gdb/python/lib/gdb/function/in_scope.py
+
+diff --git a/gdb/Makefile.in b/gdb/Makefile.in
+index 3142ad6af1..28d8664236 100644
+--- a/gdb/Makefile.in
++++ b/gdb/Makefile.in
+@@ -2110,6 +2110,12 @@ stamp-h: $(srcdir)/config.in config.status
+ CONFIG_LINKS= \
+ $(SHELL) config.status
+
++.gdbinit: $(srcdir)/gdbinit.in config.status
++ CONFIG_FILES=".gdbinit:gdbinit.in" \
++ CONFIG_COMMANDS= \
++ CONFIG_HEADERS= \
++ $(SHELL) config.status
++
+ config.status: $(srcdir)/configure configure.tgt configure.host ../bfd/development.sh
+ $(SHELL) config.status --recheck
+
+diff --git a/gdb/data-directory/Makefile.in b/gdb/data-directory/Makefile.in
+index 5c7c0b4c2e..2014607e9e 100644
+--- a/gdb/data-directory/Makefile.in
++++ b/gdb/data-directory/Makefile.in
+@@ -80,6 +80,8 @@ PYTHON_FILE_LIST = \
+ gdb/unwinder.py \
+ gdb/xmethod.py \
+ gdb/command/__init__.py \
++ gdb/command/ignore_errors.py \
++ gdb/command/pahole.py \
+ gdb/command/explore.py \
+ gdb/command/backtrace.py \
+ gdb/command/frame_filters.py \
+@@ -92,6 +94,8 @@ PYTHON_FILE_LIST = \
+ gdb/function/as_string.py \
+ gdb/function/caller_is.py \
+ gdb/function/strfns.py \
++ gdb/function/caller_is.py \
++ gdb/function/in_scope.py \
+ gdb/printer/__init__.py \
+ gdb/printer/bound_registers.py
+
+diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo
+index 7b99ae1551..dea17fd5a7 100644
+--- a/gdb/doc/gdb.texinfo
++++ b/gdb/doc/gdb.texinfo
+@@ -1245,6 +1245,16 @@ for remote debugging.
+ Run using @var{device} for your program's standard input and output.
+ @c FIXME: kingdon thinks there is more to -tty. Investigate.
+
++@item -P
++@cindex @code{-P}
++@itemx --python
++@cindex @code{--python}
++Change interpretation of command line so that the argument immediately
++following this switch is taken to be the name of a Python script file.
++This option stops option processing; subsequent options are passed to
++Python as @code{sys.argv}. This option is only available if Python
++scripting support was enabled when @value{GDBN} was configured.
++
+ @c resolve the situation of these eventually
+ @item -tui
+ @cindex @code{--tui}
+diff --git a/gdb/doc/python.texi b/gdb/doc/python.texi
+index ccf011e35e..461e900f77 100644
+--- a/gdb/doc/python.texi
++++ b/gdb/doc/python.texi
+@@ -88,8 +88,6 @@ containing @code{end}. For example:
+
+ @smallexample
+ (@value{GDBP}) python
+-Type python script
+-End with a line saying just "end".
+ >print 23
+ >end
+ 23
+diff --git a/gdb/gdb-gdb.gdb.in b/gdb/gdb-gdb.gdb.in
+index 05a38b2670..9801fdff67 100644
+--- a/gdb/gdb-gdb.gdb.in
++++ b/gdb/gdb-gdb.gdb.in
+@@ -1,5 +1,15 @@
+ echo Setting up the environment for debugging gdb.\n
+
++# Set up the Python library and "require" command.
++python
++from os.path import abspath
++gdb.datadir = abspath ('@srcdir@/python/lib')
++gdb.pythonlibdir = gdb.datadir
++gdb.__path__ = [gdb.datadir + '/gdb']
++sys.path.insert(0, gdb.datadir)
++end
++source @srcdir(a)/python/lib/gdb/__init__.py
++
+ if !$gdb_init_done
+ set variable $gdb_init_done = 1
+
+diff --git a/gdb/main.c b/gdb/main.c
+index b079e79c93..b150af4e70 100644
+--- a/gdb/main.c
++++ b/gdb/main.c
+@@ -33,6 +33,7 @@
+
+ #include "interps.h"
+ #include "main.h"
++#include "python/python.h"
+ #include "source.h"
+ #include "cli/cli-cmds.h"
+ #include "objfiles.h"
+@@ -478,7 +479,7 @@ exec_or_core_file_attach (const char *filename, int from_tty)
+ }
+
+ static void
+-captured_main_1 (struct captured_main_args *context)
++captured_main_1 (struct captured_main_args *context, int &python_script)
+ {
+ int argc = context->argc;
+ char **argv = context->argv;
+@@ -694,10 +695,14 @@ captured_main_1 (struct captured_main_args *context)
+ {"args", no_argument, &set_args, 1},
+ {"l", required_argument, 0, 'l'},
+ {"return-child-result", no_argument, &return_child_result, 1},
++#if HAVE_PYTHON
++ {"python", no_argument, 0, 'P'},
++ {"P", no_argument, 0, 'P'},
++#endif
+ {0, no_argument, 0, 0}
+ };
+
+- while (1)
++ while (!python_script)
+ {
+ int option_index;
+
+@@ -715,6 +720,9 @@ captured_main_1 (struct captured_main_args *context)
+ case 0:
+ /* Long option that just sets a flag. */
+ break;
++ case 'P':
++ python_script = 1;
++ break;
+ case OPT_SE:
+ symarg = optarg;
+ execarg = optarg;
+@@ -889,7 +897,31 @@ captured_main_1 (struct captured_main_args *context)
+
+ /* Now that gdb_init has created the initial inferior, we're in
+ position to set args for that inferior. */
+- if (set_args)
++ if (python_script)
++ {
++ /* The first argument is a python script to evaluate, and
++ subsequent arguments are passed to the script for
++ processing there. */
++ if (optind >= argc)
++ {
++ fprintf_unfiltered (gdb_stderr,
++ _("%s: Python script file name required\n"),
++ argv[0]);
++ exit (1);
++ }
++
++ /* FIXME: should handle inferior I/O intelligently here.
++ E.g., should be possible to run gdb in pipeline and have
++ Python (and gdb) output go to stderr or file; and if a
++ prompt is needed, open the tty. */
++ quiet = 1;
++ /* FIXME: should read .gdbinit if, and only if, a prompt is
++ requested by the script. Though... maybe this is not
++ ideal? */
++ /* FIXME: likewise, reading in history. */
++ inhibit_gdbinit = 1;
++ }
++ else if (set_args)
+ {
+ /* The remaining options are the command-line options for the
+ inferior. The first one is the sym/exec file, and the rest
+@@ -1179,7 +1211,8 @@ captured_main_1 (struct captured_main_args *context)
+
+ /* Read in the old history after all the command files have been
+ read. */
+- init_history ();
++ if (!python_script)
++ init_history ();
+
+ if (batch_flag)
+ {
+@@ -1192,24 +1225,37 @@ static void
+ captured_main (void *data)
+ {
+ struct captured_main_args *context = (struct captured_main_args *) data;
++ int python_script = 0;
+
+- captured_main_1 (context);
++ captured_main_1 (context, python_script);
+
+- /* NOTE: cagney/1999-11-07: There is probably no reason for not
+- moving this loop and the code found in captured_command_loop()
+- into the command_loop() proper. The main thing holding back that
+- change - SET_TOP_LEVEL() - has been eliminated. */
+- while (1)
++#if HAVE_PYTHON
++ if (python_script)
+ {
+- TRY
+- {
+- captured_command_loop ();
+- }
+- CATCH (ex, RETURN_MASK_ALL)
++ extern int pagination_enabled;
++ pagination_enabled = 0;
++ run_python_script (context->argc - optind, &context->argv[optind]);
++ return;
++ }
++ else
++#endif
++ {
++ /* NOTE: cagney/1999-11-07: There is probably no reason for not
++ moving this loop and the code found in captured_command_loop()
++ into the command_loop() proper. The main thing holding back that
++ change - SET_TOP_LEVEL() - has been eliminated. */
++ while (1)
+ {
+- exception_print (gdb_stderr, ex);
++ TRY
++ {
++ captured_command_loop ();
++ }
++ CATCH (ex, RETURN_MASK_ALL)
++ {
++ exception_print (gdb_stderr, ex);
++ }
++ END_CATCH
+ }
+- END_CATCH
+ }
+ /* No exit -- exit is through quit_command. */
+ }
+@@ -1252,6 +1298,12 @@ print_gdb_help (struct ui_file *stream)
+ fputs_unfiltered (_("\
+ This is the GNU debugger. Usage:\n\n\
+ gdb [options] [executable-file [core-file or process-id]]\n\
++ gdb [options] --args executable-file [inferior-arguments ...]\n"), stream);
++#if HAVE_PYTHON
++ fputs_unfiltered (_("\
++ gdb [options] [--python|-P] script-file [script-arguments ...]\n"), stream);
++#endif
++ fputs_unfiltered (_("\n\
+ gdb [options] --args executable-file [inferior-arguments ...]\n\n\
+ "), stream);
+ fputs_unfiltered (_("\
+@@ -1297,6 +1349,13 @@ Output and user interface control:\n\n\
+ #endif
+ fputs_unfiltered (_("\
+ --dbx DBX compatibility mode.\n\
++"), stream);
++#if HAVE_PYTHON
++ fputs_unfiltered (_("\
++ --python, -P Following argument is Python script file; remaining\n\
++ arguments are passed to script.\n"), stream);
++#endif
++ fputs_unfiltered (_("\
+ -q, --quiet, --silent\n\
+ Do not print version number on startup.\n\n\
+ "), stream);
+diff --git a/gdb/python/lib/gdb/command/ignore_errors.py b/gdb/python/lib/gdb/command/ignore_errors.py
+new file mode 100644
+index 0000000000..6fa48ff081
+--- /dev/null
++++ b/gdb/python/lib/gdb/command/ignore_errors.py
+@@ -0,0 +1,37 @@
++# Ignore errors in user commands.
++
++# Copyright (C) 2008 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/>.
++
++import gdb
++
++class IgnoreErrorsCommand (gdb.Command):
++ """Execute a single command, ignoring all errors.
++Only one-line commands are supported.
++This is primarily useful in scripts."""
++
++ def __init__ (self):
++ super (IgnoreErrorsCommand, self).__init__ ("ignore-errors",
++ gdb.COMMAND_OBSCURE,
++ # FIXME...
++ gdb.COMPLETE_COMMAND)
++
++ def invoke (self, arg, from_tty):
++ try:
++ gdb.execute (arg, from_tty)
++ except:
++ pass
++
++IgnoreErrorsCommand ()
+diff --git a/gdb/python/lib/gdb/command/pahole.py b/gdb/python/lib/gdb/command/pahole.py
+new file mode 100644
+index 0000000000..e08eaf5ca8
+--- /dev/null
++++ b/gdb/python/lib/gdb/command/pahole.py
+@@ -0,0 +1,81 @@
++# pahole command for gdb
++
++# Copyright (C) 2008, 2009, 2012 Free Software Foundation, Inc.
++
++# This program is free software; you can redistribute it and/or modify
++# it under the terms of the GNU General Public License as published by
++# the Free Software Foundation; either version 3 of the License, or
++# (at your option) any later version.
++#
++# This program is distributed in the hope that it will be useful,
++# but WITHOUT ANY WARRANTY; without even the implied warranty of
++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++# GNU General Public License for more details.
++#
++# You should have received a copy of the GNU General Public License
++# along with this program. If not, see <http://www.gnu.org/licenses/>.
++
++import gdb
++
++class Pahole (gdb.Command):
++ """Show the holes in a structure.
++This command takes a single argument, a type name.
++It prints the type and displays comments showing where holes are."""
++
++ def __init__ (self):
++ super (Pahole, self).__init__ ("pahole", gdb.COMMAND_NONE,
++ gdb.COMPLETE_SYMBOL)
++
++ def maybe_print_hole(self, bitpos, field_bitpos):
++ if bitpos != field_bitpos:
++ hole = field_bitpos - bitpos
++ print (' /* XXX %d bit hole, try to pack */' % hole)
++
++ def pahole (self, type, level, name):
++ if name is None:
++ name = ''
++ tag = type.tag
++ if tag is None:
++ tag = ''
++ print ('%sstruct %s {' % (' ' * (2 * level), tag))
++ bitpos = 0
++ for field in type.fields ():
++ # Skip static fields.
++ if not hasattr (field, ('bitpos')):
++ continue
++
++ ftype = field.type.strip_typedefs()
++
++ self.maybe_print_hole(bitpos, field.bitpos)
++ bitpos = field.bitpos
++ if field.bitsize > 0:
++ fieldsize = field.bitsize
++ else:
++ # TARGET_CHAR_BIT here...
++ fieldsize = 8 * ftype.sizeof
++
++ # TARGET_CHAR_BIT
++ print (' /* %3d %3d */' % (int (bitpos / 8), int (fieldsize / 8)), end = "")
++ bitpos = bitpos + fieldsize
++
++ if ftype.code == gdb.TYPE_CODE_STRUCT:
++ self.pahole (ftype, level + 1, field.name)
++ else:
++ print (' ' * (2 + 2 * level), end = "")
++ print ('%s %s' % (str (ftype), field.name))
++
++ if level == 0:
++ self.maybe_print_hole(bitpos, 8 * type.sizeof)
++
++ print (' ' * (14 + 2 * level), end = "")
++ print ('} %s' % name)
++
++ def invoke (self, arg, from_tty):
++ type = gdb.lookup_type (arg)
++ type = type.strip_typedefs ()
++ if type.code != gdb.TYPE_CODE_STRUCT:
++ raise (TypeError, '%s is not a struct type' % arg)
++ print (' ' * 14, end = "")
++ self.pahole (type, 0, '')
++
++Pahole()
+diff --git a/gdb/python/lib/gdb/function/in_scope.py b/gdb/python/lib/gdb/function/in_scope.py
+new file mode 100644
+index 0000000000..8742680614
+--- /dev/null
++++ b/gdb/python/lib/gdb/function/in_scope.py
+@@ -0,0 +1,47 @@
++# In-scope function.
++
++# Copyright (C) 2008 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/>.
++
++import gdb
++
++class InScope (gdb.Function):
++ """Return True if all the given variables or macros are in scope.
++Takes one argument for each variable name to be checked."""
++
++ def __init__ (self):
++ super (InScope, self).__init__ ("in_scope")
++
++ def invoke (self, *vars):
++ if len (vars) == 0:
++ raise (TypeError, "in_scope takes at least one argument")
++
++ # gdb.Value isn't hashable so it can't be put in a map.
++ # Convert to string first.
++ wanted = set (map (lambda x: x.string (), vars))
++ found = set ()
++ block = gdb.selected_frame ().block ()
++ while block:
++ for sym in block:
++ if (sym.is_argument or sym.is_constant
++ or sym.is_function or sym.is_variable):
++ if sym.name in wanted:
++ found.add (sym.name)
++
++ block = block.superblock
++
++ return wanted == found
++
++InScope ()
+diff --git a/gdb/python/python-internal.h b/gdb/python/python-internal.h
+index 4556323472..826122b9b9 100644
+--- a/gdb/python/python-internal.h
++++ b/gdb/python/python-internal.h
+@@ -651,6 +651,9 @@ class gdbpy_enter_varobj : public gdbpy_enter
+
+ };
+
++struct cleanup *ensure_python_env (struct gdbarch *gdbarch,
++ const struct language_defn *language);
++
+ extern struct gdbarch *python_gdbarch;
+ extern const struct language_defn *python_language;
+
+diff --git a/gdb/python/python.c b/gdb/python/python.c
+index 610dda828c..de5ffbd70b 100644
+--- a/gdb/python/python.c
++++ b/gdb/python/python.c
+@@ -95,6 +95,8 @@ const struct extension_language_defn extension_language_python =
+ #include "linespec.h"
+ #include "source.h"
+ #include "version.h"
++#include "inferior.h"
++#include "gdbthread.h"
+ #include "target.h"
+ #include "gdbthread.h"
+ #include "interps.h"
+@@ -242,6 +244,29 @@ gdbpy_enter::~gdbpy_enter ()
+ restore_active_ext_lang (m_previous_active);
+ }
+
++static void
++restore_python_env (void *p)
++{
++ gdbpy_enter *env = (gdbpy_enter *) p;
++
++ delete env;
++}
++
++/* Called before entering the Python interpreter to install the
++ current language and architecture to be used for Python values.
++ Also set the active extension language for GDB so that SIGINT's
++ are directed our way, and if necessary install the right SIGINT
++ handler. */
++
++struct cleanup *
++ensure_python_env (struct gdbarch *gdbarch,
++ const struct language_defn *language)
++{
++ gdbpy_enter *env = new gdbpy_enter (gdbarch, language);
++
++ return make_cleanup (restore_python_env, env);
++}
++
+ /* Set the quit flag. */
+
+ static void
+@@ -1356,6 +1381,92 @@ gdbpy_print_stack (void)
+
+ /* Return the current Progspace.
+ There always is one. */
++/* True if 'gdb -P' was used, false otherwise. */
++static int running_python_script;
++
++/* True if we are currently in a call to 'gdb.cli', false otherwise. */
++static int in_cli;
++
++/* Enter the command loop. */
++
++static PyObject *
++gdbpy_cli (PyObject *unused1, PyObject *unused2)
++{
++ if (! running_python_script || in_cli)
++ return PyErr_Format (PyExc_RuntimeError, "cannot invoke CLI recursively");
++
++ if (current_uiout->is_mi_like_p ())
++ return PyErr_Format (PyExc_RuntimeError, _("Cannot invoke CLI from MI."));
++
++ in_cli = 1;
++ /* See captured_command_loop. */
++
++ /* Give the interpreter a chance to print a prompt. */
++ interp_pre_command_loop (top_level_interpreter ());
++
++ /* Now it's time to start the event loop. */
++ start_event_loop ();
++
++ in_cli = 0;
++
++ Py_RETURN_NONE;
++}
++
++/* Set up the Python argument vector and evaluate a script. This is
++ used to implement 'gdb -P'. */
++
++void
++run_python_script (int argc, char **argv)
++{
++ FILE *input;
++
++ /* We never free this, since we plan to exit at the end. */
++ ensure_python_env (get_current_arch (), current_language);
++
++ running_python_script = 1;
++
++#if PYTHON_ABI_VERSION < 3
++ PySys_SetArgv (argc - 1, argv + 1);
++#else
++ {
++ wchar_t **wargv = (wchar_t **) alloca (sizeof (*wargv) * (argc + 1));
++ int i;
++
++ for (i = 1; i < argc; i++)
++ {
++ size_t len = mbstowcs (NULL, argv[i], 0);
++ /* Python-related GDB sources are built with -DNDEBUG
++ https://sourceware.org/bugzilla/show_bug.cgi?id=20445 */
++ size_t len2 ATTRIBUTE_UNUSED;
++
++ if (len == (size_t) -1)
++ {
++ fprintf (stderr, "Invalid multibyte argument #%d \"%s\"\n",
++ i, argv[i]);
++ exit (1);
++ }
++ wargv[i] = (wchar_t *) alloca (sizeof (**wargv) * (len + 1));
++ len2 = mbstowcs (wargv[i], argv[i], len + 1);
++ assert (len2 == len);
++ }
++ wargv[argc] = NULL;
++ PySys_SetArgv (argc - 1, wargv + 1);
++ }
++#endif
++
++ input = fopen (argv[0], "r");
++ if (! input)
++ {
++ fprintf (stderr, "could not open %s: %s\n", argv[0], strerror (errno));
++ exit (1);
++ }
++ PyRun_SimpleFile (input, argv[0]);
++ fclose (input);
++ exit (0);
++}
++
++
++
+
+ static PyObject *
+ gdbpy_get_current_progspace (PyObject *unused1, PyObject *unused2)
+@@ -2034,6 +2145,8 @@ PyMethodDef python_GdbMethods[] =
+ Evaluate command, a string, as a gdb CLI command. Optionally returns\n\
+ a Python String containing the output of the command if to_string is\n\
+ set to True." },
++ { "cli", gdbpy_cli, METH_NOARGS,
++ "Enter the gdb CLI" },
+ { "parameter", gdbpy_parameter, METH_VARARGS,
+ "Return a gdb parameter's value" },
+
+diff --git a/gdb/python/python.h b/gdb/python/python.h
+index de58fd81df..237a84a0b2 100644
+--- a/gdb/python/python.h
++++ b/gdb/python/python.h
+@@ -25,4 +25,6 @@
+ /* This is all that python exports to gdb. */
+ extern const struct extension_language_defn extension_language_python;
+
++extern void run_python_script (int argc, char **argv);
++
+ #endif /* GDB_PYTHON_H */
+diff --git a/gdb/testsuite/gdb.python/py-frame.exp b/gdb/testsuite/gdb.python/py-frame.exp
+index f186fa9578..0327284226 100644
+--- a/gdb/testsuite/gdb.python/py-frame.exp
++++ b/gdb/testsuite/gdb.python/py-frame.exp
+@@ -95,6 +95,8 @@ gdb_test "python print ('result = %s' % f0.read_var ('a'))" " = 1" "test Frame.r
+
+ gdb_test "python print ('result = %s' % (gdb.selected_frame () == f1))" " = True" "test gdb.selected_frame"
+
++gdb_test "python print ('result = %s' % (f0.block ()))" "<gdb.Block object at 0x\[\[:xdigit:\]\]+>" "test Frame.block"
++
+ # Can read SP register.
+ gdb_test "python print ('result = %s' % (gdb.selected_frame ().read_register ('sp') == gdb.parse_and_eval ('\$sp')))" \
+ " = True" \
+diff --git a/gdb/testsuite/gdb.python/py-value.exp b/gdb/testsuite/gdb.python/py-value.exp
+index eb82a7776f..3069a5c6d7 100644
+--- a/gdb/testsuite/gdb.python/py-value.exp
++++ b/gdb/testsuite/gdb.python/py-value.exp
+@@ -384,6 +384,15 @@ proc test_value_after_death {} {
+ "print value's type"
+ }
+
++# Regression test for a cast failure. The bug was that if we cast a
++# value to its own type, gdb could crash. This happened because we
++# could end up double-freeing a struct value.
++proc test_cast_regression {} {
++ gdb_test "python v = gdb.Value(5)" "" "create value for cast test"
++ gdb_test "python v = v.cast(v.type)" "" "cast value for cast test"
++ gdb_test "python print(v)" "5" "print value for cast test"
++}
++
+ # Regression test for invalid subscript operations. The bug was that
+ # the type of the value was not being checked before allowing a
+ # subscript operation to proceed.
+@@ -512,6 +521,7 @@ if ![runto_main] then {
+ test_value_in_inferior
+ test_inferior_function_call
+ test_value_after_death
++test_cast_regression
+
+ # Test either C or C++ values.
+
+diff --git a/gdb/varobj.c b/gdb/varobj.c
+index 01dabef37c..c198731d0b 100644
+--- a/gdb/varobj.c
++++ b/gdb/varobj.c
+@@ -217,6 +217,14 @@ is_root_p (const struct varobj *var)
+ }
+
+ #ifdef HAVE_PYTHON
++/* Helper function to install a Python environment suitable for
++ use during operations on VAR. */
++struct cleanup *
++varobj_ensure_python_env (const struct varobj *var)
++{
++ return ensure_python_env (var->root->exp->gdbarch,
++ var->root->exp->language_defn);
++}
+
+ /* See python-internal.h. */
+ gdbpy_enter_varobj::gdbpy_enter_varobj (const struct varobj *var)
+diff --git a/gdb/varobj.h b/gdb/varobj.h
+index 6e80d1b89e..677547996f 100644
+--- a/gdb/varobj.h
++++ b/gdb/varobj.h
+@@ -327,6 +327,8 @@ extern bool varobj_has_more (const struct varobj *var, int to);
+
+ extern bool varobj_is_dynamic_p (const struct varobj *var);
+
++extern struct cleanup *varobj_ensure_python_env (const struct varobj *var);
++
+ extern bool varobj_default_value_is_changeable_p (const struct varobj *var);
+ extern bool varobj_value_is_changeable_p (const struct varobj *var);
+
+--
+2.14.3
+
diff --git a/gdb-attach-fail-reasons-5of5.patch b/gdb-attach-fail-reasons-5of5.patch
deleted file mode 100644
index d9c55a9..0000000
--- a/gdb-attach-fail-reasons-5of5.patch
+++ /dev/null
@@ -1,399 +0,0 @@
-http://sourceware.org/ml/gdb-patches/2012-03/msg00171.html
-Subject: [patch 3/3] attach-fail-reasons: SELinux deny_ptrace
-
-Hi,
-
-and here is the last bit for new SELinux 'deny_ptrace':
- https://bugzilla.redhat.com/show_bug.cgi?id=786878
-
-As even PTRACE_TRACEME fails in such case it needs to install hook for even
-that event.
-
-
-Thanks,
-Jan
-
-
-gdb/
-2012-03-06 Jan Kratochvil <jan.kratochvil(a)redhat.com>
-
- * common/linux-ptrace.c [HAVE_SELINUX_SELINUX_H]: include
- selinux/selinux.h.
- (linux_ptrace_attach_warnings): Call linux_ptrace_create_warnings.
- (linux_ptrace_create_warnings): New.
- * common/linux-ptrace.h (linux_ptrace_create_warnings): New declaration.
- * config.in: Regenerate.
- * configure: Regenerate.
- * configure.ac: Check selinux/selinux.h and the selinux library.
- * inf-ptrace.c (inf_ptrace_me): Check the ptrace result.
- * linux-nat.c (linux_nat_create_inferior): New variable ex. Wrap
- to_create_inferior into TRY_CATCH, call linux_ptrace_create_warnings.
-
-gdb/gdbserver/
- * config.in: Regenerate.
- * configure: Regenerate.
- * configure.ac: Check selinux/selinux.h and the selinux library.
- * linux-low.c (linux_traceme): New function.
- (linux_create_inferior, linux_tracefork_child): Call it instead of
- direct ptrace.
-
-Index: gdb-7.12.50.20170226/gdb/nat/linux-ptrace.c
-===================================================================
---- gdb-7.12.50.20170226.orig/gdb/nat/linux-ptrace.c 2017-02-26 21:27:14.780009449 +0100
-+++ gdb-7.12.50.20170226/gdb/nat/linux-ptrace.c 2017-02-26 21:27:18.838038193 +0100
-@@ -27,6 +27,10 @@
- #include <sys/procfs.h>
- #endif
-
-+#ifdef HAVE_SELINUX_SELINUX_H
-+# include <selinux/selinux.h>
-+#endif /* HAVE_SELINUX_SELINUX_H */
-+
- /* Stores the ptrace options supported by the running kernel.
- A value of -1 means we did not check for features yet. A value
- of 0 means there are no supported features. */
-@@ -51,6 +55,8 @@
- buffer_xml_printf (buffer, _("process %d is a zombie "
- "- the process has already terminated"),
- (int) pid);
-+
-+ linux_ptrace_create_warnings (buffer);
- }
-
- /* See linux-ptrace.h. */
-@@ -594,6 +600,22 @@
- linux_ptrace_test_ret_to_nx ();
- }
-
-+/* Print all possible reasons we could fail to create a traced process. */
-+
-+void
-+linux_ptrace_create_warnings (struct buffer *buffer)
-+{
-+#ifdef HAVE_LIBSELINUX
-+ /* -1 is returned for errors, 0 if it has no effect, 1 if PTRACE_ATTACH is
-+ forbidden. */
-+ if (security_get_boolean_active ("deny_ptrace") == 1)
-+ buffer_xml_printf (buffer,
-+ _("the SELinux boolean 'deny_ptrace' is enabled, "
-+ "you can disable this process attach protection by: "
-+ "(gdb) shell sudo setsebool deny_ptrace=0"));
-+#endif /* HAVE_LIBSELINUX */
-+}
-+
- /* Extract extended ptrace event from wait status. */
-
- int
-Index: gdb-7.12.50.20170226/gdb/nat/linux-ptrace.h
-===================================================================
---- gdb-7.12.50.20170226.orig/gdb/nat/linux-ptrace.h 2017-02-26 21:27:14.780009449 +0100
-+++ gdb-7.12.50.20170226/gdb/nat/linux-ptrace.h 2017-02-26 21:27:18.838038193 +0100
-@@ -185,6 +185,7 @@
- extern char *linux_ptrace_attach_fail_reason_string (ptid_t ptid, int err);
-
- extern void linux_ptrace_init_warnings (void);
-+extern void linux_ptrace_create_warnings (struct buffer *buffer);
- extern void linux_check_ptrace_features (void);
- extern void linux_enable_event_reporting (pid_t pid, int attached);
- extern void linux_disable_event_reporting (pid_t pid);
-Index: gdb-7.12.50.20170226/gdb/configure.ac
-===================================================================
---- gdb-7.12.50.20170226.orig/gdb/configure.ac 2017-02-26 21:27:14.781009456 +0100
-+++ gdb-7.12.50.20170226/gdb/configure.ac 2017-02-26 21:27:18.839038200 +0100
-@@ -2092,6 +2092,10 @@
- esac
- AC_DEFINE_UNQUOTED(GDBINIT,"$gdbinit",[The .gdbinit filename.])
-
-+dnl Check security_get_boolean_active availability.
-+AC_CHECK_HEADERS(selinux/selinux.h)
-+AC_CHECK_LIB(selinux, security_get_boolean_active)
-+
- dnl Handle optional features that can be enabled.
-
- # Support for --with-sysroot is a copy of GDB_AC_WITH_DIR,
-Index: gdb-7.12.50.20170226/gdb/gdbserver/configure.ac
-===================================================================
---- gdb-7.12.50.20170226.orig/gdb/gdbserver/configure.ac 2017-02-26 21:27:14.781009456 +0100
-+++ gdb-7.12.50.20170226/gdb/gdbserver/configure.ac 2017-02-26 21:27:18.839038200 +0100
-@@ -469,6 +469,10 @@
- fi
- fi
-
-+dnl Check security_get_boolean_active availability.
-+AC_CHECK_HEADERS(selinux/selinux.h)
-+AC_CHECK_LIB(selinux, security_get_boolean_active)
-+
- AC_SUBST(GDBSERVER_DEPFILES)
- AC_SUBST(GDBSERVER_LIBS)
- AC_SUBST(srv_xmlbuiltin)
-Index: gdb-7.12.50.20170226/gdb/gdbserver/linux-low.c
-===================================================================
---- gdb-7.12.50.20170226.orig/gdb/gdbserver/linux-low.c 2017-02-26 21:27:14.783009470 +0100
-+++ gdb-7.12.50.20170226/gdb/gdbserver/linux-low.c 2017-02-26 21:27:18.841038214 +0100
-@@ -946,6 +946,29 @@
- return lwp;
- }
-
-+/* Execute PTRACE_TRACEME with error checking. */
-+
-+static void
-+linux_traceme (const char *program)
-+{
-+ int save_errno;
-+ struct buffer buffer;
-+
-+ errno = 0;
-+ if (ptrace (PTRACE_TRACEME, 0,
-+ (PTRACE_TYPE_ARG3) 0, (PTRACE_TYPE_ARG4) 0) == 0)
-+ return;
-+
-+ save_errno = errno;
-+ buffer_init (&buffer);
-+ linux_ptrace_create_warnings (&buffer);
-+ buffer_grow_str0 (&buffer, "");
-+ fprintf (stderr, _("%sCannot trace created process %s: %s.\n"),
-+ buffer_finish (&buffer), program, strerror (save_errno));
-+ fflush (stderr);
-+ _exit (0177);
-+}
-+
- /* Start an inferior process and returns its pid.
- ALLARGS is a vector of program-name and args. */
-
-@@ -969,7 +992,7 @@
- if (pid == 0)
- {
- close_most_fds ();
-- ptrace (PTRACE_TRACEME, 0, (PTRACE_TYPE_ARG3) 0, (PTRACE_TYPE_ARG4) 0);
-+ linux_traceme (program);
-
- setpgid (0, 0);
-
-Index: gdb-7.12.50.20170226/gdb/linux-nat.c
-===================================================================
---- gdb-7.12.50.20170226.orig/gdb/linux-nat.c 2017-02-26 21:27:14.785009484 +0100
-+++ gdb-7.12.50.20170226/gdb/linux-nat.c 2017-02-26 21:27:18.842038221 +0100
-@@ -1110,6 +1110,7 @@
- {
- struct cleanup *restore_personality
- = maybe_disable_address_space_randomization (disable_randomization);
-+ volatile struct gdb_exception ex;
-
- /* The fork_child mechanism is synchronous and calls target_wait, so
- we have to mask the async mode. */
-@@ -1117,7 +1118,28 @@
- /* Make sure we report all signals during startup. */
- linux_nat_pass_signals (ops, 0, NULL);
-
-- linux_ops->to_create_inferior (ops, exec_file, allargs, env, from_tty);
-+ TRY
-+ {
-+ linux_ops->to_create_inferior (ops, exec_file, allargs, env, from_tty);
-+ }
-+ CATCH (ex, RETURN_MASK_ERROR)
-+ {
-+ struct buffer buffer;
-+ char *message, *buffer_s;
-+
-+ message = xstrdup (ex.message);
-+ make_cleanup (xfree, message);
-+
-+ buffer_init (&buffer);
-+ linux_ptrace_create_warnings (&buffer);
-+
-+ buffer_grow_str0 (&buffer, "");
-+ buffer_s = buffer_finish (&buffer);
-+ make_cleanup (xfree, buffer_s);
-+
-+ throw_error (ex.error, "%s%s", buffer_s, message);
-+ }
-+ END_CATCH
-
- do_cleanups (restore_personality);
- }
-Index: gdb-7.12.50.20170226/gdb/config.in
-===================================================================
---- gdb-7.12.50.20170226.orig/gdb/config.in 2017-02-26 21:27:14.786009491 +0100
-+++ gdb-7.12.50.20170226/gdb/config.in 2017-02-26 21:27:18.842038221 +0100
-@@ -270,6 +270,9 @@
- /* Define if librpm library is being used. */
- #undef HAVE_LIBRPM
-
-+/* Define to 1 if you have the `selinux' library (-lselinux). */
-+#undef HAVE_LIBSELINUX
-+
- /* Define to 1 if you have the <libunwind-ia64.h> header file. */
- #undef HAVE_LIBUNWIND_IA64_H
-
-@@ -402,6 +405,9 @@
- /* Define to 1 if you have the `scm_new_smob' function. */
- #undef HAVE_SCM_NEW_SMOB
-
-+/* Define to 1 if you have the <selinux/selinux.h> header file. */
-+#undef HAVE_SELINUX_SELINUX_H
-+
- /* Define to 1 if you have the `setlocale' function. */
- #undef HAVE_SETLOCALE
-
-Index: gdb-7.12.50.20170226/gdb/configure
-===================================================================
---- gdb-7.12.50.20170226.orig/gdb/configure 2017-02-26 21:27:14.790009519 +0100
-+++ gdb-7.12.50.20170226/gdb/configure 2017-02-26 21:27:18.846038249 +0100
-@@ -15492,6 +15492,64 @@
- _ACEOF
-
-
-+for ac_header in selinux/selinux.h
-+do :
-+ ac_fn_c_check_header_mongrel "$LINENO" "selinux/selinux.h" "ac_cv_header_selinux_selinux_h" "$ac_includes_default"
-+if test "x$ac_cv_header_selinux_selinux_h" = x""yes; then :
-+ cat >>confdefs.h <<_ACEOF
-+#define HAVE_SELINUX_SELINUX_H 1
-+_ACEOF
-+
-+fi
-+
-+done
-+
-+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for security_get_boolean_active in -lselinux" >&5
-+$as_echo_n "checking for security_get_boolean_active in -lselinux... " >&6; }
-+if test "${ac_cv_lib_selinux_security_get_boolean_active+set}" = set; then :
-+ $as_echo_n "(cached) " >&6
-+else
-+ ac_check_lib_save_LIBS=$LIBS
-+LIBS="-lselinux $LIBS"
-+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-+/* end confdefs.h. */
-+
-+/* Override any GCC internal prototype to avoid an error.
-+ Use char because int might match the return type of a GCC
-+ builtin and then its argument prototype would still apply. */
-+#ifdef __cplusplus
-+extern "C"
-+#endif
-+char security_get_boolean_active ();
-+int
-+main ()
-+{
-+return security_get_boolean_active ();
-+ ;
-+ return 0;
-+}
-+_ACEOF
-+if ac_fn_c_try_link "$LINENO"; then :
-+ ac_cv_lib_selinux_security_get_boolean_active=yes
-+else
-+ ac_cv_lib_selinux_security_get_boolean_active=no
-+fi
-+rm -f core conftest.err conftest.$ac_objext \
-+ conftest$ac_exeext conftest.$ac_ext
-+LIBS=$ac_check_lib_save_LIBS
-+fi
-+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_selinux_security_get_boolean_active" >&5
-+$as_echo "$ac_cv_lib_selinux_security_get_boolean_active" >&6; }
-+if test "x$ac_cv_lib_selinux_security_get_boolean_active" = x""yes; then :
-+ cat >>confdefs.h <<_ACEOF
-+#define HAVE_LIBSELINUX 1
-+_ACEOF
-+
-+ LIBS="-lselinux $LIBS"
-+
-+fi
-+
-+
-
- # Support for --with-sysroot is a copy of GDB_AC_WITH_DIR,
- # except that the argument to --with-sysroot is optional.
-Index: gdb-7.12.50.20170226/gdb/gdbserver/config.in
-===================================================================
---- gdb-7.12.50.20170226.orig/gdb/gdbserver/config.in 2017-02-26 21:27:14.791009527 +0100
-+++ gdb-7.12.50.20170226/gdb/gdbserver/config.in 2017-02-26 21:27:18.846038249 +0100
-@@ -123,6 +123,9 @@
- /* Define to 1 if you have the `mcheck' library (-lmcheck). */
- #undef HAVE_LIBMCHECK
-
-+/* Define to 1 if you have the `selinux' library (-lselinux). */
-+#undef HAVE_LIBSELINUX
-+
- /* Define if the target supports branch tracing. */
- #undef HAVE_LINUX_BTRACE
-
-@@ -199,6 +202,9 @@
- /* Define to 1 if you have the `pwrite' function. */
- #undef HAVE_PWRITE
-
-+/* Define to 1 if you have the <selinux/selinux.h> header file. */
-+#undef HAVE_SELINUX_SELINUX_H
-+
- /* Define to 1 if you have the `setns' function. */
- #undef HAVE_SETNS
-
-Index: gdb-7.12.50.20170226/gdb/gdbserver/configure
-===================================================================
---- gdb-7.12.50.20170226.orig/gdb/gdbserver/configure 2017-02-26 21:27:14.793009541 +0100
-+++ gdb-7.12.50.20170226/gdb/gdbserver/configure 2017-02-26 21:27:18.848038263 +0100
-@@ -8429,6 +8429,64 @@
- fi
- fi
-
-+for ac_header in selinux/selinux.h
-+do :
-+ ac_fn_c_check_header_mongrel "$LINENO" "selinux/selinux.h" "ac_cv_header_selinux_selinux_h" "$ac_includes_default"
-+if test "x$ac_cv_header_selinux_selinux_h" = x""yes; then :
-+ cat >>confdefs.h <<_ACEOF
-+#define HAVE_SELINUX_SELINUX_H 1
-+_ACEOF
-+
-+fi
-+
-+done
-+
-+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for security_get_boolean_active in -lselinux" >&5
-+$as_echo_n "checking for security_get_boolean_active in -lselinux... " >&6; }
-+if test "${ac_cv_lib_selinux_security_get_boolean_active+set}" = set; then :
-+ $as_echo_n "(cached) " >&6
-+else
-+ ac_check_lib_save_LIBS=$LIBS
-+LIBS="-lselinux $LIBS"
-+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-+/* end confdefs.h. */
-+
-+/* Override any GCC internal prototype to avoid an error.
-+ Use char because int might match the return type of a GCC
-+ builtin and then its argument prototype would still apply. */
-+#ifdef __cplusplus
-+extern "C"
-+#endif
-+char security_get_boolean_active ();
-+int
-+main ()
-+{
-+return security_get_boolean_active ();
-+ ;
-+ return 0;
-+}
-+_ACEOF
-+if ac_fn_c_try_link "$LINENO"; then :
-+ ac_cv_lib_selinux_security_get_boolean_active=yes
-+else
-+ ac_cv_lib_selinux_security_get_boolean_active=no
-+fi
-+rm -f core conftest.err conftest.$ac_objext \
-+ conftest$ac_exeext conftest.$ac_ext
-+LIBS=$ac_check_lib_save_LIBS
-+fi
-+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_selinux_security_get_boolean_active" >&5
-+$as_echo "$ac_cv_lib_selinux_security_get_boolean_active" >&6; }
-+if test "x$ac_cv_lib_selinux_security_get_boolean_active" = x""yes; then :
-+ cat >>confdefs.h <<_ACEOF
-+#define HAVE_LIBSELINUX 1
-+_ACEOF
-+
-+ LIBS="-lselinux $LIBS"
-+
-+fi
-+
-+
-
-
-
diff --git a/gdb-btrobust.patch b/gdb-btrobust.patch
index dd57543..5175ff0 100644
--- a/gdb-btrobust.patch
+++ b/gdb-btrobust.patch
@@ -1,13 +1,26 @@
+From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
+From: Fedora GDB patches <invalid(a)email.com>
+Date: Fri, 27 Oct 2017 21:07:50 +0200
+Subject: gdb-btrobust.patch
+
+FileName: gdb-btrobust.patch
+
+;; Continue backtrace even if a frame filter throws an exception (Phil Muldoon).
+;;=push
+
This should fix the error with glib. An error message will still be
printed, but a default backtrace will occur in this case.
--
+---
+ gdb/python/py-framefilter.c | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
-Index: gdb-7.12.50.20170226/gdb/python/py-framefilter.c
-===================================================================
---- gdb-7.12.50.20170226.orig/gdb/python/py-framefilter.c 2017-02-26 21:33:23.150618708 +0100
-+++ gdb-7.12.50.20170226/gdb/python/py-framefilter.c 2017-02-26 21:33:29.993667179 +0100
-@@ -1388,6 +1388,7 @@
+diff --git a/gdb/python/py-framefilter.c b/gdb/python/py-framefilter.c
+index e887849c36..a8e4f49eb5 100644
+--- a/gdb/python/py-framefilter.c
++++ b/gdb/python/py-framefilter.c
+@@ -1388,6 +1388,7 @@ gdbpy_apply_frame_filter (const struct extension_language_defn *extlang,
htab_eq_pointer,
NULL));
@@ -15,7 +28,7 @@ Index: gdb-7.12.50.20170226/gdb/python/py-framefilter.c
while (true)
{
gdbpy_ref<> item (PyIter_Next (iterable.get ()));
-@@ -1397,7 +1398,7 @@
+@@ -1397,7 +1398,7 @@ gdbpy_apply_frame_filter (const struct extension_language_defn *extlang,
if (PyErr_Occurred ())
{
gdbpy_print_stack ();
@@ -24,7 +37,7 @@ Index: gdb-7.12.50.20170226/gdb/python/py-framefilter.c
}
break;
}
-@@ -1409,6 +1410,7 @@
+@@ -1409,6 +1410,7 @@ gdbpy_apply_frame_filter (const struct extension_language_defn *extlang,
error and continue with other frames. */
if (success == EXT_LANG_BT_ERROR)
gdbpy_print_stack ();
@@ -32,3 +45,6 @@ Index: gdb-7.12.50.20170226/gdb/python/py-framefilter.c
}
return success;
+--
+2.14.3
+
diff --git a/gdb-bz1219747-attach-kills.patch b/gdb-bz1219747-attach-kills.patch
index fe3781c..0572aa6 100644
--- a/gdb-bz1219747-attach-kills.patch
+++ b/gdb-bz1219747-attach-kills.patch
@@ -1,5 +1,14 @@
+From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
+From: Fedora GDB patches <invalid(a)email.com>
+Date: Fri, 27 Oct 2017 21:07:50 +0200
+Subject: Never kill PID on: gdb exec PID
+
+FileName: gdb-bz1219747-attach-kills.patch
+
+;; Never kill PID on: gdb exec PID (Jan Kratochvil, RH BZ 1219747).
+;;=push+jan
+
http://sourceware.org/ml/gdb-patches/2015-10/msg00301.html
-Subject: [PATCH 1/3] Never kill PID on: gdb exec PID
Hi,
@@ -16,25 +25,13 @@ A program is being debugged already. Kill it? (y or n) _
The first attachment of "/tmp/sleep" commandline argument errors at:
-#0 throw_error (error=GENERIC_ERROR, fmt=0x116d135 "%s.") at ./common/common-exceptions.c:371
-#1 in throw_perror_with_name (errcode=GENERIC_ERROR, string=0x7fffffffdb96 "/dfsfds") at utils.c:974
-#2 in perror_with_name (string=0x7fffffffdb96 "/dfsfds") at utils.c:982
-#3 in exec_file_attach (filename=0x7fffffffdb96 "/dfsfds", from_tty=1) at exec.c:268
267 if (scratch_chan < 0)
268 perror_with_name (filename);
-#4 in catch_command_errors_const (command=0x80f59f <exec_file_attach>, arg=0x7fffffffdb96 "/dfsfds", from_tty=1) at main.c:395
-#5 in captured_main (data=0x7fffffffd6f0) at main.c:1051
1051 if (catch_command_errors_const (exec_file_attach, execarg,
1052 !batch_flag))
Then GDB tries to attach to the process $p:
-#0 inferior_appeared (inf=0x240e0b0, pid=29210) at inferior.c:305
-#1 in inf_ptrace_attach (ops=0x2339540, args=0x21dcdc0 "29210", from_tty=1) at inf-ptrace.c:206
-#2 in linux_nat_attach (ops=0x2339540, args=0x21dcdc0 "29210", from_tty=1) at linux-nat.c:1278
-#3 in attach_command (args=0x21dcdc0 "29210", from_tty=1) at infcmd.c:2748
-#4 in catch_command_errors (command=0x79d7e5 <attach_command>, arg=0x7fffffffdb9e "29210", from_tty=1) at main.c:368
-#5 in captured_main (data=0x7fffffffd6f0) at main.c:1082
1082 if (catch_command_errors (attach_command, pid_or_core_arg,
1083 !batch_flag) == 0)
@@ -45,37 +42,14 @@ the lines
still fail because consequently attach_command() fails to find the associated
executable file:
-#0 throw_error (error=GENERIC_ERROR, fmt=0x116d135 "%s.") at ./common/common-exceptions.c:371
-#1 in throw_perror_with_name (errcode=GENERIC_ERROR, string=0x2477860 "/tmp/sleep (deleted)") at utils.c:974
-#2 in perror_with_name (string=0x2477860 "/tmp/sleep (deleted)") at utils.c:982
-#3 in exec_file_attach (filename=0x2477860 "/tmp/sleep (deleted)", from_tty=1) at exec.c:268
267 if (scratch_chan < 0)
268 perror_with_name (filename);
-#4 in exec_file_locate_attach (pid=29210, from_tty=1) at exec.c:173
-#5 in attach_command_post_wait (args=0x24739b0 "29210", from_tty=1, async_exec=0) at infcmd.c:2628
-#6 in attach_command_continuation (args=0x2473590, err=0) at infcmd.c:2700
-#7 in do_my_continuations_1 (pmy_chain=0x7fffffffd190, err=0) at continuations.c:59
-#8 in do_my_continuations (list=0x240e130, err=0) at continuations.c:83
-#9 in do_all_inferior_continuations (err=0) at continuations.c:125
-#10 in inferior_event_handler (event_type=INF_EXEC_COMPLETE, client_data=0x0) at inf-loop.c:60
-#11 in fetch_inferior_event (client_data=0x0) at infrun.c:3929
-#12 in inferior_event_handler (event_type=INF_REG_EVENT, client_data=0x0) at inf-loop.c:44
-#13 in handle_target_event (error=0, client_data=0x0) at linux-nat.c:4681
-#14 in handle_file_event (file_ptr=0x21e4170, ready_mask=1) at event-loop.c:708
-#15 in gdb_wait_for_event (block=0) at event-loop.c:834
-#16 in gdb_do_one_event () at event-loop.c:298
-#17 in wait_sync_command_done () at top.c:373
-#18 in maybe_wait_sync_command_done (was_sync=0) at top.c:388
-#19 in catch_command_errors (command=0x79d7e5 <attach_command>, arg=0x7fffffffdb9e "29210", from_tty=1) at main.c:370
-#20 in captured_main (data=0x7fffffffd6f0) at main.c:1082
1082 if (catch_command_errors (attach_command, pid_or_core_arg,
1083 !batch_flag) == 0)
and therefore GDB executes the following:
(gdb) bt
-#5 in query (ctlstr=0x1141ae8 "A program is being debugged already. Kill it? ") at utils.c:1371
-#6 in target_preopen (from_tty=1) at target.c:2183
2179 if (have_inferiors ())
2180 {
2181 if (!from_tty
@@ -85,20 +59,14 @@ and therefore GDB executes the following:
2185 else
2186 error (_("Program not killed."));
2187 }
-#7 in core_open (arg=0x7fffffffdb9f "9694", from_tty=1) at corelow.c:283
-#8 in core_file_command (filename=0x7fffffffdb9f "9694", from_tty=1) at corefile.c:77
-#9 in catch_command_errors (command=0x86ca16 <core_file_command>, arg=0x7fffffffdb9f "9694", from_tty=1) at main.c:368
-#10 in captured_main (data=0x7fffffffd6f0) at main.c:1084
1084 catch_command_errors (core_file_command, pid_or_core_arg,
1085 !batch_flag);
No regressions on {x86_64,x86_64-m32,i686}-fedora24pre-linux-gnu.
-
Thanks,
Jan
-
gdb/ChangeLog
2015-10-16 Jan Kratochvil <jan.kratochvil(a)redhat.com>
@@ -111,17 +79,18 @@ gdb/testsuite/ChangeLog
* gdb.base/attach-kills.c: New.
* gdb.base/attach-kills.exp: New.
---
- gdb/testsuite/gdb.base/attach-kills.c | 25 ++++++++++++++++
- gdb/testsuite/gdb.base/attach-kills.exp | 49 +++++++++++++++++++++++++++++++
- 2 files changed, 74 insertions(+)
+ gdb/main.c | 5 +++-
+ gdb/testsuite/gdb.base/attach-kills.c | 25 +++++++++++++++++
+ gdb/testsuite/gdb.base/attach-kills.exp | 49 +++++++++++++++++++++++++++++++++
+ 3 files changed, 78 insertions(+), 1 deletion(-)
create mode 100644 gdb/testsuite/gdb.base/attach-kills.c
create mode 100644 gdb/testsuite/gdb.base/attach-kills.exp
diff --git a/gdb/main.c b/gdb/main.c
-index 49c9b68..bc19699 100644
+index 17d35f4a8a..b079e79c93 100644
--- a/gdb/main.c
+++ b/gdb/main.c
-@@ -1080,7 +1080,10 @@ captured_main (void *data)
+@@ -1114,7 +1114,10 @@ captured_main_1 (struct captured_main_args *context)
if (isdigit (pid_or_core_arg[0]))
{
if (catch_command_errors (attach_command, pid_or_core_arg,
@@ -135,7 +104,7 @@ index 49c9b68..bc19699 100644
}
diff --git a/gdb/testsuite/gdb.base/attach-kills.c b/gdb/testsuite/gdb.base/attach-kills.c
new file mode 100644
-index 0000000..2398f00
+index 0000000000..2398f00442
--- /dev/null
+++ b/gdb/testsuite/gdb.base/attach-kills.c
@@ -0,0 +1,25 @@
@@ -166,7 +135,7 @@ index 0000000..2398f00
+}
diff --git a/gdb/testsuite/gdb.base/attach-kills.exp b/gdb/testsuite/gdb.base/attach-kills.exp
new file mode 100644
-index 0000000..9a93cb7
+index 0000000000..9a93cb7584
--- /dev/null
+++ b/gdb/testsuite/gdb.base/attach-kills.exp
@@ -0,0 +1,49 @@
@@ -219,4 +188,6 @@ index 0000000..9a93cb7
+}
+
+kill_wait_spawned_process $test_spawn_id
+--
+2.14.3
diff --git a/gdb-bz533176-fortran-omp-step.patch b/gdb-bz533176-fortran-omp-step.patch
index 1ad42b9..2f2f820 100644
--- a/gdb-bz533176-fortran-omp-step.patch
+++ b/gdb-bz533176-fortran-omp-step.patch
@@ -1,3 +1,13 @@
+From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
+From: Fedora GDB patches <invalid(a)email.com>
+Date: Fri, 27 Oct 2017 21:07:50 +0200
+Subject: gdb-bz533176-fortran-omp-step.patch
+
+FileName: gdb-bz533176-fortran-omp-step.patch
+
+;; Fix stepping with OMP parallel Fortran sections (BZ 533176).
+;;=push+jan: It requires some better DWARF annotations.
+
https://bugzilla.redhat.com/show_bug.cgi?id=533176#c4
I find it a bug in DWARF and gdb behaves correctly according to it. From the
@@ -18,14 +28,19 @@ upstream) or "step" (default in F/RHEL) the simultaneous execution of the
threads is inconvenient. Setting it to "on" will lockup the debugging as the
threads need to get synchronized at some point. This is a more general
debugging problem of GOMP outside of the scope of this Bug.
+---
+ gdb/infrun.c | 11 +++++++++++
+ gdb/testsuite/gdb.fortran/omp-step.exp | 31 +++++++++++++++++++++++++++++++
+ gdb/testsuite/gdb.fortran/omp-step.f90 | 32 ++++++++++++++++++++++++++++++++
+ 3 files changed, 74 insertions(+)
+ create mode 100644 gdb/testsuite/gdb.fortran/omp-step.exp
+ create mode 100644 gdb/testsuite/gdb.fortran/omp-step.f90
-
-
-Index: gdb-7.7.90.20140613/gdb/infrun.c
-===================================================================
---- gdb-7.7.90.20140613.orig/gdb/infrun.c 2014-06-13 21:59:10.835805512 +0200
-+++ gdb-7.7.90.20140613/gdb/infrun.c 2014-06-13 21:59:31.064829121 +0200
-@@ -4820,6 +4820,16 @@ process_event_stop_test (struct executio
+diff --git a/gdb/infrun.c b/gdb/infrun.c
+index 8e30aed3b8..9b7b238f4d 100644
+--- a/gdb/infrun.c
++++ b/gdb/infrun.c
+@@ -6663,6 +6663,16 @@ process_event_stop_test (struct execution_control_state *ecs)
if (ecs->event_thread->control.step_over_calls == STEP_OVER_ALL)
{
@@ -42,7 +57,7 @@ Index: gdb-7.7.90.20140613/gdb/infrun.c
/* We're doing a "next".
Normal (forward) execution: set a breakpoint at the
-@@ -4855,6 +4865,7 @@ process_event_stop_test (struct executio
+@@ -6696,6 +6706,7 @@ process_event_stop_test (struct execution_control_state *ecs)
keep_going (ecs);
return;
@@ -50,10 +65,11 @@ Index: gdb-7.7.90.20140613/gdb/infrun.c
}
/* If we are in a function call trampoline (a stub between the
-Index: gdb-7.7.90.20140613/gdb/testsuite/gdb.fortran/omp-step.exp
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ gdb-7.7.90.20140613/gdb/testsuite/gdb.fortran/omp-step.exp 2014-06-13 21:59:22.801819481 +0200
+diff --git a/gdb/testsuite/gdb.fortran/omp-step.exp b/gdb/testsuite/gdb.fortran/omp-step.exp
+new file mode 100644
+index 0000000000..66440a7507
+--- /dev/null
++++ b/gdb/testsuite/gdb.fortran/omp-step.exp
@@ -0,0 +1,31 @@
+# Copyright 2009 Free Software Foundation, Inc.
+
@@ -86,10 +102,11 @@ Index: gdb-7.7.90.20140613/gdb/testsuite/gdb.fortran/omp-step.exp
+
+gdb_breakpoint [gdb_get_line_number "success"]
+gdb_continue_to_breakpoint "success" ".*success.*"
-Index: gdb-7.7.90.20140613/gdb/testsuite/gdb.fortran/omp-step.f90
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ gdb-7.7.90.20140613/gdb/testsuite/gdb.fortran/omp-step.f90 2014-06-13 21:59:22.801819481 +0200
+diff --git a/gdb/testsuite/gdb.fortran/omp-step.f90 b/gdb/testsuite/gdb.fortran/omp-step.f90
+new file mode 100644
+index 0000000000..a0cfb37014
+--- /dev/null
++++ b/gdb/testsuite/gdb.fortran/omp-step.f90
@@ -0,0 +1,32 @@
+! Copyright 2009 Free Software Foundation, Inc.
+
@@ -123,3 +140,6 @@ Index: gdb-7.7.90.20140613/gdb/testsuite/gdb.fortran/omp-step.f90
+ end do
+ print *, "success"
+ end
+--
+2.14.3
+
diff --git a/gdb-bz541866-rwatch-before-run.patch b/gdb-bz541866-rwatch-before-run.patch
index ba0622a..bbb65a0 100644
--- a/gdb-bz541866-rwatch-before-run.patch
+++ b/gdb-bz541866-rwatch-before-run.patch
@@ -1,32 +1,52 @@
-Index: gdb-7.11.90.20160807/gdb/config/i386/linux64.mh
-===================================================================
---- gdb-7.11.90.20160807.orig/gdb/config/i386/linux64.mh 2016-08-07 22:27:13.889285274 +0200
-+++ gdb-7.11.90.20160807/gdb/config/i386/linux64.mh 2016-08-07 22:29:20.451311124 +0200
-@@ -7,7 +7,7 @@
- linux-procfs.o linux-ptrace.o linux-btrace.o \
- linux-waitpid.o linux-personality.o x86-linux.o \
- x86-linux-dregs.o amd64-linux-siginfo.o linux-namespaces.o
--NAT_FILE= config/nm-linux.h
-+NAT_FILE= nm-linux64.h
- NAT_CDEPS = $(srcdir)/proc-service.list
+From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
+From: Fedora GDB patches <invalid(a)email.com>
+Date: Fri, 27 Oct 2017 21:07:50 +0200
+Subject: gdb-bz541866-rwatch-before-run.patch
+
+FileName: gdb-bz541866-rwatch-before-run.patch
+
+;; Fix i386+x86_64 rwatch+awatch before run, regression against 6.8 (BZ 541866).
+;; Fix i386 rwatch+awatch before run (BZ 688788, on top of BZ 541866).
+;;=push+jan: It should be fixed properly instead.
+---
+ gdb/breakpoint.c | 4 +--
+ gdb/config/i386/nm-linux.h | 28 +++++++++++++++
+ gdb/config/i386/nm-linux64.h | 28 +++++++++++++++
+ gdb/configure.nat | 2 ++
+ gdb/target.h | 2 ++
+ .../gdb.base/watchpoint-hw-before-run.exp | 40 ++++++++++++++++++++++
+ 6 files changed, 102 insertions(+), 2 deletions(-)
+ create mode 100644 gdb/config/i386/nm-linux.h
+ create mode 100644 gdb/config/i386/nm-linux64.h
+ create mode 100644 gdb/testsuite/gdb.base/watchpoint-hw-before-run.exp
+
+diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c
+index 814802a0a1..5a99de75e1 100644
+--- a/gdb/breakpoint.c
++++ b/gdb/breakpoint.c
+@@ -8864,7 +8864,7 @@ init_breakpoint_sal (struct breakpoint *b, struct gdbarch *gdbarch,
+ int enabled, int internal, unsigned flags,
+ int display_canonical)
+ {
+- int i;
++ int i ATTRIBUTE_UNUSED;
- # The dynamically loaded libthread_db needs access to symbols in the
-Index: gdb-7.11.90.20160807/gdb/config/i386/linux.mh
-===================================================================
---- gdb-7.11.90.20160807.orig/gdb/config/i386/linux.mh 2016-08-07 22:27:13.889285274 +0200
-+++ gdb-7.11.90.20160807/gdb/config/i386/linux.mh 2016-08-07 22:29:20.451311124 +0200
-@@ -1,6 +1,6 @@
- # Host: Intel 386 running GNU/Linux.
+ if (type == bp_hardware_breakpoint)
+ {
+@@ -14425,7 +14425,7 @@ enable_breakpoint_disp (struct breakpoint *bpt, enum bpdisp disposition,
--NAT_FILE= config/nm-linux.h
-+NAT_FILE= nm-linux.h
- NATDEPFILES= inf-ptrace.o fork-child.o \
- x86-nat.o x86-dregs.o i386-linux-nat.o x86-linux-nat.o \
- proc-service.o linux-thread-db.o \
-Index: gdb-7.11.90.20160807/gdb/config/i386/nm-linux.h
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ gdb-7.11.90.20160807/gdb/config/i386/nm-linux.h 2016-08-07 22:29:20.451311124 +0200
+ if (bpt->type == bp_hardware_breakpoint)
+ {
+- int i;
++ int i ATTRIBUTE_UNUSED;
+ i = hw_breakpoint_used_count ();
+ target_resources_ok =
+ target_can_use_hardware_watchpoint (bp_hardware_breakpoint,
+diff --git a/gdb/config/i386/nm-linux.h b/gdb/config/i386/nm-linux.h
+new file mode 100644
+index 0000000000..38e94baab1
+--- /dev/null
++++ b/gdb/config/i386/nm-linux.h
@@ -0,0 +1,28 @@
+/* Native support for GNU/Linux i386.
+
@@ -56,10 +76,11 @@ Index: gdb-7.11.90.20160807/gdb/config/i386/nm-linux.h
+#define target_can_use_hardware_watchpoint(type, cnt, ot) 1
+
+#endif /* NM_LINUX64_H */
-Index: gdb-7.11.90.20160807/gdb/config/i386/nm-linux64.h
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ gdb-7.11.90.20160807/gdb/config/i386/nm-linux64.h 2016-08-07 22:29:20.451311124 +0200
+diff --git a/gdb/config/i386/nm-linux64.h b/gdb/config/i386/nm-linux64.h
+new file mode 100644
+index 0000000000..212daba477
+--- /dev/null
++++ b/gdb/config/i386/nm-linux64.h
@@ -0,0 +1,28 @@
+/* Native support for GNU/Linux amd64.
+
@@ -89,11 +110,31 @@ Index: gdb-7.11.90.20160807/gdb/config/i386/nm-linux64.h
+#define target_can_use_hardware_watchpoint(type, cnt, ot) 1
+
+#endif /* NM_LINUX64_H */
-Index: gdb-7.11.90.20160807/gdb/target.h
-===================================================================
---- gdb-7.11.90.20160807.orig/gdb/target.h 2016-08-07 22:27:13.889285274 +0200
-+++ gdb-7.11.90.20160807/gdb/target.h 2016-08-07 22:29:20.452311132 +0200
-@@ -1939,9 +1939,11 @@
+diff --git a/gdb/configure.nat b/gdb/configure.nat
+index 8e14892722..6dbb072054 100644
+--- a/gdb/configure.nat
++++ b/gdb/configure.nat
+@@ -237,6 +237,7 @@ case ${gdb_host} in
+ ;;
+ i386)
+ # Host: Intel 386 running GNU/Linux.
++ NAT_FILE="${srcdir}/config/${gdb_host_cpu}/nm-linux.h"
+ NATDEPFILES="${NATDEPFILES} x86-nat.o x86-dregs.o \
+ i386-linux-nat.o x86-linux-nat.o linux-btrace.o \
+ x86-linux.o x86-linux-dregs.o"
+@@ -289,6 +290,7 @@ case ${gdb_host} in
+ case ${gdb_host_cpu} in
+ i386)
+ # Host: GNU/Linux x86-64
++ NAT_FILE="${srcdir}/config/${gdb_host_cpu}/nm-linux64.h"
+ NATDEPFILES="${NATDEPFILES} x86-nat.o x86-dregs.o \
+ amd64-nat.o amd64-linux-nat.o x86-linux-nat.o linux-btrace.o \
+ x86-linux.o x86-linux-dregs.o amd64-linux-siginfo.o"
+diff --git a/gdb/target.h b/gdb/target.h
+index 4781fbc59c..e3a2882fe5 100644
+--- a/gdb/target.h
++++ b/gdb/target.h
+@@ -1915,9 +1915,11 @@ extern struct thread_info *target_thread_handle_to_thread_info
one. OTHERTYPE is the number of watchpoints of other types than
this one used so far. */
@@ -105,10 +146,11 @@ Index: gdb-7.11.90.20160807/gdb/target.h
/* Returns the number of debug registers needed to watch the given
memory region, or zero if not supported. */
-Index: gdb-7.11.90.20160807/gdb/testsuite/gdb.base/watchpoint-hw-before-run.exp
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ gdb-7.11.90.20160807/gdb/testsuite/gdb.base/watchpoint-hw-before-run.exp 2016-08-07 22:29:20.452311132 +0200
+diff --git a/gdb/testsuite/gdb.base/watchpoint-hw-before-run.exp b/gdb/testsuite/gdb.base/watchpoint-hw-before-run.exp
+new file mode 100644
+index 0000000000..4ce9997e4a
+--- /dev/null
++++ b/gdb/testsuite/gdb.base/watchpoint-hw-before-run.exp
@@ -0,0 +1,40 @@
+# Copyright 2009, 2010 Free Software Foundation, Inc.
+
@@ -150,16 +192,6 @@ Index: gdb-7.11.90.20160807/gdb/testsuite/gdb.base/watchpoint-hw-before-run.exp
+gdb_test "" "main .* at .*" "start"
+
+gdb_test "continue" "Continuing.\r\n\r\nHardware read watchpoint \[0-9\]+: watchee\r\n\r\nValue = 0\r\n.*"
-Index: gdb-7.11.90.20160807/gdb/breakpoint.c
-===================================================================
---- gdb-7.11.90.20160807.orig/gdb/breakpoint.c 2016-08-07 22:33:38.835405458 +0200
-+++ gdb-7.11.90.20160807/gdb/breakpoint.c 2016-08-07 22:34:45.023941950 +0200
-@@ -14953,7 +14953,7 @@
-
- if (bpt->type == bp_hardware_breakpoint)
- {
-- int i;
-+ int i ATTRIBUTE_UNUSED;
- i = hw_breakpoint_used_count ();
- target_resources_ok =
- target_can_use_hardware_watchpoint (bp_hardware_breakpoint,
+--
+2.14.3
+
diff --git a/gdb-bz568248-oom-is-error.patch b/gdb-bz568248-oom-is-error.patch
index 045d34e..9cc6fa4 100644
--- a/gdb-bz568248-oom-is-error.patch
+++ b/gdb-bz568248-oom-is-error.patch
@@ -1,5 +1,14 @@
+From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
+From: Fedora GDB patches <invalid(a)email.com>
+Date: Fri, 27 Oct 2017 21:07:50 +0200
+Subject: nomem: internal_error -> error
+
+FileName: gdb-bz568248-oom-is-error.patch
+
+;; Out of memory is just an error, not fatal (uninitialized VLS vars, BZ 568248).
+;;=push+jan: Inferior objects should be read in parts, then this patch gets obsoleted.
+
http://sourceware.org/ml/gdb-patches/2010-06/msg00005.html
-Subject: [rfc patch] nomem: internal_error -> error
Hi,
@@ -24,7 +33,6 @@ It is apparently because boundary for the variable `a' is not initialized
there. Users notice it due to Eclipse-CDT trying to automatically display all
the local variables on each step.
-
Apparentl no regressions on {x86_64,x86_64-m32,i686}-fedora13-linux-gnu.
But is anone aware of the reasons to use internal_error there?
I find simple error as a perfectly reasonable there.
@@ -35,22 +43,23 @@ IIRC this idea has been discussed with Tom Tromey, not sure of its origin.
I understand it may be offtopic for FSF GDB but from some GDB crashes I am not
sure if it can happen only due to the VLA variables.
-
Thanks,
Jan
-
gdb/
2010-06-01 Jan Kratochvil <jan.kratochvil(a)redhat.com>
Tom Tromey <tromey(a)redhat.com>
* utils.c (nomem): Change internal_error to error.
-
-Index: gdb-7.3.50.20110722/gdb/utils.c
-===================================================================
---- gdb-7.3.50.20110722.orig/gdb/utils.c 2011-07-22 19:28:58.000000000 +0200
-+++ gdb-7.3.50.20110722/gdb/utils.c 2011-07-22 19:34:25.000000000 +0200
-@@ -1219,13 +1219,11 @@ malloc_failure (long size)
+---
+ gdb/utils.c | 6 ++----
+ 1 file changed, 2 insertions(+), 4 deletions(-)
+
+diff --git a/gdb/utils.c b/gdb/utils.c
+index c531748fe4..0066bfcc4b 100644
+--- a/gdb/utils.c
++++ b/gdb/utils.c
+@@ -774,13 +774,11 @@ malloc_failure (long size)
{
if (size > 0)
{
@@ -66,3 +75,6 @@ Index: gdb-7.3.50.20110722/gdb/utils.c
}
}
+--
+2.14.3
+
diff --git a/gdb-container-rh-pkg.patch b/gdb-container-rh-pkg.patch
index 0b8a3a2..ce648be 100644
--- a/gdb-container-rh-pkg.patch
+++ b/gdb-container-rh-pkg.patch
@@ -1,6 +1,21 @@
---- gdb-7.11/gdb/remote.c-orig 2016-04-06 17:46:52.428921496 +0200
-+++ gdb-7.11/gdb/remote.c 2016-04-06 18:28:26.781923516 +0200
-@@ -13002,7 +13002,17 @@ remote_pid_to_exec_file (struct target_o
+From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
+From: Fedora GDB patches <invalid(a)email.com>
+Date: Fri, 27 Oct 2017 21:07:50 +0200
+Subject: gdb-container-rh-pkg.patch
+
+FileName: gdb-container-rh-pkg.patch
+
+;; Add messages suggesting more recent RHEL gdbserver (RH BZ 1321114).
+;;=fedora
+---
+ gdb/remote.c | 12 +++++++++++-
+ 1 file changed, 11 insertions(+), 1 deletion(-)
+
+diff --git a/gdb/remote.c b/gdb/remote.c
+index 1eee712466..fbade4f267 100644
+--- a/gdb/remote.c
++++ b/gdb/remote.c
+@@ -13431,7 +13431,17 @@ remote_pid_to_exec_file (struct target_ops *self, int pid)
char *annex = NULL;
if (packet_support (PACKET_qXfer_exec_file) != PACKET_ENABLE)
@@ -17,5 +32,8 @@
+ return NULL;
+ }
- if (filename != NULL)
- xfree (filename);
+ inf = find_inferior_pid (pid);
+ if (inf == NULL)
+--
+2.14.3
+
diff --git a/gdb-core-open-vdso-warning.patch b/gdb-core-open-vdso-warning.patch
deleted file mode 100644
index 5bd3ef9..0000000
--- a/gdb-core-open-vdso-warning.patch
+++ /dev/null
@@ -1,50 +0,0 @@
-http://sourceware.org/ml/gdb-patches/2009-10/msg00142.html
-Subject: [patch] Fix GNU/Linux core open: Can't read pathname for load map: Input/output error.
-
-[ New patch variant. ]
-
-commit 7d760051ffb8a23cdc51342d4e6243fbc462f73f
-Author: Ulrich Weigand <uweigand(a)de.ibm.com>
-Date: Wed Sep 25 11:52:50 2013 +0000
-
-Index: gdb-7.6.50.20130731-cvs/gdb/testsuite/gdb.base/solib-symbol.exp
-===================================================================
---- gdb-7.6.50.20130731-cvs.orig/gdb/testsuite/gdb.base/solib-symbol.exp 2013-08-02 16:27:28.833259471 +0200
-+++ gdb-7.6.50.20130731-cvs/gdb/testsuite/gdb.base/solib-symbol.exp 2013-08-02 16:28:22.549330973 +0200
-@@ -29,6 +29,7 @@ set testfile "solib-symbol-main"
- set srcfile ${srcdir}/${subdir}/${testfile}.c
- set binfile [standard_output_file ${testfile}]
- set bin_flags [list debug shlib=${binfile_lib}]
-+set executable ${testfile}
-
- if [get_compiler_info] {
- return -1
-@@ -72,8 +73,26 @@ gdb_test "br foo2" \
- "Breakpoint.*: foo2. .2 locations..*" \
- "foo2 in mdlib"
-
--gdb_exit
-+# Test GDB warns for shared libraris which have not been found.
-
--return 0
-+gdb_test "info sharedlibrary" "/${libname}.*"
-
-+clean_restart ${executable}
-+gdb_breakpoint "main"
-+gdb_run_cmd
-+set test "no warning for missing libraries"
-+gdb_test_multiple "" $test {
-+ -re "warning: Could not load shared library symbols for \[0-9\]+ libraries,.*\r\n$gdb_prompt $" {
-+ fail $test
-+ }
-+ -re "Breakpoint \[0-9\]+, main .*\r\n$gdb_prompt $" {
-+ pass $test
-+ }
-+}
-
-+clean_restart ${executable}
-+gdb_test_no_output "set solib-absolute-prefix /doESnotEXIST"
-+gdb_breakpoint "main"
-+gdb_run_cmd
-+gdb_test "" "warning: Could not load shared library symbols for \[0-9\]+ libraries,.*\r\nBreakpoint \[0-9\]+, main .*" \
-+ "warning for missing libraries"
diff --git a/gdb-dts-rhel6-python-compat.patch b/gdb-dts-rhel6-python-compat.patch
index 8adf7f4..29c2824 100644
--- a/gdb-dts-rhel6-python-compat.patch
+++ b/gdb-dts-rhel6-python-compat.patch
@@ -1,10 +1,29 @@
+From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
+From: Fedora GDB patches <invalid(a)email.com>
+Date: Fri, 27 Oct 2017 21:07:50 +0200
+Subject: gdb-dts-rhel6-python-compat.patch
+
+FileName: gdb-dts-rhel6-python-compat.patch
+
+;; [rhel6] DTS backward Python compatibility API (BZ 1020004, Phil Muldoon).
+;;=fedora
+
https://bugzilla.redhat.com/show_bug.cgi?id=1020004
+---
+ gdb/data-directory/Makefile.in | 3 +
+ gdb/python/lib/gdb/FrameWrapper.py | 122 ++++++++++++++++++++++++++++++++
+ gdb/python/lib/gdb/backtrace.py | 42 +++++++++++
+ gdb/python/lib/gdb/command/backtrace.py | 106 +++++++++++++++++++++++++++
+ 4 files changed, 273 insertions(+)
+ create mode 100644 gdb/python/lib/gdb/FrameWrapper.py
+ create mode 100644 gdb/python/lib/gdb/backtrace.py
+ create mode 100644 gdb/python/lib/gdb/command/backtrace.py
-Index: gdb-7.12.50.20170207/gdb/data-directory/Makefile.in
-===================================================================
---- gdb-7.12.50.20170207.orig/gdb/data-directory/Makefile.in 2017-02-26 21:10:31.418894975 +0100
-+++ gdb-7.12.50.20170207/gdb/data-directory/Makefile.in 2017-02-26 21:11:07.083147930 +0100
-@@ -71,6 +71,8 @@
+diff --git a/gdb/data-directory/Makefile.in b/gdb/data-directory/Makefile.in
+index 753e0b69a3..5c7c0b4c2e 100644
+--- a/gdb/data-directory/Makefile.in
++++ b/gdb/data-directory/Makefile.in
+@@ -71,6 +71,8 @@ PYTHON_FILE_LIST = \
gdb/__init__.py \
gdb/FrameDecorator.py \
gdb/FrameIterator.py \
@@ -13,18 +32,19 @@ Index: gdb-7.12.50.20170207/gdb/data-directory/Makefile.in
gdb/frames.py \
gdb/printing.py \
gdb/prompt.py \
-@@ -83,6 +85,7 @@
- gdb/command/pahole.py \
- gdb/command/xmethods.py \
+@@ -79,6 +81,7 @@ PYTHON_FILE_LIST = \
+ gdb/xmethod.py \
+ gdb/command/__init__.py \
gdb/command/explore.py \
+ gdb/command/backtrace.py \
gdb/command/frame_filters.py \
gdb/command/pretty_printers.py \
gdb/command/prompt.py \
-Index: gdb-7.12.50.20170207/gdb/python/lib/gdb/FrameWrapper.py
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ gdb-7.12.50.20170207/gdb/python/lib/gdb/FrameWrapper.py 2017-02-26 21:10:31.419894983 +0100
+diff --git a/gdb/python/lib/gdb/FrameWrapper.py b/gdb/python/lib/gdb/FrameWrapper.py
+new file mode 100644
+index 0000000000..34ba4a2a12
+--- /dev/null
++++ b/gdb/python/lib/gdb/FrameWrapper.py
@@ -0,0 +1,122 @@
+# Wrapper API for frames.
+
@@ -148,10 +168,11 @@ Index: gdb-7.12.50.20170207/gdb/python/lib/gdb/FrameWrapper.py
+
+ def __getattr__ (self, name):
+ return getattr (self.frame, name)
-Index: gdb-7.12.50.20170207/gdb/python/lib/gdb/backtrace.py
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ gdb-7.12.50.20170207/gdb/python/lib/gdb/backtrace.py 2017-02-26 21:10:31.419894983 +0100
+diff --git a/gdb/python/lib/gdb/backtrace.py b/gdb/python/lib/gdb/backtrace.py
+new file mode 100644
+index 0000000000..06c893f239
+--- /dev/null
++++ b/gdb/python/lib/gdb/backtrace.py
@@ -0,0 +1,42 @@
+# Filtering backtrace.
+
@@ -195,10 +216,11 @@ Index: gdb-7.12.50.20170207/gdb/python/lib/gdb/backtrace.py
+ return iter
+ return old_frame_filter (iter)
+
-Index: gdb-7.12.50.20170207/gdb/python/lib/gdb/command/backtrace.py
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ gdb-7.12.50.20170207/gdb/python/lib/gdb/command/backtrace.py 2017-02-26 21:10:31.419894983 +0100
+diff --git a/gdb/python/lib/gdb/command/backtrace.py b/gdb/python/lib/gdb/command/backtrace.py
+new file mode 100644
+index 0000000000..eeea9093e8
+--- /dev/null
++++ b/gdb/python/lib/gdb/command/backtrace.py
@@ -0,0 +1,106 @@
+# New backtrace command.
+
@@ -306,3 +328,6 @@ Index: gdb-7.12.50.20170207/gdb/python/lib/gdb/command/backtrace.py
+ pair[1].describe (sys.stdout, full)
+
+FilteringBacktrace()
+--
+2.14.3
+
diff --git a/gdb-follow-child-stale-parent.patch b/gdb-follow-child-stale-parent.patch
index 336790c..973a06d 100644
--- a/gdb-follow-child-stale-parent.patch
+++ b/gdb-follow-child-stale-parent.patch
@@ -1,3 +1,13 @@
+From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
+From: Fedora GDB patches <invalid(a)email.com>
+Date: Fri, 27 Oct 2017 21:07:50 +0200
+Subject: gdb-follow-child-stale-parent.patch
+
+FileName: gdb-follow-child-stale-parent.patch
+
+;; Fix regression by python on ia64 due to stale current frame.
+;;=push+jan
+
Problem occurs with python and its get_current_arch () as it selects
selected_frame and current_frame while still inferior_ptid is valid for the
original parent. But since this place it is already attached and later
@@ -12,10 +22,15 @@ unwinders try to access it, breaking:
+FAIL: gdb.threads/watchpoint-fork.exp: child: singlethreaded: breakpoint after the second fork
+FAIL: gdb.threads/watchpoint-fork.exp: child: singlethreaded: watchpoint after the second fork
+FAIL: gdb.threads/watchpoint-fork.exp: child: singlethreaded: finish
+---
+ gdb/infrun.c | 3 +++
+ 1 file changed, 3 insertions(+)
---- ./gdb/infrun.c 2009-12-21 20:26:30.000000000 +0100
-+++ ./gdb/infrun.c 2009-12-21 20:26:11.000000000 +0100
-@@ -375,6 +375,9 @@ follow_fork (void)
+diff --git a/gdb/infrun.c b/gdb/infrun.c
+index 9b7b238f4d..91d6004d0a 100644
+--- a/gdb/infrun.c
++++ b/gdb/infrun.c
+@@ -749,6 +749,9 @@ follow_fork (void)
}
else
{
@@ -25,3 +40,6 @@ unwinders try to access it, breaking:
/* This pending follow fork event is now handled, one way
or another. The previous selected thread may be gone
from the lists by now, but if it is still around, need
+--
+2.14.3
+
diff --git a/gdb-fortran-frame-string.patch b/gdb-fortran-frame-string.patch
deleted file mode 100644
index e07b27b..0000000
--- a/gdb-fortran-frame-string.patch
+++ /dev/null
@@ -1,104 +0,0 @@
-http://sourceware.org/ml/gdb-patches/2014-07/msg00709.html
-Subject: [patch] Display Fortran strings in backtraces
-
-
-Hi,
-
-for Fortran it fixes displaying normal strings also in frames/backtraces:
-
-(gdb) frame
-#0 f (s=..., _s=3) at ./gdb.fortran/fortran-frame-string.f90:24
-->
-#0 f (s='foo', _s=3) at ./gdb.fortran/fortran-frame-string.f90:24
-
-The patch is simple and I do not see why it should not be this way.
-
-For C/C++ TYPE_CODE_STRING is not used. I am not aware of Pascal but that
-language is currently not really much supported in GDB anyway.
-
-This was a part of my archer/jankratochvil/vla branch but it is not a part of
-the Intel VLA patchset as it in fact is completely unrelated to "VLA".
-
-No regressions on {x86_64,x86_64-m32,i686}-fedora22pre-linux-gnu.
-
-
-Thanks,
-Jan
-
-
-diff --git a/gdb/testsuite/gdb.fortran/fortran-frame-string.exp b/gdb/testsuite/gdb.fortran/fortran-frame-string.exp
-new file mode 100644
-index 0000000..4b78266
---- /dev/null
-+++ b/gdb/testsuite/gdb.fortran/fortran-frame-string.exp
-@@ -0,0 +1,36 @@
-+# Copyright 2014 Free Software Foundation, Inc.
-+
-+# This program is free software; you can redistribute it and/or modify
-+# it under the terms of the GNU General Public License as published by
-+# the Free Software Foundation; either version 2 of the License, or
-+# (at your option) any later version.
-+#
-+# This program is distributed in the hope that it will be useful,
-+# but WITHOUT ANY WARRANTY; without even the implied warranty of
-+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+# GNU General Public License for more details.
-+#
-+# You should have received a copy of the GNU General Public License
-+# along with this program; if not, write to the Free Software
-+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-+
-+standard_testfile .f90
-+if { [prepare_for_testing ${testfile}.exp ${testfile} ${srcfile} {debug f90}] } {
-+ return -1
-+}
-+
-+if ![runto MAIN__] then {
-+ perror "couldn't run to breakpoint MAIN__"
-+ continue
-+}
-+
-+gdb_breakpoint [gdb_get_line_number "s = s"]
-+gdb_continue_to_breakpoint "s = s"
-+
-+gdb_test "ptype s" {type = character\*3}
-+gdb_test "p s" " = 'foo'"
-+
-+# Fix rejected upstream:
-+# https://sourceware.org/ml/gdb-patches/2014-07/msg00768.html
-+setup_kfail "rejected" *-*-*
-+gdb_test "frame" { \(s='foo', .*}
-diff --git a/gdb/testsuite/gdb.fortran/fortran-frame-string.f90 b/gdb/testsuite/gdb.fortran/fortran-frame-string.f90
-new file mode 100644
-index 0000000..3d1576f
---- /dev/null
-+++ b/gdb/testsuite/gdb.fortran/fortran-frame-string.f90
-@@ -0,0 +1,28 @@
-+! Copyright 2014 Free Software Foundation, Inc.
-+!
-+! This program is free software; you can redistribute it and/or modify
-+! it under the terms of the GNU General Public License as published by
-+! the Free Software Foundation; either version 2 of the License, or
-+! (at your option) any later version.
-+!
-+! This program is distributed in the hope that it will be useful,
-+! but WITHOUT ANY WARRANTY; without even the implied warranty of
-+! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+! GNU General Public License for more details.
-+!
-+! You should have received a copy of the GNU General Public License
-+! along with this program; if not, write to the Free Software
-+! Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-+!
-+! Ihis file is the Fortran source file for dynamic.exp.
-+! Original file written by Jakub Jelinek <jakub(a)redhat.com>.
-+! Modified for the GDB testcase by Jan Kratochvil <jan.kratochvil(a)redhat.com>.
-+
-+ subroutine f(s)
-+ character*3 s
-+ s = s
-+ end
-+
-+ program main
-+ call f ('foo')
-+ end
diff --git a/gdb-gdb-add-index-script.patch b/gdb-gdb-add-index-script.patch
deleted file mode 100644
index da88642..0000000
--- a/gdb-gdb-add-index-script.patch
+++ /dev/null
@@ -1,171 +0,0 @@
-http://sourceware.org/ml/gdb-patches/2010-07/msg00184.html
-Subject: Re: [0/4] RFC: add DWARF index support
-
-Jan Kratochvil: Fixed $d -> $dir.
-Jan Kratochvil: Remove /dev/null redirection.
-
->>>>> "Tom" == Tom Tromey <tromey(a)redhat.com> writes:
-
-Tom> This patch series adds support for a DWARF index to gdb.
-
-Roland suggested we wrap up the index-creation code into a helper
-script.
-
-I'm not sure if this is something people would want in gdb proper, but I
-figured I would send it here just in case.
-
-Tom
-
-2010-07-09 Tom Tromey <tromey(a)redhat.com>
-
- * Makefile.in (install-only): Install gdb-add-index.
- * gdb-add-index: New file.
-
-2010-07-09 Tom Tromey <tromey(a)redhat.com>
-
- * gdb.texinfo (Index Files): Mention gdb-add-index.
-
->From 30714fe719e61baea03d0dc5793eb0d564faebb7 Mon Sep 17 00:00:00 2001
-From: Tom Tromey <tromey(a)redhat.com>
-Date: Fri, 9 Jul 2010 11:17:54 -0600
-Subject: [PATCH 4/4] add gdb-add-index
-Subject: [PATCH 4/4] add gdb-add-index
-
----
- gdb/ChangeLog | 5 +++++
- gdb/Makefile.in | 11 ++++++++++-
- gdb/doc/ChangeLog | 4 ++++
- gdb/doc/gdb.texinfo | 8 ++++++++
- gdb/gdb-add-index | 30 ++++++++++++++++++++++++++++++
- 5 files changed, 57 insertions(+), 1 deletions(-)
- create mode 100755 gdb/gdb-add-index
-
-Index: gdb-7.6.90.20140127/gdb/Makefile.in
-===================================================================
---- gdb-7.6.90.20140127.orig/gdb/Makefile.in 2014-02-06 17:37:54.555975958 +0100
-+++ gdb-7.6.90.20140127/gdb/Makefile.in 2014-02-06 17:38:52.110038415 +0100
-@@ -1093,6 +1093,15 @@ install-only: install-gstack $(CONFIG_IN
- $(INSTALL_SCRIPT) gcore \
- $(DESTDIR)$(bindir)/$$transformed_name; \
- fi
-+ transformed_name=`t='$(program_transform_name)'; \
-+ echo gdb-add-index | sed -e "$$t"` ; \
-+ if test "x$$transformed_name" = x; then \
-+ transformed_name=gdb-add-index ; \
-+ else \
-+ true ; \
-+ fi ; \
-+ $(INSTALL_PROGRAM) $(srcdir)/contrib/gdb-add-index.sh \
-+ $(DESTDIR)$(bindir)/$$transformed_name$(EXEEXT)
- @$(MAKE) DO=install "DODIRS=$(SUBDIRS)" $(FLAGS_TO_PASS) subdir_do
-
- install-strip:
-Index: gdb-7.6.90.20140127/gdb/doc/gdb.texinfo
-===================================================================
---- gdb-7.6.90.20140127.orig/gdb/doc/gdb.texinfo 2014-02-06 17:37:50.822971940 +0100
-+++ gdb-7.6.90.20140127/gdb/doc/gdb.texinfo 2014-02-06 17:37:54.565975968 +0100
-@@ -17749,6 +17749,14 @@ There are currently some limitation on i
- for DWARF debugging information, not stabs. And, they do not
- currently work for programs using Ada.
-
-+@value{GDBN} comes with a program, @command{gdb-add-index}, which can
-+be used to add the index to a symbol file. It takes the symbol file
-+as its only argument:
-+
-+@smallexample
-+$ gdb-add-index symfile
-+@end smallexample
-+
- @node Symbol Errors
- @section Errors Reading Symbol Files
-
-@@ -43878,6 +43886,7 @@ switch (die->tag)
- * gdbserver man:: Remote Server for the GNU Debugger man page
- * gcore man:: Generate a core file of a running program
- * gdbinit man:: gdbinit scripts
-+* gdb-add-index man:: Add index files to speed up GDB
- @end menu
-
- @node gdb man
-@@ -44530,6 +44539,54 @@ gdb(1), @code{info -f gdb -n Startup}
- The full documentation for @value{GDBN} is maintained as a Texinfo manual.
- If the @code{info} and @code{gdb} programs and @value{GDBN}'s Texinfo
- documentation are properly installed at your site, the command
-+
-+@smallexample
-+info gdb
-+@end smallexample
-+
-+should give you access to the complete manual.
-+
-+@cite{Using GDB: A Guide to the GNU Source-Level Debugger},
-+Richard M. Stallman and Roland H. Pesch, July 1991.
-+@end ifset
-+@c man end
-+
-+@node gdb-add-index man
-+@heading gdb-add-index
-+
-+@c man title gdb-add-index Add index files to speed up GDB
-+
-+@c man begin SYNOPSIS gdb-add-index
-+gdb-add-index @var{filename}
-+@c man end
-+
-+@c man begin DESCRIPTION gdb-add-index
-+When GDB finds a symbol file, it scans the symbols in the file in order
-+to construct an internal symbol table. This lets most GDB operations
-+work quickly--at the cost of a delay early on. For large programs,
-+this delay can be quite lengthy, so GDB provides a way to build an
-+index, which speeds up startup.
-+
-+To determine whether a file contains such an index, use the command
-+@command{readelf -S filename}: the index is stored in a section named
-+(a)code{.gdb_index}. Note that the index is never generated for files that do
-+not contain DWARF debug information (sections named @code{.debug_*}).
-+
-+See more in
-+@ifset man
-+the @value{GDBN} manual in node @code{Index Files}
-+-- shell command @code{info -f gdb -n 'Index Files'}.
-+@end ifset
-+@ifclear man
-+@ref{Index Files}.
-+@end ifclear
-+@c man end
-+
-+@c man begin SEEALSO gdb-add-index
-+@ifset man
-+The full documentation for @value{GDBN} is maintained as a Texinfo manual.
-+If the @code{info} and @code{gdb} programs and @value{GDBN}'s Texinfo
-+documentation are properly installed at your site, the command
-
- @smallexample
- info gdb
-Index: gdb-7.6.90.20140127/gdb/doc/Makefile.in
-===================================================================
---- gdb-7.6.90.20140127.orig/gdb/doc/Makefile.in 2014-02-06 17:37:50.824971942 +0100
-+++ gdb-7.6.90.20140127/gdb/doc/Makefile.in 2014-02-06 17:37:54.565975968 +0100
-@@ -165,7 +165,7 @@ POD2MAN5 = pod2man --center="GNU Develop
- --release="gdb-`sed q version.subst`" --section=5
-
- # List of man pages generated from gdb.texi
--MAN1S = gdb.1 gdbserver.1 gcore.1
-+MAN1S = gdb.1 gdbserver.1 gcore.1 gdb-add-index.1
- MAN5S = gdbinit.5
- MANS = $(MAN1S) $(MAN5S)
-
-@@ -590,6 +590,13 @@ gcore.1: $(GDB_DOC_FILES)
- mv -f $@.T$$$$ $@) || (rm -f $@.T$$$$ && exit 1)
- rm -f gcore.pod
-
-+gdb-add-index.1: $(GDB_DOC_FILES)
-+ touch $@
-+ -$(TEXI2POD) $(MANCONF) -Dgdb-add-index < $(srcdir)/gdb.texinfo > gdb-add-index.pod
-+ -($(POD2MAN1) gdb-add-index.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \
-+ mv -f $@.T$$$$ $@) || (rm -f $@.T$$$$ && exit 1)
-+ rm -f gdb-add-index.pod
-+
- gdbinit.5: $(GDB_DOC_FILES)
- touch $@
- -$(TEXI2POD) $(MANCONF) -Dgdbinit < $(srcdir)/gdb.texinfo > gdbinit.pod
diff --git a/gdb-glibc-strstr-workaround.patch b/gdb-glibc-strstr-workaround.patch
index d3418f3..e850792 100644
--- a/gdb-glibc-strstr-workaround.patch
+++ b/gdb-glibc-strstr-workaround.patch
@@ -1,8 +1,23 @@
-Index: gdb-7.7.90.20140613/gdb/dwarf2read.c
-===================================================================
---- gdb-7.7.90.20140613.orig/gdb/dwarf2read.c 2014-06-13 21:56:54.744653443 +0200
-+++ gdb-7.7.90.20140613/gdb/dwarf2read.c 2014-06-13 22:01:51.529990684 +0200
-@@ -17695,6 +17695,26 @@ new_symbol_full (struct die_info *die, s
+From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
+From: Fedora GDB patches <invalid(a)email.com>
+Date: Fri, 27 Oct 2017 21:07:50 +0200
+Subject: gdb-glibc-strstr-workaround.patch
+
+FileName: gdb-glibc-strstr-workaround.patch
+
+;; Workaround PR libc/14166 for inferior calls of strstr.
+;;=fedora: Compatibility with RHELs (unchecked which ones).
+---
+ gdb/dwarf2read.c | 20 ++++
+ .../gdb.base/gnu-ifunc-strstr-workaround.exp | 108 +++++++++++++++++++++
+ 2 files changed, 128 insertions(+)
+ create mode 100644 gdb/testsuite/gdb.base/gnu-ifunc-strstr-workaround.exp
+
+diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c
+index 86d496312e..babe659539 100644
+--- a/gdb/dwarf2read.c
++++ b/gdb/dwarf2read.c
+@@ -21330,6 +21330,26 @@ new_symbol_full (struct die_info *die, struct type *type, struct dwarf2_cu *cu,
/* Cache this symbol's name and the name's demangled form (if any). */
SYMBOL_SET_LANGUAGE (sym, cu->language, &objfile->objfile_obstack);
linkagename = dwarf2_physname (name, die, cu);
@@ -29,10 +44,11 @@ Index: gdb-7.7.90.20140613/gdb/dwarf2read.c
SYMBOL_SET_NAMES (sym, linkagename, strlen (linkagename), 0, objfile);
/* Fortran does not have mangling standard and the mangling does differ
-Index: gdb-7.7.90.20140613/gdb/testsuite/gdb.base/gnu-ifunc-strstr-workaround.exp
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ gdb-7.7.90.20140613/gdb/testsuite/gdb.base/gnu-ifunc-strstr-workaround.exp 2014-06-13 21:59:41.174840871 +0200
+diff --git a/gdb/testsuite/gdb.base/gnu-ifunc-strstr-workaround.exp b/gdb/testsuite/gdb.base/gnu-ifunc-strstr-workaround.exp
+new file mode 100644
+index 0000000000..5469cd7354
+--- /dev/null
++++ b/gdb/testsuite/gdb.base/gnu-ifunc-strstr-workaround.exp
@@ -0,0 +1,108 @@
+# Copyright (C) 2012 Free Software Foundation, Inc.
+
@@ -142,3 +158,6 @@ Index: gdb-7.7.90.20140613/gdb/testsuite/gdb.base/gnu-ifunc-strstr-workaround.ex
+
+gdb_test {print strstr("abc","b")} { = 0x[0-9a-f]+ "bc"}
+gdb_test {print strstr("def","e")} { = 0x[0-9a-f]+ "ef"}
+--
+2.14.3
+
diff --git a/gdb-glibc-vdso-workaround.patch b/gdb-glibc-vdso-workaround.patch
deleted file mode 100644
index 601cf2a..0000000
--- a/gdb-glibc-vdso-workaround.patch
+++ /dev/null
@@ -1,31 +0,0 @@
-http://sourceware.org/ml/gdb-patches/2011-08/msg00331.html
-Subject: [RFC] Work around PR libc/13097 "linux-vdso.so.1" #2
-
-Hi,
-
-missed the x86_64-m32 case:
-
-gdb/
-2011-08-16 Jan Kratochvil <jan.kratochvil(a)redhat.com>
-
- Work around PR libc/13097.
- * solib.c (update_solib_list): Ignore "linux-vdso.so.1".
-
-Index: gdb-7.9.50.20150520/gdb/solib.c
-===================================================================
---- gdb-7.9.50.20150520.orig/gdb/solib.c 2015-05-31 17:04:16.870802493 +0200
-+++ gdb-7.9.50.20150520/gdb/solib.c 2015-05-31 17:04:38.824941054 +0200
-@@ -893,8 +893,11 @@ update_solib_list (int from_tty, struct
-
- TRY
- {
-- /* Fill in the rest of the `struct so_list' node. */
-- if (!solib_map_sections (i))
-+ /* Fill in the rest of the `struct so_list' node.
-+ Work around PR libc/13097. */
-+ if (!solib_map_sections (i)
-+ && strcmp (i->so_original_name, "linux-vdso.so.1") != 0
-+ && strcmp (i->so_original_name, "linux-gate.so.1") != 0)
- {
- not_found++;
- if (not_found_filename == NULL)
diff --git a/gdb-gnat-dwarf-crash-3of3.patch b/gdb-gnat-dwarf-crash-3of3.patch
index 3f57fd3..559a867 100644
--- a/gdb-gnat-dwarf-crash-3of3.patch
+++ b/gdb-gnat-dwarf-crash-3of3.patch
@@ -1,6 +1,14 @@
-http://sourceware.org/ml/gdb-patches/2014-02/msg00731.html
-Subject: [patch] gdb_assert -> complaint for weird DWARF
+From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
+From: Fedora GDB patches <invalid(a)email.com>
+Date: Fri, 27 Oct 2017 21:07:50 +0200
+Subject: gdb_assert -> complaint for weird DWARF
+
+FileName: gdb-gnat-dwarf-crash-3of3.patch
+;; Fix crash of -readnow /usr/lib/debug/usr/bin/gnatbind.debug (BZ 1069211).
+;;=push+jan
+
+http://sourceware.org/ml/gdb-patches/2014-02/msg00731.html
--6TrnltStXW4iwmi0
Content-Type: text/plain; charset=us-ascii
@@ -21,7 +29,6 @@ Fedora GCC build, not in FSF GCC build, more info at:
https://bugzilla.redhat.com/show_bug.cgi?id=1069382
http://people.redhat.com/jkratoch/gcc-debuginfo-4.8.2-7.fc20.x86_64-gnatb...
-
Thanks,
Jan
@@ -33,26 +40,29 @@ gdb/
2014-02-24 Jan Kratochvil <jan.kratochvil(a)redhat.com>
* dwarf2read.c (process_die): Change gdb_assert to complaint.
+---
+ gdb/dwarf2read.c | 8 ++++++++
+ 1 file changed, 8 insertions(+)
diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c
-index 3eaa0b1..71f5d34 100644
+index 1a62c58614..ebded1753f 100644
--- a/gdb/dwarf2read.c
+++ b/gdb/dwarf2read.c
-@@ -8029,7 +8029,13 @@ process_die (struct die_info *die, struct dwarf2_cu *cu)
- struct cleanup *in_process;
-
- /* We should only be processing those not already in process. */
-- gdb_assert (!die->in_process);
+@@ -10614,6 +10614,14 @@ private:
+ static void
+ process_die (struct die_info *die, struct dwarf2_cu *cu)
+ {
+ if (die->in_process)
+ {
+ complaint (&symfile_complaints,
+ _("DIE at 0x%x attempted to be processed twice"),
-+ die->offset.sect_off);
++ to_underlying (die->sect_off));
+ return;
+ }
++
+ process_die_scope scope (die, cu);
- die->in_process = 1;
- in_process = make_cleanup (reset_die_in_process,die);
-
---6TrnltStXW4iwmi0--
+ switch (die->tag)
+--
+2.14.3
diff --git a/gdb-jit-reader-multilib.patch b/gdb-jit-reader-multilib.patch
index 04aa397..6c83848 100644
--- a/gdb-jit-reader-multilib.patch
+++ b/gdb-jit-reader-multilib.patch
@@ -1,8 +1,22 @@
+From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
+From: Fedora GDB patches <invalid(a)email.com>
+Date: Fri, 27 Oct 2017 21:07:50 +0200
+Subject: gdb-jit-reader-multilib.patch
+
+FileName: gdb-jit-reader-multilib.patch
+
+;; Fix jit-reader.h for multi-lib.
+;;=push+jan
+---
+ gdb/configure | 8 +++++---
+ gdb/configure.ac | 8 +++++---
+ 2 files changed, 10 insertions(+), 6 deletions(-)
+
diff --git a/gdb/configure b/gdb/configure
-index 7ff74ba..00a5b5b 100755
+index aa944a08c4..dbae54b42c 100755
--- a/gdb/configure
+++ b/gdb/configure
-@@ -7382,10 +7382,12 @@ _ACEOF
+@@ -9528,10 +9528,12 @@ _ACEOF
@@ -19,10 +33,10 @@ index 7ff74ba..00a5b5b 100755
TARGET_PTR="unsigned __int128"
else
diff --git a/gdb/configure.ac b/gdb/configure.ac
-index ec776d7..c02ace9 100644
+index 1b6c4d77c3..e94280f773 100644
--- a/gdb/configure.ac
+++ b/gdb/configure.ac
-@@ -648,10 +648,12 @@ AC_CHECK_SIZEOF(unsigned long long)
+@@ -832,10 +832,12 @@ AC_CHECK_SIZEOF(unsigned long long)
AC_CHECK_SIZEOF(unsigned long)
AC_CHECK_SIZEOF(unsigned __int128)
@@ -38,3 +52,6 @@ index ec776d7..c02ace9 100644
elif test "x${ac_cv_sizeof_unsigned___int128}" = "x16"; then
TARGET_PTR="unsigned __int128"
else
+--
+2.14.3
+
diff --git a/gdb-libexec-add-index.patch b/gdb-libexec-add-index.patch
index 8ca579f..f127bab 100644
--- a/gdb-libexec-add-index.patch
+++ b/gdb-libexec-add-index.patch
@@ -1,5 +1,18 @@
+From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
+From: Fedora GDB patches <invalid(a)email.com>
+Date: Fri, 27 Oct 2017 21:07:50 +0200
+Subject: gdb-libexec-add-index.patch
+
+FileName: gdb-libexec-add-index.patch
+
+;; Fix gdb-headless /usr/bin/ executables (BZ 1390251).
+;;=fedora
+---
+ gdb/contrib/gdb-add-index.sh | 5 +++++
+ 1 file changed, 5 insertions(+)
+
diff --git a/gdb/contrib/gdb-add-index.sh b/gdb/contrib/gdb-add-index.sh
-index cca7153..73181ec 100755
+index 71146966ab..500b2f62d5 100755
--- a/gdb/contrib/gdb-add-index.sh
+++ b/gdb/contrib/gdb-add-index.sh
@@ -21,6 +21,11 @@
@@ -14,3 +27,6 @@ index cca7153..73181ec 100755
myname="${0##*/}"
if test $# != 1; then
+--
+2.14.3
+
diff --git a/gdb-linux_perf-bundle.patch b/gdb-linux_perf-bundle.patch
index ead3758..1210bea 100644
--- a/gdb-linux_perf-bundle.patch
+++ b/gdb-linux_perf-bundle.patch
@@ -1,7 +1,73 @@
-Index: gdb-7.11.90.20160904/gdb/nat/linux-btrace.h
-===================================================================
---- gdb-7.11.90.20160904.orig/gdb/nat/linux-btrace.h 2016-09-04 04:02:13.000000000 +0200
-+++ gdb-7.11.90.20160904/gdb/nat/linux-btrace.h 2016-09-04 20:11:47.375275492 +0200
+From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
+From: Fedora GDB patches <invalid(a)email.com>
+Date: Fri, 27 Oct 2017 21:07:50 +0200
+Subject: gdb-linux_perf-bundle.patch
+
+FileName: gdb-linux_perf-bundle.patch
+
+;; [dts+el7] [x86*] Bundle linux_perf.h for libipt (RH BZ 1256513).
+;;=fedora
+---
+ gdb/configure | 2 +-
+ gdb/configure.ac | 2 +-
+ gdb/gdb.c | 8 +++
+ gdb/nat/linux-btrace.h | 171 +++++++++++++++++++++++++++++++++++++++++++++++++
+ 4 files changed, 181 insertions(+), 2 deletions(-)
+
+diff --git a/gdb/configure b/gdb/configure
+index fcd2efd4d7..26f5259b64 100755
+--- a/gdb/configure
++++ b/gdb/configure
+@@ -11907,7 +11907,7 @@ else
+
+ #include <linux/perf_event.h>
+ #ifndef PERF_ATTR_SIZE_VER5
+-# error
++// error // PERF_ATTR_SIZE_VER5_BUNDLE is not available here - Fedora+RHEL
+ #endif
+
+ _ACEOF
+diff --git a/gdb/configure.ac b/gdb/configure.ac
+index ec82a09a0b..6a07648239 100644
+--- a/gdb/configure.ac
++++ b/gdb/configure.ac
+@@ -1466,7 +1466,7 @@ else
+ AC_PREPROC_IFELSE(AC_LANG_SOURCE([[
+ #include <linux/perf_event.h>
+ #ifndef PERF_ATTR_SIZE_VER5
+-# error
++// error // PERF_ATTR_SIZE_VER5_BUNDLE is not available here - Fedora+RHEL
+ #endif
+ ]]), [perf_event=yes], [perf_event=no])
+ if test "$perf_event" != yes; then
+diff --git a/gdb/gdb.c b/gdb/gdb.c
+index b97500e579..151545105c 100644
+--- a/gdb/gdb.c
++++ b/gdb/gdb.c
+@@ -20,11 +20,19 @@
+ #include "main.h"
+ #include "interps.h"
+
++#ifdef PERF_ATTR_SIZE_VER5_BUNDLE
++extern "C" void __libipt_init(void);
++#endif
++
+ int
+ main (int argc, char **argv)
+ {
+ struct captured_main_args args;
+
++#ifdef PERF_ATTR_SIZE_VER5_BUNDLE
++ __libipt_init();
++#endif
++
+ memset (&args, 0, sizeof args);
+ args.argc = argc;
+ args.argv = argv;
+diff --git a/gdb/nat/linux-btrace.h b/gdb/nat/linux-btrace.h
+index 31a8d9e67b..72faf23c5f 100644
+--- a/gdb/nat/linux-btrace.h
++++ b/gdb/nat/linux-btrace.h
@@ -28,6 +28,177 @@
# include <linux/perf_event.h>
#endif
@@ -180,53 +246,6 @@ Index: gdb-7.11.90.20160904/gdb/nat/linux-btrace.h
struct target_ops;
#if HAVE_LINUX_PERF_EVENT_H
-Index: gdb-7.11.90.20160904/gdb/configure
-===================================================================
---- gdb-7.11.90.20160904.orig/gdb/configure 2016-09-04 20:11:47.238274285 +0200
-+++ gdb-7.11.90.20160904/gdb/configure 2016-09-04 20:11:47.378275519 +0200
-@@ -10601,7 +10601,7 @@
-
- #include <linux/perf_event.h>
- #ifndef PERF_ATTR_SIZE_VER5
--# error
-+// error // PERF_ATTR_SIZE_VER5_BUNDLE is not available here - Fedora+RHEL
- #endif
-
- _ACEOF
-Index: gdb-7.11.90.20160904/gdb/configure.ac
-===================================================================
---- gdb-7.11.90.20160904.orig/gdb/configure.ac 2016-09-04 20:11:47.238274285 +0200
-+++ gdb-7.11.90.20160904/gdb/configure.ac 2016-09-04 20:11:47.379275528 +0200
-@@ -1461,7 +1461,7 @@
- AC_PREPROC_IFELSE(AC_LANG_SOURCE([[
- #include <linux/perf_event.h>
- #ifndef PERF_ATTR_SIZE_VER5
--# error
-+// error // PERF_ATTR_SIZE_VER5_BUNDLE is not available here - Fedora+RHEL
- #endif
- ]]), [perf_event=yes], [perf_event=no])
- if test "$perf_event" != yes; then
-Index: gdb-7.11.90.20160904/gdb/gdb.c
-===================================================================
---- gdb-7.11.90.20160904.orig/gdb/gdb.c 2016-09-04 04:02:13.000000000 +0200
-+++ gdb-7.11.90.20160904/gdb/gdb.c 2016-09-04 20:12:28.018633552 +0200
-@@ -20,11 +20,19 @@
- #include "main.h"
- #include "interps.h"
-
-+#ifdef PERF_ATTR_SIZE_VER5_BUNDLE
-+extern "C" void __libipt_init(void);
-+#endif
-+
- int
- main (int argc, char **argv)
- {
- struct captured_main_args args;
-
-+#ifdef PERF_ATTR_SIZE_VER5_BUNDLE
-+ __libipt_init();
-+#endif
-+
- memset (&args, 0, sizeof args);
- args.argc = argc;
- args.argv = argv;
+--
+2.14.3
+
diff --git a/gdb-moribund-utrace-workaround.patch b/gdb-moribund-utrace-workaround.patch
index 6b50a8e..fcdb2d4 100644
--- a/gdb-moribund-utrace-workaround.patch
+++ b/gdb-moribund-utrace-workaround.patch
@@ -1,11 +1,26 @@
+From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
+From: Fedora GDB patches <invalid(a)email.com>
+Date: Fri, 27 Oct 2017 21:07:50 +0200
+Subject: gdb-moribund-utrace-workaround.patch
+
+FileName: gdb-moribund-utrace-workaround.patch
+
+;; Workaround non-stop moribund locations exploited by kernel utrace (BZ 590623).
+;;=push+jan: Currently it is still not fully safe.
+
https://bugzilla.redhat.com/show_bug.cgi?id=590623
http://sources.redhat.com/bugzilla/show_bug.cgi?id=11593
Bug in FSF GDB exploited by the ptrace-on-utrace interaction.
+---
+ gdb/breakpoint.c | 2 ++
+ 1 file changed, 2 insertions(+)
+diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c
+index 5a99de75e1..6a0c15b239 100644
--- a/gdb/breakpoint.c
+++ b/gdb/breakpoint.c
-@@ -9084,6 +9084,8 @@ update_global_location_list (int should_insert)
+@@ -12089,6 +12089,8 @@ update_global_location_list (enum ugll_insert_mode insert_mode)
traps we can no longer explain. */
old_loc->events_till_retirement = 3 * (thread_count () + 1);
@@ -14,3 +29,6 @@ Bug in FSF GDB exploited by the ptrace-on-utrace interaction.
old_loc->owner = NULL;
VEC_safe_push (bp_location_p, moribund_locations, old_loc);
+--
+2.14.3
+
diff --git a/gdb-pahole-python2.patch b/gdb-pahole-python2.patch
deleted file mode 100644
index 473a32e..0000000
--- a/gdb-pahole-python2.patch
+++ /dev/null
@@ -1,36 +0,0 @@
-diff --git a/gdb/python/lib/gdb/command/pahole.py b/gdb/python/lib/gdb/command/pahole.py
-index e08eaf5..56c1737 100644
---- a/gdb/python/lib/gdb/command/pahole.py
-+++ b/gdb/python/lib/gdb/command/pahole.py
-@@ -55,19 +55,19 @@ It prints the type and displays comments showing where holes are."""
- fieldsize = 8 * ftype.sizeof
-
- # TARGET_CHAR_BIT
-- print (' /* %3d %3d */' % (int (bitpos / 8), int (fieldsize / 8)), end = "")
-+ print (' /* %3d %3d */' % (int (bitpos / 8), int (fieldsize / 8))),
- bitpos = bitpos + fieldsize
-
- if ftype.code == gdb.TYPE_CODE_STRUCT:
- self.pahole (ftype, level + 1, field.name)
- else:
-- print (' ' * (2 + 2 * level), end = "")
-+ print (' ' * (2 + 2 * level)),
- print ('%s %s' % (str (ftype), field.name))
-
- if level == 0:
- self.maybe_print_hole(bitpos, 8 * type.sizeof)
-
-- print (' ' * (14 + 2 * level), end = "")
-+ print (' ' * (14 + 2 * level)),
- print ('} %s' % name)
-
- def invoke (self, arg, from_tty):
-@@ -75,7 +75,7 @@ It prints the type and displays comments showing where holes are."""
- type = type.strip_typedefs ()
- if type.code != gdb.TYPE_CODE_STRUCT:
- raise (TypeError, '%s is not a struct type' % arg)
-- print (' ' * 14, end = "")
-+ print (' ' * 14),
- self.pahole (type, 0, '')
-
- Pahole()
diff --git a/gdb-python-gil.patch b/gdb-python-gil.patch
new file mode 100644
index 0000000..b5faf74
--- /dev/null
+++ b/gdb-python-gil.patch
@@ -0,0 +1,262 @@
+From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
+From: Fedora GDB patches <invalid(a)email.com>
+Date: Fri, 27 Oct 2017 21:07:50 +0200
+Subject: gdb-python-gil.patch
+
+FileName: gdb-python-gil.patch
+
+;; Fix Python GIL with gdb.execute("continue") (Phil Muldoon, BZ 1116957).
+;;=push
+---
+ gdb/doc/python.texi | 8 ++++
+ gdb/python/python-internal.h | 2 +
+ gdb/python/python.c | 42 +++++++++++++++---
+ gdb/testsuite/gdb.python/py-gil-mthread.c | 13 ++++++
+ gdb/testsuite/gdb.python/py-gil-mthread.exp | 69 +++++++++++++++++++++++++++++
+ gdb/testsuite/gdb.python/py-gil-mthread.py | 28 ++++++++++++
+ 6 files changed, 157 insertions(+), 5 deletions(-)
+ create mode 100644 gdb/testsuite/gdb.python/py-gil-mthread.c
+ create mode 100644 gdb/testsuite/gdb.python/py-gil-mthread.exp
+ create mode 100644 gdb/testsuite/gdb.python/py-gil-mthread.py
+
+diff --git a/gdb/doc/python.texi b/gdb/doc/python.texi
+index ebd48fffe7..ccf011e35e 100644
+--- a/gdb/doc/python.texi
++++ b/gdb/doc/python.texi
+@@ -232,6 +232,14 @@ returned as a string. The default is @code{False}, in which case the
+ return value is @code{None}. If @var{to_string} is @code{True}, the
+ @value{GDBN} virtual terminal will be temporarily set to unlimited width
+ and height, and its pagination will be disabled; @pxref{Screen Size}.
++
++The @var{release_gil} flag specifies whether @value{GDBN} ought to
++release the Python GIL before executing the command. This is useful
++in multi-threaded Python programs where by default the Python
++interpreter will acquire the GIL and lock other threads from
++executing. After the command has completed executing in @value{GDBN}
++the Python GIL is reacquired. This flag must be a boolean value. If
++omitted, it defaults to @code{False}.
+ @end defun
+
+ @findex gdb.breakpoints
+diff --git a/gdb/python/python-internal.h b/gdb/python/python-internal.h
+index f32a258209..4556323472 100644
+--- a/gdb/python/python-internal.h
++++ b/gdb/python/python-internal.h
+@@ -142,6 +142,8 @@ typedef int Py_ssize_t;
+ #define PyGILState_Release(ARG) ((void)(ARG))
+ #define PyEval_InitThreads()
+ #define PyThreadState_Swap(ARG) ((void)(ARG))
++#define PyEval_SaveThread() ((void)(ARG))
++#define PyEval_RestoreThread(ARG) ((void)(ARG))
+ #define PyEval_ReleaseLock()
+ #endif
+
+diff --git a/gdb/python/python.c b/gdb/python/python.c
+index 4844c86c54..610dda828c 100644
+--- a/gdb/python/python.c
++++ b/gdb/python/python.c
+@@ -554,12 +554,16 @@ execute_gdb_command (PyObject *self, PyObject *args, PyObject *kw)
+ {
+ const char *arg;
+ PyObject *from_tty_obj = NULL, *to_string_obj = NULL;
+- int from_tty, to_string;
+- static const char *keywords[] = { "command", "from_tty", "to_string", NULL };
++ int from_tty, to_string, release_gil;
++ static const char *keywords[] = {"command", "from_tty", "to_string", "release_gil", NULL };
++ PyObject *release_gil_obj = NULL;
++ /* Initialize it just to avoid a GCC false warning. */
++ PyThreadState *state = NULL;
+
+- if (!gdb_PyArg_ParseTupleAndKeywords (args, kw, "s|O!O!", keywords, &arg,
++ if (!gdb_PyArg_ParseTupleAndKeywords (args, kw, "s|O!O!O!", keywords, &arg,
+ &PyBool_Type, &from_tty_obj,
+- &PyBool_Type, &to_string_obj))
++ &PyBool_Type, &to_string_obj,
++ &PyBool_Type, &release_gil_obj))
+ return NULL;
+
+ from_tty = 0;
+@@ -580,12 +584,28 @@ execute_gdb_command (PyObject *self, PyObject *args, PyObject *kw)
+ to_string = cmp;
+ }
+
++ release_gil = 0;
++ if (release_gil_obj)
++ {
++ int cmp = PyObject_IsTrue (release_gil_obj);
++ if (cmp < 0)
++ return NULL;
++ release_gil = cmp;
++ }
++
+ std::string to_string_res;
+
+ TRY
+ {
+ struct interp *interp;
+
++ /* In the case of long running GDB commands, allow the user to
++ release the Python GIL acquired by Python. Restore the GIL
++ after the command has completed before handing back to
++ Python. */
++ if (release_gil)
++ state = PyEval_SaveThread();
++
+ scoped_restore save_async = make_scoped_restore (¤t_ui->async, 0);
+
+ scoped_restore save_uiout = make_scoped_restore (¤t_uiout);
+@@ -600,10 +620,22 @@ execute_gdb_command (PyObject *self, PyObject *args, PyObject *kw)
+ to_string_res = execute_command_to_string (arg, from_tty);
+ else
+ execute_command (arg, from_tty);
++
++ /* Reacquire the GIL if it was released earlier. */
++ if (release_gil)
++ PyEval_RestoreThread (state);
+ }
+ CATCH (except, RETURN_MASK_ALL)
+ {
+- GDB_PY_HANDLE_EXCEPTION (except);
++ if (except.reason < 0)
++ {
++ /* Reacquire the GIL if it was released earlier. */
++ if (release_gil)
++ PyEval_RestoreThread (state);
++
++ gdbpy_convert_exception (except);
++ return NULL;
++ }
+ }
+ END_CATCH
+
+diff --git a/gdb/testsuite/gdb.python/py-gil-mthread.c b/gdb/testsuite/gdb.python/py-gil-mthread.c
+new file mode 100644
+index 0000000000..1a12fc9c6d
+--- /dev/null
++++ b/gdb/testsuite/gdb.python/py-gil-mthread.c
+@@ -0,0 +1,13 @@
++#include <stdio.h>
++#include <unistd.h>
++
++int
++main (void)
++{
++ int i;
++ for (i = 0; i < 10; i++)
++ {
++ sleep (1); /* break-here */
++ printf ("Sleeping %d\n", i);
++ }
++}
+diff --git a/gdb/testsuite/gdb.python/py-gil-mthread.exp b/gdb/testsuite/gdb.python/py-gil-mthread.exp
+new file mode 100644
+index 0000000000..a89c16a45b
+--- /dev/null
++++ b/gdb/testsuite/gdb.python/py-gil-mthread.exp
+@@ -0,0 +1,69 @@
++# Copyright (C) 2014 Free Software Foundation, Inc.
++
++# This program is free software; you can redistribute it and/or modify
++# it under the terms of the GNU General Public License as published by
++# the Free Software Foundation; either version 3 of the License, or
++# (at your option) any later version.
++#
++# This program is distributed in the hope that it will be useful,
++# but WITHOUT ANY WARRANTY; without even the implied warranty of
++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++# GNU General Public License for more details.
++#
++# You should have received a copy of the GNU General Public License
++# along with this program. If not, see <http://www.gnu.org/licenses/>.
++
++standard_testfile .c .py
++set executable $testfile
++
++if { [prepare_for_testing $testfile.exp $executable $srcfile] } {
++ return -1
++}
++
++# Skip all tests if Python scripting is not enabled.
++if { [skip_python_tests] } { continue }
++
++if ![runto_main] {
++ return -1
++}
++
++gdb_breakpoint $srcfile:[gdb_get_line_number "break-here"] temporary
++gdb_continue_to_breakpoint "break-here" ".* break-here .*"
++
++set test "response"
++set timeout 60
++set sleeping_last -1
++set hello_last 0
++set minimal 5
++gdb_test_multiple "python exec (open ('$srcdir/$subdir/$srcfile2').read ())" $test {
++ -re "Error: unable to start thread\r\n" {
++ fail $test
++ # Not $gdb_prompt-synced!
++ }
++ -re "Sleeping (\[0-9\]+)\r\n" {
++ set n $expect_out(1,string)
++ if { $sleeping_last + 1 != $n } {
++ fail $test
++ } else {
++ set sleeping_last $n
++ if { $sleeping_last >= $minimal && $hello_last >= $minimal } {
++ pass $test
++ } else {
++ exp_continue
++ }
++ }
++ }
++ -re "Hello \\( (\[0-9\]+) \\)\r\n" {
++ set n $expect_out(1,string)
++ if { $hello_last + 1 != $n } {
++ fail $test
++ } else {
++ set hello_last $n
++ if { $sleeping_last >= $minimal && $hello_last >= $minimal } {
++ pass $test
++ } else {
++ exp_continue
++ }
++ }
++ }
++}
+diff --git a/gdb/testsuite/gdb.python/py-gil-mthread.py b/gdb/testsuite/gdb.python/py-gil-mthread.py
+new file mode 100644
+index 0000000000..6a89964139
+--- /dev/null
++++ b/gdb/testsuite/gdb.python/py-gil-mthread.py
+@@ -0,0 +1,28 @@
++try:
++ import thread
++except:
++ import _thread
++import time
++import gdb
++
++# Define a function for the thread
++def print_thread_hello():
++ count = 0
++ while count < 10:
++ time.sleep(1)
++ count += 1
++ print ("Hello ( %d )" % count)
++
++# Create a threads a continue
++try:
++ thread.start_new_thread (print_thread_hello, ())
++ gdb.execute ("continue", release_gil=True)
++except:
++ try:
++ _thread.start_new_thread (print_thread_hello, ())
++ gdb.execute ("continue", release_gil=True)
++ except:
++ print ("Error: unable to start thread")
++
++while 1:
++ pass
+--
+2.14.3
+
diff --git a/gdb-readline62-ask-more-rh.patch b/gdb-readline62-ask-more-rh.patch
index 463d9d3..f59b01b 100644
--- a/gdb-readline62-ask-more-rh.patch
+++ b/gdb-readline62-ask-more-rh.patch
@@ -1,8 +1,21 @@
-Index: gdb-7.11.50.20160630/gdb/event-top.c
-===================================================================
---- gdb-7.11.50.20160630.orig/gdb/event-top.c 2016-07-03 16:32:36.108342159 +0200
-+++ gdb-7.11.50.20160630/gdb/event-top.c 2016-07-03 16:32:59.787523733 +0200
-@@ -1252,6 +1252,13 @@
+From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
+From: Fedora GDB patches <invalid(a)email.com>
+Date: Fri, 27 Oct 2017 21:07:50 +0200
+Subject: gdb-readline62-ask-more-rh.patch
+
+FileName: gdb-readline62-ask-more-rh.patch
+
+;; Work around readline-6.2 incompatibility not asking for --more-- (BZ 701131).
+;;=fedora
+---
+ gdb/event-top.c | 7 +++++++
+ 1 file changed, 7 insertions(+)
+
+diff --git a/gdb/event-top.c b/gdb/event-top.c
+index 0d668f35e0..4aa26125f9 100644
+--- a/gdb/event-top.c
++++ b/gdb/event-top.c
+@@ -1183,6 +1183,13 @@ gdb_setup_readline (int editing)
{
struct ui *ui = current_ui;
@@ -16,3 +29,6 @@ Index: gdb-7.11.50.20160630/gdb/event-top.c
/* This function is a noop for the sync case. The assumption is
that the sync setup is ALL done in gdb_init, and we would only
mess it up here. The sync stuff should really go away over
+--
+2.14.3
+
diff --git a/gdb-rhbz1007614-memleak-infpy_read_memory-test.patch b/gdb-rhbz1007614-memleak-infpy_read_memory-test.patch
deleted file mode 100644
index d0aedd7..0000000
--- a/gdb-rhbz1007614-memleak-infpy_read_memory-test.patch
+++ /dev/null
@@ -1,162 +0,0 @@
-Original message by Tom Tromey:
-
- <https://sourceware.org/ml/gdb-patches/2012-03/msg00955.html>
- Message-ID: <871uoc1va3.fsf(a)fleche.redhat.com>
-
-Comment from Sergio Durigan Junior:
-
- In order to correctly test this patch, I wrote a testcase based on Jan
- Kratochvil's <gdb/testsuite/gdb.base/gcore-excessive-memory.exp>. The
- testcase, which can be seen below, tests GDB in order to see if the
- amount of memory being leaked is minimal, as requested in the bugzilla.
- It is hard to define what "minimum" is, so I ran the testcase on all
- supported RHEL architectures and came up with an average.
-
-commit cc0265cdda9dc7e8665e8bfcf5b4477489daf27c
-Author: Tom Tromey <tromey(a)redhat.com>
-Date: Wed Mar 28 17:38:08 2012 +0000
-
- * python/py-inferior.c (infpy_read_memory): Remove cleanups and
- explicitly free 'buffer' on exit paths. Decref 'membuf_object'
- before returning.
-
-Index: gdb-7.2/gdb/testsuite/gdb.python/py-gdb-rhbz1007614-memleak-infpy_read_memory.c
-===================================================================
---- /dev/null
-+++ gdb-7.2/gdb/testsuite/gdb.python/py-gdb-rhbz1007614-memleak-infpy_read_memory.c
-@@ -0,0 +1,27 @@
-+/* This testcase is part of GDB, the GNU debugger.
-+
-+ Copyright 2014 Free Software Foundation, Inc.
-+
-+ This program is free software; you can redistribute it and/or modify
-+ it under the terms of the GNU General Public License as published by
-+ the Free Software Foundation; either version 3 of the License, or
-+ (at your option) any later version.
-+
-+ This program is distributed in the hope that it will be useful,
-+ but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ GNU General Public License for more details.
-+
-+ You should have received a copy of the GNU General Public License
-+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
-+
-+static struct x
-+ {
-+ char unsigned u[4096];
-+ } x, *px = &x;
-+
-+int
-+main (int argc, char *argv[])
-+{
-+ return 0;
-+}
-Index: gdb-7.2/gdb/testsuite/gdb.python/py-gdb-rhbz1007614-memleak-infpy_read_memory.exp
-===================================================================
---- /dev/null
-+++ gdb-7.2/gdb/testsuite/gdb.python/py-gdb-rhbz1007614-memleak-infpy_read_memory.exp
-@@ -0,0 +1,68 @@
-+# Copyright 2014 Free Software Foundation, Inc.
-+
-+# This program is free software; you can redistribute it and/or modify
-+# it under the terms of the GNU General Public License as published by
-+# the Free Software Foundation; either version 3 of the License, or
-+# (at your option) any later version.
-+#
-+# This program is distributed in the hope that it will be useful,
-+# but WITHOUT ANY WARRANTY; without even the implied warranty of
-+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+# GNU General Public License for more details.
-+#
-+# You should have received a copy of the GNU General Public License
-+# along with this program. If not, see <http://www.gnu.org/licenses/>.
-+
-+set testfile py-gdb-rhbz1007614-memleak-infpy_read_memory
-+set srcfile ${testfile}.c
-+set binfile [standard_output_file ${testfile}]
-+
-+if { [prepare_for_testing ${testfile}.exp ${testfile} ${srcfile}] } {
-+ return -1
-+}
-+
-+if { [skip_python_tests] } { continue }
-+
-+set pid_of_gdb [exp_pid -i [board_info host fileid]]
-+
-+proc memory_v_pages_get {} {
-+ global pid_of_gdb
-+ set fd [open "/proc/$pid_of_gdb/statm"]
-+ gets $fd line
-+ close $fd
-+ # number of pages of virtual memory
-+ scan $line "%d" drs
-+ return $drs
-+}
-+
-+if { ![runto_main] } {
-+ untested $testfile.exp
-+ return -1
-+}
-+
-+set remote_python_file [remote_download host ${srcdir}/${subdir}/${testfile}.py]
-+
-+gdb_test "source ${remote_python_file}" ""
-+
-+gdb_test "hello-world" ""
-+
-+set kbytes_before [memory_v_pages_get]
-+verbose -log "kbytes_before = $kbytes_before"
-+
-+gdb_test "hello-world" ""
-+
-+set kbytes_after [memory_v_pages_get]
-+verbose -log "kbytes_after = $kbytes_after"
-+
-+set kbytes_diff [expr $kbytes_after - $kbytes_before]
-+verbose -log "kbytes_diff = $kbytes_diff"
-+
-+# The value "1000" was calculated by running a few GDB sessions with this
-+# testcase, and seeing how much (in average) the memory consumption
-+# increased after the "hello-world" command issued above. The average
-+# was around 500 bytes, so I chose 1000 as a high estimate.
-+if { $kbytes_diff > 1000 } {
-+ fail "there is a memory leak on GDB (RHBZ 1007614)"
-+} else {
-+ pass "there is not a memory leak on GDB (RHBZ 1007614)"
-+}
-Index: gdb-7.2/gdb/testsuite/gdb.python/py-gdb-rhbz1007614-memleak-infpy_read_memory.py
-===================================================================
---- /dev/null
-+++ gdb-7.2/gdb/testsuite/gdb.python/py-gdb-rhbz1007614-memleak-infpy_read_memory.py
-@@ -0,0 +1,30 @@
-+# Copyright (C) 2014 Free Software Foundation, Inc.
-+
-+# This program is free software; you can redistribute it and/or modify
-+# it under the terms of the GNU General Public License as published by
-+# the Free Software Foundation; either version 3 of the License, or
-+# (at your option) any later version.
-+#
-+# This program is distributed in the hope that it will be useful,
-+# but WITHOUT ANY WARRANTY; without even the implied warranty of
-+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+# GNU General Public License for more details.
-+#
-+# You should have received a copy of the GNU General Public License
-+# along with this program. If not, see <http://www.gnu.org/licenses/>.
-+
-+class HelloWorld (gdb.Command):
-+ """Greet the whole world."""
-+
-+ def __init__ (self):
-+ super (HelloWorld, self).__init__ ("hello-world",
-+ gdb.COMMAND_OBSCURE)
-+
-+ def invoke (self, arg, from_tty):
-+ px = gdb.parse_and_eval("px")
-+ core = gdb.inferiors()[0]
-+ for i in range(256 * 1024):
-+ chunk = core.read_memory(px, 4096)
-+ print "Hello, World!"
-+
-+HelloWorld ()
diff --git a/gdb-rhbz1084404-ppc64-s390x-wrong-prologue-skip-O2-g-3of3.patch b/gdb-rhbz1084404-ppc64-s390x-wrong-prologue-skip-O2-g-3of3.patch
deleted file mode 100644
index af7271a..0000000
--- a/gdb-rhbz1084404-ppc64-s390x-wrong-prologue-skip-O2-g-3of3.patch
+++ /dev/null
@@ -1,226 +0,0 @@
-These testcases have been created by compiling glibc-2.17-78 on
-RHEL-7.1 s390x/ppc64 boxes, and then taking the "select.o" file
-present at $builddir/misc/select.o.
-
-Index: gdb-7.6.1/gdb/testsuite/gdb.arch/s390x-prologue-skip.exp
-===================================================================
---- /dev/null
-+++ gdb-7.6.1/gdb/testsuite/gdb.arch/s390x-prologue-skip.exp
-@@ -0,0 +1,34 @@
-+# Copyright 2015 Free Software Foundation, Inc.
-+
-+# This program is free software; you can redistribute it and/or modify
-+# it under the terms of the GNU General Public License as published by
-+# the Free Software Foundation; either version 3 of the License, or
-+# (at your option) any later version.
-+#
-+# This program is distributed in the hope that it will be useful,
-+# but WITHOUT ANY WARRANTY; without even the implied warranty of
-+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+# GNU General Public License for more details.
-+#
-+# You should have received a copy of the GNU General Public License
-+# along with this program. If not, see <http://www.gnu.org/licenses/>.
-+
-+if { ![istarget s390x-*linux-*] || ![is_lp64_target] } {
-+ verbose "Skipping s390x-prologue-skip.exp"
-+ return
-+}
-+
-+set testfile "s390x-prologue-skip"
-+set uufile "${srcdir}/${subdir}/${testfile}.o.uu"
-+set ofile "${srcdir}/${subdir}/${testfile}.o"
-+
-+if { [catch "system \"uudecode -o ${ofile} ${uufile}\"" ] != 0 } {
-+ untested "failed uudecode"
-+ return -1
-+}
-+
-+gdb_exit
-+gdb_start
-+gdb_load $ofile
-+
-+gdb_test "break select" "Breakpoint $decimal at 0x48: file ../sysdeps/unix/syscall-template.S, line 81." "breakpoint on select"
-Index: gdb-7.6.1/gdb/testsuite/gdb.arch/s390x-prologue-skip.o.uu
-===================================================================
---- /dev/null
-+++ gdb-7.6.1/gdb/testsuite/gdb.arch/s390x-prologue-skip.o.uu
-@@ -0,0 +1,64 @@
-+begin 644 s390x-prologue-skip.o.uu
-+M?T5,1@("`0`````````````!`!8````!````````````````````````````
-+M``+```````!```````!``!(`#^LE\!``).O?\&@`)+D$`.^G^_](a)X^#P```D
-+MP.4`````N00``NLE\+``!`J.N00`TKD$`"#`Y0````"Y!``MZ]_Q"``$I_0`
-+M"L`0`````+\/$`"G=/_7"HZG2?`!N2$`),"T``````?^````5@`"````.0$!
-+M^PX-``$!`0$````!```!+BXO<WES9&5P<R]U;FEX``!S>7-C86QL+71E;7!L
-+M871E+E,``0`````)`@```````````]```0)F$P("``$!````CP`"``````@!
-+M```````````````````````````N+B]S>7-D97!S+W5N:7@O<WES8V%L;"UT
-+M96UP;&%T92Y3`"]R;V]T+V=L:6)C+V=L:6)C+3(N,3<M-S@N96PW+G-R8R]G
-+M;&EB8RTR+C$W+6,W-3AA-C@V+VUI<V,`1TY5($%3(#(N,C,N-3(N,"XQ`(`!
-+M`1$`$`81`1(!`P@;""4($P4`````````````````+``"``````@`````````
-+M`````````````````&@`````````````````````````%``````!>E(``7@.
-+M`1L,#Z`!````````&````!P`````````1`!,CP6.!HT'2`[``@```!`````X
-+M`````````"```````"YS>6UT86(`+G-T<G1A8@`N<VAS=')T86(`+G)E;&$N
-+M=&5X=``N9&%T80`N8G-S`"YN;W1E+D=.52US=&%C:P`N<F5L82YD96)U9U]L
-+M:6YE`"YR96QA+F1E8G5G7VEN9F\`+F1E8G5G7V%B8G)E=@`N<F5L82YD96)U
-+M9U]A<F%N9V5S`"YR96QA+F5H7V9R86UE````````````````````````````
-+M````````````````````````````````````````````````````````````
-+M````````(`````$`````````!@```````````````````$``````````:```
-+M``````````````````0``````````````!L````$````````````````````
-+M``````````F``````````&`````0`````0`````````(`````````!@````F
-+M`````0`````````#````````````````````J```````````````````````
-+M````````!```````````````+`````@``````````P``````````````````
-+M`*@```````````````````````````````0``````````````#$````!````
-+M``````````````````````````"H```````````````````````````````!
-+M``````````````!&`````0``````````````````````````````J```````
-+M``!:`````````````````````0``````````````00````0`````````````
-+M````````````````">``````````&````!`````&``````````@`````````
-+M&````%<````!``````````````````````````````$"`````````),`````
-+M```````````````!``````````````!2````!```````````````````````
-+M```````)^`````````!@````$`````@`````````"``````````8````8P``
-+M``$``````````````````````````````94`````````%```````````````
-+M``````$``````````````'8````!``````````````````````````````&P
-+M`````````#`````````````````````0``````````````!Q````!```````
-+M```````````````````````*6``````````P````$`````L`````````"```
-+M```````8````B@````$``````````@```````````````````>``````````
-+M2`````````````````````@``````````````(4````$````````````````
-+M``````````````J(`````````#`````0````#0`````````(`````````!@`
-+M```1`````P`````````````````````````````"*`````````"4````````
-+M`````````````0```````````````0````(`````````````````````````
-+M````!T`````````!L````!$````*``````````@`````````&`````D````#
-+M``````````````````````````````CP`````````(X`````````````````
-+M```!`````````````````````````````````````````````````P```0``
-+M`````````````````````````P```P```````````````````````````P``
-+M!````````````````````````````P``"```````````````````````````
-+M`P``"@```````````````````````````P``!@``````````````````````
-+M`````P``"P```````````````````````````P``#0``````````````````
-+M`````````P``!0`````````````````````````!$```````````````````
-+M```````````;$``````````````````````````````V$@```0````````!(
-+M`````````"`````_$`````````````````````````````!7$@```0``````
-+M``!6`````````!````!I$`````````````````````````````!Y(@```0``
-+M``````!(`````````"````"'(@```0````````!(`````````"``7U]L:6)C
-+M7V5N86)L95]A<WEN8V-A;F-E;`!?7VQI8F-?9&ES86)L95]A<WEN8V-A;F-E
-+M;`!?7W-E;&5C=`!?7VQI8F-?;75L=&EP;&5?=&AR96%D<P!?7W-E;&5C=%]N
-+M;V-A;F-E;`!?7W-Y<V-A;&Q?97)R;W(`7U]L:6)C7W-E;&5C=`!S96QE8W0`
-+M````````````'`````H````3``````````(`````````-@````L````3````
-+M``````(`````````2@````T````3``````````(`````````8@````\````3
-+M``````````(`````````1@````$````6````````````````````!@````4`
-+M```$````````````````````#`````8````$````````````````````$```
-+M``$````6````````````````````&`````$````6`````````&@`````````
-+M!@````0````$````````````````````$`````$````6````````````````
-+L````(`````$````%````````````````````/`````$````%`````````$@`
-+`
-+end
-Index: gdb-7.6.1/gdb/testsuite/gdb.arch/ppc64-prologue-skip.exp
-===================================================================
---- /dev/null
-+++ gdb-7.6.1/gdb/testsuite/gdb.arch/ppc64-prologue-skip.exp
-@@ -0,0 +1,34 @@
-+# Copyright 2015 Free Software Foundation, Inc.
-+
-+# This program is free software; you can redistribute it and/or modify
-+# it under the terms of the GNU General Public License as published by
-+# the Free Software Foundation; either version 3 of the License, or
-+# (at your option) any later version.
-+#
-+# This program is distributed in the hope that it will be useful,
-+# but WITHOUT ANY WARRANTY; without even the implied warranty of
-+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+# GNU General Public License for more details.
-+#
-+# You should have received a copy of the GNU General Public License
-+# along with this program. If not, see <http://www.gnu.org/licenses/>.
-+
-+if { ![istarget powerpc64-*linux-*] || ![is_lp64_target] } {
-+ verbose "Skipping ppc64-prologue-skip.exp"
-+ return
-+}
-+
-+set testfile "ppc64-prologue-skip"
-+set uufile "${srcdir}/${subdir}/${testfile}.o.uu"
-+set ofile "${srcdir}/${subdir}/${testfile}.o"
-+
-+if { [catch "system \"uudecode -o ${ofile} ${uufile}\"" ] != 0 } {
-+ untested "failed uudecode"
-+ return -1
-+}
-+
-+gdb_exit
-+gdb_start
-+gdb_load $ofile
-+
-+gdb_test "break ___newselect_nocancel" "Breakpoint $decimal at 0xc: file ../sysdeps/unix/syscall-template.S, line 81." "breakpoint on ___newselect_nocancel"
-Index: gdb-7.6.1/gdb/testsuite/gdb.arch/ppc64-prologue-skip.o.uu
-===================================================================
---- /dev/null
-+++ gdb-7.6.1/gdb/testsuite/gdb.arch/ppc64-prologue-skip.o.uu
-@@ -0,0 +1,70 @@
-+begin 644 ppc64-skip-prologue.o.uu
-+M?T5,1@("`0`````````````!`!4````!````````````````````````````
-+M``-(``````!```````!``!0`$8%-B-`L"@``0,(`-#@``(Y$```"3.,`('P(
-+M`J;X`0`0^"'_D4@```%@````Z`$`@#@A`'!\"`.F3H``(/@A_X%]*`*F^2$`
-+MD/CA`-#XP0#(^*$`P/B!`+CX80"P2````6````#X80!PZ.$`T.C!`,CHH0#`
-+MZ($`N.AA`+`X``".1````GP``";X80!X^`$`B.AA`'!(```!8````.DA`)#H
-+M`0"(Z&$`>'TH`Z9\#_$@."$`@$SC`"!+__]@```````,($``````````O``(
-+M7U]S96QE8W0```````````````````````````!6``(````Y!`'[#@T``0$!
-+M`0````$```$N+B]S>7-D97!S+W5N:7@``'-Y<V-A;&PM=&5M<&QA=&4N4P`!
-+M``````D"```````````#T``!`BT3`@D``0$```"/``(`````"`$`````````
-+M`````````````````"XN+W-Y<V1E<',O=6YI>"]S>7-C86QL+71E;7!L871E
-+M+E,`+W)O;W0O9VQI8F,O9VQI8F,M,BXQ-RTW."YE;#<N<W)C+V=L:6)C+3(N
-+M,3<M8S<U.&$V.#8O;6ES8P!'3E4@05,@,BXR,RXU,BXP+C$`@`$!$0`0!A$!
-+M$@$#"!L()0@3!0`````````````````L``(`````"```````````````````
-+M````````V``````````````````````````0``````%Z4@`$>$$!&PP!````
-+M`#`````8`````````+P`20YP$4%^1`X`009!0@Z``4(107Y2$49_20X`!D$&
-+M1@``````+G-Y;71A8@`N<W1R=&%B`"YS:'-T<G1A8@`N<F5L82YT97AT`"YD
-+M871A`"YB<W,`+G)E;&$N;W!D`"YN;W1E+D=.52US=&%C:P`N<F5L82YD96)U
-+M9U]L:6YE`"YR96QA+F1E8G5G7VEN9F\`+F1E8G5G7V%B8G)E=@`N<F5L82YD
-+M96)U9U]A<F%N9V5S`"YR96QA+F5H7V9R86UE````````````````````````
-+M````````````````````````````````````````````````````````````
-+M`````````"`````!``````````8```````````````````!``````````-@`
-+M```````````````````$```````````````;````!```````````````````
-+M```````````*>`````````!(````$@````$`````````"``````````8````
-+M)@````$``````````P```````````````````1@`````````````````````
-+M``````````$``````````````"P````(``````````,`````````````````
-+M``$8```````````````````````````````!```````````````V`````0``
-+M```````#```````````````````!&``````````0````````````````````
-+M"```````````````,0````0`````````````````````````````"L``````
-+M````,````!(````%``````````@`````````&````#L````!````````````
-+M``````````````````$H```````````````````````````````!````````
-+M``````!0`````0`````````````````````````````!*`````````!:````
-+M`````````````````0``````````````2P````0`````````````````````
-+M````````"O``````````&````!(````(``````````@`````````&````&$`
-+M```!``````````````````````````````&"`````````),`````````````
-+M```````!``````````````!<````!``````````````````````````````+
-+M"`````````!@````$@````H`````````"``````````8````;0````$`````
-+M`````````````````````````A4`````````%`````````````````````$`
-+M`````````````(`````!``````````````````````````````(P````````
-+M`#`````````````````````0``````````````![````!```````````````
-+M```````````````+:``````````P````$@````T`````````"``````````8
-+M````E`````$``````````@```````````````````F``````````2```````
-+M``````````````@``````````````(\````$````````````````````````
-+M``````N8`````````!@````2````#P`````````(`````````!@````1````
-+M`P`````````````````````````````"J`````````">````````````````
-+M`````0```````````````0````(`````````````````````````````"$@`
-+M```````!L````!,````+``````````@`````````&`````D````#````````
-+M``````````````````````GX`````````'H````````````````````!````
-+M`````````````````````````````````````````````P```0``````````
-+M`````````````````P```P```````````````````````````P``!```````
-+M`````````````````````P``!0```````````````````````````P``"@``
-+M`````````````````````````P``#````````````````````````````P``
-+M"````````````````````````````P``#0``````````````````````````
-+M`P``#P```````````````````````````P``!P``````````````````````
-+M```!$@``!0```````````````````-@````*$@```0`````````,````````
-+M`#`````@$``````````````````````````````P$```````````````````
-+M``````````!*$`````````````````````````````!E(@``!0``````````
-+M`````````-@```!S(@``!0```````````````````-@`7U]S96QE8W0`7U]?
-+M;F5W<V5L96-T7VYO8V%N8V5L`%]?<WES8V%L;%]E<G)O<@!?7VQI8F-?96YA
-+M8FQE7V%S>6YC8V%N8V5L`%]?;&EB8U]D:7-A8FQE7V%S>6YC8V%N8V5L`%]?
-+M;&EB8U]S96QE8W0`<V5L96-T```````````````````D````#0````H`````
-+M``````````````!<````#@````H```````````````````"4````#P````H`
-+M`````````````````````````0```"8````````````````````(````````
-+M`#,```````````````````!&`````0```"8````````````````````&````
-+M!@````$````````````````````,````!P````$````````````````````0
-+M`````0```"8````````````````````8`````0```"8`````````V```````
-+M```&````!0````$````````````````````0`````0```"8`````````````
-+6```````<`````0```!H`````````````
-+`
-+end
diff --git a/gdb-rhbz1350436-type-printers-error.patch b/gdb-rhbz1350436-type-printers-error.patch
deleted file mode 100644
index 278bc2c..0000000
--- a/gdb-rhbz1350436-type-printers-error.patch
+++ /dev/null
@@ -1,73 +0,0 @@
-Typo in Python support breaks info type-printers command
-https://bugzilla.redhat.com/show_bug.cgi?id=1350436
-
-[testsuite patch] PR python/17136: 'info type-printers' causes an exception when there are per-objfile printers
-https://sourceware.org/ml/gdb-patches/2016-06/msg00455.html
-
-diff -dup -rup gdb-7.6.1/gdb/testsuite/gdb.python-orig/py-typeprint.cc gdb-7.6.1/gdb/testsuite/gdb.python/py-typeprint.cc
---- gdb-7.6.1/gdb/testsuite/gdb.python-orig/py-typeprint.cc 2013-01-01 07:41:26.000000000 +0100
-+++ gdb-7.6.1/gdb/testsuite/gdb.python/py-typeprint.cc 2016-06-27 22:57:58.168642470 +0200
-@@ -31,6 +31,12 @@ templ<basic_string> s;
-
- basic_string bs;
-
-+class Other
-+{
-+};
-+
-+Other ovar;
-+
- int main()
- {
- return 0;
-diff -dup -rup gdb-7.6.1/gdb/testsuite/gdb.python-orig/py-typeprint.exp gdb-7.6.1/gdb/testsuite/gdb.python/py-typeprint.exp
---- gdb-7.6.1/gdb/testsuite/gdb.python-orig/py-typeprint.exp 2013-01-01 07:41:26.000000000 +0100
-+++ gdb-7.6.1/gdb/testsuite/gdb.python/py-typeprint.exp 2016-06-27 22:58:13.846785208 +0200
-@@ -51,3 +51,7 @@ gdb_test_no_output "enable type-printer
- gdb_test "whatis bs" "string" "whatis with enabled printer"
-
- gdb_test "whatis s" "templ<string>"
-+
-+gdb_test "info type-printers" "Type printers for \[^\r\n\]*/py-typeprint:\r\n *other\r\n.*" \
-+ "info type-printers for other"
-+gdb_test "whatis ovar" "type = Another"
-diff -dup -rup gdb-7.6.1/gdb/testsuite/gdb.python-orig/py-typeprint.py gdb-7.6.1/gdb/testsuite/gdb.python/py-typeprint.py
---- gdb-7.6.1/gdb/testsuite/gdb.python-orig/py-typeprint.py 2013-01-01 07:41:26.000000000 +0100
-+++ gdb-7.6.1/gdb/testsuite/gdb.python/py-typeprint.py 2016-06-27 22:57:58.169642479 +0200
-@@ -15,7 +15,7 @@
-
- import gdb
-
--class Recognizer(object):
-+class StringRecognizer(object):
- def __init__(self):
- self.enabled = True
-
-@@ -30,6 +30,26 @@ class StringTypePrinter(object):
- self.enabled = True
-
- def instantiate(self):
-- return Recognizer()
-+ return StringRecognizer()
-
- gdb.type_printers.append(StringTypePrinter())
-+
-+class OtherRecognizer(object):
-+ def __init__(self):
-+ self.enabled = True
-+
-+ def recognize(self, type_obj):
-+ if type_obj.tag == 'Other':
-+ return 'Another'
-+ return None
-+
-+class OtherTypePrinter(object):
-+ def __init__(self):
-+ self.name = 'other'
-+ self.enabled = True
-+
-+ def instantiate(self):
-+ return OtherRecognizer()
-+
-+import gdb.types
-+gdb.types.register_type_printer(gdb.objfiles()[0], OtherTypePrinter())
diff --git a/gdb-rhbz795424-bitpos-21of25.patch b/gdb-rhbz795424-bitpos-21of25.patch
index 0fa7ead..42013e1 100644
--- a/gdb-rhbz795424-bitpos-21of25.patch
+++ b/gdb-rhbz795424-bitpos-21of25.patch
@@ -1,6 +1,15 @@
-http://sourceware.org/ml/gdb-patches/2012-09/msg00632.html
-Subject: [PATCH 2/4] Add a check to ensure that a type may fit into host memory
+From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
+From: Fedora GDB patches <invalid(a)email.com>
+Date: Fri, 27 Oct 2017 21:07:50 +0200
+Subject: Add a check to ensure that a type may fit into host memory
+
+FileName: gdb-rhbz795424-bitpos-21of25.patch
+
+;; Fix `GDB cannot access struct member whose offset is larger than 256MB'
+;; (RH BZ 795424).
+;;=push
+http://sourceware.org/ml/gdb-patches/2012-09/msg00632.html
--MP_/PnL6l3LUsXWpZ/olqawWlzb
Content-Type: text/plain; charset=US-ASCII
@@ -51,12 +60,22 @@ gdb/ChangeLog
Content-Type: text/x-patch
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment; filename=bitpos-ensure-size_t.patch
+---
+ gdb/alpha-tdep.c | 7 +++++++
+ gdb/cp-valprint.c | 1 +
+ gdb/defs.h | 2 ++
+ gdb/p-valprint.c | 1 +
+ gdb/utils.c | 12 ++++++++++++
+ gdb/valops.c | 1 +
+ gdb/value.c | 4 ++++
+ gdb/vax-tdep.c | 1 +
+ 8 files changed, 29 insertions(+)
-Index: gdb-7.10.90.20160211/gdb/alpha-tdep.c
-===================================================================
---- gdb-7.10.90.20160211.orig/gdb/alpha-tdep.c 2016-02-11 20:56:59.224850729 +0100
-+++ gdb-7.10.90.20160211/gdb/alpha-tdep.c 2016-02-11 20:57:05.385891225 +0100
-@@ -413,6 +413,13 @@
+diff --git a/gdb/alpha-tdep.c b/gdb/alpha-tdep.c
+index 52a46d96ea..ea53b9ee10 100644
+--- a/gdb/alpha-tdep.c
++++ b/gdb/alpha-tdep.c
+@@ -415,6 +415,13 @@ alpha_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
accumulate_size = 0;
else
accumulate_size -= sizeof(arg_reg_buffer);
@@ -70,69 +89,46 @@ Index: gdb-7.10.90.20160211/gdb/alpha-tdep.c
sp -= accumulate_size;
/* Keep sp aligned to a multiple of 16 as the ABI requires. */
-Index: gdb-7.10.90.20160211/gdb/cp-valprint.c
-===================================================================
---- gdb-7.10.90.20160211.orig/gdb/cp-valprint.c 2016-02-11 20:56:59.224850729 +0100
-+++ gdb-7.10.90.20160211/gdb/cp-valprint.c 2016-02-11 20:57:05.385891225 +0100
-@@ -536,6 +536,8 @@
- gdb_byte *buf;
- struct cleanup *back_to;
-
+diff --git a/gdb/cp-valprint.c b/gdb/cp-valprint.c
+index db3ff338d1..4d06680239 100644
+--- a/gdb/cp-valprint.c
++++ b/gdb/cp-valprint.c
+@@ -529,6 +529,7 @@ cp_print_value (struct type *type, struct type *real_type,
+ if ((boffset + offset) < 0
+ || (boffset + offset) >= TYPE_LENGTH (real_type))
+ {
+ ulongest_fits_host_or_error (TYPE_LENGTH (baseclass));
-+
- buf = (gdb_byte *) xmalloc (TYPE_LENGTH (baseclass));
- back_to = make_cleanup (xfree, buf);
+ gdb::byte_vector buf (TYPE_LENGTH (baseclass));
-Index: gdb-7.10.90.20160211/gdb/dwarf2loc.c
-===================================================================
---- gdb-7.10.90.20160211.orig/gdb/dwarf2loc.c 2016-02-11 20:56:59.225850736 +0100
-+++ gdb-7.10.90.20160211/gdb/dwarf2loc.c 2016-02-11 20:57:05.386891231 +0100
-@@ -1744,6 +1744,8 @@
+ if (target_read_memory (address + boffset, buf.data (),
+diff --git a/gdb/defs.h b/gdb/defs.h
+index 4fb2129b30..0c156d56c3 100644
+--- a/gdb/defs.h
++++ b/gdb/defs.h
+@@ -705,4 +705,6 @@ DEF_ENUM_FLAGS_TYPE (enum user_selected_what_flag, user_selected_what);
- this_size = (this_size_bits + source_offset_bits % 8 + 7) / 8;
- source_offset = source_offset_bits / 8;
-+ ulongest_fits_host_or_error (this_size);
-+
- if (buffer_size < this_size)
- {
- buffer_size = this_size;
-@@ -1926,6 +1928,7 @@
- }
- else
- {
-+ ulongest_fits_host_or_error (this_size);
- if (buffer_size < this_size)
- {
- buffer_size = this_size;
-Index: gdb-7.10.90.20160211/gdb/findcmd.c
-===================================================================
---- gdb-7.10.90.20160211.orig/gdb/findcmd.c 2016-02-11 20:56:59.226850742 +0100
-+++ gdb-7.10.90.20160211/gdb/findcmd.c 2016-02-11 20:57:05.387891238 +0100
-@@ -184,6 +184,7 @@
- size_t current_offset = pattern_buf_end - pattern_buf;
+ #include "utils.h"
- pattern_buf_size = pattern_buf_size_need * 2;
-+ ulongest_fits_host_or_error (pattern_buf_size);
- pattern_buf = (gdb_byte *) xrealloc (pattern_buf, pattern_buf_size);
- pattern_buf_end = pattern_buf + current_offset;
- }
-Index: gdb-7.10.90.20160211/gdb/p-valprint.c
-===================================================================
---- gdb-7.10.90.20160211.orig/gdb/p-valprint.c 2016-02-11 20:56:59.226850742 +0100
-+++ gdb-7.10.90.20160211/gdb/p-valprint.c 2016-02-11 20:57:05.387891238 +0100
-@@ -769,6 +769,7 @@
- gdb_byte *buf;
- struct cleanup *back_to;
++extern void ulongest_fits_host_or_error (ULONGEST num);
++
+ #endif /* #ifndef DEFS_H */
+diff --git a/gdb/p-valprint.c b/gdb/p-valprint.c
+index e5c1b07040..06fb3b77c9 100644
+--- a/gdb/p-valprint.c
++++ b/gdb/p-valprint.c
+@@ -773,6 +773,7 @@ pascal_object_print_value (struct type *type, const gdb_byte *valaddr,
+ if (boffset < 0 || boffset >= TYPE_LENGTH (type))
+ {
+ ulongest_fits_host_or_error (TYPE_LENGTH (baseclass));
- buf = (gdb_byte *) xmalloc (TYPE_LENGTH (baseclass));
- back_to = make_cleanup (xfree, buf);
+ buf.resize (TYPE_LENGTH (baseclass));
-Index: gdb-7.10.90.20160211/gdb/utils.c
-===================================================================
---- gdb-7.10.90.20160211.orig/gdb/utils.c 2016-02-11 20:56:59.227850749 +0100
-+++ gdb-7.10.90.20160211/gdb/utils.c 2016-02-11 20:57:05.388891244 +0100
-@@ -2837,6 +2837,18 @@
+ base_valaddr = buf.data ();
+diff --git a/gdb/utils.c b/gdb/utils.c
+index 0066bfcc4b..6f0abc98a2 100644
+--- a/gdb/utils.c
++++ b/gdb/utils.c
+@@ -2836,6 +2836,18 @@ string_to_core_addr (const char *my_string)
return addr;
}
@@ -148,26 +144,26 @@ Index: gdb-7.10.90.20160211/gdb/utils.c
+ pulongest (SIZE_MAX / 8));
+}
+
- char *
+ gdb::unique_xmalloc_ptr<char>
gdb_realpath (const char *filename)
{
-Index: gdb-7.10.90.20160211/gdb/valops.c
-===================================================================
---- gdb-7.10.90.20160211.orig/gdb/valops.c 2016-02-11 20:56:59.228850755 +0100
-+++ gdb-7.10.90.20160211/gdb/valops.c 2016-02-11 20:57:05.389891251 +0100
-@@ -2057,6 +2057,7 @@
- struct cleanup *back_to;
+diff --git a/gdb/valops.c b/gdb/valops.c
+index fdcb7e49e6..ddc53f131e 100644
+--- a/gdb/valops.c
++++ b/gdb/valops.c
+@@ -2087,6 +2087,7 @@ search_struct_method (const char *name, struct value **arg1p,
+ {
CORE_ADDR address;
+ ulongest_fits_host_or_error (TYPE_LENGTH (baseclass));
- tmp = (gdb_byte *) xmalloc (TYPE_LENGTH (baseclass));
- back_to = make_cleanup (xfree, tmp);
+ gdb::byte_vector tmp (TYPE_LENGTH (baseclass));
address = value_address (*arg1p);
-Index: gdb-7.10.90.20160211/gdb/value.c
-===================================================================
---- gdb-7.10.90.20160211.orig/gdb/value.c 2016-02-11 20:56:59.229850762 +0100
-+++ gdb-7.10.90.20160211/gdb/value.c 2016-02-11 20:58:35.095480877 +0100
-@@ -935,6 +935,7 @@
+
+diff --git a/gdb/value.c b/gdb/value.c
+index b6406fedc9..ac7d07a7b5 100644
+--- a/gdb/value.c
++++ b/gdb/value.c
+@@ -926,6 +926,7 @@ allocate_value_lazy (struct type *type)
description correctly. */
check_typedef (type);
@@ -175,7 +171,7 @@ Index: gdb-7.10.90.20160211/gdb/value.c
val = XCNEW (struct value);
val->contents = NULL;
val->next = all_values;
-@@ -1034,6 +1035,8 @@
+@@ -1023,6 +1024,8 @@ check_type_length_before_alloc (const struct type *type)
static void
allocate_value_contents (struct value *val)
{
@@ -184,7 +180,7 @@ Index: gdb-7.10.90.20160211/gdb/value.c
if (!val->contents)
{
check_type_length_before_alloc (val->enclosing_type);
-@@ -3090,6 +3093,7 @@
+@@ -3015,6 +3018,7 @@ set_value_enclosing_type (struct value *val, struct type *new_encl_type)
if (TYPE_LENGTH (new_encl_type) > TYPE_LENGTH (value_enclosing_type (val)))
{
check_type_length_before_alloc (new_encl_type);
@@ -192,11 +188,11 @@ Index: gdb-7.10.90.20160211/gdb/value.c
val->contents
= (gdb_byte *) xrealloc (val->contents, TYPE_LENGTH (new_encl_type));
}
-Index: gdb-7.10.90.20160211/gdb/vax-tdep.c
-===================================================================
---- gdb-7.10.90.20160211.orig/gdb/vax-tdep.c 2016-02-11 20:56:59.229850762 +0100
-+++ gdb-7.10.90.20160211/gdb/vax-tdep.c 2016-02-11 20:57:05.391891264 +0100
-@@ -219,6 +219,7 @@
+diff --git a/gdb/vax-tdep.c b/gdb/vax-tdep.c
+index 4c1ab2e73e..bd69fd2f48 100644
+--- a/gdb/vax-tdep.c
++++ b/gdb/vax-tdep.c
+@@ -218,6 +218,7 @@ vax_return_value (struct gdbarch *gdbarch, struct value *function,
ULONGEST addr;
regcache_raw_read_unsigned (regcache, VAX_R0_REGNUM, &addr);
@@ -204,14 +200,6 @@ Index: gdb-7.10.90.20160211/gdb/vax-tdep.c
read_memory (addr, readbuf, len);
}
-Index: gdb-7.10.90.20160211/gdb/defs.h
-===================================================================
---- gdb-7.10.90.20160211.orig/gdb/defs.h 2016-02-11 20:56:59.229850762 +0100
-+++ gdb-7.10.90.20160211/gdb/defs.h 2016-02-11 20:57:05.391891264 +0100
-@@ -690,4 +690,6 @@
-
- #include "utils.h"
-
-+extern void ulongest_fits_host_or_error (ULONGEST num);
-+
- #endif /* #ifndef DEFS_H */
+--
+2.14.3
+
diff --git a/gdb-rhbz795424-bitpos-22of25.patch b/gdb-rhbz795424-bitpos-22of25.patch
index 2f5b484..58f53c2 100644
--- a/gdb-rhbz795424-bitpos-22of25.patch
+++ b/gdb-rhbz795424-bitpos-22of25.patch
@@ -1,6 +1,15 @@
-http://sourceware.org/ml/gdb-patches/2012-09/msg00629.html
-Subject: [PATCH 3/4] Expand watchpoint lengths to LONGEST
+From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
+From: Fedora GDB patches <invalid(a)email.com>
+Date: Fri, 27 Oct 2017 21:07:50 +0200
+Subject: Expand watchpoint lengths to LONGEST
+
+FileName: gdb-rhbz795424-bitpos-22of25.patch
+;; Fix `GDB cannot access struct member whose offset is larger than 256MB'
+;; (RH BZ 795424).
+;;=push
+
+http://sourceware.org/ml/gdb-patches/2012-09/msg00629.html
--MP_/6HRlH6vpyqtSy4CYyMrX6b2
Content-Type: text/plain; charset=US-ASCII
@@ -95,12 +104,37 @@ gdb/ChangeLog:
Content-Type: text/x-patch
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment; filename=bitpos-wp.patch
+---
+ gdb/aarch64-linux-nat.c | 2 +-
+ gdb/arm-linux-nat.c | 2 +-
+ gdb/nat/aarch64-linux-hw-point.c | 21 +++++++++++----------
+ gdb/nat/aarch64-linux-hw-point.h | 4 ++--
+ gdb/ppc-linux-nat.c | 14 +++++++-------
+ gdb/procfs.c | 4 ++--
+ gdb/remote.c | 6 +++---
+ gdb/target-delegates.c | 14 +++++++-------
+ gdb/target.c | 4 ++--
+ gdb/target.h | 4 ++--
+ 10 files changed, 38 insertions(+), 37 deletions(-)
-Index: gdb-7.10.50.20151027/gdb/arm-linux-nat.c
-===================================================================
---- gdb-7.10.50.20151027.orig/gdb/arm-linux-nat.c 2015-11-08 10:36:33.050071812 +0100
-+++ gdb-7.10.50.20151027/gdb/arm-linux-nat.c 2015-11-08 10:36:33.094072110 +0100
-@@ -1209,7 +1209,7 @@ arm_linux_stopped_by_watchpoint (struct
+diff --git a/gdb/aarch64-linux-nat.c b/gdb/aarch64-linux-nat.c
+index 08e6f4d4fd..f08bf039e4 100644
+--- a/gdb/aarch64-linux-nat.c
++++ b/gdb/aarch64-linux-nat.c
+@@ -767,7 +767,7 @@ aarch64_linux_stopped_by_watchpoint (struct target_ops *ops)
+ static int
+ aarch64_linux_watchpoint_addr_within_range (struct target_ops *target,
+ CORE_ADDR addr,
+- CORE_ADDR start, int length)
++ CORE_ADDR start, LONGEST length)
+ {
+ return start <= addr && start + length - 1 >= addr;
+ }
+diff --git a/gdb/arm-linux-nat.c b/gdb/arm-linux-nat.c
+index 3b7aa40db8..48dfe22ce1 100644
+--- a/gdb/arm-linux-nat.c
++++ b/gdb/arm-linux-nat.c
+@@ -1177,7 +1177,7 @@ arm_linux_stopped_by_watchpoint (struct target_ops *ops)
static int
arm_linux_watchpoint_addr_within_range (struct target_ops *target,
CORE_ADDR addr,
@@ -109,11 +143,107 @@ Index: gdb-7.10.50.20151027/gdb/arm-linux-nat.c
{
return start <= addr && start + length - 1 >= addr;
}
-Index: gdb-7.10.50.20151027/gdb/ppc-linux-nat.c
-===================================================================
---- gdb-7.10.50.20151027.orig/gdb/ppc-linux-nat.c 2015-11-08 10:36:33.064071907 +0100
-+++ gdb-7.10.50.20151027/gdb/ppc-linux-nat.c 2015-11-08 10:36:33.095072117 +0100
-@@ -1807,11 +1807,11 @@ can_use_watchpoint_cond_accel (void)
+diff --git a/gdb/nat/aarch64-linux-hw-point.c b/gdb/nat/aarch64-linux-hw-point.c
+index ce26f28fad..e9ebc5fba8 100644
+--- a/gdb/nat/aarch64-linux-hw-point.c
++++ b/gdb/nat/aarch64-linux-hw-point.c
+@@ -111,7 +111,7 @@ aarch64_point_encode_ctrl_reg (enum target_hw_bp_type type, int len)
+ Return 0 for any non-compliant ADDR and/or LEN; return 1 otherwise. */
+
+ static int
+-aarch64_point_is_aligned (int is_watchpoint, CORE_ADDR addr, int len)
++aarch64_point_is_aligned (int is_watchpoint, CORE_ADDR addr, LONGEST len)
+ {
+ unsigned int alignment = 0;
+
+@@ -180,9 +180,10 @@ aarch64_point_is_aligned (int is_watchpoint, CORE_ADDR addr, int len)
+ limitations can be largely relaxed with some further work. */
+
+ static void
+-aarch64_align_watchpoint (CORE_ADDR addr, int len, CORE_ADDR *aligned_addr_p,
++aarch64_align_watchpoint (CORE_ADDR addr, LONGEST len,
++ CORE_ADDR *aligned_addr_p,
+ int *aligned_len_p, CORE_ADDR *next_addr_p,
+- int *next_len_p)
++ LONGEST *next_len_p)
+ {
+ int aligned_len;
+ unsigned int offset;
+@@ -501,7 +502,7 @@ aarch64_handle_aligned_watchpoint (enum target_hw_bp_type type,
+
+ static int
+ aarch64_handle_unaligned_watchpoint (enum target_hw_bp_type type,
+- CORE_ADDR addr, int len, int is_insert,
++ CORE_ADDR addr, LONGEST len, int is_insert,
+ struct aarch64_debug_reg_state *state)
+ {
+ while (len > 0)
+@@ -524,9 +525,9 @@ aarch64_handle_unaligned_watchpoint (enum target_hw_bp_type type,
+ " "
+ "aligned_addr: %s, aligned_len: %d\n"
+ " "
+- "next_addr: %s, next_len: %d\n",
++ "next_addr: %s, next_len: %s\n",
+ is_insert, core_addr_to_string_nz (aligned_addr),
+- aligned_len, core_addr_to_string_nz (addr), len);
++ aligned_len, core_addr_to_string_nz (addr), plongest (len));
+
+ if (ret != 0)
+ return ret;
+@@ -537,7 +538,7 @@ aarch64_handle_unaligned_watchpoint (enum target_hw_bp_type type,
+
+ int
+ aarch64_handle_watchpoint (enum target_hw_bp_type type, CORE_ADDR addr,
+- int len, int is_insert,
++ LONGEST len, int is_insert,
+ struct aarch64_debug_reg_state *state)
+ {
+ if (aarch64_point_is_aligned (1 /* is_watchpoint */ , addr, len))
+@@ -588,14 +589,14 @@ aarch64_linux_set_debug_regs (const struct aarch64_debug_reg_state *state,
+ void
+ aarch64_show_debug_reg_state (struct aarch64_debug_reg_state *state,
+ const char *func, CORE_ADDR addr,
+- int len, enum target_hw_bp_type type)
++ LONGEST len, enum target_hw_bp_type type)
+ {
+ int i;
+
+ debug_printf ("%s", func);
+ if (addr || len)
+- debug_printf (" (addr=0x%08lx, len=%d, type=%s)",
+- (unsigned long) addr, len,
++ debug_printf (" (addr=0x%08lx, len=%s, type=%s)",
++ (unsigned long) addr, plongest (len),
+ type == hw_write ? "hw-write-watchpoint"
+ : (type == hw_read ? "hw-read-watchpoint"
+ : (type == hw_access ? "hw-access-watchpoint"
+diff --git a/gdb/nat/aarch64-linux-hw-point.h b/gdb/nat/aarch64-linux-hw-point.h
+index 7c42b96d1b..e1d4fc8dbc 100644
+--- a/gdb/nat/aarch64-linux-hw-point.h
++++ b/gdb/nat/aarch64-linux-hw-point.h
+@@ -172,7 +172,7 @@ int aarch64_handle_breakpoint (enum target_hw_bp_type type, CORE_ADDR addr,
+ int len, int is_insert,
+ struct aarch64_debug_reg_state *state);
+ int aarch64_handle_watchpoint (enum target_hw_bp_type type, CORE_ADDR addr,
+- int len, int is_insert,
++ LONGEST len, int is_insert,
+ struct aarch64_debug_reg_state *state);
+
+ void aarch64_linux_set_debug_regs (const struct aarch64_debug_reg_state *state,
+@@ -180,7 +180,7 @@ void aarch64_linux_set_debug_regs (const struct aarch64_debug_reg_state *state,
+
+ void aarch64_show_debug_reg_state (struct aarch64_debug_reg_state *state,
+ const char *func, CORE_ADDR addr,
+- int len, enum target_hw_bp_type type);
++ LONGEST len, enum target_hw_bp_type type);
+
+ void aarch64_linux_get_debug_reg_capacity (int tid);
+
+diff --git a/gdb/ppc-linux-nat.c b/gdb/ppc-linux-nat.c
+index 4a82434c0d..49a27d8daa 100644
+--- a/gdb/ppc-linux-nat.c
++++ b/gdb/ppc-linux-nat.c
+@@ -1798,11 +1798,11 @@ can_use_watchpoint_cond_accel (void)
CONDITION_VALUE will hold the value which should be put in the
DVC register. */
static void
@@ -128,7 +258,7 @@ Index: gdb-7.10.50.20151027/gdb/ppc-linux-nat.c
CORE_ADDR addr_end_data, addr_end_dvc;
/* The DVC register compares bytes within fixed-length windows which
-@@ -1898,7 +1898,7 @@ num_memory_accesses (struct value *v)
+@@ -1889,7 +1889,7 @@ num_memory_accesses (struct value *v)
of the constant. */
static int
check_condition (CORE_ADDR watch_addr, struct expression *cond,
@@ -137,7 +267,7 @@ Index: gdb-7.10.50.20151027/gdb/ppc-linux-nat.c
{
int pc = 1, num_accesses_left, num_accesses_right;
struct value *left_val, *right_val, *left_chain, *right_chain;
-@@ -1966,7 +1966,7 @@ check_condition (CORE_ADDR watch_addr, s
+@@ -1957,7 +1957,7 @@ check_condition (CORE_ADDR watch_addr, struct expression *cond,
true. */
static int
ppc_linux_can_accel_watchpoint_condition (struct target_ops *self,
@@ -146,7 +276,7 @@ Index: gdb-7.10.50.20151027/gdb/ppc-linux-nat.c
struct expression *cond)
{
CORE_ADDR data_value;
-@@ -1983,7 +1983,7 @@ ppc_linux_can_accel_watchpoint_condition
+@@ -1974,7 +1974,7 @@ ppc_linux_can_accel_watchpoint_condition (struct target_ops *self,
static void
create_watchpoint_request (struct ppc_hw_breakpoint *p, CORE_ADDR addr,
@@ -155,7 +285,7 @@ Index: gdb-7.10.50.20151027/gdb/ppc-linux-nat.c
struct expression *cond, int insert)
{
if (len == 1
-@@ -2249,7 +2249,7 @@ ppc_linux_stopped_by_watchpoint (struct
+@@ -2240,7 +2240,7 @@ ppc_linux_stopped_by_watchpoint (struct target_ops *ops)
static int
ppc_linux_watchpoint_addr_within_range (struct target_ops *target,
CORE_ADDR addr,
@@ -164,20 +294,20 @@ Index: gdb-7.10.50.20151027/gdb/ppc-linux-nat.c
{
int mask;
-Index: gdb-7.10.50.20151027/gdb/procfs.c
-===================================================================
---- gdb-7.10.50.20151027.orig/gdb/procfs.c 2015-11-08 10:36:33.065071913 +0100
-+++ gdb-7.10.50.20151027/gdb/procfs.c 2015-11-08 10:36:33.096072123 +0100
-@@ -2427,7 +2427,7 @@ procfs_address_to_host_pointer (CORE_ADD
- #endif
+diff --git a/gdb/procfs.c b/gdb/procfs.c
+index 887f1201fe..edd1be632a 100644
+--- a/gdb/procfs.c
++++ b/gdb/procfs.c
+@@ -1563,7 +1563,7 @@ procfs_address_to_host_pointer (CORE_ADDR addr)
+ }
static int
-proc_set_watchpoint (procinfo *pi, CORE_ADDR addr, int len, int wflags)
+proc_set_watchpoint (procinfo *pi, CORE_ADDR addr, LONGEST len, int wflags)
{
- #if !defined (PCWATCH) && !defined (PIOCSWATCH)
- /* If neither or these is defined, we can't support watchpoints.
-@@ -4706,7 +4706,7 @@ procfs_pid_to_str (struct target_ops *op
+ struct {
+ procfs_ctl_t cmd;
+@@ -3250,7 +3250,7 @@ procfs_pid_to_str (struct target_ops *ops, ptid_t ptid)
/* Insert a watchpoint. */
static int
@@ -185,12 +315,12 @@ Index: gdb-7.10.50.20151027/gdb/procfs.c
+procfs_set_watchpoint (ptid_t ptid, CORE_ADDR addr, LONGEST len, int rwflag,
int after)
{
- #ifndef AIX5
-Index: gdb-7.10.50.20151027/gdb/remote.c
-===================================================================
---- gdb-7.10.50.20151027.orig/gdb/remote.c 2015-11-08 10:36:33.067071927 +0100
-+++ gdb-7.10.50.20151027/gdb/remote.c 2015-11-08 10:36:33.097072130 +0100
-@@ -9085,7 +9085,7 @@ remote_insert_watchpoint (struct target_
+ int pflags = 0;
+diff --git a/gdb/remote.c b/gdb/remote.c
+index f9f8f973a2..1eee712466 100644
+--- a/gdb/remote.c
++++ b/gdb/remote.c
+@@ -9891,7 +9891,7 @@ remote_insert_watchpoint (struct target_ops *self, CORE_ADDR addr, int len,
p = strchr (rs->buf, '\0');
addr = remote_address_masked (addr);
p += hexnumstr (p, (ULONGEST) addr);
@@ -199,7 +329,7 @@ Index: gdb-7.10.50.20151027/gdb/remote.c
putpkt (rs->buf);
getpkt (&rs->buf, &rs->buf_size, 0);
-@@ -9105,7 +9105,7 @@ remote_insert_watchpoint (struct target_
+@@ -9911,7 +9911,7 @@ remote_insert_watchpoint (struct target_ops *self, CORE_ADDR addr, int len,
static int
remote_watchpoint_addr_within_range (struct target_ops *target, CORE_ADDR addr,
@@ -208,7 +338,7 @@ Index: gdb-7.10.50.20151027/gdb/remote.c
{
CORE_ADDR diff = remote_address_masked (addr - start);
-@@ -9134,7 +9134,7 @@ remote_remove_watchpoint (struct target_
+@@ -9940,7 +9940,7 @@ remote_remove_watchpoint (struct target_ops *self, CORE_ADDR addr, int len,
p = strchr (rs->buf, '\0');
addr = remote_address_masked (addr);
p += hexnumstr (p, (ULONGEST) addr);
@@ -217,68 +347,11 @@ Index: gdb-7.10.50.20151027/gdb/remote.c
putpkt (rs->buf);
getpkt (&rs->buf, &rs->buf_size, 0);
-Index: gdb-7.10.50.20151027/gdb/target.c
-===================================================================
---- gdb-7.10.50.20151027.orig/gdb/target.c 2015-11-08 10:36:33.069071941 +0100
-+++ gdb-7.10.50.20151027/gdb/target.c 2015-11-08 10:36:33.098072137 +0100
-@@ -51,7 +51,7 @@ static void generic_tls_error (void) ATT
- static void default_terminal_info (struct target_ops *, const char *, int);
-
- static int default_watchpoint_addr_within_range (struct target_ops *,
-- CORE_ADDR, CORE_ADDR, int);
-+ CORE_ADDR, CORE_ADDR, LONGEST);
-
- static int default_region_ok_for_hw_watchpoint (struct target_ops *,
- CORE_ADDR, LONGEST);
-@@ -3140,7 +3140,7 @@ default_region_ok_for_hw_watchpoint (str
- static int
- default_watchpoint_addr_within_range (struct target_ops *target,
- CORE_ADDR addr,
-- CORE_ADDR start, int length)
-+ CORE_ADDR start, LONGEST length)
- {
- return addr >= start && addr < start + length;
- }
-Index: gdb-7.10.50.20151027/gdb/target.h
-===================================================================
---- gdb-7.10.50.20151027.orig/gdb/target.h 2015-11-08 10:36:33.069071941 +0100
-+++ gdb-7.10.50.20151027/gdb/target.h 2015-11-08 10:36:33.098072137 +0100
-@@ -543,7 +543,7 @@ struct target_ops
- int (*to_stopped_data_address) (struct target_ops *, CORE_ADDR *)
- TARGET_DEFAULT_RETURN (0);
- int (*to_watchpoint_addr_within_range) (struct target_ops *,
-- CORE_ADDR, CORE_ADDR, int)
-+ CORE_ADDR, CORE_ADDR, LONGEST)
- TARGET_DEFAULT_FUNC (default_watchpoint_addr_within_range);
-
- /* Documentation of this routine is provided with the corresponding
-@@ -553,7 +553,7 @@ struct target_ops
- TARGET_DEFAULT_FUNC (default_region_ok_for_hw_watchpoint);
-
- int (*to_can_accel_watchpoint_condition) (struct target_ops *,
-- CORE_ADDR, int, int,
-+ CORE_ADDR, LONGEST, int,
- struct expression *)
- TARGET_DEFAULT_RETURN (0);
- int (*to_masked_watch_num_registers) (struct target_ops *,
-Index: gdb-7.10.50.20151027/gdb/aarch64-linux-nat.c
-===================================================================
---- gdb-7.10.50.20151027.orig/gdb/aarch64-linux-nat.c 2015-11-08 10:36:33.074071975 +0100
-+++ gdb-7.10.50.20151027/gdb/aarch64-linux-nat.c 2015-11-08 10:36:33.098072137 +0100
-@@ -795,7 +795,7 @@ aarch64_linux_stopped_by_watchpoint (str
- static int
- aarch64_linux_watchpoint_addr_within_range (struct target_ops *target,
- CORE_ADDR addr,
-- CORE_ADDR start, int length)
-+ CORE_ADDR start, LONGEST length)
- {
- return start <= addr && start + length - 1 >= addr;
- }
-Index: gdb-7.10.50.20151027/gdb/target-delegates.c
-===================================================================
---- gdb-7.10.50.20151027.orig/gdb/target-delegates.c 2015-11-08 10:36:33.073071968 +0100
-+++ gdb-7.10.50.20151027/gdb/target-delegates.c 2015-11-08 10:36:33.099072144 +0100
-@@ -709,14 +709,14 @@ debug_stopped_data_address (struct targe
+diff --git a/gdb/target-delegates.c b/gdb/target-delegates.c
+index 2b449cbf01..f725215fff 100644
+--- a/gdb/target-delegates.c
++++ b/gdb/target-delegates.c
+@@ -733,14 +733,14 @@ debug_stopped_data_address (struct target_ops *self, CORE_ADDR *arg1)
}
static int
@@ -295,7 +368,7 @@ Index: gdb-7.10.50.20151027/gdb/target-delegates.c
{
int result;
fprintf_unfiltered (gdb_stdlog, "-> %s->to_watchpoint_addr_within_range (...)\n", debug_target.to_shortname);
-@@ -728,7 +728,7 @@ debug_watchpoint_addr_within_range (stru
+@@ -752,7 +752,7 @@ debug_watchpoint_addr_within_range (struct target_ops *self, CORE_ADDR arg1, COR
fputs_unfiltered (", ", gdb_stdlog);
target_debug_print_CORE_ADDR (arg2);
fputs_unfiltered (", ", gdb_stdlog);
@@ -304,7 +377,7 @@ Index: gdb-7.10.50.20151027/gdb/target-delegates.c
fputs_unfiltered (") = ", gdb_stdlog);
target_debug_print_int (result);
fputs_unfiltered ("\n", gdb_stdlog);
-@@ -761,20 +761,20 @@ debug_region_ok_for_hw_watchpoint (struc
+@@ -785,20 +785,20 @@ debug_region_ok_for_hw_watchpoint (struct target_ops *self, CORE_ADDR arg1, LONG
}
static int
@@ -328,7 +401,7 @@ Index: gdb-7.10.50.20151027/gdb/target-delegates.c
{
int result;
fprintf_unfiltered (gdb_stdlog, "-> %s->to_can_accel_watchpoint_condition (...)\n", debug_target.to_shortname);
-@@ -784,7 +784,7 @@ debug_can_accel_watchpoint_condition (st
+@@ -808,7 +808,7 @@ debug_can_accel_watchpoint_condition (struct target_ops *self, CORE_ADDR arg1, i
fputs_unfiltered (", ", gdb_stdlog);
target_debug_print_CORE_ADDR (arg1);
fputs_unfiltered (", ", gdb_stdlog);
@@ -337,99 +410,50 @@ Index: gdb-7.10.50.20151027/gdb/target-delegates.c
fputs_unfiltered (", ", gdb_stdlog);
target_debug_print_int (arg3);
fputs_unfiltered (", ", gdb_stdlog);
-Index: gdb-7.10.50.20151027/gdb/nat/aarch64-linux-hw-point.c
-===================================================================
---- gdb-7.10.50.20151027.orig/gdb/nat/aarch64-linux-hw-point.c 2015-10-27 02:48:31.000000000 +0100
-+++ gdb-7.10.50.20151027/gdb/nat/aarch64-linux-hw-point.c 2015-11-08 10:36:33.099072144 +0100
-@@ -111,7 +111,7 @@ aarch64_point_encode_ctrl_reg (enum targ
- Return 0 for any non-compliant ADDR and/or LEN; return 1 otherwise. */
-
- static int
--aarch64_point_is_aligned (int is_watchpoint, CORE_ADDR addr, int len)
-+aarch64_point_is_aligned (int is_watchpoint, CORE_ADDR addr, LONGEST len)
- {
- unsigned int alignment = 0;
-
-@@ -180,9 +180,10 @@ aarch64_point_is_aligned (int is_watchpo
- limitations can be largely relaxed with some further work. */
+diff --git a/gdb/target.c b/gdb/target.c
+index a1ac6d0697..eb0538cb82 100644
+--- a/gdb/target.c
++++ b/gdb/target.c
+@@ -53,7 +53,7 @@ static void generic_tls_error (void) ATTRIBUTE_NORETURN;
+ static void default_terminal_info (struct target_ops *, const char *, int);
- static void
--aarch64_align_watchpoint (CORE_ADDR addr, int len, CORE_ADDR *aligned_addr_p,
-+aarch64_align_watchpoint (CORE_ADDR addr, LONGEST len,
-+ CORE_ADDR *aligned_addr_p,
- int *aligned_len_p, CORE_ADDR *next_addr_p,
-- int *next_len_p)
-+ LONGEST *next_len_p)
- {
- int aligned_len;
- unsigned int offset;
-@@ -494,7 +495,7 @@ aarch64_handle_aligned_watchpoint (enum
+ static int default_watchpoint_addr_within_range (struct target_ops *,
+- CORE_ADDR, CORE_ADDR, int);
++ CORE_ADDR, CORE_ADDR, LONGEST);
+ static int default_region_ok_for_hw_watchpoint (struct target_ops *,
+ CORE_ADDR, LONGEST);
+@@ -3120,7 +3120,7 @@ default_region_ok_for_hw_watchpoint (struct target_ops *self,
static int
- aarch64_handle_unaligned_watchpoint (enum target_hw_bp_type type,
-- CORE_ADDR addr, int len, int is_insert,
-+ CORE_ADDR addr, LONGEST len, int is_insert,
- struct aarch64_debug_reg_state *state)
- {
- while (len > 0)
-@@ -517,9 +518,9 @@ aarch64_handle_unaligned_watchpoint (enu
- " "
- "aligned_addr: %s, aligned_len: %d\n"
- " "
-- "next_addr: %s, next_len: %d\n",
-+ "next_addr: %s, next_len: %s\n",
- is_insert, core_addr_to_string_nz (aligned_addr),
-- aligned_len, core_addr_to_string_nz (addr), len);
-+ aligned_len, core_addr_to_string_nz (addr), plongest (len));
-
- if (ret != 0)
- return ret;
-@@ -530,7 +531,7 @@ aarch64_handle_unaligned_watchpoint (enu
-
- int
- aarch64_handle_watchpoint (enum target_hw_bp_type type, CORE_ADDR addr,
-- int len, int is_insert,
-+ LONGEST len, int is_insert,
- struct aarch64_debug_reg_state *state)
- {
- if (aarch64_point_is_aligned (1 /* is_watchpoint */ , addr, len))
-@@ -581,14 +582,14 @@ aarch64_linux_set_debug_regs (const stru
- void
- aarch64_show_debug_reg_state (struct aarch64_debug_reg_state *state,
- const char *func, CORE_ADDR addr,
-- int len, enum target_hw_bp_type type)
-+ LONGEST len, enum target_hw_bp_type type)
+ default_watchpoint_addr_within_range (struct target_ops *target,
+ CORE_ADDR addr,
+- CORE_ADDR start, int length)
++ CORE_ADDR start, LONGEST length)
{
- int i;
-
- debug_printf ("%s", func);
- if (addr || len)
-- debug_printf (" (addr=0x%08lx, len=%d, type=%s)",
-- (unsigned long) addr, len,
-+ debug_printf (" (addr=0x%08lx, len=%s, type=%s)",
-+ (unsigned long) addr, plongest (len),
- type == hw_write ? "hw-write-watchpoint"
- : (type == hw_read ? "hw-read-watchpoint"
- : (type == hw_access ? "hw-access-watchpoint"
-Index: gdb-7.10.50.20151027/gdb/nat/aarch64-linux-hw-point.h
-===================================================================
---- gdb-7.10.50.20151027.orig/gdb/nat/aarch64-linux-hw-point.h 2015-10-27 02:48:31.000000000 +0100
-+++ gdb-7.10.50.20151027/gdb/nat/aarch64-linux-hw-point.h 2015-11-08 10:36:47.656170839 +0100
-@@ -168,7 +168,7 @@ int aarch64_handle_breakpoint (enum targ
- int len, int is_insert,
- struct aarch64_debug_reg_state *state);
- int aarch64_handle_watchpoint (enum target_hw_bp_type type, CORE_ADDR addr,
-- int len, int is_insert,
-+ LONGEST len, int is_insert,
- struct aarch64_debug_reg_state *state);
-
- void aarch64_linux_set_debug_regs (const struct aarch64_debug_reg_state *state,
-@@ -176,7 +176,7 @@ void aarch64_linux_set_debug_regs (const
-
- void aarch64_show_debug_reg_state (struct aarch64_debug_reg_state *state,
- const char *func, CORE_ADDR addr,
-- int len, enum target_hw_bp_type type);
-+ LONGEST len, enum target_hw_bp_type type);
+ return addr >= start && addr < start + length;
+ }
+diff --git a/gdb/target.h b/gdb/target.h
+index 7a70c3f6da..35eee91a83 100644
+--- a/gdb/target.h
++++ b/gdb/target.h
+@@ -535,7 +535,7 @@ struct target_ops
+ int (*to_stopped_data_address) (struct target_ops *, CORE_ADDR *)
+ TARGET_DEFAULT_RETURN (0);
+ int (*to_watchpoint_addr_within_range) (struct target_ops *,
+- CORE_ADDR, CORE_ADDR, int)
++ CORE_ADDR, CORE_ADDR, LONGEST)
+ TARGET_DEFAULT_FUNC (default_watchpoint_addr_within_range);
- void aarch64_linux_get_debug_reg_capacity (int tid);
+ /* Documentation of this routine is provided with the corresponding
+@@ -545,7 +545,7 @@ struct target_ops
+ TARGET_DEFAULT_FUNC (default_region_ok_for_hw_watchpoint);
+ int (*to_can_accel_watchpoint_condition) (struct target_ops *,
+- CORE_ADDR, int, int,
++ CORE_ADDR, LONGEST, int,
+ struct expression *)
+ TARGET_DEFAULT_RETURN (0);
+ int (*to_masked_watch_num_registers) (struct target_ops *,
+--
+2.14.3
+
diff --git a/gdb-rhbz795424-bitpos-25of25.patch b/gdb-rhbz795424-bitpos-25of25.patch
new file mode 100644
index 0000000..bc3c404
--- /dev/null
+++ b/gdb-rhbz795424-bitpos-25of25.patch
@@ -0,0 +1,153 @@
+From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
+From: Fedora GDB patches <invalid(a)email.com>
+Date: Fri, 27 Oct 2017 21:07:50 +0200
+Subject: Expand fortran array bounds sizes to LONGEST
+
+FileName: gdb-rhbz795424-bitpos-25of25.patch
+
+;; Fix `GDB cannot access struct member whose offset is larger than 256MB'
+;; (RH BZ 795424).
+;;=push
+
+http://sourceware.org/ml/gdb-patches/2012-08/msg00562.html
+
+--MP_/90J7bck2fqDySEX9JkZtaqL
+Content-Type: text/plain; charset=US-ASCII
+Content-Transfer-Encoding: 7bit
+Content-Disposition: inline
+
+Hi,
+
+Range bounds for a gdb type can have LONGEST values for low and high
+bounds. Fortran range bounds functions however use only int. The larger
+ranges don't compile by default on gcc, but it is possible to override
+the check in the compiler by using -fno-range-check. As a result, this
+check is necessary so that we don't print junk in case of an overflow.
+
+Attached patch does this expansion and also includes a test case that
+verifies that the problem is fixed. I have also verified on x86_64 that
+this patch does not cause any regressions.
+
+Regards,
+Siddhesh
+
+gdb/ChangeLog:
+
+ * f-lang.h (f77_get_upperbound): Return LONGEST.
+ (f77_get_lowerbound): Likewise.
+ * f-typeprint.c (f_type_print_varspec_suffix): Expand
+ UPPER_BOUND and LOWER_BOUND to LONGEST. Use plongest to format
+ print them.
+ (f_type_print_base): Expand UPPER_BOUND to LONGEST. Use
+ plongest to format print it.
+ * f-valprint.c (f77_get_lowerbound): Return LONGEST.
+ (f77_get_upperbound): Likewise.
+ (f77_get_dynamic_length_of_aggregate): Expand UPPER_BOUND,
+ LOWER_BOUND to LONGEST.
+ (f77_create_arrayprint_offset_tbl): Likewise.
+
+testsuite/ChangeLog:
+
+ * gdb.fortran/array-bounds.exp: New test case.
+ * gdb.fortran/array-bounds.f: New test case.
+
+--MP_/90J7bck2fqDySEX9JkZtaqL
+Content-Type: text/x-patch
+Content-Transfer-Encoding: 7bit
+Content-Disposition: attachment; filename=f77-bounds.patch
+---
+ gdb/f-lang.h | 4 ++--
+ gdb/f-typeprint.c | 10 +++++-----
+ gdb/f-valprint.c | 4 ++--
+ 3 files changed, 9 insertions(+), 9 deletions(-)
+
+diff --git a/gdb/f-lang.h b/gdb/f-lang.h
+index 9171a13bdf..9ec58f808e 100644
+--- a/gdb/f-lang.h
++++ b/gdb/f-lang.h
+@@ -49,9 +49,9 @@ struct common_block
+ struct symbol *contents[1];
+ };
+
+-extern int f77_get_upperbound (struct type *);
++extern LONGEST f77_get_upperbound (struct type *);
+
+-extern int f77_get_lowerbound (struct type *);
++extern LONGEST f77_get_lowerbound (struct type *);
+
+ extern void f77_get_dynamic_array_length (struct type *);
+
+diff --git a/gdb/f-typeprint.c b/gdb/f-typeprint.c
+index 4f6a0ed09a..c330522913 100644
+--- a/gdb/f-typeprint.c
++++ b/gdb/f-typeprint.c
+@@ -149,7 +149,7 @@ f_type_print_varspec_suffix (struct type *type, struct ui_file *stream,
+ int show, int passed_a_ptr, int demangled_args,
+ int arrayprint_recurse_level, int print_rank_only)
+ {
+- int upper_bound, lower_bound;
++ LONGEST upper_bound, lower_bound;
+
+ /* No static variables are permitted as an error call may occur during
+ execution of this function. */
+@@ -196,7 +196,7 @@ f_type_print_varspec_suffix (struct type *type, struct ui_file *stream,
+ {
+ lower_bound = f77_get_lowerbound (type);
+ if (lower_bound != 1) /* Not the default. */
+- fprintf_filtered (stream, "%d:", lower_bound);
++ fprintf_filtered (stream, "%s:", plongest (lower_bound));
+
+ /* Make sure that, if we have an assumed size array, we
+ print out a warning and print the upperbound as '*'. */
+@@ -206,7 +206,7 @@ f_type_print_varspec_suffix (struct type *type, struct ui_file *stream,
+ else
+ {
+ upper_bound = f77_get_upperbound (type);
+- fprintf_filtered (stream, "%d", upper_bound);
++ fprintf_filtered (stream, "%s", plongest (upper_bound));
+ }
+ }
+
+@@ -278,7 +278,7 @@ void
+ f_type_print_base (struct type *type, struct ui_file *stream, int show,
+ int level)
+ {
+- int upper_bound;
++ LONGEST upper_bound;
+ int index;
+
+ QUIT;
+@@ -365,7 +365,7 @@ f_type_print_base (struct type *type, struct ui_file *stream, int show,
+ else
+ {
+ upper_bound = f77_get_upperbound (type);
+- fprintf_filtered (stream, "character*%d", upper_bound);
++ fprintf_filtered (stream, "character*%s", plongest (upper_bound));
+ }
+ break;
+
+diff --git a/gdb/f-valprint.c b/gdb/f-valprint.c
+index 0772f359f0..03400ae431 100644
+--- a/gdb/f-valprint.c
++++ b/gdb/f-valprint.c
+@@ -41,7 +41,7 @@ LONGEST f77_array_offset_tbl[MAX_FORTRAN_DIMS + 1][2];
+ /* Array which holds offsets to be applied to get a row's elements
+ for a given array. Array also holds the size of each subarray. */
+
+-int
++LONGEST
+ f77_get_lowerbound (struct type *type)
+ {
+ if (TYPE_ARRAY_LOWER_BOUND_IS_UNDEFINED (type))
+@@ -50,7 +50,7 @@ f77_get_lowerbound (struct type *type)
+ return TYPE_ARRAY_LOWER_BOUND_VALUE (type);
+ }
+
+-int
++LONGEST
+ f77_get_upperbound (struct type *type)
+ {
+ if (TYPE_ARRAY_UPPER_BOUND_IS_UNDEFINED (type))
+--
+2.14.3
+
diff --git a/gdb-rhbz795424-bitpos-lazyvalue.patch b/gdb-rhbz795424-bitpos-lazyvalue.patch
index 5f427e7..15a0742 100644
--- a/gdb-rhbz795424-bitpos-lazyvalue.patch
+++ b/gdb-rhbz795424-bitpos-lazyvalue.patch
@@ -1,104 +1,29 @@
-Index: gdb-7.11.50.20160630/gdb/testsuite/gdb.base/longest-types-64bit.exp
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ gdb-7.11.50.20160630/gdb/testsuite/gdb.base/longest-types-64bit.exp 2016-07-03 15:00:57.617347850 +0200
-@@ -0,0 +1,59 @@
-+# This testcase is part of GDB, the GNU debugger.
-+
-+# Copyright 2012 Free Software Foundation, Inc.
-+
-+# This program is free software; you can redistribute it and/or modify
-+# it under the terms of the GNU General Public License as published by
-+# the Free Software Foundation; either version 3 of the License, or
-+# (at your option) any later version.
-+#
-+# This program is distributed in the hope that it will be useful,
-+# but WITHOUT ANY WARRANTY; without even the implied warranty of
-+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+# GNU General Public License for more details.
-+#
-+# You should have received a copy of the GNU General Public License
-+# along with this program. If not, see <http://www.gnu.org/licenses/>.
-+
-+standard_testfile .c longest-types-64bit.S
-+
-+proc test { name } { with_test_prefix $name {
-+ # 64-bit array size should not overflow
-+ gdb_test "print &f->buf" {= \(char \(\*\)\[1099494850560\]\) 0x0}
-+
-+ # The offset should not overflow
-+ gdb_test "print &f->buf2" {= \(char \(\*\)\[2\]\) 0xffff000000}
-+}}
-+
-+
-+# Test 64-bit file first as it is not compiled so its compilation never fails.
-+
-+set file64bitbz2uu ${srcdir}/${subdir}/${testfile}.bz2.uu
-+set file64bit [standard_output_file ${testfile}]
-+
-+if {[catch "system \"uudecode -o - ${file64bitbz2uu} | bzip2 -dc >${file64bit}\""] != 0} {
-+ untested "failed uudecode or bzip2"
-+ return -1
-+}
-+file stat ${file64bit} file64bitstat
-+if {$file64bitstat(size) != 9501} {
-+ untested "uudecode or bzip2 produce invalid result"
-+ return -1
-+}
-+
-+clean_restart ${file64bit}
-+
-+#if { [prepare_for_testing ${testfile}.exp ${testfile} $srcfile2 {nodebug}] } {
-+# return -1
-+#}
-+
-+test "64bit"
-+
-+
-+# And here is the native build test.
-+
-+if { [prepare_for_testing ${testfile}.exp ${testfile} $srcfile {debug quiet}] } {
-+ return -1
-+}
-+
-+test "native"
-Index: gdb-7.11.50.20160630/gdb/testsuite/gdb.base/longest-types-64bit.c
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ gdb-7.11.50.20160630/gdb/testsuite/gdb.base/longest-types-64bit.c 2016-07-03 15:00:57.618347859 +0200
-@@ -0,0 +1,28 @@
-+/* This testcase is part of GDB, the GNU debugger.
-+
-+ Copyright 2012 Free Software Foundation, Inc.
-+
-+ This program is free software; you can redistribute it and/or modify
-+ it under the terms of the GNU General Public License as published by
-+ the Free Software Foundation; either version 3 of the License, or
-+ (at your option) any later version.
-+
-+ This program is distributed in the hope that it will be useful,
-+ but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ GNU General Public License for more details.
-+
-+ You should have received a copy of the GNU General Public License
-+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
-+
-+struct foo
-+{
-+ char buf[0xffff000000];
-+ char buf2[2];
-+} *f;
-+
-+int
-+main (void)
-+{
-+ return 0;
-+}
-Index: gdb-7.11.50.20160630/gdb/testsuite/gdb.base/longest-types-64bit.S
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ gdb-7.11.50.20160630/gdb/testsuite/gdb.base/longest-types-64bit.S 2016-07-03 15:00:57.618347859 +0200
+From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
+From: Fedora GDB patches <invalid(a)email.com>
+Date: Fri, 27 Oct 2017 21:07:50 +0200
+Subject: gdb-rhbz795424-bitpos-lazyvalue.patch
+
+FileName: gdb-rhbz795424-bitpos-lazyvalue.patch
+
+;; Fix `GDB cannot access struct member whose offset is larger than 256MB'
+;; (RH BZ 795424).
+;;=push
+---
+ gdb/testsuite/gdb.base/longest-types-64bit.S | 249 ++++++++++++++++++++++
+ gdb/testsuite/gdb.base/longest-types-64bit.bz2.uu | 67 ++++++
+ gdb/testsuite/gdb.base/longest-types-64bit.c | 28 +++
+ gdb/testsuite/gdb.base/longest-types-64bit.exp | 59 +++++
+ 4 files changed, 403 insertions(+)
+ create mode 100644 gdb/testsuite/gdb.base/longest-types-64bit.S
+ create mode 100644 gdb/testsuite/gdb.base/longest-types-64bit.bz2.uu
+ create mode 100644 gdb/testsuite/gdb.base/longest-types-64bit.c
+ create mode 100644 gdb/testsuite/gdb.base/longest-types-64bit.exp
+
+diff --git a/gdb/testsuite/gdb.base/longest-types-64bit.S b/gdb/testsuite/gdb.base/longest-types-64bit.S
+new file mode 100644
+index 0000000000..336d3fdb7a
+--- /dev/null
++++ b/gdb/testsuite/gdb.base/longest-types-64bit.S
@@ -0,0 +1,249 @@
+/* This testcase is part of GDB, the GNU debugger.
+
@@ -349,10 +274,11 @@ Index: gdb-7.11.50.20160630/gdb/testsuite/gdb.base/longest-types-64bit.S
+ .string "char"
+ .ident "GCC: (GNU) 4.7.3 20121109 (prerelease)"
+ .section .note.GNU-stack,"",@progbits
-Index: gdb-7.11.50.20160630/gdb/testsuite/gdb.base/longest-types-64bit.bz2.uu
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ gdb-7.11.50.20160630/gdb/testsuite/gdb.base/longest-types-64bit.bz2.uu 2016-07-03 15:00:57.618347859 +0200
+diff --git a/gdb/testsuite/gdb.base/longest-types-64bit.bz2.uu b/gdb/testsuite/gdb.base/longest-types-64bit.bz2.uu
+new file mode 100644
+index 0000000000..4007da2917
+--- /dev/null
++++ b/gdb/testsuite/gdb.base/longest-types-64bit.bz2.uu
@@ -0,0 +1,67 @@
+begin 755 gdb.base/longest-types-64bit.bz2
+M0EIH.3%!62936<'N#OH`"G/________^______?_Y______//]7SQD5'^/_%
@@ -421,3 +347,105 @@ Index: gdb-7.11.50.20160630/gdb/testsuite/gdb.base/longest-types-64bit.bz2.uu
+?<55!2^6_8J$)-O<>\H0U/6Q^>UG0%W)%.%"0P>X.^@``
+`
+end
+diff --git a/gdb/testsuite/gdb.base/longest-types-64bit.c b/gdb/testsuite/gdb.base/longest-types-64bit.c
+new file mode 100644
+index 0000000000..1394c08bdc
+--- /dev/null
++++ b/gdb/testsuite/gdb.base/longest-types-64bit.c
+@@ -0,0 +1,28 @@
++/* This testcase is part of GDB, the GNU debugger.
++
++ Copyright 2012 Free Software Foundation, Inc.
++
++ This program is free software; you can redistribute it and/or modify
++ it under the terms of the GNU General Public License as published by
++ the Free Software Foundation; either version 3 of the License, or
++ (at your option) any later version.
++
++ This program is distributed in the hope that it will be useful,
++ but WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++ GNU General Public License for more details.
++
++ You should have received a copy of the GNU General Public License
++ along with this program. If not, see <http://www.gnu.org/licenses/>. */
++
++struct foo
++{
++ char buf[0xffff000000];
++ char buf2[2];
++} *f;
++
++int
++main (void)
++{
++ return 0;
++}
+diff --git a/gdb/testsuite/gdb.base/longest-types-64bit.exp b/gdb/testsuite/gdb.base/longest-types-64bit.exp
+new file mode 100644
+index 0000000000..4871dec72f
+--- /dev/null
++++ b/gdb/testsuite/gdb.base/longest-types-64bit.exp
+@@ -0,0 +1,59 @@
++# This testcase is part of GDB, the GNU debugger.
++
++# Copyright 2012 Free Software Foundation, Inc.
++
++# This program is free software; you can redistribute it and/or modify
++# it under the terms of the GNU General Public License as published by
++# the Free Software Foundation; either version 3 of the License, or
++# (at your option) any later version.
++#
++# This program is distributed in the hope that it will be useful,
++# but WITHOUT ANY WARRANTY; without even the implied warranty of
++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++# GNU General Public License for more details.
++#
++# You should have received a copy of the GNU General Public License
++# along with this program. If not, see <http://www.gnu.org/licenses/>.
++
++standard_testfile .c longest-types-64bit.S
++
++proc test { name } { with_test_prefix $name {
++ # 64-bit array size should not overflow
++ gdb_test "print &f->buf" {= \(char \(\*\)\[1099494850560\]\) 0x0}
++
++ # The offset should not overflow
++ gdb_test "print &f->buf2" {= \(char \(\*\)\[2\]\) 0xffff000000}
++}}
++
++
++# Test 64-bit file first as it is not compiled so its compilation never fails.
++
++set file64bitbz2uu ${srcdir}/${subdir}/${testfile}.bz2.uu
++set file64bit [standard_output_file ${testfile}]
++
++if {[catch "system \"uudecode -o - ${file64bitbz2uu} | bzip2 -dc >${file64bit}\""] != 0} {
++ untested "failed uudecode or bzip2"
++ return -1
++}
++file stat ${file64bit} file64bitstat
++if {$file64bitstat(size) != 9501} {
++ untested "uudecode or bzip2 produce invalid result"
++ return -1
++}
++
++clean_restart ${file64bit}
++
++#if { [prepare_for_testing ${testfile}.exp ${testfile} $srcfile2 {nodebug}] } {
++# return -1
++#}
++
++test "64bit"
++
++
++# And here is the native build test.
++
++if { [prepare_for_testing ${testfile}.exp ${testfile} $srcfile {debug quiet}] } {
++ return -1
++}
++
++test "native"
+--
+2.14.3
+
diff --git a/gdb-stale-frame_info.patch b/gdb-stale-frame_info.patch
index bc42e68..8504aba 100644
--- a/gdb-stale-frame_info.patch
+++ b/gdb-stale-frame_info.patch
@@ -1,5 +1,14 @@
+From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
+From: Fedora GDB patches <invalid(a)email.com>
+Date: Fri, 27 Oct 2017 21:07:50 +0200
+Subject: workaround stale frame_info * (PR 13866)
+
+FileName: gdb-stale-frame_info.patch
+
+;; Workaround crashes from stale frame_info pointer (BZ 804256).
+;;=push+jan
+
http://sourceware.org/ml/gdb-patches/2012-04/msg00058.html
-Subject: [downstream patch FYI] workaround stale frame_info * (PR 13866)
Hi,
@@ -21,39 +30,41 @@ testsuite under valgrind I did not find feasible.
No regressions on {x86_64,x86_64-m32,i686}-fedora17-linux-gnu.
-
Thanks,
Jan
-
gdb/
2012-04-04 Jan Kratochvil <jan.kratochvil(a)redhat.com>
Workaround PR backtrace/13866.
* progspace.c (switch_to_program_space_and_thread): Try not to call
switch_to_thread.
-
---- a/gdb/progspace.c
-+++ b/gdb/progspace.c
-@@ -481,17 +481,28 @@ save_current_space_and_thread (void)
+---
+ gdb/progspace-and-thread.c | 18 ++++++++++++++++--
+ 1 file changed, 16 insertions(+), 2 deletions(-)
+
+diff --git a/gdb/progspace-and-thread.c b/gdb/progspace-and-thread.c
+index 27d626b05f..ee6342d96a 100644
+--- a/gdb/progspace-and-thread.c
++++ b/gdb/progspace-and-thread.c
+@@ -23,15 +23,29 @@
void
- switch_to_program_space_and_thread (struct program_space *pspace)
+ switch_to_program_space_and_thread (program_space *pspace)
{
-- struct inferior *inf;
-+ struct inferior *inf = current_inferior ();
-
-- inf = find_inferior_for_program_space (pspace);
+- inferior *inf = find_inferior_for_program_space (pspace);
++ inferior *inf = current_inferior ();
++
+ if (inf->pspace != pspace)
+ inf = find_inferior_for_program_space (pspace);
+
if (inf != NULL && inf->pid != 0)
{
-- struct thread_info *tp;
-+ struct thread_info *tp, *current_tp = NULL;
+ thread_info *tp = any_live_thread_of_process (inf->pid);
++ thread_info *current_tp = NULL;
+
+ if (ptid_get_pid (inferior_ptid) == inf->pid)
+ current_tp = find_thread_ptid (inferior_ptid);
- tp = any_live_thread_of_process (inf->pid);
if (tp != NULL)
{
- switch_to_thread (tp->ptid);
@@ -68,107 +79,6 @@ gdb/
/* Switching thread switches pspace implicitly. We're
done. */
return;
+--
+2.14.3
-
-Reproducer with:
-./gdb -nx ~/t/thread -ex 'b 24' -ex r -ex 'until 25'
-Breakpoint 1, main () at /home/jkratoch/t/thread.c:24
-24 v++;
-Segmentation fault (core dumped)
-
-#include <pthread.h>
-#include <assert.h>
-#include <unistd.h>
-
-static int v;
-
-static void *start (void *arg)
-{
- v++;
- v++;
- v++;
- v++;
- sleep (100);
- return arg;
-}
-
-int main (void)
-{
- pthread_t thread1;
- int i;
-
- i = pthread_create (&thread1, NULL, start, NULL);
- assert (i == 0);
- v++;
- v++;
- v++;
- v++;
- i = pthread_join (thread1, NULL);
- assert (i == 0);
-
- return 0;
-}
-### --- a/gdb/frame.c
-### +++ b/gdb/frame.c
-### @@ -1522,12 +1522,30 @@ frame_observer_target_changed (struct target_ops *target)
-### reinit_frame_cache ();
-### }
-###
-### +typedef struct obstack obstack_s;
-### +DEF_VEC_O (obstack_s);
-### +static VEC (obstack_s) *frame_poison_vec;
-### +
-### +void frame_garbage_collection (void);
-### +void
-### +frame_garbage_collection (void)
-### +{
-### + struct obstack *obstack_p;
-### + int ix;
-### +
-### + for (ix = 0; VEC_iterate (obstack_s, frame_poison_vec, ix, obstack_p); ix++)
-### + obstack_free (obstack_p, 0);
-### +
-### + VEC_free (obstack_s, frame_poison_vec);
-### + frame_poison_vec = NULL;
-### +}
-### +
-### /* Flush the entire frame cache. */
-###
-### void
-### reinit_frame_cache (void)
-### {
-### - struct frame_info *fi;
-### + struct frame_info *fi, *fi_prev;
-###
-### /* Tear down all frame caches. */
-### for (fi = current_frame; fi != NULL; fi = fi->prev)
-### @@ -1538,8 +1556,14 @@ reinit_frame_cache (void)
-### fi->base->unwind->dealloc_cache (fi, fi->base_cache);
-### }
-###
-### + for (fi = current_frame; fi != NULL; fi = fi_prev)
-### + {
-### + fi_prev = fi->prev;
-### + memset (fi, 0, sizeof (*fi));
-### + }
-### + VEC_safe_push (obstack_s, frame_poison_vec, &frame_cache_obstack);
-### +
-### /* Since we can't really be sure what the first object allocated was. */
-### - obstack_free (&frame_cache_obstack, 0);
-### obstack_init (&frame_cache_obstack);
-###
-### if (current_frame != NULL)
-### --- a/gdb/top.c
-### +++ b/gdb/top.c
-### @@ -359,6 +359,11 @@ prepare_execute_command (void)
-### if (non_stop)
-### target_dcache_invalidate ();
-###
-### + {
-### + extern void frame_garbage_collection (void);
-### + frame_garbage_collection ();
-### + }
-### +
-### return cleanup;
-### }
-###
diff --git a/gdb-tls-1of2.patch b/gdb-tls-1of2.patch
deleted file mode 100644
index ef0d416..0000000
--- a/gdb-tls-1of2.patch
+++ /dev/null
@@ -1,47 +0,0 @@
-http://sourceware.org/ml/gdb-patches/2016-10/msg00206.html
-Subject: [patch+7.12.1 1/2] Code cleanup: write_exp_msymbol: +is_tls
-
-
---XMCwj5IQnwKtuyBG
-Content-Type: text/plain; charset=us-ascii
-Content-Disposition: inline
-
-Hi,
-
-no functionality change, for patch 2/2.
-
-
-Jan
-
---XMCwj5IQnwKtuyBG
-Content-Type: text/plain; charset=us-ascii
-Content-Disposition: inline; filename="tls1.patch"
-
-gdb/ChangeLog
-2016-10-09 Jan Kratochvil <jan.kratochvil(a)redhat.com>
-
- * parse.c (write_exp_msymbol): New variable is_tls, use it.
-
---- a/gdb/parse.c
-+++ b/gdb/parse.c
-@@ -484,6 +484,8 @@ write_exp_msymbol (struct parser_state *ps,
- struct obj_section *section = MSYMBOL_OBJ_SECTION (objfile, msymbol);
- enum minimal_symbol_type type = MSYMBOL_TYPE (msymbol);
- CORE_ADDR pc;
-+ const int is_tls = (section != NULL
-+ && section->the_bfd_section->flags & SEC_THREAD_LOCAL);
-
- /* The minimal symbol might point to a function descriptor;
- resolve it to the actual code address instead. */
-@@ -520,7 +522,7 @@ write_exp_msymbol (struct parser_state *ps,
- write_exp_elt_longcst (ps, (LONGEST) addr);
- write_exp_elt_opcode (ps, OP_LONG);
-
-- if (section && section->the_bfd_section->flags & SEC_THREAD_LOCAL)
-+ if (is_tls)
- {
- write_exp_elt_opcode (ps, UNOP_MEMVAL_TLS);
- write_exp_elt_objfile (ps, objfile);
-
---XMCwj5IQnwKtuyBG--
-
diff --git a/gdb-tls-2of2.patch b/gdb-tls-2of2.patch
deleted file mode 100644
index 3d97cb8..0000000
--- a/gdb-tls-2of2.patch
+++ /dev/null
@@ -1,159 +0,0 @@
-http://sourceware.org/ml/gdb-patches/2016-10/msg00207.html
-Subject: [patch+7.12.1 2/2] Fix TLS (such as 'errno') regression
-
-
---3Pql8miugIZX0722
-Content-Type: text/plain; charset=us-ascii
-Content-Disposition: inline
-
-Hi,
-
-2273f0ac95a79ce29ef42025c63f90e82cf907d7 is the first bad commit
-commit 2273f0ac95a79ce29ef42025c63f90e82cf907d7
-Author: Tom Tromey <tromey(a)redhat.com>
-Date: Tue Oct 15 13:28:57 2013 -0600
- change minsyms not to be relocated at read-time
-[FYI v3 06/10] change minsyms not to be relocated at read-time
-Message-Id: <1393441273-32268-7-git-send-email-tromey(a)redhat.com>
-https://sourceware.org/ml/gdb-patches/2014-02/msg00798.html
-
-mv /usr/lib/debug /usr/lib/debug-x
-echo 'int main(){}'|gcc -pthread -x c -
-./gdb -q -ex start -ex 'set debug expr 1' -ex 'p errno' ./a.out
- 0 UNOP_MEMVAL_TLS TLS type @0x35df7e0 (__thread /* "/lib64/libc.so.6" */ <thread local variable, no debug info>)
- 4 OP_LONG Type @0x35df850 (__CORE_ADDR), value 140737345728528 (0x7ffff77fb010)
-Cannot access memory at address 0xffffef7c9698
-->
- 0 UNOP_MEMVAL_TLS TLS type @0x3ad9520 (__thread /* "/lib64/libc.so.6" */ <thread local variable, no debug info>)
- 4 OP_LONG Type @0x3ad9590 (__CORE_ADDR), value 16 (0x10)
-$1 = 0
-
-With glibc debuginfo, that is without: mv /usr/lib/debug /usr/lib/debug-x
- 0 OP_VAR_VALUE Block @0x3b30e70, symbol @0x3b30d10 (errno)
-$1 = 0
-So such case is unrelated to this patch and the regression is not visible with
-glibc debuginfo installed.
-
-I guess all these issues will be solved by Gary Benson's Infinity.
-But at least for older non-Infinity glibcs GDB should not regress.
-
-For the testcase it is important the variable is in objfile with non-zero base
-address. glibc is a shared library for 'errno' but I found easier for the
-testcase to use PIE instead of a shlib. For TLS variables in PT_EXEC the
-regression obviously does not happen.
-
-It has been found by a more complete testcase present in Fedora, the fix there
-also solves more cases where FSF GDB currently cannot resolve 'errno':
- http://pkgs.fedoraproject.org/cgit/rpms/gdb.git/tree/gdb-6.5-bz185337-res...
- FAIL: gdb.dwarf2/dw2-errno2.exp: macros=N threads=Y: print errno for core
-
-No regressions on {x86_64,x86_64-m32,i686}-fedora26pre-linux-gnu.
-
-OK for check-in?
-
-
-Thanks,
-Jan
-
---3Pql8miugIZX0722
-Content-Type: text/plain; charset=us-ascii
-Content-Disposition: inline; filename="tls1-2.patch"
-
-gdb/ChangeLog
-2016-10-09 Jan Kratochvil <jan.kratochvil(a)redhat.com>
-
- * parse.c (write_exp_msymbol): Fix ADDR computation.
-
-gdb/testsuite/ChangeLog
-2016-10-09 Jan Kratochvil <jan.kratochvil(a)redhat.com>
-
- * gdb.threads/tls-nodebug-pie.c: New file.
- * gdb.threads/tls-nodebug-pie.exp: New file.
-
---- a/gdb/parse.c
-+++ b/gdb/parse.c
-@@ -480,13 +480,17 @@ write_exp_msymbol (struct parser_state *ps,
- struct objfile *objfile = bound_msym.objfile;
- struct gdbarch *gdbarch = get_objfile_arch (objfile);
-
-- CORE_ADDR addr = BMSYMBOL_VALUE_ADDRESS (bound_msym);
- struct obj_section *section = MSYMBOL_OBJ_SECTION (objfile, msymbol);
- enum minimal_symbol_type type = MSYMBOL_TYPE (msymbol);
-- CORE_ADDR pc;
-+ CORE_ADDR addr, pc;
- const int is_tls = (section != NULL
- && section->the_bfd_section->flags & SEC_THREAD_LOCAL);
-
-+ if (is_tls)
-+ addr = MSYMBOL_VALUE_RAW_ADDRESS (bound_msym.minsym);
-+ else
-+ addr = BMSYMBOL_VALUE_ADDRESS (bound_msym);
-+
- /* The minimal symbol might point to a function descriptor;
- resolve it to the actual code address instead. */
- pc = gdbarch_convert_from_func_ptr_addr (gdbarch, addr, ¤t_target);
---- /dev/null
-+++ b/gdb/testsuite/gdb.threads/tls-nodebug-pie.c
-@@ -0,0 +1,27 @@
-+/* This testcase is part of GDB, the GNU debugger.
-+
-+ Copyright 2016 Free Software Foundation, Inc.
-+
-+ This program is free software; you can redistribute it and/or modify
-+ it under the terms of the GNU General Public License as published by
-+ the Free Software Foundation; either version 3 of the License, or
-+ (at your option) any later version.
-+
-+ This program is distributed in the hope that it will be useful,
-+ but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ GNU General Public License for more details.
-+
-+ You should have received a copy of the GNU General Public License
-+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
-+
-+#include <pthread.h>
-+
-+__thread int thread_local = 42;
-+
-+int main(void)
-+{
-+ /* Ensure we link against pthreads even with --as-needed. */
-+ pthread_testcancel();
-+ return 0;
-+}
---- /dev/null
-+++ b/gdb/testsuite/gdb.threads/tls-nodebug-pie.exp
-@@ -0,0 +1,29 @@
-+# Copyright 2016 Free Software Foundation, Inc.
-+
-+# This program is free software; you can redistribute it and/or modify
-+# it under the terms of the GNU General Public License as published by
-+# the Free Software Foundation; either version 3 of the License, or
-+# (at your option) any later version.
-+#
-+# This program is distributed in the hope that it will be useful,
-+# but WITHOUT ANY WARRANTY; without even the implied warranty of
-+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+# GNU General Public License for more details.
-+#
-+# You should have received a copy of the GNU General Public License
-+# along with this program. If not, see <http://www.gnu.org/licenses/>.
-+
-+standard_testfile
-+
-+if {[gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable \
-+ [list "additional_flags=-fPIE -pie"]] != "" } {
-+ return -1
-+}
-+
-+clean_restart ${binfile}
-+if ![runto_main] then {
-+ return 0
-+}
-+
-+# Formerly: Cannot access memory at address 0xd5554d5216fc
-+gdb_test "p thread_local" " = 42" "thread local storage"
-
---3Pql8miugIZX0722--
-
diff --git a/gdb-vla-intel-fix-print-char-array.patch b/gdb-vla-intel-fix-print-char-array.patch
new file mode 100644
index 0000000..76cd70f
--- /dev/null
+++ b/gdb-vla-intel-fix-print-char-array.patch
@@ -0,0 +1,72 @@
+From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
+From: Sergio Durigan Junior <sergiodj(a)redhat.com>
+Date: Thu, 7 Dec 2017 16:20:31 -0500
+Subject: gdb-vla-intel-fix-print-char-array.patch
+
+FileName: gdb-vla-intel-fix-print-char-array.patch
+
+;; Revert upstream commit 469412dd9ccc4de5874fd3299b105833f36b34cd
+
+Revert commit (only the part touching gdb/f-valprint.c):
+
+ commit 469412dd9ccc4de5874fd3299b105833f36b34cd
+ Author: Christoph Weinmann <christoph.t.weinmann(a)intel.com>
+ Date: Fri Sep 8 15:11:47 2017 +0200
+
+ Remove C/C++ relevant code in Fortran specific file.
+
+ Remove code relevant for printing C/C++ Integer values in a
+ Fortran specific file to unify printing of Fortran values.
+ This does not change the output.
+
+And adjust its testcase.
+---
+ gdb/f-valprint.c | 18 ++++++++++++++++--
+ gdb/testsuite/gdb.fortran/printing-types.exp | 2 +-
+ 2 files changed, 17 insertions(+), 3 deletions(-)
+
+diff --git a/gdb/f-valprint.c b/gdb/f-valprint.c
+index 03400ae431..aa33d848d6 100644
+--- a/gdb/f-valprint.c
++++ b/gdb/f-valprint.c
+@@ -313,8 +313,22 @@ f_val_print (struct type *type, LONGEST embedded_offset,
+ original_value, &opts, 0, stream);
+ }
+ else
+- val_print_scalar_formatted (type, embedded_offset,
+- original_value, options, 0, stream);
++ {
++ val_print_scalar_formatted (type, embedded_offset,
++ original_value, options, 0, stream);
++ /* C and C++ has no single byte int type, char is used instead.
++ Since we don't know whether the value is really intended to
++ be used as an integer or a character, print the character
++ equivalent as well. */
++ if (TYPE_LENGTH (type) == 1)
++ {
++ LONGEST c;
++
++ fputs_filtered (" ", stream);
++ c = unpack_long (type, valaddr + embedded_offset);
++ LA_PRINT_CHAR ((unsigned char) c, type, stream);
++ }
++ }
+ break;
+
+ case TYPE_CODE_STRUCT:
+diff --git a/gdb/testsuite/gdb.fortran/printing-types.exp b/gdb/testsuite/gdb.fortran/printing-types.exp
+index 9237907ed6..dbd0666422 100644
+--- a/gdb/testsuite/gdb.fortran/printing-types.exp
++++ b/gdb/testsuite/gdb.fortran/printing-types.exp
+@@ -29,7 +29,7 @@ if {![runto MAIN__]} then {
+ gdb_breakpoint [gdb_get_line_number "write"]
+ gdb_continue_to_breakpoint "write"
+
+-gdb_test "print oneByte" " = 1"
++gdb_test "print oneByte" " = 1 \'\\\\001\'"
+ gdb_test "print twobytes" " = 2"
+ gdb_test "print chvalue" " = \'a\'"
+ gdb_test "print logvalue" " = \.TRUE\."
+--
+2.14.3
+
diff --git a/gdb-vla-intel-fortran-strides.patch b/gdb-vla-intel-fortran-strides.patch
new file mode 100644
index 0000000..fc77bf5
--- /dev/null
+++ b/gdb-vla-intel-fortran-strides.patch
@@ -0,0 +1,2021 @@
+From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
+From: Fedora GDB patches <invalid(a)email.com>
+Date: Fri, 27 Oct 2017 21:07:50 +0200
+Subject: gdb-vla-intel-fortran-strides.patch
+
+FileName: gdb-vla-intel-fortran-strides.patch
+
+;; VLA (Fortran dynamic arrays) from Intel + archer-jankratochvil-vla tests.
+;;=push
+
+git diff --stat -p gdb/master...gdb/users/bheckel/fortran-strides
+dbfd7140bf4c0500d1f5d192be781f83f78f7922
+
+ gdb/dwarf2loc.c | 46 ++-
+ gdb/dwarf2loc.h | 6 +
+ gdb/dwarf2read.c | 13 +-
+ gdb/eval.c | 391 +++++++++++++++++++++-----
+ gdb/expprint.c | 20 +-
+ gdb/expression.h | 18 +-
+ gdb/f-exp.y | 42 ++-
+ gdb/f-valprint.c | 8 +-
+ gdb/gdbtypes.c | 34 ++-
+ gdb/gdbtypes.h | 18 +-
+ gdb/parse.c | 24 +-
+ gdb/rust-exp.y | 12 +-
+ gdb/rust-lang.c | 17 +-
+ gdb/testsuite/gdb.fortran/static-arrays.exp | 421 ++++++++++++++++++++++++++++
+ gdb/testsuite/gdb.fortran/static-arrays.f90 | 55 ++++
+ gdb/testsuite/gdb.fortran/vla-ptype.exp | 4 +
+ gdb/testsuite/gdb.fortran/vla-sizeof.exp | 4 +
+ gdb/testsuite/gdb.fortran/vla-stride.exp | 44 +++
+ gdb/testsuite/gdb.fortran/vla-stride.f90 | 29 ++
+ gdb/testsuite/gdb.fortran/vla.f90 | 10 +
+ gdb/valarith.c | 10 +-
+ gdb/valops.c | 197 +++++++++++--
+ gdb/value.h | 2 +
+ 23 files changed, 1242 insertions(+), 183 deletions(-)
+---
+ gdb/dwarf2loc.c | 46 ++-
+ gdb/dwarf2loc.h | 6 +
+ gdb/dwarf2read.c | 13 +-
+ gdb/eval.c | 391 +++++++++++++++++++++-----
+ gdb/expprint.c | 20 +-
+ gdb/expression.h | 18 +-
+ gdb/f-exp.y | 42 ++-
+ gdb/f-valprint.c | 8 +-
+ gdb/gdbtypes.c | 34 ++-
+ gdb/gdbtypes.h | 18 +-
+ gdb/parse.c | 24 +-
+ gdb/rust-exp.y | 12 +-
+ gdb/rust-lang.c | 17 +-
+ gdb/testsuite/gdb.fortran/static-arrays.exp | 421 ++++++++++++++++++++++++++++
+ gdb/testsuite/gdb.fortran/static-arrays.f90 | 55 ++++
+ gdb/testsuite/gdb.fortran/vla-ptype.exp | 4 +
+ gdb/testsuite/gdb.fortran/vla-sizeof.exp | 4 +
+ gdb/testsuite/gdb.fortran/vla-stride.exp | 44 +++
+ gdb/testsuite/gdb.fortran/vla-stride.f90 | 29 ++
+ gdb/testsuite/gdb.fortran/vla.f90 | 10 +
+ gdb/valarith.c | 10 +-
+ gdb/valops.c | 199 +++++++++++--
+ gdb/value.h | 2 +
+ 23 files changed, 1245 insertions(+), 182 deletions(-)
+ create mode 100644 gdb/testsuite/gdb.fortran/static-arrays.exp
+ create mode 100644 gdb/testsuite/gdb.fortran/static-arrays.f90
+ create mode 100644 gdb/testsuite/gdb.fortran/vla-stride.exp
+ create mode 100644 gdb/testsuite/gdb.fortran/vla-stride.f90
+
+diff --git a/gdb/dwarf2loc.c b/gdb/dwarf2loc.c
+index 51f133f1b5..5105c8d23a 100644
+--- a/gdb/dwarf2loc.c
++++ b/gdb/dwarf2loc.c
+@@ -2601,11 +2601,14 @@ dwarf2_locexpr_baton_eval (const struct dwarf2_locexpr_baton *dlbaton,
+ /* See dwarf2loc.h. */
+
+ int
+-dwarf2_evaluate_property (const struct dynamic_prop *prop,
++dwarf2_evaluate_property_signed (const struct dynamic_prop *prop,
+ struct frame_info *frame,
+ struct property_addr_info *addr_stack,
+- CORE_ADDR *value)
++ CORE_ADDR *value,
++ int is_signed)
+ {
++ int rc = 0;
++
+ if (prop == NULL)
+ return 0;
+
+@@ -2629,7 +2632,7 @@ dwarf2_evaluate_property (const struct dynamic_prop *prop,
+
+ *value = value_as_address (val);
+ }
+- return 1;
++ rc = 1;
+ }
+ }
+ break;
+@@ -2651,7 +2654,7 @@ dwarf2_evaluate_property (const struct dynamic_prop *prop,
+ if (!value_optimized_out (val))
+ {
+ *value = value_as_address (val);
+- return 1;
++ rc = 1;
+ }
+ }
+ }
+@@ -2659,8 +2662,8 @@ dwarf2_evaluate_property (const struct dynamic_prop *prop,
+
+ case PROP_CONST:
+ *value = prop->data.const_val;
+- return 1;
+-
++ rc = 1;
++ break;
+ case PROP_ADDR_OFFSET:
+ {
+ struct dwarf2_property_baton *baton
+@@ -2681,11 +2684,38 @@ dwarf2_evaluate_property (const struct dynamic_prop *prop,
+ val = value_at (baton->offset_info.type,
+ pinfo->addr + baton->offset_info.offset);
+ *value = value_as_address (val);
+- return 1;
++ rc = 1;
+ }
++ break;
+ }
+
+- return 0;
++ if (rc == 1 && is_signed == 1)
++ {
++ /* If we have a valid return candidate and it's value is signed,
++ we have to sign-extend the value because CORE_ADDR on 64bit machine has
++ 8 bytes but address size of an 32bit application is 4 bytes. */
++ struct gdbarch * gdbarch = target_gdbarch ();
++ const int addr_bit = gdbarch_addr_bit (gdbarch);
++ const CORE_ADDR neg_mask = ((~0) << (addr_bit - 1));
++
++ /* Check if signed bit is set and sign-extend values. */
++ if (*value & (neg_mask))
++ *value |= (neg_mask );
++ }
++ return rc;
++}
++
++int
++dwarf2_evaluate_property (const struct dynamic_prop *prop,
++ struct frame_info *frame,
++ struct property_addr_info *addr_stack,
++ CORE_ADDR *value)
++{
++ return dwarf2_evaluate_property_signed (prop,
++ frame,
++ addr_stack,
++ value,
++ 0);
+ }
+
+ /* See dwarf2loc.h. */
+diff --git a/gdb/dwarf2loc.h b/gdb/dwarf2loc.h
+index f82e7b2d11..74f0597359 100644
+--- 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
+index a3028e5c52..59e749e416 100644
+--- a/gdb/dwarf2read.c
++++ b/gdb/dwarf2read.c
+@@ -17553,7 +17553,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;
+@@ -17573,7 +17573,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. */
+@@ -17606,6 +17608,13 @@ read_subrange_type (struct die_info *die, struct dwarf2_cu *cu)
+ break;
+ }
+
++ attr = dwarf2_attr (die, DW_AT_byte_stride, cu);
++ if (attr)
++ if (!attr_to_dynamic_prop (attr, die, cu, &stride))
++ complaint (&symfile_complaints, _("Missing DW_AT_byte_stride "
++ "- DIE at 0x%x [in module %s]"),
++ to_underlying (die->sect_off), objfile_name (cu->objfile));
++
+ attr = dwarf2_attr (die, DW_AT_lower_bound, cu);
+ if (attr)
+ attr_to_dynamic_prop (attr, die, cu, &low);
+@@ -17682,7 +17691,7 @@ read_subrange_type (struct die_info *die, struct dwarf2_cu *cu)
+ && !TYPE_UNSIGNED (base_type) && (high.data.const_val & negative_mask))
+ high.data.const_val |= negative_mask;
+
+- range_type = create_range_type (NULL, orig_base_type, &low, &high);
++ range_type = create_range_type (NULL, orig_base_type, &low, &high, &stride);
+
+ if (high_bound_is_count)
+ TYPE_RANGE_DATA (range_type)->flag_upper_bound_is_count = 1;
+diff --git a/gdb/eval.c b/gdb/eval.c
+index 6f74c41b9f..d9bca2791d 100644
+--- a/gdb/eval.c
++++ b/gdb/eval.c
+@@ -384,29 +384,325 @@ init_array_element (struct value *array, struct value *element,
+ return index;
+ }
+
++/* Evaluates any operation on Fortran arrays or strings with at least
++ one user provided parameter. Expects the input ARRAY to be either
++ an array, or a string. Evaluates EXP by incrementing POS, and
++ writes the content from the elt stack into a local struct. NARGS
++ specifies number of literal or range arguments the user provided.
++ NARGS must be the same number as ARRAY has dimensions. */
++
+ static struct value *
+-value_f90_subarray (struct value *array,
+- struct expression *exp, int *pos, enum noside noside)
++value_f90_subarray (struct value *array, struct expression *exp,
++ int *pos, int nargs, enum noside noside)
+ {
+- int pc = (*pos) + 1;
++ int i, dim_count = 0;
+ LONGEST low_bound, high_bound;
+- struct type *range = check_typedef (TYPE_INDEX_TYPE (value_type (array)));
+- enum range_type range_type
+- = (enum range_type) longest_to_int (exp->elts[pc].longconst);
+-
+- *pos += 3;
+-
+- if (range_type == LOW_BOUND_DEFAULT || range_type == BOTH_BOUND_DEFAULT)
+- low_bound = TYPE_LOW_BOUND (range);
+- else
+- low_bound = value_as_long (evaluate_subexp (NULL_TYPE, exp, pos, noside));
++ struct value *new_array = array;
++ struct type *array_type = check_typedef (value_type (new_array));
++ struct type *elt_type;
++
++ typedef struct subscript_range
++ {
++ enum range_type f90_range_type;
++ LONGEST low, high, stride;
++ } subscript_range;
++
++ typedef enum subscript_kind
++ {
++ SUBSCRIPT_RANGE, /* e.g. "(lowbound:highbound)" */
++ SUBSCRIPT_INDEX /* e.g. "(literal)" */
++ } kind;
++
++ /* Local struct to hold user data for Fortran subarray dimensions. */
++ struct subscript_store
++ {
++ /* For every dimension, we are either working on a range or an index
++ expression, so we store this info separately for later. */
++ enum subscript_kind kind;
++
++ /* We also store either the lower and upper bound info, or the index
++ number. Before evaluation of the input values, we do not know if we are
++ actually working on a range of ranges, or an index in a range. So as a
++ first step we store all input in a union. The array calculation itself
++ deals with this later on. */
++ union element_range
++ {
++ subscript_range range;
++ LONGEST number;
++ } U;
++ } *subscript_array;
++
++ /* Check if the number of arguments provided by the user matches
++ the number of dimension of the array. A string has only one
++ dimension. */
++ if (nargs != calc_f77_array_dims (value_type (new_array)))
++ error (_("Wrong number of subscripts"));
++
++ subscript_array = (struct subscript_store*) alloca (sizeof (*subscript_array) * nargs);
++
++ /* Parse the user input into the SUBSCRIPT_ARRAY to store it. We need
++ to evaluate it first, as the input is from left-to-right. The
++ array is stored from right-to-left. So we have to use the user
++ input in reverse order. Later on, we need the input information to
++ re-calculate the output array. For multi-dimensional arrays, we
++ can be dealing with any possible combination of ranges and indices
++ for every dimension. */
++ for (i = 0; i < nargs; i++)
++ {
++ struct subscript_store *index = &subscript_array[i];
+
+- if (range_type == HIGH_BOUND_DEFAULT || range_type == BOTH_BOUND_DEFAULT)
+- high_bound = TYPE_HIGH_BOUND (range);
+- else
+- high_bound = value_as_long (evaluate_subexp (NULL_TYPE, exp, pos, noside));
++ /* The user input is a range, with or without lower and upper bound.
++ E.g.: "p arry(2:5)", "p arry( :5)", "p arry( : )", etc. */
++ if (exp->elts[*pos].opcode == OP_RANGE)
++ {
++ int pc = (*pos) + 1;
++ subscript_range *range;
++
++ index->kind = SUBSCRIPT_RANGE;
++ range = &index->U.range;
++
++ *pos += 3;
++ range->f90_range_type = (enum range_type) exp->elts[pc].longconst;
++
++ /* If a lower bound was provided by the user, the bit has been
++ set and we can assign the value from the elt stack. Same for
++ upper bound. */
++ if ((range->f90_range_type & SUBARRAY_LOW_BOUND)
++ == SUBARRAY_LOW_BOUND)
++ range->low = value_as_long (evaluate_subexp (NULL_TYPE, exp,
++ pos, noside));
++ if ((range->f90_range_type & SUBARRAY_HIGH_BOUND)
++ == SUBARRAY_HIGH_BOUND)
++ range->high = value_as_long (evaluate_subexp (NULL_TYPE, exp,
++ pos, noside));
++
++ /* Assign the user's stride value if provided. */
++ if ((range->f90_range_type & SUBARRAY_STRIDE) == SUBARRAY_STRIDE)
++ range->stride = value_as_long (evaluate_subexp (NULL_TYPE, exp,
++ pos, noside));
++
++ /* Assign the default stride value '1'. */
++ else
++ range->stride = 1;
++
++ /* Check the provided stride value is illegal, aka '0'. */
++ if (range->stride == 0)
++ error (_("Stride must not be 0"));
++ }
++ /* User input is an index. E.g.: "p arry(5)". */
++ else
++ {
++ struct value *val;
++
++ index->kind = SUBSCRIPT_INDEX;
++
++ /* Evaluate each subscript; it must be a legal integer in F77. This
++ ensures the validity of the provided index. */
++ val = evaluate_subexp_with_coercion (exp, pos, noside);
++ index->U.number = value_as_long (val);
++ }
++
++ }
++
++ /* Traverse the array from right to left and set the high and low bounds
++ for later use. */
++ for (i = nargs - 1; i >= 0; i--)
++ {
++ struct subscript_store *index = &subscript_array[i];
++ struct type *index_type = TYPE_INDEX_TYPE (array_type);
++
++ switch (index->kind)
++ {
++ case SUBSCRIPT_RANGE:
++ {
++
++ /* When we hit the first range specified by the user, we must
++ treat any subsequent user entry as a range. We simply
++ increment DIM_COUNT which tells us how many times we are
++ calling VALUE_SLICE_1. */
++ subscript_range *range = &index->U.range;
++
++ /* If no lower bound was provided by the user, we take the
++ default boundary. Same for the high bound. */
++ if ((range->f90_range_type & SUBARRAY_LOW_BOUND) == 0)
++ range->low = TYPE_LOW_BOUND (index_type);
++
++ if ((range->f90_range_type & SUBARRAY_HIGH_BOUND) == 0)
++ range->high = TYPE_HIGH_BOUND (index_type);
++
++ /* Both user provided low and high bound have to be inside the
++ array bounds. Throw an error if not. */
++ if (range->low < TYPE_LOW_BOUND (index_type)
++ || range->low > TYPE_HIGH_BOUND (index_type)
++ || range->high < TYPE_LOW_BOUND (index_type)
++ || range->high > TYPE_HIGH_BOUND (index_type))
++ error (_("provided bound(s) outside array bound(s)"));
++
++ /* For a negative stride the lower boundary must be larger than the
++ upper boundary.
++ For a positive stride the lower boundary must be smaller than the
++ upper boundary. */
++ if ((range->stride < 0 && range->low < range->high)
++ || (range->stride > 0 && range->low > range->high))
++ error (_("Wrong value provided for stride and boundaries"));
++
++ }
++ break;
++
++ case SUBSCRIPT_INDEX:
++ break;
++
++ }
++
++ array_type = TYPE_TARGET_TYPE (array_type);
++ }
++
++ /* Reset ARRAY_TYPE before slicing.*/
++ array_type = check_typedef (value_type (new_array));
++
++ /* Traverse the array from right to left and evaluate each corresponding
++ user input. VALUE_SUBSCRIPT is called for every index, until a range
++ expression is evaluated. After a range expression has been evaluated,
++ every subsequent expression is also treated as a range. */
++ for (i = nargs - 1; i >= 0; i--)
++ {
++ struct subscript_store *index = &subscript_array[i];
++ struct type *index_type = TYPE_INDEX_TYPE (array_type);
++
++ switch (index->kind)
++ {
++ case SUBSCRIPT_RANGE:
++ {
++
++ /* When we hit the first range specified by the user, we must
++ treat any subsequent user entry as a range. We simply
++ increment DIM_COUNT which tells us how many times we are
++ calling VALUE_SLICE_1. */
++ subscript_range *range = &index->U.range;
++
++ /* DIM_COUNT counts every user argument that is treated as a range.
++ This is necessary for expressions like 'print array(7, 8:9).
++ Here the first argument is a literal, but must be treated as a
++ range argument to allow the correct output representation. */
++ dim_count++;
++
++ new_array
++ = value_slice_1 (new_array, range->low,
++ range->high - range->low + 1,
++ range->stride, dim_count);
++ }
++ break;
++
++ case SUBSCRIPT_INDEX:
++ {
++ /* DIM_COUNT only stays '0' when no range argument was processed
++ before, starting from the last dimension. This way we can
++ reduce the number of dimensions from the result array.
++ However, if a range has been processed before an index, we
++ treat the index like a range with equal low- and high bounds
++ to get the value offset right. */
++ if (dim_count == 0)
++ new_array
++ = value_subscripted_rvalue (new_array, index->U.number,
++ f77_get_lowerbound (value_type
++ (new_array)));
++ else
++ {
++ dim_count++;
++
++ /* We might end up here, because we have to treat the provided
++ index like a range. But now VALUE_SUBSCRIPTED_RVALUE
++ cannot do the range checks for us. So we have to make sure
++ ourselves that the user provided index is inside the
++ array bounds. Throw an error if not. */
++ if (index->U.number < TYPE_LOW_BOUND (index_type)
++ && index->U.number > TYPE_HIGH_BOUND (index_type))
++ error (_("provided bound(s) outside array bound(s)"));
++
++ if (index->U.number > TYPE_LOW_BOUND (index_type)
++ && index->U.number > TYPE_HIGH_BOUND (index_type))
++ error (_("provided bound(s) outside array bound(s)"));
++
++ new_array = value_slice_1 (new_array,
++ index->U.number,
++ 1, /* COUNT is '1' element */
++ 1, /* STRIDE set to '1' */
++ dim_count);
++ }
++
++ }
++ break;
++ }
++ array_type = TYPE_TARGET_TYPE (array_type);
++ }
++
++ /* With DIM_COUNT > 1 we currently have a one dimensional array, but expect
++ an array of arrays, depending on how many ranges have been provided by
++ the user. So we need to rebuild the array dimensions for printing it
++ correctly.
++ Starting from right to left in the user input, after we hit the first
++ range argument every subsequent argument is also treated as a range.
++ E.g.:
++ "p ary(3, 7, 2:15)" in Fortran has only 1 dimension, but we calculated 3
++ ranges.
++ "p ary(3, 7:12, 4)" in Fortran has only 1 dimension, but we calculated 2
++ ranges.
++ "p ary(2:4, 5, 7)" in Fortran has only 1 dimension, and we calculated 1
++ range. */
++ if (dim_count > 1)
++ {
++ struct value *v = NULL;
++
++ elt_type = TYPE_TARGET_TYPE (value_type (new_array));
++
++ /* Every SUBSCRIPT_RANGE in the user input signifies an actual range in
++ the output array. So we traverse the SUBSCRIPT_ARRAY again, looking
++ for a range entry. When we find one, we use the range info to create
++ an additional range_type to set the correct bounds and dimensions for
++ the output array. In addition, we may have a stride value that is not
++ '1', forcing us to adjust the number of elements in a range, according
++ to the stride value. */
++ for (i = 0; i < nargs; i++)
++ {
++ struct subscript_store *index = &subscript_array[i];
++
++ if (index->kind == SUBSCRIPT_RANGE)
++ {
++ struct type *range_type, *interim_array_type;
++
++ int new_length;
+
+- return value_slice (array, low_bound, high_bound - low_bound + 1);
++ /* The length of a sub-dimension with all elements between the
++ bounds plus the start element itself. It may be modified by
++ a user provided stride value. */
++ new_length = index->U.range.high - index->U.range.low;
++
++ new_length /= index->U.range.stride;
++
++ range_type
++ = create_static_range_type (NULL,
++ elt_type,
++ index->U.range.low,
++ index->U.range.low + new_length);
++
++ interim_array_type = create_array_type (NULL,
++ elt_type,
++ range_type);
++
++ TYPE_CODE (interim_array_type)
++ = TYPE_CODE (value_type (new_array));
++
++ v = allocate_value (interim_array_type);
++
++ elt_type = value_type (v);
++ }
++
++ }
++ value_contents_copy (v, 0, new_array, 0, TYPE_LENGTH (elt_type));
++ return v;
++ }
++
++ return new_array;
+ }
+
+
+@@ -1928,19 +2224,8 @@ evaluate_subexp_standard (struct type *expect_type,
+ switch (code)
+ {
+ case TYPE_CODE_ARRAY:
+- if (exp->elts[*pos].opcode == OP_RANGE)
+- return value_f90_subarray (arg1, exp, pos, noside);
+- else
+- goto multi_f77_subscript;
+-
+ case TYPE_CODE_STRING:
+- if (exp->elts[*pos].opcode == OP_RANGE)
+- return value_f90_subarray (arg1, exp, pos, noside);
+- else
+- {
+- arg2 = evaluate_subexp_with_coercion (exp, pos, noside);
+- return value_subscript (arg1, value_as_long (arg2));
+- }
++ return value_f90_subarray (arg1, exp, pos, nargs, noside);
+
+ case TYPE_CODE_PTR:
+ case TYPE_CODE_FUNC:
+@@ -2336,49 +2621,6 @@ evaluate_subexp_standard (struct type *expect_type,
+ }
+ return (arg1);
+
+- multi_f77_subscript:
+- {
+- LONGEST subscript_array[MAX_FORTRAN_DIMS];
+- int ndimensions = 1, i;
+- struct value *array = arg1;
+-
+- if (nargs > MAX_FORTRAN_DIMS)
+- error (_("Too many subscripts for F77 (%d Max)"), MAX_FORTRAN_DIMS);
+-
+- ndimensions = calc_f77_array_dims (type);
+-
+- if (nargs != ndimensions)
+- error (_("Wrong number of subscripts"));
+-
+- gdb_assert (nargs > 0);
+-
+- /* Now that we know we have a legal array subscript expression
+- let us actually find out where this element exists in the array. */
+-
+- /* Take array indices left to right. */
+- for (i = 0; i < nargs; i++)
+- {
+- /* Evaluate each subscript; it must be a legal integer in F77. */
+- arg2 = evaluate_subexp_with_coercion (exp, pos, noside);
+-
+- /* Fill in the subscript array. */
+-
+- subscript_array[i] = value_as_long (arg2);
+- }
+-
+- /* Internal type of array is arranged right to left. */
+- for (i = nargs; i > 0; i--)
+- {
+- struct type *array_type = check_typedef (value_type (array));
+- LONGEST index = subscript_array[i - 1];
+-
+- array = value_subscripted_rvalue (array, index,
+- f77_get_lowerbound (array_type));
+- }
+-
+- return array;
+- }
+-
+ case BINOP_LOGICAL_AND:
+ arg1 = evaluate_subexp (NULL_TYPE, exp, pos, noside);
+ if (noside == EVAL_SKIP)
+@@ -3282,6 +3524,9 @@ calc_f77_array_dims (struct type *array_type)
+ int ndimen = 1;
+ struct type *tmp_type;
+
++ if (TYPE_CODE (array_type) == TYPE_CODE_STRING)
++ return 1;
++
+ if ((TYPE_CODE (array_type) != TYPE_CODE_ARRAY))
+ error (_("Can't get dimensions for a non-array type"));
+
+diff --git a/gdb/expprint.c b/gdb/expprint.c
+index ac5ae0fea1..41bb357a27 100644
+--- a/gdb/expprint.c
++++ b/gdb/expprint.c
+@@ -581,12 +581,10 @@ print_subexp_standard (struct expression *exp, int *pos,
+ *pos += 2;
+
+ fputs_filtered ("RANGE(", stream);
+- if (range_type == HIGH_BOUND_DEFAULT
+- || range_type == NONE_BOUND_DEFAULT)
++ if ((range_type & SUBARRAY_LOW_BOUND) == SUBARRAY_LOW_BOUND)
+ print_subexp (exp, pos, stream, PREC_ABOVE_COMMA);
+ fputs_filtered ("..", stream);
+- if (range_type == LOW_BOUND_DEFAULT
+- || range_type == NONE_BOUND_DEFAULT)
++ if ((range_type & SUBARRAY_HIGH_BOUND) == SUBARRAY_HIGH_BOUND)
+ print_subexp (exp, pos, stream, PREC_ABOVE_COMMA);
+ fputs_filtered (")", stream);
+ return;
+@@ -1094,16 +1092,16 @@ dump_subexp_body_standard (struct expression *exp,
+
+ switch (range_type)
+ {
+- case BOTH_BOUND_DEFAULT:
++ case SUBARRAY_NONE_BOUND:
+ fputs_filtered ("Range '..'", stream);
+ break;
+- case LOW_BOUND_DEFAULT:
++ case SUBARRAY_HIGH_BOUND:
+ fputs_filtered ("Range '..EXP'", stream);
+ break;
+- case HIGH_BOUND_DEFAULT:
++ case SUBARRAY_LOW_BOUND:
+ fputs_filtered ("Range 'EXP..'", stream);
+ break;
+- case NONE_BOUND_DEFAULT:
++ case (SUBARRAY_LOW_BOUND | SUBARRAY_HIGH_BOUND):
+ fputs_filtered ("Range 'EXP..EXP'", stream);
+ break;
+ default:
+@@ -1111,11 +1109,9 @@ dump_subexp_body_standard (struct expression *exp,
+ break;
+ }
+
+- if (range_type == HIGH_BOUND_DEFAULT
+- || range_type == NONE_BOUND_DEFAULT)
++ if ((range_type & SUBARRAY_LOW_BOUND) == SUBARRAY_LOW_BOUND)
+ elt = dump_subexp (exp, stream, elt);
+- if (range_type == LOW_BOUND_DEFAULT
+- || range_type == NONE_BOUND_DEFAULT)
++ if ((range_type & SUBARRAY_HIGH_BOUND) == SUBARRAY_HIGH_BOUND)
+ elt = dump_subexp (exp, stream, elt);
+ }
+ break;
+diff --git a/gdb/expression.h b/gdb/expression.h
+index a783ea5fef..be24792eb6 100644
+--- a/gdb/expression.h
++++ b/gdb/expression.h
+@@ -153,17 +153,17 @@ extern void dump_raw_expression (struct expression *,
+ struct ui_file *, const char *);
+ extern void dump_prefix_expression (struct expression *, struct ui_file *);
+
+-/* In an OP_RANGE expression, either bound could be empty, indicating
+- that its value is by default that of the corresponding bound of the
+- array or string. So we have four sorts of subrange. This
+- enumeration type is to identify this. */
+-
++/* In an OP_RANGE expression, either bound can be provided by the user, or not.
++ In addition to this, the user can also specify a stride value to indicated
++ only certain elements of the array. This enumeration type is to identify
++ this. */
++
+ enum range_type
+ {
+- BOTH_BOUND_DEFAULT, /* "(:)" */
+- LOW_BOUND_DEFAULT, /* "(:high)" */
+- HIGH_BOUND_DEFAULT, /* "(low:)" */
+- NONE_BOUND_DEFAULT /* "(low:high)" */
++ SUBARRAY_NONE_BOUND = 0x0, /* "( : )" */
++ SUBARRAY_LOW_BOUND = 0x1, /* "(low:)" */
++ SUBARRAY_HIGH_BOUND = 0x2, /* "(:high)" */
++ SUBARRAY_STRIDE = 0x4 /* "(::stride)" */
+ };
+
+ #endif /* !defined (EXPRESSION_H) */
+diff --git a/gdb/f-exp.y b/gdb/f-exp.y
+index 6495e03cc5..cd89bb7ca2 100644
+--- a/gdb/f-exp.y
++++ b/gdb/f-exp.y
+@@ -257,31 +257,63 @@ arglist : subrange
+
+ arglist : arglist ',' exp %prec ABOVE_COMMA
+ { arglist_len++; }
++ | arglist ',' subrange %prec ABOVE_COMMA
++ { arglist_len++; }
+ ;
+
+ /* There are four sorts of subrange types in F90. */
+
+ subrange: exp ':' exp %prec ABOVE_COMMA
+- { write_exp_elt_opcode (pstate, OP_RANGE);
+- write_exp_elt_longcst (pstate, NONE_BOUND_DEFAULT);
++ { write_exp_elt_opcode (pstate, OP_RANGE);
++ write_exp_elt_longcst (pstate,
++ SUBARRAY_LOW_BOUND | SUBARRAY_HIGH_BOUND);
+ write_exp_elt_opcode (pstate, OP_RANGE); }
+ ;
+
+ subrange: exp ':' %prec ABOVE_COMMA
+ { write_exp_elt_opcode (pstate, OP_RANGE);
+- write_exp_elt_longcst (pstate, HIGH_BOUND_DEFAULT);
++ write_exp_elt_longcst (pstate, SUBARRAY_LOW_BOUND);
+ write_exp_elt_opcode (pstate, OP_RANGE); }
+ ;
+
+ subrange: ':' exp %prec ABOVE_COMMA
+ { write_exp_elt_opcode (pstate, OP_RANGE);
+- write_exp_elt_longcst (pstate, LOW_BOUND_DEFAULT);
++ write_exp_elt_longcst (pstate, SUBARRAY_HIGH_BOUND);
+ write_exp_elt_opcode (pstate, OP_RANGE); }
+ ;
+
+ subrange: ':' %prec ABOVE_COMMA
+ { write_exp_elt_opcode (pstate, OP_RANGE);
+- write_exp_elt_longcst (pstate, BOTH_BOUND_DEFAULT);
++ write_exp_elt_longcst (pstate, SUBARRAY_NONE_BOUND);
++ write_exp_elt_opcode (pstate, OP_RANGE); }
++ ;
++
++/* Each subrange type can have a stride argument. */
++subrange: exp ':' exp ':' exp %prec ABOVE_COMMA
++ { write_exp_elt_opcode (pstate, OP_RANGE);
++ write_exp_elt_longcst (pstate, SUBARRAY_LOW_BOUND
++ | SUBARRAY_HIGH_BOUND
++ | SUBARRAY_STRIDE);
++ write_exp_elt_opcode (pstate, OP_RANGE); }
++ ;
++
++subrange: exp ':' ':' exp %prec ABOVE_COMMA
++ { write_exp_elt_opcode (pstate, OP_RANGE);
++ write_exp_elt_longcst (pstate, SUBARRAY_LOW_BOUND
++ | SUBARRAY_STRIDE);
++ write_exp_elt_opcode (pstate, OP_RANGE); }
++ ;
++
++subrange: ':' exp ':' exp %prec ABOVE_COMMA
++ { write_exp_elt_opcode (pstate, OP_RANGE);
++ write_exp_elt_longcst (pstate, SUBARRAY_HIGH_BOUND
++ | SUBARRAY_STRIDE);
++ write_exp_elt_opcode (pstate, OP_RANGE); }
++ ;
++
++subrange: ':' ':' exp %prec ABOVE_COMMA
++ { write_exp_elt_opcode (pstate, OP_RANGE);
++ write_exp_elt_longcst (pstate, SUBARRAY_STRIDE);
+ write_exp_elt_opcode (pstate, OP_RANGE); }
+ ;
+
+diff --git a/gdb/f-valprint.c b/gdb/f-valprint.c
+index 903f2af638..b4067a8460 100644
+--- a/gdb/f-valprint.c
++++ b/gdb/f-valprint.c
+@@ -119,8 +119,14 @@ f77_print_array_1 (int nss, int ndimensions, struct type *type,
+
+ if (nss != ndimensions)
+ {
+- size_t dim_size = TYPE_LENGTH (TYPE_TARGET_TYPE (type));
++ size_t dim_size;
+ size_t offs = 0;
++ LONGEST byte_stride = abs (TYPE_BYTE_STRIDE (range_type));
++
++ if (byte_stride)
++ dim_size = byte_stride;
++ else
++ dim_size = TYPE_LENGTH (TYPE_TARGET_TYPE (type));
+
+ for (i = lowerbound;
+ (i < upperbound + 1 && (*elts) < options->print_max);
+diff --git a/gdb/gdbtypes.c b/gdb/gdbtypes.c
+index 7ba62df474..519dfebba8 100644
+--- a/gdb/gdbtypes.c
++++ b/gdb/gdbtypes.c
+@@ -864,7 +864,8 @@ allocate_stub_method (struct type *type)
+ struct type *
+ create_range_type (struct type *result_type, struct type *index_type,
+ const struct dynamic_prop *low_bound,
+- const struct dynamic_prop *high_bound)
++ const struct dynamic_prop *high_bound,
++ const struct dynamic_prop *stride)
+ {
+ if (result_type == NULL)
+ result_type = alloc_type_copy (index_type);
+@@ -879,6 +880,7 @@ create_range_type (struct type *result_type, struct type *index_type,
+ TYPE_ZALLOC (result_type, sizeof (struct range_bounds));
+ TYPE_RANGE_DATA (result_type)->low = *low_bound;
+ TYPE_RANGE_DATA (result_type)->high = *high_bound;
++ TYPE_RANGE_DATA (result_type)->stride = *stride;
+
+ if (low_bound->kind == PROP_CONST && low_bound->data.const_val >= 0)
+ TYPE_UNSIGNED (result_type) = 1;
+@@ -907,7 +909,7 @@ struct type *
+ create_static_range_type (struct type *result_type, struct type *index_type,
+ LONGEST low_bound, LONGEST high_bound)
+ {
+- struct dynamic_prop low, high;
++ struct dynamic_prop low, high, stride;
+
+ low.kind = PROP_CONST;
+ low.data.const_val = low_bound;
+@@ -915,7 +917,11 @@ create_static_range_type (struct type *result_type, struct type *index_type,
+ high.kind = PROP_CONST;
+ high.data.const_val = high_bound;
+
+- result_type = create_range_type (result_type, index_type, &low, &high);
++ stride.kind = PROP_CONST;
++ stride.data.const_val = 0;
++
++ result_type = create_range_type (result_type, index_type,
++ &low, &high, &stride);
+
+ return result_type;
+ }
+@@ -1133,16 +1139,20 @@ create_array_type_with_stride (struct type *result_type,
+ && (!type_not_associated (result_type)
+ && !type_not_allocated (result_type)))
+ {
+- LONGEST low_bound, high_bound;
++ LONGEST low_bound, high_bound, byte_stride;
+
+ if (get_discrete_bounds (range_type, &low_bound, &high_bound) < 0)
+ low_bound = high_bound = 0;
+ element_type = check_typedef (element_type);
++ byte_stride = abs (TYPE_BYTE_STRIDE (range_type));
++
+ /* Be careful when setting the array length. Ada arrays can be
+ empty arrays with the high_bound being smaller than the low_bound.
+ In such cases, the array length should be zero. */
+ if (high_bound < low_bound)
+ TYPE_LENGTH (result_type) = 0;
++ else if (byte_stride > 0)
++ TYPE_LENGTH (result_type) = byte_stride * (high_bound - low_bound + 1);
+ else if (bit_stride > 0)
+ TYPE_LENGTH (result_type) =
+ (bit_stride * (high_bound - low_bound + 1) + 7) / 8;
+@@ -1954,12 +1964,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;
+@@ -1971,7 +1981,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;
+@@ -1986,12 +1996,20 @@ resolve_dynamic_range (struct type *dyn_range_type,
+ high_bound.data.const_val = 0;
+ }
+
++ prop = &TYPE_RANGE_DATA (dyn_range_type)->stride;
++ if (dwarf2_evaluate_property_signed (prop, NULL, addr_stack, &value, 1))
++ {
++ stride.kind = PROP_CONST;
++ stride.data.const_val = value;
++ }
++
+ static_target_type
+ = resolve_dynamic_type_internal (TYPE_TARGET_TYPE (dyn_range_type),
+ addr_stack, 0);
+ static_range_type = create_range_type (copy_type (dyn_range_type),
+ static_target_type,
+- &low_bound, &high_bound);
++ &low_bound, &high_bound, &stride);
++
+ TYPE_RANGE_DATA (static_range_type)->flag_bound_evaluated = 1;
+ return static_range_type;
+ }
+diff --git a/gdb/gdbtypes.h b/gdb/gdbtypes.h
+index 5942b5ad48..923ba101ca 100644
+--- a/gdb/gdbtypes.h
++++ b/gdb/gdbtypes.h
+@@ -550,6 +550,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. */
+
+@@ -711,7 +715,6 @@ struct main_type
+ /* * Union member used for range types. */
+
+ struct range_bounds *bounds;
+-
+ } flds_bnds;
+
+ /* * Slot to point to additional language-specific fields of this
+@@ -1233,6 +1236,15 @@ extern void allocate_gnat_aux_type (struct type *);
+ TYPE_RANGE_DATA(range_type)->high.kind
+ #define TYPE_LOW_BOUND_KIND(range_type) \
+ TYPE_RANGE_DATA(range_type)->low.kind
++#define TYPE_BYTE_STRIDE(range_type) \
++ TYPE_RANGE_DATA(range_type)->stride.data.const_val
++#define TYPE_BYTE_STRIDE_BLOCK(range_type) \
++ TYPE_RANGE_DATA(range_type)->stride.data.locexpr
++#define TYPE_BYTE_STRIDE_LOCLIST(range_type) \
++ TYPE_RANGE_DATA(range_type)->stride.data.loclist
++#define TYPE_BYTE_STRIDE_KIND(range_type) \
++ TYPE_RANGE_DATA(range_type)->stride.kind
++
+
+ /* Property accessors for the type data location. */
+ #define TYPE_DATA_LOCATION(thistype) \
+@@ -1267,6 +1279,9 @@ extern void allocate_gnat_aux_type (struct type *);
+ TYPE_HIGH_BOUND_UNDEFINED(TYPE_INDEX_TYPE(arraytype))
+ #define TYPE_ARRAY_LOWER_BOUND_IS_UNDEFINED(arraytype) \
+ TYPE_LOW_BOUND_UNDEFINED(TYPE_INDEX_TYPE(arraytype))
++#define TYPE_ARRAY_STRIDE_IS_UNDEFINED(arraytype) \
++ (TYPE_BYTE_STRIDE(TYPE_INDEX_TYPE(arraytype)) == 0)
++
+
+ #define TYPE_ARRAY_UPPER_BOUND_VALUE(arraytype) \
+ (TYPE_HIGH_BOUND(TYPE_INDEX_TYPE((arraytype))))
+@@ -1798,6 +1813,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
+index 8b2bb22c76..e1bf3edbe2 100644
+--- a/gdb/parse.c
++++ b/gdb/parse.c
+@@ -984,22 +984,20 @@ operator_length_standard (const struct expression *expr, int endpos,
+
+ case OP_RANGE:
+ oplen = 3;
++ args = 0;
+ range_type = (enum range_type)
+ longest_to_int (expr->elts[endpos - 2].longconst);
+
+- switch (range_type)
+- {
+- case LOW_BOUND_DEFAULT:
+- case HIGH_BOUND_DEFAULT:
+- args = 1;
+- break;
+- case BOTH_BOUND_DEFAULT:
+- args = 0;
+- break;
+- case NONE_BOUND_DEFAULT:
+- args = 2;
+- break;
+- }
++ /* Increment the argument counter for each argument
++ provided by the user. */
++ if ((range_type & SUBARRAY_LOW_BOUND) == SUBARRAY_LOW_BOUND)
++ args++;
++
++ if ((range_type & SUBARRAY_HIGH_BOUND) == SUBARRAY_HIGH_BOUND)
++ args++;
++
++ if ((range_type & SUBARRAY_STRIDE) == SUBARRAY_STRIDE)
++ args++;
+
+ break;
+
+diff --git a/gdb/rust-exp.y b/gdb/rust-exp.y
+index 199e87671e..397a92dfdb 100644
+--- a/gdb/rust-exp.y
++++ b/gdb/rust-exp.y
+@@ -2448,23 +2448,17 @@ convert_ast_to_expression (struct parser_state *state,
+
+ case OP_RANGE:
+ {
+- enum range_type kind = BOTH_BOUND_DEFAULT;
++ enum range_type kind = SUBARRAY_NONE_BOUND;
+
+ if (operation->left.op != NULL)
+ {
+ convert_ast_to_expression (state, operation->left.op, top);
+- kind = HIGH_BOUND_DEFAULT;
++ kind = SUBARRAY_LOW_BOUND;
+ }
+ if (operation->right.op != NULL)
+ {
+ convert_ast_to_expression (state, operation->right.op, top);
+- if (kind == BOTH_BOUND_DEFAULT)
+- kind = LOW_BOUND_DEFAULT;
+- else
+- {
+- gdb_assert (kind == HIGH_BOUND_DEFAULT);
+- kind = NONE_BOUND_DEFAULT;
+- }
++ kind = (range_type) (kind | SUBARRAY_HIGH_BOUND);
+ }
+ write_exp_elt_opcode (state, OP_RANGE);
+ write_exp_elt_longcst (state, kind);
+diff --git a/gdb/rust-lang.c b/gdb/rust-lang.c
+index f7bec33a42..cb924e084d 100644
+--- a/gdb/rust-lang.c
++++ b/gdb/rust-lang.c
+@@ -1366,9 +1366,9 @@ rust_range (struct expression *exp, int *pos, enum noside noside)
+ kind = (enum range_type) longest_to_int (exp->elts[*pos + 1].longconst);
+ *pos += 3;
+
+- if (kind == HIGH_BOUND_DEFAULT || kind == NONE_BOUND_DEFAULT)
++ if ((kind & SUBARRAY_LOW_BOUND) == SUBARRAY_LOW_BOUND)
+ low = evaluate_subexp (NULL_TYPE, exp, pos, noside);
+- if (kind == LOW_BOUND_DEFAULT || kind == NONE_BOUND_DEFAULT)
++ if ((kind & SUBARRAY_HIGH_BOUND) == SUBARRAY_HIGH_BOUND)
+ high = evaluate_subexp (NULL_TYPE, exp, pos, noside);
+
+ if (noside == EVAL_SKIP)
+@@ -1457,7 +1457,7 @@ rust_compute_range (struct type *type, struct value *range,
+
+ *low = 0;
+ *high = 0;
+- *kind = BOTH_BOUND_DEFAULT;
++ *kind = SUBARRAY_NONE_BOUND;
+
+ if (TYPE_NFIELDS (type) == 0)
+ return;
+@@ -1465,15 +1465,14 @@ rust_compute_range (struct type *type, struct value *range,
+ i = 0;
+ if (strcmp (TYPE_FIELD_NAME (type, 0), "start") == 0)
+ {
+- *kind = HIGH_BOUND_DEFAULT;
++ *kind = SUBARRAY_LOW_BOUND;
+ *low = value_as_long (value_field (range, 0));
+ ++i;
+ }
+ if (TYPE_NFIELDS (type) > i
+ && strcmp (TYPE_FIELD_NAME (type, i), "end") == 0)
+ {
+- *kind = (*kind == BOTH_BOUND_DEFAULT
+- ? LOW_BOUND_DEFAULT : NONE_BOUND_DEFAULT);
++ *kind = (range_type) (*kind | SUBARRAY_HIGH_BOUND);
+ *high = value_as_long (value_field (range, i));
+ }
+ }
+@@ -1488,7 +1487,7 @@ rust_subscript (struct expression *exp, int *pos, enum noside noside,
+ struct type *rhstype;
+ LONGEST low, high_bound;
+ /* Initialized to appease the compiler. */
+- enum range_type kind = BOTH_BOUND_DEFAULT;
++ enum range_type kind = SUBARRAY_NONE_BOUND;
+ LONGEST high = 0;
+ int want_slice = 0;
+
+@@ -1586,7 +1585,7 @@ rust_subscript (struct expression *exp, int *pos, enum noside noside,
+ error (_("Cannot subscript non-array type"));
+
+ if (want_slice
+- && (kind == BOTH_BOUND_DEFAULT || kind == LOW_BOUND_DEFAULT))
++ && ((kind & SUBARRAY_LOW_BOUND) != SUBARRAY_LOW_BOUND))
+ low = low_bound;
+ if (low < 0)
+ error (_("Index less than zero"));
+@@ -1604,7 +1603,7 @@ rust_subscript (struct expression *exp, int *pos, enum noside noside,
+ CORE_ADDR addr;
+ struct value *addrval, *tem;
+
+- if (kind == BOTH_BOUND_DEFAULT || kind == HIGH_BOUND_DEFAULT)
++ if ((kind & SUBARRAY_HIGH_BOUND) != SUBARRAY_HIGH_BOUND)
+ high = high_bound;
+ if (high < 0)
+ error (_("High index less than zero"));
+diff --git a/gdb/testsuite/gdb.fortran/static-arrays.exp b/gdb/testsuite/gdb.fortran/static-arrays.exp
+new file mode 100644
+index 0000000000..cc9ecc04ab
+--- /dev/null
++++ b/gdb/testsuite/gdb.fortran/static-arrays.exp
+@@ -0,0 +1,421 @@
++# Copyright 2015 Free Software Foundation, Inc.
++#
++# Contributed by Intel Corp. <christoph.t.weinmann(a)intel.com>
++#
++# 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 static-arrays.f90
++
++if { [prepare_for_testing $testfile.exp $testfile $srcfile {debug f90}] } {
++ return -1
++}
++
++if ![runto MAIN__] then {
++ perror "couldn't run to breakpoint MAIN__"
++ continue
++}
++
++gdb_breakpoint [gdb_get_line_number "BP1"]
++gdb_continue_to_breakpoint "BP1" ".*BP1.*"
++
++# Tests subarrays of one dimensional arrays with subrange variations
++gdb_test "print ar1" "\\$\[0-9\]+ = \\(1, 2, 3, 4, 5, 6, 7, 8, 9\\)" \
++ "print ar1."
++gdb_test "print ar1\(4:7\)" "\\$\[0-9\]+ = \\(4, 5, 6, 7\\)" \
++ "print ar1\(4:7\)"
++gdb_test "print ar1\(8:\)" "\\$\[0-9\]+ = \\(8, 9\\).*" \
++ "print ar1\(8:\)"
++gdb_test "print ar1\(:3\)" "\\$\[0-9\]+ = \\(1, 2, 3\\).*" \
++ "print ar1\(:3\)"
++gdb_test "print ar1\(:\)" "\\$\[0-9\]+ = \\(1, 2, 3, 4, 5, 6, 7, 8, 9\\)" \
++ "print ar1\(:\)"
++
++# Check assignment
++gdb_test_no_output "set \$my_ary = ar1\(3:8\)"
++gdb_test "print \$my_ary" \
++ "\\$\[0-9\]+ = \\(3, 4, 5, 6, 7, 8\\)" \
++ "Assignment of subarray to variable"
++gdb_test_no_output "set ar1\(5\) = 42"
++ gdb_test "print ar1\(3:8\)" \
++ "\\$\[0-9\]+ = \\(3, 4, 42, 6, 7, 8\\)" \
++ "print ar1\(3:8\) after assignment"
++gdb_test "print \$my_ary" \
++ "\\$\[0-9\]+ = \\(3, 4, 5, 6, 7, 8\\)" \
++ "Assignment of subarray to variable after original array changed"
++
++# Test for subarrays of one dimensional arrays with literals
++ gdb_test "print ar1\(3\)" "\\$\[0-9\]+ = 3" \
++ "print ar1\(3\)"
++
++# Tests for subranges of 2 dimensional arrays with subrange variations
++gdb_test "print ar2\(2:3, 3:4\)" \
++ "\\$\[0-9\]+ = \\(\\( 23, 33\\) \\( 24, 34\\) \\)" \
++ "print ar2\(2:3, 3:4\)."
++gdb_test "print ar2\(8:9,8:\)" \
++ "\\$\[0-9\]+ = \\(\\( 88, 98\\) \\( 89, 99\\) \\)" \
++ "print ar2\(8:9,8:\)"
++gdb_test "print ar2\(8:9,:2\)" \
++ "\\$\[0-9\]+ = \\(\\( 81, 91\\) \\( 82, 92\\) \\)" \
++ "print ar2\(8:9,:2\)"
++
++gdb_test "print ar2\(8:,8:9\)" \
++ "\\$\[0-9\]+ = \\(\\( 88, 98\\) \\( 89, 99\\) \\)" \
++ "print ar2\(8:,8:9\)"
++gdb_test "print ar2\(8:,8:\)" \
++ "\\$\[0-9\]+ = \\(\\( 88, 98\\) \\( 89, 99\\) \\)" \
++ "print ar2\(8:,8:\)"
++gdb_test "print ar2\(8:,:2\)" \
++ "\\$\[0-9\]+ = \\(\\( 81, 91\\) \\( 82, 92\\) \\)" \
++ "print ar2\(8:,:2\)"
++
++gdb_test "print ar2\(:2,2:3\)" \
++ "\\$\[0-9\]+ = \\(\\( 12, 22\\) \\( 13, 23\\) \\)" \
++ "print ar2\(:2,2:3\)"
++gdb_test "print ar2\(:2,8:\)" \
++ "\\$\[0-9\]+ = \\(\\( 18, 28\\) \\( 19, 29\\) \\)" \
++ "print ar2\(:2,8:\)"
++gdb_test "print ar2\(:2,:2\)" \
++ "\\$\[0-9\]+ = \\(\\( 11, 21\\) \\( 12, 22\\) \\)" \
++ "print ar2\(:2,:2\)"
++
++# Test subranges of 2 dimensional arrays with literals and subrange variations
++gdb_test "print ar2\(7, 3:6\)" \
++ "\\$\[0-9\]+ = \\(73, 74, 75, 76\\)" \
++ "print ar2\(7, 3:6\)"
++gdb_test "print ar2\(7,8:\)" \
++ "\\$\[0-9\]+ = \\(78, 79\\)" \
++ "print ar2\(7,8:\)"
++gdb_test "print ar2\(7,:2\)" \
++ "\\$\[0-9\]+ = \\(71, 72\\)" \
++ "print ar2\(7,:2\)"
++
++gdb_test "print ar2\(7:8,4\)" \
++ "\\$\[0-9\]+ = \\(74, 84\\)" \
++ "print ar2(7:8,4\)"
++gdb_test "print ar2\(8:,4\)" \
++ "\\$\[0-9\]+ = \\(84, 94\\)" \
++ "print ar2\(8:,4\)"
++gdb_test "print ar2\(:2,4\)" \
++ "\\$\[0-9\]+ = \\(14, 24\\)" \
++ "print ar2\(:2,4\)"
++gdb_test "print ar2\(3,4\)" \
++ "\\$\[0-9\]+ = 34" \
++ "print ar2\(3,4\)"
++
++# Test subarrays of 3 dimensional arrays with literals and subrange variations
++gdb_test "print ar3\(2:4,3:4,7:8\)" \
++ "\\$\[0-9\]+ = \\(\\( \\( 237, 337, 437\\) \\( 247, 347, 447\\)\
++ \\) \\( \\( 238, 338, 438\\) \\( 248, 348, 448\\) \\) \\)" \
++ "print ar3\(2:4,3:4,7:8\)"
++gdb_test "print ar3\(2:3,4:5,8:\)" \
++ "\\$\[0-9\]+ = \\(\\( \\( 248, 348\\) \\( 258, 358\\) \\) \\(\
++ \\( 249, 349\\) \\( 259, 359\\) \\) \\)" \
++ "print ar3\(2:3,4:5,8:\)"
++gdb_test "print ar3\(2:3,4:5,:2\)" \
++ "\\$\[0-9\]+ = \\(\\( \\( 241, 341\\) \\( 251, 351\\) \\) \\(\
++ \\( 242, 342\\) \\( 252, 352\\) \\) \\)" \
++ "print ar3\(2:3,4:5,:2\)"
++
++gdb_test "print ar3\(2:3,8:,7:8\)" \
++ "\\$\[0-9\]+ = \\(\\( \\( 287, 387\\) \\( 297, 397\\) \\) \\(\
++ \\( 288, 388\\) \\( 298, 398\\) \\) \\)" \
++ "print ar3\(2:3,8:,7:8\)"
++gdb_test "print ar3\(2:3,8:,8:\)" \
++ "\\$\[0-9\]+ = \\(\\( \\( 288, 388\\) \\( 298, 398\\) \\) \\(\
++ \\( 289, 389\\) \\( 299, 399\\) \\) \\)" \
++ "print ar3\(2:3,8:,8:\)"
++gdb_test "print ar3\(2:3,8:,:2\)" \
++ "\\$\[0-9\]+ = \\(\\( \\( 281, 381\\) \\( 291, 391\\) \\) \\(\
++ \\( 282, 382\\) \\( 292, 392\\) \\) \\)" \
++ "print ar3\(2:3,8:,:2\)"
++
++gdb_test "print ar3\(2:3,:2,7:8\)" \
++ "\\$\[0-9\]+ = \\(\\( \\( 217, 317\\) \\( 227, 327\\) \\) \\(\
++ \\( 218, 318\\) \\( 228, 328\\) \\) \\)" \
++ "print ar3\(2:3,:2,7:8\)"
++gdb_test "print ar3\(2:3,:2,8:\)" \
++ "\\$\[0-9\]+ = \\(\\( \\( 218, 318\\) \\( 228, 328\\) \\) \\(\
++ \\( 219, 319\\) \\( 229, 329\\) \\) \\)" \
++ "print ar3\(2:3,:2,8:\)"
++gdb_test "print ar3\(2:3,:2,:2\)" \
++ "\\$\[0-9\]+ = \\(\\( \\( 211, 311\\) \\( 221, 321\\) \\) \\(\
++ \\( 212, 312\\) \\( 222, 322\\) \\) \\)" \
++ "print ar3\(2:3,:2,:2\)"
++
++gdb_test "print ar3\(8:,3:4,7:8\)" \
++ "\\$\[0-9\]+ = \\(\\( \\( 837, 937\\) \\( 847, 947\\) \\) \\(\
++ \\( 838, 938\\) \\( 848, 948\\) \\) \\)" \
++ "print ar3\(8:,3:4,7:8\)"
++gdb_test "print ar3\(8:,4:5,8:\)" \
++ "\\$\[0-9\]+ = \\(\\( \\( 848, 948\\) \\( 858, 958\\) \\) \\(\
++ \\( 849, 949\\) \\( 859, 959\\) \\) \\)" \
++ "print ar3\(8:,4:5,8:\)"
++gdb_test "print ar3\(8:,4:5,:2\)" \
++ "\\$\[0-9\]+ = \\(\\( \\( 841, 941\\) \\( 851, 951\\) \\) \\(\
++ \\( 842, 942\\) \\( 852, 952\\) \\) \\)" \
++ "print ar3\(8:,4:5,:2\)"
++
++gdb_test "print ar3\(8:,8:,7:8\)" \
++ "\\$\[0-9\]+ = \\(\\( \\( 887, 987\\) \\( 897, 997\\) \\) \\(\
++ \\( 888, 988\\) \\( 898, 998\\) \\) \\)" \
++ "print ar3\(8:,8:,7:8\)"
++gdb_test "print ar3\(8:,8:,8:\)" \
++ "\\$\[0-9\]+ = \\(\\( \\( 888, 988\\) \\( 898, 998\\) \\) \\(\
++ \\( 889, 989\\) \\( 899, 999\\) \\) \\)" \
++ "print ar3\(8:,8:,8:\)"
++gdb_test "print ar3\(8:,8:,:2\)" \
++ "\\$\[0-9\]+ = \\(\\( \\( 881, 981\\) \\( 891, 991\\) \\) \\(\
++ \\( 882, 982\\) \\( 892, 992\\) \\) \\)" \
++ "print ar3\(8:,8:,:2\)"
++
++gdb_test "print ar3\(8:,:2,7:8\)" \
++ "\\$\[0-9\]+ = \\(\\( \\( 817, 917\\) \\( 827, 927\\) \\) \\(\
++ \\( 818, 918\\) \\( 828, 928\\) \\) \\)" \
++ "print ar3\(8:,:2,7:8\)"
++gdb_test "print ar3\(8:,:2,8:\)" \
++ "\\$\[0-9\]+ = \\(\\( \\( 818, 918\\) \\( 828, 928\\) \\) \\(\
++ \\( 819, 919\\) \\( 829, 929\\) \\) \\)" \
++ "print ar3\(8:,:2,8:\)"
++gdb_test "print ar3\(8:,:2,:2\)" \
++ "\\$\[0-9\]+ = \\(\\( \\( 811, 911\\) \\( 821, 921\\) \\) \\(\
++ \\( 812, 912\\) \\( 822, 922\\) \\) \\)" \
++ "print ar3\(8:,:2,:2\)"
++
++
++gdb_test "print ar3\(:2,3:4,7:8\)" \
++ "\\$\[0-9\]+ = \\(\\( \\( 137, 237\\) \\( 147, 247\\) \\) \\(\
++ \\( 138, 238\\) \\( 148, 248\\) \\) \\)" \
++ "print ar3 \(:2,3:4,7:8\)."
++gdb_test "print ar3\(:2,3:4,8:\)" \
++ "\\$\[0-9\]+ = \\(\\( \\( 138, 238\\) \\( 148, 248\\) \\) \\(\
++ \\( 139, 239\\) \\( 149, 249\\) \\) \\)" \
++ "print ar3\(:2,3:4,8:\)"
++gdb_test "print ar3\(:2,3:4,:2\)" \
++ "\\$\[0-9\]+ = \\(\\( \\( 131, 231\\) \\( 141, 241\\) \\) \\(\
++ \\( 132, 232\\) \\( 142, 242\\) \\) \\)" \
++ "print ar3\(:2,3:4,:2\)"
++
++gdb_test "print ar3\(:2,8:,7:8\)" "\\$\[0-9\]+ = \\(\\( \\( 187, 287\\) \\(\
++ 197, 297\\) \\) \\( \\( 188, 288\\) \\( 198, 298\\) \\) \\)" \
++ "print ar3\(:2,8:,7:8\)"
++gdb_test "print ar3\(:2,8:,8:\)" "\\$\[0-9\]+ = \\(\\( \\( 188, 288\\) \\( 198,\
++ 298\\) \\) \\( \\( 189, 289\\) \\( 199, 299\\) \\) \\)" \
++ "print ar3\(:2,8:,8:\)"
++gdb_test "print ar3\(:2,8:,:2\)" "\\$\[0-9\]+ = \\(\\( \\( 181, 281\\) \\( 191,\
++ 291\\) \\) \\( \\( 182, 282\\) \\( 192, 292\\) \\) \\)" \
++ "print ar3\(:2,8:,:2\)"
++
++gdb_test "print ar3\(:2,:2,7:8\)" \
++ "\\$\[0-9\]+ = \\(\\( \\( 117, 217\\) \\( 127, 227\\) \\) \\(\
++ \\( 118, 218\\) \\( 128, 228\\) \\) \\)" \
++ "print ar3\(:2,:2,7:8\)"
++gdb_test "print ar3\(:2,:2,8:\)" \
++ "\\$\[0-9\]+ = \\(\\( \\( 118, 218\\) \\( 128, 228\\) \\) \\(\
++ \\( 119, 219\\) \\( 129, 229\\) \\) \\)" \
++ "print ar3\(:2,:2,8:\)"
++gdb_test "print ar3\(:2,:2,:2\)" \
++ "\\$\[0-9\]+ = \\(\\( \\( 111, 211\\) \\( 121, 221\\) \\) \\(\
++ \\( 112, 212\\) \\( 122, 222\\) \\) \\)" \
++ "print ar3\(:2,:2,:2\)"
++
++#Tests for subarrays of 3 dimensional arrays with literals and subranges
++gdb_test "print ar3\(3,3:4,7:8\)" \
++ "\\$\[0-9\]+ = \\(\\( 337, 347\\) \\( 338, 348\\) \\)" \
++ "print ar3\(3,3:4,7:8\)"
++gdb_test "print ar3\(3,4:5,8:\)" \
++ "\\$\[0-9\]+ = \\(\\( 348, 358\\) \\( 349, 359\\) \\)" \
++ "print ar3\(3,4:5,8:\)"
++gdb_test "print ar3\(3,4:5,:2\)" \
++ "\\$\[0-9\]+ = \\(\\( 341, 351\\) \\( 342, 352\\) \\)" \
++ "print ar3\(3,4:5,:2\)"
++gdb_test "print ar3\(3,4:5,3\)" \
++ "\\$\[0-9\]+ = \\(343, 353\\)" \
++ "print ar3\(3,4:5,3\)"
++
++gdb_test "print ar3\(2,8:,7:8\)" \
++ "\\$\[0-9\]+ = \\(\\( 287, 297\\) \\( 288, 298\\) \\)" \
++ "print ar3\(2,8:,7:8\)"
++gdb_test "print ar3\(2,8:,8:\)" \
++ "\\$\[0-9\]+ = \\(\\( 288, 298\\) \\( 289, 299\\) \\)" \
++ "print ar3\(2,8:,8:\)"
++gdb_test "print ar3\(2,8:,:2\)"\
++ "\\$\[0-9\]+ = \\(\\( 281, 291\\) \\( 282, 292\\) \\)" \
++ "print ar3\(2,8:,:2\)"
++gdb_test "print ar3\(2,8:,3\)" \
++ "\\$\[0-9\]+ = \\(283, 293\\)" \
++ "print ar3\(2,8:,3\)"
++
++gdb_test "print ar3\(2,:2,7:8\)" \
++ "\\$\[0-9\]+ = \\(\\( 217, 227\\) \\( 218, 228\\) \\)" \
++ "print ar3\(2,:2,7:8\)"
++gdb_test "print ar3\(2,:2,8:\)" \
++ "\\$\[0-9\]+ = \\(\\( 218, 228\\) \\( 219, 229\\) \\)" \
++ "print ar3\(2,:2,8:\)"
++gdb_test "print ar3\(2,:2,:2\)" \
++ "\\$\[0-9\]+ = \\(\\( 211, 221\\) \\( 212, 222\\) \\)" \
++ "print ar3\(2,:2,:2\)"
++gdb_test "print ar3\(2,:2,3\)" \
++ "\\$\[0-9\]+ = \\(213, 223\\)" \
++ "print ar3\(2,:2,3\)"
++
++gdb_test "print ar3\(3,4,7:8\)" \
++ "\\$\[0-9\]+ = \\(347, 348\\)" \
++ "print ar3\(3,4,7:8\)"
++gdb_test "print ar3\(3,4,8:\)" \
++ "\\$\[0-9\]+ = \\(348, 349\\)" \
++i "print ar3\(3,4,8:\)"
++gdb_test "print ar3\(3,4,:2\)" \
++ "\\$\[0-9\]+ = \\(341, 342\\)" \
++ "print ar3\(3,4,:2\)"
++gdb_test "print ar3\(5,6,7\)" \
++ "\\$\[0-9\]+ = 567" \
++ "print ar3\(5,6,7\)"
++
++gdb_test "print ar3\(3:4,6,7:8\)" \
++ "\\$\[0-9\]+ = \\(\\( 367, 467\\) \\( 368, 468\\) \\)" \
++ "print ar3\(3:4,6,7:8\)"
++gdb_test "print ar3\(3:4,6,8:\)" \
++ "\\$\[0-9\]+ = \\(\\( 368, 468\\) \\( 369, 469\\) \\)" \
++ "print ar3\(3:4,6,8:\)"
++gdb_test "print ar3\(3:4,6,:2\)" \
++ "\\$\[0-9\]+ = \\(\\( 361, 461\\) \\( 362, 462\\) \\)" \
++ "print ar3\(3:4,6,:2\)"
++gdb_test "print ar3\(3:4,6,5\)" \
++ "\\$\[0-9\]+ = \\(365, 465\\)" \
++ "print ar3\(3:4,6,5\)"
++
++gdb_test "print ar3\(8:,6,7:8\)" \
++ "\\$\[0-9\]+ = \\(\\( 867, 967\\) \\( 868, 968\\) \\)" \
++ "print ar3\(8:,6,7:8\)"
++gdb_test "print ar3\(8:,6,8:\)" \
++ "\\$\[0-9\]+ = \\(\\( 868, 968\\) \\( 869, 969\\) \\)" \
++ "print ar3\(8:,6,8:\)"
++gdb_test "print ar3\(8:,6,:2\)" \
++ "\\$\[0-9\]+ = \\(\\( 861, 961\\) \\( 862, 962\\) \\)" \
++ "print ar3\(8:,6,:2\)"
++gdb_test "print ar3\(8:,6,5\)" \
++ "\\$\[0-9\]+ = \\(865, 965\\)" \
++ "print ar3\(8:,6,5\)"
++
++gdb_test "print ar3\(:2,6,7:8\)" \
++ "\\$\[0-9\]+ = \\(\\( 167, 267\\) \\( 168, 268\\) \\)" \
++ "print ar3\(:2,6,7:8\)"
++gdb_test "print ar3\(:2,6,8:\)" \
++ "\\$\[0-9\]+ = \\(\\( 168, 268\\) \\( 169, 269\\) \\)" \
++ "print ar3\(:2,6,8:\)"
++gdb_test "print ar3\(:2,6,:2\)" \
++ "\\$\[0-9\]+ = \\(\\( 161, 261\\) \\( 162, 262\\) \\)" \
++ "print ar3\(:2,6,:2\)"
++gdb_test "print ar3\(:2,6,5\)" \
++ "\\$\[0-9\]+ = \\(165, 265\\)" \
++ "print ar3\(:2,6,5\)"
++
++gdb_test "print ar3\(3:4,5:6,4\)" \
++ "\\$\[0-9\]+ = \\(\\( 354, 454\\) \\( 364, 464\\) \\)" \
++ "print ar2\(3:4,5:6,4\)"
++gdb_test "print ar3\(8:,5:6,4\)" \
++ "\\$\[0-9\]+ = \\(\\( 854, 954\\) \\( 864, 964\\) \\)" \
++ "print ar2\(8:,5:6,4\)"
++gdb_test "print ar3\(:2,5:6,4\)" \
++ "\\$\[0-9\]+ = \\(\\( 154, 254\\) \\( 164, 264\\) \\)" \
++ "print ar2\(:2,5:6,4\)"
++
++# Stride > 1
++gdb_test "print ar1\(2:6:2\)" \
++ "\\$\[0-9\]+ = \\(2, 4, 6\\)" \
++ "print ar1\(2:6:2\)"
++gdb_test "print ar2\(2:6:2,3:4\)" \
++ "\\$\[0-9\]+ = \\(\\( 23, 43, 63\\) \\( 24, 44, 64\\) \\)" \
++ "print ar2\(2:6:2,3:4\)"
++gdb_test "print ar2\(2:6:2,3\)" \
++ "\\$\[0-9\]+ = \\(23, 43, 63\\)" \
++ "print ar2\(2:6:2,3\)"
++gdb_test "print ar3\(2:6:2,3:5:2,4:7:3\)" \
++ "\\$\[0-9\]+ = \\(\\( \\( 234, 434, 634\\) \\( 254, 454, 654\\)\
++ \\) \\( \\( 237, 437, 637\\) \\( 257, 457, 657\\) \\) \\)" \
++ "print ar3\(2:6:2,3:5:2,4:7:3\)"
++gdb_test "print ar3\(2:6:2,5,4:7:3\)" \
++ "\\$\[0-9\]+ = \\(\\( 254, 454, 654\\) \\( 257, 457, 657\\)\
++ \\)" \
++ "print ar3\(2:6:2,5,4:7:3\)"
++
++# Stride < 0
++gdb_test "print ar1\(8:2:-2\)" \
++ "\\$\[0-9\]+ = \\(8, 6, 4, 2\\)" \
++ "print ar1\(8:2:-2\)"
++gdb_test "print ar2\(8:2:-2,3:4\)" \
++ "\\$\[0-9\]+ = \\(\\( 83, 63, 43, 23\\) \\( 84, 64, 44, 24\\)\
++ \\)" \
++ "print ar2\(8:2:-2,3:4\)"
++gdb_test "print ar2\(2:6:2,3\)" \
++ "\\$\[0-9\]+ = \\(23, 43, 63\\)" \
++ "print ar2\(2:6:2,3\)"
++gdb_test "print ar3\(2:3,7:3:-4,4:7:3\)" \
++ "\\$\[0-9\]+ = \\(\\( \\( 274, 374\\) \\( 234, 334\\) \\) \\(\
++ \\( 277, 377\\) \\( 237, 337\\) \\) \\)" \
++ "print ar3\(2:3,7:3:-4,4:7:3\)"
++gdb_test "print ar3\(2:6:2,5,7:4:-3\)" \
++ "\\$\[0-9\]+ = \\(\\( 257, 457, 657\\) \\( 254, 454, 654\\)\
++ \\)" \
++ "print ar3\(2:6:2,5,7:4:-3\)"
++
++# Tests with negative and mixed indices
++gdb_test "p ar4\(2:4, -2:1, -15:-14\)" \
++ "\\$\[0-9\]+ = \\(\\( \\( 261, 361, 461\\) \\( 271, 371, 471\\)\
++ \\( 281, 381, 481\\) \\( 291, 391, 491\\) \\) \\( \\( 262,\
++ 362, 462\\) \\( 272, 372, 472\\) \\( 282, 382, 482\\) \\( 292,\
++ 392, 492\\) \\) \\)" \
++ "print ar4(2:4, -2:1, -15:-14)"
++
++gdb_test "p ar4\(7,-6:2:3,-7\)" \
++ "\\$\[0-9\]+ = \\(729, 759, 789\\)" \
++ "print ar4(7,-6:2:3,-7)"
++
++gdb_test "p ar4\(9:2:-2, -6:2:3, -6:-15:-3\)" \
++ "\\$\[0-9\]+ = \\(\\( \\( 930, 730, 530, 330\\) \\( 960, 760,\
++ 560, 360\\) \\( 990, 790, 590, 390\\) \\) \\( \\( 927, 727,\
++ 527, 327\\) \\( 957, 757, 557, 357\\) \\( 987, 787, 587,\
++ 387\\) \\) \\( \\( 924, 724, 524, 324\\) \\( 954, 754, 554,\
++ 354\\) \\( 984, 784, 584, 384\\) \\) \\( \\( 921, 721, 521,\
++ 321\\) \\( 951, 751, 551, 351\\) \\( 981, 781, 581, 381\\) \\)\
++ \\)" \
++ "print ar4(9:2:-2, -6:2:3, -6:-15:-3)"
++
++gdb_test "p ar4\(:,:,:\)" \
++ "\\$\[0-9\]+ = \\(\\( \\( 111, 211, 311, 411, 511, 611, 711,\
++ 811, .*" \
++ "print ar4(:,:,:)"
++
++# Provoke error messages for bad user input
++gdb_test "print ar1\(0:4\)" \
++ "provided bound\\(s\\) outside array bound\\(s\\)" \
++ "print ar1\(0:4\)"
++gdb_test "print ar1\(8:12\)" \
++ "provided bound\\(s\\) outside array bound\\(s\\)" \
++ "print ar1\(8:12\)"
++gdb_test "print ar1\(8:2:\)" \
++ "A syntax error in expression, near `\\)'." \
++ "print ar1\(8:2:\)"
++gdb_test "print ar1\(8:2:2\)" \
++ "Wrong value provided for stride and boundaries" \
++ "print ar1\(8:2:2\)"
++gdb_test "print ar1\(2:8:-2\)" \
++ "Wrong value provided for stride and boundaries" \
++ "print ar1\(2:8:-2\)"
++gdb_test "print ar1\(2:7:0\)" \
++ "Stride must not be 0" \
++ "print ar1\(2:7:0\)"
++gdb_test "print ar1\(3:7\) = 42" \
++ "Invalid cast." \
++ "Assignment of value to subarray"
+diff --git a/gdb/testsuite/gdb.fortran/static-arrays.f90 b/gdb/testsuite/gdb.fortran/static-arrays.f90
+new file mode 100644
+index 0000000000..f22fcbe124
+--- /dev/null
++++ b/gdb/testsuite/gdb.fortran/static-arrays.f90
+@@ -0,0 +1,55 @@
++! Copyright 2015 Free Software Foundation, Inc.
++!
++! Contributed by Intel Corp. <christoph.t.weinmann(a)intel.com>
++!
++! 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/>.
++
++subroutine sub
++ integer, dimension(9) :: ar1
++ integer, dimension(9,9) :: ar2
++ integer, dimension(9,9,9) :: ar3
++ integer, dimension(10,-7:3, -15:-5) :: ar4
++ integer :: i,j,k
++
++ ar1 = 1
++ ar2 = 1
++ ar3 = 1
++ ar4 = 4
++
++ ! Resulting array ar3 looks like ((( 111, 112, 113, 114,...)))
++ do i = 1, 9, 1
++ ar1(i) = i
++ do j = 1, 9, 1
++ ar2(i,j) = i*10 + j
++ do k = 1, 9, 1
++ ar3(i,j,k) = i*100 + j*10 + k
++ end do
++ end do
++ end do
++
++ do i = 1, 10, 1
++ do j = -7, 3, 1
++ do k = -15, -5, 1
++ ar4(i,j,k) = i*100 + (j+8)*10 + (k+16)
++ end do
++ end do
++ end do
++
++ ar1(1) = 11 !BP1
++ return
++end
++
++program testprog
++ call sub
++end
+diff --git a/gdb/testsuite/gdb.fortran/vla-ptype.exp b/gdb/testsuite/gdb.fortran/vla-ptype.exp
+index 5f367348b0..5351a0aa2e 100644
+--- a/gdb/testsuite/gdb.fortran/vla-ptype.exp
++++ b/gdb/testsuite/gdb.fortran/vla-ptype.exp
+@@ -98,3 +98,7 @@ gdb_test "ptype vla2" "type = <not allocated>" "ptype vla2 not allocated"
+ gdb_test "ptype vla2(5, 45, 20)" \
+ "no such vector element \\\(vector not allocated\\\)" \
+ "ptype vla2(5, 45, 20) not allocated"
++
++gdb_breakpoint [gdb_get_line_number "vla1-neg-bounds"]
++gdb_continue_to_breakpoint "vla1-neg-bounds"
++gdb_test "ptype vla1" "type = $real \\(-2:1,-5:4,-3:-1\\)" "ptype vla1 negative bounds"
+diff --git a/gdb/testsuite/gdb.fortran/vla-sizeof.exp b/gdb/testsuite/gdb.fortran/vla-sizeof.exp
+index 3113983ba4..83bc849619 100644
+--- a/gdb/testsuite/gdb.fortran/vla-sizeof.exp
++++ b/gdb/testsuite/gdb.fortran/vla-sizeof.exp
+@@ -44,3 +44,7 @@ gdb_test "print sizeof(pvla)" " = 0" "print sizeof non-associated pvla"
+ gdb_breakpoint [gdb_get_line_number "pvla-associated"]
+ gdb_continue_to_breakpoint "pvla-associated"
+ gdb_test "print sizeof(pvla)" " = 4000" "print sizeof associated pvla"
++
++gdb_breakpoint [gdb_get_line_number "vla1-neg-bounds"]
++gdb_continue_to_breakpoint "vla1-neg-bounds"
++gdb_test "print sizeof(vla1)" " = 480" "print sizeof vla1 negative bounds"
+diff --git a/gdb/testsuite/gdb.fortran/vla-stride.exp b/gdb/testsuite/gdb.fortran/vla-stride.exp
+new file mode 100644
+index 0000000000..dcf15e5daf
+--- /dev/null
++++ b/gdb/testsuite/gdb.fortran/vla-stride.exp
+@@ -0,0 +1,44 @@
++# Copyright 2016 Free Software Foundation, Inc.
++
++# This program is free software; you can redistribute it and/or modify
++# it under the terms of the GNU General Public License as published by
++# the Free Software Foundation; either version 3 of the License, or
++# (at your option) any later version.
++#
++# This program is distributed in the hope that it will be useful,
++# but WITHOUT ANY WARRANTY; without even the implied warranty of
++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++# GNU General Public License for more details.
++#
++# You should have received a copy of the GNU General Public License
++# along with this program. If not, see <http://www.gnu.org/licenses/>.
++
++standard_testfile ".f90"
++
++if { [prepare_for_testing ${testfile}.exp ${testfile} ${srcfile} \
++ {debug f90 quiet}] } {
++ return -1
++}
++
++if ![runto MAIN__] then {
++ perror "couldn't run to breakpoint MAIN__"
++ continue
++}
++
++gdb_breakpoint [gdb_get_line_number "re-reverse-elements"]
++gdb_continue_to_breakpoint "re-reverse-elements"
++gdb_test "print pvla" " = \\\(1, 2, 3, 4, 5, 6, 7, 8, 9, 10\\\)" \
++ "print re-reverse-elements"
++gdb_test "print pvla(1)" " = 1" "print first re-reverse-element"
++gdb_test "print pvla(10)" " = 10" "print last re-reverse-element"
++
++gdb_breakpoint [gdb_get_line_number "odd-elements"]
++gdb_continue_to_breakpoint "odd-elements"
++gdb_test "print pvla" " = \\\(1, 3, 5, 7, 9\\\)" "print odd-elements"
++gdb_test "print pvla(1)" " = 1" "print first odd-element"
++gdb_test "print pvla(5)" " = 9" "print last odd-element"
++
++gdb_breakpoint [gdb_get_line_number "single-element"]
++gdb_continue_to_breakpoint "single-element"
++gdb_test "print pvla" " = \\\(5\\\)" "print single-element"
++gdb_test "print pvla(1)" " = 5" "print one single-element"
+diff --git a/gdb/testsuite/gdb.fortran/vla-stride.f90 b/gdb/testsuite/gdb.fortran/vla-stride.f90
+new file mode 100644
+index 0000000000..8d2425222e
+--- /dev/null
++++ b/gdb/testsuite/gdb.fortran/vla-stride.f90
+@@ -0,0 +1,29 @@
++! Copyright 2016 Free Software Foundation, Inc.
++!
++! This program is free software; you can redistribute it and/or modify
++! it under the terms of the GNU General Public License as published by
++! the Free Software Foundation; either version 3 of the License, or
++! (at your option) any later version.
++!
++! This program is distributed in the hope that it will be useful,
++! but WITHOUT ANY WARRANTY; without even the implied warranty of
++! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++! GNU General Public License for more details.
++!
++! You should have received a copy of the GNU General Public License
++! along with this program. If not, see <http://www.gnu.org/licenses/>.
++
++program vla_stride
++ integer, target, allocatable :: vla (:)
++ integer, pointer :: pvla (:)
++
++ allocate(vla(10))
++ vla = (/ (I, I = 1,10) /)
++
++ pvla => vla(10:1:-1)
++ pvla => pvla(10:1:-1)
++ pvla => vla(1:10:2) ! re-reverse-elements
++ pvla => vla(5:4:-2) ! odd-elements
++
++ pvla => null() ! single-element
++end program vla_stride
+diff --git a/gdb/testsuite/gdb.fortran/vla.f90 b/gdb/testsuite/gdb.fortran/vla.f90
+index 508290a36e..d87f59b92b 100644
+--- a/gdb/testsuite/gdb.fortran/vla.f90
++++ b/gdb/testsuite/gdb.fortran/vla.f90
+@@ -54,4 +54,14 @@ program vla
+
+ allocate (vla3 (2,2)) ! vla2-deallocated
+ vla3(:,:) = 13
++
++ allocate (vla1 (-2:1, -5:4, -3:-1))
++ l = allocated(vla1)
++
++ vla1(:, :, :) = 1
++ vla1(-2, -3, -1) = -231
++
++ deallocate (vla1) ! vla1-neg-bounds
++ l = allocated(vla1)
++
+ end program vla
+diff --git a/gdb/valarith.c b/gdb/valarith.c
+index 58e3a09c37..035def5466 100644
+--- a/gdb/valarith.c
++++ b/gdb/valarith.c
+@@ -189,10 +189,16 @@ value_subscripted_rvalue (struct value *array, LONGEST index, int lowerbound)
+ 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)))
+ {
+ if (type_not_associated (array_type))
+ error (_("no such vector element (vector not associated)"));
+diff --git a/gdb/valops.c b/gdb/valops.c
+index 9525dc8499..4cd4fd96ae 100644
+--- a/gdb/valops.c
++++ b/gdb/valops.c
+@@ -3776,56 +3776,195 @@ value_of_this_silent (const struct language_defn *lang)
+
+ struct value *
+ value_slice (struct value *array, int lowbound, int length)
++{
++ /* Pass unaltered arguments to VALUE_SLICE_1, plus a default stride
++ value of '1', which returns every element between LOWBOUND and
++ (LOWBOUND + LENGTH). We also provide a default CALL_COUNT of '1'
++ as we are only considering the highest dimension, or we are
++ working on a one dimensional array. So we call VALUE_SLICE_1
++ exactly once. */
++ return value_slice_1 (array, lowbound, length, 1, 1);
++}
++
++/* VALUE_SLICE_1 is called for each array dimension to calculate the number
++ of elements as defined by the subscript expression.
++ CALL_COUNT is used to determine if we are calling the function once, e.g.
++ we are working on the current dimension of ARRAY, or if we are calling
++ the function repeatedly. In the later case we need to take elements
++ from the TARGET_TYPE of ARRAY.
++ With a CALL_COUNT greater than 1 we calculate the offsets for every element
++ that should be in the result array. Then we fetch the contents and then
++ copy them into the result array. The result array will have one dimension
++ less than the input array, so later on we need to recreate the indices and
++ ranges in the calling function. */
++
++struct value *
++value_slice_1 (struct value *array, int lowbound, int length,
++ int stride_length, int call_count)
+ {
+ struct type *slice_range_type, *slice_type, *range_type;
+- LONGEST lowerbound, upperbound;
+- struct value *slice;
+- struct type *array_type;
++ struct type *array_type = check_typedef (value_type (array));
++ struct type *elt_type = check_typedef (TYPE_TARGET_TYPE (array_type));
++ unsigned int elt_size, elt_offs;
++ LONGEST ary_high_bound, ary_low_bound;
++ struct value *v;
++ int slice_range_size, i = 0, row_count = 1, elem_count = 1;
+
+- array_type = check_typedef (value_type (array));
++ /* Check for legacy code if we are actually dealing with an array or
++ string. */
+ if (TYPE_CODE (array_type) != TYPE_CODE_ARRAY
+ && TYPE_CODE (array_type) != TYPE_CODE_STRING)
+ error (_("cannot take slice of non-array"));
+
+- range_type = TYPE_INDEX_TYPE (array_type);
+- if (get_discrete_bounds (range_type, &lowerbound, &upperbound) < 0)
+- error (_("slice from bad array or bitstring"));
++ ary_low_bound = TYPE_LOW_BOUND (TYPE_INDEX_TYPE (array_type));
++ ary_high_bound = TYPE_HIGH_BOUND (TYPE_INDEX_TYPE (array_type));
++
++ /* When we are working on a multi-dimensional array, we need to get the
++ attributes of the underlying type. */
++ if (call_count > 1)
++ {
++ ary_low_bound = TYPE_LOW_BOUND (TYPE_INDEX_TYPE (elt_type));
++ ary_high_bound = TYPE_HIGH_BOUND (TYPE_INDEX_TYPE (elt_type));
++ elt_type = check_typedef (TYPE_TARGET_TYPE (elt_type));
++ row_count = TYPE_LENGTH (array_type)
++ / TYPE_LENGTH (TYPE_TARGET_TYPE (array_type));
++ }
++
++ /* With a stride of '1', the number of elements per result row is equal to
++ the LENGTH of the subarray. With non-default stride values, we skip
++ elements, but have to add the start element to the total number of
++ elements per row. */
++ if (stride_length == 1)
++ elem_count = length;
++ else
++ elem_count = ((length - 1) / stride_length) + 1;
++
++ elt_size = TYPE_LENGTH (elt_type);
++ elt_offs = lowbound - ary_low_bound;
+
+- if (lowbound < lowerbound || length < 0
+- || lowbound + length - 1 > upperbound)
+- error (_("slice out of range"));
++ elt_offs *= elt_size;
++
++ /* Check for valid user input. In case of Fortran this was already done
++ in the calling function. */
++ if (call_count == 1
++ && (!TYPE_ARRAY_UPPER_BOUND_IS_UNDEFINED (array_type)
++ && elt_offs >= TYPE_LENGTH (array_type)))
++ error (_("no such vector element"));
++
++ /* CALL_COUNT is 1 when we are dealing either with the highest dimension
++ of the array, or a one dimensional array. Set RANGE_TYPE accordingly.
++ In both cases we calculate how many rows/elements will be in the output
++ array by setting slice_range_size. */
++ if (call_count == 1)
++ {
++ range_type = TYPE_INDEX_TYPE (array_type);
++ slice_range_size = ary_low_bound + elem_count - 1;
++
++ /* Check if the array bounds are valid. */
++ if (get_discrete_bounds (range_type, &ary_low_bound, &ary_high_bound) < 0)
++ error (_("slice from bad array or bitstring"));
++ }
++ /* When CALL_COUNT is greater than 1, we are dealing with an array of arrays.
++ So we need to get the type below the current one and set the RANGE_TYPE
++ accordingly. */
++ else
++ {
++ range_type = TYPE_INDEX_TYPE (TYPE_TARGET_TYPE (array_type));
++ slice_range_size = ary_low_bound + (row_count * elem_count) - 1;
++ ary_low_bound = TYPE_LOW_BOUND (range_type);
++ }
+
+ /* FIXME-type-allocation: need a way to free this type when we are
+- done with it. */
+- slice_range_type = create_static_range_type ((struct type *) NULL,
+- TYPE_TARGET_TYPE (range_type),
+- lowbound,
+- lowbound + length - 1);
++ done with it. */
+
++ slice_range_type = create_static_range_type (NULL, TYPE_TARGET_TYPE (range_type),
++ ary_low_bound, slice_range_size);
+ {
+- struct type *element_type = TYPE_TARGET_TYPE (array_type);
+- LONGEST offset
+- = (lowbound - lowerbound) * TYPE_LENGTH (check_typedef (element_type));
++ struct type *element_type;
++
++ /* When both CALL_COUNT and STRIDE_LENGTH equal 1, we can use the legacy
++ code for subarrays. */
++ if (call_count == 1 && stride_length == 1)
++ {
++ element_type = TYPE_TARGET_TYPE (array_type);
++
++ slice_type = create_array_type (NULL, element_type, slice_range_type);
+
+- slice_type = create_array_type ((struct type *) NULL,
+- element_type,
+- slice_range_type);
+- TYPE_CODE (slice_type) = TYPE_CODE (array_type);
++ TYPE_CODE (slice_type) = TYPE_CODE (array_type);
+
+- if (VALUE_LVAL (array) == lval_memory && value_lazy (array))
+- slice = allocate_value_lazy (slice_type);
++ if (VALUE_LVAL (array) == lval_memory && value_lazy (array))
++ v = allocate_value_lazy (slice_type);
++ else
++ {
++ v = allocate_value (slice_type);
++ value_contents_copy (v,
++ value_embedded_offset (v),
++ array,
++ value_embedded_offset (array) + elt_offs,
++ elt_size * longest_to_int (length));
++ }
++
++ }
++ /* With a CALL_COUNT or STRIDE_LENGTH are greater than 1 we are working
++ on a range of ranges. So we copy the relevant elements into the
++ new array we return. */
+ else
+ {
+- slice = allocate_value (slice_type);
+- value_contents_copy (slice, 0, array, offset,
+- type_length_units (slice_type));
++ int j, offs_store = elt_offs;
++ LONGEST dst_offset = 0;
++ LONGEST src_row_length = TYPE_LENGTH (TYPE_TARGET_TYPE (array_type));
++
++ if (call_count == 1)
++ {
++ /* When CALL_COUNT is equal to 1 we are working on the current range
++ and use these elements directly. */
++ element_type = TYPE_TARGET_TYPE (array_type);
++ }
++ else
++ {
++ /* Working on an array of arrays, the type of the elements is the type
++ of the subarrays' type. */
++ element_type = TYPE_TARGET_TYPE (TYPE_TARGET_TYPE (array_type));
++ }
++
++ slice_type = create_array_type (NULL, element_type, slice_range_type);
++
++ /* If we have a one dimensional array, we copy its TYPE_CODE. For a
++ multi dimensional array we copy the embedded type's TYPE_CODE. */
++ if (call_count == 1)
++ TYPE_CODE (slice_type) = TYPE_CODE (array_type);
++ else
++ TYPE_CODE (slice_type) = TYPE_CODE (TYPE_TARGET_TYPE (array_type));
++
++ v = allocate_value (slice_type);
++
++ /* Iterate through the rows of the outer array and set the new offset
++ for each row. */
++ for (i = 0; i < row_count; i++)
++ {
++ elt_offs = offs_store + i * src_row_length;
++
++ /* Iterate through the elements in each row to copy only those. */
++ for (j = 1; j <= elem_count; j++)
++ {
++ /* Fetches the contents of ARRAY and copies them into V. */
++ value_contents_copy (v, dst_offset, array, elt_offs, elt_size);
++ elt_offs += elt_size * stride_length;
++ dst_offset += elt_size;
++ }
++ }
+ }
+
+- set_value_component_location (slice, array);
+- set_value_offset (slice, value_offset (array) + offset);
++ set_value_component_location (v, array);
++ if (VALUE_LVAL (v) == lval_register)
++ {
++ VALUE_REGNUM (v) = VALUE_REGNUM (array);
++ VALUE_NEXT_FRAME_ID (v) = VALUE_NEXT_FRAME_ID (array);
++ }
++ set_value_offset (v, value_offset (array) + elt_offs);
+ }
+
+- return slice;
++ return v;
+ }
+
+ /* Create a value for a FORTRAN complex number. Currently most of the
+diff --git a/gdb/value.h b/gdb/value.h
+index 7dc67dc721..03ca06448f 100644
+--- a/gdb/value.h
++++ b/gdb/value.h
+@@ -1128,6 +1128,8 @@ extern struct value *varying_to_slice (struct value *);
+
+ extern struct value *value_slice (struct value *, int, int);
+
++extern struct value *value_slice_1 (struct value *, int, int, int, int);
++
+ extern struct value *value_literal_complex (struct value *, struct value *,
+ struct type *);
+
+--
+2.14.3
+
diff --git a/gdb-vla-intel-stringbt-fix.patch b/gdb-vla-intel-stringbt-fix.patch
new file mode 100644
index 0000000..6f4c625
--- /dev/null
+++ b/gdb-vla-intel-stringbt-fix.patch
@@ -0,0 +1,194 @@
+From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
+From: Jan Kratochvil <jan.kratochvil(a)redhat.com>
+Date: Fri, 1 Aug 2014 23:02:17 +0200
+Subject: Crash regression(?) printing Fortran strings in bt [Re: [V2 00/23]
+ Fortran dynamic array support]
+
+FileName: gdb-vla-intel-stringbt-fix.patch
+
+;;=push+jan
+
+http://sourceware.org/ml/gdb-patches/2014-08/msg00025.html
+
+On Fri, 01 Aug 2014 09:20:19 +0200, Keven Boell wrote:
+> I just tried it on Fedora 20 i686. Applied the patch, you mentioned, on top of
+> the Fortran VLA series and executed your dynamic-other-frame test. Everything
+> is working fine here, I cannot reproduce the crash.
+
+I have it reproducible on Fedora 20 i686 with plain
+CFLAGS=-g ./configure;make;cd gdb/testsuite;make site.exp;runtest gdb.fortran/dynamic-other-frame.exp
+
+Besides that I have updated the testcase with
+ gdb_test_no_output "set print frame-arguments all"
+so that there is no longer needed the patch:
+ [patch] Display Fortran strings in backtraces
+ https://sourceware.org/ml/gdb-patches/2014-07/msg00709.html
+
+The fix below has no regressions for me. Unfortunately I do not see why you
+cannot reproduce it.
+
+Thanks,
+Jan
+---
+ gdb/dwarf2loc.c | 15 +++++++++
+ .../gdb.fortran/dynamic-other-frame-stub.f90 | 24 +++++++++++++
+ gdb/testsuite/gdb.fortran/dynamic-other-frame.exp | 39 ++++++++++++++++++++++
+ gdb/testsuite/gdb.fortran/dynamic-other-frame.f90 | 36 ++++++++++++++++++++
+ 4 files changed, 114 insertions(+)
+ create mode 100644 gdb/testsuite/gdb.fortran/dynamic-other-frame-stub.f90
+ create mode 100644 gdb/testsuite/gdb.fortran/dynamic-other-frame.exp
+ create mode 100644 gdb/testsuite/gdb.fortran/dynamic-other-frame.f90
+
+diff --git a/gdb/dwarf2loc.c b/gdb/dwarf2loc.c
+index 5105c8d23a..5486e4dc12 100644
+--- a/gdb/dwarf2loc.c
++++ b/gdb/dwarf2loc.c
+@@ -42,6 +42,7 @@
+ #include <algorithm>
+ #include <vector>
+ #include <unordered_set>
++#include <functional>
+ #include "common/underlying.h"
+ #include "common/byte-vector.h"
+
+@@ -2348,6 +2349,20 @@ dwarf2_evaluate_loc_desc_full (struct type *type, struct frame_info *frame,
+ ctx.per_cu = per_cu;
+ ctx.obj_address = 0;
+
++frame_id old_frame_id (get_frame_id (deprecated_safe_get_selected_frame ()));
++class RestoreCall {
++private:
++ const std::function<void ()> func;
++public:
++ RestoreCall(std::function<void ()> func_):func(func_) {}
++ ~RestoreCall() { func(); }
++} restore_frame([=]() {
++ frame_info *old_frame (frame_find_by_id (old_frame_id));
++ if (old_frame != NULL)
++ select_frame (old_frame);
++});
++if (frame != NULL) select_frame (frame);
++
+ scoped_value_mark free_values;
+
+ ctx.gdbarch = get_objfile_arch (objfile);
+diff --git a/gdb/testsuite/gdb.fortran/dynamic-other-frame-stub.f90 b/gdb/testsuite/gdb.fortran/dynamic-other-frame-stub.f90
+new file mode 100644
+index 0000000000..261ce17ae5
+--- /dev/null
++++ b/gdb/testsuite/gdb.fortran/dynamic-other-frame-stub.f90
+@@ -0,0 +1,24 @@
++! Copyright 2010 Free Software Foundation, Inc.
++!
++! This program is free software; you can redistribute it and/or modify
++! it under the terms of the GNU General Public License as published by
++! the Free Software Foundation; either version 2 of the License, or
++! (at your option) any later version.
++!
++! This program is distributed in the hope that it will be useful,
++! but WITHOUT ANY WARRANTY; without even the implied warranty of
++! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++! GNU General Public License for more details.
++!
++! You should have received a copy of the GNU General Public License
++! along with this program; if not, write to the Free Software
++! Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
++!
++! Ihis file is the Fortran source file for dynamic.exp.
++! Original file written by Jakub Jelinek <jakub(a)redhat.com>.
++! Modified for the GDB testcase by Jan Kratochvil <jan.kratochvil(a)redhat.com>.
++
++subroutine bar
++ real :: dummy
++ dummy = 1
++end subroutine bar
+diff --git a/gdb/testsuite/gdb.fortran/dynamic-other-frame.exp b/gdb/testsuite/gdb.fortran/dynamic-other-frame.exp
+new file mode 100644
+index 0000000000..570a28ca65
+--- /dev/null
++++ b/gdb/testsuite/gdb.fortran/dynamic-other-frame.exp
+@@ -0,0 +1,39 @@
++# Copyright 2010 Free Software Foundation, Inc.
++
++# This program is free software; you can redistribute it and/or modify
++# it under the terms of the GNU General Public License as published by
++# the Free Software Foundation; either version 2 of the License, or
++# (at your option) any later version.
++#
++# This program is distributed in the hope that it will be useful,
++# but WITHOUT ANY WARRANTY; without even the implied warranty of
++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++# GNU General Public License for more details.
++#
++# You should have received a copy of the GNU General Public License
++# along with this program; if not, write to the Free Software
++# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
++
++set testfile "dynamic-other-frame"
++set srcfile1 ${testfile}.f90
++set srcfile2 ${testfile}-stub.f90
++set objfile2 [standard_output_file ${testfile}-stub.o]
++set executable ${testfile}
++set binfile [standard_output_file ${executable}]
++
++if { [gdb_compile "${srcdir}/${subdir}/${srcfile2}" "${objfile2}" object {f90}] != ""
++ || [gdb_compile "${srcdir}/${subdir}/${srcfile1} ${objfile2}" "${binfile}" executable {debug f90}] != "" } {
++ untested "Couldn't compile ${srcfile1} or ${srcfile2}"
++ return -1
++}
++
++clean_restart ${executable}
++
++gdb_test_no_output "set print frame-arguments all"
++
++if ![runto bar_] then {
++ perror "couldn't run to bar_"
++ continue
++}
++
++gdb_test "bt" {foo \(string='hello'.*}
+diff --git a/gdb/testsuite/gdb.fortran/dynamic-other-frame.f90 b/gdb/testsuite/gdb.fortran/dynamic-other-frame.f90
+new file mode 100644
+index 0000000000..2bc637db49
+--- /dev/null
++++ b/gdb/testsuite/gdb.fortran/dynamic-other-frame.f90
+@@ -0,0 +1,36 @@
++! Copyright 2010 Free Software Foundation, Inc.
++!
++! This program is free software; you can redistribute it and/or modify
++! it under the terms of the GNU General Public License as published by
++! the Free Software Foundation; either version 2 of the License, or
++! (at your option) any later version.
++!
++! This program is distributed in the hope that it will be useful,
++! but WITHOUT ANY WARRANTY; without even the implied warranty of
++! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++! GNU General Public License for more details.
++!
++! You should have received a copy of the GNU General Public License
++! along with this program; if not, write to the Free Software
++! Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
++!
++! Ihis file is the Fortran source file for dynamic.exp.
++! Original file written by Jakub Jelinek <jakub(a)redhat.com>.
++! Modified for the GDB testcase by Jan Kratochvil <jan.kratochvil(a)redhat.com>.
++
++subroutine foo (string)
++ interface
++ subroutine bar
++ end subroutine
++ end interface
++ character string*(*)
++ call bar ! stop-here
++end subroutine foo
++program test
++ interface
++ subroutine foo (string)
++ character string*(*)
++ end subroutine
++ end interface
++ call foo ('hello')
++end
+--
+2.14.3
+
diff --git a/gdb-vla-intel-tests.patch b/gdb-vla-intel-tests.patch
deleted file mode 100644
index 427ec95..0000000
--- a/gdb-vla-intel-tests.patch
+++ /dev/null
@@ -1,293 +0,0 @@
-Index: gdb-7.10.50.20160106/gdb/testsuite/gdb.fortran/vla-func.exp
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ gdb-7.10.50.20160106/gdb/testsuite/gdb.fortran/vla-func.exp 2016-01-08 19:15:44.983637680 +0100
-@@ -0,0 +1,61 @@
-+# Copyright 2014 Free Software Foundation, Inc.
-+
-+# This program is free software; you can redistribute it and/or modify
-+# it under the terms of the GNU General Public License as published by
-+# the Free Software Foundation; either version 3 of the License, or
-+# (at your option) any later version.
-+#
-+# This program is distributed in the hope that it will be useful,
-+# but WITHOUT ANY WARRANTY; without even the implied warranty of
-+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+# GNU General Public License for more details.
-+#
-+# You should have received a copy of the GNU General Public License
-+# along with this program. If not, see <http://www.gnu.org/licenses/>.
-+
-+standard_testfile ".f90"
-+
-+if { [prepare_for_testing ${testfile}.exp ${testfile} ${srcfile} \
-+ {debug f90 quiet}] } {
-+ return -1
-+}
-+
-+if ![runto MAIN__] then {
-+ perror "couldn't run to breakpoint MAIN__"
-+ continue
-+}
-+
-+# Check VLA passed to first Fortran function.
-+gdb_breakpoint [gdb_get_line_number "func1-vla-passed"]
-+gdb_continue_to_breakpoint "func1-vla-passed"
-+gdb_test "print vla" " = \\( *\\( *22, *22, *22,\[()22, .\]*\\)" \
-+ "print vla (func1)"
-+gdb_test "ptype vla" "type = integer\\\(kind=4\\\) \\\(10,10\\\)" \
-+ "ptype vla (func1)"
-+
-+gdb_breakpoint [gdb_get_line_number "func1-vla-modified"]
-+gdb_continue_to_breakpoint "func1-vla-modified"
-+gdb_test "print vla(5,5)" " = 55" "print vla(5,5) (func1)"
-+gdb_test "print vla(7,7)" " = 77" "print vla(5,5) (func1)"
-+
-+# Check if the values are correct after returning from func1
-+gdb_breakpoint [gdb_get_line_number "func1-returned"]
-+gdb_continue_to_breakpoint "func1-returned"
-+gdb_test "print ret" " = .TRUE." "print ret after func1 returned"
-+
-+# Check VLA passed to second Fortran function
-+gdb_breakpoint [gdb_get_line_number "func2-vla-passed"]
-+gdb_continue_to_breakpoint "func2-vla-passed"
-+gdb_test "print vla" \
-+ " = \\\(44, 44, 44, 44, 44, 44, 44, 44, 44, 44\\\)" \
-+ "print vla (func2)"
-+gdb_test "ptype vla" "type = integer\\\(kind=4\\\) \\\(10\\\)" \
-+ "ptype vla (func2)"
-+
-+# Check if the returned VLA has the correct values and ptype.
-+gdb_breakpoint [gdb_get_line_number "func2-returned"]
-+gdb_continue_to_breakpoint "func2-returned"
-+gdb_test "print vla3" " = \\\(1, 2, 44, 4, 44, 44, 44, 8, 44, 44\\\)" \
-+ "print vla3 (after func2)"
-+gdb_test "ptype vla3" "type = integer\\\(kind=4\\\) \\\(10\\\)" \
-+ "ptype vla3 (after func2)"
-Index: gdb-7.10.50.20160106/gdb/testsuite/gdb.fortran/vla-func.f90
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ gdb-7.10.50.20160106/gdb/testsuite/gdb.fortran/vla-func.f90 2016-01-08 19:15:44.983637680 +0100
-@@ -0,0 +1,71 @@
-+! Copyright 2014 Free Software Foundation, Inc.
-+!
-+! This program is free software; you can redistribute it and/or modify
-+! it under the terms of the GNU General Public License as published by
-+! the Free Software Foundation; either version 2 of the License, or
-+! (at your option) any later version.
-+!
-+! This program is distributed in the hope that it will be useful,
-+! but WITHOUT ANY WARRANTY; without even the implied warranty of
-+! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+! GNU General Public License for more details.
-+!
-+! You should have received a copy of the GNU General Public License
-+! along with this program; if not, write to the Free Software
-+! Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-+
-+logical function func1 (vla)
-+ implicit none
-+ integer, allocatable :: vla (:, :)
-+ func1 = allocated(vla)
-+ vla(5,5) = 55 ! func1-vla-passed
-+ vla(7,7) = 77
-+ return ! func1-vla-modified
-+end function func1
-+
-+function func2(vla)
-+ implicit none
-+ integer :: vla (:)
-+ integer :: func2(size(vla))
-+ integer :: k
-+
-+ vla(1) = 1 ! func2-vla-passed
-+ vla(2) = 2
-+ vla(4) = 4
-+ vla(8) = 8
-+
-+ func2 = vla
-+end function func2
-+
-+program vla_func
-+ implicit none
-+ interface
-+ logical function func1 (vla)
-+ integer, allocatable :: vla (:, :)
-+ end function
-+ end interface
-+ interface
-+ function func2 (vla)
-+ integer :: vla (:)
-+ integer func2(size(vla))
-+ end function
-+ end interface
-+
-+ logical :: ret
-+ integer, allocatable :: vla1 (:, :)
-+ integer, allocatable :: vla2 (:)
-+ integer, allocatable :: vla3 (:)
-+
-+ ret = .FALSE.
-+
-+ allocate (vla1 (10,10))
-+ vla1(:,:) = 22
-+
-+ allocate (vla2 (10))
-+ vla2(:) = 44
-+
-+ ret = func1(vla1)
-+ vla3 = func2(vla2) ! func1-returned
-+
-+ ret = .TRUE. ! func2-returned
-+end program vla_func
-Index: gdb-7.10.50.20160106/gdb/testsuite/gdb.fortran/vla-stringsold.exp
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ gdb-7.10.50.20160106/gdb/testsuite/gdb.fortran/vla-stringsold.exp 2016-01-08 19:15:44.984637686 +0100
-@@ -0,0 +1,101 @@
-+# Copyright 2014 Free Software Foundation, Inc.
-+
-+# This program is free software; you can redistribute it and/or modify
-+# it under the terms of the GNU General Public License as published by
-+# the Free Software Foundation; either version 3 of the License, or
-+# (at your option) any later version.
-+#
-+# This program is distributed in the hope that it will be useful,
-+# but WITHOUT ANY WARRANTY; without even the implied warranty of
-+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+# GNU General Public License for more details.
-+#
-+# You should have received a copy of the GNU General Public License
-+# along with this program. If not, see <http://www.gnu.org/licenses/>.
-+
-+standard_testfile ".f90"
-+
-+if { [prepare_for_testing ${testfile}.exp ${testfile} ${srcfile} \
-+ {debug f90 quiet}] } {
-+ return -1
-+}
-+
-+# check that all fortran standard datatypes will be
-+# handled correctly when using as VLA's
-+
-+if ![runto MAIN__] then {
-+ perror "couldn't run to breakpoint MAIN__"
-+ continue
-+}
-+
-+gdb_breakpoint [gdb_get_line_number "var_char-allocated-1"]
-+gdb_continue_to_breakpoint "var_char-allocated-1"
-+gdb_test "print var_char" \
-+ " = \\(PTR TO -> \\( character\\*10 \\)\\) ${hex}" \
-+ "print var_char after allocated first time"
-+gdb_test "whatis var_char" "type = PTR TO -> \\( character\\*10 \\)" \
-+ "whatis var_char first time"
-+gdb_test "ptype var_char" "type = PTR TO -> \\( character\\*10 \\)" \
-+ "ptype var_char first time"
-+gdb_test "next" "\\d+.*var_char = 'foo'.*" \
-+ "next to allocation status of var_char"
-+gdb_test "print l" " = .TRUE." "print allocation status first time"
-+
-+gdb_breakpoint [gdb_get_line_number "var_char-filled-1"]
-+gdb_continue_to_breakpoint "var_char-filled-1"
-+gdb_test "print var_char" \
-+ " = \\(PTR TO -> \\( character\\*3 \\)\\) ${hex}" \
-+ "print var_char after filled first time"
-+gdb_test "print *var_char" " = 'foo'" \
-+ "print *var_char after filled first time"
-+gdb_test "whatis var_char" "type = PTR TO -> \\( character\\*3 \\)" \
-+ "whatis var_char after filled first time"
-+gdb_test "ptype var_char" "type = PTR TO -> \\( character\\*3 \\)" \
-+ "ptype var_char after filled first time"
-+gdb_test "print var_char(1)" " = 102 'f'" "print var_char(1)"
-+gdb_test "print var_char(3)" " = 111 'o'" "print var_char(3)"
-+
-+gdb_breakpoint [gdb_get_line_number "var_char-filled-2"]
-+gdb_continue_to_breakpoint "var_char-filled-2"
-+gdb_test "print var_char" \
-+ " = \\(PTR TO -> \\( character\\*6 \\)\\) ${hex}" \
-+ "print var_char after allocated second time"
-+gdb_test "print *var_char" " = 'foobar'" \
-+ "print *var_char after allocated second time"
-+gdb_test "whatis var_char" "type = PTR TO -> \\( character\\*6 \\)" \
-+ "whatis var_char second time"
-+gdb_test "ptype var_char" "type = PTR TO -> \\( character\\*6 \\)" \
-+ "ptype var_char second time"
-+
-+gdb_breakpoint [gdb_get_line_number "var_char-empty"]
-+gdb_continue_to_breakpoint "var_char-empty"
-+gdb_test "print var_char" \
-+ " = \\(PTR TO -> \\( character\\*0 \\)\\) ${hex}" \
-+ "print var_char after set empty"
-+gdb_test "print *var_char" " = \"\"" "print *var_char after set empty"
-+gdb_test "whatis var_char" "type = PTR TO -> \\( character\\*0 \\)" \
-+ "whatis var_char after set empty"
-+gdb_test "ptype var_char" "type = PTR TO -> \\( character\\*0 \\)" \
-+ "ptype var_char after set empty"
-+
-+gdb_breakpoint [gdb_get_line_number "var_char-allocated-3"]
-+gdb_continue_to_breakpoint "var_char-allocated-3"
-+gdb_test "print var_char" \
-+ " = \\(PTR TO -> \\( character\\*21 \\)\\) ${hex}" \
-+ "print var_char after allocated third time"
-+gdb_test "whatis var_char" "type = PTR TO -> \\( character\\*21 \\)" \
-+ "whatis var_char after allocated third time"
-+gdb_test "ptype var_char" "type = PTR TO -> \\( character\\*21 \\)" \
-+ "ptype var_char after allocated third time"
-+
-+gdb_breakpoint [gdb_get_line_number "var_char_p-associated"]
-+gdb_continue_to_breakpoint "var_char_p-associated"
-+gdb_test "print var_char_p" \
-+ " = \\(PTR TO -> \\( character\\*7 \\)\\) ${hex}" \
-+ "print var_char_p after associated"
-+gdb_test "print *var_char_p" " = 'johndoe'" \
-+ "print *var_char_ after associated"
-+gdb_test "whatis var_char_p" "type = PTR TO -> \\( character\\*7 \\)" \
-+ "whatis var_char_p after associated"
-+gdb_test "ptype var_char_p" "type = PTR TO -> \\( character\\*7 \\)" \
-+ "ptype var_char_p after associated"
-Index: gdb-7.10.50.20160106/gdb/testsuite/gdb.fortran/vla-stringsold.f90
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ gdb-7.10.50.20160106/gdb/testsuite/gdb.fortran/vla-stringsold.f90 2016-01-08 19:15:44.984637686 +0100
-@@ -0,0 +1,40 @@
-+! Copyright 2014 Free Software Foundation, Inc.
-+!
-+! This program is free software; you can redistribute it and/or modify
-+! it under the terms of the GNU General Public License as published by
-+! the Free Software Foundation; either version 2 of the License, or
-+! (at your option) any later version.
-+!
-+! This program is distributed in the hope that it will be useful,
-+! but WITHOUT ANY WARRANTY; without even the implied warranty of
-+! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+! GNU General Public License for more details.
-+!
-+! You should have received a copy of the GNU General Public License
-+! along with this program; if not, write to the Free Software
-+! Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-+
-+program vla_strings
-+ character(len=:), target, allocatable :: var_char
-+ character(len=:), pointer :: var_char_p
-+ logical :: l
-+
-+ allocate(character(len=10) :: var_char)
-+ l = allocated(var_char) ! var_char-allocated-1
-+ var_char = 'foo'
-+ deallocate(var_char) ! var_char-filled-1
-+ l = allocated(var_char) ! var_char-deallocated
-+ allocate(character(len=42) :: var_char)
-+ l = allocated(var_char)
-+ var_char = 'foobar'
-+ var_char = '' ! var_char-filled-2
-+ var_char = 'bar' ! var_char-empty
-+ deallocate(var_char)
-+ allocate(character(len=21) :: var_char)
-+ l = allocated(var_char) ! var_char-allocated-3
-+ var_char = 'johndoe'
-+ var_char_p => var_char
-+ l = associated(var_char_p) ! var_char_p-associated
-+ var_char_p => null()
-+ l = associated(var_char_p) ! var_char_p-not-associated
-+end program vla_strings
diff --git a/gdb-x86_64-i386-syscall-restart.patch b/gdb-x86_64-i386-syscall-restart.patch
index af3cccd..7c731e3 100644
--- a/gdb-x86_64-i386-syscall-restart.patch
+++ b/gdb-x86_64-i386-syscall-restart.patch
@@ -1,3 +1,13 @@
+From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
+From: Fedora GDB patches <invalid(a)email.com>
+Date: Fri, 27 Oct 2017 21:07:50 +0200
+Subject: gdb-x86_64-i386-syscall-restart.patch
+
+FileName: gdb-x86_64-i386-syscall-restart.patch
+
+;; Fix syscall restarts for amd64->i386 biarch.
+;;=push+jan
+
http://sourceware.org/ml/gdb-patches/2009-11/msg00592.html
Subject: [patch] Fix syscall restarts for amd64->i386 biarch
@@ -15,7 +25,6 @@ x86_64 i386 i386 PASS on recent kernels
(PASS: kernel-2.6.32-0.55.rc8.git1.fc13.x86_64)
i386 i386 i386 PASS
-
Currently gdb.base/interrupt.exp fails on amd64 host running under
--target_board unix/-m32 with:
continue
@@ -29,7 +38,6 @@ Currently gdb.base/interrupt.exp fails on amd64 host running under
* at syscall exit tracing, but they will never be left for the debugged user
* process to see.
*/
-#define ERESTARTSYS 512
"Unknown error 512" printed above is printed by the inferior itself, not by GDB.
@@ -39,7 +47,6 @@ It is because GDB reads it as 0xfffffffffffffe00 but writes it back as
+ for -ERESTART* values -512 being above 0xfffffffffffffe00; tested by
+ interrupt.exp. */
-
Quote of Roland McGrath from IRC:
roland: in the user_regset model, there are 64-bit user_regset flavors and
@@ -62,7 +69,6 @@ roland: so a 64-bit debugger should see and be able to fiddle the full
registers. it can even change cs via ptrace to force the inferior into
running 32 or 64 bit code.
-
Saving whole 64bits for i386 targets on x86_64 hosts does not much match the
GDB architecture as `struct type' for these registers still should be 32bit
etc. Therefore provided just this exception.
@@ -72,20 +78,23 @@ interruption to do full inferior save/restore from GDB regcache.
Regression tested on {x86_64,x86_64-m32,i686}-fedora12-linux-gnu.
-
Thanks,
Jan
-
gdb/
2009-11-29 Jan Kratochvil <jan.kratochvil(a)redhat.com>
* amd64-nat.c (amd64_collect_native_gregset): Do not pre-clear %eax.
Sign extend it afterwards.
+---
+ gdb/amd64-nat.c | 20 ++++++++++++++++++--
+ 1 file changed, 18 insertions(+), 2 deletions(-)
+diff --git a/gdb/amd64-nat.c b/gdb/amd64-nat.c
+index 12d364a716..0359edf041 100644
--- a/gdb/amd64-nat.c
+++ b/gdb/amd64-nat.c
-@@ -131,9 +131,9 @@ amd64_collect_native_gregset (const struct regcache *regcache,
+@@ -135,9 +135,9 @@ amd64_collect_native_gregset (const struct regcache *regcache,
{
num_regs = amd64_native_gregset32_num_regs;
@@ -97,7 +106,7 @@ gdb/
{
if (regnum == -1 || regnum == i)
memset (regs + amd64_native_gregset_reg_offset (gdbarch, i), 0, 8);
-@@ -159,4 +159,20 @@ amd64_collect_native_gregset (const struct regcache *regcache,
+@@ -163,4 +163,20 @@ amd64_collect_native_gregset (const struct regcache *regcache,
regcache_raw_collect (regcache, i, regs + offset);
}
}
@@ -118,4 +127,6 @@ gdb/
+ }
+ }
}
+--
+2.14.3
diff --git a/insight-7.12-gdb-6.3-readnever-20050907.patch b/insight-7.12-gdb-6.3-readnever-20050907.patch
deleted file mode 100644
index 21c467a..0000000
--- a/insight-7.12-gdb-6.3-readnever-20050907.patch
+++ /dev/null
@@ -1,78 +0,0 @@
-diff -Naurp insight-7.12.50.20170416.orig/gdb/doc/gdb.texinfo insight-7.12.50.20170416.new/gdb/doc/gdb.texinfo
---- insight-7.12.50.20170416.orig/gdb/doc/gdb.texinfo 2017-04-16 11:51:34.697009514 +0100
-+++ insight-7.12.50.20170416.new/gdb/doc/gdb.texinfo 2017-04-16 11:56:31.611716645 +0100
-@@ -1037,6 +1037,12 @@ Read each symbol file's entire symbol ta
- the default, which is to read it incrementally as it is needed.
- This makes startup slower, but makes future operations faster.
-
-+@item --readnever
-+@cindex @code{--readnever}
-+Do not read each symbol file's symbolic debug information. This makes
-+startup faster but at the expense of not being able to perform
-+symbolic debugging.
-+
- @end table
-
- @node Mode Options
-diff -Naurp insight-7.12.50.20170416.orig/gdb/dwarf2read.c insight-7.12.50.20170416.new/gdb/dwarf2read.c
---- insight-7.12.50.20170416.orig/gdb/dwarf2read.c 2017-04-15 01:21:12.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/dwarf2read.c 2017-04-16 11:58:01.869539574 +0100
-@@ -73,6 +73,7 @@
- #include "common/function-view.h"
- #include "common/gdb_optional.h"
- #include "common/underlying.h"
-+#include "top.h"
-
- #include <fcntl.h>
- #include <sys/types.h>
-@@ -2207,7 +2208,8 @@ dwarf2_has_info (struct objfile *objfile
- (void *) names);
- dwarf2_per_objfile->objfile = objfile;
- }
-- return (!dwarf2_per_objfile->info.is_virtual
-+ return !readnever_symbol_files &&
-+ (!dwarf2_per_objfile->info.is_virtual
- && dwarf2_per_objfile->info.s.section != NULL
- && !dwarf2_per_objfile->abbrev.is_virtual
- && dwarf2_per_objfile->abbrev.s.section != NULL);
-diff -Naurp insight-7.12.50.20170416.orig/gdb/main.c insight-7.12.50.20170416.new/gdb/main.c
---- insight-7.12.50.20170416.orig/gdb/main.c 2017-04-09 01:11:01.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/main.c 2017-04-16 11:56:31.612716654 +0100
-@@ -614,6 +614,7 @@ captured_main_1 (struct captured_main_ar
- {"tui", no_argument, 0, OPT_TUI},
- {"dbx", no_argument, &dbx_commands, 1},
- {"readnow", no_argument, &readnow_symbol_files, 1},
-+ {"readnever", no_argument, &readnever_symbol_files, 1},
- {"r", no_argument, &readnow_symbol_files, 1},
- {"quiet", no_argument, &quiet, 1},
- {"q", no_argument, &quiet, 1},
-@@ -1202,6 +1203,7 @@ Selection of debuggee and its files:\n\n
- --se=FILE Use FILE as symbol file and executable file.\n\
- --symbols=SYMFILE Read symbols from SYMFILE.\n\
- --readnow Fully read symbol files on first access.\n\
-+ --readnever Do not read symbol files.\n\
- --write Set writing into executable and core files.\n\n\
- "), stream);
- fputs_unfiltered (_("\
-diff -Naurp insight-7.12.50.20170416.orig/gdb/symfile.c insight-7.12.50.20170416.new/gdb/symfile.c
---- insight-7.12.50.20170416.orig/gdb/symfile.c 2017-04-15 01:21:12.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/symfile.c 2017-04-16 11:56:31.614716672 +0100
-@@ -79,6 +79,7 @@ static void clear_symtab_users_cleanup (
-
- /* Global variables owned by this file. */
- int readnow_symbol_files; /* Read full symbols immediately. */
-+int readnever_symbol_files; /* Never read full symbols. */
-
- /* Functions this file defines. */
-
-diff -Naurp insight-7.12.50.20170416.orig/gdb/top.h insight-7.12.50.20170416.new/gdb/top.h
---- insight-7.12.50.20170416.orig/gdb/top.h 2017-04-09 01:11:01.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/top.h 2017-04-16 11:56:31.622716745 +0100
-@@ -269,6 +269,7 @@ extern int gdb_in_secondary_prompt_p (st
-
- /* From random places. */
- extern int readnow_symbol_files;
-+extern int readnever_symbol_files;
-
- /* Perform _initialize initialization. */
- extern void gdb_init (char *);
diff --git a/insight-7.12-gdb-6.6-buildid-locate-core-as-arg.patch b/insight-7.12-gdb-6.6-buildid-locate-core-as-arg.patch
deleted file mode 100644
index a43b4aa..0000000
--- a/insight-7.12-gdb-6.6-buildid-locate-core-as-arg.patch
+++ /dev/null
@@ -1,134 +0,0 @@
-diff -Naurp insight-7.12.50.20170416.orig/gdb/common/common-exceptions.h insight-7.12.50.20170416.new/gdb/common/common-exceptions.h
---- insight-7.12.50.20170416.orig/gdb/common/common-exceptions.h 2017-03-04 04:09:18.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/common/common-exceptions.h 2017-04-16 12:17:55.954426687 +0100
-@@ -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 -Naurp insight-7.12.50.20170416.orig/gdb/exec.c insight-7.12.50.20170416.new/gdb/exec.c
---- insight-7.12.50.20170416.orig/gdb/exec.c 2017-01-21 02:32:23.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/exec.c 2017-04-16 12:17:55.952426669 +0100
-@@ -35,6 +35,7 @@
- #include "progspace.h"
- #include "gdb_bfd.h"
- #include "gcore.h"
-+#include "exceptions.h"
-
- #include <fcntl.h>
- #include "readline/readline.h"
-@@ -359,12 +360,27 @@ exec_file_attach (const char *filename,
-
- if (!bfd_check_format_matches (exec_bfd, bfd_object, &matching))
- {
-+ int is_core;
-+
-+ /* If the user accidentally did "gdb core", print a useful
-+ error message. Check it only after bfd_object has been checked as
-+ a valid executable may get recognized for example also as
-+ "trad-core". */
-+ is_core = bfd_check_format (exec_bfd, bfd_core);
-+
- /* Make sure to close exec_bfd, or else "run" might try to use
- it. */
- exec_close ();
-- error (_("\"%s\": not in executable format: %s"),
-- scratch_pathname,
-- gdb_bfd_errmsg (bfd_get_error (), matching));
-+
-+ if (is_core != 0)
-+ throw_error (IS_CORE_ERROR,
-+ _("\"%s\" is a core file.\n"
-+ "Please specify an executable to debug."),
-+ scratch_pathname);
-+ else
-+ error (_("\"%s\": not in executable format: %s"),
-+ scratch_pathname,
-+ gdb_bfd_errmsg (bfd_get_error (), matching));
- }
-
- if (build_section_table (exec_bfd, §ions, §ions_end))
-diff -Naurp insight-7.12.50.20170416.orig/gdb/main.c insight-7.12.50.20170416.new/gdb/main.c
---- insight-7.12.50.20170416.orig/gdb/main.c 2017-04-16 12:16:41.229745385 +0100
-+++ insight-7.12.50.20170416.new/gdb/main.c 2017-04-16 12:17:55.953426678 +0100
-@@ -458,6 +458,37 @@ struct cmdarg
- char *string;
- };
-
-+/* Call exec_file_attach. If it detected FILENAME is a core file call
-+ core_file_command. Print the original exec_file_attach error only if
-+ core_file_command failed to find a matching executable. */
-+
-+static void
-+exec_or_core_file_attach (const char *filename, int from_tty)
-+{
-+ volatile struct gdb_exception e;
-+
-+ gdb_assert (exec_bfd == NULL);
-+
-+ TRY
-+ {
-+ exec_file_attach (filename, from_tty);
-+ }
-+ CATCH (e, RETURN_MASK_ALL)
-+ {
-+ if (e.error == IS_CORE_ERROR)
-+ {
-+ core_file_command ((char *) filename, from_tty);
-+
-+ /* Iff the core file found its executable suppress the error message
-+ from exec_file_attach. */
-+ if (exec_bfd != NULL)
-+ return;
-+ }
-+ throw_exception (e);
-+ }
-+ END_CATCH
-+}
-+
- static void
- captured_main_1 (struct captured_main_args *context)
- {
-@@ -880,6 +911,8 @@ captured_main_1 (struct captured_main_ar
- {
- symarg = argv[optind];
- execarg = argv[optind];
-+ if (optind + 1 == argc && corearg == NULL)
-+ corearg = argv[optind];
- optind++;
- }
-
-@@ -1030,11 +1063,25 @@ captured_main_1 (struct captured_main_ar
- && symarg != NULL
- && strcmp (execarg, symarg) == 0)
- {
-+ catch_command_errors_const_ftype *func;
-+
-+ /* Call exec_or_core_file_attach only if the file was specified as
-+ a command line argument (and not an a command line option). */
-+ if (corearg != NULL && strcmp (corearg, execarg) == 0)
-+ {
-+ func = exec_or_core_file_attach;
-+ corearg = NULL;
-+ }
-+ else
-+ func = exec_file_attach;
-+
- /* The exec file and the symbol-file are the same. If we can't
- open it, better only print one error message.
-- catch_command_errors returns non-zero on success! */
-- if (catch_command_errors_const (exec_file_attach, execarg,
-- !batch_flag))
-+ catch_command_errors returns non-zero on success!
-+ Do not load EXECARG as a symbol file if it has been already processed
-+ as a core file. */
-+ if (catch_command_errors_const (func, execarg, !batch_flag)
-+ && core_bfd == NULL)
- catch_command_errors_const (symbol_file_add_main_adapter, symarg,
- !batch_flag);
- }
diff --git a/insight-7.12-gdb-6.6-buildid-locate-rpm.patch b/insight-7.12-gdb-6.6-buildid-locate-rpm.patch
deleted file mode 100644
index 5f17b7c..0000000
--- a/insight-7.12-gdb-6.6-buildid-locate-rpm.patch
+++ /dev/null
@@ -1,1504 +0,0 @@
-diff -Naurp insight-7.12.50.20170416.orig/gdb/aclocal.m4 insight-7.12.50.20170416.new/gdb/aclocal.m4
---- insight-7.12.50.20170416.orig/gdb/aclocal.m4 2017-04-16 10:13:12.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/aclocal.m4 2017-04-16 12:12:54.707680063 +0100
-@@ -12,6 +12,221 @@
- # PARTICULAR PURPOSE.
-
- m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])])
-+# pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*-
-+# serial 1 (pkg-config-0.24)
-+#
-+# Copyright © 2004 Scott James Remnant <scott(a)netsplit.com>.
-+#
-+# This program is free software; you can redistribute it and/or modify
-+# it under the terms of the GNU General Public License as published by
-+# the Free Software Foundation; either version 2 of the License, or
-+# (at your option) any later version.
-+#
-+# This program is distributed in the hope that it will be useful, but
-+# WITHOUT ANY WARRANTY; without even the implied warranty of
-+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-+# General Public License for more details.
-+#
-+# You should have received a copy of the GNU General Public License
-+# along with this program; if not, write to the Free Software
-+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-+#
-+# As a special exception to the GNU General Public License, if you
-+# distribute this file as part of a program that contains a
-+# configuration script generated by Autoconf, you may include it under
-+# the same distribution terms that you use for the rest of that program.
-+
-+# PKG_PROG_PKG_CONFIG([MIN-VERSION])
-+# ----------------------------------
-+AC_DEFUN([PKG_PROG_PKG_CONFIG],
-+[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
-+m4_pattern_allow([^PKG_CONFIG(_(PATH|LIBDIR|SYSROOT_DIR|ALLOW_SYSTEM_(CFLAGS|LIBS)))?$])
-+m4_pattern_allow([^PKG_CONFIG_(DISABLE_UNINSTALLED|TOP_BUILD_DIR|DEBUG_SPEW)$])
-+AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])
-+AC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path])
-+AC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path])
-+
-+if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
-+ AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
-+fi
-+if test -n "$PKG_CONFIG"; then
-+ _pkg_min_version=m4_default([$1], [0.9.0])
-+ AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
-+ if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
-+ AC_MSG_RESULT([yes])
-+ else
-+ AC_MSG_RESULT([no])
-+ PKG_CONFIG=""
-+ fi
-+fi[]dnl
-+])# PKG_PROG_PKG_CONFIG
-+
-+# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
-+#
-+# Check to see whether a particular set of modules exists. Similar
-+# to PKG_CHECK_MODULES(), but does not set variables or print errors.
-+#
-+# Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG])
-+# only at the first occurence in configure.ac, so if the first place
-+# it's called might be skipped (such as if it is within an "if", you
-+# have to call PKG_CHECK_EXISTS manually
-+# --------------------------------------------------------------
-+AC_DEFUN([PKG_CHECK_EXISTS],
-+[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
-+if test -n "$PKG_CONFIG" && \
-+ AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
-+ m4_default([$2], [:])
-+m4_ifvaln([$3], [else
-+ $3])dnl
-+fi])
-+
-+# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
-+# ---------------------------------------------
-+m4_define([_PKG_CONFIG],
-+[if test -n "$$1"; then
-+ pkg_cv_[]$1="$$1"
-+ elif test -n "$PKG_CONFIG"; then
-+ PKG_CHECK_EXISTS([$3],
-+ [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`
-+ test "x$?" != "x0" && pkg_failed=yes ],
-+ [pkg_failed=yes])
-+ else
-+ pkg_failed=untried
-+fi[]dnl
-+])# _PKG_CONFIG
-+
-+# _PKG_SHORT_ERRORS_SUPPORTED
-+# -----------------------------
-+AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
-+[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
-+if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
-+ _pkg_short_errors_supported=yes
-+else
-+ _pkg_short_errors_supported=no
-+fi[]dnl
-+])# _PKG_SHORT_ERRORS_SUPPORTED
-+
-+
-+# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
-+# [ACTION-IF-NOT-FOUND])
-+#
-+#
-+# Note that if there is a possibility the first call to
-+# PKG_CHECK_MODULES might not happen, you should be sure to include an
-+# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
-+#
-+#
-+# --------------------------------------------------------------
-+AC_DEFUN([PKG_CHECK_MODULES],
-+[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
-+AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
-+AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
-+
-+pkg_failed=no
-+AC_MSG_CHECKING([for $1])
-+
-+_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
-+_PKG_CONFIG([$1][_LIBS], [libs], [$2])
-+
-+m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
-+and $1[]_LIBS to avoid the need to call pkg-config.
-+See the pkg-config man page for more details.])
-+
-+if test $pkg_failed = yes; then
-+ AC_MSG_RESULT([no])
-+ _PKG_SHORT_ERRORS_SUPPORTED
-+ if test $_pkg_short_errors_supported = yes; then
-+ $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1`
-+ else
-+ $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1`
-+ fi
-+ # Put the nasty error message in config.log where it belongs
-+ echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
-+
-+ m4_default([$4], [AC_MSG_ERROR(
-+[Package requirements ($2) were not met:
-+
-+$$1_PKG_ERRORS
-+
-+Consider adjusting the PKG_CONFIG_PATH environment variable if you
-+installed software in a non-standard prefix.
-+
-+_PKG_TEXT])[]dnl
-+ ])
-+elif test $pkg_failed = untried; then
-+ AC_MSG_RESULT([no])
-+ m4_default([$4], [AC_MSG_FAILURE(
-+[The pkg-config script could not be found or is too old. Make sure it
-+is in your PATH or set the PKG_CONFIG environment variable to the full
-+path to pkg-config.
-+
-+_PKG_TEXT
-+
-+To get pkg-config, see <http://pkg-config.freedesktop.org/>.])[]dnl
-+ ])
-+else
-+ $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
-+ $1[]_LIBS=$pkg_cv_[]$1[]_LIBS
-+ AC_MSG_RESULT([yes])
-+ $3
-+fi[]dnl
-+])# PKG_CHECK_MODULES
-+
-+
-+# PKG_INSTALLDIR(DIRECTORY)
-+# -------------------------
-+# Substitutes the variable pkgconfigdir as the location where a module
-+# should install pkg-config .pc files. By default the directory is
-+# $libdir/pkgconfig, but the default can be changed by passing
-+# DIRECTORY. The user can override through the --with-pkgconfigdir
-+# parameter.
-+AC_DEFUN([PKG_INSTALLDIR],
-+[m4_pushdef([pkg_default], [m4_default([$1], ['${libdir}/pkgconfig'])])
-+m4_pushdef([pkg_description],
-+ [pkg-config installation directory @<:@]pkg_default[@:>@])
-+AC_ARG_WITH([pkgconfigdir],
-+ [AS_HELP_STRING([--with-pkgconfigdir], pkg_description)],,
-+ [with_pkgconfigdir=]pkg_default)
-+AC_SUBST([pkgconfigdir], [$with_pkgconfigdir])
-+m4_popdef([pkg_default])
-+m4_popdef([pkg_description])
-+]) dnl PKG_INSTALLDIR
-+
-+
-+# PKG_NOARCH_INSTALLDIR(DIRECTORY)
-+# -------------------------
-+# Substitutes the variable noarch_pkgconfigdir as the location where a
-+# module should install arch-independent pkg-config .pc files. By
-+# default the directory is $datadir/pkgconfig, but the default can be
-+# changed by passing DIRECTORY. The user can override through the
-+# --with-noarch-pkgconfigdir parameter.
-+AC_DEFUN([PKG_NOARCH_INSTALLDIR],
-+[m4_pushdef([pkg_default], [m4_default([$1], ['${datadir}/pkgconfig'])])
-+m4_pushdef([pkg_description],
-+ [pkg-config arch-independent installation directory @<:@]pkg_default[@:>@])
-+AC_ARG_WITH([noarch-pkgconfigdir],
-+ [AS_HELP_STRING([--with-noarch-pkgconfigdir], pkg_description)],,
-+ [with_noarch_pkgconfigdir=]pkg_default)
-+AC_SUBST([noarch_pkgconfigdir], [$with_noarch_pkgconfigdir])
-+m4_popdef([pkg_default])
-+m4_popdef([pkg_description])
-+]) dnl PKG_NOARCH_INSTALLDIR
-+
-+
-+# PKG_CHECK_VAR(VARIABLE, MODULE, CONFIG-VARIABLE,
-+# [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
-+# -------------------------------------------
-+# Retrieves the value of the pkg-config variable for the given module.
-+AC_DEFUN([PKG_CHECK_VAR],
-+[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
-+AC_ARG_VAR([$1], [value of $3 for $2, overriding pkg-config])dnl
-+
-+_PKG_CONFIG([$1], [variable="][$3]["], [$2])
-+AS_VAR_COPY([$1], [pkg_cv_][$1])
-+
-+AS_VAR_IF([$1], [""], [$5], [$4])dnl
-+])# PKG_CHECK_VAR
-+
- # AM_AUX_DIR_EXPAND -*- Autoconf -*-
-
- # Copyright (C) 2001-2014 Free Software Foundation, Inc.
-diff -Naurp insight-7.12.50.20170416.orig/gdb/build-id.c insight-7.12.50.20170416.new/gdb/build-id.c
---- insight-7.12.50.20170416.orig/gdb/build-id.c 2017-04-16 12:02:56.905229574 +0100
-+++ insight-7.12.50.20170416.new/gdb/build-id.c 2017-04-16 12:04:34.197116635 +0100
-@@ -35,6 +35,7 @@
- #include "elf/common.h"
- #include "elf-bfd.h"
- #include <sys/stat.h>
-+#include "elf/external.h"
-
- #define BUILD_ID_VERBOSE_NONE 0
- #define BUILD_ID_VERBOSE_FILENAMES 1
-@@ -664,8 +665,366 @@ build_id_to_filename (const struct bfd_b
- return result;
- }
-
-+#ifdef HAVE_LIBRPM
-+
-+#include <rpm/rpmlib.h>
-+#include <rpm/rpmts.h>
-+#include <rpm/rpmdb.h>
-+#include <rpm/header.h>
-+#ifdef DLOPEN_LIBRPM
-+#include <dlfcn.h>
-+#endif
-+
-+/* This MISSING_RPM_HASH tracker is used to collect all the missing rpm files
-+ and avoid their duplicities during a single inferior run. */
-+
-+static struct htab *missing_rpm_hash;
-+
-+/* This MISSING_RPM_LIST tracker is used to collect and print as a single line
-+ all the rpms right before the nearest GDB prompt. It gets cleared after
-+ each such print (it is questionable if we should clear it after the print).
-+ */
-+
-+struct missing_rpm
-+ {
-+ struct missing_rpm *next;
-+ char rpm[1];
-+ };
-+static struct missing_rpm *missing_rpm_list;
-+static int missing_rpm_list_entries;
-+
-+/* Returns the count of newly added rpms. */
-+
-+static int
-+missing_rpm_enlist (const char *filename)
-+{
-+ static int rpm_init_done = 0;
-+ rpmts ts;
-+ rpmdbMatchIterator mi;
-+ int count = 0;
-+
-+#ifdef DLOPEN_LIBRPM
-+ /* Duplicate here the declarations to verify they match. The same sanity
-+ check is present also in `configure.ac'. */
-+ extern char * headerFormat(Header h, const char * fmt, errmsg_t * errmsg);
-+ static char *(*headerFormat_p) (Header h, const char * fmt, errmsg_t *errmsg);
-+ extern int rpmReadConfigFiles(const char * file, const char * target);
-+ static int (*rpmReadConfigFiles_p) (const char * file, const char * target);
-+ extern rpmdbMatchIterator rpmdbFreeIterator(rpmdbMatchIterator mi);
-+ static rpmdbMatchIterator (*rpmdbFreeIterator_p) (rpmdbMatchIterator mi);
-+ extern Header rpmdbNextIterator(rpmdbMatchIterator mi);
-+ static Header (*rpmdbNextIterator_p) (rpmdbMatchIterator mi);
-+ extern rpmts rpmtsCreate(void);
-+ static rpmts (*rpmtsCreate_p) (void);
-+ extern rpmts rpmtsFree(rpmts ts);
-+ static rpmts (*rpmtsFree_p) (rpmts ts);
-+ extern rpmdbMatchIterator rpmtsInitIterator(const rpmts ts, rpmTag rpmtag,
-+ const void * keyp, size_t keylen);
-+ static rpmdbMatchIterator (*rpmtsInitIterator_p) (const rpmts ts,
-+ rpmTag rpmtag,
-+ const void *keyp,
-+ size_t keylen);
-+#else /* !DLOPEN_LIBRPM */
-+# define headerFormat_p headerFormat
-+# define rpmReadConfigFiles_p rpmReadConfigFiles
-+# define rpmdbFreeIterator_p rpmdbFreeIterator
-+# define rpmdbNextIterator_p rpmdbNextIterator
-+# define rpmtsCreate_p rpmtsCreate
-+# define rpmtsFree_p rpmtsFree
-+# define rpmtsInitIterator_p rpmtsInitIterator
-+#endif /* !DLOPEN_LIBRPM */
-+
-+ gdb_assert (filename != NULL);
-+
-+ if (strcmp (filename, BUILD_ID_MAIN_EXECUTABLE_FILENAME) == 0)
-+ return 0;
-+
-+ if (is_target_filename (filename))
-+ return 0;
-+
-+ if (filename[0] != '/')
-+ {
-+ warning (_("Ignoring non-absolute filename: <%s>"), filename);
-+ return 0;
-+ }
-+
-+ if (!rpm_init_done)
-+ {
-+ static int init_tried;
-+
-+ /* Already failed the initialization before? */
-+ if (init_tried)
-+ return 0;
-+ init_tried = 1;
-+
-+#ifdef DLOPEN_LIBRPM
-+ {
-+ void *h;
-+
-+ h = dlopen (DLOPEN_LIBRPM, RTLD_LAZY);
-+ if (!h)
-+ {
-+ warning (_("Unable to open \"%s\" (%s), "
-+ "missing debuginfos notifications will not be displayed"),
-+ DLOPEN_LIBRPM, dlerror ());
-+ return 0;
-+ }
-+
-+ if (!((headerFormat_p = (char *(*) (Header h, const char * fmt, errmsg_t *errmsg)) dlsym (h, "headerFormat"))
-+ && (rpmReadConfigFiles_p = (int (*) (const char * file, const char * target)) dlsym (h, "rpmReadConfigFiles"))
-+ && (rpmdbFreeIterator_p = (rpmdbMatchIterator (*) (rpmdbMatchIterator mi)) dlsym (h, "rpmdbFreeIterator"))
-+ && (rpmdbNextIterator_p = (Header (*) (rpmdbMatchIterator mi)) dlsym (h, "rpmdbNextIterator"))
-+ && (rpmtsCreate_p = (rpmts (*) (void)) dlsym (h, "rpmtsCreate"))
-+ && (rpmtsFree_p = (rpmts (*) (rpmts ts)) dlsym (h, "rpmtsFree"))
-+ && (rpmtsInitIterator_p = (rpmdbMatchIterator (*) (const rpmts ts, rpmTag rpmtag, const void *keyp, size_t keylen)) dlsym (h, "rpmtsInitIterator"))))
-+ {
-+ warning (_("Opened library \"%s\" is incompatible (%s), "
-+ "missing debuginfos notifications will not be displayed"),
-+ DLOPEN_LIBRPM, dlerror ());
-+ if (dlclose (h))
-+ warning (_("Error closing library \"%s\": %s\n"), DLOPEN_LIBRPM,
-+ dlerror ());
-+ return 0;
-+ }
-+ }
-+#endif /* DLOPEN_LIBRPM */
-+
-+ if (rpmReadConfigFiles_p (NULL, NULL) != 0)
-+ {
-+ warning (_("Error reading the rpm configuration files"));
-+ return 0;
-+ }
-+
-+ rpm_init_done = 1;
-+ }
-+
-+ ts = rpmtsCreate_p ();
-+
-+ mi = rpmtsInitIterator_p (ts, RPMTAG_BASENAMES, filename, 0);
-+ if (mi != NULL)
-+ {
-+ for (;;)
-+ {
-+ Header h;
-+ char *debuginfo, **slot, *s, *s2;
-+ errmsg_t err;
-+ size_t srcrpmlen = sizeof (".src.rpm") - 1;
-+ size_t debuginfolen = sizeof ("-debuginfo") - 1;
-+ rpmdbMatchIterator mi_debuginfo;
-+
-+ h = rpmdbNextIterator_p (mi);
-+ if (h == NULL)
-+ break;
-+
-+ /* Verify the debuginfo file is not already installed. */
-+
-+ debuginfo = headerFormat_p (h, "%{sourcerpm}-debuginfo.%{arch}",
-+ &err);
-+ if (!debuginfo)
-+ {
-+ warning (_("Error querying the rpm file `%s': %s"), filename,
-+ err);
-+ continue;
-+ }
-+ /* s = `.src.rpm-debuginfo.%{arch}' */
-+ s = strrchr (debuginfo, '-') - srcrpmlen;
-+ s2 = NULL;
-+ if (s > debuginfo && memcmp (s, ".src.rpm", srcrpmlen) == 0)
-+ {
-+ /* s2 = `-%{release}.src.rpm-debuginfo.%{arch}' */
-+ s2 = (char *) memrchr (debuginfo, '-', s - debuginfo);
-+ }
-+ if (s2)
-+ {
-+ /* s2 = `-%{version}-%{release}.src.rpm-debuginfo.%{arch}' */
-+ s2 = (char *) memrchr (debuginfo, '-', s2 - debuginfo);
-+ }
-+ if (!s2)
-+ {
-+ warning (_("Error querying the rpm file `%s': %s"), filename,
-+ debuginfo);
-+ xfree (debuginfo);
-+ continue;
-+ }
-+ /* s = `.src.rpm-debuginfo.%{arch}' */
-+ /* s2 = `-%{version}-%{release}.src.rpm-debuginfo.%{arch}' */
-+ memmove (s2 + debuginfolen, s2, s - s2);
-+ memcpy (s2, "-debuginfo", debuginfolen);
-+ /* s = `XXXX.%{arch}' */
-+ /* strlen ("XXXX") == srcrpmlen + debuginfolen */
-+ /* s2 = `-debuginfo-%{version}-%{release}XX.%{arch}' */
-+ /* strlen ("XX") == srcrpmlen */
-+ memmove (s + debuginfolen, s + srcrpmlen + debuginfolen,
-+ strlen (s + srcrpmlen + debuginfolen) + 1);
-+ /* s = `-debuginfo-%{version}-%{release}.%{arch}' */
-+
-+ /* RPMDBI_PACKAGES requires keylen == sizeof (int). */
-+ /* RPMDBI_LABEL is an interface for NVR-based dbiFindByLabel(). */
-+ mi_debuginfo = rpmtsInitIterator_p (ts, (rpmTag) RPMDBI_LABEL, debuginfo, 0);
-+ xfree (debuginfo);
-+ if (mi_debuginfo)
-+ {
-+ rpmdbFreeIterator_p (mi_debuginfo);
-+ count = 0;
-+ break;
-+ }
-+
-+ /* The allocated memory gets utilized below for MISSING_RPM_HASH. */
-+ debuginfo = headerFormat_p (h,
-+ "%{name}-%{version}-%{release}.%{arch}",
-+ &err);
-+ if (!debuginfo)
-+ {
-+ warning (_("Error querying the rpm file `%s': %s"), filename,
-+ err);
-+ continue;
-+ }
-+
-+ /* Base package name for `debuginfo-install'. We do not use the
-+ `yum' command directly as the line
-+ yum --enablerepo='*debug*' install NAME-debuginfo.ARCH
-+ would be more complicated than just:
-+ debuginfo-install NAME-VERSION-RELEASE.ARCH
-+ Do not supply the rpm base name (derived from .src.rpm name) as
-+ debuginfo-install is unable to install the debuginfo package if
-+ the base name PKG binary rpm is not installed while for example
-+ PKG-libs would be installed (RH Bug 467901).
-+ FUTURE: After multiple debuginfo versions simultaneously installed
-+ get supported the support for the VERSION-RELEASE tags handling
-+ may need an update. */
-+
-+ if (missing_rpm_hash == NULL)
-+ {
-+ /* DEL_F is passed NULL as MISSING_RPM_LIST's HTAB_DELETE
-+ should not deallocate the entries. */
-+
-+ missing_rpm_hash = htab_create_alloc (64, htab_hash_string,
-+ (int (*) (const void *, const void *)) streq,
-+ NULL, xcalloc, xfree);
-+ }
-+ slot = (char **) htab_find_slot (missing_rpm_hash, debuginfo, INSERT);
-+ /* XCALLOC never returns NULL. */
-+ gdb_assert (slot != NULL);
-+ if (*slot == NULL)
-+ {
-+ struct missing_rpm *missing_rpm;
-+
-+ *slot = debuginfo;
-+
-+ missing_rpm = (struct missing_rpm *) xmalloc (sizeof (*missing_rpm) + strlen (debuginfo));
-+ strcpy (missing_rpm->rpm, debuginfo);
-+ missing_rpm->next = missing_rpm_list;
-+ missing_rpm_list = missing_rpm;
-+ missing_rpm_list_entries++;
-+ }
-+ else
-+ xfree (debuginfo);
-+ count++;
-+ }
-+
-+ rpmdbFreeIterator_p (mi);
-+ }
-+
-+ rpmtsFree_p (ts);
-+
-+ return count;
-+}
-+
-+static int
-+missing_rpm_list_compar (const char *const *ap, const char *const *bp)
-+{
-+ return strcoll (*ap, *bp);
-+}
-+
-+/* It returns a NULL-terminated array of strings needing to be FREEd. It may
-+ also return only NULL. */
-+
-+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);
-+
-+ array_iter = array;
-+ for (list_iter = missing_rpm_list; list_iter != NULL;
-+ list_iter = list_iter->next)
-+ {
-+ *array_iter++ = list_iter->rpm;
-+ }
-+ gdb_assert (array_iter == array + missing_rpm_list_entries);
-+
-+ qsort (array, missing_rpm_list_entries, sizeof (*array),
-+ (int (*) (const void *, const void *)) 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++)
-+ {
-+ putchar_unfiltered (' ');
-+ puts_unfiltered (*array_iter);
-+ }
-+ putchar_unfiltered ('\n');
-+
-+ while (missing_rpm_list != NULL)
-+ {
-+ list_iter = missing_rpm_list;
-+ missing_rpm_list = list_iter->next;
-+ xfree (list_iter);
-+ }
-+ missing_rpm_list_entries = 0;
-+
-+ do_cleanups (cleanups);
-+}
-+
-+static void
-+missing_rpm_change (void)
-+{
-+ debug_flush_missing ();
-+
-+ gdb_assert (missing_rpm_list == NULL);
-+ if (missing_rpm_hash != NULL)
-+ {
-+ htab_delete (missing_rpm_hash);
-+ missing_rpm_hash = NULL;
-+ }
-+}
-+
-+enum missing_exec
-+ {
-+ /* Init state. EXEC_BFD also still could be NULL. */
-+ MISSING_EXEC_NOT_TRIED,
-+ /* We saw a non-NULL EXEC_BFD but RPM has no info about it. */
-+ MISSING_EXEC_NOT_FOUND,
-+ /* We found EXEC_BFD by RPM and we either have its symbols (either embedded
-+ or separate) or the main executable's RPM is now contained in
-+ MISSING_RPM_HASH. */
-+ MISSING_EXEC_ENLISTED
-+ };
-+static enum missing_exec missing_exec = MISSING_EXEC_NOT_TRIED;
-+
-+#endif /* HAVE_LIBRPM */
-+
-+void
-+debug_flush_missing (void)
-+{
-+#ifdef HAVE_LIBRPM
-+ missing_rpm_list_print ();
-+#endif
-+}
-+
- /* This MISSING_FILEPAIR_HASH tracker is used only for the duplicite messages
-- Try to install the hash file ...
-+ yum --enablerepo='*debug*' install ...
- avoidance. */
-
- struct missing_filepair
-@@ -719,11 +1078,17 @@ missing_filepair_change (void)
- /* All their memory came just from missing_filepair_OBSTACK. */
- missing_filepair_hash = NULL;
- }
-+#ifdef HAVE_LIBRPM
-+ missing_exec = MISSING_EXEC_NOT_TRIED;
-+#endif
- }
-
- static void
- debug_print_executable_changed (void)
- {
-+#ifdef HAVE_LIBRPM
-+ missing_rpm_change ();
-+#endif
- missing_filepair_change ();
- }
-
-@@ -790,14 +1155,39 @@ debug_print_missing (const char *binary,
-
- *slot = missing_filepair;
-
-- /* We do not collect and flush these messages as each such message
-- already requires its own separate lines. */
-+#ifdef HAVE_LIBRPM
-+ if (missing_exec == MISSING_EXEC_NOT_TRIED)
-+ {
-+ char *execfilename;
-
-- 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)
-+ missing_exec = MISSING_EXEC_NOT_FOUND;
-+ else
-+ missing_exec = MISSING_EXEC_ENLISTED;
-+ }
-+ }
-+ if (missing_exec != MISSING_EXEC_ENLISTED)
-+ if ((binary[0] == 0 || missing_rpm_enlist (binary) == 0)
-+ && (debug == NULL || missing_rpm_enlist (debug) == 0))
-+#endif /* HAVE_LIBRPM */
-+ {
-+ /* We do not collect and flush these messages as each such message
-+ already requires its own separate lines. */
-+
-+ fprintf_unfiltered (gdb_stdlog,
-+ _("Missing separate debuginfo for %s\n"), binary);
-+ if (debug != NULL)
-+ fprintf_unfiltered (gdb_stdlog, _("Try: %s %s\n"),
-+#ifdef DNF_DEBUGINFO_INSTALL
-+ "dnf"
-+#else
-+ "yum"
-+#endif
-+ " --enablerepo='*debug*' install", debug);
-+ }
- }
-
- /* See build-id.h. */
-diff -Naurp insight-7.12.50.20170416.orig/gdb/config.in insight-7.12.50.20170416.new/gdb/config.in
---- insight-7.12.50.20170416.orig/gdb/config.in 2016-11-06 09:57:37.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/config.in 2017-04-16 12:04:34.188116553 +0100
-@@ -33,6 +33,9 @@
- /* Define to BFD's default target vector. */
- #undef DEFAULT_BFD_VEC
-
-+/* librpm version specific library name to dlopen. */
-+#undef DLOPEN_LIBRPM
-+
- /* Define to 1 if translation of program messages to the user's native
- language is requested. */
- #undef ENABLE_NLS
-@@ -264,6 +267,9 @@
- /* Define if Python 2.7 is being used. */
- #undef HAVE_LIBPYTHON2_7
-
-+/* Define if librpm library is being used. */
-+#undef HAVE_LIBRPM
-+
- /* Define to 1 if you have the <libunwind-ia64.h> header file. */
- #undef HAVE_LIBUNWIND_IA64_H
-
-diff -Naurp insight-7.12.50.20170416.orig/gdb/configure insight-7.12.50.20170416.new/gdb/configure
---- insight-7.12.50.20170416.orig/gdb/configure 2017-04-16 10:13:12.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/configure 2017-04-16 12:08:10.902092451 +0100
-@@ -740,6 +740,11 @@ PKGVERSION
- HAVE_NATIVE_GCORE_TARGET
- TARGET_OBS
- subdirs
-+RPM_LIBS
-+RPM_CFLAGS
-+PKG_CONFIG_LIBDIR
-+PKG_CONFIG_PATH
-+PKG_CONFIG
- GDB_DATADIR
- DEBUGDIR
- MAKEINFO_EXTRA_FLAGS
-@@ -844,6 +849,7 @@ with_gdb_datadir
- with_relocated_sources
- with_auto_load_dir
- with_auto_load_safe_path
-+with_rpm
- enable_targets
- enable_64_bit_bfd
- enable_gdbcli
-@@ -900,6 +906,11 @@ CCC
- CPP
- MAKEINFO
- MAKEINFOFLAGS
-+PKG_CONFIG
-+PKG_CONFIG_PATH
-+PKG_CONFIG_LIBDIR
-+RPM_CFLAGS
-+RPM_LIBS
- YACC
- YFLAGS
- XMKMF'
-@@ -1570,6 +1581,8 @@ Optional Packages:
- [--with-auto-load-dir]
- --without-auto-load-safe-path
- do not restrict auto-loaded files locations
-+ --with-rpm query rpm database for missing debuginfos (yes/no,
-+ def. auto=librpm.so)
- --with-libunwind-ia64 use libunwind frame unwinding for ia64 targets
- --with-curses use the curses library instead of the termcap
- library
-@@ -1624,6 +1637,13 @@ Some influential environment variables:
- MAKEINFO Parent configure detects if it is of sufficient version.
- MAKEINFOFLAGS
- Parameters for MAKEINFO.
-+ PKG_CONFIG path to pkg-config utility
-+ PKG_CONFIG_PATH
-+ directories to add to pkg-config's search path
-+ PKG_CONFIG_LIBDIR
-+ path overriding pkg-config's built-in search path
-+ RPM_CFLAGS C compiler flags for RPM, overriding pkg-config
-+ RPM_LIBS linker flags for RPM, overriding pkg-config
- YACC The `Yet Another Compiler Compiler' implementation to use.
- Defaults to the first program found out of: `bison -y', `byacc',
- `yacc'.
-@@ -6553,6 +6573,494 @@ _ACEOF
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_auto_load_safe_path" >&5
- $as_echo "$with_auto_load_safe_path" >&6; }
-
-+# Integration with rpm library to support missing debuginfo suggestions.
-+# --without-rpm: Disable any rpm support.
-+# --with-rpm=libname.so: Try to dynamically open `libname.so' during runtime.
-+# Even with runtime missing `libname.so' GDB will still other run correctly.
-+# Missing `libname.so' during ./configure will abort the configuration.
-+# --with-rpm=librpm.so: Like `--with-rpm=libname.so' but try to find specific
-+# minor version first such as `librpm-4.6.so' as minor version differences
-+# mean API+ABI incompatibility. If the specific match versioned library name
-+# could not be found still open dynamically at least `librpm.so'.
-+# --with-rpm: Like `--with-rpm=librpm.so' but if any of its detection fails try
-+# to find librpm for compilation-time linking by pkg-config. GDB binary will
-+# be probably linked with the version specific library (as `librpm-4.6.so').
-+# Failure to find librpm by pkg-config will abort the configuration.
-+# (default) --with-rpm=auto: Like `--with-rpm=librpm.so' but if even pkg-config
-+# cannot find librpm use to the rpmless compilation (like `--without-rpm').
-+
-+
-+# Check whether --with-rpm was given.
-+if test "${with_rpm+set}" = set; then :
-+ withval=$with_rpm;
-+else
-+ with_rpm="auto"
-+fi
-+
-+
-+
-+
-+if test "x$with_rpm" != "xno"; then
-+ if test "x$with_rpm" = "xyes"; then
-+ LIBRPM="librpm.so"
-+ RPM_REQUIRE=true
-+ DLOPEN_REQUIRE=false
-+ elif test "x$with_rpm" = "xauto"; then
-+ LIBRPM="librpm.so"
-+ RPM_REQUIRE=false
-+ DLOPEN_REQUIRE=false
-+ else
-+ LIBRPM="$with_rpm"
-+ RPM_REQUIRE=true
-+ DLOPEN_REQUIRE=true
-+ fi
-+ LIBRPM_STRING='"'"$LIBRPM"'"'
-+
-+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking specific librpm version" >&5
-+$as_echo_n "checking specific librpm version... " >&6; }
-+ HAVE_DLOPEN_LIBRPM=false
-+ save_LIBS="$LIBS"
-+ LIBS="$LIBS -ldl"
-+ if test "$cross_compiling" = yes; then :
-+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-+as_fn_error "cannot run test program while cross compiling
-+See \`config.log' for more details." "$LINENO" 5; }
-+else
-+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-+/* end confdefs.h. */
-+
-+#include <rpm/rpmlib.h>
-+#include <dlfcn.h>
-+#include <errno.h>
-+
-+int
-+main ()
-+{
-+
-+ void *h;
-+ const char *const *rpmverp;
-+ FILE *f;
-+
-+ f = fopen ("conftest.out", "w");
-+ if (!f)
-+ {
-+ fprintf (stderr, "Cannot write \"%s\": %s\n", "conftest.out",
-+ strerror (errno));
-+ return 1;
-+ }
-+ h = dlopen ($LIBRPM_STRING, RTLD_LAZY);
-+ if (!h)
-+ {
-+ fprintf (stderr, "dlopen (\"%s\"): %s\n", $LIBRPM_STRING, dlerror ());
-+ return 1;
-+ }
-+ rpmverp = dlsym (h, "RPMVERSION");
-+ if (!rpmverp)
-+ {
-+ fprintf (stderr, "dlsym (\"RPMVERSION\"): %s\n", dlerror ());
-+ return 1;
-+ }
-+ fprintf (stderr, "RPMVERSION is: \"");
-+ fprintf (stderr, "%s\"\n", *rpmverp);
-+
-+ /* Try to find the specific librpm version only for "librpm.so" as we do
-+ not know how to assemble the version string otherwise. */
-+
-+ if (strcmp ("librpm.so", $LIBRPM_STRING) != 0)
-+ {
-+ fprintf (f, "%s\n", $LIBRPM_STRING);
-+ return 0;
-+ }
-+ else
-+ {
-+ char *h2_name;
-+ void *h2;
-+ int major, minor;
-+
-+ if (sscanf (*rpmverp, "%d.%d", &major, &minor) != 2)
-+ {
-+ fprintf (stderr, "Unable to parse RPMVERSION.\n");
-+ fprintf (f, "%s\n", $LIBRPM_STRING);
-+ return 0;
-+ }
-+ /* Avoid the square brackets by malloc. */
-+ h2_name = malloc (64);
-+ sprintf (h2_name, "librpm-%d.%d.so", major, minor);
-+ h2 = dlopen (h2_name, RTLD_LAZY);
-+ if (!h2)
-+ {
-+ fprintf (stderr, "dlopen (\"%s\"): %s\n", h2_name, dlerror ());
-+ fprintf (f, "%s\n", $LIBRPM_STRING);
-+ return 0;
-+ }
-+ if (h2 != h)
-+ {
-+ fprintf (stderr, "dlopen of \"%s\" and \"%s\" are different.\n",
-+ $LIBRPM_STRING, h2_name);
-+ fprintf (f, "%s\n", $LIBRPM_STRING);
-+ return 0;
-+ }
-+ /* Found the valid .so name with a specific version. */
-+ fprintf (f, "%s\n", h2_name);
-+ return 0;
-+ }
-+
-+ ;
-+ return 0;
-+}
-+_ACEOF
-+if ac_fn_c_try_run "$LINENO"; then :
-+
-+ DLOPEN_LIBRPM="`cat conftest.out`"
-+ if test "x$DLOPEN_LIBRPM" != "x"; then
-+ HAVE_DLOPEN_LIBRPM=true
-+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DLOPEN_LIBRPM" >&5
-+$as_echo "$DLOPEN_LIBRPM" >&6; }
-+ fi
-+
-+fi
-+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
-+ conftest.$ac_objext conftest.beam conftest.$ac_ext
-+fi
-+
-+ rm -f conftest.out
-+
-+
-+
-+ if $HAVE_DLOPEN_LIBRPM; then
-+
-+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking rpm library API compatibility" >&5
-+$as_echo_n "checking rpm library API compatibility... " >&6; }
-+ # The compilation requires -Werror to verify anything.
-+ save_CFLAGS="$CFLAGS"
-+ CFLAGS="$CFLAGS -Werror"
-+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-+/* end confdefs.h. */
-+
-+/* Duplicate here the declarations to verify they match "elfread.c". */
-+#include <rpm/rpmlib.h>
-+#include <rpm/rpmts.h>
-+#include <rpm/rpmdb.h>
-+#include <rpm/header.h>
-+extern char * headerFormat(Header h, const char * fmt, errmsg_t * errmsg);
-+extern int rpmReadConfigFiles(const char * file, const char * target);
-+extern rpmdbMatchIterator rpmdbFreeIterator(rpmdbMatchIterator mi);
-+extern Header rpmdbNextIterator(rpmdbMatchIterator mi);
-+extern rpmts rpmtsCreate(void);
-+extern rpmts rpmtsFree(rpmts ts);
-+extern rpmdbMatchIterator rpmtsInitIterator(const rpmts ts, rpmTag rpmtag,
-+ const void * keyp, size_t keylen);
-+
-+int
-+main ()
-+{
-+
-+ ;
-+ return 0;
-+}
-+_ACEOF
-+if ac_fn_c_try_compile "$LINENO"; then :
-+
-+ LIBRPM_COMPAT=true
-+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-+$as_echo "yes" >&6; }
-+
-+else
-+
-+ LIBRPM_COMPAT=false
-+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-+$as_echo "no" >&6; }
-+
-+fi
-+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-+ CFLAGS="$save_CFLAGS"
-+
-+ if ! $LIBRPM_COMPAT; then
-+ HAVE_DLOPEN_LIBRPM=false
-+ fi
-+ fi
-+
-+ if $HAVE_DLOPEN_LIBRPM; then
-+ DLOPEN_LIBRPM_STRING='"'"$DLOPEN_LIBRPM"'"'
-+
-+cat >>confdefs.h <<_ACEOF
-+#define DLOPEN_LIBRPM $DLOPEN_LIBRPM_STRING
-+_ACEOF
-+
-+
-+$as_echo "#define HAVE_LIBRPM 1" >>confdefs.h
-+
-+ else
-+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-+$as_echo "no" >&6; }
-+ LIBS="$save_LIBS"
-+ if $DLOPEN_REQUIRE; then
-+ as_fn_error "Specific name $LIBRPM was requested but it could not be opened." "$LINENO" 5
-+ fi
-+
-+
-+
-+
-+
-+
-+
-+if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
-+ if test -n "$ac_tool_prefix"; then
-+ # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args.
-+set dummy ${ac_tool_prefix}pkg-config; ac_word=$2
-+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-+$as_echo_n "checking for $ac_word... " >&6; }
-+if test "${ac_cv_path_PKG_CONFIG+set}" = set; then :
-+ $as_echo_n "(cached) " >&6
-+else
-+ case $PKG_CONFIG in
-+ [\\/]* | ?:[\\/]*)
-+ ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
-+ ;;
-+ *)
-+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-+for as_dir in $PATH
-+do
-+ IFS=$as_save_IFS
-+ test -z "$as_dir" && as_dir=.
-+ for ac_exec_ext in '' $ac_executable_extensions; do
-+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
-+ ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
-+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-+ break 2
-+ fi
-+done
-+ done
-+IFS=$as_save_IFS
-+
-+ ;;
-+esac
-+fi
-+PKG_CONFIG=$ac_cv_path_PKG_CONFIG
-+if test -n "$PKG_CONFIG"; then
-+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5
-+$as_echo "$PKG_CONFIG" >&6; }
-+else
-+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-+$as_echo "no" >&6; }
-+fi
-+
-+
-+fi
-+if test -z "$ac_cv_path_PKG_CONFIG"; then
-+ ac_pt_PKG_CONFIG=$PKG_CONFIG
-+ # Extract the first word of "pkg-config", so it can be a program name with args.
-+set dummy pkg-config; ac_word=$2
-+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-+$as_echo_n "checking for $ac_word... " >&6; }
-+if test "${ac_cv_path_ac_pt_PKG_CONFIG+set}" = set; then :
-+ $as_echo_n "(cached) " >&6
-+else
-+ case $ac_pt_PKG_CONFIG in
-+ [\\/]* | ?:[\\/]*)
-+ ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path.
-+ ;;
-+ *)
-+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-+for as_dir in $PATH
-+do
-+ IFS=$as_save_IFS
-+ test -z "$as_dir" && as_dir=.
-+ for ac_exec_ext in '' $ac_executable_extensions; do
-+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
-+ ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
-+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-+ break 2
-+ fi
-+done
-+ done
-+IFS=$as_save_IFS
-+
-+ ;;
-+esac
-+fi
-+ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG
-+if test -n "$ac_pt_PKG_CONFIG"; then
-+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKG_CONFIG" >&5
-+$as_echo "$ac_pt_PKG_CONFIG" >&6; }
-+else
-+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-+$as_echo "no" >&6; }
-+fi
-+
-+ if test "x$ac_pt_PKG_CONFIG" = x; then
-+ PKG_CONFIG=""
-+ else
-+ case $cross_compiling:$ac_tool_warned in
-+yes:)
-+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
-+ac_tool_warned=yes ;;
-+esac
-+ PKG_CONFIG=$ac_pt_PKG_CONFIG
-+ fi
-+else
-+ PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
-+fi
-+
-+fi
-+if test -n "$PKG_CONFIG"; then
-+ _pkg_min_version=0.9.0
-+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking pkg-config is at least version $_pkg_min_version" >&5
-+$as_echo_n "checking pkg-config is at least version $_pkg_min_version... " >&6; }
-+ if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
-+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-+$as_echo "yes" >&6; }
-+ else
-+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-+$as_echo "no" >&6; }
-+ PKG_CONFIG=""
-+ fi
-+fi
-+
-+pkg_failed=no
-+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for RPM" >&5
-+$as_echo_n "checking for RPM... " >&6; }
-+
-+if test -n "$RPM_CFLAGS"; then
-+ pkg_cv_RPM_CFLAGS="$RPM_CFLAGS"
-+ elif test -n "$PKG_CONFIG"; then
-+ if test -n "$PKG_CONFIG" && \
-+ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"rpm\""; } >&5
-+ ($PKG_CONFIG --exists --print-errors "rpm") 2>&5
-+ ac_status=$?
-+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-+ test $ac_status = 0; }; then
-+ pkg_cv_RPM_CFLAGS=`$PKG_CONFIG --cflags "rpm" 2>/dev/null`
-+ test "x$?" != "x0" && pkg_failed=yes
-+else
-+ pkg_failed=yes
-+fi
-+ else
-+ pkg_failed=untried
-+fi
-+if test -n "$RPM_LIBS"; then
-+ pkg_cv_RPM_LIBS="$RPM_LIBS"
-+ elif test -n "$PKG_CONFIG"; then
-+ if test -n "$PKG_CONFIG" && \
-+ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"rpm\""; } >&5
-+ ($PKG_CONFIG --exists --print-errors "rpm") 2>&5
-+ ac_status=$?
-+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-+ test $ac_status = 0; }; then
-+ pkg_cv_RPM_LIBS=`$PKG_CONFIG --libs "rpm" 2>/dev/null`
-+ test "x$?" != "x0" && pkg_failed=yes
-+else
-+ pkg_failed=yes
-+fi
-+ else
-+ pkg_failed=untried
-+fi
-+
-+
-+
-+if test $pkg_failed = yes; then
-+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-+$as_echo "no" >&6; }
-+
-+if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
-+ _pkg_short_errors_supported=yes
-+else
-+ _pkg_short_errors_supported=no
-+fi
-+ if test $_pkg_short_errors_supported = yes; then
-+ RPM_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "rpm" 2>&1`
-+ else
-+ RPM_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "rpm" 2>&1`
-+ fi
-+ # Put the nasty error message in config.log where it belongs
-+ echo "$RPM_PKG_ERRORS" >&5
-+
-+ HAVE_LIBRPM=false
-+elif test $pkg_failed = untried; then
-+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-+$as_echo "no" >&6; }
-+ HAVE_LIBRPM=false
-+else
-+ RPM_CFLAGS=$pkg_cv_RPM_CFLAGS
-+ RPM_LIBS=$pkg_cv_RPM_LIBS
-+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-+$as_echo "yes" >&6; }
-+ HAVE_LIBRPM=true
-+fi
-+
-+ if $HAVE_LIBRPM; then
-+
-+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking rpm library API compatibility" >&5
-+$as_echo_n "checking rpm library API compatibility... " >&6; }
-+ # The compilation requires -Werror to verify anything.
-+ save_CFLAGS="$CFLAGS"
-+ CFLAGS="$CFLAGS -Werror"
-+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-+/* end confdefs.h. */
-+
-+/* Duplicate here the declarations to verify they match "elfread.c". */
-+#include <rpm/rpmlib.h>
-+#include <rpm/rpmts.h>
-+#include <rpm/rpmdb.h>
-+#include <rpm/header.h>
-+extern char * headerFormat(Header h, const char * fmt, errmsg_t * errmsg);
-+extern int rpmReadConfigFiles(const char * file, const char * target);
-+extern rpmdbMatchIterator rpmdbFreeIterator(rpmdbMatchIterator mi);
-+extern Header rpmdbNextIterator(rpmdbMatchIterator mi);
-+extern rpmts rpmtsCreate(void);
-+extern rpmts rpmtsFree(rpmts ts);
-+extern rpmdbMatchIterator rpmtsInitIterator(const rpmts ts, rpmTag rpmtag,
-+ const void * keyp, size_t keylen);
-+
-+int
-+main ()
-+{
-+
-+ ;
-+ return 0;
-+}
-+_ACEOF
-+if ac_fn_c_try_compile "$LINENO"; then :
-+
-+ LIBRPM_COMPAT=true
-+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-+$as_echo "yes" >&6; }
-+
-+else
-+
-+ LIBRPM_COMPAT=false
-+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-+$as_echo "no" >&6; }
-+
-+fi
-+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-+ CFLAGS="$save_CFLAGS"
-+
-+ if ! $LIBRPM_COMPAT; then
-+ HAVE_LIBRPM=false
-+ RPM_PKG_ERRORS="Found $LIBRPM API is incompatibile with this GDB"
-+ fi
-+ fi
-+
-+ if $HAVE_LIBRPM; then
-+
-+$as_echo "#define HAVE_LIBRPM 1" >>confdefs.h
-+
-+ CFLAGS="$CFLAGS $RPM_CFLAGS"
-+ LIBS="$LIBS $RPM_LIBS"
-+ else
-+ if $RPM_REQUIRE; then
-+ as_fn_error "$RPM_PKG_ERRORS" "$LINENO" 5
-+ else
-+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $RPM_PKG_ERRORS" >&5
-+$as_echo "$as_me: WARNING: $RPM_PKG_ERRORS" >&2;}
-+ fi
-+ fi
-+ fi
-+fi
-+
-
-
- subdirs="$subdirs testsuite"
-diff -Naurp insight-7.12.50.20170416.orig/gdb/configure.ac insight-7.12.50.20170416.new/gdb/configure.ac
---- insight-7.12.50.20170416.orig/gdb/configure.ac 2017-04-16 12:02:56.836228945 +0100
-+++ insight-7.12.50.20170416.new/gdb/configure.ac 2017-04-16 12:04:34.195116617 +0100
-@@ -167,6 +167,199 @@ AC_DEFINE_DIR(AUTO_LOAD_SAFE_PATH, escap
- [Directories safe to hold auto-loaded files.])
- AC_MSG_RESULT([$with_auto_load_safe_path])
-
-+# Integration with rpm library to support missing debuginfo suggestions.
-+# --without-rpm: Disable any rpm support.
-+# --with-rpm=libname.so: Try to dynamically open `libname.so' during runtime.
-+# Even with runtime missing `libname.so' GDB will still other run correctly.
-+# Missing `libname.so' during ./configure will abort the configuration.
-+# --with-rpm=librpm.so: Like `--with-rpm=libname.so' but try to find specific
-+# minor version first such as `librpm-4.6.so' as minor version differences
-+# mean API+ABI incompatibility. If the specific match versioned library name
-+# could not be found still open dynamically at least `librpm.so'.
-+# --with-rpm: Like `--with-rpm=librpm.so' but if any of its detection fails try
-+# to find librpm for compilation-time linking by pkg-config. GDB binary will
-+# be probably linked with the version specific library (as `librpm-4.6.so').
-+# Failure to find librpm by pkg-config will abort the configuration.
-+# (default) --with-rpm=auto: Like `--with-rpm=librpm.so' but if even pkg-config
-+# cannot find librpm use to the rpmless compilation (like `--without-rpm').
-+
-+AC_ARG_WITH([rpm],
-+ [AS_HELP_STRING([--with-rpm],
-+ [query rpm database for missing debuginfos (yes/no, def. auto=librpm.so)])], [], [with_rpm="auto"])
-+
-+m4_pattern_allow([^AC_MSG_ERROR$])
-+m4_pattern_allow([^AC_MSG_WARN$])
-+if test "x$with_rpm" != "xno"; then
-+ if test "x$with_rpm" = "xyes"; then
-+ LIBRPM="librpm.so"
-+ RPM_REQUIRE=true
-+ DLOPEN_REQUIRE=false
-+ elif test "x$with_rpm" = "xauto"; then
-+ LIBRPM="librpm.so"
-+ RPM_REQUIRE=false
-+ DLOPEN_REQUIRE=false
-+ else
-+ LIBRPM="$with_rpm"
-+ RPM_REQUIRE=true
-+ DLOPEN_REQUIRE=true
-+ fi
-+ LIBRPM_STRING='"'"$LIBRPM"'"'
-+
-+ AC_MSG_CHECKING([specific librpm version])
-+ HAVE_DLOPEN_LIBRPM=false
-+ save_LIBS="$LIBS"
-+ LIBS="$LIBS -ldl"
-+ AC_RUN_IFELSE(AC_LANG_PROGRAM([[
-+#include <rpm/rpmlib.h>
-+#include <dlfcn.h>
-+#include <errno.h>
-+ ]], [[
-+ void *h;
-+ const char *const *rpmverp;
-+ FILE *f;
-+
-+ f = fopen ("conftest.out", "w");
-+ if (!f)
-+ {
-+ fprintf (stderr, "Cannot write \"%s\": %s\n", "conftest.out",
-+ strerror (errno));
-+ return 1;
-+ }
-+ h = dlopen ($LIBRPM_STRING, RTLD_LAZY);
-+ if (!h)
-+ {
-+ fprintf (stderr, "dlopen (\"%s\"): %s\n", $LIBRPM_STRING, dlerror ());
-+ return 1;
-+ }
-+ rpmverp = dlsym (h, "RPMVERSION");
-+ if (!rpmverp)
-+ {
-+ fprintf (stderr, "dlsym (\"RPMVERSION\"): %s\n", dlerror ());
-+ return 1;
-+ }
-+ fprintf (stderr, "RPMVERSION is: \"");
-+ fprintf (stderr, "%s\"\n", *rpmverp);
-+
-+ /* Try to find the specific librpm version only for "librpm.so" as we do
-+ not know how to assemble the version string otherwise. */
-+
-+ if (strcmp ("librpm.so", $LIBRPM_STRING) != 0)
-+ {
-+ fprintf (f, "%s\n", $LIBRPM_STRING);
-+ return 0;
-+ }
-+ else
-+ {
-+ char *h2_name;
-+ void *h2;
-+ int major, minor;
-+
-+ if (sscanf (*rpmverp, "%d.%d", &major, &minor) != 2)
-+ {
-+ fprintf (stderr, "Unable to parse RPMVERSION.\n");
-+ fprintf (f, "%s\n", $LIBRPM_STRING);
-+ return 0;
-+ }
-+ /* Avoid the square brackets by malloc. */
-+ h2_name = malloc (64);
-+ sprintf (h2_name, "librpm-%d.%d.so", major, minor);
-+ h2 = dlopen (h2_name, RTLD_LAZY);
-+ if (!h2)
-+ {
-+ fprintf (stderr, "dlopen (\"%s\"): %s\n", h2_name, dlerror ());
-+ fprintf (f, "%s\n", $LIBRPM_STRING);
-+ return 0;
-+ }
-+ if (h2 != h)
-+ {
-+ fprintf (stderr, "dlopen of \"%s\" and \"%s\" are different.\n",
-+ $LIBRPM_STRING, h2_name);
-+ fprintf (f, "%s\n", $LIBRPM_STRING);
-+ return 0;
-+ }
-+ /* Found the valid .so name with a specific version. */
-+ fprintf (f, "%s\n", h2_name);
-+ return 0;
-+ }
-+ ]]), [
-+ DLOPEN_LIBRPM="`cat conftest.out`"
-+ if test "x$DLOPEN_LIBRPM" != "x"; then
-+ HAVE_DLOPEN_LIBRPM=true
-+ AC_MSG_RESULT($DLOPEN_LIBRPM)
-+ fi
-+ ])
-+ rm -f conftest.out
-+
-+ m4_define([CHECK_LIBRPM_COMPAT], [
-+ AC_MSG_CHECKING([rpm library API compatibility])
-+ # The compilation requires -Werror to verify anything.
-+ save_CFLAGS="$CFLAGS"
-+ CFLAGS="$CFLAGS -Werror"
-+ AC_COMPILE_IFELSE(AC_LANG_PROGRAM([[
-+/* Duplicate here the declarations to verify they match "elfread.c". */
-+#include <rpm/rpmlib.h>
-+#include <rpm/rpmts.h>
-+#include <rpm/rpmdb.h>
-+#include <rpm/header.h>
-+extern char * headerFormat(Header h, const char * fmt, errmsg_t * errmsg);
-+extern int rpmReadConfigFiles(const char * file, const char * target);
-+extern rpmdbMatchIterator rpmdbFreeIterator(rpmdbMatchIterator mi);
-+extern Header rpmdbNextIterator(rpmdbMatchIterator mi);
-+extern rpmts rpmtsCreate(void);
-+extern rpmts rpmtsFree(rpmts ts);
-+extern rpmdbMatchIterator rpmtsInitIterator(const rpmts ts, rpmTag rpmtag,
-+ const void * keyp, size_t keylen);
-+ ]]), [
-+ LIBRPM_COMPAT=true
-+ AC_MSG_RESULT(yes)
-+ ], [
-+ LIBRPM_COMPAT=false
-+ AC_MSG_RESULT(no)
-+ ])
-+ CFLAGS="$save_CFLAGS"
-+ ])
-+
-+ if $HAVE_DLOPEN_LIBRPM; then
-+ CHECK_LIBRPM_COMPAT
-+ if ! $LIBRPM_COMPAT; then
-+ HAVE_DLOPEN_LIBRPM=false
-+ fi
-+ fi
-+
-+ if $HAVE_DLOPEN_LIBRPM; then
-+ DLOPEN_LIBRPM_STRING='"'"$DLOPEN_LIBRPM"'"'
-+ AC_DEFINE_UNQUOTED(DLOPEN_LIBRPM, $DLOPEN_LIBRPM_STRING, [librpm version specific library name to dlopen.])
-+ AC_DEFINE(HAVE_LIBRPM, 1, [Define if librpm library is being used.])
-+ else
-+ AC_MSG_RESULT(no)
-+ LIBS="$save_LIBS"
-+ if $DLOPEN_REQUIRE; then
-+ AC_MSG_ERROR([Specific name $LIBRPM was requested but it could not be opened.])
-+ fi
-+ PKG_CHECK_MODULES(RPM, rpm, [HAVE_LIBRPM=true], [HAVE_LIBRPM=false])
-+
-+ if $HAVE_LIBRPM; then
-+ CHECK_LIBRPM_COMPAT
-+ if ! $LIBRPM_COMPAT; then
-+ HAVE_LIBRPM=false
-+ RPM_PKG_ERRORS="Found $LIBRPM API is incompatibile with this GDB"
-+ fi
-+ fi
-+
-+ if $HAVE_LIBRPM; then
-+ AC_DEFINE(HAVE_LIBRPM, 1, [Define if librpm library is being used.])
-+ CFLAGS="$CFLAGS $RPM_CFLAGS"
-+ LIBS="$LIBS $RPM_LIBS"
-+ else
-+ if $RPM_REQUIRE; then
-+ AC_MSG_ERROR($RPM_PKG_ERRORS)
-+ else
-+ AC_MSG_WARN($RPM_PKG_ERRORS)
-+ fi
-+ fi
-+ fi
-+fi
-+
- AC_CONFIG_SUBDIRS(testsuite)
-
- # Check whether to support alternative target configurations
-diff -Naurp insight-7.12.50.20170416.orig/gdb/corelow.c insight-7.12.50.20170416.new/gdb/corelow.c
---- insight-7.12.50.20170416.orig/gdb/corelow.c 2017-04-16 12:02:56.896229492 +0100
-+++ insight-7.12.50.20170416.new/gdb/corelow.c 2017-04-16 12:04:34.196116626 +0100
-@@ -311,7 +311,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 -Naurp insight-7.12.50.20170416.orig/gdb/event-top.c insight-7.12.50.20170416.new/gdb/event-top.c
---- insight-7.12.50.20170416.orig/gdb/event-top.c 2017-04-16 10:13:09.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/event-top.c 2017-04-16 12:04:34.185116525 +0100
-@@ -40,6 +40,7 @@
- #include "buffer.h"
- #include "ser-event.h"
- #include "gdb_select.h"
-+#include "symfile.h"
-
- /* readline include files. */
- #include "readline/readline.h"
-@@ -360,6 +361,8 @@ display_gdb_prompt (const char *new_prom
- /* Reset the nesting depth used when trace-commands is set. */
- reset_command_nest_depth ();
-
-+ debug_flush_missing ();
-+
- old_chain = make_cleanup (free_current_contents, &actual_gdb_prompt);
-
- /* Do not call the python hook on an explicit prompt change as
-@@ -780,7 +783,10 @@ command_line_handler (char *rl)
- command_handler (cmd);
-
- if (ui->prompt_state != PROMPTED)
-- display_gdb_prompt (0);
-+ {
-+ debug_flush_missing ();
-+ display_gdb_prompt (0);
-+ }
- }
- }
-
-diff -Naurp insight-7.12.50.20170416.orig/gdb/symfile.h insight-7.12.50.20170416.new/gdb/symfile.h
---- insight-7.12.50.20170416.orig/gdb/symfile.h 2017-04-16 12:02:56.903229555 +0100
-+++ insight-7.12.50.20170416.new/gdb/symfile.h 2017-04-16 12:04:34.186116534 +0100
-@@ -570,6 +570,8 @@ void map_symbol_filenames (symbol_filena
- /* 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);
-+extern void debug_flush_missing (void);
-+#define BUILD_ID_MAIN_EXECUTABLE_FILENAME _("the main executable file")
-
- /* From dwarf2read.c */
-
diff --git a/insight-7.12-gdb-6.6-buildid-locate.patch b/insight-7.12-gdb-6.6-buildid-locate.patch
deleted file mode 100644
index 8e0826c..0000000
--- a/insight-7.12-gdb-6.6-buildid-locate.patch
+++ /dev/null
@@ -1,1257 +0,0 @@
-diff -Naurp insight-7.12.50.20170416.orig/gdb/build-id.c insight-7.12.50.20170416.new/gdb/build-id.c
---- insight-7.12.50.20170416.orig/gdb/build-id.c 2017-01-21 02:32:23.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/build-id.c 2017-04-16 13:55:30.668769990 +0100
-@@ -26,11 +26,67 @@
- #include "objfiles.h"
- #include "filenames.h"
- #include "gdbcore.h"
-+#include "libbfd.h"
-+#include "gdbcore.h"
-+#include "gdbcmd.h"
-+#include "observer.h"
-+#include "elf/external.h"
-+#include "elf/internal.h"
-+#include "elf/common.h"
-+#include "elf-bfd.h"
-+#include <sys/stat.h>
-+
-+#define BUILD_ID_VERBOSE_NONE 0
-+#define BUILD_ID_VERBOSE_FILENAMES 1
-+#define BUILD_ID_VERBOSE_BINARY_PARSE 2
-+static int build_id_verbose = BUILD_ID_VERBOSE_FILENAMES;
-+static void
-+show_build_id_verbose (struct ui_file *file, int from_tty,
-+ struct cmd_list_element *c, const char *value)
-+{
-+ fprintf_filtered (file, _("Verbosity level of the build-id locator is %s.\n"),
-+ value);
-+}
-+/* Locate NT_GNU_BUILD_ID and return its matching debug filename.
-+ FIXME: NOTE decoding should be unified with the BFD core notes decoding. */
-+
-+static struct bfd_build_id *
-+build_id_buf_get (bfd *templ, gdb_byte *buf, bfd_size_type size)
-+{
-+ bfd_byte *p;
-+
-+ p = buf;
-+ while (p < buf + size)
-+ {
-+ /* FIXME: bad alignment assumption. */
-+ Elf_External_Note *xnp = (Elf_External_Note *) p;
-+ size_t namesz = H_GET_32 (templ, xnp->namesz);
-+ size_t descsz = H_GET_32 (templ, xnp->descsz);
-+ bfd_byte *descdata = (gdb_byte *) xnp->name + BFD_ALIGN (namesz, 4);
-+
-+ if (H_GET_32 (templ, xnp->type) == NT_GNU_BUILD_ID
-+ && namesz == sizeof "GNU"
-+ && memcmp (xnp->name, "GNU", sizeof "GNU") == 0)
-+ {
-+ size_t size = descsz;
-+ gdb_byte *data = (gdb_byte *) descdata;
-+ struct bfd_build_id *retval;
-+
-+ retval = (struct bfd_build_id *) xmalloc (sizeof *retval - 1 + size);
-+ retval->size = size;
-+ memcpy (retval->data, data, size);
-+
-+ return retval;
-+ }
-+ p = descdata + BFD_ALIGN (descsz, 4);
-+ }
-+ return NULL;
-+}
-
- /* See build-id.h. */
-
- const struct bfd_build_id *
--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)
- return NULL;
- }
-
-+/* Core files may have missing (corrupt) SHDR but PDHR is correct there.
-+ bfd_elf_bfd_from_remote_memory () has too much overhead by
-+ allocating/reading all the available ELF PT_LOADs. */
-+
-+static struct bfd_build_id *
-+build_id_phdr_get (bfd *templ, bfd_vma loadbase, unsigned e_phnum,
-+ Elf_Internal_Phdr *i_phdr)
-+{
-+ int i;
-+ struct bfd_build_id *retval = NULL;
-+
-+ for (i = 0; i < e_phnum; i++)
-+ if (i_phdr[i].p_type == PT_NOTE && i_phdr[i].p_filesz > 0)
-+ {
-+ Elf_Internal_Phdr *hdr = &i_phdr[i];
-+ gdb_byte *buf;
-+ int err;
-+
-+ buf = (gdb_byte *) xmalloc (hdr->p_filesz);
-+ err = target_read_memory (loadbase + i_phdr[i].p_vaddr, buf,
-+ hdr->p_filesz);
-+ if (err == 0)
-+ retval = build_id_buf_get (templ, buf, hdr->p_filesz);
-+ else
-+ retval = NULL;
-+ xfree (buf);
-+ if (retval != NULL)
-+ break;
-+ }
-+ return retval;
-+}
-+
-+/* First we validate the file by reading in the ELF header and checking
-+ the magic number. */
-+
-+static inline bfd_boolean
-+elf_file_p (Elf64_External_Ehdr *x_ehdrp64)
-+{
-+ gdb_assert (sizeof (Elf64_External_Ehdr) >= sizeof (Elf32_External_Ehdr));
-+ gdb_assert (offsetof (Elf64_External_Ehdr, e_ident)
-+ == offsetof (Elf32_External_Ehdr, e_ident));
-+ gdb_assert (sizeof (((Elf64_External_Ehdr *) 0)->e_ident)
-+ == sizeof (((Elf32_External_Ehdr *) 0)->e_ident));
-+
-+ return ((x_ehdrp64->e_ident[EI_MAG0] == ELFMAG0)
-+ && (x_ehdrp64->e_ident[EI_MAG1] == ELFMAG1)
-+ && (x_ehdrp64->e_ident[EI_MAG2] == ELFMAG2)
-+ && (x_ehdrp64->e_ident[EI_MAG3] == ELFMAG3));
-+}
-+
-+/* Translate an ELF file header in external format into an ELF file header in
-+ internal format. */
-+
-+#define H_GET_WORD(bfd, ptr) (is64 ? H_GET_64 (bfd, (ptr)) \
-+ : H_GET_32 (bfd, (ptr)))
-+#define H_GET_SIGNED_WORD(bfd, ptr) (is64 ? H_GET_S64 (bfd, (ptr)) \
-+ : H_GET_S32 (bfd, (ptr)))
-+
-+static void
-+elf_swap_ehdr_in (bfd *abfd,
-+ const Elf64_External_Ehdr *src64,
-+ Elf_Internal_Ehdr *dst)
-+{
-+ int is64 = bfd_get_arch_size (abfd) == 64;
-+#define SRC(field) (is64 ? src64->field \
-+ : ((const Elf32_External_Ehdr *) src64)->field)
-+
-+ int signed_vma = get_elf_backend_data (abfd)->sign_extend_vma;
-+ memcpy (dst->e_ident, SRC (e_ident), EI_NIDENT);
-+ dst->e_type = H_GET_16 (abfd, SRC (e_type));
-+ dst->e_machine = H_GET_16 (abfd, SRC (e_machine));
-+ dst->e_version = H_GET_32 (abfd, SRC (e_version));
-+ if (signed_vma)
-+ dst->e_entry = H_GET_SIGNED_WORD (abfd, SRC (e_entry));
-+ else
-+ dst->e_entry = H_GET_WORD (abfd, SRC (e_entry));
-+ dst->e_phoff = H_GET_WORD (abfd, SRC (e_phoff));
-+ dst->e_shoff = H_GET_WORD (abfd, SRC (e_shoff));
-+ dst->e_flags = H_GET_32 (abfd, SRC (e_flags));
-+ dst->e_ehsize = H_GET_16 (abfd, SRC (e_ehsize));
-+ dst->e_phentsize = H_GET_16 (abfd, SRC (e_phentsize));
-+ dst->e_phnum = H_GET_16 (abfd, SRC (e_phnum));
-+ dst->e_shentsize = H_GET_16 (abfd, SRC (e_shentsize));
-+ dst->e_shnum = H_GET_16 (abfd, SRC (e_shnum));
-+ dst->e_shstrndx = H_GET_16 (abfd, SRC (e_shstrndx));
-+
-+#undef SRC
-+}
-+
-+/* Translate an ELF program header table entry in external format into an
-+ ELF program header table entry in internal format. */
-+
-+static void
-+elf_swap_phdr_in (bfd *abfd,
-+ const Elf64_External_Phdr *src64,
-+ Elf_Internal_Phdr *dst)
-+{
-+ int is64 = bfd_get_arch_size (abfd) == 64;
-+#define SRC(field) (is64 ? src64->field \
-+ : ((const Elf32_External_Phdr *) src64)->field)
-+
-+ int signed_vma = get_elf_backend_data (abfd)->sign_extend_vma;
-+
-+ dst->p_type = H_GET_32 (abfd, SRC (p_type));
-+ dst->p_flags = H_GET_32 (abfd, SRC (p_flags));
-+ dst->p_offset = H_GET_WORD (abfd, SRC (p_offset));
-+ if (signed_vma)
-+ {
-+ dst->p_vaddr = H_GET_SIGNED_WORD (abfd, SRC (p_vaddr));
-+ dst->p_paddr = H_GET_SIGNED_WORD (abfd, SRC (p_paddr));
-+ }
-+ else
-+ {
-+ dst->p_vaddr = H_GET_WORD (abfd, SRC (p_vaddr));
-+ dst->p_paddr = H_GET_WORD (abfd, SRC (p_paddr));
-+ }
-+ dst->p_filesz = H_GET_WORD (abfd, SRC (p_filesz));
-+ dst->p_memsz = H_GET_WORD (abfd, SRC (p_memsz));
-+ dst->p_align = H_GET_WORD (abfd, SRC (p_align));
-+
-+#undef SRC
-+}
-+
-+#undef H_GET_SIGNED_WORD
-+#undef H_GET_WORD
-+
-+static Elf_Internal_Phdr *
-+elf_get_phdr (bfd *templ, bfd_vma ehdr_vma, unsigned *e_phnum_pointer,
-+ bfd_vma *loadbase_pointer)
-+{
-+ /* sizeof (Elf64_External_Ehdr) >= sizeof (Elf32_External_Ehdr) */
-+ Elf64_External_Ehdr x_ehdr64; /* Elf file header, external form */
-+ Elf_Internal_Ehdr i_ehdr; /* Elf file header, internal form */
-+ bfd_size_type x_phdrs_size;
-+ gdb_byte *x_phdrs_ptr;
-+ Elf_Internal_Phdr *i_phdrs;
-+ int err;
-+ unsigned int i;
-+ bfd_vma loadbase;
-+ int loadbase_set;
-+
-+ gdb_assert (templ != NULL);
-+ gdb_assert (sizeof (Elf64_External_Ehdr) >= sizeof (Elf32_External_Ehdr));
-+
-+ /* Read in the ELF header in external format. */
-+ err = target_read_memory (ehdr_vma, (bfd_byte *) &x_ehdr64, sizeof x_ehdr64);
-+ if (err)
-+ {
-+ if (build_id_verbose >= BUILD_ID_VERBOSE_BINARY_PARSE)
-+ warning (_("build-id: Error reading ELF header at address 0x%lx"),
-+ (unsigned long) ehdr_vma);
-+ return NULL;
-+ }
-+
-+ /* Now check to see if we have a valid ELF file, and one that BFD can
-+ make use of. The magic number must match, the address size ('class')
-+ and byte-swapping must match our XVEC entry. */
-+
-+ if (! elf_file_p (&x_ehdr64)
-+ || x_ehdr64.e_ident[EI_VERSION] != EV_CURRENT
-+ || !((bfd_get_arch_size (templ) == 64
-+ && x_ehdr64.e_ident[EI_CLASS] == ELFCLASS64)
-+ || (bfd_get_arch_size (templ) == 32
-+ && x_ehdr64.e_ident[EI_CLASS] == ELFCLASS32)))
-+ {
-+ if (build_id_verbose >= BUILD_ID_VERBOSE_BINARY_PARSE)
-+ warning (_("build-id: Unrecognized ELF header at address 0x%lx"),
-+ (unsigned long) ehdr_vma);
-+ return NULL;
-+ }
-+
-+ /* Check that file's byte order matches xvec's */
-+ switch (x_ehdr64.e_ident[EI_DATA])
-+ {
-+ case ELFDATA2MSB: /* Big-endian */
-+ if (! bfd_header_big_endian (templ))
-+ {
-+ if (build_id_verbose >= BUILD_ID_VERBOSE_BINARY_PARSE)
-+ warning (_("build-id: Unrecognized "
-+ "big-endian ELF header at address 0x%lx"),
-+ (unsigned long) ehdr_vma);
-+ return NULL;
-+ }
-+ break;
-+ case ELFDATA2LSB: /* Little-endian */
-+ if (! bfd_header_little_endian (templ))
-+ {
-+ if (build_id_verbose >= BUILD_ID_VERBOSE_BINARY_PARSE)
-+ warning (_("build-id: Unrecognized "
-+ "little-endian ELF header at address 0x%lx"),
-+ (unsigned long) ehdr_vma);
-+ return NULL;
-+ }
-+ break;
-+ case ELFDATANONE: /* No data encoding specified */
-+ default: /* Unknown data encoding specified */
-+ if (build_id_verbose >= BUILD_ID_VERBOSE_BINARY_PARSE)
-+ warning (_("build-id: Unrecognized "
-+ "ELF header endianity at address 0x%lx"),
-+ (unsigned long) ehdr_vma);
-+ return NULL;
-+ }
-+
-+ elf_swap_ehdr_in (templ, &x_ehdr64, &i_ehdr);
-+
-+ /* The file header tells where to find the program headers.
-+ These are what we use to actually choose what to read. */
-+
-+ if (i_ehdr.e_phentsize != (bfd_get_arch_size (templ) == 64
-+ ? sizeof (Elf64_External_Phdr)
-+ : sizeof (Elf32_External_Phdr))
-+ || i_ehdr.e_phnum == 0)
-+ {
-+ if (build_id_verbose >= BUILD_ID_VERBOSE_BINARY_PARSE)
-+ warning (_("build-id: Invalid ELF program headers from the ELF header "
-+ "at address 0x%lx"), (unsigned long) ehdr_vma);
-+ return NULL;
-+ }
-+
-+ x_phdrs_size = (bfd_get_arch_size (templ) == 64 ? sizeof (Elf64_External_Phdr)
-+ : sizeof (Elf32_External_Phdr));
-+
-+ i_phdrs = (Elf_Internal_Phdr *) xmalloc (i_ehdr.e_phnum * (sizeof *i_phdrs + x_phdrs_size));
-+ x_phdrs_ptr = (gdb_byte *) &i_phdrs[i_ehdr.e_phnum];
-+ err = target_read_memory (ehdr_vma + i_ehdr.e_phoff, (bfd_byte *) x_phdrs_ptr,
-+ i_ehdr.e_phnum * x_phdrs_size);
-+ if (err)
-+ {
-+ free (i_phdrs);
-+ if (build_id_verbose >= BUILD_ID_VERBOSE_BINARY_PARSE)
-+ warning (_("build-id: Error reading "
-+ "ELF program headers at address 0x%lx"),
-+ (unsigned long) (ehdr_vma + i_ehdr.e_phoff));
-+ return NULL;
-+ }
-+
-+ loadbase = ehdr_vma;
-+ loadbase_set = 0;
-+ for (i = 0; i < i_ehdr.e_phnum; ++i)
-+ {
-+ elf_swap_phdr_in (templ, (Elf64_External_Phdr *)
-+ (x_phdrs_ptr + i * x_phdrs_size), &i_phdrs[i]);
-+ /* IA-64 vDSO may have two mappings for one segment, where one mapping
-+ is executable only, and one is read only. We must not use the
-+ executable one (PF_R is the first one, PF_X the second one). */
-+ if (i_phdrs[i].p_type == PT_LOAD && (i_phdrs[i].p_flags & PF_R))
-+ {
-+ /* Only the first PT_LOAD segment indicates the file bias.
-+ Next segments may have P_VADDR arbitrarily higher.
-+ If the first segment has P_VADDR zero any next segment must not
-+ confuse us, the first one sets LOADBASE certainly enough. */
-+ if (!loadbase_set && i_phdrs[i].p_offset == 0)
-+ {
-+ loadbase = ehdr_vma - i_phdrs[i].p_vaddr;
-+ loadbase_set = 1;
-+ }
-+ }
-+ }
-+
-+ if (build_id_verbose >= BUILD_ID_VERBOSE_BINARY_PARSE)
-+ warning (_("build-id: Found ELF header at address 0x%lx, loadbase 0x%lx"),
-+ (unsigned long) ehdr_vma, (unsigned long) loadbase);
-+
-+ *e_phnum_pointer = i_ehdr.e_phnum;
-+ *loadbase_pointer = loadbase;
-+ return i_phdrs;
-+}
-+
-+/* BUILD_ID_ADDR_GET gets ADDR located somewhere in the object.
-+ Find the first section before ADDR containing an ELF header.
-+ We rely on the fact the sections from multiple files do not mix.
-+ FIXME: We should check ADDR is contained _inside_ the section with possibly
-+ missing content (P_FILESZ < P_MEMSZ). These omitted sections are currently
-+ hidden by _BFD_ELF_MAKE_SECTION_FROM_PHDR. */
-+
-+static CORE_ADDR build_id_addr;
-+struct build_id_addr_sect
-+ {
-+ struct build_id_addr_sect *next;
-+ asection *sect;
-+ };
-+static struct build_id_addr_sect *build_id_addr_sect;
-+
-+static void build_id_addr_candidate (bfd *abfd, asection *sect, void *obj)
-+{
-+ if (build_id_addr >= bfd_section_vma (abfd, sect))
-+ {
-+ struct build_id_addr_sect *candidate;
-+
-+ candidate = (struct build_id_addr_sect *) xmalloc (sizeof *candidate);
-+ candidate->next = build_id_addr_sect;
-+ build_id_addr_sect = candidate;
-+ candidate->sect = sect;
-+ }
-+}
-+
-+struct bfd_build_id *
-+build_id_addr_get (CORE_ADDR addr)
-+{
-+ struct build_id_addr_sect *candidate;
-+ struct bfd_build_id *retval = NULL;
-+ Elf_Internal_Phdr *i_phdr = NULL;
-+ bfd_vma loadbase = 0;
-+ unsigned e_phnum = 0;
-+
-+ if (core_bfd == NULL)
-+ return NULL;
-+
-+ build_id_addr = addr;
-+ gdb_assert (build_id_addr_sect == NULL);
-+ bfd_map_over_sections (core_bfd, build_id_addr_candidate, NULL);
-+
-+ /* Sections are sorted in the high-to-low VMAs order.
-+ Stop the search on the first ELF header we find.
-+ Do not continue the search even if it does not contain NT_GNU_BUILD_ID. */
-+
-+ for (candidate = build_id_addr_sect; candidate != NULL;
-+ candidate = candidate->next)
-+ {
-+ i_phdr = elf_get_phdr (core_bfd,
-+ bfd_section_vma (core_bfd, candidate->sect),
-+ &e_phnum, &loadbase);
-+ if (i_phdr != NULL)
-+ break;
-+ }
-+
-+ if (i_phdr != NULL)
-+ {
-+ retval = build_id_phdr_get (core_bfd, loadbase, e_phnum, i_phdr);
-+ xfree (i_phdr);
-+ }
-+
-+ while (build_id_addr_sect != NULL)
-+ {
-+ candidate = build_id_addr_sect;
-+ build_id_addr_sect = candidate->next;
-+ xfree (candidate);
-+ }
-+
-+ return retval;
-+}
-+
- /* See build-id.h. */
-
- int
-@@ -50,7 +448,7 @@ build_id_verify (bfd *abfd, size_t check
- const struct bfd_build_id *found;
- int retval = 0;
-
-- found = build_id_bfd_get (abfd);
-+ found = build_id_bfd_shdr_get (abfd);
-
- if (found == NULL)
- warning (_("File \"%s\" has no build-id, file skipped"),
-@@ -65,23 +463,56 @@ build_id_verify (bfd *abfd, size_t check
- return retval;
- }
-
-+static char *
-+link_resolve (const char *symlink, int level)
-+{
-+ char buf[PATH_MAX + 1], *target, *retval;
-+ ssize_t got;
-+
-+ if (level > 10)
-+ return xstrdup (symlink);
-+
-+ got = readlink (symlink, buf, sizeof (buf));
-+ if (got < 0 || got >= sizeof (buf))
-+ return xstrdup (symlink);
-+ buf[got] = '\0';
-+
-+ if (IS_ABSOLUTE_PATH (buf))
-+ target = xstrdup (buf);
-+ else
-+ {
-+ std::string dir = ldirname (symlink);
-+
-+ if (dir.length () == 0)
-+ return xstrdup (symlink);
-+ target = xstrprintf ("%s"
-+#ifndef HAVE_DOS_BASED_FILE_SYSTEM
-+ "/"
-+#else /* HAVE_DOS_BASED_FILE_SYSTEM */
-+ "\\"
-+#endif /* HAVE_DOS_BASED_FILE_SYSTEM */
-+ "%s", dir.c_str (), buf);
-+ }
-+
-+ retval = link_resolve (target, level + 1);
-+ xfree (target);
-+ return retval;
-+}
-+
- /* 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, int add_debug_suffix)
- {
-- char *link, *debugdir;
-+ char *link, *debugdir, *link_all = NULL;
- VEC (char_ptr) *debugdir_vec;
- struct cleanup *back_to;
- int ix;
- gdb_bfd_ref_ptr abfd;
-- int alloc_len;
-
- /* DEBUG_FILE_DIRECTORY/.build-id/ab/cdef */
-- alloc_len = (strlen (debug_file_directory)
-- + (sizeof "/.build-id/" - 1) + 1
-- + 2 * build_id_len + (sizeof ".debug" - 1) + 1);
-- link = (char *) alloca (alloc_len);
-+ link = (char *) xmalloc (strlen (debug_file_directory) + 2 * build_id_len + 50);
-
- /* Keep backward compatibility so that DEBUG_FILE_DIRECTORY being "" will
- cause "/.build-id/..." lookups. */
-@@ -94,9 +525,12 @@ build_id_to_debug_bfd (size_t build_id_l
- size_t debugdir_len = strlen (debugdir);
- const gdb_byte *data = build_id;
- size_t size = build_id_len;
-- char *s;
- char *filename = NULL;
- struct cleanup *inner;
-+ unsigned seqno;
-+ struct stat statbuf_trash;
-+ /* Initialize it just to avoid a GCC false warning. */
-+ char *s, *link0 = NULL, *link0_resolved;
-
- memcpy (link, debugdir, debugdir_len);
- s = &link[debugdir_len];
-@@ -110,45 +544,290 @@ build_id_to_debug_bfd (size_t build_id_l
- *s++ = '/';
- while (size-- > 0)
- s += sprintf (s, "%02x", (unsigned) *data++);
-- strcpy (s, ".debug");
-+ for (seqno = 0;; seqno++)
-+ {
-+ char *s2;
-
-- /* lrealpath() is expensive even for the usually non-existent files. */
-- if (access (link, F_OK) == 0)
-- filename = lrealpath (link);
-+ if (seqno)
-+ {
-+ /* There can be multiple build-id symlinks pointing to real files
-+ with the same build-id (such as hard links). Some of the real
-+ files may not be installed. */
-+
-+ s2 = s + sprintf (s, ".%u", seqno);
-+ }
-+ else
-+ s2 = s;
-+
-+ if (add_debug_suffix)
-+ strcpy (s2, ".debug");
-+ else
-+ *s2 = 0;
-+
-+ if (!seqno)
-+ {
-+ /* If none of the real files is found report as missing file
-+ always the non-.%u-suffixed file. */
-+ link0 = xstrdup (link);
-+ }
-+
-+ /* `access' automatically dereferences LINK. */
-+ if (lstat (link, &statbuf_trash) != 0)
-+ {
-+ /* Stop increasing SEQNO. */
-+ break;
-+ }
-+
-+ filename = lrealpath (link);
-+ if (filename == NULL)
-+ continue;
-+
-+ /* We expect to be silent on the non-existing files. */
-+ inner = make_cleanup (xfree, filename);
-+ abfd = gdb_bfd_open (filename, gnutarget, -1);
-+ do_cleanups (inner);
-+
-+ if (abfd == NULL)
-+ continue;
-
-- if (filename == NULL)
-- continue;
-+ if (build_id_verify (abfd.get(), build_id_len, build_id))
-+ break;
-
-- /* We expect to be silent on the non-existing files. */
-- inner = make_cleanup (xfree, filename);
-- abfd = gdb_bfd_open (filename, gnutarget, -1);
-- do_cleanups (inner);
-+ abfd.release ();
-
-- if (abfd == NULL)
-- continue;
-+ filename = NULL;
-+ }
-
-- if (build_id_verify (abfd.get(), build_id_len, build_id))
-- break;
-+ if (filename != NULL)
-+ {
-+ /* LINK_ALL is not used below in this non-NULL FILENAME case. */
-+ xfree (link0);
-+ break;
-+ }
-
-- abfd.release ();
-+ /* If the symlink has target request to install the target.
-+ BASE-debuginfo.rpm contains the symlink but BASE.rpm may be missing.
-+ https://bugzilla.redhat.com/show_bug.cgi?id=981154 */
-+ link0_resolved = link_resolve (link0, 0);
-+ xfree (link0);
-+
-+ if (link_all == NULL)
-+ link_all = link0_resolved;
-+ else
-+ {
-+ size_t len_orig = strlen (link_all);
-+
-+ link_all = (char *) xrealloc (link_all,
-+ len_orig + 1 + strlen (link0_resolved) + 1);
-+
-+ /* Use whitespace instead of DIRNAME_SEPARATOR to be compatible with
-+ its possible use as an argument for installation command. */
-+ link_all[len_orig] = ' ';
-+
-+ strcpy (&link_all[len_orig + 1], link0_resolved);
-+ xfree (link0_resolved);
-+ }
-+ }
-+
-+ if (link_return != NULL)
-+ {
-+ if (abfd != NULL)
-+ {
-+ *link_return = link;
-+ link = NULL;
-+ }
-+ else
-+ {
-+ *link_return = link_all;
-+ link_all = NULL;
-+ }
- }
-+ xfree (link);
-+ xfree (link_all);
-
- do_cleanups (back_to);
- return abfd;
- }
-
-+char *
-+build_id_to_filename (const struct bfd_build_id *build_id, char **link_return)
-+{
-+ gdb_bfd_ref_ptr abfd;
-+ char *result;
-+
-+ abfd = build_id_to_debug_bfd (build_id->size, build_id->data, link_return, 0);
-+ if (abfd == NULL)
-+ return NULL;
-+
-+ result = xstrdup (bfd_get_filename (abfd));
-+ abfd.release ();
-+ return result;
-+}
-+
-+/* This MISSING_FILEPAIR_HASH tracker is used only for the duplicite messages
-+ Try to install the hash file ...
-+ avoidance. */
-+
-+struct missing_filepair
-+ {
-+ char *binary;
-+ char *debug;
-+ char data[1];
-+ };
-+
-+static struct htab *missing_filepair_hash;
-+static struct obstack missing_filepair_obstack;
-+
-+static void *
-+missing_filepair_xcalloc (size_t nmemb, size_t nmemb_size)
-+{
-+ void *retval;
-+ size_t size = nmemb * nmemb_size;
-+
-+ retval = obstack_alloc (&missing_filepair_obstack, size);
-+ memset (retval, 0, size);
-+ return retval;
-+}
-+
-+static hashval_t
-+missing_filepair_hash_func (const struct missing_filepair *elem)
-+{
-+ hashval_t retval = 0;
-+
-+ retval ^= htab_hash_string (elem->binary);
-+ if (elem->debug != NULL)
-+ retval ^= htab_hash_string (elem->debug);
-+
-+ return retval;
-+}
-+
-+static int
-+missing_filepair_eq (const struct missing_filepair *elem1,
-+ const struct missing_filepair *elem2)
-+{
-+ return strcmp (elem1->binary, elem2->binary) == 0
-+ && ((elem1->debug == NULL) == (elem2->debug == NULL))
-+ && (elem1->debug == NULL || strcmp (elem1->debug, elem2->debug) == 0);
-+}
-+
-+static void
-+missing_filepair_change (void)
-+{
-+ if (missing_filepair_hash != NULL)
-+ {
-+ obstack_free (&missing_filepair_obstack, NULL);
-+ /* All their memory came just from missing_filepair_OBSTACK. */
-+ missing_filepair_hash = NULL;
-+ }
-+}
-+
-+static void
-+debug_print_executable_changed (void)
-+{
-+ missing_filepair_change ();
-+}
-+
-+/* Notify user the file BINARY with (possibly NULL) associated separate debug
-+ information file DEBUG is missing. DEBUG may or may not be the build-id
-+ file such as would be:
-+ /usr/lib/debug/.build-id/dd/b1d2ce632721c47bb9e8679f369e2295ce71be.debug
-+ */
-+
-+void
-+debug_print_missing (const char *binary, const char *debug)
-+{
-+ size_t binary_len0 = strlen (binary) + 1;
-+ size_t debug_len0 = debug ? strlen (debug) + 1 : 0;
-+ struct missing_filepair missing_filepair_find;
-+ struct missing_filepair *missing_filepair;
-+ struct missing_filepair **slot;
-+
-+ if (build_id_verbose < BUILD_ID_VERBOSE_FILENAMES)
-+ return;
-+
-+ if (missing_filepair_hash == NULL)
-+ {
-+ obstack_init (&missing_filepair_obstack);
-+ missing_filepair_hash = htab_create_alloc (64,
-+ (hashval_t (*) (const void *)) missing_filepair_hash_func,
-+ (int (*) (const void *, const void *)) missing_filepair_eq, NULL,
-+ missing_filepair_xcalloc, NULL);
-+ }
-+
-+ /* Use MISSING_FILEPAIR_FIND first instead of calling obstack_alloc with
-+ obstack_free in the case of a (rare) match. The problem is ALLOC_F for
-+ MISSING_FILEPAIR_HASH allocates from MISSING_FILEPAIR_OBSTACK maintenance
-+ structures for MISSING_FILEPAIR_HASH. Calling obstack_free would possibly
-+ not to free only MISSING_FILEPAIR but also some such structures (allocated
-+ during the htab_find_slot call). */
-+
-+ missing_filepair_find.binary = (char *) binary;
-+ missing_filepair_find.debug = (char *) debug;
-+ slot = (struct missing_filepair **) htab_find_slot (missing_filepair_hash,
-+ &missing_filepair_find,
-+ INSERT);
-+
-+ /* While it may be still printed duplicitely with the missing debuginfo file
-+ * it is due to once printing about the binary file build-id link and once
-+ * about the .debug file build-id link as both the build-id symlinks are
-+ * located in the debuginfo package. */
-+
-+ if (*slot != NULL)
-+ return;
-+
-+ missing_filepair = (struct missing_filepair *) obstack_alloc (&missing_filepair_obstack,
-+ sizeof (*missing_filepair) - 1
-+ + binary_len0 + debug_len0);
-+ missing_filepair->binary = missing_filepair->data;
-+ memcpy (missing_filepair->binary, binary, binary_len0);
-+ if (debug != NULL)
-+ {
-+ missing_filepair->debug = missing_filepair->binary + binary_len0;
-+ memcpy (missing_filepair->debug, debug, debug_len0);
-+ }
-+ else
-+ missing_filepair->debug = NULL;
-+
-+ *slot = missing_filepair;
-+
-+ /* We do not collect and flush these messages as each such message
-+ already requires its own separate lines. */
-+
-+ 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);
-+}
-+
- /* See build-id.h. */
-
- char *
--find_separate_debug_file_by_buildid (struct objfile *objfile)
-+find_separate_debug_file_by_buildid (struct objfile *objfile,
-+ gdb::unique_xmalloc_ptr<char> *build_id_filename_return)
- {
- const struct bfd_build_id *build_id;
-
-- build_id = build_id_bfd_get (objfile->obfd);
-+ if (build_id_filename_return)
-+ *build_id_filename_return = NULL;
-+
-+ build_id = build_id_bfd_shdr_get (objfile->obfd);
- if (build_id != NULL)
- {
-+ char *build_id_filename_cstr = NULL;
- 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));
-+ if (build_id_filename_return)
-+ {
-+ if (!build_id_filename_cstr)
-+ gdb_assert (!*build_id_filename_return);
-+ else
-+ {
-+ *build_id_filename_return = gdb::unique_xmalloc_ptr<char> (build_id_filename_cstr);
-+ build_id_filename_cstr = NULL;
-+ }
-+ }
- /* Prevent looping on a stripped .debug file. */
- if (abfd != NULL
- && filename_cmp (bfd_get_filename (abfd.get ()),
-@@ -160,3 +839,21 @@ find_separate_debug_file_by_buildid (str
- }
- return NULL;
- }
-+
-+extern void _initialize_build_id (void);
-+
-+void
-+_initialize_build_id (void)
-+{
-+ add_setshow_zinteger_cmd ("build-id-verbose", no_class, &build_id_verbose,
-+ _("\
-+Set debugging level of the build-id locator."), _("\
-+Show debugging level of the build-id locator."), _("\
-+Level 1 (default) enables printing the missing debug filenames,\n\
-+level 2 also prints the parsing of binaries to find the identificators."),
-+ NULL,
-+ show_build_id_verbose,
-+ &setlist, &showlist);
-+
-+ observer_attach_executable_changed (debug_print_executable_changed);
-+}
-diff -Naurp insight-7.12.50.20170416.orig/gdb/build-id.h insight-7.12.50.20170416.new/gdb/build-id.h
---- insight-7.12.50.20170416.orig/gdb/build-id.h 2017-01-21 02:32:23.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/build-id.h 2017-04-16 13:52:31.767187912 +0100
-@@ -22,9 +22,10 @@
-
- #include "gdb_bfd.h"
-
--/* Locate NT_GNU_BUILD_ID from ABFD and return its content. */
-+/* Separate debuginfo files have corrupted PHDR but SHDR is correct there.
-+ Locate NT_GNU_BUILD_ID from ABFD and return its content. */
-
--extern const struct bfd_build_id *build_id_bfd_get (bfd *abfd);
-+extern const struct bfd_build_id *build_id_bfd_shdr_get (bfd *abfd);
-
- /* Return true if ABFD has NT_GNU_BUILD_ID matching the CHECK value.
- Otherwise, issue a warning and return false. */
-@@ -38,13 +39,19 @@ extern int build_id_verify (bfd *abfd,
- the caller. */
-
- 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);
-+
-+extern char *build_id_to_filename (const struct bfd_build_id *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 a malloc'd
- file name for the separate debug file. The caller must free this.
- Otherwise, returns NULL. */
-
--extern char *find_separate_debug_file_by_buildid (struct objfile *objfile);
-+extern char *find_separate_debug_file_by_buildid (struct objfile *objfile,
-+ gdb::unique_xmalloc_ptr<char> *build_id_filename_return);
-
- #endif /* BUILD_ID_H */
-diff -Naurp insight-7.12.50.20170416.orig/gdb/coffread.c insight-7.12.50.20170416.new/gdb/coffread.c
---- insight-7.12.50.20170416.orig/gdb/coffread.c 2017-01-21 02:32:23.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/coffread.c 2017-04-16 13:52:31.773187966 +0100
-@@ -734,7 +734,7 @@ coff_symfile_read (struct objfile *objfi
- {
- char *debugfile;
-
-- debugfile = find_separate_debug_file_by_buildid (objfile);
-+ debugfile = find_separate_debug_file_by_buildid (objfile, NULL);
-
- if (debugfile == NULL)
- debugfile = find_separate_debug_file_by_debuglink (objfile);
-diff -Naurp insight-7.12.50.20170416.orig/gdb/corelow.c insight-7.12.50.20170416.new/gdb/corelow.c
---- insight-7.12.50.20170416.orig/gdb/corelow.c 2017-04-09 01:11:01.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/corelow.c 2017-04-16 13:52:31.752187778 +0100
-@@ -45,6 +45,10 @@
- #include "gdb_bfd.h"
- #include "completer.h"
- #include "filestuff.h"
-+#include "auxv.h"
-+#include "elf/common.h"
-+#include "gdbcmd.h"
-+#include "build-id.h"
-
- #ifndef O_LARGEFILE
- #define O_LARGEFILE 0
-@@ -266,6 +270,54 @@ add_to_thread_list (bfd *abfd, asection
- 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, *debug_filename;
-+ char *build_id_filename;
-+ struct cleanup *back_to;
-+
-+ if (exec_bfd != NULL || symfile_objfile != NULL)
-+ return;
-+
-+ if (target_auxv_search (¤t_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. */
-+}
-+
- /* This routine opens and sets up the core file bfd. */
-
- static void
-@@ -402,6 +454,14 @@ core_open (const char *arg, int from_tty
- switch_to_thread (thread->ptid);
- }
-
-+ /* 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 (&core_ops, from_tty);
-
- /* Now go through the target stack looking for threads since there
-@@ -1079,4 +1139,11 @@ _initialize_corelow (void)
- init_core_ops ();
-
- add_target_with_completer (&core_ops, filename_completer);
-+
-+ add_setshow_boolean_cmd ("build-id-core-loads", class_files,
-+ &build_id_core_loads, _("\
-+Set whether CORE-FILE loads the build-id associated files automatically."), _("\
-+Show whether CORE-FILE loads the build-id associated files automatically."),
-+ NULL, NULL, NULL,
-+ &setlist, &showlist);
- }
-diff -Naurp insight-7.12.50.20170416.orig/gdb/doc/gdb.texinfo insight-7.12.50.20170416.new/gdb/doc/gdb.texinfo
---- insight-7.12.50.20170416.orig/gdb/doc/gdb.texinfo 2017-04-16 13:51:32.834666757 +0100
-+++ insight-7.12.50.20170416.new/gdb/doc/gdb.texinfo 2017-04-16 13:52:31.761187859 +0100
-@@ -18977,6 +18977,27 @@ information files.
-
- @end table
-
-+You can also adjust the current verbosity of the @dfn{build id} locating.
-+
-+@table @code
-+
-+@kindex set build-id-verbose
-+@item set build-id-verbose 0
-+No additional messages are printed.
-+
-+@item set build-id-verbose 1
-+Missing separate debug filenames are printed.
-+
-+@item set build-id-verbose 2
-+Missing separate debug filenames are printed and also all the parsing of the
-+binaries to find their @dfn{build id} content is printed.
-+
-+@kindex show build-id-verbose
-+@item show build-id-verbose
-+Show the current verbosity value for the @dfn{build id} content locating.
-+
-+@end table
-+
- @cindex @code{.gnu_debuglink} sections
- @cindex debug link sections
- A debug link is a special section of the executable file named
-diff -Naurp insight-7.12.50.20170416.orig/gdb/dwarf2read.c insight-7.12.50.20170416.new/gdb/dwarf2read.c
---- insight-7.12.50.20170416.orig/gdb/dwarf2read.c 2017-04-16 13:51:32.837666783 +0100
-+++ insight-7.12.50.20170416.new/gdb/dwarf2read.c 2017-04-16 13:52:31.772187957 +0100
-@@ -2670,7 +2670,7 @@ dwarf2_get_dwz_file (void)
- }
-
- 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);
-
- if (dwz_bfd == NULL)
- error (_("could not find '.gnu_debugaltlink' file for %s"),
-diff -Naurp insight-7.12.50.20170416.orig/gdb/elfread.c insight-7.12.50.20170416.new/gdb/elfread.c
---- insight-7.12.50.20170416.orig/gdb/elfread.c 2017-04-15 01:21:12.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/elfread.c 2017-04-16 13:52:31.762187868 +0100
-@@ -1265,8 +1265,9 @@ elf_symfile_read (struct objfile *objfil
- && objfile->separate_debug_objfile == NULL
- && objfile->separate_debug_objfile_backlink == NULL)
- {
-+ gdb::unique_xmalloc_ptr<char> build_id_filename;
- gdb::unique_xmalloc_ptr<char> debugfile
-- (find_separate_debug_file_by_buildid (objfile));
-+ (find_separate_debug_file_by_buildid (objfile, &build_id_filename));
-
- if (debugfile == NULL)
- debugfile.reset (find_separate_debug_file_by_debuglink (objfile));
-@@ -1278,6 +1279,10 @@ elf_symfile_read (struct objfile *objfil
- symbol_file_add_separate (abfd.get (), debugfile.get (),
- symfile_flags, objfile);
- }
-+ /* 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 ());
- }
- }
-
-diff -Naurp insight-7.12.50.20170416.orig/gdb/objfiles.h insight-7.12.50.20170416.new/gdb/objfiles.h
---- insight-7.12.50.20170416.orig/gdb/objfiles.h 2017-04-09 01:11:01.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/objfiles.h 2017-04-16 13:52:31.766187903 +0100
-@@ -444,6 +444,10 @@ struct objfile
- htab_t static_links;
- };
-
-+/* This file was loaded according to the BUILD_ID_CORE_LOADS rules. */
-+
-+#define OBJF_BUILD_ID_CORE_LOADED static_cast<enum objfile_flag>(1 << 12)
-+
- /* Declarations for functions defined in objfiles.c */
-
- extern struct objfile *allocate_objfile (bfd *, const char *name,
-diff -Naurp insight-7.12.50.20170416.orig/gdb/python/py-objfile.c insight-7.12.50.20170416.new/gdb/python/py-objfile.c
---- insight-7.12.50.20170416.orig/gdb/python/py-objfile.c 2017-04-09 01:11:01.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/python/py-objfile.c 2017-04-16 13:52:31.772187957 +0100
-@@ -137,7 +137,7 @@ objfpy_get_build_id (PyObject *self, voi
-
- TRY
- {
-- build_id = build_id_bfd_get (objfile->obfd);
-+ build_id = build_id_bfd_shdr_get (objfile->obfd);
- }
- CATCH (except, RETURN_MASK_ALL)
- {
-@@ -544,7 +544,7 @@ objfpy_lookup_objfile_by_build_id (const
- /* Don't return separate debug files. */
- if (objfile->separate_debug_objfile_backlink != NULL)
- continue;
-- obfd_build_id = build_id_bfd_get (objfile->obfd);
-+ obfd_build_id = build_id_bfd_shdr_get (objfile->obfd);
- if (obfd_build_id == NULL)
- continue;
- if (objfpy_build_id_matches (obfd_build_id, build_id))
-diff -Naurp insight-7.12.50.20170416.orig/gdb/solib-svr4.c insight-7.12.50.20170416.new/gdb/solib-svr4.c
---- insight-7.12.50.20170416.orig/gdb/solib-svr4.c 2017-03-25 10:42:37.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/solib-svr4.c 2017-04-16 13:52:31.762187868 +0100
-@@ -45,6 +45,7 @@
- #include "auxv.h"
- #include "gdb_bfd.h"
- #include "probe.h"
-+#include "build-id.h"
-
- static struct link_map_offsets *svr4_fetch_link_map_offsets (void);
- static int svr4_have_link_map_offsets (void);
-@@ -1420,9 +1421,52 @@ svr4_read_so_list (CORE_ADDR lm, CORE_AD
- continue;
- }
-
-- strncpy (newobj->so_name, buffer, SO_NAME_MAX_PATH_SIZE - 1);
-- newobj->so_name[SO_NAME_MAX_PATH_SIZE - 1] = '\0';
-- strcpy (newobj->so_original_name, newobj->so_name);
-+ {
-+ struct bfd_build_id *build_id;
-+
-+ strncpy (newobj->so_original_name, buffer, SO_NAME_MAX_PATH_SIZE - 1);
-+ newobj->so_original_name[SO_NAME_MAX_PATH_SIZE - 1] = '\0';
-+ /* May get overwritten below. */
-+ strcpy (newobj->so_name, newobj->so_original_name);
-+
-+ build_id = build_id_addr_get (newobj->lm_info->l_ld);
-+ if (build_id != NULL)
-+ {
-+ char *name, *build_id_filename;
-+
-+ /* Missing the build-id matching separate debug info file
-+ would be handled while SO_NAME gets loaded. */
-+ name = build_id_to_filename (build_id, &build_id_filename);
-+ if (name != NULL)
-+ {
-+ strncpy (newobj->so_name, name, SO_NAME_MAX_PATH_SIZE - 1);
-+ newobj->so_name[SO_NAME_MAX_PATH_SIZE - 1] = '\0';
-+ xfree (name);
-+ }
-+ else
-+ {
-+ debug_print_missing (newobj->so_name, build_id_filename);
-+
-+ /* In the case the main executable was found according to
-+ its build-id (from a core file) prevent loading
-+ a different build of a library with accidentally the
-+ same SO_NAME.
-+
-+ It suppresses bogus backtraces (and prints "??" there
-+ instead) if the on-disk files no longer match the
-+ running program version. */
-+
-+ if (symfile_objfile != NULL
-+ && (symfile_objfile->flags
-+ & OBJF_BUILD_ID_CORE_LOADED) != 0)
-+ newobj->so_name[0] = 0;
-+ }
-+
-+ xfree (build_id_filename);
-+ xfree (build_id);
-+ }
-+ }
-+
- xfree (buffer);
-
- /* If this entry has no name, or its name matches the name
-diff -Naurp insight-7.12.50.20170416.orig/gdb/symfile.h insight-7.12.50.20170416.new/gdb/symfile.h
---- insight-7.12.50.20170416.orig/gdb/symfile.h 2017-04-15 01:21:12.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/symfile.h 2017-04-16 13:52:31.763187877 +0100
-@@ -567,6 +567,10 @@ void expand_symtabs_matching
- void map_symbol_filenames (symbol_filename_ftype *fun, void *data,
- int need_fullname);
-
-+/* 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);
-+
- /* From dwarf2read.c */
-
- /* Names for a dwarf2 debugging section. The field NORMAL is the normal
-diff -Naurp insight-7.12.50.20170416.orig/gdb/testsuite/gdb.base/corefile.exp insight-7.12.50.20170416.new/gdb/testsuite/gdb.base/corefile.exp
---- insight-7.12.50.20170416.orig/gdb/testsuite/gdb.base/corefile.exp 2017-01-03 17:36:55.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/testsuite/gdb.base/corefile.exp 2017-04-16 13:52:31.766187903 +0100
-@@ -293,3 +293,33 @@ gdb_test_multiple "core-file $corefile"
- pass $test
- }
- }
-+
-+
-+# Test auto-loading of binary files through build-id from the core file.
-+set buildid [build_id_debug_filename_get $binfile]
-+set wholetest "binfile found by build-id"
-+if {$buildid == ""} {
-+ untested "$wholetest (binary has no build-id)"
-+} else {
-+ gdb_exit
-+ gdb_start
-+
-+ regsub {\.debug$} $buildid {} buildid
-+ set debugdir [standard_output_file ${testfile}-debugdir]
-+ file delete -force -- $debugdir
-+ file mkdir $debugdir/[file dirname $buildid]
-+ file copy $binfile $debugdir/$buildid
-+
-+ set test "show debug-file-directory"
-+ gdb_test_multiple $test $test {
-+ -re "The directory where separate debug symbols are searched for is \"(.*)\"\\.\r\n$gdb_prompt $" {
-+ set debugdir_orig $expect_out(1,string)
-+ pass $test
-+ }
-+ }
-+ gdb_test_no_output "set debug-file-directory $debugdir:$debugdir_orig" "set debug-file-directory"
-+ gdb_test "show build-id-core-loads" {Whether CORE-FILE loads the build-id associated files automatically is on\.}
-+ gdb_test "core-file $corefile" "\r\nProgram terminated with .*" "core-file without executable"
-+ gdb_test "info files" "Local exec file:\r\n\[ \t\]*`[string_to_regexp $debugdir/$buildid]', file type .*"
-+ pass $wholetest
-+}
-diff -Naurp insight-7.12.50.20170416.orig/gdb/testsuite/gdb.base/new-ui-pending-input.exp insight-7.12.50.20170416.new/gdb/testsuite/gdb.base/new-ui-pending-input.exp
---- insight-7.12.50.20170416.orig/gdb/testsuite/gdb.base/new-ui-pending-input.exp 2017-01-03 17:36:55.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/testsuite/gdb.base/new-ui-pending-input.exp 2017-04-16 13:52:31.765187895 +0100
-@@ -62,6 +62,7 @@ proc test_command_line_new_ui_pending_in
- set options ""
- append options " -iex \"set height 0\""
- append options " -iex \"set width 0\""
-+ append options " -iex \"set build-id-verbose 0\""
- append options " -iex \"new-ui console $extra_tty_name\""
- append options " -ex \"b $bpline\""
- append options " -ex \"run\""
-diff -Naurp insight-7.12.50.20170416.orig/gdb/testsuite/lib/gdb.exp insight-7.12.50.20170416.new/gdb/testsuite/lib/gdb.exp
---- insight-7.12.50.20170416.orig/gdb/testsuite/lib/gdb.exp 2017-04-16 13:51:32.814666580 +0100
-+++ insight-7.12.50.20170416.new/gdb/testsuite/lib/gdb.exp 2017-04-16 13:52:31.764187886 +0100
-@@ -1646,6 +1646,16 @@ proc default_gdb_start { } {
- warning "Couldn't set the width to 0."
- }
- }
-+ # Turn off the missing warnings as the testsuite does not expect it.
-+ send_gdb "set build-id-verbose 0\n"
-+ gdb_expect 10 {
-+ -re "$gdb_prompt $" {
-+ verbose "Disabled the missing debug infos warnings." 2
-+ }
-+ timeout {
-+ warning "Could not disable the missing debug infos warnings.."
-+ }
-+ }
- return 0
- }
-
-diff -Naurp insight-7.12.50.20170416.orig/gdb/testsuite/lib/mi-support.exp insight-7.12.50.20170416.new/gdb/testsuite/lib/mi-support.exp
---- insight-7.12.50.20170416.orig/gdb/testsuite/lib/mi-support.exp 2017-03-25 10:42:37.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/testsuite/lib/mi-support.exp 2017-04-16 13:52:31.765187895 +0100
-@@ -309,6 +309,16 @@ proc default_mi_gdb_start { args } {
- warning "Couldn't set the width to 0."
- }
- }
-+ # Turn off the missing warnings as the testsuite does not expect it.
-+ send_gdb "190-gdb-set build-id-verbose 0\n"
-+ gdb_expect 10 {
-+ -re ".*190-gdb-set build-id-verbose 0\r\n190\\\^done\r\n$mi_gdb_prompt$" {
-+ verbose "Disabled the missing debug infos warnings." 2
-+ }
-+ timeout {
-+ warning "Could not disable the missing debug infos warnings.."
-+ }
-+ }
-
- if { $separate_inferior_pty } {
- mi_create_inferior_pty
diff --git a/insight-7.12-gdb-6.8-attach-signalled-detach-stopped.patch b/insight-7.12-gdb-6.8-attach-signalled-detach-stopped.patch
deleted file mode 100644
index 6126c41..0000000
--- a/insight-7.12-gdb-6.8-attach-signalled-detach-stopped.patch
+++ /dev/null
@@ -1,177 +0,0 @@
-diff -Naurp insight-7.12.50.20170416.orig/gdb/infrun.c insight-7.12.50.20170416.new/gdb/infrun.c
---- insight-7.12.50.20170416.orig/gdb/infrun.c 2017-04-16 12:20:48.912021636 +0100
-+++ insight-7.12.50.20170416.new/gdb/infrun.c 2017-04-16 12:21:43.277528153 +0100
-@@ -620,6 +620,13 @@ holding the child stopped. Try \"set de
- target_pid_to_str (process_ptid));
- }
-
-+#ifdef NEED_DETACH_SIGSTOP
-+ /* We should check PID_WAS_STOPPED and detach it stopped accordingly.
-+ In this point of code it cannot be 1 as we would not get FORK
-+ executed without CONTINUE first which resets PID_WAS_STOPPED.
-+ We would have to first TARGET_STOP and WAITPID it as with running
-+ inferior PTRACE_DETACH, SIGSTOP will ignore the signal. */
-+#endif
- target_detach (NULL, 0);
- }
-
-diff -Naurp insight-7.12.50.20170416.orig/gdb/linux-nat.c insight-7.12.50.20170416.new/gdb/linux-nat.c
---- insight-7.12.50.20170416.orig/gdb/linux-nat.c 2017-04-16 10:13:09.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/linux-nat.c 2017-04-16 12:21:43.941534340 +0100
-@@ -194,6 +194,11 @@ enum tribool have_ptrace_getregset = TRI
- static struct target_ops *linux_ops;
- static struct target_ops linux_ops_saved;
-
-+#ifdef NEED_DETACH_SIGSTOP
-+/* PID of the inferior stopped by SIGSTOP before attaching (or zero). */
-+static pid_t pid_was_stopped;
-+
-+#endif
- /* The method to call, if any, when a new thread is attached. */
- static void (*linux_nat_new_thread) (struct lwp_info *);
-
-@@ -1055,6 +1060,9 @@ linux_nat_post_attach_wait (ptid_t ptid,
- if (debug_linux_nat)
- fprintf_unfiltered (gdb_stdlog,
- "LNPAW: Attaching to a stopped process\n");
-+#ifdef NEED_DETACH_SIGSTOP
-+ pid_was_stopped = ptid_get_pid (ptid);
-+#endif
-
- /* The process is definitely stopped. It is in a job control
- stop, unless the kernel predates the TASK_STOPPED /
-@@ -1390,6 +1398,25 @@ get_detach_signal (struct lwp_info *lp)
- return gdb_signal_to_host (signo);
- }
-
-+#ifdef NEED_DETACH_SIGSTOP
-+ /* Workaround RHEL-5 kernel which has unreliable PTRACE_DETACH, SIGSTOP (that
-+ many TIDs are left unstopped). See RH Bug 496732. */
-+ if (ptid_get_pid (lp->ptid) == pid_was_stopped)
-+ {
-+ int err;
-+
-+ errno = 0;
-+ err = kill_lwp (ptid_get_lwp (lp->ptid), SIGSTOP);
-+ if (debug_linux_nat)
-+ {
-+ fprintf_unfiltered (gdb_stdlog,
-+ "SC: lwp kill %d %s\n",
-+ err,
-+ errno ? safe_strerror (errno) : "ERRNO-OK");
-+ }
-+ }
-+
-+#endif
- return 0;
- }
-
-@@ -1548,6 +1575,10 @@ linux_nat_detach (struct target_ops *ops
- detach_one_lwp (main_lwp, &signo);
-
- inf_ptrace_detach_success (ops);
-+
-+#ifdef NEED_DETACH_SIGSTOP
-+ pid_was_stopped = 0;
-+#endif
- }
- }
-
-@@ -1808,6 +1839,16 @@ linux_nat_resume (struct target_ops *ops
- return;
- }
-
-+#ifdef NEED_DETACH_SIGSTOP
-+ /* At this point, we are going to resume the inferior and if we
-+ have attached to a stopped process, we no longer should leave
-+ it as stopped if the user detaches. PTID variable has PID set to LWP
-+ while we need to check the real PID here. */
-+
-+ if (!step && lp && pid_was_stopped == ptid_get_pid (lp->ptid))
-+ pid_was_stopped = 0;
-+
-+#endif
- if (resume_many)
- iterate_over_lwps (ptid, linux_nat_resume_callback, lp);
-
-@@ -3804,6 +3845,10 @@ linux_nat_mourn_inferior (struct target_
-
- /* Let the arch-specific native code know this process is gone. */
- linux_nat_forget_process (pid);
-+#ifdef NEED_DETACH_SIGSTOP
-+
-+ pid_was_stopped = 0;
-+#endif
- }
-
- /* Convert a native/host siginfo object, into/from the siginfo in the
-diff -Naurp insight-7.12.50.20170416.orig/gdb/testsuite/gdb.threads/attach-stopped.exp insight-7.12.50.20170416.new/gdb/testsuite/gdb.threads/attach-stopped.exp
---- insight-7.12.50.20170416.orig/gdb/testsuite/gdb.threads/attach-stopped.exp 2017-01-03 17:36:55.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/testsuite/gdb.threads/attach-stopped.exp 2017-04-16 12:21:43.942534349 +0100
-@@ -56,7 +56,65 @@ proc corefunc { threadtype } {
- gdb_reinitialize_dir $srcdir/$subdir
- gdb_load ${binfile}
-
-- # Verify that we can attach to the stopped process.
-+ # Verify that we can attach to the process by first giving its
-+ # executable name via the file command, and using attach with the
-+ # process ID.
-+
-+ set test "$threadtype: set file, before attach1 to stopped process"
-+ gdb_test_multiple "file $binfile" "$test" {
-+ -re "Load new symbol table from.*y or n. $" {
-+ gdb_test "y" "Reading symbols from $escapedbinfile\.\.\.*done." \
-+ "$test (re-read)"
-+ }
-+ -re "Reading symbols from $escapedbinfile\.\.\.*done.*$gdb_prompt $" {
-+ pass "$test"
-+ }
-+ }
-+
-+ set test "$threadtype: attach1 to stopped, after setting file"
-+ gdb_test_multiple "attach $testpid" "$test" {
-+ -re "Attaching to program.*`?$escapedbinfile'?, process $testpid.*$gdb_prompt $" {
-+ pass "$test"
-+ }
-+ }
-+
-+ # ".*sleep.*clone.*" would fail on s390x as bt stops at START_THREAD there.
-+ if {[string equal $threadtype threaded]} {
-+ gdb_test "thread apply all bt" ".*sleep.*start_thread.*" "$threadtype: attach1 to stopped bt"
-+ } else {
-+ gdb_test "bt" ".*sleep.*main.*" "$threadtype: attach1 to stopped bt"
-+ }
-+
-+ # Exit and detach the process.
-+
-+ gdb_exit
-+
-+ # Avoid some race:
-+ sleep 2
-+
-+ if [catch {open /proc/${testpid}/status r} fileid] {
-+ set line2 "NOTFOUND"
-+ } else {
-+ gets $fileid line1;
-+ gets $fileid line2;
-+ close $fileid;
-+ }
-+
-+ set test "$threadtype: attach1, exit leaves process stopped"
-+ if {[string match "*(stopped)*" $line2]} {
-+ pass $test
-+ } else {
-+ fail $test
-+ }
-+
-+ # At this point, the process should still be stopped
-+
-+ gdb_start
-+ gdb_reinitialize_dir $srcdir/$subdir
-+ gdb_load ${binfile}
-+
-+ # Verify that we can attach to the process just by giving the
-+ # process ID.
-
- set test "$threadtype: attach2 to stopped, after setting file"
- gdb_test_multiple "attach $testpid" "$test" {
diff --git a/insight-7.12-gdb-archer-pie-addons-keep-disabled.patch b/insight-7.12-gdb-archer-pie-addons-keep-disabled.patch
deleted file mode 100644
index 371711b..0000000
--- a/insight-7.12-gdb-archer-pie-addons-keep-disabled.patch
+++ /dev/null
@@ -1,80 +0,0 @@
-diff -Naurp insight-7.12.50.20170416.orig/gdb/breakpoint.c insight-7.12.50.20170416.new/gdb/breakpoint.c
---- insight-7.12.50.20170416.orig/gdb/breakpoint.c 2017-04-15 01:21:12.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/breakpoint.c 2017-04-16 14:14:26.217661774 +0100
-@@ -16086,6 +16086,50 @@ initialize_breakpoint_ops (void)
- static struct cmd_list_element *enablebreaklist = NULL;
-
- void
-+breakpoints_relocate (struct objfile *objfile, struct section_offsets *delta)
-+{
-+ struct bp_location *bl, **blp_tmp;
-+ int changed = 0;
-+
-+ gdb_assert (objfile->separate_debug_objfile_backlink == NULL);
-+
-+ ALL_BP_LOCATIONS (bl, blp_tmp)
-+ {
-+ struct obj_section *osect;
-+
-+ /* BL->SECTION can be correctly NULL for breakpoints with multiple
-+ locations expanded through symtab. */
-+
-+ ALL_OBJFILE_OSECTIONS (objfile, osect)
-+ {
-+ CORE_ADDR relocated_address;
-+ CORE_ADDR delta_offset;
-+
-+ delta_offset = ANOFFSET (delta, osect->the_bfd_section->index);
-+ if (delta_offset == 0)
-+ continue;
-+ relocated_address = bl->address + delta_offset;
-+
-+ if (obj_section_addr (osect) <= relocated_address
-+ && relocated_address < obj_section_endaddr (osect))
-+ {
-+ if (bl->inserted)
-+ remove_breakpoint (bl);
-+
-+ bl->address += delta_offset;
-+ bl->requested_address += delta_offset;
-+
-+ changed = 1;
-+ }
-+ }
-+ }
-+
-+ if (changed)
-+ qsort (bp_locations, bp_locations_count, sizeof (*bp_locations),
-+ bp_locations_compare);
-+}
-+
-+void
- _initialize_breakpoint (void)
- {
- struct cmd_list_element *c;
-diff -Naurp insight-7.12.50.20170416.orig/gdb/breakpoint.h insight-7.12.50.20170416.new/gdb/breakpoint.h
---- insight-7.12.50.20170416.orig/gdb/breakpoint.h 2017-04-15 01:21:12.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/breakpoint.h 2017-04-16 14:02:21.816405874 +0100
-@@ -1646,4 +1646,7 @@ extern const char *ep_parse_optional_if_
- UIOUT iff debugging multiple threads. */
- extern void maybe_print_thread_hit_breakpoint (struct ui_out *uiout);
-
-+extern void breakpoints_relocate (struct objfile *objfile,
-+ struct section_offsets *delta);
-+
- #endif /* !defined (BREAKPOINT_H) */
-diff -Naurp insight-7.12.50.20170416.orig/gdb/objfiles.c insight-7.12.50.20170416.new/gdb/objfiles.c
---- insight-7.12.50.20170416.orig/gdb/objfiles.c 2017-04-09 01:11:01.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/objfiles.c 2017-04-16 14:02:21.817405883 +0100
-@@ -909,6 +909,11 @@ objfile_relocate1 (struct objfile *objfi
- obj_section_addr (s));
- }
-
-+ /* Final call of breakpoint_re_set can keep breakpoint locations disabled if
-+ their addresses match. */
-+ if (objfile->separate_debug_objfile_backlink == NULL)
-+ breakpoints_relocate (objfile, delta);
-+
- /* Data changed. */
- return 1;
- }
diff --git a/insight-7.12-gdb-archer.patch b/insight-7.12-gdb-archer.patch
deleted file mode 100644
index 4b4c57e..0000000
--- a/insight-7.12-gdb-archer.patch
+++ /dev/null
@@ -1,663 +0,0 @@
-diff -Naurp insight-7.12.50.20170416.orig/gdb/data-directory/Makefile.in insight-7.12.50.20170416.new/gdb/data-directory/Makefile.in
---- insight-7.12.50.20170416.orig/gdb/data-directory/Makefile.in 2017-01-03 17:36:55.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/data-directory/Makefile.in 2017-04-16 12:26:17.155076938 +0100
-@@ -77,7 +77,11 @@ PYTHON_FILE_LIST = \
- gdb/types.py \
- gdb/unwinder.py \
- gdb/xmethod.py \
-+ gdb/types.py \
- gdb/command/__init__.py \
-+ gdb/command/ignore_errors.py \
-+ gdb/command/pahole.py \
-+ gdb/command/xmethods.py \
- gdb/command/explore.py \
- gdb/command/frame_filters.py \
- gdb/command/pretty_printers.py \
-@@ -89,6 +93,8 @@ PYTHON_FILE_LIST = \
- gdb/function/as_string.py \
- gdb/function/caller_is.py \
- gdb/function/strfns.py \
-+ gdb/function/caller_is.py \
-+ gdb/function/in_scope.py \
- gdb/printer/__init__.py \
- gdb/printer/bound_registers.py
-
-diff -Naurp insight-7.12.50.20170416.orig/gdb/doc/gdb.texinfo insight-7.12.50.20170416.new/gdb/doc/gdb.texinfo
---- insight-7.12.50.20170416.orig/gdb/doc/gdb.texinfo 2017-04-16 12:25:21.689560997 +0100
-+++ insight-7.12.50.20170416.new/gdb/doc/gdb.texinfo 2017-04-16 12:26:17.163077013 +0100
-@@ -1236,6 +1236,16 @@ for remote debugging.
- Run using @var{device} for your program's standard input and output.
- @c FIXME: kingdon thinks there is more to -tty. Investigate.
-
-+@item -P
-+@cindex @code{-P}
-+@itemx --python
-+@cindex @code{--python}
-+Change interpretation of command line so that the argument immediately
-+following this switch is taken to be the name of a Python script file.
-+This option stops option processing; subsequent options are passed to
-+Python as @code{sys.argv}. This option is only available if Python
-+scripting support was enabled when @value{GDBN} was configured.
-+
- @c resolve the situation of these eventually
- @item -tui
- @cindex @code{--tui}
-diff -Naurp insight-7.12.50.20170416.orig/gdb/doc/python.texi insight-7.12.50.20170416.new/gdb/doc/python.texi
---- insight-7.12.50.20170416.orig/gdb/doc/python.texi 2017-03-25 10:42:37.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/doc/python.texi 2017-04-16 12:26:17.164077022 +0100
-@@ -88,8 +88,6 @@ containing @code{end}. For example:
-
- @smallexample
- (@value{GDBP}) python
--Type python script
--End with a line saying just "end".
- >print 23
- >end
- 23
-diff -Naurp insight-7.12.50.20170416.orig/gdb/gdb-gdb.gdb.in insight-7.12.50.20170416.new/gdb/gdb-gdb.gdb.in
---- insight-7.12.50.20170416.orig/gdb/gdb-gdb.gdb.in 2015-08-15 00:31:38.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/gdb-gdb.gdb.in 2017-04-16 12:26:17.164077022 +0100
-@@ -1,5 +1,15 @@
- echo Setting up the environment for debugging gdb.\n
-
-+# Set up the Python library and "require" command.
-+python
-+from os.path import abspath
-+gdb.datadir = abspath ('@srcdir@/python/lib')
-+gdb.pythonlibdir = gdb.datadir
-+gdb.__path__ = [gdb.datadir + '/gdb']
-+sys.path.insert(0, gdb.datadir)
-+end
-+source @srcdir(a)/python/lib/gdb/__init__.py
-+
- if !$gdb_init_done
- set variable $gdb_init_done = 1
-
-diff -Naurp insight-7.12.50.20170416.orig/gdb/main.c insight-7.12.50.20170416.new/gdb/main.c
---- insight-7.12.50.20170416.orig/gdb/main.c 2017-04-16 12:25:21.792561955 +0100
-+++ insight-7.12.50.20170416.new/gdb/main.c 2017-04-16 12:26:17.165077031 +0100
-@@ -33,6 +33,7 @@
-
- #include "interps.h"
- #include "main.h"
-+#include "python/python.h"
- #include "source.h"
- #include "cli/cli-cmds.h"
- #include "objfiles.h"
-@@ -490,7 +491,7 @@ exec_or_core_file_attach (const char *fi
- }
-
- static void
--captured_main_1 (struct captured_main_args *context)
-+captured_main_1 (struct captured_main_args *context, int &python_script)
- {
- int argc = context->argc;
- char **argv = context->argv;
-@@ -708,10 +709,14 @@ captured_main_1 (struct captured_main_ar
- {"args", no_argument, &set_args, 1},
- {"l", required_argument, 0, 'l'},
- {"return-child-result", no_argument, &return_child_result, 1},
-+#if HAVE_PYTHON
-+ {"python", no_argument, 0, 'P'},
-+ {"P", no_argument, 0, 'P'},
-+#endif
- {0, no_argument, 0, 0}
- };
-
-- while (1)
-+ while (!python_script)
- {
- int option_index;
-
-@@ -729,6 +734,9 @@ captured_main_1 (struct captured_main_ar
- case 0:
- /* Long option that just sets a flag. */
- break;
-+ case 'P':
-+ python_script = 1;
-+ break;
- case OPT_SE:
- symarg = optarg;
- execarg = optarg;
-@@ -887,7 +895,31 @@ captured_main_1 (struct captured_main_ar
-
- /* Now that gdb_init has created the initial inferior, we're in
- position to set args for that inferior. */
-- if (set_args)
-+ if (python_script)
-+ {
-+ /* The first argument is a python script to evaluate, and
-+ subsequent arguments are passed to the script for
-+ processing there. */
-+ if (optind >= argc)
-+ {
-+ fprintf_unfiltered (gdb_stderr,
-+ _("%s: Python script file name required\n"),
-+ argv[0]);
-+ exit (1);
-+ }
-+
-+ /* FIXME: should handle inferior I/O intelligently here.
-+ E.g., should be possible to run gdb in pipeline and have
-+ Python (and gdb) output go to stderr or file; and if a
-+ prompt is needed, open the tty. */
-+ quiet = 1;
-+ /* FIXME: should read .gdbinit if, and only if, a prompt is
-+ requested by the script. Though... maybe this is not
-+ ideal? */
-+ /* FIXME: likewise, reading in history. */
-+ inhibit_gdbinit = 1;
-+ }
-+ else if (set_args)
- {
- /* The remaining options are the command-line options for the
- inferior. The first one is the sym/exec file, and the rest
-@@ -1173,7 +1205,8 @@ captured_main_1 (struct captured_main_ar
-
- /* Read in the old history after all the command files have been
- read. */
-- init_history ();
-+ if (!python_script)
-+ init_history ();
-
- if (batch_flag)
- {
-@@ -1186,16 +1219,29 @@ static void
- captured_main (void *data)
- {
- struct captured_main_args *context = (struct captured_main_args *) data;
-+ int python_script = 0;
-
-- captured_main_1 (context);
-+ captured_main_1 (context, python_script);
-
-- /* NOTE: cagney/1999-11-07: There is probably no reason for not
-- moving this loop and the code found in captured_command_loop()
-- into the command_loop() proper. The main thing holding back that
-- change - SET_TOP_LEVEL() - has been eliminated. */
-- while (1)
-+#if HAVE_PYTHON
-+ if (python_script)
- {
-- catch_errors (captured_command_loop, 0, "", RETURN_MASK_ALL);
-+ extern int pagination_enabled;
-+ pagination_enabled = 0;
-+ run_python_script (context->argc - optind, &context->argv[optind]);
-+ return;
-+ }
-+ else
-+#endif
-+ {
-+ /* NOTE: cagney/1999-11-07: There is probably no reason for not
-+ moving this loop and the code found in captured_command_loop()
-+ into the command_loop() proper. The main thing holding back that
-+ change - SET_TOP_LEVEL() - has been eliminated. */
-+ while (1)
-+ {
-+ catch_errors (captured_command_loop, 0, "", RETURN_MASK_ALL);
-+ }
- }
- /* No exit -- exit is through quit_command. */
- }
-@@ -1238,6 +1284,12 @@ print_gdb_help (struct ui_file *stream)
- fputs_unfiltered (_("\
- This is the GNU debugger. Usage:\n\n\
- gdb [options] [executable-file [core-file or process-id]]\n\
-+ gdb [options] --args executable-file [inferior-arguments ...]\n"), stream);
-+#if HAVE_PYTHON
-+ fputs_unfiltered (_("\
-+ gdb [options] [--python|-P] script-file [script-arguments ...]\n"), stream);
-+#endif
-+ fputs_unfiltered (_("\n\
- gdb [options] --args executable-file [inferior-arguments ...]\n\n\
- "), stream);
- fputs_unfiltered (_("\
-@@ -1283,6 +1335,13 @@ Output and user interface control:\n\n\
- #endif
- fputs_unfiltered (_("\
- --dbx DBX compatibility mode.\n\
-+"), stream);
-+#if HAVE_PYTHON
-+ fputs_unfiltered (_("\
-+ --python, -P Following argument is Python script file; remaining\n\
-+ arguments are passed to script.\n"), stream);
-+#endif
-+ fputs_unfiltered (_("\
- -q, --quiet, --silent\n\
- Do not print version number on startup.\n\n\
- "), stream);
-diff -Naurp insight-7.12.50.20170416.orig/gdb/Makefile.in insight-7.12.50.20170416.new/gdb/Makefile.in
---- insight-7.12.50.20170416.orig/gdb/Makefile.in 2017-04-16 12:25:21.544559648 +0100
-+++ insight-7.12.50.20170416.new/gdb/Makefile.in 2017-04-16 12:26:17.155076938 +0100
-@@ -2379,6 +2379,12 @@ stamp-h: $(srcdir)/config.in config.stat
- CONFIG_LINKS= \
- $(SHELL) config.status
-
-+.gdbinit: $(srcdir)/gdbinit.in config.status
-+ CONFIG_FILES=".gdbinit:gdbinit.in" \
-+ CONFIG_COMMANDS= \
-+ CONFIG_HEADERS= \
-+ $(SHELL) config.status
-+
- config.status: $(srcdir)/configure configure.tgt configure.host ../bfd/development.sh
- $(SHELL) config.status --recheck
-
-diff -Naurp insight-7.12.50.20170416.orig/gdb/python/lib/gdb/command/ignore_errors.py insight-7.12.50.20170416.new/gdb/python/lib/gdb/command/ignore_errors.py
---- insight-7.12.50.20170416.orig/gdb/python/lib/gdb/command/ignore_errors.py 1970-01-01 01:00:00.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/python/lib/gdb/command/ignore_errors.py 2017-04-16 12:26:17.165077031 +0100
-@@ -0,0 +1,37 @@
-+# Ignore errors in user commands.
-+
-+# Copyright (C) 2008 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/>.
-+
-+import gdb
-+
-+class IgnoreErrorsCommand (gdb.Command):
-+ """Execute a single command, ignoring all errors.
-+Only one-line commands are supported.
-+This is primarily useful in scripts."""
-+
-+ def __init__ (self):
-+ super (IgnoreErrorsCommand, self).__init__ ("ignore-errors",
-+ gdb.COMMAND_OBSCURE,
-+ # FIXME...
-+ gdb.COMPLETE_COMMAND)
-+
-+ def invoke (self, arg, from_tty):
-+ try:
-+ gdb.execute (arg, from_tty)
-+ except:
-+ pass
-+
-+IgnoreErrorsCommand ()
-diff -Naurp insight-7.12.50.20170416.orig/gdb/python/lib/gdb/command/pahole.py insight-7.12.50.20170416.new/gdb/python/lib/gdb/command/pahole.py
---- insight-7.12.50.20170416.orig/gdb/python/lib/gdb/command/pahole.py 1970-01-01 01:00:00.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/python/lib/gdb/command/pahole.py 2017-04-16 12:26:17.165077031 +0100
-@@ -0,0 +1,81 @@
-+# pahole command for gdb
-+
-+# Copyright (C) 2008, 2009, 2012 Free Software Foundation, Inc.
-+
-+# This program is free software; you can redistribute it and/or modify
-+# it under the terms of the GNU General Public License as published by
-+# the Free Software Foundation; either version 3 of the License, or
-+# (at your option) any later version.
-+#
-+# This program is distributed in the hope that it will be useful,
-+# but WITHOUT ANY WARRANTY; without even the implied warranty of
-+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+# GNU General Public License for more details.
-+#
-+# You should have received a copy of the GNU General Public License
-+# along with this program. If not, see <http://www.gnu.org/licenses/>.
-+
-+import gdb
-+
-+class Pahole (gdb.Command):
-+ """Show the holes in a structure.
-+This command takes a single argument, a type name.
-+It prints the type and displays comments showing where holes are."""
-+
-+ def __init__ (self):
-+ super (Pahole, self).__init__ ("pahole", gdb.COMMAND_NONE,
-+ gdb.COMPLETE_SYMBOL)
-+
-+ def maybe_print_hole(self, bitpos, field_bitpos):
-+ if bitpos != field_bitpos:
-+ hole = field_bitpos - bitpos
-+ print (' /* XXX %d bit hole, try to pack */' % hole)
-+
-+ def pahole (self, type, level, name):
-+ if name is None:
-+ name = ''
-+ tag = type.tag
-+ if tag is None:
-+ tag = ''
-+ print ('%sstruct %s {' % (' ' * (2 * level), tag))
-+ bitpos = 0
-+ for field in type.fields ():
-+ # Skip static fields.
-+ if not hasattr (field, ('bitpos')):
-+ continue
-+
-+ ftype = field.type.strip_typedefs()
-+
-+ self.maybe_print_hole(bitpos, field.bitpos)
-+ bitpos = field.bitpos
-+ if field.bitsize > 0:
-+ fieldsize = field.bitsize
-+ else:
-+ # TARGET_CHAR_BIT here...
-+ fieldsize = 8 * ftype.sizeof
-+
-+ # TARGET_CHAR_BIT
-+ print (' /* %3d %3d */' % (int (bitpos / 8), int (fieldsize / 8)), end = "")
-+ bitpos = bitpos + fieldsize
-+
-+ if ftype.code == gdb.TYPE_CODE_STRUCT:
-+ self.pahole (ftype, level + 1, field.name)
-+ else:
-+ print (' ' * (2 + 2 * level), end = "")
-+ print ('%s %s' % (str (ftype), field.name))
-+
-+ if level == 0:
-+ self.maybe_print_hole(bitpos, 8 * type.sizeof)
-+
-+ print (' ' * (14 + 2 * level), end = "")
-+ print ('} %s' % name)
-+
-+ def invoke (self, arg, from_tty):
-+ type = gdb.lookup_type (arg)
-+ type = type.strip_typedefs ()
-+ if type.code != gdb.TYPE_CODE_STRUCT:
-+ raise (TypeError, '%s is not a struct type' % arg)
-+ print (' ' * 14, end = "")
-+ self.pahole (type, 0, '')
-+
-+Pahole()
-diff -Naurp insight-7.12.50.20170416.orig/gdb/python/lib/gdb/function/in_scope.py insight-7.12.50.20170416.new/gdb/python/lib/gdb/function/in_scope.py
---- insight-7.12.50.20170416.orig/gdb/python/lib/gdb/function/in_scope.py 1970-01-01 01:00:00.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/python/lib/gdb/function/in_scope.py 2017-04-16 12:26:17.165077031 +0100
-@@ -0,0 +1,47 @@
-+# In-scope function.
-+
-+# Copyright (C) 2008 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/>.
-+
-+import gdb
-+
-+class InScope (gdb.Function):
-+ """Return True if all the given variables or macros are in scope.
-+Takes one argument for each variable name to be checked."""
-+
-+ def __init__ (self):
-+ super (InScope, self).__init__ ("in_scope")
-+
-+ def invoke (self, *vars):
-+ if len (vars) == 0:
-+ raise (TypeError, "in_scope takes at least one argument")
-+
-+ # gdb.Value isn't hashable so it can't be put in a map.
-+ # Convert to string first.
-+ wanted = set (map (lambda x: x.string (), vars))
-+ found = set ()
-+ block = gdb.selected_frame ().block ()
-+ while block:
-+ for sym in block:
-+ if (sym.is_argument or sym.is_constant
-+ or sym.is_function or sym.is_variable):
-+ if sym.name in wanted:
-+ found.add (sym.name)
-+
-+ block = block.superblock
-+
-+ return wanted == found
-+
-+InScope ()
-diff -Naurp insight-7.12.50.20170416.orig/gdb/python/python.c insight-7.12.50.20170416.new/gdb/python/python.c
---- insight-7.12.50.20170416.orig/gdb/python/python.c 2017-04-16 10:13:09.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/python/python.c 2017-04-16 12:26:17.166077041 +0100
-@@ -95,6 +95,8 @@ const struct extension_language_defn ext
- #include "linespec.h"
- #include "source.h"
- #include "version.h"
-+#include "inferior.h"
-+#include "gdbthread.h"
- #include "target.h"
- #include "gdbthread.h"
- #include "interps.h"
-@@ -242,6 +244,29 @@ gdbpy_enter::~gdbpy_enter ()
- restore_active_ext_lang (m_previous_active);
- }
-
-+static void
-+restore_python_env (void *p)
-+{
-+ gdbpy_enter *env = (gdbpy_enter *) p;
-+
-+ delete env;
-+}
-+
-+/* Called before entering the Python interpreter to install the
-+ current language and architecture to be used for Python values.
-+ Also set the active extension language for GDB so that SIGINT's
-+ are directed our way, and if necessary install the right SIGINT
-+ handler. */
-+
-+struct cleanup *
-+ensure_python_env (struct gdbarch *gdbarch,
-+ const struct language_defn *language)
-+{
-+ gdbpy_enter *env = new gdbpy_enter (gdbarch, language);
-+
-+ return make_cleanup (restore_python_env, env);
-+}
-+
- /* Set the quit flag. */
-
- static void
-@@ -1187,6 +1212,92 @@ gdbpy_print_stack (void)
-
- /* Return the current Progspace.
- There always is one. */
-+/* True if 'gdb -P' was used, false otherwise. */
-+static int running_python_script;
-+
-+/* True if we are currently in a call to 'gdb.cli', false otherwise. */
-+static int in_cli;
-+
-+/* Enter the command loop. */
-+
-+static PyObject *
-+gdbpy_cli (PyObject *unused1, PyObject *unused2)
-+{
-+ if (! running_python_script || in_cli)
-+ return PyErr_Format (PyExc_RuntimeError, "cannot invoke CLI recursively");
-+
-+ if (current_uiout->is_mi_like_p ())
-+ return PyErr_Format (PyExc_RuntimeError, _("Cannot invoke CLI from MI."));
-+
-+ in_cli = 1;
-+ /* See captured_command_loop. */
-+
-+ /* Give the interpreter a chance to print a prompt. */
-+ interp_pre_command_loop (top_level_interpreter ());
-+
-+ /* Now it's time to start the event loop. */
-+ start_event_loop ();
-+
-+ in_cli = 0;
-+
-+ Py_RETURN_NONE;
-+}
-+
-+/* Set up the Python argument vector and evaluate a script. This is
-+ used to implement 'gdb -P'. */
-+
-+void
-+run_python_script (int argc, char **argv)
-+{
-+ FILE *input;
-+
-+ /* We never free this, since we plan to exit at the end. */
-+ ensure_python_env (get_current_arch (), current_language);
-+
-+ running_python_script = 1;
-+
-+#if PYTHON_ABI_VERSION < 3
-+ PySys_SetArgv (argc - 1, argv + 1);
-+#else
-+ {
-+ wchar_t **wargv = (wchar_t **) alloca (sizeof (*wargv) * (argc + 1));
-+ int i;
-+
-+ for (i = 1; i < argc; i++)
-+ {
-+ size_t len = mbstowcs (NULL, argv[i], 0);
-+ /* Python-related GDB sources are built with -DNDEBUG
-+ https://sourceware.org/bugzilla/show_bug.cgi?id=20445 */
-+ size_t len2 ATTRIBUTE_UNUSED;
-+
-+ if (len == (size_t) -1)
-+ {
-+ fprintf (stderr, "Invalid multibyte argument #%d \"%s\"\n",
-+ i, argv[i]);
-+ exit (1);
-+ }
-+ wargv[i] = (wchar_t *) alloca (sizeof (**wargv) * (len + 1));
-+ len2 = mbstowcs (wargv[i], argv[i], len + 1);
-+ assert (len2 == len);
-+ }
-+ wargv[argc] = NULL;
-+ PySys_SetArgv (argc - 1, wargv + 1);
-+ }
-+#endif
-+
-+ input = fopen (argv[0], "r");
-+ if (! input)
-+ {
-+ fprintf (stderr, "could not open %s: %s\n", argv[0], strerror (errno));
-+ exit (1);
-+ }
-+ PyRun_SimpleFile (input, argv[0]);
-+ fclose (input);
-+ exit (0);
-+}
-+
-+
-+
-
- static PyObject *
- gdbpy_get_current_progspace (PyObject *unused1, PyObject *unused2)
-@@ -1881,6 +1992,8 @@ PyMethodDef python_GdbMethods[] =
- Evaluate command, a string, as a gdb CLI command. Optionally returns\n\
- a Python String containing the output of the command if to_string is\n\
- set to True." },
-+ { "cli", gdbpy_cli, METH_NOARGS,
-+ "Enter the gdb CLI" },
- { "parameter", gdbpy_parameter, METH_VARARGS,
- "Return a gdb parameter's value" },
-
-diff -Naurp insight-7.12.50.20170416.orig/gdb/python/python.h insight-7.12.50.20170416.new/gdb/python/python.h
---- insight-7.12.50.20170416.orig/gdb/python/python.h 2017-01-03 17:36:55.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/python/python.h 2017-04-16 12:26:17.166077041 +0100
-@@ -25,4 +25,6 @@
- /* This is all that python exports to gdb. */
- extern const struct extension_language_defn extension_language_python;
-
-+extern void run_python_script (int argc, char **argv);
-+
- #endif /* GDB_PYTHON_H */
-diff -Naurp insight-7.12.50.20170416.orig/gdb/python/python-internal.h insight-7.12.50.20170416.new/gdb/python/python-internal.h
---- insight-7.12.50.20170416.orig/gdb/python/python-internal.h 2017-04-09 01:11:01.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/python/python-internal.h 2017-04-16 12:26:17.166077041 +0100
-@@ -672,6 +672,9 @@ class gdbpy_enter_varobj : public gdbpy_
-
- };
-
-+struct cleanup *ensure_python_env (struct gdbarch *gdbarch,
-+ const struct language_defn *language);
-+
- extern struct gdbarch *python_gdbarch;
- extern const struct language_defn *python_language;
-
-diff -Naurp insight-7.12.50.20170416.orig/gdb/testsuite/gdb.python/py-frame.exp insight-7.12.50.20170416.new/gdb/testsuite/gdb.python/py-frame.exp
---- insight-7.12.50.20170416.orig/gdb/testsuite/gdb.python/py-frame.exp 2017-01-03 17:36:55.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/testsuite/gdb.python/py-frame.exp 2017-04-16 12:26:17.166077041 +0100
-@@ -95,6 +95,8 @@ gdb_test "python print ('result = %s' %
-
- gdb_test "python print ('result = %s' % (gdb.selected_frame () == f1))" " = True" "test gdb.selected_frame"
-
-+gdb_test "python print ('result = %s' % (f0.block ()))" "<gdb.Block object at 0x\[\[:xdigit:\]\]+>" "test Frame.block"
-+
- # Can read SP register.
- gdb_test "python print ('result = %s' % (gdb.selected_frame ().read_register ('sp') == gdb.parse_and_eval ('\$sp')))" \
- " = True" \
-diff -Naurp insight-7.12.50.20170416.orig/gdb/testsuite/gdb.python/py-value.exp insight-7.12.50.20170416.new/gdb/testsuite/gdb.python/py-value.exp
---- insight-7.12.50.20170416.orig/gdb/testsuite/gdb.python/py-value.exp 2017-03-18 01:22:31.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/testsuite/gdb.python/py-value.exp 2017-04-16 12:26:17.166077041 +0100
-@@ -384,6 +384,15 @@ proc test_value_after_death {} {
- "print value's type"
- }
-
-+# Regression test for a cast failure. The bug was that if we cast a
-+# value to its own type, gdb could crash. This happened because we
-+# could end up double-freeing a struct value.
-+proc test_cast_regression {} {
-+ gdb_test "python v = gdb.Value(5)" "" "create value for cast test"
-+ gdb_test "python v = v.cast(v.type)" "" "cast value for cast test"
-+ gdb_test "python print(v)" "5" "print value for cast test"
-+}
-+
- # Regression test for invalid subscript operations. The bug was that
- # the type of the value was not being checked before allowing a
- # subscript operation to proceed.
-@@ -512,6 +521,7 @@ if ![runto_main] then {
- test_value_in_inferior
- test_inferior_function_call
- test_value_after_death
-+test_cast_regression
-
- # Test either C or C++ values.
-
-diff -Naurp insight-7.12.50.20170416.orig/gdb/varobj.c insight-7.12.50.20170416.new/gdb/varobj.c
---- insight-7.12.50.20170416.orig/gdb/varobj.c 2017-04-09 01:11:01.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/varobj.c 2017-04-16 12:26:17.167077050 +0100
-@@ -226,6 +226,14 @@ is_root_p (const struct varobj *var)
- }
-
- #ifdef HAVE_PYTHON
-+/* Helper function to install a Python environment suitable for
-+ use during operations on VAR. */
-+struct cleanup *
-+varobj_ensure_python_env (const struct varobj *var)
-+{
-+ return ensure_python_env (var->root->exp->gdbarch,
-+ var->root->exp->language_defn);
-+}
-
- /* See python-internal.h. */
- gdbpy_enter_varobj::gdbpy_enter_varobj (const struct varobj *var)
-diff -Naurp insight-7.12.50.20170416.orig/gdb/varobj.h insight-7.12.50.20170416.new/gdb/varobj.h
---- insight-7.12.50.20170416.orig/gdb/varobj.h 2017-04-09 01:11:01.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/varobj.h 2017-04-16 12:26:17.167077050 +0100
-@@ -320,6 +320,8 @@ extern int varobj_has_more (const struct
-
- extern int varobj_is_dynamic_p (const struct varobj *var);
-
-+extern struct cleanup *varobj_ensure_python_env (const struct varobj *var);
-+
- extern int varobj_default_value_is_changeable_p (const struct varobj *var);
- extern int varobj_value_is_changeable_p (const struct varobj *var);
-
-diff -Naurp insight-7.12.50.20170416.orig/README.archer insight-7.12.50.20170416.new/README.archer
---- insight-7.12.50.20170416.orig/README.archer 1970-01-01 01:00:00.000000000 +0100
-+++ insight-7.12.50.20170416.new/README.archer 2017-04-16 12:26:17.154076929 +0100
-@@ -0,0 +1,2 @@
-+This branch originally held the Python code for gdb. It still exists
-+because a small amount of code here has not yet been merged upstream.
diff --git a/insight-7.12-gdb-fedora-libncursesw.patch b/insight-7.12-gdb-fedora-libncursesw.patch
deleted file mode 100644
index 5e7aa46..0000000
--- a/insight-7.12-gdb-fedora-libncursesw.patch
+++ /dev/null
@@ -1,60 +0,0 @@
-diff -Naurp insight-7.12.50.20170416.orig/gdb/configure insight-7.12.50.20170416.new/gdb/configure
---- insight-7.12.50.20170416.orig/gdb/configure 2017-04-16 13:35:12.113725974 +0100
-+++ insight-7.12.50.20170416.new/gdb/configure 2017-04-16 13:36:16.306314191 +0100
-@@ -9359,6 +9359,7 @@ if test x"$prefer_curses" = xyes; then
- # search /usr/local/include, if ncurses is installed in /usr/local. A
- # default installation of ncurses on alpha*-dec-osf* will lead to such
- # a situation.
-+ # Fedora: Force libncursesw over libncurses to match the includes.
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing waddstr" >&5
- $as_echo_n "checking for library containing waddstr... " >&6; }
- if ${ac_cv_search_waddstr+:} false; then :
-@@ -9383,7 +9384,7 @@ return waddstr ();
- return 0;
- }
- _ACEOF
--for ac_lib in '' ncurses cursesX curses; do
-+for ac_lib in '' ncursesw; do
- if test -z "$ac_lib"; then
- ac_res="none required"
- else
-@@ -9457,6 +9458,7 @@ case $host_os in
- esac
-
- # These are the libraries checked by Readline.
-+# Fedora: Force libncursesw over libncurses to match the includes.
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing tgetent" >&5
- $as_echo_n "checking for library containing tgetent... " >&6; }
- if ${ac_cv_search_tgetent+:} false; then :
-@@ -9481,7 +9483,7 @@ return tgetent ();
- return 0;
- }
- _ACEOF
--for ac_lib in '' termcap tinfo curses ncurses; do
-+for ac_lib in '' termcap tinfo ncursesw; do
- if test -z "$ac_lib"; then
- ac_res="none required"
- else
-diff -Naurp insight-7.12.50.20170416.orig/gdb/configure.ac insight-7.12.50.20170416.new/gdb/configure.ac
---- insight-7.12.50.20170416.orig/gdb/configure.ac 2017-04-16 13:35:12.113725974 +0100
-+++ insight-7.12.50.20170416.new/gdb/configure.ac 2017-04-16 13:36:16.307314200 +0100
-@@ -762,7 +762,8 @@ if test x"$prefer_curses" = xyes; then
- # search /usr/local/include, if ncurses is installed in /usr/local. A
- # default installation of ncurses on alpha*-dec-osf* will lead to such
- # a situation.
-- AC_SEARCH_LIBS(waddstr, [ncurses cursesX curses])
-+ # Fedora: Force libncursesw over libncurses to match the includes.
-+ AC_SEARCH_LIBS(waddstr, [ncursesw])
-
- if test "$ac_cv_search_waddstr" != no; then
- curses_found=yes
-@@ -804,7 +805,8 @@ case $host_os in
- esac
-
- # These are the libraries checked by Readline.
--AC_SEARCH_LIBS(tgetent, [termcap tinfo curses ncurses])
-+# Fedora: Force libncursesw over libncurses to match the includes.
-+AC_SEARCH_LIBS(tgetent, [termcap tinfo ncursesw])
-
- if test "$ac_cv_search_tgetent" = no; then
- CONFIG_OBS="$CONFIG_OBS stub-termcap.o"
diff --git a/insight-7.12-gdb-python-gil.patch b/insight-7.12-gdb-python-gil.patch
deleted file mode 100644
index 4c41efe..0000000
--- a/insight-7.12-gdb-python-gil.patch
+++ /dev/null
@@ -1,230 +0,0 @@
-diff -Naurp insight-7.12.50.20170416.orig/gdb/doc/python.texi insight-7.12.50.20170416.new/gdb/doc/python.texi
---- insight-7.12.50.20170416.orig/gdb/doc/python.texi 2017-04-16 13:26:46.610227059 +0100
-+++ insight-7.12.50.20170416.new/gdb/doc/python.texi 2017-04-16 13:27:34.573643843 +0100
-@@ -230,6 +230,14 @@ returned as a string. The default is @c
- return value is @code{None}. If @var{to_string} is @code{True}, the
- @value{GDBN} virtual terminal will be temporarily set to unlimited width
- and height, and its pagination will be disabled; @pxref{Screen Size}.
-+
-+The @var{release_gil} flag specifies whether @value{GDBN} ought to
-+release the Python GIL before executing the command. This is useful
-+in multi-threaded Python programs where by default the Python
-+interpreter will acquire the GIL and lock other threads from
-+executing. After the command has completed executing in @value{GDBN}
-+the Python GIL is reacquired. This flag must be a boolean value. If
-+omitted, it defaults to @code{False}.
- @end defun
-
- @findex gdb.breakpoints
-diff -Naurp insight-7.12.50.20170416.orig/gdb/python/python.c insight-7.12.50.20170416.new/gdb/python/python.c
---- insight-7.12.50.20170416.orig/gdb/python/python.c 2017-04-16 13:26:46.612227077 +0100
-+++ insight-7.12.50.20170416.new/gdb/python/python.c 2017-04-16 13:31:19.962602386 +0100
-@@ -594,12 +594,16 @@ execute_gdb_command (PyObject *self, PyO
- {
- const char *arg;
- PyObject *from_tty_obj = NULL, *to_string_obj = NULL;
-- int from_tty, to_string;
-- static const char *keywords[] = { "command", "from_tty", "to_string", NULL };
-+ int from_tty, to_string, release_gil;
-+ static const char *keywords[] = { "command", "from_tty", "to_string", "release_gil", NULL };
-+ PyObject *release_gil_obj = NULL;
-+ /* Initialize it just to avoid a GCC false warning. */
-+ PyThreadState *state = NULL;
-
-- if (!gdb_PyArg_ParseTupleAndKeywords (args, kw, "s|O!O!", keywords, &arg,
-+ if (!gdb_PyArg_ParseTupleAndKeywords (args, kw, "s|O!O!O!", keywords, &arg,
- &PyBool_Type, &from_tty_obj,
-- &PyBool_Type, &to_string_obj))
-+ &PyBool_Type, &to_string_obj,
-+ &PyBool_Type, &release_gil_obj))
- return NULL;
-
- from_tty = 0;
-@@ -620,6 +624,15 @@ execute_gdb_command (PyObject *self, PyO
- to_string = cmp;
- }
-
-+ release_gil = 0;
-+ if (release_gil_obj)
-+ {
-+ int cmp = PyObject_IsTrue (release_gil_obj);
-+ if (cmp < 0)
-+ return NULL;
-+ release_gil = cmp;
-+ }
-+
- std::string to_string_res;
-
- TRY
-@@ -628,6 +641,13 @@ execute_gdb_command (PyObject *self, PyO
- std::string copy (arg);
- struct interp *interp;
-
-+ /* In the case of long running GDB commands, allow the user to
-+ release the Python GIL acquired by Python. Restore the GIL
-+ after the command has completed before handing back to
-+ Python. */
-+ if (release_gil)
-+ state = PyEval_SaveThread();
-+
- scoped_restore save_async = make_scoped_restore (¤t_ui->async, 0);
-
- scoped_restore save_uiout = make_scoped_restore (¤t_uiout);
-@@ -642,10 +662,22 @@ execute_gdb_command (PyObject *self, PyO
- to_string_res = execute_command_to_string (©[0], from_tty);
- else
- execute_command (©[0], from_tty);
-+
-+ /* Reacquire the GIL if it was released earlier. */
-+ if (release_gil)
-+ PyEval_RestoreThread (state);
- }
- CATCH (except, RETURN_MASK_ALL)
- {
-- GDB_PY_HANDLE_EXCEPTION (except);
-+ if (except.reason < 0)
-+ {
-+ /* Reacquire the GIL if it was released earlier. */
-+ if (release_gil)
-+ PyEval_RestoreThread (state);
-+
-+ gdbpy_convert_exception (except);
-+ return NULL;
-+ }
- }
- END_CATCH
-
-diff -Naurp insight-7.12.50.20170416.orig/gdb/python/python-internal.h insight-7.12.50.20170416.new/gdb/python/python-internal.h
---- insight-7.12.50.20170416.orig/gdb/python/python-internal.h 2017-04-16 13:26:46.612227077 +0100
-+++ insight-7.12.50.20170416.new/gdb/python/python-internal.h 2017-04-16 13:27:34.573643843 +0100
-@@ -142,6 +142,8 @@ typedef int Py_ssize_t;
- #define PyGILState_Release(ARG) ((void)(ARG))
- #define PyEval_InitThreads()
- #define PyThreadState_Swap(ARG) ((void)(ARG))
-+#define PyEval_SaveThread() ((void)(ARG))
-+#define PyEval_RestoreThread(ARG) ((void)(ARG))
- #define PyEval_ReleaseLock()
- #endif
-
-diff -Naurp insight-7.12.50.20170416.orig/gdb/testsuite/gdb.python/py-gil-mthread.c insight-7.12.50.20170416.new/gdb/testsuite/gdb.python/py-gil-mthread.c
---- insight-7.12.50.20170416.orig/gdb/testsuite/gdb.python/py-gil-mthread.c 1970-01-01 01:00:00.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/testsuite/gdb.python/py-gil-mthread.c 2017-04-16 13:27:34.574643851 +0100
-@@ -0,0 +1,13 @@
-+#include <stdio.h>
-+#include <unistd.h>
-+
-+int
-+main (void)
-+{
-+ int i;
-+ for (i = 0; i < 10; i++)
-+ {
-+ sleep (1); /* break-here */
-+ printf ("Sleeping %d\n", i);
-+ }
-+}
-diff -Naurp insight-7.12.50.20170416.orig/gdb/testsuite/gdb.python/py-gil-mthread.exp insight-7.12.50.20170416.new/gdb/testsuite/gdb.python/py-gil-mthread.exp
---- insight-7.12.50.20170416.orig/gdb/testsuite/gdb.python/py-gil-mthread.exp 1970-01-01 01:00:00.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/testsuite/gdb.python/py-gil-mthread.exp 2017-04-16 13:27:34.574643851 +0100
-@@ -0,0 +1,69 @@
-+# Copyright (C) 2014 Free Software Foundation, Inc.
-+
-+# This program is free software; you can redistribute it and/or modify
-+# it under the terms of the GNU General Public License as published by
-+# the Free Software Foundation; either version 3 of the License, or
-+# (at your option) any later version.
-+#
-+# This program is distributed in the hope that it will be useful,
-+# but WITHOUT ANY WARRANTY; without even the implied warranty of
-+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+# GNU General Public License for more details.
-+#
-+# You should have received a copy of the GNU General Public License
-+# along with this program. If not, see <http://www.gnu.org/licenses/>.
-+
-+standard_testfile .c .py
-+set executable $testfile
-+
-+if { [prepare_for_testing $testfile.exp $executable $srcfile] } {
-+ return -1
-+}
-+
-+# Skip all tests if Python scripting is not enabled.
-+if { [skip_python_tests] } { continue }
-+
-+if ![runto_main] {
-+ return -1
-+}
-+
-+gdb_breakpoint $srcfile:[gdb_get_line_number "break-here"] temporary
-+gdb_continue_to_breakpoint "break-here" ".* break-here .*"
-+
-+set test "response"
-+set timeout 60
-+set sleeping_last -1
-+set hello_last 0
-+set minimal 5
-+gdb_test_multiple "python exec (open ('$srcdir/$subdir/$srcfile2').read ())" $test {
-+ -re "Error: unable to start thread\r\n" {
-+ fail $test
-+ # Not $gdb_prompt-synced!
-+ }
-+ -re "Sleeping (\[0-9\]+)\r\n" {
-+ set n $expect_out(1,string)
-+ if { $sleeping_last + 1 != $n } {
-+ fail $test
-+ } else {
-+ set sleeping_last $n
-+ if { $sleeping_last >= $minimal && $hello_last >= $minimal } {
-+ pass $test
-+ } else {
-+ exp_continue
-+ }
-+ }
-+ }
-+ -re "Hello \\( (\[0-9\]+) \\)\r\n" {
-+ set n $expect_out(1,string)
-+ if { $hello_last + 1 != $n } {
-+ fail $test
-+ } else {
-+ set hello_last $n
-+ if { $sleeping_last >= $minimal && $hello_last >= $minimal } {
-+ pass $test
-+ } else {
-+ exp_continue
-+ }
-+ }
-+ }
-+}
-diff -Naurp insight-7.12.50.20170416.orig/gdb/testsuite/gdb.python/py-gil-mthread.py insight-7.12.50.20170416.new/gdb/testsuite/gdb.python/py-gil-mthread.py
---- insight-7.12.50.20170416.orig/gdb/testsuite/gdb.python/py-gil-mthread.py 1970-01-01 01:00:00.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/testsuite/gdb.python/py-gil-mthread.py 2017-04-16 13:27:34.574643851 +0100
-@@ -0,0 +1,28 @@
-+try:
-+ import thread
-+except:
-+ import _thread
-+import time
-+import gdb
-+
-+# Define a function for the thread
-+def print_thread_hello():
-+ count = 0
-+ while count < 10:
-+ time.sleep(1)
-+ count += 1
-+ print ("Hello ( %d )" % count)
-+
-+# Create a threads a continue
-+try:
-+ thread.start_new_thread (print_thread_hello, ())
-+ gdb.execute ("continue", release_gil=True)
-+except:
-+ try:
-+ _thread.start_new_thread (print_thread_hello, ())
-+ gdb.execute ("continue", release_gil=True)
-+ except:
-+ print ("Error: unable to start thread")
-+
-+while 1:
-+ pass
diff --git a/insight-7.12-gdb-rhbz795424-bitpos-20of25.patch b/insight-7.12-gdb-rhbz795424-bitpos-20of25.patch
deleted file mode 100644
index 6b22704..0000000
--- a/insight-7.12-gdb-rhbz795424-bitpos-20of25.patch
+++ /dev/null
@@ -1,2887 +0,0 @@
-diff -Naurp insight-7.12.50.20170416.orig/gdb/aarch64-linux-nat.c insight-7.12.50.20170416.new/gdb/aarch64-linux-nat.c
---- insight-7.12.50.20170416.orig/gdb/aarch64-linux-nat.c 2017-03-18 01:22:31.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/aarch64-linux-nat.c 2017-04-16 12:29:51.472070521 +0100
-@@ -708,7 +708,7 @@ aarch64_linux_remove_watchpoint (struct
-
- static int
- aarch64_linux_region_ok_for_hw_watchpoint (struct target_ops *self,
-- CORE_ADDR addr, int len)
-+ CORE_ADDR addr, LONGEST len)
- {
- return aarch64_linux_region_ok_for_watchpoint (addr, len);
- }
-diff -Naurp insight-7.12.50.20170416.orig/gdb/ada-lang.c insight-7.12.50.20170416.new/gdb/ada-lang.c
---- insight-7.12.50.20170416.orig/gdb/ada-lang.c 2017-04-09 01:11:01.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/ada-lang.c 2017-04-16 12:29:51.435070177 +0100
-@@ -76,7 +76,7 @@ static struct type *desc_bounds_type (st
-
- static struct value *desc_bounds (struct value *);
-
--static int fat_pntr_bounds_bitpos (struct type *);
-+static LONGEST fat_pntr_bounds_bitpos (struct type *);
-
- static int fat_pntr_bounds_bitsize (struct type *);
-
-@@ -84,13 +84,13 @@ static struct type *desc_data_target_typ
-
- static struct value *desc_data (struct value *);
-
--static int fat_pntr_data_bitpos (struct type *);
-+static LONGEST fat_pntr_data_bitpos (struct type *);
-
- static int fat_pntr_data_bitsize (struct type *);
-
- static struct value *desc_one_bound (struct value *, int, int);
-
--static int desc_bound_bitpos (struct type *, int, int);
-+static LONGEST desc_bound_bitpos (struct type *, int, int);
-
- static int desc_bound_bitsize (struct type *, int, int);
-
-@@ -173,7 +173,7 @@ static struct type *static_unwrap_type (
-
- static struct value *unwrap_value (struct value *);
-
--static struct type *constrained_packed_array_type (struct type *, long *);
-+static struct type *constrained_packed_array_type (struct type *, LONGEST *);
-
- static struct type *decode_constrained_packed_array_type (struct type *);
-
-@@ -188,7 +188,8 @@ static int ada_is_unconstrained_packed_a
- static struct value *value_subscript_packed (struct value *, int,
- struct value **);
-
--static void move_bits (gdb_byte *, int, const gdb_byte *, int, int, int);
-+static void move_bits (gdb_byte *, int, const gdb_byte *, LONGEST, LONGEST,
-+ int);
-
- static struct value *coerce_unspec_val_to_type (struct value *,
- struct type *);
-@@ -216,14 +217,14 @@ static struct value *value_val_atr (stru
- static struct symbol *standard_lookup (const char *, const struct block *,
- domain_enum);
-
--static struct value *ada_search_struct_field (const char *, struct value *, int,
-+static struct value *ada_search_struct_field (const char *, struct value *, LONGEST,
- struct type *);
-
--static struct value *ada_value_primitive_field (struct value *, int, int,
-+static struct value *ada_value_primitive_field (struct value *, LONGEST, int,
- struct type *);
-
--static int find_struct_field (const char *, struct type *, int,
-- struct type **, int *, int *, int *, int *);
-+static int find_struct_field (const char *, struct type *, LONGEST,
-+ struct type **, LONGEST *, int *, int *, int *);
-
- static struct value *ada_to_fixed_value_create (struct type *, CORE_ADDR,
- struct value *);
-@@ -237,7 +238,7 @@ static int ada_is_direct_array_type (str
- static void ada_language_arch_info (struct gdbarch *,
- struct language_arch_info *);
-
--static struct value *ada_index_struct_field (int, struct value *, int,
-+static struct value *ada_index_struct_field (LONGEST, struct value *, LONGEST,
- struct type *);
-
- static struct value *assign_aggregate (struct value *, struct value *,
-@@ -699,7 +700,7 @@ coerce_unspec_val_to_type (struct value
- }
-
- static const gdb_byte *
--cond_offset_host (const gdb_byte *valaddr, long offset)
-+cond_offset_host (const gdb_byte *valaddr, LONGEST offset)
- {
- if (valaddr == NULL)
- return NULL;
-@@ -708,7 +709,7 @@ cond_offset_host (const gdb_byte *valadd
- }
-
- static CORE_ADDR
--cond_offset_target (CORE_ADDR address, long offset)
-+cond_offset_target (CORE_ADDR address, LONGEST offset)
- {
- if (address == 0)
- return 0;
-@@ -1755,7 +1756,7 @@ desc_bounds (struct value *arr)
- /* If TYPE is the type of an array-descriptor (fat pointer), the bit
- position of the field containing the address of the bounds data. */
-
--static int
-+static LONGEST
- fat_pntr_bounds_bitpos (struct type *type)
- {
- return TYPE_FIELD_BITPOS (desc_base_type (type), 1);
-@@ -1821,7 +1822,7 @@ desc_data (struct value *arr)
- /* If TYPE is the type of an array-descriptor (fat pointer), the bit
- position of the field containing the address of the data. */
-
--static int
-+static LONGEST
- fat_pntr_data_bitpos (struct type *type)
- {
- return TYPE_FIELD_BITPOS (desc_base_type (type), 0);
-@@ -1856,7 +1857,7 @@ desc_one_bound (struct value *bounds, in
- of the Ith lower bound stored in it, if WHICH is 0, and the Ith upper
- bound, if WHICH is 1. The first bound is I=1. */
-
--static int
-+static LONGEST
- desc_bound_bitpos (struct type *type, int i, int which)
- {
- return TYPE_FIELD_BITPOS (desc_base_type (type), 2 * i + which - 2);
-@@ -2046,7 +2047,7 @@ ada_type_of_array (struct value *arr, in
- zero, and does not need to be recomputed. */
- if (lo < hi)
- {
-- int array_bitsize =
-+ LONGEST array_bitsize =
- (hi - lo + 1) * TYPE_FIELD_BITSIZE (elt_type, 0);
-
- TYPE_LENGTH (array_type) = (array_bitsize + 7) / 8;
-@@ -2206,7 +2207,7 @@ decode_packed_array_bitsize (struct type
- the length is arbitrary. */
-
- static struct type *
--constrained_packed_array_type (struct type *type, long *elt_bits)
-+constrained_packed_array_type (struct type *type, LONGEST *elt_bits)
- {
- struct type *new_elt_type;
- struct type *new_type;
-@@ -2260,7 +2261,7 @@ decode_constrained_packed_array_type (st
- char *name;
- const char *tail;
- struct type *shadow_type;
-- long bits;
-+ LONGEST bits;
-
- if (!raw_name)
- raw_name = ada_type_name (desc_base_type (type));
-@@ -2331,7 +2332,8 @@ decode_constrained_packed_array (struct
- array with no wrapper. In order to interpret the value through
- the (left-justified) packed array type we just built, we must
- first left-justify it. */
-- int bit_size, bit_pos;
-+ int bit_size;
-+ LONGEST bit_pos;
- ULONGEST mod;
-
- mod = ada_modulus (value_type (arr)) - 1;
-@@ -2559,7 +2561,7 @@ ada_unpack_from_contents (const gdb_byte
-
- struct value *
- ada_value_primitive_packed_val (struct value *obj, const gdb_byte *valaddr,
-- long offset, int bit_offset, int bit_size,
-+ LONGEST offset, int bit_offset, int bit_size,
- struct type *type)
- {
- struct value *v;
-@@ -2630,7 +2632,7 @@ ada_value_primitive_packed_val (struct v
-
- if (obj != NULL)
- {
-- long new_offset = offset;
-+ LONGEST new_offset = offset;
-
- set_value_component_location (v, obj);
- set_value_bitpos (v, bit_offset + value_bitpos (obj));
-@@ -2676,7 +2678,7 @@ ada_value_primitive_packed_val (struct v
- not overlap. */
- static void
- move_bits (gdb_byte *target, int targ_offset, const gdb_byte *source,
-- int src_offset, int n, int bits_big_endian_p)
-+ LONGEST src_offset, LONGEST n, int bits_big_endian_p)
- {
- unsigned int accum, mask;
- int accum_bits, chunk_size;
-@@ -2766,7 +2768,7 @@ ada_value_assign (struct value *toval, s
- {
- int len = (value_bitpos (toval)
- + bits + HOST_CHAR_BIT - 1) / HOST_CHAR_BIT;
-- int from_size;
-+ LONGEST from_size;
- gdb_byte *buffer = (gdb_byte *) alloca (len);
- struct value *val;
- CORE_ADDR to_addr = value_address (toval);
-@@ -2817,7 +2819,7 @@ value_assign_to_component (struct value
- (LONGEST) (value_address (component) - value_address (container));
- int bit_offset_in_container =
- value_bitpos (component) - value_bitpos (container);
-- int bits;
-+ LONGEST bits;
-
- val = value_cast (value_type (component), val);
-
-@@ -4468,7 +4470,7 @@ ensure_lval (struct value *val)
- if (VALUE_LVAL (val) == not_lval
- || VALUE_LVAL (val) == lval_internalvar)
- {
-- int len = TYPE_LENGTH (ada_check_typedef (value_type (val)));
-+ LONGEST len = TYPE_LENGTH (ada_check_typedef (value_type (val)));
- const CORE_ADDR addr =
- value_as_long (value_allocate_space_in_inferior (len));
-
-@@ -4552,7 +4554,7 @@ static CORE_ADDR
- value_pointer (struct value *value, struct type *type)
- {
- struct gdbarch *gdbarch = get_type_arch (type);
-- unsigned len = TYPE_LENGTH (type);
-+ ULONGEST len = TYPE_LENGTH (type);
- gdb_byte *buf = (gdb_byte *) alloca (len);
- CORE_ADDR addr;
-
-@@ -6752,7 +6754,7 @@ value_tag_from_contents_and_address (str
- const gdb_byte *valaddr,
- CORE_ADDR address)
- {
-- int tag_byte_offset;
-+ LONGEST tag_byte_offset;
- struct type *tag_type;
-
- if (find_struct_field ("_tag", type, 0, &tag_type, &tag_byte_offset,
-@@ -7233,7 +7235,7 @@ ada_in_variant (LONGEST val, struct type
- only in that it can handle packed values of arbitrary type. */
-
- static struct value *
--ada_value_primitive_field (struct value *arg1, int offset, int fieldno,
-+ada_value_primitive_field (struct value *arg1, LONGEST offset, int fieldno,
- struct type *arg_type)
- {
- struct type *type;
-@@ -7245,7 +7247,7 @@ ada_value_primitive_field (struct value
-
- if (TYPE_FIELD_BITSIZE (arg_type, fieldno) != 0)
- {
-- int bit_pos = TYPE_FIELD_BITPOS (arg_type, fieldno);
-+ LONGEST bit_pos = TYPE_FIELD_BITPOS (arg_type, fieldno);
- int bit_size = TYPE_FIELD_BITSIZE (arg_type, fieldno);
-
- return ada_value_primitive_packed_val (arg1, value_contents (arg1),
-@@ -7272,9 +7274,9 @@ ada_value_primitive_field (struct value
- Returns 1 if found, 0 otherwise. */
-
- static int
--find_struct_field (const char *name, struct type *type, int offset,
-+find_struct_field (const char *name, struct type *type, LONGEST offset,
- struct type **field_type_p,
-- int *byte_offset_p, int *bit_offset_p, int *bit_size_p,
-+ LONGEST *byte_offset_p, int *bit_offset_p, int *bit_size_p,
- int *index_p)
- {
- int i;
-@@ -7292,8 +7294,8 @@ find_struct_field (const char *name, str
-
- for (i = 0; i < TYPE_NFIELDS (type); i += 1)
- {
-- int bit_pos = TYPE_FIELD_BITPOS (type, i);
-- int fld_offset = offset + bit_pos / 8;
-+ LONGEST bit_pos = TYPE_FIELD_BITPOS (type, i);
-+ LONGEST fld_offset = offset + bit_pos / 8;
- const char *t_field_name = TYPE_FIELD_NAME (type, i);
-
- if (t_field_name == NULL)
-@@ -7363,7 +7365,7 @@ num_visible_fields (struct type *type)
- Searches recursively through wrapper fields (e.g., '_parent'). */
-
- static struct value *
--ada_search_struct_field (const char *name, struct value *arg, int offset,
-+ada_search_struct_field (const char *name, struct value *arg, LONGEST offset,
- struct type *type)
- {
- int i;
-@@ -7396,7 +7398,7 @@ ada_search_struct_field (const char *nam
- int j;
- struct type *field_type = ada_check_typedef (TYPE_FIELD_TYPE (type,
- i));
-- int var_offset = offset + TYPE_FIELD_BITPOS (type, i) / 8;
-+ LONGEST var_offset = offset + TYPE_FIELD_BITPOS (type, i) / 8;
-
- for (j = 0; j < TYPE_NFIELDS (field_type); j += 1)
- {
-@@ -7414,8 +7416,8 @@ ada_search_struct_field (const char *nam
- return NULL;
- }
-
--static struct value *ada_index_struct_field_1 (int *, struct value *,
-- int, struct type *);
-+static struct value *ada_index_struct_field_1 (LONGEST *, struct value *,
-+ LONGEST, struct type *);
-
-
- /* Return field #INDEX in ARG, where the index is that returned by
-@@ -7424,7 +7426,7 @@ static struct value *ada_index_struct_fi
- * If found, return value, else return NULL. */
-
- static struct value *
--ada_index_struct_field (int index, struct value *arg, int offset,
-+ada_index_struct_field (LONGEST index, struct value *arg, LONGEST offset,
- struct type *type)
- {
- return ada_index_struct_field_1 (&index, arg, offset, type);
-@@ -7436,7 +7438,7 @@ ada_index_struct_field (int index, struc
- * *INDEX_P. */
-
- static struct value *
--ada_index_struct_field_1 (int *index_p, struct value *arg, int offset,
-+ada_index_struct_field_1 (LONGEST *index_p, struct value *arg, LONGEST offset,
- struct type *type)
- {
- int i;
-@@ -7526,7 +7528,8 @@ ada_value_struct_elt (struct value *arg,
- v = ada_search_struct_field (name, arg, 0, t);
- else
- {
-- int bit_offset, bit_size, byte_offset;
-+ int bit_offset, bit_size;
-+ LONGEST byte_offset;
- struct type *field_type;
- CORE_ADDR address;
-
-@@ -7832,8 +7835,8 @@ ada_coerce_ref (struct value *val0)
- /* Return OFF rounded upward if necessary to a multiple of
- ALIGNMENT (a power of 2). */
-
--static unsigned int
--align_value (unsigned int off, unsigned int alignment)
-+static ULONGEST
-+align_value (ULONGEST off, ULONGEST alignment)
- {
- return (off + alignment - 1) & ~(alignment - 1);
- }
-@@ -8227,10 +8230,9 @@ ada_template_to_fixed_record_type_1 (str
- struct value *mark = value_mark ();
- struct value *dval;
- struct type *rtype;
-- int nfields, bit_len;
-+ int nfields;
- int variant_field;
-- long off;
-- int fld_bit_len;
-+ LONGEST off, bit_len, fld_bit_len;
- int f;
-
- /* Compute the number of fields in this record type that are going
-@@ -8308,7 +8310,7 @@ ada_template_to_fixed_record_type_1 (str
- that follow this one. */
- if (ada_is_aligner_type (field_type))
- {
-- long field_offset = TYPE_FIELD_BITPOS (field_type, f);
-+ LONGEST field_offset = TYPE_FIELD_BITPOS (field_type, f);
-
- field_valaddr = cond_offset_host (field_valaddr, field_offset);
- field_address = cond_offset_target (field_address, field_offset);
-@@ -8444,11 +8446,11 @@ ada_template_to_fixed_record_type_1 (str
- if (TYPE_LENGTH (type) <= 0)
- {
- if (TYPE_NAME (rtype))
-- warning (_("Invalid type size for `%s' detected: %d."),
-- TYPE_NAME (rtype), TYPE_LENGTH (type));
-+ warning (_("Invalid type size for `%s' detected: %s."),
-+ TYPE_NAME (rtype), pulongest (TYPE_LENGTH (type)));
- else
-- warning (_("Invalid type size for <unnamed> detected: %d."),
-- TYPE_LENGTH (type));
-+ warning (_("Invalid type size for <unnamed> detected: %s."),
-+ pulongest (TYPE_LENGTH (type)));
- }
- else
- {
-@@ -8915,7 +8917,8 @@ to_fixed_array_type (struct type *type0,
- type was a regular (non-packed) array type. As a result, the
- bitsize of the array elements needs to be set again, and the array
- length needs to be recomputed based on that bitsize. */
-- int len = TYPE_LENGTH (result) / TYPE_LENGTH (TYPE_TARGET_TYPE (result));
-+ LONGEST len = (TYPE_LENGTH (result)
-+ / TYPE_LENGTH (TYPE_TARGET_TYPE (result)));
- int elt_bitsize = TYPE_FIELD_BITSIZE (type0, 0);
-
- TYPE_FIELD_BITSIZE (result, 0) = TYPE_FIELD_BITSIZE (type0, 0);
-diff -Naurp insight-7.12.50.20170416.orig/gdb/ada-lang.h insight-7.12.50.20170416.new/gdb/ada-lang.h
---- insight-7.12.50.20170416.orig/gdb/ada-lang.h 2017-04-09 01:11:01.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/ada-lang.h 2017-04-16 12:29:51.436070187 +0100
-@@ -168,7 +168,7 @@ extern void ada_print_type (struct type
- extern void ada_print_typedef (struct type *type, struct symbol *new_symbol,
- struct ui_file *stream);
-
--extern void ada_val_print (struct type *, int, CORE_ADDR,
-+extern void ada_val_print (struct type *, LONGEST, CORE_ADDR,
- struct ui_file *, int,
- struct value *,
- const struct value_print_options *);
-@@ -183,7 +183,7 @@ extern void ada_emit_char (int, struct t
- extern void ada_printchar (int, struct type *, struct ui_file *);
-
- extern void ada_printstr (struct ui_file *, struct type *, const gdb_byte *,
-- unsigned int, const char *, int,
-+ ULONGEST, const char *, int,
- const struct value_print_options *);
-
- struct value *ada_convert_actual (struct value *actual,
-@@ -255,7 +255,7 @@ extern int ada_is_constrained_packed_arr
-
- extern struct value *ada_value_primitive_packed_val (struct value *,
- const gdb_byte *,
-- long, int, int,
-+ LONGEST, int, int,
- struct type *);
-
- extern struct type *ada_coerce_to_simple_array_type (struct type *);
-diff -Naurp insight-7.12.50.20170416.orig/gdb/ada-typeprint.c insight-7.12.50.20170416.new/gdb/ada-typeprint.c
---- insight-7.12.50.20170416.orig/gdb/ada-typeprint.c 2017-01-03 17:36:55.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/ada-typeprint.c 2017-04-16 12:29:51.436070187 +0100
-@@ -891,8 +891,8 @@ ada_print_type (struct type *type0, cons
- const char *name = ada_type_name (type);
-
- if (!ada_is_range_type_name (name))
-- fprintf_filtered (stream, _("<%d-byte integer>"),
-- TYPE_LENGTH (type));
-+ fprintf_filtered (stream, _("<%s-byte integer>"),
-+ pulongest (TYPE_LENGTH (type)));
- else
- {
- fprintf_filtered (stream, "range ");
-@@ -913,7 +913,8 @@ ada_print_type (struct type *type0, cons
- }
- break;
- case TYPE_CODE_FLT:
-- fprintf_filtered (stream, _("<%d-byte float>"), TYPE_LENGTH (type));
-+ fprintf_filtered (stream, _("<%s-byte float>"),
-+ pulongest (TYPE_LENGTH (type)));
- break;
- case TYPE_CODE_ENUM:
- if (show < 0)
-diff -Naurp insight-7.12.50.20170416.orig/gdb/ada-valprint.c insight-7.12.50.20170416.new/gdb/ada-valprint.c
---- insight-7.12.50.20170416.orig/gdb/ada-valprint.c 2017-03-04 04:09:18.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/ada-valprint.c 2017-04-16 12:29:51.436070187 +0100
-@@ -33,11 +33,11 @@
- #include "objfiles.h"
-
- static int print_field_values (struct type *, const gdb_byte *,
-- int,
-+ LONGEST,
- struct ui_file *, int,
- struct value *,
- const struct value_print_options *,
-- int, struct type *, int,
-+ int, struct type *, LONGEST,
- const struct language_defn *);
-
-
-@@ -279,7 +279,7 @@ ada_emit_char (int c, struct type *type,
- of a character. */
-
- static int
--char_at (const gdb_byte *string, int i, int type_len,
-+char_at (const gdb_byte *string, LONGEST i, int type_len,
- enum bfd_endian byte_order)
- {
- if (type_len == 1)
-@@ -439,11 +439,11 @@ ada_print_scalar (struct type *type, LON
-
- static void
- printstr (struct ui_file *stream, struct type *elttype, const gdb_byte *string,
-- unsigned int length, int force_ellipses, int type_len,
-+ ULONGEST length, int force_ellipses, int type_len,
- const struct value_print_options *options)
- {
- enum bfd_endian byte_order = gdbarch_byte_order (get_type_arch (elttype));
-- unsigned int i;
-+ ULONGEST i;
- unsigned int things_printed = 0;
- int in_quotes = 0;
- int need_comma = 0;
-@@ -458,9 +458,9 @@ printstr (struct ui_file *stream, struct
- {
- /* Position of the character we are examining
- to see whether it is repeated. */
-- unsigned int rep1;
-+ ULONGEST rep1;
- /* Number of repetitions we have detected so far. */
-- unsigned int reps;
-+ ULONGEST reps;
-
- QUIT;
-
-@@ -491,7 +491,8 @@ printstr (struct ui_file *stream, struct
- ada_emit_char (char_at (string, i, type_len, byte_order),
- elttype, stream, '\'', type_len);
- fputs_filtered ("'", stream);
-- fprintf_filtered (stream, _(" <repeats %u times>"), reps);
-+ fprintf_filtered (stream, _(" <repeats %s times>"),
-+ pulongest (reps));
- i = rep1 - 1;
- things_printed += options->repeat_count_threshold;
- need_comma = 1;
-@@ -519,7 +520,7 @@ printstr (struct ui_file *stream, struct
-
- void
- ada_printstr (struct ui_file *stream, struct type *type,
-- const gdb_byte *string, unsigned int length,
-+ const gdb_byte *string, ULONGEST length,
- const char *encoding, int force_ellipses,
- const struct value_print_options *options)
- {
-@@ -529,12 +530,12 @@ ada_printstr (struct ui_file *stream, st
-
- static int
- print_variant_part (struct type *type, int field_num,
-- const gdb_byte *valaddr, int offset,
-+ const gdb_byte *valaddr, LONGEST offset,
- struct ui_file *stream, int recurse,
- struct value *val,
- const struct value_print_options *options,
- int comma_needed,
-- struct type *outer_type, int outer_offset,
-+ struct type *outer_type, LONGEST outer_offset,
- const struct language_defn *language)
- {
- struct type *var_type = TYPE_FIELD_TYPE (type, field_num);
-@@ -570,11 +571,11 @@ print_variant_part (struct type *type, i
-
- static int
- print_field_values (struct type *type, const gdb_byte *valaddr,
-- int offset, struct ui_file *stream, int recurse,
-+ LONGEST offset, struct ui_file *stream, int recurse,
- struct value *val,
- const struct value_print_options *options,
- int comma_needed,
-- struct type *outer_type, int outer_offset,
-+ struct type *outer_type, LONGEST outer_offset,
- const struct language_defn *language)
- {
- int i, len;
-@@ -640,7 +641,7 @@ print_field_values (struct type *type, c
- else
- {
- struct value *v;
-- int bit_pos = TYPE_FIELD_BITPOS (type, i);
-+ LONGEST bit_pos = TYPE_FIELD_BITPOS (type, i);
- int bit_size = TYPE_FIELD_BITSIZE (type, i);
- struct value_print_options opts;
-
-@@ -685,8 +686,8 @@ ada_val_print_string (struct type *type,
- {
- enum bfd_endian byte_order = gdbarch_byte_order (get_type_arch (type));
- struct type *elttype = TYPE_TARGET_TYPE (type);
-- unsigned int eltlen;
-- unsigned int len;
-+ ULONGEST eltlen;
-+ ULONGEST len;
-
- /* We know that ELTTYPE cannot possibly be null, because we assume
- that we're called only when TYPE is a string-like type.
-@@ -705,7 +706,7 @@ ada_val_print_string (struct type *type,
- elements up to it. */
- if (options->stop_print_at_null)
- {
-- int temp_len;
-+ LONGEST temp_len;
-
- /* Look for a NULL char. */
- for (temp_len = 0;
-@@ -1072,7 +1073,7 @@ ada_val_print_ref (struct type *type, co
-
- static void
- ada_val_print_1 (struct type *type,
-- int offset, CORE_ADDR address,
-+ LONGEST offset, CORE_ADDR address,
- struct ui_file *stream, int recurse,
- struct value *original_value,
- const struct value_print_options *options,
-@@ -1156,7 +1157,7 @@ ada_val_print_1 (struct type *type,
-
- void
- ada_val_print (struct type *type,
-- int embedded_offset, CORE_ADDR address,
-+ LONGEST embedded_offset, CORE_ADDR address,
- struct ui_file *stream, int recurse,
- struct value *val,
- const struct value_print_options *options)
-diff -Naurp insight-7.12.50.20170416.orig/gdb/annotate.c insight-7.12.50.20170416.new/gdb/annotate.c
---- insight-7.12.50.20170416.orig/gdb/annotate.c 2017-01-03 17:36:55.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/annotate.c 2017-04-16 12:29:51.437070196 +0100
-@@ -533,21 +533,21 @@ annotate_frame_end (void)
- }
-
- void
--annotate_array_section_begin (int idx, struct type *elttype)
-+annotate_array_section_begin (LONGEST idx, struct type *elttype)
- {
- if (annotation_level == 2)
- {
-- printf_filtered (("\n\032\032array-section-begin %d "), idx);
-+ printf_filtered (("\n\032\032array-section-begin %s "), plongest (idx));
- print_value_flags (elttype);
- printf_filtered (("\n"));
- }
- }
-
- void
--annotate_elt_rep (unsigned int repcount)
-+annotate_elt_rep (ULONGEST repcount)
- {
- if (annotation_level == 2)
-- printf_filtered (("\n\032\032elt-rep %u\n"), repcount);
-+ printf_filtered (("\n\032\032elt-rep %s\n"), pulongest (repcount));
- }
-
- void
-diff -Naurp insight-7.12.50.20170416.orig/gdb/annotate.h insight-7.12.50.20170416.new/gdb/annotate.h
---- insight-7.12.50.20170416.orig/gdb/annotate.h 2017-01-03 17:36:55.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/annotate.h 2017-04-16 12:29:51.437070196 +0100
-@@ -92,8 +92,8 @@ extern void annotate_frame_source_end (v
- extern void annotate_frame_where (void);
- extern void annotate_frame_end (void);
-
--extern void annotate_array_section_begin (int, struct type *);
--extern void annotate_elt_rep (unsigned int);
-+extern void annotate_array_section_begin (LONGEST, struct type *);
-+extern void annotate_elt_rep (ULONGEST);
- extern void annotate_elt_rep_end (void);
- extern void annotate_elt (void);
- extern void annotate_array_section_end (void);
-diff -Naurp insight-7.12.50.20170416.orig/gdb/arch-utils.c insight-7.12.50.20170416.new/gdb/arch-utils.c
---- insight-7.12.50.20170416.orig/gdb/arch-utils.c 2017-01-03 17:36:55.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/arch-utils.c 2017-04-16 12:29:51.474070540 +0100
-@@ -247,7 +247,7 @@ legacy_virtual_frame_pointer (struct gdb
-
- const struct floatformat **
- default_floatformat_for_type (struct gdbarch *gdbarch,
-- const char *name, int len)
-+ const char *name, LONGEST len)
- {
- const struct floatformat **format = NULL;
-
-diff -Naurp insight-7.12.50.20170416.orig/gdb/arch-utils.h insight-7.12.50.20170416.new/gdb/arch-utils.h
---- insight-7.12.50.20170416.orig/gdb/arch-utils.h 2017-01-03 17:36:55.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/arch-utils.h 2017-04-16 12:29:51.474070540 +0100
-@@ -144,7 +144,7 @@ extern gdbarch_virtual_frame_pointer_fty
- /* Default implementation of gdbarch_floatformat_for_type. */
- extern const struct floatformat **
- default_floatformat_for_type (struct gdbarch *gdbarch,
-- const char *name, int len);
-+ const char *name, LONGEST len);
-
- extern CORE_ADDR generic_skip_trampoline_code (struct frame_info *frame,
- CORE_ADDR pc);
-diff -Naurp insight-7.12.50.20170416.orig/gdb/arm-linux-nat.c insight-7.12.50.20170416.new/gdb/arm-linux-nat.c
---- insight-7.12.50.20170416.orig/gdb/arm-linux-nat.c 2017-03-18 01:22:31.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/arm-linux-nat.c 2017-04-16 12:29:51.437070196 +0100
-@@ -1065,7 +1065,7 @@ arm_linux_remove_hw_breakpoint (struct t
- ADDR? */
- static int
- arm_linux_region_ok_for_hw_watchpoint (struct target_ops *self,
-- CORE_ADDR addr, int len)
-+ CORE_ADDR addr, LONGEST len)
- {
- const struct arm_linux_hwbp_cap *cap = arm_linux_get_hwbp_cap ();
- CORE_ADDR max_wp_length, aligned_addr;
-diff -Naurp insight-7.12.50.20170416.orig/gdb/ax-gdb.c insight-7.12.50.20170416.new/gdb/ax-gdb.c
---- insight-7.12.50.20170416.orig/gdb/ax-gdb.c 2017-04-15 01:21:12.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/ax-gdb.c 2017-04-16 12:34:26.988633385 +0100
-@@ -83,12 +83,12 @@ static void gen_traced_pop (struct gdbar
- static void gen_sign_extend (struct agent_expr *, struct type *);
- static void gen_extend (struct agent_expr *, struct type *);
- static void gen_fetch (struct agent_expr *, struct type *);
--static void gen_left_shift (struct agent_expr *, int);
-+static void gen_left_shift (struct agent_expr *, LONGEST);
-
-
- static void gen_frame_args_address (struct gdbarch *, struct agent_expr *);
- static void gen_frame_locals_address (struct gdbarch *, struct agent_expr *);
--static void gen_offset (struct agent_expr *ax, int offset);
-+static void gen_offset (struct agent_expr *ax, LONGEST offset);
- static void gen_sym_offset (struct agent_expr *, struct symbol *);
- static void gen_var_ref (struct gdbarch *, struct agent_expr *ax,
- struct axs_value *value, struct symbol *var);
-@@ -137,15 +137,16 @@ static void gen_deref (struct agent_expr
- static void gen_address_of (struct agent_expr *, struct axs_value *);
- static void gen_bitfield_ref (struct expression *exp, struct agent_expr *ax,
- struct axs_value *value,
-- struct type *type, int start, int end);
-+ struct type *type, LONGEST start, LONGEST end);
- static void gen_primitive_field (struct expression *exp,
- struct agent_expr *ax,
- struct axs_value *value,
-- int offset, int fieldno, struct type *type);
-+ LONGEST offset, int fieldno,
-+ struct type *type);
- static int gen_struct_ref_recursive (struct expression *exp,
- struct agent_expr *ax,
- struct axs_value *value,
-- const char *field, int offset,
-+ const char *field, LONGEST offset,
- struct type *type);
- static void gen_struct_ref (struct expression *exp, struct agent_expr *ax,
- struct axs_value *value,
-@@ -541,7 +542,7 @@ gen_fetch (struct agent_expr *ax, struct
- right shift it by -DISTANCE bits if DISTANCE < 0. This generates
- unsigned (logical) right shifts. */
- static void
--gen_left_shift (struct agent_expr *ax, int distance)
-+gen_left_shift (struct agent_expr *ax, LONGEST distance)
- {
- if (distance > 0)
- {
-@@ -595,7 +596,7 @@ gen_frame_locals_address (struct gdbarch
- programming in ML, it would be clearer why these are the same
- thing. */
- static void
--gen_offset (struct agent_expr *ax, int offset)
-+gen_offset (struct agent_expr *ax, LONGEST offset)
- {
- /* It would suffice to simply push the offset and add it, but this
- makes it easier to read positive and negative offsets in the
-@@ -1251,7 +1252,7 @@ gen_address_of (struct agent_expr *ax, s
- static void
- gen_bitfield_ref (struct expression *exp, struct agent_expr *ax,
- struct axs_value *value, struct type *type,
-- int start, int end)
-+ LONGEST start, LONGEST end)
- {
- /* Note that ops[i] fetches 8 << i bits. */
- static enum agent_op ops[]
-@@ -1286,13 +1287,13 @@ gen_bitfield_ref (struct expression *exp
-
- /* The first and one-after-last bits in the field, but rounded down
- and up to byte boundaries. */
-- int bound_start = (start / TARGET_CHAR_BIT) * TARGET_CHAR_BIT;
-- int bound_end = (((end + TARGET_CHAR_BIT - 1)
-- / TARGET_CHAR_BIT)
-- * TARGET_CHAR_BIT);
-+ LONGEST bound_start = (start / TARGET_CHAR_BIT) * TARGET_CHAR_BIT;
-+ LONGEST bound_end = (((end + TARGET_CHAR_BIT - 1)
-+ / TARGET_CHAR_BIT)
-+ * TARGET_CHAR_BIT);
-
- /* current bit offset within the structure */
-- int offset;
-+ LONGEST offset;
-
- /* The index in ops of the opcode we're considering. */
- int op;
-@@ -1411,7 +1412,7 @@ gen_bitfield_ref (struct expression *exp
- static void
- gen_primitive_field (struct expression *exp,
- struct agent_expr *ax, struct axs_value *value,
-- int offset, int fieldno, struct type *type)
-+ LONGEST offset, int fieldno, struct type *type)
- {
- /* Is this a bitfield? */
- if (TYPE_FIELD_PACKED (type, fieldno))
-@@ -1436,7 +1437,7 @@ gen_primitive_field (struct expression *
- static int
- gen_struct_ref_recursive (struct expression *exp, struct agent_expr *ax,
- struct axs_value *value,
-- const char *field, int offset, struct type *type)
-+ const char *field, LONGEST offset, struct type *type)
- {
- int i, rslt;
- int nbases = TYPE_N_BASECLASSES (type);
-diff -Naurp insight-7.12.50.20170416.orig/gdb/ax-general.c insight-7.12.50.20170416.new/gdb/ax-general.c
---- insight-7.12.50.20170416.orig/gdb/ax-general.c 2017-01-03 17:36:55.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/ax-general.c 2017-04-16 12:29:51.439070215 +0100
-@@ -177,7 +177,7 @@ ax_zero_ext (struct agent_expr *x, int n
-
- /* Append a trace_quick instruction to EXPR, to record N bytes. */
- void
--ax_trace_quick (struct agent_expr *x, int n)
-+ax_trace_quick (struct agent_expr *x, LONGEST n)
- {
- /* N must fit in a byte. */
- if (n < 0 || n > 255)
-diff -Naurp insight-7.12.50.20170416.orig/gdb/ax.h insight-7.12.50.20170416.new/gdb/ax.h
---- insight-7.12.50.20170416.orig/gdb/ax.h 2017-01-03 17:36:55.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/ax.h 2017-04-16 12:29:51.439070215 +0100
-@@ -205,7 +205,7 @@ extern void ax_ext (struct agent_expr *E
- extern void ax_zero_ext (struct agent_expr *EXPR, int N);
-
- /* Append a trace_quick instruction to EXPR, to record N bytes. */
--extern void ax_trace_quick (struct agent_expr *EXPR, int N);
-+extern void ax_trace_quick (struct agent_expr *EXPR, LONGEST N);
-
- /* Append a goto op to EXPR. OP is the actual op (must be aop_goto or
- aop_if_goto). We assume we don't know the target offset yet,
-diff -Naurp insight-7.12.50.20170416.orig/gdb/breakpoint.c insight-7.12.50.20170416.new/gdb/breakpoint.c
---- insight-7.12.50.20170416.orig/gdb/breakpoint.c 2017-04-16 12:29:02.788617666 +0100
-+++ insight-7.12.50.20170416.new/gdb/breakpoint.c 2017-04-16 12:29:51.442070242 +0100
-@@ -2225,9 +2225,9 @@ should_be_inserted (struct bp_location *
- {
- fprintf_unfiltered (gdb_stdlog,
- "infrun: stepping past non-steppable watchpoint. "
-- "skipping watchpoint at %s:%d\n",
-+ "skipping watchpoint at %s:%s\n",
- paddress (bl->gdbarch, bl->address),
-- bl->length);
-+ plongest (bl->length));
- }
- return 0;
- }
-@@ -7151,7 +7151,7 @@ breakpoint_address_match (struct address
-
- static int
- breakpoint_address_match_range (struct address_space *aspace1, CORE_ADDR addr1,
-- int len1, struct address_space *aspace2,
-+ LONGEST len1, struct address_space *aspace2,
- CORE_ADDR addr2)
- {
- return ((gdbarch_has_global_breakpoints (target_gdbarch ())
-@@ -11444,7 +11444,7 @@ can_use_hardware_watchpoint (struct valu
- && TYPE_CODE (vtype) != TYPE_CODE_ARRAY))
- {
- CORE_ADDR vaddr = value_address (v);
-- int len;
-+ LONGEST len;
- int num_regs;
-
- len = (target_exact_watchpoints
-diff -Naurp insight-7.12.50.20170416.orig/gdb/breakpoint.h insight-7.12.50.20170416.new/gdb/breakpoint.h
---- insight-7.12.50.20170416.orig/gdb/breakpoint.h 2017-04-16 12:29:02.694616792 +0100
-+++ insight-7.12.50.20170416.new/gdb/breakpoint.h 2017-04-16 12:29:51.443070252 +0100
-@@ -250,7 +250,7 @@ struct bp_target_info
-
- /* If this is a ranged breakpoint, then this field contains the
- length of the range that will be watched for execution. */
-- int length;
-+ LONGEST length;
-
- /* If the breakpoint lives in memory and reading that memory would
- give back the breakpoint, instead of the original contents, then
-@@ -422,7 +422,7 @@ struct bp_location
- /* For hardware watchpoints, the size of the memory region being
- watched. For hardware ranged breakpoints, the size of the
- breakpoint range. */
-- int length;
-+ LONGEST length;
-
- /* Type of hardware watchpoint. */
- enum target_hw_bp_type watchpoint_type;
-diff -Naurp insight-7.12.50.20170416.orig/gdb/c-lang.c insight-7.12.50.20170416.new/gdb/c-lang.c
---- insight-7.12.50.20170416.orig/gdb/c-lang.c 2017-04-15 01:21:12.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/c-lang.c 2017-04-16 12:29:51.443070252 +0100
-@@ -186,7 +186,7 @@ c_printchar (int c, struct type *type, s
-
- void
- c_printstr (struct ui_file *stream, struct type *type,
-- const gdb_byte *string, unsigned int length,
-+ const gdb_byte *string, ULONGEST length,
- const char *user_encoding, int force_ellipses,
- const struct value_print_options *options)
- {
-@@ -672,7 +672,7 @@ evaluate_subexp_c (struct type *expect_t
- }
- else
- {
-- int i;
-+ LONGEST i;
-
- /* Write the terminating character. */
- for (i = 0; i < TYPE_LENGTH (type); ++i)
-@@ -681,7 +681,7 @@ evaluate_subexp_c (struct type *expect_t
- if (satisfy_expected)
- {
- LONGEST low_bound, high_bound;
-- int element_size = TYPE_LENGTH (type);
-+ LONGEST element_size = TYPE_LENGTH (type);
-
- if (get_discrete_bounds (TYPE_INDEX_TYPE (expect_type),
- &low_bound, &high_bound) < 0)
-diff -Naurp insight-7.12.50.20170416.orig/gdb/c-lang.h insight-7.12.50.20170416.new/gdb/c-lang.h
---- insight-7.12.50.20170416.orig/gdb/c-lang.h 2017-04-09 01:11:01.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/c-lang.h 2017-04-16 12:29:51.443070252 +0100
-@@ -77,7 +77,7 @@ extern void c_print_typedef (struct type
- struct ui_file *);
-
- extern void c_val_print (struct type *,
-- int, CORE_ADDR,
-+ LONGEST, CORE_ADDR,
- struct ui_file *, int,
- struct value *,
- const struct value_print_options *);
-@@ -97,7 +97,7 @@ extern void c_printchar (int, struct typ
- extern void c_printstr (struct ui_file * stream,
- struct type *elttype,
- const gdb_byte *string,
-- unsigned int length,
-+ ULONGEST length,
- const char *user_encoding,
- int force_ellipses,
- const struct value_print_options *options);
-diff -Naurp insight-7.12.50.20170416.orig/gdb/compile/compile-c-support.c insight-7.12.50.20170416.new/gdb/compile/compile-c-support.c
---- insight-7.12.50.20170416.orig/gdb/compile/compile-c-support.c 2017-04-15 01:21:12.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/compile/compile-c-support.c 2017-04-16 12:29:51.473070531 +0100
-@@ -309,11 +309,11 @@ generate_register_struct (struct ui_file
-
- default:
- fprintf_unfiltered (stream,
-- " unsigned char %s[%d]"
-+ " unsigned char %s[%s]"
- " __attribute__((__aligned__("
- "__BIGGEST_ALIGNMENT__)))",
- regname,
-- TYPE_LENGTH (regtype));
-+ pulongest (TYPE_LENGTH (regtype)));
- }
- fputs_unfiltered (";\n", stream);
-
-diff -Naurp insight-7.12.50.20170416.orig/gdb/cp-abi.c insight-7.12.50.20170416.new/gdb/cp-abi.c
---- insight-7.12.50.20170416.orig/gdb/cp-abi.c 2017-01-03 17:36:55.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/cp-abi.c 2017-04-16 12:29:51.444070261 +0100
-@@ -64,12 +64,12 @@ is_operator_name (const char *name)
- return (*current_cp_abi.is_operator_name) (name);
- }
-
--int
-+LONGEST
- baseclass_offset (struct type *type, int index, const gdb_byte *valaddr,
- LONGEST embedded_offset, CORE_ADDR address,
- const struct value *val)
- {
-- int res = 0;
-+ LONGEST res = 0;
-
- gdb_assert (current_cp_abi.baseclass_offset != NULL);
-
-@@ -96,7 +96,7 @@ baseclass_offset (struct type *type, int
- struct value *
- value_virtual_fn_field (struct value **arg1p,
- struct fn_field *f, int j,
-- struct type *type, int offset)
-+ struct type *type, LONGEST offset)
- {
- if ((current_cp_abi.virtual_fn_field) == NULL)
- return NULL;
-diff -Naurp insight-7.12.50.20170416.orig/gdb/cp-abi.h insight-7.12.50.20170416.new/gdb/cp-abi.h
---- insight-7.12.50.20170416.orig/gdb/cp-abi.h 2017-01-03 17:36:55.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/cp-abi.h 2017-04-16 12:29:51.444070261 +0100
-@@ -108,7 +108,7 @@ extern struct value *value_virtual_fn_fi
- struct fn_field *f,
- int j,
- struct type *type,
-- int offset);
-+ LONGEST offset);
-
-
- /* Try to find the run-time type of VALUE, using C++ run-time type
-@@ -144,11 +144,11 @@ extern struct type *value_rtti_type (str
- contents of VAL. The result is the offset of the baseclass value
- relative to (the address of)(ARG) + OFFSET. */
-
--extern int baseclass_offset (struct type *type,
-- int index, const gdb_byte *valaddr,
-- LONGEST embedded_offset,
-- CORE_ADDR address,
-- const struct value *val);
-+extern LONGEST baseclass_offset (struct type *type,
-+ int index, const gdb_byte *valaddr,
-+ LONGEST embedded_offset,
-+ CORE_ADDR address,
-+ const struct value *val);
-
- /* Describe the target of a pointer to method. CONTENTS is the byte
- pattern representing the pointer to method. TYPE is the pointer to
-@@ -226,12 +226,12 @@ struct cp_abi_ops
- struct value *(*virtual_fn_field) (struct value **arg1p,
- struct fn_field * f,
- int j, struct type * type,
-- int offset);
-+ LONGEST offset);
- struct type *(*rtti_type) (struct value *v, int *full,
- LONGEST *top, int *using_enc);
-- int (*baseclass_offset) (struct type *type, int index,
-- const bfd_byte *valaddr, LONGEST embedded_offset,
-- CORE_ADDR address, const struct value *val);
-+ LONGEST (*baseclass_offset) (struct type *type, int index,
-+ const bfd_byte *valaddr, LONGEST embedded_offset,
-+ CORE_ADDR address, const struct value *val);
- void (*print_method_ptr) (const gdb_byte *contents,
- struct type *type,
- struct ui_file *stream);
-diff -Naurp insight-7.12.50.20170416.orig/gdb/cp-valprint.c insight-7.12.50.20170416.new/gdb/cp-valprint.c
---- insight-7.12.50.20170416.orig/gdb/cp-valprint.c 2017-04-09 01:11:01.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/cp-valprint.c 2017-04-16 12:29:51.444070261 +0100
-@@ -336,7 +336,7 @@ cp_print_value_fields (struct type *type
- }
- else if (i == vptr_fieldno && type == vptr_basetype)
- {
-- int i_offset = offset + TYPE_FIELD_BITPOS (type, i) / 8;
-+ LONGEST i_offset = offset + TYPE_FIELD_BITPOS (type, i) / 8;
- struct type *i_type = TYPE_FIELD_TYPE (type, i);
-
- if (valprint_check_validity (stream, i_type, i_offset, val))
-diff -Naurp insight-7.12.50.20170416.orig/gdb/c-valprint.c insight-7.12.50.20170416.new/gdb/c-valprint.c
---- insight-7.12.50.20170416.orig/gdb/c-valprint.c 2017-03-25 10:42:37.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/c-valprint.c 2017-04-16 12:29:51.443070252 +0100
-@@ -244,7 +244,7 @@ c_val_print_array (struct type *type, co
- if (TYPE_LENGTH (type) > 0 && TYPE_LENGTH (unresolved_elttype) > 0)
- {
- LONGEST low_bound, high_bound;
-- int eltlen, len;
-+ LONGEST eltlen, len;
- struct gdbarch *gdbarch = get_type_arch (type);
- enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
- unsigned int i = 0; /* Number of characters printed. */
-@@ -318,8 +318,8 @@ c_val_print_array (struct type *type, co
- if (cp_is_vtbl_ptr_type (elttype))
- {
- i = 1;
-- fprintf_filtered (stream, _("%d vtable entries"),
-- len - 1);
-+ fprintf_filtered (stream, _("%s vtable entries"),
-+ plongest (len - 1));
- }
- else
- {
-@@ -396,7 +396,7 @@ c_val_print_struct (struct type *type, c
- -fvtable_thunks. (Otherwise, look under
- TYPE_CODE_PTR.) */
- struct gdbarch *gdbarch = get_type_arch (type);
-- int offset = (embedded_offset
-+ LONGEST offset = (embedded_offset
- + TYPE_FIELD_BITPOS (type,
- VTBL_FNADDR_OFFSET) / 8);
- struct type *field_type = TYPE_FIELD_TYPE (type, VTBL_FNADDR_OFFSET);
-@@ -495,7 +495,7 @@ c_val_print_memberptr (struct type *type
-
- void
- c_val_print (struct type *type,
-- int embedded_offset, CORE_ADDR address,
-+ LONGEST embedded_offset, CORE_ADDR address,
- struct ui_file *stream, int recurse,
- struct value *original_value,
- const struct value_print_options *options)
-diff -Naurp insight-7.12.50.20170416.orig/gdb/d-lang.h insight-7.12.50.20170416.new/gdb/d-lang.h
---- insight-7.12.50.20170416.orig/gdb/d-lang.h 2017-04-09 01:11:01.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/d-lang.h 2017-04-16 12:29:51.444070261 +0100
-@@ -81,7 +81,7 @@ extern struct block_symbol d_lookup_nest
- /* Defined in d-valprint.c */
-
- extern void d_val_print (struct type *type,
-- int embedded_offset, CORE_ADDR address,
-+ LONGEST embedded_offset, CORE_ADDR address,
- struct ui_file *stream, int recurse,
- struct value *val,
- const struct value_print_options *options);
-diff -Naurp insight-7.12.50.20170416.orig/gdb/d-valprint.c insight-7.12.50.20170416.new/gdb/d-valprint.c
---- insight-7.12.50.20170416.orig/gdb/d-valprint.c 2017-01-03 17:36:55.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/d-valprint.c 2017-04-16 12:29:51.444070261 +0100
-@@ -73,7 +73,7 @@ dynamic_array_type (struct type *type,
-
- /* Implements the la_val_print routine for language D. */
- void
--d_val_print (struct type *type, int embedded_offset,
-+d_val_print (struct type *type, LONGEST embedded_offset,
- CORE_ADDR address, struct ui_file *stream, int recurse,
- struct value *val,
- const struct value_print_options *options)
-diff -Naurp insight-7.12.50.20170416.orig/gdb/dwarf2loc.c insight-7.12.50.20170416.new/gdb/dwarf2loc.c
---- insight-7.12.50.20170416.orig/gdb/dwarf2loc.c 2017-04-09 01:11:01.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/dwarf2loc.c 2017-04-16 12:41:35.762621853 +0100
-@@ -1760,12 +1760,12 @@ static void
- read_pieced_value (struct value *v)
- {
- int i;
-- long offset = 0;
-+ LONGEST offset = 0;
- ULONGEST bits_to_skip;
- gdb_byte *contents;
- struct piece_closure *c
- = (struct piece_closure *) value_computed_closure (v);
-- size_t type_len;
-+ ULONGEST type_len;
- size_t buffer_size = 0;
- std::vector<gdb_byte> buffer;
- int bits_big_endian
-@@ -1789,8 +1789,8 @@ read_pieced_value (struct value *v)
- for (i = 0; i < c->n_pieces && offset < type_len; i++)
- {
- struct dwarf_expr_piece *p = &c->pieces[i];
-- size_t this_size, this_size_bits;
-- long dest_offset_bits, source_offset_bits, source_offset;
-+ ULONGEST this_size, this_size_bits;
-+ LONGEST dest_offset_bits, source_offset_bits, source_offset;
- const gdb_byte *intermediate_buffer;
-
- /* Compute size, source, and destination offsets for copying, in
-@@ -1929,12 +1929,12 @@ static void
- write_pieced_value (struct value *to, struct value *from)
- {
- int i;
-- long offset = 0;
-+ LONGEST offset = 0;
- ULONGEST bits_to_skip;
- const gdb_byte *contents;
- struct piece_closure *c
- = (struct piece_closure *) value_computed_closure (to);
-- size_t type_len;
-+ ULONGEST type_len;
- size_t buffer_size = 0;
- std::vector<gdb_byte> buffer;
- int bits_big_endian
-@@ -1953,8 +1953,8 @@ write_pieced_value (struct value *to, st
- for (i = 0; i < c->n_pieces && offset < type_len; i++)
- {
- struct dwarf_expr_piece *p = &c->pieces[i];
-- size_t this_size_bits, this_size;
-- long dest_offset_bits, source_offset_bits, dest_offset, source_offset;
-+ ULONGEST this_size_bits, this_size;
-+ LONGEST dest_offset_bits, source_offset_bits, dest_offset, source_offset;
- int need_bitwise;
- const gdb_byte *source_buffer;
-
-@@ -2073,7 +2073,7 @@ write_pieced_value (struct value *to, st
-
- static int
- check_pieced_synthetic_pointer (const struct value *value, LONGEST bit_offset,
-- int bit_length)
-+ LONGEST bit_length)
- {
- struct piece_closure *c
- = (struct piece_closure *) value_computed_closure (value);
-@@ -2086,7 +2086,7 @@ check_pieced_synthetic_pointer (const st
- for (i = 0; i < c->n_pieces && bit_length > 0; i++)
- {
- struct dwarf_expr_piece *p = &c->pieces[i];
-- size_t this_size_bits = p->size;
-+ ULONGEST this_size_bits = p->size;
-
- if (bit_offset > 0)
- {
-@@ -2194,8 +2194,8 @@ indirect_pieced_value (struct value *val
- struct type *type;
- struct frame_info *frame;
- struct dwarf2_locexpr_baton baton;
-- int i, bit_length;
-- LONGEST bit_offset;
-+ int i;
-+ LONGEST bit_length, bit_offset;
- struct dwarf_expr_piece *piece = NULL;
- LONGEST byte_offset;
- enum bfd_endian byte_order;
-@@ -2212,7 +2212,7 @@ indirect_pieced_value (struct value *val
- for (i = 0; i < c->n_pieces && bit_length > 0; i++)
- {
- struct dwarf_expr_piece *p = &c->pieces[i];
-- size_t this_size_bits = p->size;
-+ ULONGEST this_size_bits = p->size;
-
- if (bit_offset > 0)
- {
-@@ -2489,9 +2489,9 @@ dwarf2_evaluate_loc_desc_full (struct ty
- case DWARF_VALUE_STACK:
- {
- struct value *value = ctx.fetch (0);
-- size_t n = TYPE_LENGTH (value_type (value));
-- size_t len = TYPE_LENGTH (subobj_type);
-- size_t max = TYPE_LENGTH (type);
-+ ULONGEST n = TYPE_LENGTH (value_type (value));
-+ ULONGEST len = TYPE_LENGTH (subobj_type);
-+ ULONGEST max = TYPE_LENGTH (type);
- struct gdbarch *objfile_gdbarch = get_objfile_arch (objfile);
- struct cleanup *cleanup;
-
-diff -Naurp insight-7.12.50.20170416.orig/gdb/dwarf2read.c insight-7.12.50.20170416.new/gdb/dwarf2read.c
---- insight-7.12.50.20170416.orig/gdb/dwarf2read.c 2017-04-16 12:29:02.815617918 +0100
-+++ insight-7.12.50.20170416.new/gdb/dwarf2read.c 2017-04-16 12:29:51.449070307 +0100
-@@ -2063,12 +2063,12 @@ dwarf2_complex_location_expr_complaint (
- }
-
- static void
--dwarf2_const_value_length_mismatch_complaint (const char *arg1, int arg2,
-- int arg3)
-+dwarf2_const_value_length_mismatch_complaint (const char *arg1, LONGEST arg2,
-+ LONGEST arg3)
- {
- complaint (&symfile_complaints,
-- _("const value length mismatch for '%s', got %d, expected %d"),
-- arg1, arg2, arg3);
-+ _("const value length mismatch for '%s', got %s, expected %s"),
-+ arg1, plongest (arg2), plongest (arg3));
- }
-
- static void
-@@ -12876,8 +12876,8 @@ dwarf2_add_field (struct field_info *fip
- object, and then subtract off the number of bits of
- the field itself. The result is the bit offset of
- the LSB of the field. */
-- int anonymous_size;
-- int bit_offset = DW_UNSND (attr);
-+ LONGEST anonymous_size;
-+ LONGEST bit_offset = DW_UNSND (attr);
-
- attr = dwarf2_attr (die, DW_AT_byte_size, cu);
- if (attr)
-diff -Naurp insight-7.12.50.20170416.orig/gdb/eval.c insight-7.12.50.20170416.new/gdb/eval.c
---- insight-7.12.50.20170416.orig/gdb/eval.c 2017-03-25 10:42:37.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/eval.c 2017-04-16 12:29:51.450070317 +0100
-@@ -297,7 +297,8 @@ evaluate_struct_tuple (struct value *str
- while (--nargs >= 0)
- {
- struct value *val = NULL;
-- int bitpos, bitsize;
-+ LONGEST bitpos;
-+ int bitsize;
- bfd_byte *addr;
-
- fieldno++;
-@@ -358,7 +359,7 @@ init_array_element (struct value *array,
- enum noside noside, LONGEST low_bound, LONGEST high_bound)
- {
- LONGEST index;
-- int element_size = TYPE_LENGTH (value_type (element));
-+ LONGEST element_size = TYPE_LENGTH (value_type (element));
-
- if (exp->elts[*pos].opcode == BINOP_COMMA)
- {
-@@ -506,11 +507,11 @@ binop_promote (const struct language_def
- /* FIXME: Also mixed integral/booleans, with result an integer. */
- {
- const struct builtin_type *builtin = builtin_type (gdbarch);
-- unsigned int promoted_len1 = TYPE_LENGTH (type1);
-- unsigned int promoted_len2 = TYPE_LENGTH (type2);
-+ ULONGEST promoted_len1 = TYPE_LENGTH (type1);
-+ ULONGEST promoted_len2 = TYPE_LENGTH (type2);
- int is_unsigned1 = TYPE_UNSIGNED (type1);
- int is_unsigned2 = TYPE_UNSIGNED (type2);
-- unsigned int result_len;
-+ ULONGEST result_len;
- int unsigned_operation;
-
- /* Determine type length and signedness after promotion for
-@@ -692,7 +693,7 @@ evaluate_subexp_standard (struct type *e
- struct value **argvec;
- int code;
- int ix;
-- long mem_offset;
-+ LONGEST mem_offset;
- struct type **arg_types;
- int save_pos1;
- struct symbol *function = NULL;
-@@ -871,7 +872,7 @@ evaluate_subexp_standard (struct type *e
- struct type *range_type = TYPE_INDEX_TYPE (type);
- struct type *element_type = TYPE_TARGET_TYPE (type);
- struct value *array = allocate_value (expect_type);
-- int element_size = TYPE_LENGTH (check_typedef (element_type));
-+ LONGEST element_size = TYPE_LENGTH (check_typedef (element_type));
- LONGEST low_bound, high_bound, index;
-
- if (get_discrete_bounds (range_type, &low_bound, &high_bound) < 0)
-diff -Naurp insight-7.12.50.20170416.orig/gdb/findcmd.c insight-7.12.50.20170416.new/gdb/findcmd.c
---- insight-7.12.50.20170416.orig/gdb/findcmd.c 2017-01-03 17:36:55.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/findcmd.c 2017-04-16 12:29:51.474070540 +0100
-@@ -180,7 +180,7 @@ parse_find_args (char *args, ULONGEST *m
- need to grow the pattern buf. */
- pattern_buf_size_need = (pattern_buf_end - pattern_buf
- + std::max (TYPE_LENGTH (t),
-- (unsigned) sizeof (int64_t)));
-+ (ULONGEST) sizeof (int64_t)));
- if (pattern_buf_size_need > pattern_buf_size)
- {
- size_t current_offset = pattern_buf_end - pattern_buf;
-diff -Naurp insight-7.12.50.20170416.orig/gdb/findvar.c insight-7.12.50.20170416.new/gdb/findvar.c
---- insight-7.12.50.20170416.orig/gdb/findvar.c 2017-03-25 10:42:37.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/findvar.c 2017-04-16 12:29:51.451070326 +0100
-@@ -817,7 +817,7 @@ struct value *
- default_value_from_register (struct gdbarch *gdbarch, struct type *type,
- int regnum, struct frame_id frame_id)
- {
-- int len = TYPE_LENGTH (type);
-+ LONGEST len = TYPE_LENGTH (type);
- struct value *value = allocate_value (type);
- struct frame_info *frame;
-
-@@ -861,7 +861,7 @@ read_frame_register_value (struct value
- LONGEST offset = 0;
- LONGEST reg_offset = value_offset (value);
- int regnum = VALUE_REGNUM (value);
-- int len = type_length_units (check_typedef (value_type (value)));
-+ LONGEST len = type_length_units (check_typedef (value_type (value)));
-
- gdb_assert (VALUE_LVAL (value) == lval_register);
-
-@@ -876,7 +876,7 @@ read_frame_register_value (struct value
- while (len > 0)
- {
- struct value *regval = get_frame_register_value (frame, regnum);
-- int reg_len = type_length_units (value_type (regval)) - reg_offset;
-+ LONGEST reg_len = type_length_units (value_type (regval)) - reg_offset;
-
- /* If the register length is larger than the number of bytes
- remaining to copy, then only copy the appropriate bytes. */
-diff -Naurp insight-7.12.50.20170416.orig/gdb/f-lang.c insight-7.12.50.20170416.new/gdb/f-lang.c
---- insight-7.12.50.20170416.orig/gdb/f-lang.c 2017-04-09 01:11:01.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/f-lang.c 2017-04-16 12:29:51.450070317 +0100
-@@ -103,7 +103,7 @@ f_printchar (int c, struct type *type, s
-
- static void
- f_printstr (struct ui_file *stream, struct type *type, const gdb_byte *string,
-- unsigned int length, const char *encoding, int force_ellipses,
-+ ULONGEST length, const char *encoding, int force_ellipses,
- const struct value_print_options *options)
- {
- const char *type_encoding = f_get_encoding (type);
-diff -Naurp insight-7.12.50.20170416.orig/gdb/f-lang.h insight-7.12.50.20170416.new/gdb/f-lang.h
---- insight-7.12.50.20170416.orig/gdb/f-lang.h 2017-04-09 01:11:01.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/f-lang.h 2017-04-16 12:29:51.450070317 +0100
-@@ -30,7 +30,7 @@ extern void f_yyerror (const char *); /*
- extern void f_print_type (struct type *, const char *, struct ui_file *, int,
- int, const struct type_print_options *);
-
--extern void f_val_print (struct type *, int, CORE_ADDR,
-+extern void f_val_print (struct type *, LONGEST, CORE_ADDR,
- struct ui_file *, int,
- struct value *,
- const struct value_print_options *);
-diff -Naurp insight-7.12.50.20170416.orig/gdb/frame.c insight-7.12.50.20170416.new/gdb/frame.c
---- insight-7.12.50.20170416.orig/gdb/frame.c 2017-04-09 01:11:01.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/frame.c 2017-04-16 12:29:51.452070335 +0100
-@@ -1375,7 +1375,7 @@ deprecated_frame_register_read (struct f
-
- int
- get_frame_register_bytes (struct frame_info *frame, int regnum,
-- CORE_ADDR offset, int len, gdb_byte *myaddr,
-+ CORE_ADDR offset, LONGEST len, gdb_byte *myaddr,
- int *optimizedp, int *unavailablep)
- {
- struct gdbarch *gdbarch = get_frame_arch (frame);
-@@ -1404,7 +1404,7 @@ get_frame_register_bytes (struct frame_i
- }
- if (len > maxsize)
- error (_("Bad debug information detected: "
-- "Attempt to read %d bytes from registers."), len);
-+ "Attempt to read %s bytes from registers."), plongest (len));
-
- /* Copy the data. */
- while (len > 0)
-diff -Naurp insight-7.12.50.20170416.orig/gdb/frame.h insight-7.12.50.20170416.new/gdb/frame.h
---- insight-7.12.50.20170416.orig/gdb/frame.h 2017-01-03 17:36:55.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/frame.h 2017-04-16 12:29:51.453070345 +0100
-@@ -600,7 +600,7 @@ extern void put_frame_register (struct f
- contents are optimized out or unavailable, set *OPTIMIZEDP,
- *UNAVAILABLEP accordingly. */
- extern int get_frame_register_bytes (struct frame_info *frame, int regnum,
-- CORE_ADDR offset, int len,
-+ CORE_ADDR offset, LONGEST len,
- gdb_byte *myaddr,
- int *optimizedp, int *unavailablep);
-
-diff -Naurp insight-7.12.50.20170416.orig/gdb/f-valprint.c insight-7.12.50.20170416.new/gdb/f-valprint.c
---- insight-7.12.50.20170416.orig/gdb/f-valprint.c 2017-01-03 17:36:55.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/f-valprint.c 2017-04-16 12:29:51.451070326 +0100
-@@ -38,7 +38,7 @@ extern void _initialize_f_valprint (void
- static void info_common_command (char *, int);
- static void f77_get_dynamic_length_of_aggregate (struct type *);
-
--int f77_array_offset_tbl[MAX_FORTRAN_DIMS + 1][2];
-+LONGEST f77_array_offset_tbl[MAX_FORTRAN_DIMS + 1][2];
-
- /* Array which holds offsets to be applied to get a row's elements
- for a given array. Array also holds the size of each subarray. */
-@@ -73,8 +73,8 @@ f77_get_upperbound (struct type *type)
- static void
- f77_get_dynamic_length_of_aggregate (struct type *type)
- {
-- int upper_bound = -1;
-- int lower_bound = 1;
-+ LONGEST upper_bound = -1;
-+ LONGEST lower_bound = 1;
-
- /* Recursively go all the way down into a possibly multi-dimensional
- F77 array and get the bounds. For simple arrays, this is pretty
-@@ -106,7 +106,7 @@ f77_get_dynamic_length_of_aggregate (str
- static void
- f77_print_array_1 (int nss, int ndimensions, struct type *type,
- const gdb_byte *valaddr,
-- int embedded_offset, CORE_ADDR address,
-+ LONGEST embedded_offset, CORE_ADDR address,
- struct ui_file *stream, int recurse,
- const struct value *val,
- const struct value_print_options *options,
-@@ -115,7 +115,7 @@ f77_print_array_1 (int nss, int ndimensi
- struct type *range_type = TYPE_INDEX_TYPE (check_typedef (type));
- CORE_ADDR addr = address + embedded_offset;
- LONGEST lowerbound, upperbound;
-- int i;
-+ LONGEST i;
-
- get_discrete_bounds (range_type, &lowerbound, &upperbound);
-
-@@ -171,7 +171,7 @@ f77_print_array_1 (int nss, int ndimensi
-
- static void
- f77_print_array (struct type *type, const gdb_byte *valaddr,
-- int embedded_offset,
-+ LONGEST embedded_offset,
- CORE_ADDR address, struct ui_file *stream,
- int recurse,
- const struct value *val,
-@@ -210,7 +210,7 @@ static const struct generic_val_print_de
- function; they are identical. */
-
- void
--f_val_print (struct type *type, int embedded_offset,
-+f_val_print (struct type *type, LONGEST embedded_offset,
- CORE_ADDR address, struct ui_file *stream, int recurse,
- struct value *original_value,
- const struct value_print_options *options)
-diff -Naurp insight-7.12.50.20170416.orig/gdb/gdbarch.c insight-7.12.50.20170416.new/gdb/gdbarch.c
---- insight-7.12.50.20170416.orig/gdb/gdbarch.c 2017-04-15 01:21:12.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/gdbarch.c 2017-04-16 12:29:51.475070549 +0100
-@@ -1806,7 +1806,7 @@ set_gdbarch_wchar_signed (struct gdbarch
- }
-
- const struct floatformat **
--gdbarch_floatformat_for_type (struct gdbarch *gdbarch, const char *name, int length)
-+gdbarch_floatformat_for_type (struct gdbarch *gdbarch, const char *name, LONGEST length)
- {
- gdb_assert (gdbarch != NULL);
- gdb_assert (gdbarch->floatformat_for_type != NULL);
-diff -Naurp insight-7.12.50.20170416.orig/gdb/gdbarch.h insight-7.12.50.20170416.new/gdb/gdbarch.h
---- insight-7.12.50.20170416.orig/gdb/gdbarch.h 2017-04-15 01:21:12.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/gdbarch.h 2017-04-16 12:29:51.475070549 +0100
-@@ -203,8 +203,8 @@ extern void set_gdbarch_wchar_signed (st
- NAME, if non-NULL, is the type name, which may be used to distinguish
- different target formats of the same length. */
-
--typedef const struct floatformat ** (gdbarch_floatformat_for_type_ftype) (struct gdbarch *gdbarch, const char *name, int length);
--extern const struct floatformat ** gdbarch_floatformat_for_type (struct gdbarch *gdbarch, const char *name, int length);
-+typedef const struct floatformat ** (gdbarch_floatformat_for_type_ftype) (struct gdbarch *gdbarch, const char *name, LONGEST length);
-+extern const struct floatformat ** gdbarch_floatformat_for_type (struct gdbarch *gdbarch, const char *name, LONGEST length);
- extern void set_gdbarch_floatformat_for_type (struct gdbarch *gdbarch, gdbarch_floatformat_for_type_ftype *floatformat_for_type);
-
- /* For most targets, a pointer on the target and its representation as an
-diff -Naurp insight-7.12.50.20170416.orig/gdb/gdbarch.sh insight-7.12.50.20170416.new/gdb/gdbarch.sh
---- insight-7.12.50.20170416.orig/gdb/gdbarch.sh 2017-04-15 01:21:12.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/gdbarch.sh 2017-04-16 12:29:51.476070559 +0100
-@@ -392,7 +392,7 @@ v:int:wchar_signed:::1:-1:1
- # Returns the floating-point format to be used for values of length LENGTH.
- # NAME, if non-NULL, is the type name, which may be used to distinguish
- # different target formats of the same length.
--m:const struct floatformat **:floatformat_for_type:const char *name, int length:name, length:0:default_floatformat_for_type::0
-+m:const struct floatformat **:floatformat_for_type:const char *name, LONGEST length:name, length:0:default_floatformat_for_type::0
-
- # For most targets, a pointer on the target and its representation as an
- # address in GDB have the same size and "look the same". For such a
-diff -Naurp insight-7.12.50.20170416.orig/gdb/gdbtypes.c insight-7.12.50.20170416.new/gdb/gdbtypes.c
---- insight-7.12.50.20170416.orig/gdb/gdbtypes.c 2017-04-15 01:21:12.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/gdbtypes.c 2017-04-16 12:29:51.453070345 +0100
-@@ -2756,7 +2756,7 @@ verify_floatformat (int bit, const struc
- least as long as OBJFILE. */
-
- struct type *
--init_type (struct objfile *objfile, enum type_code code, int length,
-+init_type (struct objfile *objfile, enum type_code code, LONGEST length,
- const char *name)
- {
- struct type *type;
-@@ -3065,8 +3065,8 @@ is_public_ancestor (struct type *base, s
-
- static int
- is_unique_ancestor_worker (struct type *base, struct type *dclass,
-- int *offset,
-- const gdb_byte *valaddr, int embedded_offset,
-+ LONGEST *offset,
-+ const gdb_byte *valaddr, LONGEST embedded_offset,
- CORE_ADDR address, struct value *val)
- {
- int i, count = 0;
-@@ -3077,7 +3077,7 @@ is_unique_ancestor_worker (struct type *
- for (i = 0; i < TYPE_N_BASECLASSES (dclass) && count < 2; ++i)
- {
- struct type *iter;
-- int this_offset;
-+ LONGEST this_offset;
-
- iter = check_typedef (TYPE_BASECLASS (dclass, i));
-
-@@ -3118,7 +3118,7 @@ is_unique_ancestor_worker (struct type *
- int
- is_unique_ancestor (struct type *base, struct value *val)
- {
-- int offset = -1;
-+ LONGEST offset = -1;
-
- return is_unique_ancestor_worker (base, value_type (val), &offset,
- value_contents_for_printing (val),
-@@ -4357,7 +4357,7 @@ recursive_dump_type (struct type *type,
- break;
- }
- puts_filtered ("\n");
-- printfi_filtered (spaces, "length %d\n", TYPE_LENGTH (type));
-+ printfi_filtered (spaces, "length %s\n", pulongest (TYPE_LENGTH (type)));
- if (TYPE_OBJFILE_OWNED (type))
- {
- printfi_filtered (spaces, "objfile ");
-@@ -4817,7 +4817,7 @@ copy_type (const struct type *type)
-
- struct type *
- arch_type (struct gdbarch *gdbarch,
-- enum type_code code, int length, const char *name)
-+ enum type_code code, LONGEST length, const char *name)
- {
- struct type *type;
-
-diff -Naurp insight-7.12.50.20170416.orig/gdb/gdbtypes.h insight-7.12.50.20170416.new/gdb/gdbtypes.h
---- insight-7.12.50.20170416.orig/gdb/gdbtypes.h 2017-04-16 12:29:02.689616746 +0100
-+++ insight-7.12.50.20170416.new/gdb/gdbtypes.h 2017-04-16 12:29:51.454070354 +0100
-@@ -784,7 +784,7 @@ struct type
- type_length_units function should be used in order to get the length
- expressed in target addressable memory units. */
-
-- unsigned int length;
-+ ULONGEST length;
-
- /* * Core type, shared by a group of qualified types. */
-
-@@ -1650,7 +1650,7 @@ extern unsigned int type_length_units (s
-
- /* * Helper function to construct objfile-owned types. */
-
--extern struct type *init_type (struct objfile *, enum type_code, int,
-+extern struct type *init_type (struct objfile *, enum type_code, LONGEST,
- const char *);
- extern struct type *init_integer_type (struct objfile *, int, int,
- const char *);
-@@ -1667,7 +1667,7 @@ extern struct type *init_pointer_type (s
- struct type *);
-
- /* Helper functions to construct architecture-owned types. */
--extern struct type *arch_type (struct gdbarch *, enum type_code, int,
-+extern struct type *arch_type (struct gdbarch *, enum type_code, LONGEST,
- const char *);
- extern struct type *arch_integer_type (struct gdbarch *, int, int,
- const char *);
-diff -Naurp insight-7.12.50.20170416.orig/gdb/gnu-v2-abi.c insight-7.12.50.20170416.new/gdb/gnu-v2-abi.c
---- insight-7.12.50.20170416.orig/gdb/gnu-v2-abi.c 2017-01-03 17:36:55.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/gnu-v2-abi.c 2017-04-16 12:29:51.455070363 +0100
-@@ -82,7 +82,7 @@ gnuv2_is_operator_name (const char *name
- TYPE is the type in which F is located. */
- static struct value *
- gnuv2_virtual_fn_field (struct value **arg1p, struct fn_field * f, int j,
-- struct type * type, int offset)
-+ struct type *type, LONGEST offset)
- {
- struct value *arg1 = *arg1p;
- struct type *type1 = check_typedef (value_type (arg1));
-@@ -338,7 +338,7 @@ vb_match (struct type *type, int index,
- target). The result is the offset of the baseclass value relative
- to (the address of)(ARG) + OFFSET. */
-
--static int
-+static LONGEST
- gnuv2_baseclass_offset (struct type *type, int index,
- const bfd_byte *valaddr, LONGEST embedded_offset,
- CORE_ADDR address, const struct value *val)
-@@ -358,8 +358,7 @@ gnuv2_baseclass_offset (struct type *typ
- if (vb_match (type, i, basetype))
- {
- struct type *field_type;
-- LONGEST field_offset;
-- int field_length;
-+ LONGEST field_offset, field_length;
- CORE_ADDR addr;
-
- field_type = check_typedef (TYPE_FIELD_TYPE (type, i));
-@@ -383,7 +382,7 @@ gnuv2_baseclass_offset (struct type *typ
- /* Don't go through baseclass_offset, as that wraps
- exceptions, thus, inner exceptions would be wrapped more
- than once. */
-- int boffset =
-+ LONGEST boffset =
- gnuv2_baseclass_offset (type, i, valaddr,
- embedded_offset, address, val);
-
-diff -Naurp insight-7.12.50.20170416.orig/gdb/gnu-v3-abi.c insight-7.12.50.20170416.new/gdb/gnu-v3-abi.c
---- insight-7.12.50.20170416.orig/gdb/gnu-v3-abi.c 2017-04-15 01:21:12.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/gnu-v3-abi.c 2017-04-16 12:29:51.455070363 +0100
-@@ -109,7 +109,7 @@ build_gdb_vtable_type (struct gdbarch *a
- {
- struct type *t;
- struct field *field_list, *field;
-- int offset;
-+ LONGEST offset;
-
- struct type *void_ptr_type
- = builtin_type (arch)->builtin_data_ptr;
-@@ -185,7 +185,7 @@ vtable_ptrdiff_type (struct gdbarch *gdb
- /* Return the offset from the start of the imaginary `struct
- gdb_gnu_v3_abi_vtable' object to the vtable's "address point"
- (i.e., where objects' virtual table pointers point). */
--static int
-+static LONGEST
- vtable_address_point_offset (struct gdbarch *gdbarch)
- {
- struct type *vtable_type
-@@ -408,7 +408,7 @@ gnuv3_get_virtual_fn (struct gdbarch *gd
- static struct value *
- gnuv3_virtual_fn_field (struct value **value_p,
- struct fn_field *f, int j,
-- struct type *vfn_base, int offset)
-+ struct type *vfn_base, LONGEST offset)
- {
- struct type *values_type = check_typedef (value_type (*value_p));
- struct gdbarch *gdbarch;
-@@ -438,7 +438,7 @@ gnuv3_virtual_fn_field (struct value **v
-
- -1 is returned on error. */
-
--static int
-+static LONGEST
- gnuv3_baseclass_offset (struct type *type, int index,
- const bfd_byte *valaddr, LONGEST embedded_offset,
- CORE_ADDR address, const struct value *val)
-@@ -447,7 +447,7 @@ gnuv3_baseclass_offset (struct type *typ
- struct type *ptr_type;
- struct value *vtable;
- struct value *vbase_array;
-- long int cur_base_offset, base_offset;
-+ LONGEST cur_base_offset, base_offset;
-
- /* Determine architecture. */
- gdbarch = get_type_arch (type);
-@@ -470,7 +470,7 @@ gnuv3_baseclass_offset (struct type *typ
- cur_base_offset = cur_base_offset + vtable_address_point_offset (gdbarch);
- if ((- cur_base_offset) % TYPE_LENGTH (ptr_type) != 0)
- error (_("Misaligned vbase offset."));
-- cur_base_offset = cur_base_offset / ((int) TYPE_LENGTH (ptr_type));
-+ cur_base_offset = cur_base_offset / ((LONGEST) TYPE_LENGTH (ptr_type));
-
- vtable = gnuv3_get_vtable (gdbarch, type, address + embedded_offset);
- gdb_assert (vtable != NULL);
-@@ -514,7 +514,7 @@ gnuv3_find_method_in (struct type *domai
- we're out of luck. */
- for (i = 0; i < TYPE_N_BASECLASSES (domain); i++)
- {
-- int pos;
-+ LONGEST pos;
- struct type *basetype;
-
- if (BASETYPE_VIA_VIRTUAL (domain, i))
-diff -Naurp insight-7.12.50.20170416.orig/gdb/go-lang.h insight-7.12.50.20170416.new/gdb/go-lang.h
---- insight-7.12.50.20170416.orig/gdb/go-lang.h 2017-04-09 01:11:01.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/go-lang.h 2017-04-16 12:29:51.456070373 +0100
-@@ -85,7 +85,7 @@ extern void go_print_type (struct type *
- /* Defined in go-valprint.c. */
-
- extern void go_val_print (struct type *type,
-- int embedded_offset, CORE_ADDR address,
-+ LONGEST embedded_offset, CORE_ADDR address,
- struct ui_file *stream, int recurse,
- struct value *val,
- const struct value_print_options *options);
-diff -Naurp insight-7.12.50.20170416.orig/gdb/go-valprint.c insight-7.12.50.20170416.new/gdb/go-valprint.c
---- insight-7.12.50.20170416.orig/gdb/go-valprint.c 2017-01-03 17:36:55.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/go-valprint.c 2017-04-16 12:29:51.456070373 +0100
-@@ -86,7 +86,7 @@ print_go_string (struct type *type,
- /* Implements the la_val_print routine for language Go. */
-
- void
--go_val_print (struct type *type, int embedded_offset,
-+go_val_print (struct type *type, LONGEST embedded_offset,
- CORE_ADDR address, struct ui_file *stream, int recurse,
- struct value *val,
- const struct value_print_options *options)
-diff -Naurp insight-7.12.50.20170416.orig/gdb/i386-tdep.c insight-7.12.50.20170416.new/gdb/i386-tdep.c
---- insight-7.12.50.20170416.orig/gdb/i386-tdep.c 2017-04-16 12:29:02.714616978 +0100
-+++ insight-7.12.50.20170416.new/gdb/i386-tdep.c 2017-04-16 12:29:51.477070568 +0100
-@@ -8180,7 +8180,7 @@ i386_fast_tracepoint_valid_at (struct gd
-
- const struct floatformat **
- i386_floatformat_for_type (struct gdbarch *gdbarch,
-- const char *name, int len)
-+ const char *name, LONGEST len)
- {
- if (len == 128 && name)
- if (strcmp (name, "__float128") == 0
-diff -Naurp insight-7.12.50.20170416.orig/gdb/language.c insight-7.12.50.20170416.new/gdb/language.c
---- insight-7.12.50.20170416.orig/gdb/language.c 2017-04-09 01:11:01.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/language.c 2017-04-16 12:29:51.456070373 +0100
-@@ -753,7 +753,7 @@ unk_lang_printchar (int c, struct type *
-
- static void
- unk_lang_printstr (struct ui_file *stream, struct type *type,
-- const gdb_byte *string, unsigned int length,
-+ const gdb_byte *string, ULONGEST length,
- const char *encoding, int force_ellipses,
- const struct value_print_options *options)
- {
-@@ -772,7 +772,7 @@ unk_lang_print_type (struct type *type,
-
- static void
- unk_lang_val_print (struct type *type,
-- int embedded_offset, CORE_ADDR address,
-+ LONGEST embedded_offset, CORE_ADDR address,
- struct ui_file *stream, int recurse,
- struct value *val,
- const struct value_print_options *options)
-diff -Naurp insight-7.12.50.20170416.orig/gdb/language.h insight-7.12.50.20170416.new/gdb/language.h
---- insight-7.12.50.20170416.orig/gdb/language.h 2017-04-09 01:11:01.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/language.h 2017-04-16 12:29:51.457070382 +0100
-@@ -197,7 +197,7 @@ struct language_defn
- struct ui_file * stream);
-
- void (*la_printstr) (struct ui_file * stream, struct type *elttype,
-- const gdb_byte *string, unsigned int length,
-+ const gdb_byte *string, ULONGEST length,
- const char *encoding, int force_ellipses,
- const struct value_print_options *);
-
-@@ -235,7 +235,7 @@ struct language_defn
- printing. */
-
- void (*la_val_print) (struct type *type,
-- int embedded_offset, CORE_ADDR address,
-+ LONGEST embedded_offset, CORE_ADDR address,
- struct ui_file *stream, int recurse,
- struct value *val,
- const struct value_print_options *options);
-diff -Naurp insight-7.12.50.20170416.orig/gdb/m2-lang.c insight-7.12.50.20170416.new/gdb/m2-lang.c
---- insight-7.12.50.20170416.orig/gdb/m2-lang.c 2017-01-03 17:36:55.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/m2-lang.c 2017-04-16 12:29:51.457070382 +0100
-@@ -104,10 +104,10 @@ m2_printchar (int c, struct type *type,
-
- static void
- m2_printstr (struct ui_file *stream, struct type *type, const gdb_byte *string,
-- unsigned int length, const char *encoding, int force_ellipses,
-+ ULONGEST length, const char *encoding, int force_ellipses,
- const struct value_print_options *options)
- {
-- unsigned int i;
-+ ULONGEST i;
- unsigned int things_printed = 0;
- int in_quotes = 0;
- int need_comma = 0;
-@@ -122,9 +122,9 @@ m2_printstr (struct ui_file *stream, str
- {
- /* Position of the character we are examining
- to see whether it is repeated. */
-- unsigned int rep1;
-+ ULONGEST rep1;
- /* Number of repetitions we have detected so far. */
-- unsigned int reps;
-+ ULONGEST reps;
-
- QUIT;
-
-@@ -150,7 +150,7 @@ m2_printstr (struct ui_file *stream, str
- in_quotes = 0;
- }
- m2_printchar (string[i], type, stream);
-- fprintf_filtered (stream, " <repeats %u times>", reps);
-+ fprintf_filtered (stream, " <repeats %s times>", pulongest (reps));
- i = rep1 - 1;
- things_printed += options->repeat_count_threshold;
- need_comma = 1;
-diff -Naurp insight-7.12.50.20170416.orig/gdb/m2-lang.h insight-7.12.50.20170416.new/gdb/m2-lang.h
---- insight-7.12.50.20170416.orig/gdb/m2-lang.h 2017-04-09 01:11:01.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/m2-lang.h 2017-04-16 12:29:51.457070382 +0100
-@@ -34,7 +34,7 @@ extern void m2_print_typedef (struct typ
- extern int m2_is_long_set (struct type *type);
- extern int m2_is_unbounded_array (struct type *type);
-
--extern void m2_val_print (struct type *, int, CORE_ADDR,
-+extern void m2_val_print (struct type *, LONGEST, CORE_ADDR,
- struct ui_file *, int,
- struct value *,
- const struct value_print_options *);
-diff -Naurp insight-7.12.50.20170416.orig/gdb/m2-typeprint.c insight-7.12.50.20170416.new/gdb/m2-typeprint.c
---- insight-7.12.50.20170416.orig/gdb/m2-typeprint.c 2017-01-03 17:36:55.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/m2-typeprint.c 2017-04-16 12:29:51.457070382 +0100
-@@ -234,9 +234,12 @@ static void m2_array (struct type *type,
- m2_print_bounds (TYPE_INDEX_TYPE (type), stream, show, -1, 1);
- }
- else
-- fprintf_filtered (stream, "%d",
-- (TYPE_LENGTH (type)
-- / TYPE_LENGTH (TYPE_TARGET_TYPE (type))));
-+ {
-+ ULONGEST val = (TYPE_LENGTH (type)
-+ / TYPE_LENGTH (TYPE_TARGET_TYPE (type)));
-+
-+ fprintf_filtered (stream, "%s", pulongest (val));
-+ }
- }
- fprintf_filtered (stream, "] OF ");
- m2_print_type (TYPE_TARGET_TYPE (type), "", stream, show, level, flags);
-diff -Naurp insight-7.12.50.20170416.orig/gdb/m2-valprint.c insight-7.12.50.20170416.new/gdb/m2-valprint.c
---- insight-7.12.50.20170416.orig/gdb/m2-valprint.c 2017-01-03 17:36:55.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/m2-valprint.c 2017-04-16 12:29:51.457070382 +0100
-@@ -35,7 +35,7 @@ static int print_unpacked_pointer (struc
- struct ui_file *stream);
- static void
- m2_print_array_contents (struct type *type, const gdb_byte *valaddr,
-- int embedded_offset, CORE_ADDR address,
-+ LONGEST embedded_offset, CORE_ADDR address,
- struct ui_file *stream, int recurse,
- struct value *val,
- const struct value_print_options *options,
-@@ -67,7 +67,7 @@ get_long_set_bounds (struct type *type,
-
- static void
- m2_print_long_set (struct type *type, const gdb_byte *valaddr,
-- int embedded_offset, CORE_ADDR address,
-+ LONGEST embedded_offset, CORE_ADDR address,
- struct ui_file *stream)
- {
- int empty_set = 1;
-@@ -158,7 +158,7 @@ m2_print_long_set (struct type *type, co
-
- static void
- m2_print_unbounded_array (struct type *type, const gdb_byte *valaddr,
-- int embedded_offset, CORE_ADDR address,
-+ LONGEST embedded_offset, CORE_ADDR address,
- struct ui_file *stream, int recurse,
- const struct value_print_options *options)
- {
-@@ -260,7 +260,7 @@ print_variable_at_address (struct type *
-
- static void
- m2_print_array_contents (struct type *type, const gdb_byte *valaddr,
-- int embedded_offset, CORE_ADDR address,
-+ LONGEST embedded_offset, CORE_ADDR address,
- struct ui_file *stream, int recurse,
- struct value *val,
- const struct value_print_options *options,
-@@ -308,13 +308,13 @@ static const struct generic_val_print_de
- function; they are identical. */
-
- void
--m2_val_print (struct type *type, int embedded_offset,
-+m2_val_print (struct type *type, LONGEST embedded_offset,
- CORE_ADDR address, struct ui_file *stream, int recurse,
- struct value *original_value,
- const struct value_print_options *options)
- {
- struct gdbarch *gdbarch = get_type_arch (type);
-- unsigned len;
-+ ULONGEST len;
- struct type *elttype;
- CORE_ADDR addr;
- const gdb_byte *valaddr = value_contents_for_printing (original_value);
-@@ -340,7 +340,7 @@ m2_val_print (struct type *type, int emb
- elements up to it. */
- if (options->stop_print_at_null)
- {
-- unsigned int temp_len;
-+ ULONGEST temp_len;
-
- /* Look for a NULL char. */
- for (temp_len = 0;
-@@ -416,7 +416,7 @@ m2_val_print (struct type *type, int emb
- {
- struct type *range = elttype;
- LONGEST low_bound, high_bound;
-- int i;
-+ LONGEST i;
- int need_comma = 0;
-
- fputs_filtered ("{", stream);
-diff -Naurp insight-7.12.50.20170416.orig/gdb/memrange.c insight-7.12.50.20170416.new/gdb/memrange.c
---- insight-7.12.50.20170416.orig/gdb/memrange.c 2017-01-03 17:36:55.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/memrange.c 2017-04-16 12:29:51.457070382 +0100
-@@ -22,8 +22,8 @@
- #include <algorithm>
-
- int
--mem_ranges_overlap (CORE_ADDR start1, int len1,
-- CORE_ADDR start2, int len2)
-+mem_ranges_overlap (CORE_ADDR start1, LONGEST len1,
-+ CORE_ADDR start2, LONGEST len2)
- {
- ULONGEST h, l;
-
-diff -Naurp insight-7.12.50.20170416.orig/gdb/memrange.h insight-7.12.50.20170416.new/gdb/memrange.h
---- insight-7.12.50.20170416.orig/gdb/memrange.h 2017-01-03 17:36:55.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/memrange.h 2017-04-16 12:29:51.458070391 +0100
-@@ -30,7 +30,7 @@ struct mem_range
- CORE_ADDR start;
-
- /* Length of the range. */
-- int length;
-+ LONGEST length;
- };
-
- typedef struct mem_range mem_range_s;
-@@ -40,8 +40,8 @@ DEF_VEC_O(mem_range_s);
- /* Returns true if the ranges defined by [start1, start1+len1) and
- [start2, start2+len2) overlap. */
-
--extern int mem_ranges_overlap (CORE_ADDR start1, int len1,
-- CORE_ADDR start2, int len2);
-+extern int mem_ranges_overlap (CORE_ADDR start1, LONGEST len1,
-+ CORE_ADDR start2, LONGEST len2);
-
- /* Returns true if ADDR is in RANGE. */
-
-diff -Naurp insight-7.12.50.20170416.orig/gdb/mips-linux-nat.c insight-7.12.50.20170416.new/gdb/mips-linux-nat.c
---- insight-7.12.50.20170416.orig/gdb/mips-linux-nat.c 2017-03-25 10:42:37.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/mips-linux-nat.c 2017-04-16 12:29:51.458070391 +0100
-@@ -584,7 +584,7 @@ mips_linux_stopped_data_address (struct
-
- static int
- mips_linux_region_ok_for_hw_watchpoint (struct target_ops *self,
-- CORE_ADDR addr, int len)
-+ CORE_ADDR addr, LONGEST len)
- {
- struct pt_watch_regs dummy_regs;
- int i;
-diff -Naurp insight-7.12.50.20170416.orig/gdb/nat/x86-dregs.c insight-7.12.50.20170416.new/gdb/nat/x86-dregs.c
---- insight-7.12.50.20170416.orig/gdb/nat/x86-dregs.c 2017-01-03 17:36:55.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/nat/x86-dregs.c 2017-04-16 12:29:51.473070531 +0100
-@@ -384,7 +384,7 @@ x86_remove_aligned_watchpoint (struct x8
-
- static int
- x86_handle_nonaligned_watchpoint (struct x86_debug_reg_state *state,
-- x86_wp_op_t what, CORE_ADDR addr, int len,
-+ x86_wp_op_t what, CORE_ADDR addr, LONGEST len,
- enum target_hw_bp_type type)
- {
- int retval = 0;
-@@ -552,7 +552,7 @@ x86_dr_remove_watchpoint (struct x86_deb
-
- int
- x86_dr_region_ok_for_watchpoint (struct x86_debug_reg_state *state,
-- CORE_ADDR addr, int len)
-+ CORE_ADDR addr, LONGEST len)
- {
- int nregs;
-
-diff -Naurp insight-7.12.50.20170416.orig/gdb/nat/x86-dregs.h insight-7.12.50.20170416.new/gdb/nat/x86-dregs.h
---- insight-7.12.50.20170416.orig/gdb/nat/x86-dregs.h 2017-01-03 17:36:55.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/nat/x86-dregs.h 2017-04-16 12:29:51.473070531 +0100
-@@ -116,7 +116,7 @@ extern int x86_dr_remove_watchpoint (str
- /* Return non-zero if we can watch a memory region that starts at
- address ADDR and whose length is LEN bytes. */
- extern int x86_dr_region_ok_for_watchpoint (struct x86_debug_reg_state *state,
-- CORE_ADDR addr, int len);
-+ CORE_ADDR addr, LONGEST len);
-
- /* If the inferior has some break/watchpoint that triggered, set the
- address associated with that break/watchpoint and return true.
-diff -Naurp insight-7.12.50.20170416.orig/gdb/opencl-lang.c insight-7.12.50.20170416.new/gdb/opencl-lang.c
---- insight-7.12.50.20170416.orig/gdb/opencl-lang.c 2017-01-03 17:36:55.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/opencl-lang.c 2017-04-16 12:29:51.458070391 +0100
-@@ -78,11 +78,11 @@ builtin_opencl_type (struct gdbarch *gdb
-
- static struct type *
- lookup_opencl_vector_type (struct gdbarch *gdbarch, enum type_code code,
-- unsigned int el_length, unsigned int flag_unsigned,
-+ ULONGEST el_length, unsigned int flag_unsigned,
- int n)
- {
- int i;
-- unsigned int length;
-+ ULONGEST length;
- struct type *type = NULL;
- struct type **types = builtin_opencl_type (gdbarch);
-
-@@ -174,7 +174,7 @@ lval_func_read (struct value *v)
- struct type *eltype = TYPE_TARGET_TYPE (check_typedef (value_type (c->val)));
- LONGEST offset = value_offset (v);
- LONGEST elsize = TYPE_LENGTH (eltype);
-- int n, i, j = 0;
-+ LONGEST n, i, j = 0;
- LONGEST lowb = 0;
- LONGEST highb = 0;
-
-@@ -203,7 +203,7 @@ lval_func_write (struct value *v, struct
- struct type *eltype = TYPE_TARGET_TYPE (check_typedef (value_type (c->val)));
- LONGEST offset = value_offset (v);
- LONGEST elsize = TYPE_LENGTH (eltype);
-- int n, i, j = 0;
-+ LONGEST n, i, j = 0;
- LONGEST lowb = 0;
- LONGEST highb = 0;
-
-@@ -243,17 +243,17 @@ lval_func_write (struct value *v, struct
-
- static int
- lval_func_check_synthetic_pointer (const struct value *v,
-- LONGEST offset, int length)
-+ LONGEST offset, LONGEST length)
- {
- struct lval_closure *c = (struct lval_closure *) value_computed_closure (v);
- /* Size of the target type in bits. */
-- int elsize =
-+ LONGEST elsize =
- TYPE_LENGTH (TYPE_TARGET_TYPE (check_typedef (value_type (c->val)))) * 8;
-- int startrest = offset % elsize;
-- int start = offset / elsize;
-- int endrest = (offset + length) % elsize;
-- int end = (offset + length) / elsize;
-- int i;
-+ LONGEST startrest = offset % elsize;
-+ LONGEST start = offset / elsize;
-+ LONGEST endrest = (offset + length) % elsize;
-+ LONGEST end = (offset + length) / elsize;
-+ LONGEST i;
-
- if (endrest)
- end++;
-@@ -263,8 +263,8 @@ lval_func_check_synthetic_pointer (const
-
- for (i = start; i < end; i++)
- {
-- int comp_offset = (i == start) ? startrest : 0;
-- int comp_length = (i == end) ? endrest : elsize;
-+ LONGEST comp_offset = (i == start) ? startrest : 0;
-+ LONGEST comp_length = (i == end) ? endrest : elsize;
-
- if (!value_bits_synthetic_pointer (c->val,
- c->indices[i] * elsize + comp_offset,
-diff -Naurp insight-7.12.50.20170416.orig/gdb/p-lang.c insight-7.12.50.20170416.new/gdb/p-lang.c
---- insight-7.12.50.20170416.orig/gdb/p-lang.c 2017-01-03 17:36:55.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/p-lang.c 2017-04-16 12:29:51.458070391 +0100
-@@ -95,8 +95,8 @@ pascal_main_name (void)
- are not multiple of TARGET_CHAR_BIT then the results are wrong
- but this does not happen for Free Pascal nor for GPC. */
- int
--is_pascal_string_type (struct type *type,int *length_pos,
-- int *length_size, int *string_pos,
-+is_pascal_string_type (struct type *type, LONGEST *length_pos,
-+ LONGEST *length_size, LONGEST *string_pos,
- struct type **char_type,
- const char **arrayname)
- {
-@@ -216,12 +216,12 @@ pascal_printchar (int c, struct type *ty
-
- void
- pascal_printstr (struct ui_file *stream, struct type *type,
-- const gdb_byte *string, unsigned int length,
-+ const gdb_byte *string, ULONGEST length,
- const char *encoding, int force_ellipses,
- const struct value_print_options *options)
- {
- enum bfd_endian byte_order = gdbarch_byte_order (get_type_arch (type));
-- unsigned int i;
-+ ULONGEST i;
- unsigned int things_printed = 0;
- int in_quotes = 0;
- int need_comma = 0;
-@@ -249,9 +249,9 @@ pascal_printstr (struct ui_file *stream,
- {
- /* Position of the character we are examining
- to see whether it is repeated. */
-- unsigned int rep1;
-+ ULONGEST rep1;
- /* Number of repetitions we have detected so far. */
-- unsigned int reps;
-+ ULONGEST reps;
- unsigned long int current_char;
-
- QUIT;
-@@ -283,7 +283,7 @@ pascal_printstr (struct ui_file *stream,
- in_quotes = 0;
- }
- pascal_printchar (current_char, type, stream);
-- fprintf_filtered (stream, " <repeats %u times>", reps);
-+ fprintf_filtered (stream, " <repeats %s times>", pulongest (reps));
- i = rep1 - 1;
- things_printed += options->repeat_count_threshold;
- need_comma = 1;
-diff -Naurp insight-7.12.50.20170416.orig/gdb/p-lang.h insight-7.12.50.20170416.new/gdb/p-lang.h
---- insight-7.12.50.20170416.orig/gdb/p-lang.h 2017-04-09 01:11:01.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/p-lang.h 2017-04-16 12:29:51.458070391 +0100
-@@ -36,7 +36,7 @@ extern void pascal_print_type (struct ty
- extern void pascal_print_typedef (struct type *, struct symbol *,
- struct ui_file *);
-
--extern void pascal_val_print (struct type *, int,
-+extern void pascal_val_print (struct type *, LONGEST,
- CORE_ADDR, struct ui_file *, int,
- struct value *,
- const struct value_print_options *);
-@@ -50,13 +50,13 @@ extern void pascal_type_print_method_arg
- /* These are in p-lang.c: */
-
- extern int
-- is_pascal_string_type (struct type *, int *, int *, int *,
-+ is_pascal_string_type (struct type *, LONGEST *, LONGEST *, LONGEST *,
- struct type **, const char **);
-
- extern void pascal_printchar (int, struct type *, struct ui_file *);
-
- extern void pascal_printstr (struct ui_file *, struct type *, const gdb_byte *,
-- unsigned int, const char *, int,
-+ ULONGEST, const char *, int,
- const struct value_print_options *);
-
- extern struct type **const (pascal_builtin_types[]);
-diff -Naurp insight-7.12.50.20170416.orig/gdb/ppc-linux-nat.c insight-7.12.50.20170416.new/gdb/ppc-linux-nat.c
---- insight-7.12.50.20170416.orig/gdb/ppc-linux-nat.c 2017-03-25 10:42:37.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/ppc-linux-nat.c 2017-04-16 12:29:51.459070401 +0100
-@@ -1445,7 +1445,7 @@ ppc_linux_can_use_hw_breakpoint (struct
-
- static int
- ppc_linux_region_ok_for_hw_watchpoint (struct target_ops *self,
-- CORE_ADDR addr, int len)
-+ CORE_ADDR addr, LONGEST len)
- {
- /* Handle sub-8-byte quantities. */
- if (len <= 0)
-diff -Naurp insight-7.12.50.20170416.orig/gdb/ppc-linux-tdep.c insight-7.12.50.20170416.new/gdb/ppc-linux-tdep.c
---- insight-7.12.50.20170416.orig/gdb/ppc-linux-tdep.c 2017-01-03 17:36:55.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/ppc-linux-tdep.c 2017-04-16 12:29:51.478070577 +0100
-@@ -1632,7 +1632,7 @@ ppc_init_linux_record_tdep (struct linux
-
- const struct floatformat **
- ppc_floatformat_for_type (struct gdbarch *gdbarch,
-- const char *name, int len)
-+ const char *name, LONGEST len)
- {
- if (len == 128 && name)
- if (strcmp (name, "__float128") == 0
-diff -Naurp insight-7.12.50.20170416.orig/gdb/printcmd.c insight-7.12.50.20170416.new/gdb/printcmd.c
---- insight-7.12.50.20170416.orig/gdb/printcmd.c 2017-04-16 12:29:02.709616932 +0100
-+++ insight-7.12.50.20170416.new/gdb/printcmd.c 2017-04-16 12:29:51.460070410 +0100
-@@ -280,7 +280,7 @@ print_formatted (struct value *val, int
- struct ui_file *stream)
- {
- struct type *type = check_typedef (value_type (val));
-- int len = TYPE_LENGTH (type);
-+ LONGEST len = TYPE_LENGTH (type);
-
- if (VALUE_LVAL (val) == lval_memory)
- next_address = value_address (val) + len;
-@@ -357,7 +357,7 @@ print_scalar_formatted (const gdb_byte *
- {
- struct gdbarch *gdbarch = get_type_arch (type);
- LONGEST val_long = 0;
-- unsigned int len = TYPE_LENGTH (type);
-+ ULONGEST len = TYPE_LENGTH (type);
- enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
-
- /* String printing should go through val_print_scalar_formatted. */
-diff -Naurp insight-7.12.50.20170416.orig/gdb/procfs.c insight-7.12.50.20170416.new/gdb/procfs.c
---- insight-7.12.50.20170416.orig/gdb/procfs.c 2017-04-15 01:21:12.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/procfs.c 2017-04-16 12:29:51.461070419 +0100
-@@ -4864,7 +4864,7 @@ procfs_remove_watchpoint (struct target_
-
- static int
- procfs_region_ok_for_hw_watchpoint (struct target_ops *self,
-- CORE_ADDR addr, int len)
-+ CORE_ADDR addr, LONGEST len)
- {
- /* The man page for proc(4) on Solaris 2.6 and up says that the
- system can support "thousands" of hardware watchpoints, but gives
-diff -Naurp insight-7.12.50.20170416.orig/gdb/p-valprint.c insight-7.12.50.20170416.new/gdb/p-valprint.c
---- insight-7.12.50.20170416.orig/gdb/p-valprint.c 2017-01-03 17:36:55.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/p-valprint.c 2017-04-16 12:29:51.459070401 +0100
-@@ -59,7 +59,7 @@ static const struct generic_val_print_de
-
- void
- pascal_val_print (struct type *type,
-- int embedded_offset, CORE_ADDR address,
-+ LONGEST embedded_offset, CORE_ADDR address,
- struct ui_file *stream, int recurse,
- struct value *original_value,
- const struct value_print_options *options)
-@@ -70,8 +70,8 @@ pascal_val_print (struct type *type,
- unsigned len;
- LONGEST low_bound, high_bound;
- struct type *elttype;
-- unsigned eltlen;
-- int length_pos, length_size, string_pos;
-+ ULONGEST eltlen;
-+ LONGEST length_pos, length_size, string_pos;
- struct type *char_type;
- CORE_ADDR addr;
- int want_space = 0;
-diff -Naurp insight-7.12.50.20170416.orig/gdb/regcache.c insight-7.12.50.20170416.new/gdb/regcache.c
---- insight-7.12.50.20170416.orig/gdb/regcache.c 2017-03-25 10:42:37.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/regcache.c 2017-04-16 12:29:51.461070419 +0100
-@@ -988,7 +988,7 @@ typedef void (regcache_write_ftype) (str
-
- static enum register_status
- regcache_xfer_part (struct regcache *regcache, int regnum,
-- int offset, int len, void *in, const void *out,
-+ LONGEST offset, LONGEST len, void *in, const void *out,
- enum register_status (*read) (struct regcache *regcache,
- int regnum,
- gdb_byte *buf),
-@@ -1033,7 +1033,7 @@ regcache_xfer_part (struct regcache *reg
-
- enum register_status
- regcache_raw_read_part (struct regcache *regcache, int regnum,
-- int offset, int len, gdb_byte *buf)
-+ int offset, LONGEST len, gdb_byte *buf)
- {
- struct regcache_descr *descr = regcache->descr;
-
-@@ -1044,7 +1044,7 @@ regcache_raw_read_part (struct regcache
-
- void
- regcache_raw_write_part (struct regcache *regcache, int regnum,
-- int offset, int len, const gdb_byte *buf)
-+ int offset, LONGEST len, const gdb_byte *buf)
- {
- struct regcache_descr *descr = regcache->descr;
-
-@@ -1055,7 +1055,7 @@ regcache_raw_write_part (struct regcache
-
- enum register_status
- regcache_cooked_read_part (struct regcache *regcache, int regnum,
-- int offset, int len, gdb_byte *buf)
-+ LONGEST offset, LONGEST len, gdb_byte *buf)
- {
- struct regcache_descr *descr = regcache->descr;
-
-@@ -1066,7 +1066,7 @@ regcache_cooked_read_part (struct regcac
-
- void
- regcache_cooked_write_part (struct regcache *regcache, int regnum,
-- int offset, int len, const gdb_byte *buf)
-+ LONGEST offset, LONGEST len, const gdb_byte *buf)
- {
- struct regcache_descr *descr = regcache->descr;
-
-diff -Naurp insight-7.12.50.20170416.orig/gdb/regcache.h insight-7.12.50.20170416.new/gdb/regcache.h
---- insight-7.12.50.20170416.orig/gdb/regcache.h 2017-03-25 10:42:37.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/regcache.h 2017-04-16 12:29:51.462070429 +0100
-@@ -94,9 +94,9 @@ extern void regcache_raw_set_cached_valu
-
- extern enum register_status
- regcache_raw_read_part (struct regcache *regcache, int regnum,
-- int offset, int len, gdb_byte *buf);
-+ int offset, LONGEST len, gdb_byte *buf);
- void regcache_raw_write_part (struct regcache *regcache, int regnum,
-- int offset, int len, const gdb_byte *buf);
-+ int offset, LONGEST len, const gdb_byte *buf);
-
- void regcache_invalidate (struct regcache *regcache, int regnum);
-
-@@ -133,10 +133,11 @@ extern void regcache_cooked_write_unsign
- write style operations. */
-
- enum register_status regcache_cooked_read_part (struct regcache *regcache,
-- int regnum, int offset,
-- int len, gdb_byte *buf);
-+ int regnum, LONGEST offset,
-+ LONGEST len, gdb_byte *buf);
- void regcache_cooked_write_part (struct regcache *regcache, int regnum,
-- int offset, int len, const gdb_byte *buf);
-+ LONGEST offset, LONGEST len,
-+ const gdb_byte *buf);
-
- /* Special routines to read/write the PC. */
-
-diff -Naurp insight-7.12.50.20170416.orig/gdb/remote.c insight-7.12.50.20170416.new/gdb/remote.c
---- insight-7.12.50.20170416.orig/gdb/remote.c 2017-04-15 01:21:12.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/remote.c 2017-04-16 12:29:51.464070447 +0100
-@@ -9915,7 +9915,7 @@ int remote_hw_breakpoint_limit = -1;
-
- static int
- remote_region_ok_for_hw_watchpoint (struct target_ops *self,
-- CORE_ADDR addr, int len)
-+ CORE_ADDR addr, LONGEST len)
- {
- if (remote_hw_watchpoint_length_limit == 0)
- return 0;
-diff -Naurp insight-7.12.50.20170416.orig/gdb/rust-lang.c insight-7.12.50.20170416.new/gdb/rust-lang.c
---- insight-7.12.50.20170416.orig/gdb/rust-lang.c 2017-04-09 01:11:01.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/rust-lang.c 2017-04-16 12:29:51.473070531 +0100
-@@ -439,7 +439,7 @@ rust_printchar (int c, struct type *type
-
- static void
- rust_printstr (struct ui_file *stream, struct type *type,
-- const gdb_byte *string, unsigned int length,
-+ const gdb_byte *string, ULONGEST length,
- const char *user_encoding, int force_ellipses,
- const struct value_print_options *options)
- {
-@@ -563,7 +563,7 @@ static const struct generic_val_print_de
- /* la_val_print implementation for Rust. */
-
- static void
--rust_val_print (struct type *type, int embedded_offset,
-+rust_val_print (struct type *type, LONGEST embedded_offset,
- CORE_ADDR address, struct ui_file *stream, int recurse,
- struct value *val,
- const struct value_print_options *options)
-diff -Naurp insight-7.12.50.20170416.orig/gdb/s390-linux-nat.c insight-7.12.50.20170416.new/gdb/s390-linux-nat.c
---- insight-7.12.50.20170416.orig/gdb/s390-linux-nat.c 2017-03-25 10:42:37.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/s390-linux-nat.c 2017-04-16 12:29:51.471070512 +0100
-@@ -900,7 +900,7 @@ s390_remove_hw_breakpoint (struct target
-
- static int
- s390_region_ok_for_hw_watchpoint (struct target_ops *self,
-- CORE_ADDR addr, int cnt)
-+ CORE_ADDR addr, LONGEST cnt)
- {
- return 1;
- }
-diff -Naurp insight-7.12.50.20170416.orig/gdb/spu-multiarch.c insight-7.12.50.20170416.new/gdb/spu-multiarch.c
---- insight-7.12.50.20170416.orig/gdb/spu-multiarch.c 2017-03-25 10:42:37.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/spu-multiarch.c 2017-04-16 12:29:51.464070447 +0100
-@@ -127,7 +127,7 @@ spu_thread_architecture (struct target_o
- /* Override the to_region_ok_for_hw_watchpoint routine. */
- static int
- spu_region_ok_for_hw_watchpoint (struct target_ops *self,
-- CORE_ADDR addr, int len)
-+ CORE_ADDR addr, LONGEST len)
- {
- struct target_ops *ops_beneath = find_target_beneath (self);
-
-diff -Naurp insight-7.12.50.20170416.orig/gdb/stack.c insight-7.12.50.20170416.new/gdb/stack.c
---- insight-7.12.50.20170416.orig/gdb/stack.c 2017-03-04 04:09:18.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/stack.c 2017-04-16 12:29:51.465070457 +0100
-@@ -189,7 +189,7 @@ print_stack_frame (struct frame_info *fr
- argument (not just the first nameless argument). */
-
- static void
--print_frame_nameless_args (struct frame_info *frame, long start, int num,
-+print_frame_nameless_args (struct frame_info *frame, LONGEST start, int num,
- int first, struct ui_file *stream)
- {
- struct gdbarch *gdbarch = get_frame_arch (frame);
-@@ -546,7 +546,7 @@ print_frame_args (struct symbol *func, s
- /* Offset of next stack argument beyond the one we have seen that is
- at the highest offset, or -1 if we haven't come to a stack
- argument yet. */
-- long highest_offset = -1;
-+ LONGEST highest_offset = -1;
- /* Number of ints of arguments that we have printed so far. */
- int args_printed = 0;
- /* True if we should print arguments, false otherwise. */
-@@ -575,8 +575,8 @@ print_frame_args (struct symbol *func, s
- case LOC_ARG:
- case LOC_REF_ARG:
- {
-- long current_offset = SYMBOL_VALUE (sym);
-- int arg_size = TYPE_LENGTH (SYMBOL_TYPE (sym));
-+ LONGEST current_offset = SYMBOL_VALUE (sym);
-+ LONGEST arg_size = TYPE_LENGTH (SYMBOL_TYPE (sym));
-
- /* Compute address of next argument by adding the size of
- this argument and rounding to an int boundary. */
-@@ -711,7 +711,7 @@ print_frame_args (struct symbol *func, s
- enough about the stack to find them. */
- if (num != -1)
- {
-- long start;
-+ LONGEST start;
-
- if (highest_offset == -1)
- start = gdbarch_frame_args_skip (get_frame_arch (frame));
-diff -Naurp insight-7.12.50.20170416.orig/gdb/symmisc.c insight-7.12.50.20170416.new/gdb/symmisc.c
---- insight-7.12.50.20170416.orig/gdb/symmisc.c 2017-03-04 04:09:18.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/symmisc.c 2017-04-16 12:29:51.465070457 +0100
-@@ -604,11 +604,11 @@ print_symbol (void *args)
-
- case LOC_CONST_BYTES:
- {
-- unsigned i;
-+ ULONGEST i;
- struct type *type = check_typedef (SYMBOL_TYPE (symbol));
-
-- fprintf_filtered (outfile, "const %u hex bytes:",
-- TYPE_LENGTH (type));
-+ fprintf_filtered (outfile, "const %s hex bytes:",
-+ pulongest (TYPE_LENGTH (type)));
- for (i = 0; i < TYPE_LENGTH (type); i++)
- fprintf_filtered (outfile, " %02x",
- (unsigned) SYMBOL_VALUE_BYTES (symbol)[i]);
-diff -Naurp insight-7.12.50.20170416.orig/gdb/target.c insight-7.12.50.20170416.new/gdb/target.c
---- insight-7.12.50.20170416.orig/gdb/target.c 2017-04-09 01:11:01.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/target.c 2017-04-16 12:29:51.465070457 +0100
-@@ -57,7 +57,7 @@ static int default_watchpoint_addr_withi
- CORE_ADDR, CORE_ADDR, int);
-
- static int default_region_ok_for_hw_watchpoint (struct target_ops *,
-- CORE_ADDR, int);
-+ CORE_ADDR, LONGEST);
-
- static void default_rcmd (struct target_ops *, const char *, struct ui_file *);
-
-@@ -3228,7 +3228,7 @@ target_fileio_read_stralloc (struct infe
-
- static int
- default_region_ok_for_hw_watchpoint (struct target_ops *self,
-- CORE_ADDR addr, int len)
-+ CORE_ADDR addr, LONGEST len)
- {
- return (len <= gdbarch_ptr_bit (target_gdbarch ()) / TARGET_CHAR_BIT);
- }
-diff -Naurp insight-7.12.50.20170416.orig/gdb/target-delegates.c insight-7.12.50.20170416.new/gdb/target-delegates.c
---- insight-7.12.50.20170416.orig/gdb/target-delegates.c 2017-04-09 01:11:01.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/target-delegates.c 2017-04-16 12:29:51.472070521 +0100
-@@ -760,14 +760,14 @@ debug_watchpoint_addr_within_range (stru
- }
-
- static int
--delegate_region_ok_for_hw_watchpoint (struct target_ops *self, CORE_ADDR arg1, int arg2)
-+delegate_region_ok_for_hw_watchpoint (struct target_ops *self, CORE_ADDR arg1, LONGEST arg2)
- {
- self = self->beneath;
- return self->to_region_ok_for_hw_watchpoint (self, arg1, arg2);
- }
-
- static int
--debug_region_ok_for_hw_watchpoint (struct target_ops *self, CORE_ADDR arg1, int arg2)
-+debug_region_ok_for_hw_watchpoint (struct target_ops *self, CORE_ADDR arg1, LONGEST arg2)
- {
- int result;
- fprintf_unfiltered (gdb_stdlog, "-> %s->to_region_ok_for_hw_watchpoint (...)\n", debug_target.to_shortname);
-@@ -777,7 +777,7 @@ debug_region_ok_for_hw_watchpoint (struc
- fputs_unfiltered (", ", gdb_stdlog);
- target_debug_print_CORE_ADDR (arg1);
- fputs_unfiltered (", ", gdb_stdlog);
-- target_debug_print_int (arg2);
-+ target_debug_print_LONGEST (arg2);
- fputs_unfiltered (") = ", gdb_stdlog);
- target_debug_print_int (result);
- fputs_unfiltered ("\n", gdb_stdlog);
-diff -Naurp insight-7.12.50.20170416.orig/gdb/target.h insight-7.12.50.20170416.new/gdb/target.h
---- insight-7.12.50.20170416.orig/gdb/target.h 2017-04-16 12:29:02.782617611 +0100
-+++ insight-7.12.50.20170416.new/gdb/target.h 2017-04-16 12:29:51.466070466 +0100
-@@ -555,7 +555,7 @@ struct target_ops
- /* Documentation of this routine is provided with the corresponding
- target_* macro. */
- int (*to_region_ok_for_hw_watchpoint) (struct target_ops *,
-- CORE_ADDR, int)
-+ CORE_ADDR, LONGEST)
- TARGET_DEFAULT_FUNC (default_region_ok_for_hw_watchpoint);
-
- int (*to_can_accel_watchpoint_condition) (struct target_ops *,
-diff -Naurp insight-7.12.50.20170416.orig/gdb/tracepoint.c insight-7.12.50.20170416.new/gdb/tracepoint.c
---- insight-7.12.50.20170416.orig/gdb/tracepoint.c 2017-04-15 01:21:12.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/tracepoint.c 2017-04-16 12:29:51.467070475 +0100
-@@ -904,10 +904,10 @@ collection_list::add_register (unsigned
- void
- collection_list::add_memrange (struct gdbarch *gdbarch,
- int type, bfd_signed_vma base,
-- unsigned long len)
-+ ULONGEST len)
- {
- if (info_verbose)
-- printf_filtered ("(%d,%s,%ld)\n", type, paddress (gdbarch, base), len);
-+ printf_filtered ("(%d,%s,%s)\n", type, paddress (gdbarch, base), pulongest (len));
-
- /* type: memrange_absolute == memory, other n == basereg */
- /* base: addr if memory, offset if reg relative. */
-@@ -927,7 +927,7 @@ collection_list::collect_symbol (struct
- CORE_ADDR scope,
- int trace_string)
- {
-- unsigned long len;
-+ ULONGEST len;
- unsigned int reg;
- bfd_signed_vma offset;
- int treat_as_expr = 0;
-@@ -948,8 +948,8 @@ collection_list::collect_symbol (struct
- offset = SYMBOL_VALUE_ADDRESS (sym);
- if (info_verbose)
- {
-- printf_filtered ("LOC_STATIC %s: collect %ld bytes at %s.\n",
-- SYMBOL_PRINT_NAME (sym), len,
-+ printf_filtered ("LOC_STATIC %s: collect %s bytes at %s.\n",
-+ SYMBOL_PRINT_NAME (sym), pulongest (len),
- paddress (gdbarch, offset));
- }
- /* A struct may be a C++ class with static fields, go to general
-@@ -981,9 +981,9 @@ collection_list::collect_symbol (struct
- offset = frame_offset + SYMBOL_VALUE (sym);
- if (info_verbose)
- {
-- printf_filtered ("LOC_LOCAL %s: Collect %ld bytes at offset %s"
-+ printf_filtered ("LOC_LOCAL %s: Collect %s bytes at offset %s"
- " from frame ptr reg %d\n",
-- SYMBOL_PRINT_NAME (sym), len,
-+ SYMBOL_PRINT_NAME (sym), pulongest (len),
- paddress (gdbarch, offset), reg);
- }
- add_memrange (gdbarch, reg, offset, len);
-@@ -993,9 +993,9 @@ collection_list::collect_symbol (struct
- offset = 0;
- if (info_verbose)
- {
-- printf_filtered ("LOC_REGPARM_ADDR %s: Collect %ld bytes at offset %s"
-+ printf_filtered ("LOC_REGPARM_ADDR %s: Collect %s bytes at offset %s"
- " from reg %d\n",
-- SYMBOL_PRINT_NAME (sym), len,
-+ SYMBOL_PRINT_NAME (sym), pulongest (len),
- paddress (gdbarch, offset), reg);
- }
- add_memrange (gdbarch, reg, offset, len);
-@@ -1005,9 +1005,9 @@ collection_list::collect_symbol (struct
- offset = frame_offset + SYMBOL_VALUE (sym);
- if (info_verbose)
- {
-- printf_filtered ("LOC_LOCAL %s: Collect %ld bytes at offset %s"
-+ printf_filtered ("LOC_LOCAL %s: Collect %s bytes at offset %s"
- " from frame ptr reg %d\n",
-- SYMBOL_PRINT_NAME (sym), len,
-+ SYMBOL_PRINT_NAME (sym), pulongest (len),
- paddress (gdbarch, offset), reg);
- }
- add_memrange (gdbarch, reg, offset, len);
-@@ -2585,7 +2585,8 @@ scope_info (char *args, int from_tty)
- const char *symname;
- char *save_args = args;
- struct block_iterator iter;
-- int j, count = 0;
-+ int count = 0;
-+ LONGEST j;
- struct gdbarch *gdbarch;
- int regno;
-
-@@ -2727,8 +2728,11 @@ scope_info (char *args, int from_tty)
- }
- }
- if (SYMBOL_TYPE (sym))
-- printf_filtered (", length %d.\n",
-- TYPE_LENGTH (check_typedef (SYMBOL_TYPE (sym))));
-+ {
-+ ULONGEST len = TYPE_LENGTH (check_typedef (SYMBOL_TYPE (sym)));
-+
-+ printf_filtered (", length %s.\n", pulongest (len));
-+ }
- }
- if (BLOCK_FUNCTION (block))
- break;
-diff -Naurp insight-7.12.50.20170416.orig/gdb/tracepoint.h insight-7.12.50.20170416.new/gdb/tracepoint.h
---- insight-7.12.50.20170416.orig/gdb/tracepoint.h 2017-04-09 01:11:01.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/tracepoint.h 2017-04-16 12:29:51.478070577 +0100
-@@ -254,7 +254,7 @@ public:
- void add_register (unsigned int regno);
- void add_memrange (struct gdbarch *gdbarch,
- int type, bfd_signed_vma base,
-- unsigned long len);
-+ ULONGEST len);
- void collect_symbol (struct symbol *sym,
- struct gdbarch *gdbarch,
- long frame_regno, long frame_offset,
-diff -Naurp insight-7.12.50.20170416.orig/gdb/valarith.c insight-7.12.50.20170416.new/gdb/valarith.c
---- insight-7.12.50.20170416.orig/gdb/valarith.c 2017-03-25 10:42:37.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/valarith.c 2017-04-16 12:29:51.467070475 +0100
-@@ -188,7 +188,7 @@ value_subscript (struct value *array, LO
- to doubles, but no longer does. */
-
- struct value *
--value_subscripted_rvalue (struct value *array, LONGEST index, int lowerbound)
-+value_subscripted_rvalue (struct value *array, LONGEST index, LONGEST lowerbound)
- {
- struct type *array_type = check_typedef (value_type (array));
- struct type *elt_type = check_typedef (TYPE_TARGET_TYPE (array_type));
-@@ -659,7 +659,7 @@ value_concat (struct value *arg1, struct
- struct value *inval1;
- struct value *inval2;
- struct value *outval = NULL;
-- int inval1len, inval2len;
-+ ssize_t inval1len, inval2len;
- int count, idx;
- char *ptr;
- char inchar;
-@@ -1512,7 +1512,7 @@ value_binop (struct value *arg1, struct
- int
- value_logical_not (struct value *arg1)
- {
-- int len;
-+ LONGEST len;
- const gdb_byte *p;
- struct type *type1;
-
-@@ -1543,11 +1543,11 @@ value_logical_not (struct value *arg1)
- static int
- value_strcmp (struct value *arg1, struct value *arg2)
- {
-- int len1 = TYPE_LENGTH (value_type (arg1));
-- int len2 = TYPE_LENGTH (value_type (arg2));
-+ LONGEST len1 = TYPE_LENGTH (value_type (arg1));
-+ LONGEST len2 = TYPE_LENGTH (value_type (arg2));
- const gdb_byte *s1 = value_contents (arg1);
- const gdb_byte *s2 = value_contents (arg2);
-- int i, len = len1 < len2 ? len1 : len2;
-+ LONGEST i, len = len1 < len2 ? len1 : len2;
-
- for (i = 0; i < len; i++)
- {
-diff -Naurp insight-7.12.50.20170416.orig/gdb/valops.c insight-7.12.50.20170416.new/gdb/valops.c
---- insight-7.12.50.20170416.orig/gdb/valops.c 2017-03-25 10:42:37.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/valops.c 2017-04-16 12:29:51.468070484 +0100
-@@ -79,7 +79,7 @@ oload_classification classify_oload_matc
- int, int);
-
- static struct value *value_struct_elt_for_reference (struct type *,
-- int, struct type *,
-+ LONGEST, struct type *,
- const char *,
- struct type *,
- int, enum noside);
-@@ -183,7 +183,7 @@ find_function_in_inferior (const char *n
- space. */
-
- struct value *
--value_allocate_space_in_inferior (int len)
-+value_allocate_space_in_inferior (LONGEST len)
- {
- struct objfile *objf;
- struct value *val = find_function_in_inferior ("malloc", &objf);
-@@ -393,12 +393,12 @@ value_cast (struct type *type, struct va
- if (code1 == TYPE_CODE_ARRAY)
- {
- struct type *element_type = TYPE_TARGET_TYPE (type);
-- unsigned element_length = TYPE_LENGTH (check_typedef (element_type));
-+ ULONGEST element_length = TYPE_LENGTH (check_typedef (element_type));
-
- if (element_length > 0 && TYPE_ARRAY_UPPER_BOUND_IS_UNDEFINED (type))
- {
- struct type *range_type = TYPE_INDEX_TYPE (type);
-- int val_length = TYPE_LENGTH (type2);
-+ LONGEST val_length = TYPE_LENGTH (type2);
- LONGEST low_bound, high_bound, new_length;
-
- if (get_discrete_bounds (range_type, &low_bound, &high_bound) < 0)
-@@ -1064,7 +1064,7 @@ value_assign (struct value *toval, struc
- {
- const gdb_byte *dest_buffer;
- CORE_ADDR changed_addr;
-- int changed_len;
-+ LONGEST changed_len;
- gdb_byte buffer[sizeof (LONGEST)];
-
- if (value_bitsize (toval))
-@@ -3319,7 +3319,7 @@ compare_parameters (struct type *t1, str
- the form "DOMAIN::NAME". */
-
- static struct value *
--value_struct_elt_for_reference (struct type *domain, int offset,
-+value_struct_elt_for_reference (struct type *domain, LONGEST offset,
- struct type *curtype, const char *name,
- struct type *intype,
- int want_address,
-@@ -3353,7 +3353,7 @@ value_struct_elt_for_reference (struct t
- if (want_address)
- return value_from_longest
- (lookup_memberptr_type (TYPE_FIELD_TYPE (t, i), domain),
-- offset + (LONGEST) (TYPE_FIELD_BITPOS (t, i) >> 3));
-+ offset + (TYPE_FIELD_BITPOS (t, i) >> 3));
- else if (noside != EVAL_NORMAL)
- return allocate_value (TYPE_FIELD_TYPE (t, i));
- else
-@@ -3521,7 +3521,7 @@ value_struct_elt_for_reference (struct t
- for (i = TYPE_N_BASECLASSES (t) - 1; i >= 0; i--)
- {
- struct value *v;
-- int base_offset;
-+ LONGEST base_offset;
-
- if (BASETYPE_VIA_VIRTUAL (t, i))
- base_offset = 0;
-@@ -3670,7 +3670,7 @@ value_rtti_indirect_type (struct value *
- struct value *
- value_full_object (struct value *argp,
- struct type *rtype,
-- int xfull, int xtop,
-+ int xfull, LONGEST xtop,
- int xusing_enc)
- {
- struct type *real_type;
-diff -Naurp insight-7.12.50.20170416.orig/gdb/valprint.c insight-7.12.50.20170416.new/gdb/valprint.c
---- insight-7.12.50.20170416.orig/gdb/valprint.c 2017-03-25 10:42:37.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/valprint.c 2017-04-16 12:29:51.469070494 +0100
-@@ -933,7 +933,7 @@ generic_val_print_complex (struct type *
-
- void
- generic_val_print (struct type *type,
-- int embedded_offset, CORE_ADDR address,
-+ LONGEST embedded_offset, CORE_ADDR address,
- struct ui_file *stream, int recurse,
- struct value *original_value,
- const struct value_print_options *options,
-@@ -1879,7 +1879,7 @@ print_decimal_chars (struct ui_file *str
-
- void
- print_hex_chars (struct ui_file *stream, const gdb_byte *valaddr,
-- unsigned len, enum bfd_endian byte_order)
-+ ULONGEST len, enum bfd_endian byte_order)
- {
- const gdb_byte *p;
-
-@@ -2001,17 +2001,17 @@ val_print_array_elements (struct type *t
- int recurse,
- struct value *val,
- const struct value_print_options *options,
-- unsigned int i)
-+ ULONGEST i)
- {
- unsigned int things_printed = 0;
-- unsigned len;
-+ ULONGEST len;
- struct type *elttype, *index_type, *base_index_type;
-- unsigned eltlen;
-+ ULONGEST eltlen;
- /* Position of the array element we are examining to see
- whether it is repeated. */
-- unsigned int rep1;
-+ ULONGEST rep1;
- /* Number of repetitions we have detected so far. */
-- unsigned int reps;
-+ ULONGEST reps;
- LONGEST low_bound, high_bound;
- LONGEST low_pos, high_pos;
-
-@@ -2101,7 +2101,7 @@ val_print_array_elements (struct type *t
- address, stream, recurse + 1, val, options,
- current_language);
- annotate_elt_rep (reps);
-- fprintf_filtered (stream, " <repeats %u times>", reps);
-+ fprintf_filtered (stream, " <repeats %s times>", pulongest (reps));
- annotate_elt_rep_end ();
-
- i = rep1 - 1;
-@@ -2753,7 +2753,7 @@ print_converted_chars_to_obstack (struct
-
- void
- generic_printstr (struct ui_file *stream, struct type *type,
-- const gdb_byte *string, unsigned int length,
-+ const gdb_byte *string, ULONGEST length,
- const char *encoding, int force_ellipses,
- int quote_char, int c_style_terminator,
- const struct value_print_options *options)
-diff -Naurp insight-7.12.50.20170416.orig/gdb/valprint.h insight-7.12.50.20170416.new/gdb/valprint.h
---- insight-7.12.50.20170416.orig/gdb/valprint.h 2017-01-03 17:36:55.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/valprint.h 2017-04-16 12:29:51.469070494 +0100
-@@ -119,7 +119,7 @@ extern void val_print_array_elements (st
- CORE_ADDR, struct ui_file *, int,
- struct value *,
- const struct value_print_options *,
-- unsigned int);
-+ ULONGEST);
-
- extern void val_print_type_code_int (struct type *, const gdb_byte *,
- struct ui_file *);
-@@ -141,7 +141,7 @@ extern void print_decimal_chars (struct
- unsigned int, enum bfd_endian);
-
- extern void print_hex_chars (struct ui_file *, const gdb_byte *,
-- unsigned int, enum bfd_endian);
-+ ULONGEST, enum bfd_endian);
-
- extern void print_char_chars (struct ui_file *, struct type *,
- const gdb_byte *, unsigned int, enum bfd_endian);
-@@ -194,7 +194,7 @@ struct generic_val_print_decorations
-
-
- extern void generic_val_print (struct type *type,
-- int embedded_offset, CORE_ADDR address,
-+ LONGEST embedded_offset, CORE_ADDR address,
- struct ui_file *stream, int recurse,
- struct value *original_value,
- const struct value_print_options *options,
-@@ -204,7 +204,7 @@ extern void generic_emit_char (int c, st
- int quoter, const char *encoding);
-
- extern void generic_printstr (struct ui_file *stream, struct type *type,
-- const gdb_byte *string, unsigned int length,
-+ const gdb_byte *string, ULONGEST length,
- const char *encoding, int force_ellipses,
- int quote_char, int c_style_terminator,
- const struct value_print_options *options);
-diff -Naurp insight-7.12.50.20170416.orig/gdb/value.c insight-7.12.50.20170416.new/gdb/value.c
---- insight-7.12.50.20170416.orig/gdb/value.c 2017-04-16 12:29:02.690616755 +0100
-+++ insight-7.12.50.20170416.new/gdb/value.c 2017-04-16 12:29:51.470070503 +0100
-@@ -367,7 +367,8 @@ value_bytes_available (const struct valu
- }
-
- int
--value_bits_any_optimized_out (const struct value *value, int bit_offset, int bit_length)
-+value_bits_any_optimized_out (const struct value *value, LONGEST bit_offset,
-+ LONGEST bit_length)
- {
- gdb_assert (!value->lazy);
-
-@@ -813,9 +814,9 @@ find_first_range_overlap_and_match (stru
- Return true if the available bits match. */
-
- static int
--value_contents_bits_eq (const struct value *val1, int offset1,
-- const struct value *val2, int offset2,
-- int length)
-+value_contents_bits_eq (const struct value *val1, LONGEST offset1,
-+ const struct value *val2, LONGEST offset2,
-+ LONGEST length)
- {
- /* Each array element corresponds to a ranges source (unavailable,
- optimized out). '1' is for VAL1, '2' for VAL2. */
-@@ -1455,7 +1456,8 @@ value_optimized_out (struct value *value
- the following LENGTH bytes. */
-
- void
--mark_value_bytes_optimized_out (struct value *value, int offset, int length)
-+mark_value_bytes_optimized_out (struct value *value, LONGEST offset,
-+ LONGEST length)
- {
- mark_value_bits_optimized_out (value,
- offset * TARGET_CHAR_BIT,
-diff -Naurp insight-7.12.50.20170416.orig/gdb/value.h insight-7.12.50.20170416.new/gdb/value.h
---- insight-7.12.50.20170416.orig/gdb/value.h 2017-03-25 10:42:37.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/value.h 2017-04-16 12:29:51.471070512 +0100
-@@ -246,7 +246,7 @@ struct lval_funcs
- /* If non-NULL, this is used to determine whether the indicated bits
- of VALUE are a synthetic pointer. */
- int (*check_synthetic_pointer) (const struct value *value,
-- LONGEST offset, int length);
-+ LONGEST offset, LONGEST length);
-
- /* Return a duplicate of VALUE's closure, for use in a new value.
- This may simply return the same closure, if VALUE's is
-@@ -377,7 +377,8 @@ extern int value_optimized_out (struct v
- otherwise. */
-
- extern int value_bits_any_optimized_out (const struct value *value,
-- int bit_offset, int bit_length);
-+ LONGEST bit_offset,
-+ LONGEST bit_length);
-
- /* Like value_optimized_out, but return true iff the whole value is
- optimized out. */
-@@ -387,7 +388,7 @@ extern int value_entirely_optimized_out
- LENGTH bytes as optimized out. */
-
- extern void mark_value_bytes_optimized_out (struct value *value,
-- int offset, int length);
-+ LONGEST offset, LONGEST length);
-
- /* Mark VALUE's content bits starting at OFFSET and extending for
- LENGTH bits as optimized out. */
-@@ -820,12 +821,11 @@ extern struct value *value_primitive_fie
- int fieldno,
- struct type *arg_type);
-
--
- extern struct type *value_rtti_indirect_type (struct value *, int *, LONGEST *,
- int *);
-
- extern struct value *value_full_object (struct value *, struct type *, int,
-- int, int);
-+ LONGEST, int);
-
- extern struct value *value_cast_pointers (struct type *, struct value *, int);
-
-@@ -1112,10 +1112,11 @@ extern struct value *value_literal_compl
- extern struct value *find_function_in_inferior (const char *,
- struct objfile **);
-
--extern struct value *value_allocate_space_in_inferior (int);
-+extern struct value *value_allocate_space_in_inferior (LONGEST);
-
- extern struct value *value_subscripted_rvalue (struct value *array,
-- LONGEST index, int lowerbound);
-+ LONGEST index,
-+ LONGEST lowerbound);
-
- /* User function handler. */
-
-diff -Naurp insight-7.12.50.20170416.orig/gdb/x86-nat.c insight-7.12.50.20170416.new/gdb/x86-nat.c
---- insight-7.12.50.20170416.orig/gdb/x86-nat.c 2017-01-03 17:36:55.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/x86-nat.c 2017-04-16 12:29:51.473070531 +0100
-@@ -174,7 +174,7 @@ x86_remove_watchpoint (struct target_ops
-
- static int
- x86_region_ok_for_watchpoint (struct target_ops *self,
-- CORE_ADDR addr, int len)
-+ CORE_ADDR addr, LONGEST len)
- {
- struct x86_debug_reg_state *state
- = x86_debug_reg_state (ptid_get_pid (inferior_ptid));
diff --git a/insight-7.12-gdb-rhbz795424-bitpos-23of25.patch b/insight-7.12-gdb-rhbz795424-bitpos-23of25.patch
deleted file mode 100644
index 9f75cad..0000000
--- a/insight-7.12-gdb-rhbz795424-bitpos-23of25.patch
+++ /dev/null
@@ -1,1137 +0,0 @@
-diff -Naurp insight-7.12.50.20170416.orig/gdb/alpha-tdep.c insight-7.12.50.20170416.new/gdb/alpha-tdep.c
---- insight-7.12.50.20170416.orig/gdb/alpha-tdep.c 2017-04-16 12:45:38.999884453 +0100
-+++ insight-7.12.50.20170416.new/gdb/alpha-tdep.c 2017-04-16 12:46:32.449381642 +0100
-@@ -300,17 +300,17 @@ alpha_push_dummy_call (struct gdbarch *g
- {
- enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
- int i;
-- int accumulate_size = struct_return ? 8 : 0;
-+ ssize_t accumulate_size = struct_return ? 8 : 0;
- struct alpha_arg
- {
- const gdb_byte *contents;
-- int len;
-- int offset;
-+ ssize_t len;
-+ ssize_t offset;
- };
- struct alpha_arg *alpha_args = XALLOCAVEC (struct alpha_arg, nargs);
- struct alpha_arg *m_arg;
- gdb_byte arg_reg_buffer[ALPHA_REGISTER_SIZE * ALPHA_NUM_ARG_REGS];
-- int required_arg_regs;
-+ ssize_t required_arg_regs;
- CORE_ADDR func_addr = find_function_addr (function, NULL);
-
- /* The ABI places the address of the called function in T12. */
-@@ -430,8 +430,8 @@ alpha_push_dummy_call (struct gdbarch *g
- for (i = nargs; m_arg--, --i >= 0;)
- {
- const gdb_byte *contents = m_arg->contents;
-- int offset = m_arg->offset;
-- int len = m_arg->len;
-+ ssize_t offset = m_arg->offset;
-+ ssize_t len = m_arg->len;
-
- /* Copy the bytes destined for registers into arg_reg_buffer. */
- if (offset < sizeof(arg_reg_buffer))
-@@ -443,7 +443,7 @@ alpha_push_dummy_call (struct gdbarch *g
- }
- else
- {
-- int tlen = sizeof(arg_reg_buffer) - offset;
-+ ssize_t tlen = sizeof(arg_reg_buffer) - offset;
- memcpy (arg_reg_buffer + offset, contents, tlen);
- offset += tlen;
- contents += tlen;
-diff -Naurp insight-7.12.50.20170416.orig/gdb/amd64-tdep.c insight-7.12.50.20170416.new/gdb/amd64-tdep.c
---- insight-7.12.50.20170416.orig/gdb/amd64-tdep.c 2017-04-16 12:45:38.685881532 +0100
-+++ insight-7.12.50.20170416.new/gdb/amd64-tdep.c 2017-04-16 12:46:32.450381651 +0100
-@@ -735,7 +735,7 @@ amd64_return_value (struct gdbarch *gdba
- gdb_byte *readbuf, const gdb_byte *writebuf)
- {
- enum amd64_reg_class theclass[2];
-- int len = TYPE_LENGTH (type);
-+ LONGEST len = TYPE_LENGTH (type);
- static int integer_regnum[] = { AMD64_RAX_REGNUM, AMD64_RDX_REGNUM };
- static int sse_regnum[] = { AMD64_XMM0_REGNUM, AMD64_XMM1_REGNUM };
- int integer_reg = 0;
-@@ -852,10 +852,10 @@ amd64_return_value (struct gdbarch *gdba
- gdb_assert (regnum != -1);
-
- if (readbuf)
-- regcache_raw_read_part (regcache, regnum, offset, std::min (len, 8),
-+ regcache_raw_read_part (regcache, regnum, offset, std::min (len, (LONGEST) 8),
- readbuf + i * 8);
- if (writebuf)
-- regcache_raw_write_part (regcache, regnum, offset, std::min (len, 8),
-+ regcache_raw_write_part (regcache, regnum, offset, std::min (len, (LONGEST) 8),
- writebuf + i * 8);
- }
-
-@@ -886,8 +886,8 @@ amd64_push_arguments (struct regcache *r
- };
- struct value **stack_args = XALLOCAVEC (struct value *, nargs);
- int num_stack_args = 0;
-- int num_elements = 0;
-- int element = 0;
-+ LONGEST num_elements = 0;
-+ LONGEST element = 0;
- int integer_reg = 0;
- int sse_reg = 0;
- int i;
-@@ -899,7 +899,7 @@ amd64_push_arguments (struct regcache *r
- for (i = 0; i < nargs; i++)
- {
- struct type *type = value_type (args[i]);
-- int len = TYPE_LENGTH (type);
-+ LONGEST len = TYPE_LENGTH (type);
- enum amd64_reg_class theclass[2];
- int needed_integer_regs = 0;
- int needed_sse_regs = 0;
-@@ -963,7 +963,7 @@ amd64_push_arguments (struct regcache *r
-
- gdb_assert (regnum != -1);
- memset (buf, 0, sizeof buf);
-- memcpy (buf, valbuf + j * 8, std::min (len, 8));
-+ memcpy (buf, valbuf + j * 8, std::min (len, (LONGEST) 8));
- regcache_raw_write_part (regcache, regnum, offset, 8, buf);
- }
- }
-diff -Naurp insight-7.12.50.20170416.orig/gdb/amd64-windows-tdep.c insight-7.12.50.20170416.new/gdb/amd64-windows-tdep.c
---- insight-7.12.50.20170416.orig/gdb/amd64-windows-tdep.c 2017-03-25 10:42:37.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/amd64-windows-tdep.c 2017-04-16 12:46:32.450381651 +0100
-@@ -290,7 +290,7 @@ amd64_windows_return_value (struct gdbar
- struct type *type, struct regcache *regcache,
- gdb_byte *readbuf, const gdb_byte *writebuf)
- {
-- int len = TYPE_LENGTH (type);
-+ LONGEST len = TYPE_LENGTH (type);
- int regnum = -1;
-
- /* See if our value is returned through a register. If it is, then
-diff -Naurp insight-7.12.50.20170416.orig/gdb/arm-tdep.c insight-7.12.50.20170416.new/gdb/arm-tdep.c
---- insight-7.12.50.20170416.orig/gdb/arm-tdep.c 2017-04-15 01:21:12.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/arm-tdep.c 2017-04-16 12:46:32.453381679 +0100
-@@ -3492,7 +3492,7 @@ arm_vfp_cprc_reg_char (enum arm_vfp_cprc
- array). Vector types are not currently supported, matching the
- generic AAPCS support. */
-
--static int
-+static LONGEST
- arm_vfp_cprc_sub_candidate (struct type *t,
- enum arm_vfp_cprc_base_type *base_type)
- {
-@@ -3575,7 +3575,7 @@ arm_vfp_cprc_sub_candidate (struct type
- }
- else
- {
-- int count;
-+ LONGEST count;
- unsigned unitlen;
-
- count = arm_vfp_cprc_sub_candidate (TYPE_TARGET_TYPE (t),
-@@ -3598,12 +3598,12 @@ arm_vfp_cprc_sub_candidate (struct type
-
- case TYPE_CODE_STRUCT:
- {
-- int count = 0;
-+ LONGEST count = 0;
- unsigned unitlen;
- int i;
- for (i = 0; i < TYPE_NFIELDS (t); i++)
- {
-- int sub_count = 0;
-+ LONGEST sub_count = 0;
-
- if (!field_is_static (&TYPE_FIELD (t, i)))
- sub_count = arm_vfp_cprc_sub_candidate (TYPE_FIELD_TYPE (t, i),
-@@ -3627,13 +3627,15 @@ arm_vfp_cprc_sub_candidate (struct type
-
- case TYPE_CODE_UNION:
- {
-- int count = 0;
-+ LONGEST count = 0;
- unsigned unitlen;
- int i;
- for (i = 0; i < TYPE_NFIELDS (t); i++)
- {
-- int sub_count = arm_vfp_cprc_sub_candidate (TYPE_FIELD_TYPE (t, i),
-- base_type);
-+ LONGEST sub_count;
-+
-+ sub_count = arm_vfp_cprc_sub_candidate (TYPE_FIELD_TYPE (t, i),
-+ base_type);
- if (sub_count == -1)
- return -1;
- count = (count > sub_count ? count : sub_count);
-@@ -3669,7 +3671,7 @@ arm_vfp_call_candidate (struct type *t,
- int *count)
- {
- enum arm_vfp_cprc_base_type b = VFP_CPRC_UNKNOWN;
-- int c = arm_vfp_cprc_sub_candidate (t, &b);
-+ LONGEST c = arm_vfp_cprc_sub_candidate (t, &b);
- if (c <= 0 || c > 4)
- return 0;
- *base_type = b;
-@@ -3750,7 +3752,7 @@ arm_push_dummy_call (struct gdbarch *gdb
-
- for (argnum = 0; argnum < nargs; argnum++)
- {
-- int len;
-+ LONGEST len;
- struct type *arg_type;
- struct type *target_type;
- enum type_code typecode;
-diff -Naurp insight-7.12.50.20170416.orig/gdb/avr-tdep.c insight-7.12.50.20170416.new/gdb/avr-tdep.c
---- insight-7.12.50.20170416.orig/gdb/avr-tdep.c 2017-04-15 01:21:12.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/avr-tdep.c 2017-04-16 12:46:32.454381689 +0100
-@@ -1191,13 +1191,13 @@ avr_dummy_id (struct gdbarch *gdbarch, s
-
- struct stack_item
- {
-- int len;
-+ ssize_t len;
- struct stack_item *prev;
- gdb_byte *data;
- };
-
- static struct stack_item *
--push_stack_item (struct stack_item *prev, const bfd_byte *contents, int len)
-+push_stack_item (struct stack_item *prev, const bfd_byte *contents, ssize_t len)
- {
- struct stack_item *si;
- si = XNEW (struct stack_item);
-@@ -1285,12 +1285,12 @@ avr_push_dummy_call (struct gdbarch *gdb
-
- for (i = 0; i < nargs; i++)
- {
-- int last_regnum;
-- int j;
-+ ssize_t last_regnum;
-+ ssize_t j;
- struct value *arg = args[i];
- struct type *type = check_typedef (value_type (arg));
- const bfd_byte *contents = value_contents (arg);
-- int len = TYPE_LENGTH (type);
-+ ssize_t len = TYPE_LENGTH (type);
-
- /* Calculate the potential last register needed.
- E.g. For length 2, registers regnum and regnum-1 (say 25 and 24)
-diff -Naurp insight-7.12.50.20170416.orig/gdb/bfin-tdep.c insight-7.12.50.20170416.new/gdb/bfin-tdep.c
---- insight-7.12.50.20170416.orig/gdb/bfin-tdep.c 2017-04-09 01:11:01.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/bfin-tdep.c 2017-04-16 12:46:32.455381698 +0100
-@@ -504,7 +504,7 @@ bfin_push_dummy_call (struct gdbarch *gd
- enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
- int i;
- long reg_r0, reg_r1, reg_r2;
-- int total_len = 0;
-+ ssize_t total_len = 0;
-
- for (i = nargs - 1; i >= 0; i--)
- {
-@@ -526,7 +526,7 @@ bfin_push_dummy_call (struct gdbarch *gd
- {
- struct type *value_type = value_enclosing_type (args[i]);
- struct type *arg_type = check_typedef (value_type);
-- int container_len = (TYPE_LENGTH (value_type) + 3) & ~3;
-+ ssize_t container_len = (TYPE_LENGTH (value_type) + 3) & ~3;
-
- sp -= container_len;
- write_memory (sp, value_contents (args[i]), container_len);
-diff -Naurp insight-7.12.50.20170416.orig/gdb/cris-tdep.c insight-7.12.50.20170416.new/gdb/cris-tdep.c
---- insight-7.12.50.20170416.orig/gdb/cris-tdep.c 2017-04-09 01:11:01.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/cris-tdep.c 2017-04-16 12:46:32.457381717 +0100
-@@ -663,13 +663,13 @@ static CORE_ADDR cris_unwind_sp (struct
-
- struct stack_item
- {
-- int len;
-+ ssize_t len;
- struct stack_item *prev;
- gdb_byte *data;
- };
-
- static struct stack_item *
--push_stack_item (struct stack_item *prev, const gdb_byte *contents, int len)
-+push_stack_item (struct stack_item *prev, const gdb_byte *contents, ssize_t len)
- {
- struct stack_item *si = XNEW (struct stack_item);
- si->data = (gdb_byte *) xmalloc (len);
-@@ -833,13 +833,13 @@ cris_push_dummy_call (struct gdbarch *gd
-
- for (argnum = 0; argnum < nargs; argnum++)
- {
-- int len;
-+ ssize_t len;
- const gdb_byte *val;
-- int reg_demand;
-- int i;
-+ ssize_t reg_demand;
-+ ssize_t i;
-
-- len = TYPE_LENGTH (value_type (args[argnum]));
- val = value_contents (args[argnum]);
-+ len = TYPE_LENGTH (value_type (args[argnum]));
-
- /* How may registers worth of storage do we need for this argument? */
- reg_demand = (len / 4) + (len % 4 != 0 ? 1 : 0);
-diff -Naurp insight-7.12.50.20170416.orig/gdb/h8300-tdep.c insight-7.12.50.20170416.new/gdb/h8300-tdep.c
---- insight-7.12.50.20170416.orig/gdb/h8300-tdep.c 2017-04-15 01:21:12.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/h8300-tdep.c 2017-04-16 12:46:32.457381717 +0100
-@@ -637,7 +637,7 @@ h8300_push_dummy_call (struct gdbarch *g
- int struct_return, CORE_ADDR struct_addr)
- {
- enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
-- int stack_alloc = 0, stack_offset = 0;
-+ LONGEST stack_alloc = 0, stack_offset = 0;
- int wordsize = BINWORD (gdbarch);
- int reg = E_ARG0_REGNUM;
- int argument;
-@@ -664,11 +664,11 @@ h8300_push_dummy_call (struct gdbarch *g
- {
- struct cleanup *back_to;
- struct type *type = value_type (args[argument]);
-- int len = TYPE_LENGTH (type);
-+ ssize_t len = TYPE_LENGTH (type);
- char *contents = (char *) value_contents (args[argument]);
-
- /* Pad the argument appropriately. */
-- int padded_len = align_up (len, wordsize);
-+ ssize_t padded_len = align_up (len, wordsize);
- gdb_byte *padded = (gdb_byte *) xmalloc (padded_len);
- back_to = make_cleanup (xfree, padded);
-
-@@ -697,7 +697,7 @@ h8300_push_dummy_call (struct gdbarch *g
- /* Heavens to Betsy --- it's really going in registers!
- Note that on the h8/300s, there are gaps between the
- registers in the register file. */
-- int offset;
-+ ssize_t offset;
-
- for (offset = 0; offset < padded_len; offset += wordsize)
- {
-diff -Naurp insight-7.12.50.20170416.orig/gdb/hppa-tdep.c insight-7.12.50.20170416.new/gdb/hppa-tdep.c
---- insight-7.12.50.20170416.orig/gdb/hppa-tdep.c 2017-04-09 01:11:01.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/hppa-tdep.c 2017-04-16 12:46:32.458381726 +0100
-@@ -989,7 +989,7 @@ hppa64_push_dummy_call (struct gdbarch *
- {
- struct value *arg = args[i];
- struct type *type = value_type (arg);
-- int len = TYPE_LENGTH (type);
-+ LONGEST len = TYPE_LENGTH (type);
- const bfd_byte *valbuf;
- bfd_byte fptrbuf[8];
- int regnum;
-@@ -1184,7 +1184,7 @@ hppa64_return_value (struct gdbarch *gdb
- struct type *type, struct regcache *regcache,
- gdb_byte *readbuf, const gdb_byte *writebuf)
- {
-- int len = TYPE_LENGTH (type);
-+ LONGEST len = TYPE_LENGTH (type);
- int regnum, offset;
-
- if (len > 16)
-diff -Naurp insight-7.12.50.20170416.orig/gdb/i386-darwin-tdep.c insight-7.12.50.20170416.new/gdb/i386-darwin-tdep.c
---- insight-7.12.50.20170416.orig/gdb/i386-darwin-tdep.c 2017-01-03 17:36:55.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/i386-darwin-tdep.c 2017-04-16 12:46:32.459381735 +0100
-@@ -167,7 +167,7 @@ i386_darwin_push_dummy_call (struct gdba
-
- for (write_pass = 0; write_pass < 2; write_pass++)
- {
-- int args_space = 0;
-+ LONGEST args_space = 0;
- int num_m128 = 0;
-
- if (struct_return)
-diff -Naurp insight-7.12.50.20170416.orig/gdb/i386-tdep.c insight-7.12.50.20170416.new/gdb/i386-tdep.c
---- insight-7.12.50.20170416.orig/gdb/i386-tdep.c 2017-04-16 12:45:38.982884295 +0100
-+++ insight-7.12.50.20170416.new/gdb/i386-tdep.c 2017-04-16 12:46:32.461381754 +0100
-@@ -2682,7 +2682,7 @@ i386_push_dummy_call (struct gdbarch *gd
- gdb_byte buf[4];
- int i;
- int write_pass;
-- int args_space = 0;
-+ LONGEST args_space = 0;
-
- /* BND registers can be in arbitrary values at the moment of the
- inferior call. This can cause boundary violations that are not
-@@ -2697,7 +2697,7 @@ i386_push_dummy_call (struct gdbarch *gd
-
- for (write_pass = 0; write_pass < 2; write_pass++)
- {
-- int args_space_used = 0;
-+ LONGEST args_space_used = 0;
-
- if (struct_return)
- {
-@@ -2714,7 +2714,7 @@ i386_push_dummy_call (struct gdbarch *gd
-
- for (i = 0; i < nargs; i++)
- {
-- int len = TYPE_LENGTH (value_enclosing_type (args[i]));
-+ LONGEST len = TYPE_LENGTH (value_enclosing_type (args[i]));
-
- if (write_pass)
- {
-@@ -2921,7 +2921,7 @@ i386_reg_struct_return_p (struct gdbarch
- {
- struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
- enum type_code code = TYPE_CODE (type);
-- int len = TYPE_LENGTH (type);
-+ LONGEST len = TYPE_LENGTH (type);
-
- gdb_assert (code == TYPE_CODE_STRUCT
- || code == TYPE_CODE_UNION
-@@ -3743,7 +3743,7 @@ static int
- i386_convert_register_p (struct gdbarch *gdbarch,
- int regnum, struct type *type)
- {
-- int len = TYPE_LENGTH (type);
-+ LONGEST len = TYPE_LENGTH (type);
-
- /* Values may be spread across multiple registers. Most debugging
- formats aren't expressive enough to specify the locations, so
-@@ -3776,7 +3776,7 @@ i386_register_to_value (struct frame_inf
- int *optimizedp, int *unavailablep)
- {
- struct gdbarch *gdbarch = get_frame_arch (frame);
-- int len = TYPE_LENGTH (type);
-+ LONGEST len = TYPE_LENGTH (type);
-
- if (i386_fp_regnum_p (gdbarch, regnum))
- return i387_register_to_value (frame, regnum, type, to,
-@@ -3812,7 +3812,7 @@ static void
- i386_value_to_register (struct frame_info *frame, int regnum,
- struct type *type, const gdb_byte *from)
- {
-- int len = TYPE_LENGTH (type);
-+ LONGEST len = TYPE_LENGTH (type);
-
- if (i386_fp_regnum_p (get_frame_arch (frame), regnum))
- {
-diff -Naurp insight-7.12.50.20170416.orig/gdb/iq2000-tdep.c insight-7.12.50.20170416.new/gdb/iq2000-tdep.c
---- insight-7.12.50.20170416.orig/gdb/iq2000-tdep.c 2017-01-03 17:36:55.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/iq2000-tdep.c 2017-04-16 12:46:32.461381754 +0100
-@@ -651,8 +651,9 @@ iq2000_push_dummy_call (struct gdbarch *
- const bfd_byte *val;
- bfd_byte buf[4];
- struct type *type;
-- int i, argreg, typelen, slacklen;
-- int stackspace = 0;
-+ int i, argreg, slacklen;
-+ LONGEST typelen;
-+ LONGEST stackspace = 0;
- /* Used to copy struct arguments into the stack. */
- CORE_ADDR struct_ptr;
-
-diff -Naurp insight-7.12.50.20170416.orig/gdb/m32r-tdep.c insight-7.12.50.20170416.new/gdb/m32r-tdep.c
---- insight-7.12.50.20170416.orig/gdb/m32r-tdep.c 2017-04-15 01:21:12.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/m32r-tdep.c 2017-04-16 12:48:29.791473162 +0100
-@@ -681,7 +681,7 @@ m32r_push_dummy_call (struct gdbarch *gd
- CORE_ADDR regval;
- gdb_byte *val;
- gdb_byte valbuf[M32R_ARG_REGISTER_SIZE];
-- int len;
-+ LONGEST len;
-
- /* First force sp to a 4-byte alignment. */
- sp = sp & ~3;
-diff -Naurp insight-7.12.50.20170416.orig/gdb/m68k-tdep.c insight-7.12.50.20170416.new/gdb/m68k-tdep.c
---- insight-7.12.50.20170416.orig/gdb/m68k-tdep.c 2017-01-03 17:36:55.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/m68k-tdep.c 2017-04-16 12:46:32.463381773 +0100
-@@ -377,7 +377,7 @@ m68k_reg_struct_return_p (struct gdbarch
- {
- struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
- enum type_code code = TYPE_CODE (type);
-- int len = TYPE_LENGTH (type);
-+ LONGEST len = TYPE_LENGTH (type);
-
- gdb_assert (code == TYPE_CODE_STRUCT || code == TYPE_CODE_UNION
- || code == TYPE_CODE_COMPLEX);
-@@ -509,9 +509,9 @@ m68k_push_dummy_call (struct gdbarch *gd
- for (i = nargs - 1; i >= 0; i--)
- {
- struct type *value_type = value_enclosing_type (args[i]);
-- int len = TYPE_LENGTH (value_type);
-- int container_len = (len + 3) & ~3;
-- int offset;
-+ LONGEST len = TYPE_LENGTH (value_type);
-+ LONGEST container_len = (len + 3) & ~3;
-+ LONGEST offset;
-
- /* Non-scalars bigger than 4 bytes are left aligned, others are
- right aligned. */
-diff -Naurp insight-7.12.50.20170416.orig/gdb/m88k-tdep.c insight-7.12.50.20170416.new/gdb/m88k-tdep.c
---- insight-7.12.50.20170416.orig/gdb/m88k-tdep.c 2017-04-09 01:11:01.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/m88k-tdep.c 2017-04-16 12:46:32.464381782 +0100
-@@ -254,13 +254,13 @@ m88k_store_arguments (struct regcache *r
- {
- struct gdbarch *gdbarch = get_regcache_arch (regcache);
- int num_register_words = 0;
-- int num_stack_words = 0;
-+ LONGEST num_stack_words = 0;
- int i;
-
- for (i = 0; i < nargs; i++)
- {
- struct type *type = value_type (args[i]);
-- int len = TYPE_LENGTH (type);
-+ LONGEST len = TYPE_LENGTH (type);
-
- if (m88k_integral_or_pointer_p (type) && len < 4)
- {
-@@ -302,8 +302,8 @@ m88k_store_arguments (struct regcache *r
- {
- const bfd_byte *valbuf = value_contents (args[i]);
- struct type *type = value_type (args[i]);
-- int len = TYPE_LENGTH (type);
-- int stack_word = num_stack_words;
-+ LONGEST len = TYPE_LENGTH (type);
-+ LONGEST stack_word = num_stack_words;
-
- if (m88k_in_register_p (type))
- {
-diff -Naurp insight-7.12.50.20170416.orig/gdb/mep-tdep.c insight-7.12.50.20170416.new/gdb/mep-tdep.c
---- insight-7.12.50.20170416.orig/gdb/mep-tdep.c 2017-04-09 01:11:01.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/mep-tdep.c 2017-04-16 12:46:32.465381791 +0100
-@@ -2262,7 +2262,7 @@ push_large_arguments (CORE_ADDR sp, int
-
- for (i = 0; i < argc; i++)
- {
-- unsigned arg_len = TYPE_LENGTH (value_type (argv[i]));
-+ ULONGEST arg_len = TYPE_LENGTH (value_type (argv[i]));
-
- if (arg_len > MEP_GPR_SIZE)
- {
-diff -Naurp insight-7.12.50.20170416.orig/gdb/mips-tdep.c insight-7.12.50.20170416.new/gdb/mips-tdep.c
---- insight-7.12.50.20170416.orig/gdb/mips-tdep.c 2017-04-09 01:11:01.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/mips-tdep.c 2017-04-16 12:46:32.468381819 +0100
-@@ -474,7 +474,7 @@ static void
- mips_xfer_register (struct gdbarch *gdbarch, struct regcache *regcache,
- int reg_num, int length,
- enum bfd_endian endian, gdb_byte *in,
-- const gdb_byte *out, int buf_offset)
-+ const gdb_byte *out, LONGEST buf_offset)
- {
- int reg_offset = 0;
-
-@@ -497,8 +497,8 @@ mips_xfer_register (struct gdbarch *gdba
- }
- if (mips_debug)
- fprintf_unfiltered (gdb_stderr,
-- "xfer $%d, reg offset %d, buf offset %d, length %d, ",
-- reg_num, reg_offset, buf_offset, length);
-+ "xfer $%d, reg offset %d, buf offset %s, length %d, ",
-+ reg_num, reg_offset, plongest (buf_offset), length);
- if (mips_debug && out != NULL)
- {
- int i;
-@@ -4530,13 +4530,13 @@ mips_eabi_push_dummy_call (struct gdbarc
- gdb_byte valbuf[MAX_REGISTER_SIZE];
- struct value *arg = args[argnum];
- struct type *arg_type = check_typedef (value_type (arg));
-- int len = TYPE_LENGTH (arg_type);
-+ LONGEST len = TYPE_LENGTH (arg_type);
- enum type_code typecode = TYPE_CODE (arg_type);
-
- if (mips_debug)
- fprintf_unfiltered (gdb_stdlog,
-- "mips_eabi_push_dummy_call: %d len=%d type=%d",
-- argnum + 1, len, (int) typecode);
-+ "mips_eabi_push_dummy_call: %d len=%s type=%d",
-+ argnum + 1, plongest (len), (int) typecode);
-
- /* The EABI passes structures that do not fit in a register by
- reference. */
-@@ -4805,7 +4805,7 @@ mips_eabi_return_value (struct gdbarch *
-
- static int
- mips_n32n64_fp_arg_chunk_p (struct gdbarch *gdbarch, struct type *arg_type,
-- int offset)
-+ LONGEST offset)
- {
- int i;
-
-@@ -4820,7 +4820,7 @@ mips_n32n64_fp_arg_chunk_p (struct gdbar
-
- for (i = 0; i < TYPE_NFIELDS (arg_type); i++)
- {
-- int pos;
-+ LONGEST pos;
- struct type *field_type;
-
- /* We're only looking at normal fields. */
-@@ -4862,7 +4862,7 @@ mips_n32n64_push_dummy_call (struct gdba
- int argreg;
- int float_argreg;
- int argnum;
-- int len = 0;
-+ LONGEST len = 0;
- int stack_offset = 0;
- enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
- CORE_ADDR func_addr = find_function_addr (function, NULL);
-@@ -5213,11 +5213,11 @@ mips_n32n64_return_value (struct gdbarch
- : MIPS_V0_REGNUM);
- field < TYPE_NFIELDS (type); field++, regnum += 2)
- {
-- int offset = (FIELD_BITPOS (TYPE_FIELDS (type)[field])
-- / TARGET_CHAR_BIT);
-+ LONGEST offset = (FIELD_BITPOS (TYPE_FIELDS (type)[field])
-+ / TARGET_CHAR_BIT);
- if (mips_debug)
-- fprintf_unfiltered (gdb_stderr, "Return float struct+%d\n",
-- offset);
-+ fprintf_unfiltered (gdb_stderr, "Return float struct+%s\n",
-+ plongest (offset));
- if (TYPE_LENGTH (TYPE_FIELD_TYPE (type, field)) == 16)
- {
- /* A 16-byte long double field goes in two consecutive
-@@ -5259,8 +5259,8 @@ mips_n32n64_return_value (struct gdbarch
- if (offset + xfer > TYPE_LENGTH (type))
- xfer = TYPE_LENGTH (type) - offset;
- if (mips_debug)
-- fprintf_unfiltered (gdb_stderr, "Return struct+%d:%d in $%d\n",
-- offset, xfer, regnum);
-+ fprintf_unfiltered (gdb_stderr, "Return struct+%s:%d in $%d\n",
-+ plongest (offset), xfer, regnum);
- mips_xfer_register (gdbarch, regcache,
- gdbarch_num_regs (gdbarch) + regnum,
- xfer, BFD_ENDIAN_UNKNOWN, readbuf, writebuf,
-@@ -5318,7 +5318,7 @@ mips_o32_push_dummy_call (struct gdbarch
- int argreg;
- int float_argreg;
- int argnum;
-- int len = 0;
-+ LONGEST len = 0;
- int stack_offset = 0;
- enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
- CORE_ADDR func_addr = find_function_addr (function, NULL);
-@@ -5382,13 +5382,13 @@ mips_o32_push_dummy_call (struct gdbarch
- const gdb_byte *val;
- struct value *arg = args[argnum];
- struct type *arg_type = check_typedef (value_type (arg));
-- int len = TYPE_LENGTH (arg_type);
-+ LONGEST len = TYPE_LENGTH (arg_type);
- enum type_code typecode = TYPE_CODE (arg_type);
-
- if (mips_debug)
- fprintf_unfiltered (gdb_stdlog,
-- "mips_o32_push_dummy_call: %d len=%d type=%d",
-- argnum + 1, len, (int) typecode);
-+ "mips_o32_push_dummy_call: %d len=%s type=%d",
-+ argnum + 1, plongest (len), (int) typecode);
-
- val = value_contents (arg);
-
-@@ -5843,8 +5843,8 @@ mips_o64_push_dummy_call (struct gdbarch
- int argreg;
- int float_argreg;
- int argnum;
-- int len = 0;
-- int stack_offset = 0;
-+ LONGEST len = 0;
-+ LONGEST stack_offset = 0;
- enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
- CORE_ADDR func_addr = find_function_addr (function, NULL);
-
-@@ -5904,13 +5904,13 @@ mips_o64_push_dummy_call (struct gdbarch
- const gdb_byte *val;
- struct value *arg = args[argnum];
- struct type *arg_type = check_typedef (value_type (arg));
-- int len = TYPE_LENGTH (arg_type);
-+ LONGEST len = TYPE_LENGTH (arg_type);
- enum type_code typecode = TYPE_CODE (arg_type);
-
- if (mips_debug)
- fprintf_unfiltered (gdb_stdlog,
-- "mips_o64_push_dummy_call: %d len=%d type=%d",
-- argnum + 1, len, (int) typecode);
-+ "mips_o64_push_dummy_call: %d len=%s type=%d",
-+ argnum + 1, plongest (len), (int) typecode);
-
- val = value_contents (arg);
-
-diff -Naurp insight-7.12.50.20170416.orig/gdb/mn10300-tdep.c insight-7.12.50.20170416.new/gdb/mn10300-tdep.c
---- insight-7.12.50.20170416.orig/gdb/mn10300-tdep.c 2017-04-09 01:11:01.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/mn10300-tdep.c 2017-04-16 12:46:32.469381828 +0100
-@@ -1220,7 +1220,7 @@ mn10300_push_dummy_call (struct gdbarch
- enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
- const int push_size = register_size (gdbarch, E_PC_REGNUM);
- int regs_used;
-- int len, arg_len;
-+ LONGEST len, arg_len;
- int stack_offset = 0;
- int argnum;
- const gdb_byte *val;
-diff -Naurp insight-7.12.50.20170416.orig/gdb/mt-tdep.c insight-7.12.50.20170416.new/gdb/mt-tdep.c
---- insight-7.12.50.20170416.orig/gdb/mt-tdep.c 2017-01-03 17:36:55.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/mt-tdep.c 2017-04-16 12:46:32.470381838 +0100
-@@ -788,9 +788,9 @@ mt_push_dummy_call (struct gdbarch *gdba
- gdb_byte buf[MT_MAX_STRUCT_SIZE];
- int argreg = MT_1ST_ARGREG;
- int split_param_len = 0;
-- int stack_dest = sp;
-+ LONGEST stack_dest = sp;
- int slacklen;
-- int typelen;
-+ LONGEST typelen;
- int i, j;
-
- /* First handle however many args we can fit into MT_1ST_ARGREG thru
-diff -Naurp insight-7.12.50.20170416.orig/gdb/ppc-sysv-tdep.c insight-7.12.50.20170416.new/gdb/ppc-sysv-tdep.c
---- insight-7.12.50.20170416.orig/gdb/ppc-sysv-tdep.c 2017-03-25 10:42:37.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/ppc-sysv-tdep.c 2017-04-16 12:46:32.471381847 +0100
-@@ -67,7 +67,7 @@ ppc_sysv_abi_push_dummy_call (struct gdb
- enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
- int opencl_abi = ppc_sysv_use_opencl_abi (value_type (function));
- ULONGEST saved_sp;
-- int argspace = 0; /* 0 is an initial wrong guess. */
-+ LONGEST argspace = 0; /* 0 is an initial wrong guess. */
- int write_pass;
-
- gdb_assert (tdep->wordsize == 4);
-@@ -98,9 +98,9 @@ ppc_sysv_abi_push_dummy_call (struct gdb
- /* Next available vector register for vector arguments. */
- int vreg = 2;
- /* Arguments start above the "LR save word" and "Back chain". */
-- int argoffset = 2 * tdep->wordsize;
-+ LONGEST argoffset = 2 * tdep->wordsize;
- /* Structures start after the arguments. */
-- int structoffset = argoffset + argspace;
-+ LONGEST structoffset = argoffset + argspace;
-
- /* If the function is returning a `struct', then the first word
- (which will be passed in r3) is used for struct return
-@@ -119,7 +119,7 @@ ppc_sysv_abi_push_dummy_call (struct gdb
- {
- struct value *arg = args[argno];
- struct type *type = check_typedef (value_type (arg));
-- int len = TYPE_LENGTH (type);
-+ ssize_t len = TYPE_LENGTH (type);
- const bfd_byte *val = value_contents (arg);
-
- if (TYPE_CODE (type) == TYPE_CODE_FLT && len <= 8
-@@ -1284,11 +1284,11 @@ struct ppc64_sysv_argpos
-
- static void
- ppc64_sysv_abi_push_val (struct gdbarch *gdbarch,
-- const bfd_byte *val, int len, int align,
-+ const bfd_byte *val, ssize_t len, int align,
- struct ppc64_sysv_argpos *argpos)
- {
- struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
-- int offset = 0;
-+ ssize_t offset = 0;
-
- /* Enforce alignment of stack location, if requested. */
- if (align > tdep->wordsize)
-diff -Naurp insight-7.12.50.20170416.orig/gdb/rl78-tdep.c insight-7.12.50.20170416.new/gdb/rl78-tdep.c
---- insight-7.12.50.20170416.orig/gdb/rl78-tdep.c 2017-04-15 01:21:12.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/rl78-tdep.c 2017-04-16 12:46:32.471381847 +0100
-@@ -1352,8 +1352,8 @@ rl78_push_dummy_call (struct gdbarch *gd
- for (i = nargs - 1; i >= 0; i--)
- {
- struct type *value_type = value_enclosing_type (args[i]);
-- int len = TYPE_LENGTH (value_type);
-- int container_len = (len + 1) & ~1;
-+ LONGEST len = TYPE_LENGTH (value_type);
-+ LONGEST container_len = (len + 1) & ~1;
-
- sp -= container_len;
- write_memory (rl78_make_data_address (sp),
-diff -Naurp insight-7.12.50.20170416.orig/gdb/rs6000-aix-tdep.c insight-7.12.50.20170416.new/gdb/rs6000-aix-tdep.c
---- insight-7.12.50.20170416.orig/gdb/rs6000-aix-tdep.c 2017-04-15 01:21:12.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/rs6000-aix-tdep.c 2017-04-16 12:46:32.471381847 +0100
-@@ -186,9 +186,9 @@ rs6000_push_dummy_call (struct gdbarch *
- struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
- enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
- int ii;
-- int len = 0;
-+ LONGEST len = 0;
- int argno; /* current argument number */
-- int argbytes; /* current argument byte */
-+ LONGEST argbytes; /* current argument byte */
- gdb_byte tmp_buffer[50];
- int f_argno = 0; /* current floating point argno */
- int wordsize = gdbarch_tdep (gdbarch)->wordsize;
-@@ -319,7 +319,7 @@ ran_out_of_registers_for_arguments:
-
- if ((argno < nargs) || argbytes)
- {
-- int space = 0, jj;
-+ LONGEST space = 0, jj;
-
- if (argbytes)
- {
-diff -Naurp insight-7.12.50.20170416.orig/gdb/s390-linux-tdep.c insight-7.12.50.20170416.new/gdb/s390-linux-tdep.c
---- insight-7.12.50.20170416.orig/gdb/s390-linux-tdep.c 2017-03-25 10:42:37.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/s390-linux-tdep.c 2017-04-16 12:46:32.473381865 +0100
-@@ -3081,7 +3081,7 @@ s390_function_arg_vector (struct type *t
- /* Determine whether N is a power of two. */
-
- static int
--is_power_of_two (unsigned int n)
-+is_power_of_two (ULONGEST n)
- {
- return n && ((n & (n - 1)) == 0);
- }
-@@ -3138,7 +3138,7 @@ s390_handle_arg (struct s390_arg_state *
- enum bfd_endian byte_order, int is_unnamed)
- {
- struct type *type = check_typedef (value_type (arg));
-- unsigned int length = TYPE_LENGTH (type);
-+ ULONGEST length = TYPE_LENGTH (type);
- int write_mode = as->regcache != NULL;
-
- if (s390_function_arg_float (type))
-diff -Naurp insight-7.12.50.20170416.orig/gdb/score-tdep.c insight-7.12.50.20170416.new/gdb/score-tdep.c
---- insight-7.12.50.20170416.orig/gdb/score-tdep.c 2017-01-03 17:36:55.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/score-tdep.c 2017-04-16 12:46:32.474381875 +0100
-@@ -525,7 +525,7 @@ score_push_dummy_call (struct gdbarch *g
- enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
- int argnum;
- int argreg;
-- int arglen = 0;
-+ LONGEST arglen = 0;
- CORE_ADDR stack_offset = 0;
- CORE_ADDR addr = 0;
-
-diff -Naurp insight-7.12.50.20170416.orig/gdb/sh64-tdep.c insight-7.12.50.20170416.new/gdb/sh64-tdep.c
---- insight-7.12.50.20170416.orig/gdb/sh64-tdep.c 2017-04-09 01:11:01.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/sh64-tdep.c 2017-04-16 12:46:32.475381884 +0100
-@@ -1062,7 +1062,7 @@ sh64_push_dummy_call (struct gdbarch *gd
- CORE_ADDR struct_addr)
- {
- enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
-- int stack_offset, stack_alloc;
-+ LONGEST stack_offset, stack_alloc;
- int int_argreg;
- int float_arg_index = 0;
- int double_arg_index = 0;
-@@ -1071,7 +1071,7 @@ sh64_push_dummy_call (struct gdbarch *gd
- CORE_ADDR regval;
- const gdb_byte *val;
- gdb_byte valbuf[8];
-- int len;
-+ LONGEST len;
- int argreg_size;
- int fp_args[12];
-
-diff -Naurp insight-7.12.50.20170416.orig/gdb/sh-tdep.c insight-7.12.50.20170416.new/gdb/sh-tdep.c
---- insight-7.12.50.20170416.orig/gdb/sh-tdep.c 2017-04-15 01:21:12.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/sh-tdep.c 2017-04-16 12:46:32.474381875 +0100
-@@ -814,7 +814,7 @@ sh_skip_prologue (struct gdbarch *gdbarc
- static int
- sh_use_struct_convention (int renesas_abi, struct type *type)
- {
-- int len = TYPE_LENGTH (type);
-+ LONGEST len = TYPE_LENGTH (type);
- int nelem = TYPE_NFIELDS (type);
-
- /* The Renesas ABI returns aggregate types always on stack. */
-@@ -916,7 +916,7 @@ sh_frame_align (struct gdbarch *ignore,
-
- /* Helper function to justify value in register according to endianess. */
- static const gdb_byte *
--sh_justify_value_in_reg (struct gdbarch *gdbarch, struct value *val, int len)
-+sh_justify_value_in_reg (struct gdbarch *gdbarch, struct value *val, LONGEST len)
- {
- static gdb_byte valbuf[4];
-
-@@ -1076,7 +1076,8 @@ sh_push_dummy_call_fpu (struct gdbarch *
- struct type *type;
- CORE_ADDR regval;
- const gdb_byte *val;
-- int len, reg_size = 0;
-+ LONGEST len;
-+ int reg_size = 0;
- int pass_on_stack = 0;
- int treat_as_flt;
- int last_reg_arg = INT_MAX;
-@@ -1217,7 +1218,8 @@ sh_push_dummy_call_nofpu (struct gdbarch
- struct type *type;
- CORE_ADDR regval;
- const gdb_byte *val;
-- int len, reg_size = 0;
-+ LONGEST len;
-+ int reg_size = 0;
- int pass_on_stack = 0;
- int last_reg_arg = INT_MAX;
-
-diff -Naurp insight-7.12.50.20170416.orig/gdb/sparc64-tdep.c insight-7.12.50.20170416.new/gdb/sparc64-tdep.c
---- insight-7.12.50.20170416.orig/gdb/sparc64-tdep.c 2017-04-15 01:21:12.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/sparc64-tdep.c 2017-04-16 12:46:32.476381893 +0100
-@@ -696,7 +696,8 @@ sparc64_16_byte_align_p (struct type *ty
-
- static void
- sparc64_store_floating_fields (struct regcache *regcache, struct type *type,
-- const gdb_byte *valbuf, int element, int bitpos)
-+ const gdb_byte *valbuf, int element,
-+ LONGEST bitpos)
- {
- struct gdbarch *gdbarch = get_regcache_arch (regcache);
- int len = TYPE_LENGTH (type);
-@@ -740,7 +741,7 @@ sparc64_store_floating_fields (struct re
- for (i = 0; i < TYPE_NFIELDS (type); i++)
- {
- struct type *subtype = check_typedef (TYPE_FIELD_TYPE (type, i));
-- int subpos = bitpos + TYPE_FIELD_BITPOS (type, i);
-+ LONGEST subpos = bitpos + TYPE_FIELD_BITPOS (type, i);
-
- sparc64_store_floating_fields (regcache, subtype, valbuf,
- element, subpos);
-@@ -772,7 +773,7 @@ sparc64_store_floating_fields (struct re
-
- static void
- sparc64_extract_floating_fields (struct regcache *regcache, struct type *type,
-- gdb_byte *valbuf, int bitpos)
-+ gdb_byte *valbuf, LONGEST bitpos)
- {
- struct gdbarch *gdbarch = get_regcache_arch (regcache);
-
-@@ -812,7 +813,7 @@ sparc64_extract_floating_fields (struct
- for (i = 0; i < TYPE_NFIELDS (type); i++)
- {
- struct type *subtype = check_typedef (TYPE_FIELD_TYPE (type, i));
-- int subpos = bitpos + TYPE_FIELD_BITPOS (type, i);
-+ LONGEST subpos = bitpos + TYPE_FIELD_BITPOS (type, i);
-
- sparc64_extract_floating_fields (regcache, subtype, valbuf, subpos);
- }
-@@ -845,7 +846,7 @@ sparc64_store_arguments (struct regcache
- for (i = 0; i < nargs; i++)
- {
- struct type *type = value_type (args[i]);
-- int len = TYPE_LENGTH (type);
-+ LONGEST len = TYPE_LENGTH (type);
-
- if (sparc64_structure_or_union_p (type)
- || (sparc64_complex_floating_p (type) && len == 32))
-@@ -945,7 +946,7 @@ sparc64_store_arguments (struct regcache
- {
- const gdb_byte *valbuf = value_contents (args[i]);
- struct type *type = value_type (args[i]);
-- int len = TYPE_LENGTH (type);
-+ LONGEST len = TYPE_LENGTH (type);
- int regnum = -1;
- gdb_byte buf[16];
-
-diff -Naurp insight-7.12.50.20170416.orig/gdb/sparc-tdep.c insight-7.12.50.20170416.new/gdb/sparc-tdep.c
---- insight-7.12.50.20170416.orig/gdb/sparc-tdep.c 2017-04-16 12:45:38.764882267 +0100
-+++ insight-7.12.50.20170416.new/gdb/sparc-tdep.c 2017-04-16 12:46:32.475381884 +0100
-@@ -567,7 +567,7 @@ sparc32_store_arguments (struct regcache
- for (i = 0; i < nargs; i++)
- {
- struct type *type = value_type (args[i]);
-- int len = TYPE_LENGTH (type);
-+ LONGEST len = TYPE_LENGTH (type);
-
- if (sparc_structure_or_union_p (type)
- || (sparc_floating_p (type) && len == 16)
-diff -Naurp insight-7.12.50.20170416.orig/gdb/spu-tdep.c insight-7.12.50.20170416.new/gdb/spu-tdep.c
---- insight-7.12.50.20170416.orig/gdb/spu-tdep.c 2017-04-15 01:21:12.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/spu-tdep.c 2017-04-16 12:46:32.477381903 +0100
-@@ -1431,7 +1431,7 @@ spu_push_dummy_call (struct gdbarch *gdb
- struct value *arg = args[i];
- struct type *type = check_typedef (value_type (arg));
- const gdb_byte *contents = value_contents (arg);
-- int n_regs = align_up (TYPE_LENGTH (type), 16) / 16;
-+ LONGEST n_regs = align_up (TYPE_LENGTH (type), 16) / 16;
-
- /* If the argument doesn't wholly fit into registers, it and
- all subsequent arguments go to the stack. */
-@@ -1463,7 +1463,7 @@ spu_push_dummy_call (struct gdbarch *gdb
- {
- struct value *arg = args[i];
- struct type *type = check_typedef (value_type (arg));
-- int len = TYPE_LENGTH (type);
-+ LONGEST len = TYPE_LENGTH (type);
- int preferred_slot;
-
- if (spu_scalar_value_p (type))
-diff -Naurp insight-7.12.50.20170416.orig/gdb/tic6x-tdep.c insight-7.12.50.20170416.new/gdb/tic6x-tdep.c
---- insight-7.12.50.20170416.orig/gdb/tic6x-tdep.c 2017-01-03 17:36:55.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/tic6x-tdep.c 2017-04-16 12:46:32.478381912 +0100
-@@ -899,7 +899,7 @@ tic6x_push_dummy_call (struct gdbarch *g
- int argreg = 0;
- int argnum;
- int stack_offset = 4;
-- int references_offset = 4;
-+ LONGEST references_offset = 4;
- CORE_ADDR func_addr = find_function_addr (function, NULL);
- enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
- struct type *func_type = value_type (function);
-@@ -933,7 +933,7 @@ tic6x_push_dummy_call (struct gdbarch *g
- /* Now make space on the stack for the args. */
- for (argnum = 0; argnum < nargs; argnum++)
- {
-- int len = align_up (TYPE_LENGTH (value_type (args[argnum])), 4);
-+ LONGEST len = align_up (TYPE_LENGTH (value_type (args[argnum])), 4);
- if (argnum >= 10 - argreg)
- references_offset += len;
- stack_offset += len;
-@@ -952,7 +952,7 @@ tic6x_push_dummy_call (struct gdbarch *g
- const gdb_byte *val;
- struct value *arg = args[argnum];
- struct type *arg_type = check_typedef (value_type (arg));
-- int len = TYPE_LENGTH (arg_type);
-+ ssize_t len = TYPE_LENGTH (arg_type);
- enum type_code typecode = TYPE_CODE (arg_type);
-
- val = value_contents (arg);
-@@ -1112,7 +1112,8 @@ tic6x_push_dummy_call (struct gdbarch *g
- }
- else
- internal_error (__FILE__, __LINE__,
-- _("unexpected length %d of arg %d"), len, argnum);
-+ _("unexpected length %s of arg %d"),
-+ plongest (len), argnum);
-
- addr = sp + stack_offset;
- write_memory (addr, val, len);
-diff -Naurp insight-7.12.50.20170416.orig/gdb/tilegx-tdep.c insight-7.12.50.20170416.new/gdb/tilegx-tdep.c
---- insight-7.12.50.20170416.orig/gdb/tilegx-tdep.c 2017-01-03 17:36:55.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/tilegx-tdep.c 2017-04-16 12:46:32.478381912 +0100
-@@ -289,7 +289,7 @@ tilegx_push_dummy_call (struct gdbarch *
- CORE_ADDR stack_dest = sp;
- int argreg = TILEGX_R0_REGNUM;
- int i, j;
-- int typelen, slacklen;
-+ LONGEST typelen, slacklen;
- static const gdb_byte four_zero_words[16] = { 0 };
-
- /* If struct_return is 1, then the struct return address will
-diff -Naurp insight-7.12.50.20170416.orig/gdb/v850-tdep.c insight-7.12.50.20170416.new/gdb/v850-tdep.c
---- insight-7.12.50.20170416.orig/gdb/v850-tdep.c 2017-01-03 17:36:55.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/v850-tdep.c 2017-04-16 12:46:32.478381912 +0100
-@@ -1019,7 +1019,7 @@ v850_push_dummy_call (struct gdbarch *gd
- enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
- int argreg;
- int argnum;
-- int len = 0;
-+ LONGEST len = 0;
- int stack_offset;
-
- if (gdbarch_tdep (gdbarch)->abi == V850_ABI_RH850)
-@@ -1047,7 +1047,7 @@ v850_push_dummy_call (struct gdbarch *gd
- in four registers available. Loop thru args from first to last. */
- for (argnum = 0; argnum < nargs; argnum++)
- {
-- int len;
-+ LONGEST len;
- gdb_byte *val;
- gdb_byte valbuf[v850_reg_size];
-
-diff -Naurp insight-7.12.50.20170416.orig/gdb/vax-tdep.c insight-7.12.50.20170416.new/gdb/vax-tdep.c
---- insight-7.12.50.20170416.orig/gdb/vax-tdep.c 2017-04-16 12:45:39.005884509 +0100
-+++ insight-7.12.50.20170416.new/gdb/vax-tdep.c 2017-04-16 12:46:32.479381921 +0100
-@@ -111,7 +111,7 @@ vax_store_arguments (struct regcache *re
- struct gdbarch *gdbarch = get_regcache_arch (regcache);
- enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
- gdb_byte buf[4];
-- int count = 0;
-+ LONGEST count = 0;
- int i;
-
- /* We create an argument list on the stack, and make the argument
-@@ -120,7 +120,7 @@ vax_store_arguments (struct regcache *re
- /* Push arguments in reverse order. */
- for (i = nargs - 1; i >= 0; i--)
- {
-- int len = TYPE_LENGTH (value_enclosing_type (args[i]));
-+ LONGEST len = TYPE_LENGTH (value_enclosing_type (args[i]));
-
- sp -= (len + 3) & ~3;
- count += (len + 3) / 4;
-diff -Naurp insight-7.12.50.20170416.orig/gdb/xstormy16-tdep.c insight-7.12.50.20170416.new/gdb/xstormy16-tdep.c
---- insight-7.12.50.20170416.orig/gdb/xstormy16-tdep.c 2017-04-15 01:21:12.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/xstormy16-tdep.c 2017-04-16 12:46:32.479381921 +0100
-@@ -233,8 +233,9 @@ xstormy16_push_dummy_call (struct gdbarc
- enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
- CORE_ADDR stack_dest = sp;
- int argreg = E_1ST_ARG_REGNUM;
-- int i, j;
-- int typelen, slacklen;
-+ int i, slacklen;
-+ LONGEST j;
-+ LONGEST typelen;
- const gdb_byte *val;
- gdb_byte buf[xstormy16_pc_size];
-
-diff -Naurp insight-7.12.50.20170416.orig/gdb/xtensa-tdep.c insight-7.12.50.20170416.new/gdb/xtensa-tdep.c
---- insight-7.12.50.20170416.orig/gdb/xtensa-tdep.c 2017-04-15 01:21:12.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/xtensa-tdep.c 2017-04-16 12:46:32.480381930 +0100
-@@ -1637,8 +1637,7 @@ xtensa_store_return_value (struct type *
-
- if (len > (callsize > 8 ? 8 : 16))
- internal_error (__FILE__, __LINE__,
-- _("unimplemented for this length: %d"),
-- TYPE_LENGTH (type));
-+ _("unimplemented for this length: %d"), len);
- areg = arreg_number (gdbarch,
- gdbarch_tdep (gdbarch)->a0_base + 2 + callsize, wb);
-
-@@ -1712,18 +1711,18 @@ xtensa_push_dummy_call (struct gdbarch *
- {
- enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
- int i;
-- int size, onstack_size;
-+ LONGEST size, onstack_size;
- gdb_byte *buf = (gdb_byte *) alloca (16);
- CORE_ADDR ra, ps;
- struct argument_info
- {
- const bfd_byte *contents;
-- int length;
-+ ssize_t length;
- int onstack; /* onstack == 0 => in reg */
- int align; /* alignment */
- union
- {
-- int offset; /* stack offset if on stack. */
-+ ssize_t offset; /* stack offset if on stack. */
- int regno; /* regno if in register. */
- } u;
- };
-@@ -1747,9 +1746,10 @@ xtensa_push_dummy_call (struct gdbarch *
- {
- struct value *arg = args[i];
- struct type *arg_type = check_typedef (value_type (arg));
-- fprintf_unfiltered (gdb_stdlog, "%2d: %s %3d ", i,
-- host_address_to_string (arg),
-- TYPE_LENGTH (arg_type));
-+ const char *arg_type_len_s = pulongest (TYPE_LENGTH (arg_type));
-+
-+ fprintf_unfiltered (gdb_stdlog, "%2d: %s %s ", i,
-+ host_address_to_string (arg), arg_type_len_s);
- switch (TYPE_CODE (arg_type))
- {
- case TYPE_CODE_INT:
-@@ -1819,8 +1819,8 @@ xtensa_push_dummy_call (struct gdbarch *
- info->align = TYPE_LENGTH (builtin_type (gdbarch)->builtin_long);
- break;
- }
-- info->length = TYPE_LENGTH (arg_type);
- info->contents = value_contents (arg);
-+ info->length = TYPE_LENGTH (arg_type);
-
- /* Align size and onstack_size. */
- size = (size + info->align - 1) & ~(info->align - 1);
-@@ -1865,7 +1865,7 @@ xtensa_push_dummy_call (struct gdbarch *
-
- if (info->onstack)
- {
-- int n = info->length;
-+ ssize_t n = info->length;
- CORE_ADDR offset = sp + info->u.offset;
-
- /* Odd-sized structs are aligned to the lower side of a memory
-@@ -1881,7 +1881,7 @@ xtensa_push_dummy_call (struct gdbarch *
- }
- else
- {
-- int n = info->length;
-+ ssize_t n = info->length;
- const bfd_byte *cp = info->contents;
- int r = info->u.regno;
-
diff --git a/insight-7.12-gdb-rhbz795424-bitpos-25of25.patch b/insight-7.12-gdb-rhbz795424-bitpos-25of25.patch
deleted file mode 100644
index 8092552..0000000
--- a/insight-7.12-gdb-rhbz795424-bitpos-25of25.patch
+++ /dev/null
@@ -1,84 +0,0 @@
-diff -Naurp insight-7.12.50.20170416.orig/gdb/f-lang.h insight-7.12.50.20170416.new/gdb/f-lang.h
---- insight-7.12.50.20170416.orig/gdb/f-lang.h 2017-04-16 12:50:42.704709525 +0100
-+++ insight-7.12.50.20170416.new/gdb/f-lang.h 2017-04-16 12:51:39.948242006 +0100
-@@ -49,9 +49,9 @@ struct common_block
- struct symbol *contents[1];
- };
-
--extern int f77_get_upperbound (struct type *);
-+extern LONGEST f77_get_upperbound (struct type *);
-
--extern int f77_get_lowerbound (struct type *);
-+extern LONGEST f77_get_lowerbound (struct type *);
-
- extern void f77_get_dynamic_array_length (struct type *);
-
-diff -Naurp insight-7.12.50.20170416.orig/gdb/f-typeprint.c insight-7.12.50.20170416.new/gdb/f-typeprint.c
---- insight-7.12.50.20170416.orig/gdb/f-typeprint.c 2017-03-04 04:09:18.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/f-typeprint.c 2017-04-16 12:53:44.404399699 +0100
-@@ -161,7 +161,7 @@ f_type_print_varspec_suffix (struct type
- int show, int passed_a_ptr, int demangled_args,
- int arrayprint_recurse_level)
- {
-- int upper_bound, lower_bound;
-+ LONGEST upper_bound, lower_bound;
-
- /* No static variables are permitted as an error call may occur during
- execution of this function. */
-@@ -194,7 +194,7 @@ f_type_print_varspec_suffix (struct type
-
- lower_bound = f77_get_lowerbound (type);
- if (lower_bound != 1) /* Not the default. */
-- fprintf_filtered (stream, "%d:", lower_bound);
-+ fprintf_filtered (stream, "%s:", plongest (lower_bound));
-
- /* Make sure that, if we have an assumed size array, we
- print out a warning and print the upperbound as '*'. */
-@@ -204,7 +204,7 @@ f_type_print_varspec_suffix (struct type
- else
- {
- upper_bound = f77_get_upperbound (type);
-- fprintf_filtered (stream, "%d", upper_bound);
-+ fprintf_filtered (stream, "%s", plongest (upper_bound));
- }
-
- if (TYPE_CODE (TYPE_TARGET_TYPE (type)) != TYPE_CODE_ARRAY)
-@@ -273,7 +273,7 @@ void
- f_type_print_base (struct type *type, struct ui_file *stream, int show,
- int level)
- {
-- int upper_bound;
-+ LONGEST upper_bound;
- int index;
-
- QUIT;
-@@ -355,7 +355,7 @@ f_type_print_base (struct type *type, st
- else
- {
- upper_bound = f77_get_upperbound (type);
-- fprintf_filtered (stream, "character*%d", upper_bound);
-+ fprintf_filtered (stream, "character*%s", plongest (upper_bound));
- }
- break;
-
-diff -Naurp insight-7.12.50.20170416.orig/gdb/f-valprint.c insight-7.12.50.20170416.new/gdb/f-valprint.c
---- insight-7.12.50.20170416.orig/gdb/f-valprint.c 2017-04-16 12:50:42.705709534 +0100
-+++ insight-7.12.50.20170416.new/gdb/f-valprint.c 2017-04-16 12:51:39.950242024 +0100
-@@ -43,7 +43,7 @@ LONGEST f77_array_offset_tbl[MAX_FORTRAN
- /* Array which holds offsets to be applied to get a row's elements
- for a given array. Array also holds the size of each subarray. */
-
--int
-+LONGEST
- f77_get_lowerbound (struct type *type)
- {
- if (TYPE_ARRAY_LOWER_BOUND_IS_UNDEFINED (type))
-@@ -52,7 +52,7 @@ f77_get_lowerbound (struct type *type)
- return TYPE_ARRAY_LOWER_BOUND_VALUE (type);
- }
-
--int
-+LONGEST
- f77_get_upperbound (struct type *type)
- {
- if (TYPE_ARRAY_UPPER_BOUND_IS_UNDEFINED (type))
diff --git a/insight-7.12-gdb-vla-intel-fortran-strides.patch b/insight-7.12-gdb-vla-intel-fortran-strides.patch
deleted file mode 100644
index 3b0e685..0000000
--- a/insight-7.12-gdb-vla-intel-fortran-strides.patch
+++ /dev/null
@@ -1,1942 +0,0 @@
-diff -Naurp insight-7.12.50.20170416.orig/gdb/dwarf2loc.c insight-7.12.50.20170416.new/gdb/dwarf2loc.c
---- insight-7.12.50.20170416.orig/gdb/dwarf2loc.c 2017-04-16 14:23:22.918275412 +0100
-+++ insight-7.12.50.20170416.new/gdb/dwarf2loc.c 2017-04-16 14:24:24.088833984 +0100
-@@ -2625,11 +2625,14 @@ dwarf2_locexpr_baton_eval (const struct
- /* 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;
-
-@@ -2653,7 +2656,7 @@ dwarf2_evaluate_property (const struct d
-
- *value = value_as_address (val);
- }
-- return 1;
-+ rc = 1;
- }
- }
- break;
-@@ -2675,7 +2678,7 @@ dwarf2_evaluate_property (const struct d
- if (!value_optimized_out (val))
- {
- *value = value_as_address (val);
-- return 1;
-+ rc = 1;
- }
- }
- }
-@@ -2683,8 +2686,8 @@ dwarf2_evaluate_property (const struct d
-
- case PROP_CONST:
- *value = prop->data.const_val;
-- return 1;
--
-+ rc = 1;
-+ break;
- case PROP_ADDR_OFFSET:
- {
- struct dwarf2_property_baton *baton
-@@ -2705,11 +2708,38 @@ dwarf2_evaluate_property (const struct d
- val = value_at (baton->offset_info.type,
- pinfo->addr + baton->offset_info.offset);
- *value = value_as_address (val);
-- return 1;
-+ rc = 1;
- }
-+ break;
-+ }
-+
-+ 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;
-+}
-
-- return 0;
-+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 -Naurp insight-7.12.50.20170416.orig/gdb/dwarf2loc.h insight-7.12.50.20170416.new/gdb/dwarf2loc.h
---- insight-7.12.50.20170416.orig/gdb/dwarf2loc.h 2017-03-18 01:22:31.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/dwarf2loc.h 2017-04-16 14:24:24.088833984 +0100
-@@ -143,6 +143,12 @@ int dwarf2_evaluate_property (const stru
- 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 -Naurp insight-7.12.50.20170416.orig/gdb/dwarf2read.c insight-7.12.50.20170416.new/gdb/dwarf2read.c
---- insight-7.12.50.20170416.orig/gdb/dwarf2read.c 2017-04-16 14:23:22.973275917 +0100
-+++ insight-7.12.50.20170416.new/gdb/dwarf2read.c 2017-04-16 15:14:21.011106705 +0100
-@@ -505,7 +505,7 @@ struct dwarf2_cu
- int last_used;
-
- /* A hash table of DIE cu_offset for following references with
-- die_info->offset.sect_off as hash. */
-+ die_info->sect_off as hash. */
- htab_t die_hash;
-
- /* Full DIEs if read in. */
-@@ -8443,7 +8443,7 @@ process_die (struct die_info *die, struc
- {
- complaint (&symfile_complaints,
- _("DIE at 0x%x attempted to be processed twice"),
-- die->offset.sect_off);
-+ to_underlying (die->sect_off));
- return;
- }
-
-@@ -15290,7 +15290,7 @@ read_subrange_type (struct die_info *die
- 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;
-@@ -15310,7 +15310,9 @@ read_subrange_type (struct die_info *die
-
- 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. */
-@@ -15343,6 +15345,13 @@ read_subrange_type (struct die_info *die
- break;
- }
-
-+ attr = dwarf2_attr (die, DW_AT_byte_stride, cu);
-+ if (attr)
-+ if (!attr_to_dynamic_prop (attr, die, cu, &stride))
-+ complaint (&symfile_complaints, _("Missing DW_AT_byte_stride "
-+ "- DIE at 0x%x [in module %s]"),
-+ to_underlying (die->sect_off), objfile_name (cu->objfile));
-+
- attr = dwarf2_attr (die, DW_AT_lower_bound, cu);
- if (attr)
- attr_to_dynamic_prop (attr, die, cu, &low);
-@@ -15419,7 +15428,7 @@ read_subrange_type (struct die_info *die
- && !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 -Naurp insight-7.12.50.20170416.orig/gdb/eval.c insight-7.12.50.20170416.new/gdb/eval.c
---- insight-7.12.50.20170416.orig/gdb/eval.c 2017-04-16 14:23:22.888275136 +0100
-+++ insight-7.12.50.20170416.new/gdb/eval.c 2017-04-16 14:24:24.094834039 +0100
-@@ -380,29 +380,325 @@ init_array_element (struct value *array,
- return index;
- }
-
-+/* Evaluates any operation on Fortran arrays or strings with at least
-+ one user provided parameter. Expects the input ARRAY to be either
-+ an array, or a string. Evaluates EXP by incrementing POS, and
-+ writes the content from the elt stack into a local struct. NARGS
-+ specifies number of literal or range arguments the user provided.
-+ NARGS must be the same number as ARRAY has dimensions. */
-+
- static struct value *
--value_f90_subarray (struct value *array,
-- struct expression *exp, int *pos, enum noside noside)
-+value_f90_subarray (struct value *array, struct expression *exp,
-+ int *pos, int nargs, enum noside noside)
- {
-- int pc = (*pos) + 1;
-+ int i, dim_count = 0;
- LONGEST low_bound, high_bound;
-- struct type *range = check_typedef (TYPE_INDEX_TYPE (value_type (array)));
-- enum range_type range_type
-- = (enum range_type) longest_to_int (exp->elts[pc].longconst);
--
-- *pos += 3;
-+ struct value *new_array = array;
-+ struct type *array_type = check_typedef (value_type (new_array));
-+ struct type *elt_type;
-+
-+ typedef struct subscript_range
-+ {
-+ enum range_type f90_range_type;
-+ LONGEST low, high, stride;
-+ } subscript_range;
-+
-+ typedef enum subscript_kind
-+ {
-+ SUBSCRIPT_RANGE, /* e.g. "(lowbound:highbound)" */
-+ SUBSCRIPT_INDEX /* e.g. "(literal)" */
-+ } kind;
-+
-+ /* Local struct to hold user data for Fortran subarray dimensions. */
-+ struct subscript_store
-+ {
-+ /* For every dimension, we are either working on a range or an index
-+ expression, so we store this info separately for later. */
-+ enum subscript_kind kind;
-+
-+ /* We also store either the lower and upper bound info, or the index
-+ number. Before evaluation of the input values, we do not know if we are
-+ actually working on a range of ranges, or an index in a range. So as a
-+ first step we store all input in a union. The array calculation itself
-+ deals with this later on. */
-+ union element_range
-+ {
-+ subscript_range range;
-+ LONGEST number;
-+ } U;
-+ } *subscript_array;
-+
-+ /* Check if the number of arguments provided by the user matches
-+ the number of dimension of the array. A string has only one
-+ dimension. */
-+ if (nargs != calc_f77_array_dims (value_type (new_array)))
-+ error (_("Wrong number of subscripts"));
-+
-+ subscript_array = (struct subscript_store*) alloca (sizeof (*subscript_array) * nargs);
-+
-+ /* Parse the user input into the SUBSCRIPT_ARRAY to store it. We need
-+ to evaluate it first, as the input is from left-to-right. The
-+ array is stored from right-to-left. So we have to use the user
-+ input in reverse order. Later on, we need the input information to
-+ re-calculate the output array. For multi-dimensional arrays, we
-+ can be dealing with any possible combination of ranges and indices
-+ for every dimension. */
-+ for (i = 0; i < nargs; i++)
-+ {
-+ struct subscript_store *index = &subscript_array[i];
-
-- if (range_type == LOW_BOUND_DEFAULT || range_type == BOTH_BOUND_DEFAULT)
-- low_bound = TYPE_LOW_BOUND (range);
-- else
-- low_bound = value_as_long (evaluate_subexp (NULL_TYPE, exp, pos, noside));
-+ /* The user input is a range, with or without lower and upper bound.
-+ E.g.: "p arry(2:5)", "p arry( :5)", "p arry( : )", etc. */
-+ if (exp->elts[*pos].opcode == OP_RANGE)
-+ {
-+ int pc = (*pos) + 1;
-+ subscript_range *range;
-
-- if (range_type == HIGH_BOUND_DEFAULT || range_type == BOTH_BOUND_DEFAULT)
-- high_bound = TYPE_HIGH_BOUND (range);
-- else
-- high_bound = value_as_long (evaluate_subexp (NULL_TYPE, exp, pos, noside));
-+ index->kind = SUBSCRIPT_RANGE;
-+ range = &index->U.range;
-+
-+ *pos += 3;
-+ range->f90_range_type = (enum range_type) exp->elts[pc].longconst;
-+
-+ /* If a lower bound was provided by the user, the bit has been
-+ set and we can assign the value from the elt stack. Same for
-+ upper bound. */
-+ if ((range->f90_range_type & SUBARRAY_LOW_BOUND)
-+ == SUBARRAY_LOW_BOUND)
-+ range->low = value_as_long (evaluate_subexp (NULL_TYPE, exp,
-+ pos, noside));
-+ if ((range->f90_range_type & SUBARRAY_HIGH_BOUND)
-+ == SUBARRAY_HIGH_BOUND)
-+ range->high = value_as_long (evaluate_subexp (NULL_TYPE, exp,
-+ pos, noside));
-+
-+ /* Assign the user's stride value if provided. */
-+ if ((range->f90_range_type & SUBARRAY_STRIDE) == SUBARRAY_STRIDE)
-+ range->stride = value_as_long (evaluate_subexp (NULL_TYPE, exp,
-+ pos, noside));
-+
-+ /* Assign the default stride value '1'. */
-+ else
-+ range->stride = 1;
-+
-+ /* Check the provided stride value is illegal, aka '0'. */
-+ if (range->stride == 0)
-+ error (_("Stride must not be 0"));
-+ }
-+ /* User input is an index. E.g.: "p arry(5)". */
-+ else
-+ {
-+ struct value *val;
-+
-+ index->kind = SUBSCRIPT_INDEX;
-+
-+ /* Evaluate each subscript; it must be a legal integer in F77. This
-+ ensures the validity of the provided index. */
-+ val = evaluate_subexp_with_coercion (exp, pos, noside);
-+ index->U.number = value_as_long (val);
-+ }
-+
-+ }
-+
-+ /* Traverse the array from right to left and set the high and low bounds
-+ for later use. */
-+ for (i = nargs - 1; i >= 0; i--)
-+ {
-+ struct subscript_store *index = &subscript_array[i];
-+ struct type *index_type = TYPE_INDEX_TYPE (array_type);
-+
-+ switch (index->kind)
-+ {
-+ case SUBSCRIPT_RANGE:
-+ {
-+
-+ /* When we hit the first range specified by the user, we must
-+ treat any subsequent user entry as a range. We simply
-+ increment DIM_COUNT which tells us how many times we are
-+ calling VALUE_SLICE_1. */
-+ subscript_range *range = &index->U.range;
-+
-+ /* If no lower bound was provided by the user, we take the
-+ default boundary. Same for the high bound. */
-+ if ((range->f90_range_type & SUBARRAY_LOW_BOUND) == 0)
-+ range->low = TYPE_LOW_BOUND (index_type);
-+
-+ if ((range->f90_range_type & SUBARRAY_HIGH_BOUND) == 0)
-+ range->high = TYPE_HIGH_BOUND (index_type);
-+
-+ /* Both user provided low and high bound have to be inside the
-+ array bounds. Throw an error if not. */
-+ if (range->low < TYPE_LOW_BOUND (index_type)
-+ || range->low > TYPE_HIGH_BOUND (index_type)
-+ || range->high < TYPE_LOW_BOUND (index_type)
-+ || range->high > TYPE_HIGH_BOUND (index_type))
-+ error (_("provided bound(s) outside array bound(s)"));
-+
-+ /* For a negative stride the lower boundary must be larger than the
-+ upper boundary.
-+ For a positive stride the lower boundary must be smaller than the
-+ upper boundary. */
-+ if ((range->stride < 0 && range->low < range->high)
-+ || (range->stride > 0 && range->low > range->high))
-+ error (_("Wrong value provided for stride and boundaries"));
-+
-+ }
-+ break;
-+
-+ case SUBSCRIPT_INDEX:
-+ break;
-
-- return value_slice (array, low_bound, high_bound - low_bound + 1);
-+ }
-+
-+ array_type = TYPE_TARGET_TYPE (array_type);
-+ }
-+
-+ /* Reset ARRAY_TYPE before slicing.*/
-+ array_type = check_typedef (value_type (new_array));
-+
-+ /* Traverse the array from right to left and evaluate each corresponding
-+ user input. VALUE_SUBSCRIPT is called for every index, until a range
-+ expression is evaluated. After a range expression has been evaluated,
-+ every subsequent expression is also treated as a range. */
-+ for (i = nargs - 1; i >= 0; i--)
-+ {
-+ struct subscript_store *index = &subscript_array[i];
-+ struct type *index_type = TYPE_INDEX_TYPE (array_type);
-+
-+ switch (index->kind)
-+ {
-+ case SUBSCRIPT_RANGE:
-+ {
-+
-+ /* When we hit the first range specified by the user, we must
-+ treat any subsequent user entry as a range. We simply
-+ increment DIM_COUNT which tells us how many times we are
-+ calling VALUE_SLICE_1. */
-+ subscript_range *range = &index->U.range;
-+
-+ /* DIM_COUNT counts every user argument that is treated as a range.
-+ This is necessary for expressions like 'print array(7, 8:9).
-+ Here the first argument is a literal, but must be treated as a
-+ range argument to allow the correct output representation. */
-+ dim_count++;
-+
-+ new_array
-+ = value_slice_1 (new_array, range->low,
-+ range->high - range->low + 1,
-+ range->stride, dim_count);
-+ }
-+ break;
-+
-+ case SUBSCRIPT_INDEX:
-+ {
-+ /* DIM_COUNT only stays '0' when no range argument was processed
-+ before, starting from the last dimension. This way we can
-+ reduce the number of dimensions from the result array.
-+ However, if a range has been processed before an index, we
-+ treat the index like a range with equal low- and high bounds
-+ to get the value offset right. */
-+ if (dim_count == 0)
-+ new_array
-+ = value_subscripted_rvalue (new_array, index->U.number,
-+ f77_get_lowerbound (value_type
-+ (new_array)));
-+ else
-+ {
-+ dim_count++;
-+
-+ /* We might end up here, because we have to treat the provided
-+ index like a range. But now VALUE_SUBSCRIPTED_RVALUE
-+ cannot do the range checks for us. So we have to make sure
-+ ourselves that the user provided index is inside the
-+ array bounds. Throw an error if not. */
-+ if (index->U.number < TYPE_LOW_BOUND (index_type)
-+ && index->U.number > TYPE_HIGH_BOUND (index_type))
-+ error (_("provided bound(s) outside array bound(s)"));
-+
-+ if (index->U.number > TYPE_LOW_BOUND (index_type)
-+ && index->U.number > TYPE_HIGH_BOUND (index_type))
-+ error (_("provided bound(s) outside array bound(s)"));
-+
-+ new_array = value_slice_1 (new_array,
-+ index->U.number,
-+ 1, /* COUNT is '1' element */
-+ 1, /* STRIDE set to '1' */
-+ dim_count);
-+ }
-+
-+ }
-+ break;
-+ }
-+ array_type = TYPE_TARGET_TYPE (array_type);
-+ }
-+
-+ /* With DIM_COUNT > 1 we currently have a one dimensional array, but expect
-+ an array of arrays, depending on how many ranges have been provided by
-+ the user. So we need to rebuild the array dimensions for printing it
-+ correctly.
-+ Starting from right to left in the user input, after we hit the first
-+ range argument every subsequent argument is also treated as a range.
-+ E.g.:
-+ "p ary(3, 7, 2:15)" in Fortran has only 1 dimension, but we calculated 3
-+ ranges.
-+ "p ary(3, 7:12, 4)" in Fortran has only 1 dimension, but we calculated 2
-+ ranges.
-+ "p ary(2:4, 5, 7)" in Fortran has only 1 dimension, and we calculated 1
-+ range. */
-+ if (dim_count > 1)
-+ {
-+ struct value *v = NULL;
-+
-+ elt_type = TYPE_TARGET_TYPE (value_type (new_array));
-+
-+ /* Every SUBSCRIPT_RANGE in the user input signifies an actual range in
-+ the output array. So we traverse the SUBSCRIPT_ARRAY again, looking
-+ for a range entry. When we find one, we use the range info to create
-+ an additional range_type to set the correct bounds and dimensions for
-+ the output array. In addition, we may have a stride value that is not
-+ '1', forcing us to adjust the number of elements in a range, according
-+ to the stride value. */
-+ for (i = 0; i < nargs; i++)
-+ {
-+ struct subscript_store *index = &subscript_array[i];
-+
-+ if (index->kind == SUBSCRIPT_RANGE)
-+ {
-+ struct type *range_type, *interim_array_type;
-+
-+ int new_length;
-+
-+ /* The length of a sub-dimension with all elements between the
-+ bounds plus the start element itself. It may be modified by
-+ a user provided stride value. */
-+ new_length = index->U.range.high - index->U.range.low;
-+
-+ new_length /= index->U.range.stride;
-+
-+ range_type
-+ = create_static_range_type (NULL,
-+ elt_type,
-+ index->U.range.low,
-+ index->U.range.low + new_length);
-+
-+ interim_array_type = create_array_type (NULL,
-+ elt_type,
-+ range_type);
-+
-+ TYPE_CODE (interim_array_type)
-+ = TYPE_CODE (value_type (new_array));
-+
-+ v = allocate_value (interim_array_type);
-+
-+ elt_type = value_type (v);
-+ }
-+
-+ }
-+ value_contents_copy (v, 0, new_array, 0, TYPE_LENGTH (elt_type));
-+ return v;
-+ }
-+
-+ return new_array;
- }
-
-
-@@ -1791,19 +2087,8 @@ evaluate_subexp_standard (struct type *e
- switch (code)
- {
- case TYPE_CODE_ARRAY:
-- if (exp->elts[*pos].opcode == OP_RANGE)
-- return value_f90_subarray (arg1, exp, pos, noside);
-- else
-- goto multi_f77_subscript;
--
- case TYPE_CODE_STRING:
-- if (exp->elts[*pos].opcode == OP_RANGE)
-- return value_f90_subarray (arg1, exp, pos, noside);
-- else
-- {
-- arg2 = evaluate_subexp_with_coercion (exp, pos, noside);
-- return value_subscript (arg1, value_as_long (arg2));
-- }
-+ return value_f90_subarray (arg1, exp, pos, nargs, noside);
-
- case TYPE_CODE_PTR:
- case TYPE_CODE_FUNC:
-@@ -2204,49 +2489,6 @@ evaluate_subexp_standard (struct type *e
- }
- return (arg1);
-
-- multi_f77_subscript:
-- {
-- LONGEST subscript_array[MAX_FORTRAN_DIMS];
-- int ndimensions = 1, i;
-- struct value *array = arg1;
--
-- if (nargs > MAX_FORTRAN_DIMS)
-- error (_("Too many subscripts for F77 (%d Max)"), MAX_FORTRAN_DIMS);
--
-- ndimensions = calc_f77_array_dims (type);
--
-- if (nargs != ndimensions)
-- error (_("Wrong number of subscripts"));
--
-- gdb_assert (nargs > 0);
--
-- /* Now that we know we have a legal array subscript expression
-- let us actually find out where this element exists in the array. */
--
-- /* Take array indices left to right. */
-- for (i = 0; i < nargs; i++)
-- {
-- /* Evaluate each subscript; it must be a legal integer in F77. */
-- arg2 = evaluate_subexp_with_coercion (exp, pos, noside);
--
-- /* Fill in the subscript array. */
--
-- subscript_array[i] = value_as_long (arg2);
-- }
--
-- /* Internal type of array is arranged right to left. */
-- for (i = nargs; i > 0; i--)
-- {
-- struct type *array_type = check_typedef (value_type (array));
-- LONGEST index = subscript_array[i - 1];
--
-- array = value_subscripted_rvalue (array, index,
-- f77_get_lowerbound (array_type));
-- }
--
-- return array;
-- }
--
- case BINOP_LOGICAL_AND:
- arg1 = evaluate_subexp (NULL_TYPE, exp, pos, noside);
- if (noside == EVAL_SKIP)
-@@ -3103,6 +3345,9 @@ calc_f77_array_dims (struct type *array_
- int ndimen = 1;
- struct type *tmp_type;
-
-+ if (TYPE_CODE (array_type) == TYPE_CODE_STRING)
-+ return 1;
-+
- if ((TYPE_CODE (array_type) != TYPE_CODE_ARRAY))
- error (_("Can't get dimensions for a non-array type"));
-
-diff -Naurp insight-7.12.50.20170416.orig/gdb/expprint.c insight-7.12.50.20170416.new/gdb/expprint.c
---- insight-7.12.50.20170416.orig/gdb/expprint.c 2017-04-09 01:11:01.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/expprint.c 2017-04-16 14:24:24.095834048 +0100
-@@ -568,12 +568,10 @@ print_subexp_standard (struct expression
- *pos += 2;
-
- fputs_filtered ("RANGE(", stream);
-- if (range_type == HIGH_BOUND_DEFAULT
-- || range_type == NONE_BOUND_DEFAULT)
-+ if ((range_type & SUBARRAY_LOW_BOUND) == SUBARRAY_LOW_BOUND)
- print_subexp (exp, pos, stream, PREC_ABOVE_COMMA);
- fputs_filtered ("..", stream);
-- if (range_type == LOW_BOUND_DEFAULT
-- || range_type == NONE_BOUND_DEFAULT)
-+ if ((range_type & SUBARRAY_HIGH_BOUND) == SUBARRAY_HIGH_BOUND)
- print_subexp (exp, pos, stream, PREC_ABOVE_COMMA);
- fputs_filtered (")", stream);
- return;
-@@ -1055,16 +1053,16 @@ dump_subexp_body_standard (struct expres
-
- switch (range_type)
- {
-- case BOTH_BOUND_DEFAULT:
-+ case SUBARRAY_NONE_BOUND:
- fputs_filtered ("Range '..'", stream);
- break;
-- case LOW_BOUND_DEFAULT:
-+ case SUBARRAY_HIGH_BOUND:
- fputs_filtered ("Range '..EXP'", stream);
- break;
-- case HIGH_BOUND_DEFAULT:
-+ case SUBARRAY_LOW_BOUND:
- fputs_filtered ("Range 'EXP..'", stream);
- break;
-- case NONE_BOUND_DEFAULT:
-+ case (SUBARRAY_LOW_BOUND | SUBARRAY_HIGH_BOUND):
- fputs_filtered ("Range 'EXP..EXP'", stream);
- break;
- default:
-@@ -1072,11 +1070,9 @@ dump_subexp_body_standard (struct expres
- break;
- }
-
-- if (range_type == HIGH_BOUND_DEFAULT
-- || range_type == NONE_BOUND_DEFAULT)
-+ if ((range_type & SUBARRAY_LOW_BOUND) == SUBARRAY_LOW_BOUND)
- elt = dump_subexp (exp, stream, elt);
-- if (range_type == LOW_BOUND_DEFAULT
-- || range_type == NONE_BOUND_DEFAULT)
-+ if ((range_type & SUBARRAY_HIGH_BOUND) == SUBARRAY_HIGH_BOUND)
- elt = dump_subexp (exp, stream, elt);
- }
- break;
-diff -Naurp insight-7.12.50.20170416.orig/gdb/expression.h insight-7.12.50.20170416.new/gdb/expression.h
---- insight-7.12.50.20170416.orig/gdb/expression.h 2017-04-09 01:11:01.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/expression.h 2017-04-16 14:24:24.095834048 +0100
-@@ -154,17 +154,17 @@ extern void dump_raw_expression (struct
- struct ui_file *, const char *);
- extern void dump_prefix_expression (struct expression *, struct ui_file *);
-
--/* In an OP_RANGE expression, either bound could be empty, indicating
-- that its value is by default that of the corresponding bound of the
-- array or string. So we have four sorts of subrange. This
-- enumeration type is to identify this. */
--
-+/* In an OP_RANGE expression, either bound can be provided by the user, or not.
-+ In addition to this, the user can also specify a stride value to indicated
-+ only certain elements of the array. This enumeration type is to identify
-+ this. */
-+
- enum range_type
- {
-- BOTH_BOUND_DEFAULT, /* "(:)" */
-- LOW_BOUND_DEFAULT, /* "(:high)" */
-- HIGH_BOUND_DEFAULT, /* "(low:)" */
-- NONE_BOUND_DEFAULT /* "(low:high)" */
-+ SUBARRAY_NONE_BOUND = 0x0, /* "( : )" */
-+ SUBARRAY_LOW_BOUND = 0x1, /* "(low:)" */
-+ SUBARRAY_HIGH_BOUND = 0x2, /* "(:high)" */
-+ SUBARRAY_STRIDE = 0x4 /* "(::stride)" */
- };
-
- #endif /* !defined (EXPRESSION_H) */
-diff -Naurp insight-7.12.50.20170416.orig/gdb/f-exp.y insight-7.12.50.20170416.new/gdb/f-exp.y
---- insight-7.12.50.20170416.orig/gdb/f-exp.y 2017-04-09 01:11:01.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/f-exp.y 2017-04-16 14:24:24.095834048 +0100
-@@ -254,31 +254,63 @@ arglist : subrange
-
- arglist : arglist ',' exp %prec ABOVE_COMMA
- { arglist_len++; }
-+ | arglist ',' subrange %prec ABOVE_COMMA
-+ { arglist_len++; }
- ;
-
- /* There are four sorts of subrange types in F90. */
-
- subrange: exp ':' exp %prec ABOVE_COMMA
-- { write_exp_elt_opcode (pstate, OP_RANGE);
-- write_exp_elt_longcst (pstate, NONE_BOUND_DEFAULT);
-+ { write_exp_elt_opcode (pstate, OP_RANGE);
-+ write_exp_elt_longcst (pstate,
-+ SUBARRAY_LOW_BOUND | SUBARRAY_HIGH_BOUND);
- write_exp_elt_opcode (pstate, OP_RANGE); }
- ;
-
- subrange: exp ':' %prec ABOVE_COMMA
- { write_exp_elt_opcode (pstate, OP_RANGE);
-- write_exp_elt_longcst (pstate, HIGH_BOUND_DEFAULT);
-+ write_exp_elt_longcst (pstate, SUBARRAY_LOW_BOUND);
- write_exp_elt_opcode (pstate, OP_RANGE); }
- ;
-
- subrange: ':' exp %prec ABOVE_COMMA
- { write_exp_elt_opcode (pstate, OP_RANGE);
-- write_exp_elt_longcst (pstate, LOW_BOUND_DEFAULT);
-+ write_exp_elt_longcst (pstate, SUBARRAY_HIGH_BOUND);
- write_exp_elt_opcode (pstate, OP_RANGE); }
- ;
-
- subrange: ':' %prec ABOVE_COMMA
- { write_exp_elt_opcode (pstate, OP_RANGE);
-- write_exp_elt_longcst (pstate, BOTH_BOUND_DEFAULT);
-+ write_exp_elt_longcst (pstate, SUBARRAY_NONE_BOUND);
-+ write_exp_elt_opcode (pstate, OP_RANGE); }
-+ ;
-+
-+/* Each subrange type can have a stride argument. */
-+subrange: exp ':' exp ':' exp %prec ABOVE_COMMA
-+ { write_exp_elt_opcode (pstate, OP_RANGE);
-+ write_exp_elt_longcst (pstate, SUBARRAY_LOW_BOUND
-+ | SUBARRAY_HIGH_BOUND
-+ | SUBARRAY_STRIDE);
-+ write_exp_elt_opcode (pstate, OP_RANGE); }
-+ ;
-+
-+subrange: exp ':' ':' exp %prec ABOVE_COMMA
-+ { write_exp_elt_opcode (pstate, OP_RANGE);
-+ write_exp_elt_longcst (pstate, SUBARRAY_LOW_BOUND
-+ | SUBARRAY_STRIDE);
-+ write_exp_elt_opcode (pstate, OP_RANGE); }
-+ ;
-+
-+subrange: ':' exp ':' exp %prec ABOVE_COMMA
-+ { write_exp_elt_opcode (pstate, OP_RANGE);
-+ write_exp_elt_longcst (pstate, SUBARRAY_HIGH_BOUND
-+ | SUBARRAY_STRIDE);
-+ write_exp_elt_opcode (pstate, OP_RANGE); }
-+ ;
-+
-+subrange: ':' ':' exp %prec ABOVE_COMMA
-+ { write_exp_elt_opcode (pstate, OP_RANGE);
-+ write_exp_elt_longcst (pstate, SUBARRAY_STRIDE);
- write_exp_elt_opcode (pstate, OP_RANGE); }
- ;
-
-diff -Naurp insight-7.12.50.20170416.orig/gdb/f-valprint.c insight-7.12.50.20170416.new/gdb/f-valprint.c
---- insight-7.12.50.20170416.orig/gdb/f-valprint.c 2017-04-16 14:23:22.963275825 +0100
-+++ insight-7.12.50.20170416.new/gdb/f-valprint.c 2017-04-16 14:24:24.096834057 +0100
-@@ -121,8 +121,14 @@ f77_print_array_1 (int nss, int ndimensi
-
- if (nss != ndimensions)
- {
-- size_t dim_size = TYPE_LENGTH (TYPE_TARGET_TYPE (type));
-+ size_t dim_size;
- size_t offs = 0;
-+ LONGEST byte_stride = abs (TYPE_BYTE_STRIDE (range_type));
-+
-+ if (byte_stride)
-+ dim_size = byte_stride;
-+ else
-+ dim_size = TYPE_LENGTH (TYPE_TARGET_TYPE (type));
-
- for (i = lowerbound;
- (i < upperbound + 1 && (*elts) < options->print_max);
-diff -Naurp insight-7.12.50.20170416.orig/gdb/gdbtypes.c insight-7.12.50.20170416.new/gdb/gdbtypes.c
---- insight-7.12.50.20170416.orig/gdb/gdbtypes.c 2017-04-16 14:23:22.893275182 +0100
-+++ insight-7.12.50.20170416.new/gdb/gdbtypes.c 2017-04-16 14:24:24.097834067 +0100
-@@ -862,7 +862,8 @@ allocate_stub_method (struct type *type)
- struct type *
- create_range_type (struct type *result_type, struct type *index_type,
- const struct dynamic_prop *low_bound,
-- const struct dynamic_prop *high_bound)
-+ const struct dynamic_prop *high_bound,
-+ const struct dynamic_prop *stride)
- {
- if (result_type == NULL)
- result_type = alloc_type_copy (index_type);
-@@ -877,6 +878,7 @@ create_range_type (struct type *result_t
- TYPE_ZALLOC (result_type, sizeof (struct range_bounds));
- TYPE_RANGE_DATA (result_type)->low = *low_bound;
- TYPE_RANGE_DATA (result_type)->high = *high_bound;
-+ TYPE_RANGE_DATA (result_type)->stride = *stride;
-
- if (low_bound->kind == PROP_CONST && low_bound->data.const_val >= 0)
- TYPE_UNSIGNED (result_type) = 1;
-@@ -905,7 +907,7 @@ struct type *
- create_static_range_type (struct type *result_type, struct type *index_type,
- LONGEST low_bound, LONGEST high_bound)
- {
-- struct dynamic_prop low, high;
-+ struct dynamic_prop low, high, stride;
-
- low.kind = PROP_CONST;
- low.data.const_val = low_bound;
-@@ -913,7 +915,11 @@ create_static_range_type (struct type *r
- high.kind = PROP_CONST;
- high.data.const_val = high_bound;
-
-- result_type = create_range_type (result_type, index_type, &low, &high);
-+ stride.kind = PROP_CONST;
-+ stride.data.const_val = 0;
-+
-+ result_type = create_range_type (result_type, index_type,
-+ &low, &high, &stride);
-
- return result_type;
- }
-@@ -1110,16 +1116,20 @@ create_array_type_with_stride (struct ty
- && (!type_not_associated (result_type)
- && !type_not_allocated (result_type)))
- {
-- LONGEST low_bound, high_bound;
-+ LONGEST low_bound, high_bound, byte_stride;
-
- if (get_discrete_bounds (range_type, &low_bound, &high_bound) < 0)
- low_bound = high_bound = 0;
- element_type = check_typedef (element_type);
-+ byte_stride = abs (TYPE_BYTE_STRIDE (range_type));
-+
- /* Be careful when setting the array length. Ada arrays can be
- empty arrays with the high_bound being smaller than the low_bound.
- In such cases, the array length should be zero. */
- if (high_bound < low_bound)
- TYPE_LENGTH (result_type) = 0;
-+ else if (byte_stride > 0)
-+ TYPE_LENGTH (result_type) = byte_stride * (high_bound - low_bound + 1);
- else if (bit_stride > 0)
- TYPE_LENGTH (result_type) =
- (bit_stride * (high_bound - low_bound + 1) + 7) / 8;
-@@ -1912,12 +1922,12 @@ resolve_dynamic_range (struct type *dyn_
- 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;
-@@ -1929,7 +1939,7 @@ resolve_dynamic_range (struct type *dyn_
- }
-
- 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;
-@@ -1944,12 +1954,20 @@ resolve_dynamic_range (struct type *dyn_
- 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 -Naurp insight-7.12.50.20170416.orig/gdb/gdbtypes.h insight-7.12.50.20170416.new/gdb/gdbtypes.h
---- insight-7.12.50.20170416.orig/gdb/gdbtypes.h 2017-04-16 14:23:22.894275191 +0100
-+++ insight-7.12.50.20170416.new/gdb/gdbtypes.h 2017-04-16 14:24:24.098834076 +0100
-@@ -553,6 +553,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. */
-
-@@ -715,7 +719,6 @@ struct main_type
- /* * Union member used for range types. */
-
- struct range_bounds *bounds;
--
- } flds_bnds;
-
- /* * Slot to point to additional language-specific fields of this
-@@ -1230,6 +1233,15 @@ extern void allocate_gnat_aux_type (stru
- TYPE_RANGE_DATA(range_type)->high.kind
- #define TYPE_LOW_BOUND_KIND(range_type) \
- TYPE_RANGE_DATA(range_type)->low.kind
-+#define TYPE_BYTE_STRIDE(range_type) \
-+ TYPE_RANGE_DATA(range_type)->stride.data.const_val
-+#define TYPE_BYTE_STRIDE_BLOCK(range_type) \
-+ TYPE_RANGE_DATA(range_type)->stride.data.locexpr
-+#define TYPE_BYTE_STRIDE_LOCLIST(range_type) \
-+ TYPE_RANGE_DATA(range_type)->stride.data.loclist
-+#define TYPE_BYTE_STRIDE_KIND(range_type) \
-+ TYPE_RANGE_DATA(range_type)->stride.kind
-+
-
- /* Property accessors for the type data location. */
- #define TYPE_DATA_LOCATION(thistype) \
-@@ -1264,6 +1276,9 @@ extern void allocate_gnat_aux_type (stru
- TYPE_HIGH_BOUND_UNDEFINED(TYPE_INDEX_TYPE(arraytype))
- #define TYPE_ARRAY_LOWER_BOUND_IS_UNDEFINED(arraytype) \
- TYPE_LOW_BOUND_UNDEFINED(TYPE_INDEX_TYPE(arraytype))
-+#define TYPE_ARRAY_STRIDE_IS_UNDEFINED(arraytype) \
-+ (TYPE_BYTE_STRIDE(TYPE_INDEX_TYPE(arraytype)) == 0)
-+
-
- #define TYPE_ARRAY_UPPER_BOUND_VALUE(arraytype) \
- (TYPE_HIGH_BOUND(TYPE_INDEX_TYPE((arraytype))))
-@@ -1781,6 +1796,7 @@ extern struct type *create_array_type_wi
-
- extern struct type *create_range_type (struct type *, struct type *,
- const struct dynamic_prop *,
-+ const struct dynamic_prop *,
- const struct dynamic_prop *);
-
- extern struct type *create_array_type (struct type *, struct type *,
-diff -Naurp insight-7.12.50.20170416.orig/gdb/parse.c insight-7.12.50.20170416.new/gdb/parse.c
---- insight-7.12.50.20170416.orig/gdb/parse.c 2017-03-25 10:42:37.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/parse.c 2017-04-16 14:24:24.098834076 +0100
-@@ -1007,22 +1007,20 @@ operator_length_standard (const struct e
-
- case OP_RANGE:
- oplen = 3;
-+ args = 0;
- range_type = (enum range_type)
- longest_to_int (expr->elts[endpos - 2].longconst);
-
-- switch (range_type)
-- {
-- case LOW_BOUND_DEFAULT:
-- case HIGH_BOUND_DEFAULT:
-- args = 1;
-- break;
-- case BOTH_BOUND_DEFAULT:
-- args = 0;
-- break;
-- case NONE_BOUND_DEFAULT:
-- args = 2;
-- break;
-- }
-+ /* Increment the argument counter for each argument
-+ provided by the user. */
-+ if ((range_type & SUBARRAY_LOW_BOUND) == SUBARRAY_LOW_BOUND)
-+ args++;
-+
-+ if ((range_type & SUBARRAY_HIGH_BOUND) == SUBARRAY_HIGH_BOUND)
-+ args++;
-+
-+ if ((range_type & SUBARRAY_STRIDE) == SUBARRAY_STRIDE)
-+ args++;
-
- break;
-
-diff -Naurp insight-7.12.50.20170416.orig/gdb/rust-exp.y insight-7.12.50.20170416.new/gdb/rust-exp.y
---- insight-7.12.50.20170416.orig/gdb/rust-exp.y 2017-04-09 01:11:01.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/rust-exp.y 2017-04-16 14:24:24.099834085 +0100
-@@ -2409,23 +2409,17 @@ convert_ast_to_expression (struct parser
-
- case OP_RANGE:
- {
-- enum range_type kind = BOTH_BOUND_DEFAULT;
-+ enum range_type kind = SUBARRAY_NONE_BOUND;
-
- if (operation->left.op != NULL)
- {
- convert_ast_to_expression (state, operation->left.op, top);
-- kind = HIGH_BOUND_DEFAULT;
-+ kind = SUBARRAY_LOW_BOUND;
- }
- if (operation->right.op != NULL)
- {
- convert_ast_to_expression (state, operation->right.op, top);
-- if (kind == BOTH_BOUND_DEFAULT)
-- kind = LOW_BOUND_DEFAULT;
-- else
-- {
-- gdb_assert (kind == HIGH_BOUND_DEFAULT);
-- kind = NONE_BOUND_DEFAULT;
-- }
-+ kind = (range_type) (kind | SUBARRAY_HIGH_BOUND);
- }
- write_exp_elt_opcode (state, OP_RANGE);
- write_exp_elt_longcst (state, kind);
-diff -Naurp insight-7.12.50.20170416.orig/gdb/rust-lang.c insight-7.12.50.20170416.new/gdb/rust-lang.c
---- insight-7.12.50.20170416.orig/gdb/rust-lang.c 2017-04-16 14:23:22.906275302 +0100
-+++ insight-7.12.50.20170416.new/gdb/rust-lang.c 2017-04-16 14:24:24.099834085 +0100
-@@ -1314,9 +1314,9 @@ rust_range (struct expression *exp, int
- kind = (enum range_type) longest_to_int (exp->elts[*pos + 1].longconst);
- *pos += 3;
-
-- if (kind == HIGH_BOUND_DEFAULT || kind == NONE_BOUND_DEFAULT)
-+ if ((kind & SUBARRAY_LOW_BOUND) == SUBARRAY_LOW_BOUND)
- low = evaluate_subexp (NULL_TYPE, exp, pos, noside);
-- if (kind == LOW_BOUND_DEFAULT || kind == NONE_BOUND_DEFAULT)
-+ if ((kind & SUBARRAY_HIGH_BOUND) == SUBARRAY_HIGH_BOUND)
- high = evaluate_subexp (NULL_TYPE, exp, pos, noside);
-
- if (noside == EVAL_SKIP)
-@@ -1405,7 +1405,7 @@ rust_compute_range (struct type *type, s
-
- *low = 0;
- *high = 0;
-- *kind = BOTH_BOUND_DEFAULT;
-+ *kind = SUBARRAY_NONE_BOUND;
-
- if (TYPE_NFIELDS (type) == 0)
- return;
-@@ -1413,15 +1413,14 @@ rust_compute_range (struct type *type, s
- i = 0;
- if (strcmp (TYPE_FIELD_NAME (type, 0), "start") == 0)
- {
-- *kind = HIGH_BOUND_DEFAULT;
-+ *kind = SUBARRAY_LOW_BOUND;
- *low = value_as_long (value_field (range, 0));
- ++i;
- }
- if (TYPE_NFIELDS (type) > i
- && strcmp (TYPE_FIELD_NAME (type, i), "end") == 0)
- {
-- *kind = (*kind == BOTH_BOUND_DEFAULT
-- ? LOW_BOUND_DEFAULT : NONE_BOUND_DEFAULT);
-+ *kind = (range_type) (*kind | SUBARRAY_HIGH_BOUND);
- *high = value_as_long (value_field (range, i));
- }
- }
-@@ -1436,7 +1435,7 @@ rust_subscript (struct expression *exp,
- struct type *rhstype;
- LONGEST low, high_bound;
- /* Initialized to appease the compiler. */
-- enum range_type kind = BOTH_BOUND_DEFAULT;
-+ enum range_type kind = SUBARRAY_NONE_BOUND;
- LONGEST high = 0;
- int want_slice = 0;
-
-@@ -1498,7 +1497,7 @@ rust_subscript (struct expression *exp,
- error (_("Cannot subscript non-array type"));
-
- if (want_slice
-- && (kind == BOTH_BOUND_DEFAULT || kind == LOW_BOUND_DEFAULT))
-+ && ((kind & SUBARRAY_LOW_BOUND) != SUBARRAY_LOW_BOUND))
- low = low_bound;
- if (low < 0)
- error (_("Index less than zero"));
-@@ -1516,7 +1515,7 @@ rust_subscript (struct expression *exp,
- CORE_ADDR addr;
- struct value *addrval, *tem;
-
-- if (kind == BOTH_BOUND_DEFAULT || kind == HIGH_BOUND_DEFAULT)
-+ if ((kind & SUBARRAY_HIGH_BOUND) != SUBARRAY_HIGH_BOUND)
- high = high_bound;
- if (high < 0)
- error (_("High index less than zero"));
-diff -Naurp insight-7.12.50.20170416.orig/gdb/testsuite/gdb.fortran/static-arrays.exp insight-7.12.50.20170416.new/gdb/testsuite/gdb.fortran/static-arrays.exp
---- insight-7.12.50.20170416.orig/gdb/testsuite/gdb.fortran/static-arrays.exp 1970-01-01 01:00:00.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/testsuite/gdb.fortran/static-arrays.exp 2017-04-16 14:24:24.100834094 +0100
-@@ -0,0 +1,421 @@
-+# Copyright 2015 Free Software Foundation, Inc.
-+#
-+# Contributed by Intel Corp. <christoph.t.weinmann(a)intel.com>
-+#
-+# 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 static-arrays.f90
-+
-+if { [prepare_for_testing $testfile.exp $testfile $srcfile {debug f90}] } {
-+ return -1
-+}
-+
-+if ![runto MAIN__] then {
-+ perror "couldn't run to breakpoint MAIN__"
-+ continue
-+}
-+
-+gdb_breakpoint [gdb_get_line_number "BP1"]
-+gdb_continue_to_breakpoint "BP1" ".*BP1.*"
-+
-+# Tests subarrays of one dimensional arrays with subrange variations
-+gdb_test "print ar1" "\\$\[0-9\]+ = \\(1, 2, 3, 4, 5, 6, 7, 8, 9\\)" \
-+ "print ar1."
-+gdb_test "print ar1\(4:7\)" "\\$\[0-9\]+ = \\(4, 5, 6, 7\\)" \
-+ "print ar1\(4:7\)"
-+gdb_test "print ar1\(8:\)" "\\$\[0-9\]+ = \\(8, 9\\).*" \
-+ "print ar1\(8:\)"
-+gdb_test "print ar1\(:3\)" "\\$\[0-9\]+ = \\(1, 2, 3\\).*" \
-+ "print ar1\(:3\)"
-+gdb_test "print ar1\(:\)" "\\$\[0-9\]+ = \\(1, 2, 3, 4, 5, 6, 7, 8, 9\\)" \
-+ "print ar1\(:\)"
-+
-+# Check assignment
-+gdb_test_no_output "set \$my_ary = ar1\(3:8\)"
-+gdb_test "print \$my_ary" \
-+ "\\$\[0-9\]+ = \\(3, 4, 5, 6, 7, 8\\)" \
-+ "Assignment of subarray to variable"
-+gdb_test_no_output "set ar1\(5\) = 42"
-+ gdb_test "print ar1\(3:8\)" \
-+ "\\$\[0-9\]+ = \\(3, 4, 42, 6, 7, 8\\)" \
-+ "print ar1\(3:8\) after assignment"
-+gdb_test "print \$my_ary" \
-+ "\\$\[0-9\]+ = \\(3, 4, 5, 6, 7, 8\\)" \
-+ "Assignment of subarray to variable after original array changed"
-+
-+# Test for subarrays of one dimensional arrays with literals
-+ gdb_test "print ar1\(3\)" "\\$\[0-9\]+ = 3" \
-+ "print ar1\(3\)"
-+
-+# Tests for subranges of 2 dimensional arrays with subrange variations
-+gdb_test "print ar2\(2:3, 3:4\)" \
-+ "\\$\[0-9\]+ = \\(\\( 23, 33\\) \\( 24, 34\\) \\)" \
-+ "print ar2\(2:3, 3:4\)."
-+gdb_test "print ar2\(8:9,8:\)" \
-+ "\\$\[0-9\]+ = \\(\\( 88, 98\\) \\( 89, 99\\) \\)" \
-+ "print ar2\(8:9,8:\)"
-+gdb_test "print ar2\(8:9,:2\)" \
-+ "\\$\[0-9\]+ = \\(\\( 81, 91\\) \\( 82, 92\\) \\)" \
-+ "print ar2\(8:9,:2\)"
-+
-+gdb_test "print ar2\(8:,8:9\)" \
-+ "\\$\[0-9\]+ = \\(\\( 88, 98\\) \\( 89, 99\\) \\)" \
-+ "print ar2\(8:,8:9\)"
-+gdb_test "print ar2\(8:,8:\)" \
-+ "\\$\[0-9\]+ = \\(\\( 88, 98\\) \\( 89, 99\\) \\)" \
-+ "print ar2\(8:,8:\)"
-+gdb_test "print ar2\(8:,:2\)" \
-+ "\\$\[0-9\]+ = \\(\\( 81, 91\\) \\( 82, 92\\) \\)" \
-+ "print ar2\(8:,:2\)"
-+
-+gdb_test "print ar2\(:2,2:3\)" \
-+ "\\$\[0-9\]+ = \\(\\( 12, 22\\) \\( 13, 23\\) \\)" \
-+ "print ar2\(:2,2:3\)"
-+gdb_test "print ar2\(:2,8:\)" \
-+ "\\$\[0-9\]+ = \\(\\( 18, 28\\) \\( 19, 29\\) \\)" \
-+ "print ar2\(:2,8:\)"
-+gdb_test "print ar2\(:2,:2\)" \
-+ "\\$\[0-9\]+ = \\(\\( 11, 21\\) \\( 12, 22\\) \\)" \
-+ "print ar2\(:2,:2\)"
-+
-+# Test subranges of 2 dimensional arrays with literals and subrange variations
-+gdb_test "print ar2\(7, 3:6\)" \
-+ "\\$\[0-9\]+ = \\(73, 74, 75, 76\\)" \
-+ "print ar2\(7, 3:6\)"
-+gdb_test "print ar2\(7,8:\)" \
-+ "\\$\[0-9\]+ = \\(78, 79\\)" \
-+ "print ar2\(7,8:\)"
-+gdb_test "print ar2\(7,:2\)" \
-+ "\\$\[0-9\]+ = \\(71, 72\\)" \
-+ "print ar2\(7,:2\)"
-+
-+gdb_test "print ar2\(7:8,4\)" \
-+ "\\$\[0-9\]+ = \\(74, 84\\)" \
-+ "print ar2(7:8,4\)"
-+gdb_test "print ar2\(8:,4\)" \
-+ "\\$\[0-9\]+ = \\(84, 94\\)" \
-+ "print ar2\(8:,4\)"
-+gdb_test "print ar2\(:2,4\)" \
-+ "\\$\[0-9\]+ = \\(14, 24\\)" \
-+ "print ar2\(:2,4\)"
-+gdb_test "print ar2\(3,4\)" \
-+ "\\$\[0-9\]+ = 34" \
-+ "print ar2\(3,4\)"
-+
-+# Test subarrays of 3 dimensional arrays with literals and subrange variations
-+gdb_test "print ar3\(2:4,3:4,7:8\)" \
-+ "\\$\[0-9\]+ = \\(\\( \\( 237, 337, 437\\) \\( 247, 347, 447\\)\
-+ \\) \\( \\( 238, 338, 438\\) \\( 248, 348, 448\\) \\) \\)" \
-+ "print ar3\(2:4,3:4,7:8\)"
-+gdb_test "print ar3\(2:3,4:5,8:\)" \
-+ "\\$\[0-9\]+ = \\(\\( \\( 248, 348\\) \\( 258, 358\\) \\) \\(\
-+ \\( 249, 349\\) \\( 259, 359\\) \\) \\)" \
-+ "print ar3\(2:3,4:5,8:\)"
-+gdb_test "print ar3\(2:3,4:5,:2\)" \
-+ "\\$\[0-9\]+ = \\(\\( \\( 241, 341\\) \\( 251, 351\\) \\) \\(\
-+ \\( 242, 342\\) \\( 252, 352\\) \\) \\)" \
-+ "print ar3\(2:3,4:5,:2\)"
-+
-+gdb_test "print ar3\(2:3,8:,7:8\)" \
-+ "\\$\[0-9\]+ = \\(\\( \\( 287, 387\\) \\( 297, 397\\) \\) \\(\
-+ \\( 288, 388\\) \\( 298, 398\\) \\) \\)" \
-+ "print ar3\(2:3,8:,7:8\)"
-+gdb_test "print ar3\(2:3,8:,8:\)" \
-+ "\\$\[0-9\]+ = \\(\\( \\( 288, 388\\) \\( 298, 398\\) \\) \\(\
-+ \\( 289, 389\\) \\( 299, 399\\) \\) \\)" \
-+ "print ar3\(2:3,8:,8:\)"
-+gdb_test "print ar3\(2:3,8:,:2\)" \
-+ "\\$\[0-9\]+ = \\(\\( \\( 281, 381\\) \\( 291, 391\\) \\) \\(\
-+ \\( 282, 382\\) \\( 292, 392\\) \\) \\)" \
-+ "print ar3\(2:3,8:,:2\)"
-+
-+gdb_test "print ar3\(2:3,:2,7:8\)" \
-+ "\\$\[0-9\]+ = \\(\\( \\( 217, 317\\) \\( 227, 327\\) \\) \\(\
-+ \\( 218, 318\\) \\( 228, 328\\) \\) \\)" \
-+ "print ar3\(2:3,:2,7:8\)"
-+gdb_test "print ar3\(2:3,:2,8:\)" \
-+ "\\$\[0-9\]+ = \\(\\( \\( 218, 318\\) \\( 228, 328\\) \\) \\(\
-+ \\( 219, 319\\) \\( 229, 329\\) \\) \\)" \
-+ "print ar3\(2:3,:2,8:\)"
-+gdb_test "print ar3\(2:3,:2,:2\)" \
-+ "\\$\[0-9\]+ = \\(\\( \\( 211, 311\\) \\( 221, 321\\) \\) \\(\
-+ \\( 212, 312\\) \\( 222, 322\\) \\) \\)" \
-+ "print ar3\(2:3,:2,:2\)"
-+
-+gdb_test "print ar3\(8:,3:4,7:8\)" \
-+ "\\$\[0-9\]+ = \\(\\( \\( 837, 937\\) \\( 847, 947\\) \\) \\(\
-+ \\( 838, 938\\) \\( 848, 948\\) \\) \\)" \
-+ "print ar3\(8:,3:4,7:8\)"
-+gdb_test "print ar3\(8:,4:5,8:\)" \
-+ "\\$\[0-9\]+ = \\(\\( \\( 848, 948\\) \\( 858, 958\\) \\) \\(\
-+ \\( 849, 949\\) \\( 859, 959\\) \\) \\)" \
-+ "print ar3\(8:,4:5,8:\)"
-+gdb_test "print ar3\(8:,4:5,:2\)" \
-+ "\\$\[0-9\]+ = \\(\\( \\( 841, 941\\) \\( 851, 951\\) \\) \\(\
-+ \\( 842, 942\\) \\( 852, 952\\) \\) \\)" \
-+ "print ar3\(8:,4:5,:2\)"
-+
-+gdb_test "print ar3\(8:,8:,7:8\)" \
-+ "\\$\[0-9\]+ = \\(\\( \\( 887, 987\\) \\( 897, 997\\) \\) \\(\
-+ \\( 888, 988\\) \\( 898, 998\\) \\) \\)" \
-+ "print ar3\(8:,8:,7:8\)"
-+gdb_test "print ar3\(8:,8:,8:\)" \
-+ "\\$\[0-9\]+ = \\(\\( \\( 888, 988\\) \\( 898, 998\\) \\) \\(\
-+ \\( 889, 989\\) \\( 899, 999\\) \\) \\)" \
-+ "print ar3\(8:,8:,8:\)"
-+gdb_test "print ar3\(8:,8:,:2\)" \
-+ "\\$\[0-9\]+ = \\(\\( \\( 881, 981\\) \\( 891, 991\\) \\) \\(\
-+ \\( 882, 982\\) \\( 892, 992\\) \\) \\)" \
-+ "print ar3\(8:,8:,:2\)"
-+
-+gdb_test "print ar3\(8:,:2,7:8\)" \
-+ "\\$\[0-9\]+ = \\(\\( \\( 817, 917\\) \\( 827, 927\\) \\) \\(\
-+ \\( 818, 918\\) \\( 828, 928\\) \\) \\)" \
-+ "print ar3\(8:,:2,7:8\)"
-+gdb_test "print ar3\(8:,:2,8:\)" \
-+ "\\$\[0-9\]+ = \\(\\( \\( 818, 918\\) \\( 828, 928\\) \\) \\(\
-+ \\( 819, 919\\) \\( 829, 929\\) \\) \\)" \
-+ "print ar3\(8:,:2,8:\)"
-+gdb_test "print ar3\(8:,:2,:2\)" \
-+ "\\$\[0-9\]+ = \\(\\( \\( 811, 911\\) \\( 821, 921\\) \\) \\(\
-+ \\( 812, 912\\) \\( 822, 922\\) \\) \\)" \
-+ "print ar3\(8:,:2,:2\)"
-+
-+
-+gdb_test "print ar3\(:2,3:4,7:8\)" \
-+ "\\$\[0-9\]+ = \\(\\( \\( 137, 237\\) \\( 147, 247\\) \\) \\(\
-+ \\( 138, 238\\) \\( 148, 248\\) \\) \\)" \
-+ "print ar3 \(:2,3:4,7:8\)."
-+gdb_test "print ar3\(:2,3:4,8:\)" \
-+ "\\$\[0-9\]+ = \\(\\( \\( 138, 238\\) \\( 148, 248\\) \\) \\(\
-+ \\( 139, 239\\) \\( 149, 249\\) \\) \\)" \
-+ "print ar3\(:2,3:4,8:\)"
-+gdb_test "print ar3\(:2,3:4,:2\)" \
-+ "\\$\[0-9\]+ = \\(\\( \\( 131, 231\\) \\( 141, 241\\) \\) \\(\
-+ \\( 132, 232\\) \\( 142, 242\\) \\) \\)" \
-+ "print ar3\(:2,3:4,:2\)"
-+
-+gdb_test "print ar3\(:2,8:,7:8\)" "\\$\[0-9\]+ = \\(\\( \\( 187, 287\\) \\(\
-+ 197, 297\\) \\) \\( \\( 188, 288\\) \\( 198, 298\\) \\) \\)" \
-+ "print ar3\(:2,8:,7:8\)"
-+gdb_test "print ar3\(:2,8:,8:\)" "\\$\[0-9\]+ = \\(\\( \\( 188, 288\\) \\( 198,\
-+ 298\\) \\) \\( \\( 189, 289\\) \\( 199, 299\\) \\) \\)" \
-+ "print ar3\(:2,8:,8:\)"
-+gdb_test "print ar3\(:2,8:,:2\)" "\\$\[0-9\]+ = \\(\\( \\( 181, 281\\) \\( 191,\
-+ 291\\) \\) \\( \\( 182, 282\\) \\( 192, 292\\) \\) \\)" \
-+ "print ar3\(:2,8:,:2\)"
-+
-+gdb_test "print ar3\(:2,:2,7:8\)" \
-+ "\\$\[0-9\]+ = \\(\\( \\( 117, 217\\) \\( 127, 227\\) \\) \\(\
-+ \\( 118, 218\\) \\( 128, 228\\) \\) \\)" \
-+ "print ar3\(:2,:2,7:8\)"
-+gdb_test "print ar3\(:2,:2,8:\)" \
-+ "\\$\[0-9\]+ = \\(\\( \\( 118, 218\\) \\( 128, 228\\) \\) \\(\
-+ \\( 119, 219\\) \\( 129, 229\\) \\) \\)" \
-+ "print ar3\(:2,:2,8:\)"
-+gdb_test "print ar3\(:2,:2,:2\)" \
-+ "\\$\[0-9\]+ = \\(\\( \\( 111, 211\\) \\( 121, 221\\) \\) \\(\
-+ \\( 112, 212\\) \\( 122, 222\\) \\) \\)" \
-+ "print ar3\(:2,:2,:2\)"
-+
-+#Tests for subarrays of 3 dimensional arrays with literals and subranges
-+gdb_test "print ar3\(3,3:4,7:8\)" \
-+ "\\$\[0-9\]+ = \\(\\( 337, 347\\) \\( 338, 348\\) \\)" \
-+ "print ar3\(3,3:4,7:8\)"
-+gdb_test "print ar3\(3,4:5,8:\)" \
-+ "\\$\[0-9\]+ = \\(\\( 348, 358\\) \\( 349, 359\\) \\)" \
-+ "print ar3\(3,4:5,8:\)"
-+gdb_test "print ar3\(3,4:5,:2\)" \
-+ "\\$\[0-9\]+ = \\(\\( 341, 351\\) \\( 342, 352\\) \\)" \
-+ "print ar3\(3,4:5,:2\)"
-+gdb_test "print ar3\(3,4:5,3\)" \
-+ "\\$\[0-9\]+ = \\(343, 353\\)" \
-+ "print ar3\(3,4:5,3\)"
-+
-+gdb_test "print ar3\(2,8:,7:8\)" \
-+ "\\$\[0-9\]+ = \\(\\( 287, 297\\) \\( 288, 298\\) \\)" \
-+ "print ar3\(2,8:,7:8\)"
-+gdb_test "print ar3\(2,8:,8:\)" \
-+ "\\$\[0-9\]+ = \\(\\( 288, 298\\) \\( 289, 299\\) \\)" \
-+ "print ar3\(2,8:,8:\)"
-+gdb_test "print ar3\(2,8:,:2\)"\
-+ "\\$\[0-9\]+ = \\(\\( 281, 291\\) \\( 282, 292\\) \\)" \
-+ "print ar3\(2,8:,:2\)"
-+gdb_test "print ar3\(2,8:,3\)" \
-+ "\\$\[0-9\]+ = \\(283, 293\\)" \
-+ "print ar3\(2,8:,3\)"
-+
-+gdb_test "print ar3\(2,:2,7:8\)" \
-+ "\\$\[0-9\]+ = \\(\\( 217, 227\\) \\( 218, 228\\) \\)" \
-+ "print ar3\(2,:2,7:8\)"
-+gdb_test "print ar3\(2,:2,8:\)" \
-+ "\\$\[0-9\]+ = \\(\\( 218, 228\\) \\( 219, 229\\) \\)" \
-+ "print ar3\(2,:2,8:\)"
-+gdb_test "print ar3\(2,:2,:2\)" \
-+ "\\$\[0-9\]+ = \\(\\( 211, 221\\) \\( 212, 222\\) \\)" \
-+ "print ar3\(2,:2,:2\)"
-+gdb_test "print ar3\(2,:2,3\)" \
-+ "\\$\[0-9\]+ = \\(213, 223\\)" \
-+ "print ar3\(2,:2,3\)"
-+
-+gdb_test "print ar3\(3,4,7:8\)" \
-+ "\\$\[0-9\]+ = \\(347, 348\\)" \
-+ "print ar3\(3,4,7:8\)"
-+gdb_test "print ar3\(3,4,8:\)" \
-+ "\\$\[0-9\]+ = \\(348, 349\\)" \
-+i "print ar3\(3,4,8:\)"
-+gdb_test "print ar3\(3,4,:2\)" \
-+ "\\$\[0-9\]+ = \\(341, 342\\)" \
-+ "print ar3\(3,4,:2\)"
-+gdb_test "print ar3\(5,6,7\)" \
-+ "\\$\[0-9\]+ = 567" \
-+ "print ar3\(5,6,7\)"
-+
-+gdb_test "print ar3\(3:4,6,7:8\)" \
-+ "\\$\[0-9\]+ = \\(\\( 367, 467\\) \\( 368, 468\\) \\)" \
-+ "print ar3\(3:4,6,7:8\)"
-+gdb_test "print ar3\(3:4,6,8:\)" \
-+ "\\$\[0-9\]+ = \\(\\( 368, 468\\) \\( 369, 469\\) \\)" \
-+ "print ar3\(3:4,6,8:\)"
-+gdb_test "print ar3\(3:4,6,:2\)" \
-+ "\\$\[0-9\]+ = \\(\\( 361, 461\\) \\( 362, 462\\) \\)" \
-+ "print ar3\(3:4,6,:2\)"
-+gdb_test "print ar3\(3:4,6,5\)" \
-+ "\\$\[0-9\]+ = \\(365, 465\\)" \
-+ "print ar3\(3:4,6,5\)"
-+
-+gdb_test "print ar3\(8:,6,7:8\)" \
-+ "\\$\[0-9\]+ = \\(\\( 867, 967\\) \\( 868, 968\\) \\)" \
-+ "print ar3\(8:,6,7:8\)"
-+gdb_test "print ar3\(8:,6,8:\)" \
-+ "\\$\[0-9\]+ = \\(\\( 868, 968\\) \\( 869, 969\\) \\)" \
-+ "print ar3\(8:,6,8:\)"
-+gdb_test "print ar3\(8:,6,:2\)" \
-+ "\\$\[0-9\]+ = \\(\\( 861, 961\\) \\( 862, 962\\) \\)" \
-+ "print ar3\(8:,6,:2\)"
-+gdb_test "print ar3\(8:,6,5\)" \
-+ "\\$\[0-9\]+ = \\(865, 965\\)" \
-+ "print ar3\(8:,6,5\)"
-+
-+gdb_test "print ar3\(:2,6,7:8\)" \
-+ "\\$\[0-9\]+ = \\(\\( 167, 267\\) \\( 168, 268\\) \\)" \
-+ "print ar3\(:2,6,7:8\)"
-+gdb_test "print ar3\(:2,6,8:\)" \
-+ "\\$\[0-9\]+ = \\(\\( 168, 268\\) \\( 169, 269\\) \\)" \
-+ "print ar3\(:2,6,8:\)"
-+gdb_test "print ar3\(:2,6,:2\)" \
-+ "\\$\[0-9\]+ = \\(\\( 161, 261\\) \\( 162, 262\\) \\)" \
-+ "print ar3\(:2,6,:2\)"
-+gdb_test "print ar3\(:2,6,5\)" \
-+ "\\$\[0-9\]+ = \\(165, 265\\)" \
-+ "print ar3\(:2,6,5\)"
-+
-+gdb_test "print ar3\(3:4,5:6,4\)" \
-+ "\\$\[0-9\]+ = \\(\\( 354, 454\\) \\( 364, 464\\) \\)" \
-+ "print ar2\(3:4,5:6,4\)"
-+gdb_test "print ar3\(8:,5:6,4\)" \
-+ "\\$\[0-9\]+ = \\(\\( 854, 954\\) \\( 864, 964\\) \\)" \
-+ "print ar2\(8:,5:6,4\)"
-+gdb_test "print ar3\(:2,5:6,4\)" \
-+ "\\$\[0-9\]+ = \\(\\( 154, 254\\) \\( 164, 264\\) \\)" \
-+ "print ar2\(:2,5:6,4\)"
-+
-+# Stride > 1
-+gdb_test "print ar1\(2:6:2\)" \
-+ "\\$\[0-9\]+ = \\(2, 4, 6\\)" \
-+ "print ar1\(2:6:2\)"
-+gdb_test "print ar2\(2:6:2,3:4\)" \
-+ "\\$\[0-9\]+ = \\(\\( 23, 43, 63\\) \\( 24, 44, 64\\) \\)" \
-+ "print ar2\(2:6:2,3:4\)"
-+gdb_test "print ar2\(2:6:2,3\)" \
-+ "\\$\[0-9\]+ = \\(23, 43, 63\\)" \
-+ "print ar2\(2:6:2,3\)"
-+gdb_test "print ar3\(2:6:2,3:5:2,4:7:3\)" \
-+ "\\$\[0-9\]+ = \\(\\( \\( 234, 434, 634\\) \\( 254, 454, 654\\)\
-+ \\) \\( \\( 237, 437, 637\\) \\( 257, 457, 657\\) \\) \\)" \
-+ "print ar3\(2:6:2,3:5:2,4:7:3\)"
-+gdb_test "print ar3\(2:6:2,5,4:7:3\)" \
-+ "\\$\[0-9\]+ = \\(\\( 254, 454, 654\\) \\( 257, 457, 657\\)\
-+ \\)" \
-+ "print ar3\(2:6:2,5,4:7:3\)"
-+
-+# Stride < 0
-+gdb_test "print ar1\(8:2:-2\)" \
-+ "\\$\[0-9\]+ = \\(8, 6, 4, 2\\)" \
-+ "print ar1\(8:2:-2\)"
-+gdb_test "print ar2\(8:2:-2,3:4\)" \
-+ "\\$\[0-9\]+ = \\(\\( 83, 63, 43, 23\\) \\( 84, 64, 44, 24\\)\
-+ \\)" \
-+ "print ar2\(8:2:-2,3:4\)"
-+gdb_test "print ar2\(2:6:2,3\)" \
-+ "\\$\[0-9\]+ = \\(23, 43, 63\\)" \
-+ "print ar2\(2:6:2,3\)"
-+gdb_test "print ar3\(2:3,7:3:-4,4:7:3\)" \
-+ "\\$\[0-9\]+ = \\(\\( \\( 274, 374\\) \\( 234, 334\\) \\) \\(\
-+ \\( 277, 377\\) \\( 237, 337\\) \\) \\)" \
-+ "print ar3\(2:3,7:3:-4,4:7:3\)"
-+gdb_test "print ar3\(2:6:2,5,7:4:-3\)" \
-+ "\\$\[0-9\]+ = \\(\\( 257, 457, 657\\) \\( 254, 454, 654\\)\
-+ \\)" \
-+ "print ar3\(2:6:2,5,7:4:-3\)"
-+
-+# Tests with negative and mixed indices
-+gdb_test "p ar4\(2:4, -2:1, -15:-14\)" \
-+ "\\$\[0-9\]+ = \\(\\( \\( 261, 361, 461\\) \\( 271, 371, 471\\)\
-+ \\( 281, 381, 481\\) \\( 291, 391, 491\\) \\) \\( \\( 262,\
-+ 362, 462\\) \\( 272, 372, 472\\) \\( 282, 382, 482\\) \\( 292,\
-+ 392, 492\\) \\) \\)" \
-+ "print ar4(2:4, -2:1, -15:-14)"
-+
-+gdb_test "p ar4\(7,-6:2:3,-7\)" \
-+ "\\$\[0-9\]+ = \\(729, 759, 789\\)" \
-+ "print ar4(7,-6:2:3,-7)"
-+
-+gdb_test "p ar4\(9:2:-2, -6:2:3, -6:-15:-3\)" \
-+ "\\$\[0-9\]+ = \\(\\( \\( 930, 730, 530, 330\\) \\( 960, 760,\
-+ 560, 360\\) \\( 990, 790, 590, 390\\) \\) \\( \\( 927, 727,\
-+ 527, 327\\) \\( 957, 757, 557, 357\\) \\( 987, 787, 587,\
-+ 387\\) \\) \\( \\( 924, 724, 524, 324\\) \\( 954, 754, 554,\
-+ 354\\) \\( 984, 784, 584, 384\\) \\) \\( \\( 921, 721, 521,\
-+ 321\\) \\( 951, 751, 551, 351\\) \\( 981, 781, 581, 381\\) \\)\
-+ \\)" \
-+ "print ar4(9:2:-2, -6:2:3, -6:-15:-3)"
-+
-+gdb_test "p ar4\(:,:,:\)" \
-+ "\\$\[0-9\]+ = \\(\\( \\( 111, 211, 311, 411, 511, 611, 711,\
-+ 811, .*" \
-+ "print ar4(:,:,:)"
-+
-+# Provoke error messages for bad user input
-+gdb_test "print ar1\(0:4\)" \
-+ "provided bound\\(s\\) outside array bound\\(s\\)" \
-+ "print ar1\(0:4\)"
-+gdb_test "print ar1\(8:12\)" \
-+ "provided bound\\(s\\) outside array bound\\(s\\)" \
-+ "print ar1\(8:12\)"
-+gdb_test "print ar1\(8:2:\)" \
-+ "A syntax error in expression, near `\\)'." \
-+ "print ar1\(8:2:\)"
-+gdb_test "print ar1\(8:2:2\)" \
-+ "Wrong value provided for stride and boundaries" \
-+ "print ar1\(8:2:2\)"
-+gdb_test "print ar1\(2:8:-2\)" \
-+ "Wrong value provided for stride and boundaries" \
-+ "print ar1\(2:8:-2\)"
-+gdb_test "print ar1\(2:7:0\)" \
-+ "Stride must not be 0" \
-+ "print ar1\(2:7:0\)"
-+gdb_test "print ar1\(3:7\) = 42" \
-+ "Invalid cast." \
-+ "Assignment of value to subarray"
-diff -Naurp insight-7.12.50.20170416.orig/gdb/testsuite/gdb.fortran/static-arrays.f90 insight-7.12.50.20170416.new/gdb/testsuite/gdb.fortran/static-arrays.f90
---- insight-7.12.50.20170416.orig/gdb/testsuite/gdb.fortran/static-arrays.f90 1970-01-01 01:00:00.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/testsuite/gdb.fortran/static-arrays.f90 2017-04-16 14:24:24.100834094 +0100
-@@ -0,0 +1,55 @@
-+! Copyright 2015 Free Software Foundation, Inc.
-+!
-+! Contributed by Intel Corp. <christoph.t.weinmann(a)intel.com>
-+!
-+! 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/>.
-+
-+subroutine sub
-+ integer, dimension(9) :: ar1
-+ integer, dimension(9,9) :: ar2
-+ integer, dimension(9,9,9) :: ar3
-+ integer, dimension(10,-7:3, -15:-5) :: ar4
-+ integer :: i,j,k
-+
-+ ar1 = 1
-+ ar2 = 1
-+ ar3 = 1
-+ ar4 = 4
-+
-+ ! Resulting array ar3 looks like ((( 111, 112, 113, 114,...)))
-+ do i = 1, 9, 1
-+ ar1(i) = i
-+ do j = 1, 9, 1
-+ ar2(i,j) = i*10 + j
-+ do k = 1, 9, 1
-+ ar3(i,j,k) = i*100 + j*10 + k
-+ end do
-+ end do
-+ end do
-+
-+ do i = 1, 10, 1
-+ do j = -7, 3, 1
-+ do k = -15, -5, 1
-+ ar4(i,j,k) = i*100 + (j+8)*10 + (k+16)
-+ end do
-+ end do
-+ end do
-+
-+ ar1(1) = 11 !BP1
-+ return
-+end
-+
-+program testprog
-+ call sub
-+end
-diff -Naurp insight-7.12.50.20170416.orig/gdb/testsuite/gdb.fortran/vla.f90 insight-7.12.50.20170416.new/gdb/testsuite/gdb.fortran/vla.f90
---- insight-7.12.50.20170416.orig/gdb/testsuite/gdb.fortran/vla.f90 2017-01-03 17:36:55.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/testsuite/gdb.fortran/vla.f90 2017-04-16 14:24:24.100834094 +0100
-@@ -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 -Naurp insight-7.12.50.20170416.orig/gdb/testsuite/gdb.fortran/vla-ptype.exp insight-7.12.50.20170416.new/gdb/testsuite/gdb.fortran/vla-ptype.exp
---- insight-7.12.50.20170416.orig/gdb/testsuite/gdb.fortran/vla-ptype.exp 2017-01-03 17:36:55.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/testsuite/gdb.fortran/vla-ptype.exp 2017-04-16 14:24:24.100834094 +0100
-@@ -98,3 +98,7 @@ gdb_test "ptype vla2" "type = <not alloc
- 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 -Naurp insight-7.12.50.20170416.orig/gdb/testsuite/gdb.fortran/vla-sizeof.exp insight-7.12.50.20170416.new/gdb/testsuite/gdb.fortran/vla-sizeof.exp
---- insight-7.12.50.20170416.orig/gdb/testsuite/gdb.fortran/vla-sizeof.exp 2017-01-03 17:36:55.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/testsuite/gdb.fortran/vla-sizeof.exp 2017-04-16 14:24:24.101834103 +0100
-@@ -44,3 +44,7 @@ gdb_test "print sizeof(pvla)" " = 0" "pr
- gdb_breakpoint [gdb_get_line_number "pvla-associated"]
- gdb_continue_to_breakpoint "pvla-associated"
- gdb_test "print sizeof(pvla)" " = 4000" "print sizeof associated pvla"
-+
-+gdb_breakpoint [gdb_get_line_number "vla1-neg-bounds"]
-+gdb_continue_to_breakpoint "vla1-neg-bounds"
-+gdb_test "print sizeof(vla1)" " = 480" "print sizeof vla1 negative bounds"
-diff -Naurp insight-7.12.50.20170416.orig/gdb/testsuite/gdb.fortran/vla-stride.exp insight-7.12.50.20170416.new/gdb/testsuite/gdb.fortran/vla-stride.exp
---- insight-7.12.50.20170416.orig/gdb/testsuite/gdb.fortran/vla-stride.exp 1970-01-01 01:00:00.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/testsuite/gdb.fortran/vla-stride.exp 2017-04-16 14:24:24.101834103 +0100
-@@ -0,0 +1,44 @@
-+# Copyright 2016 Free Software Foundation, Inc.
-+
-+# This program is free software; you can redistribute it and/or modify
-+# it under the terms of the GNU General Public License as published by
-+# the Free Software Foundation; either version 3 of the License, or
-+# (at your option) any later version.
-+#
-+# This program is distributed in the hope that it will be useful,
-+# but WITHOUT ANY WARRANTY; without even the implied warranty of
-+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+# GNU General Public License for more details.
-+#
-+# You should have received a copy of the GNU General Public License
-+# along with this program. If not, see <http://www.gnu.org/licenses/>.
-+
-+standard_testfile ".f90"
-+
-+if { [prepare_for_testing ${testfile}.exp ${testfile} ${srcfile} \
-+ {debug f90 quiet}] } {
-+ return -1
-+}
-+
-+if ![runto MAIN__] then {
-+ perror "couldn't run to breakpoint MAIN__"
-+ continue
-+}
-+
-+gdb_breakpoint [gdb_get_line_number "re-reverse-elements"]
-+gdb_continue_to_breakpoint "re-reverse-elements"
-+gdb_test "print pvla" " = \\\(1, 2, 3, 4, 5, 6, 7, 8, 9, 10\\\)" \
-+ "print re-reverse-elements"
-+gdb_test "print pvla(1)" " = 1" "print first re-reverse-element"
-+gdb_test "print pvla(10)" " = 10" "print last re-reverse-element"
-+
-+gdb_breakpoint [gdb_get_line_number "odd-elements"]
-+gdb_continue_to_breakpoint "odd-elements"
-+gdb_test "print pvla" " = \\\(1, 3, 5, 7, 9\\\)" "print odd-elements"
-+gdb_test "print pvla(1)" " = 1" "print first odd-element"
-+gdb_test "print pvla(5)" " = 9" "print last odd-element"
-+
-+gdb_breakpoint [gdb_get_line_number "single-element"]
-+gdb_continue_to_breakpoint "single-element"
-+gdb_test "print pvla" " = \\\(5\\\)" "print single-element"
-+gdb_test "print pvla(1)" " = 5" "print one single-element"
-diff -Naurp insight-7.12.50.20170416.orig/gdb/testsuite/gdb.fortran/vla-stride.f90 insight-7.12.50.20170416.new/gdb/testsuite/gdb.fortran/vla-stride.f90
---- insight-7.12.50.20170416.orig/gdb/testsuite/gdb.fortran/vla-stride.f90 1970-01-01 01:00:00.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/testsuite/gdb.fortran/vla-stride.f90 2017-04-16 14:24:24.101834103 +0100
-@@ -0,0 +1,29 @@
-+! Copyright 2016 Free Software Foundation, Inc.
-+!
-+! This program is free software; you can redistribute it and/or modify
-+! it under the terms of the GNU General Public License as published by
-+! the Free Software Foundation; either version 3 of the License, or
-+! (at your option) any later version.
-+!
-+! This program is distributed in the hope that it will be useful,
-+! but WITHOUT ANY WARRANTY; without even the implied warranty of
-+! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+! GNU General Public License for more details.
-+!
-+! You should have received a copy of the GNU General Public License
-+! along with this program. If not, see <http://www.gnu.org/licenses/>.
-+
-+program vla_stride
-+ integer, target, allocatable :: vla (:)
-+ integer, pointer :: pvla (:)
-+
-+ allocate(vla(10))
-+ vla = (/ (I, I = 1,10) /)
-+
-+ pvla => vla(10:1:-1)
-+ pvla => pvla(10:1:-1)
-+ pvla => vla(1:10:2) ! re-reverse-elements
-+ pvla => vla(5:4:-2) ! odd-elements
-+
-+ pvla => null() ! single-element
-+end program vla_stride
-diff -Naurp insight-7.12.50.20170416.orig/gdb/valarith.c insight-7.12.50.20170416.new/gdb/valarith.c
---- insight-7.12.50.20170416.orig/gdb/valarith.c 2017-04-16 14:23:22.911275347 +0100
-+++ insight-7.12.50.20170416.new/gdb/valarith.c 2017-04-16 14:24:24.101834103 +0100
-@@ -193,10 +193,16 @@ value_subscripted_rvalue (struct value *
- 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)))
- {
- if (type_not_associated (array_type))
- error (_("no such vector element (vector not associated)"));
-diff -Naurp insight-7.12.50.20170416.orig/gdb/valops.c insight-7.12.50.20170416.new/gdb/valops.c
---- insight-7.12.50.20170416.orig/gdb/valops.c 2017-04-16 14:23:22.923275458 +0100
-+++ insight-7.12.50.20170416.new/gdb/valops.c 2017-04-16 14:24:24.102834112 +0100
-@@ -3787,55 +3787,194 @@ value_of_this_silent (const struct langu
- struct value *
- value_slice (struct value *array, int lowbound, int length)
- {
-+ /* Pass unaltered arguments to VALUE_SLICE_1, plus a default stride
-+ value of '1', which returns every element between LOWBOUND and
-+ (LOWBOUND + LENGTH). We also provide a default CALL_COUNT of '1'
-+ as we are only considering the highest dimension, or we are
-+ working on a one dimensional array. So we call VALUE_SLICE_1
-+ exactly once. */
-+ return value_slice_1 (array, lowbound, length, 1, 1);
-+}
-+
-+/* VALUE_SLICE_1 is called for each array dimension to calculate the number
-+ of elements as defined by the subscript expression.
-+ CALL_COUNT is used to determine if we are calling the function once, e.g.
-+ we are working on the current dimension of ARRAY, or if we are calling
-+ the function repeatedly. In the later case we need to take elements
-+ from the TARGET_TYPE of ARRAY.
-+ With a CALL_COUNT greater than 1 we calculate the offsets for every element
-+ that should be in the result array. Then we fetch the contents and then
-+ copy them into the result array. The result array will have one dimension
-+ less than the input array, so later on we need to recreate the indices and
-+ ranges in the calling function. */
-+
-+struct value *
-+value_slice_1 (struct value *array, int lowbound, int length,
-+ int stride_length, int call_count)
-+{
- struct type *slice_range_type, *slice_type, *range_type;
-- LONGEST lowerbound, upperbound;
-- struct value *slice;
-- struct type *array_type;
-+ struct type *array_type = check_typedef (value_type (array));
-+ struct type *elt_type = check_typedef (TYPE_TARGET_TYPE (array_type));
-+ unsigned int elt_size, elt_offs;
-+ LONGEST ary_high_bound, ary_low_bound;
-+ struct value *v;
-+ int slice_range_size, i = 0, row_count = 1, elem_count = 1;
-
-- array_type = check_typedef (value_type (array));
-+ /* Check for legacy code if we are actually dealing with an array or
-+ string. */
- if (TYPE_CODE (array_type) != TYPE_CODE_ARRAY
- && TYPE_CODE (array_type) != TYPE_CODE_STRING)
- error (_("cannot take slice of non-array"));
-
-- range_type = TYPE_INDEX_TYPE (array_type);
-- if (get_discrete_bounds (range_type, &lowerbound, &upperbound) < 0)
-- error (_("slice from bad array or bitstring"));
--
-- if (lowbound < lowerbound || length < 0
-- || lowbound + length - 1 > upperbound)
-- error (_("slice out of range"));
-+ ary_low_bound = TYPE_LOW_BOUND (TYPE_INDEX_TYPE (array_type));
-+ ary_high_bound = TYPE_HIGH_BOUND (TYPE_INDEX_TYPE (array_type));
-+
-+ /* When we are working on a multi-dimensional array, we need to get the
-+ attributes of the underlying type. */
-+ if (call_count > 1)
-+ {
-+ ary_low_bound = TYPE_LOW_BOUND (TYPE_INDEX_TYPE (elt_type));
-+ ary_high_bound = TYPE_HIGH_BOUND (TYPE_INDEX_TYPE (elt_type));
-+ elt_type = check_typedef (TYPE_TARGET_TYPE (elt_type));
-+ row_count = TYPE_LENGTH (array_type)
-+ / TYPE_LENGTH (TYPE_TARGET_TYPE (array_type));
-+ }
-+
-+ /* With a stride of '1', the number of elements per result row is equal to
-+ the LENGTH of the subarray. With non-default stride values, we skip
-+ elements, but have to add the start element to the total number of
-+ elements per row. */
-+ if (stride_length == 1)
-+ elem_count = length;
-+ else
-+ elem_count = ((length - 1) / stride_length) + 1;
-+
-+ elt_size = TYPE_LENGTH (elt_type);
-+ elt_offs = lowbound - ary_low_bound;
-+
-+ elt_offs *= elt_size;
-+
-+ /* Check for valid user input. In case of Fortran this was already done
-+ in the calling function. */
-+ if (call_count == 1
-+ && (!TYPE_ARRAY_UPPER_BOUND_IS_UNDEFINED (array_type)
-+ && elt_offs >= TYPE_LENGTH (array_type)))
-+ error (_("no such vector element"));
-+
-+ /* CALL_COUNT is 1 when we are dealing either with the highest dimension
-+ of the array, or a one dimensional array. Set RANGE_TYPE accordingly.
-+ In both cases we calculate how many rows/elements will be in the output
-+ array by setting slice_range_size. */
-+ if (call_count == 1)
-+ {
-+ range_type = TYPE_INDEX_TYPE (array_type);
-+ slice_range_size = ary_low_bound + elem_count - 1;
-+
-+ /* Check if the array bounds are valid. */
-+ if (get_discrete_bounds (range_type, &ary_low_bound, &ary_high_bound) < 0)
-+ error (_("slice from bad array or bitstring"));
-+ }
-+ /* When CALL_COUNT is greater than 1, we are dealing with an array of arrays.
-+ So we need to get the type below the current one and set the RANGE_TYPE
-+ accordingly. */
-+ else
-+ {
-+ range_type = TYPE_INDEX_TYPE (TYPE_TARGET_TYPE (array_type));
-+ slice_range_size = ary_low_bound + (row_count * elem_count) - 1;
-+ ary_low_bound = TYPE_LOW_BOUND (range_type);
-+ }
-
- /* FIXME-type-allocation: need a way to free this type when we are
-- done with it. */
-- slice_range_type = create_static_range_type ((struct type *) NULL,
-- TYPE_TARGET_TYPE (range_type),
-- lowbound,
-- lowbound + length - 1);
-+ done with it. */
-
-+ slice_range_type = create_static_range_type (NULL, TYPE_TARGET_TYPE (range_type),
-+ ary_low_bound, slice_range_size);
- {
-- struct type *element_type = TYPE_TARGET_TYPE (array_type);
-- LONGEST offset
-- = (lowbound - lowerbound) * TYPE_LENGTH (check_typedef (element_type));
--
-- slice_type = create_array_type ((struct type *) NULL,
-- element_type,
-- slice_range_type);
-- TYPE_CODE (slice_type) = TYPE_CODE (array_type);
-+ struct type *element_type;
-+
-+ /* When both CALL_COUNT and STRIDE_LENGTH equal 1, we can use the legacy
-+ code for subarrays. */
-+ if (call_count == 1 && stride_length == 1)
-+ {
-+ element_type = TYPE_TARGET_TYPE (array_type);
-+
-+ slice_type = create_array_type (NULL, element_type, slice_range_type);
-+
-+ TYPE_CODE (slice_type) = TYPE_CODE (array_type);
-+
-+ if (VALUE_LVAL (array) == lval_memory && value_lazy (array))
-+ v = allocate_value_lazy (slice_type);
-+ else
-+ {
-+ v = allocate_value (slice_type);
-+ value_contents_copy (v,
-+ value_embedded_offset (v),
-+ array,
-+ value_embedded_offset (array) + elt_offs,
-+ elt_size * longest_to_int (length));
-+ }
-
-- if (VALUE_LVAL (array) == lval_memory && value_lazy (array))
-- slice = allocate_value_lazy (slice_type);
-+ }
-+ /* With a CALL_COUNT or STRIDE_LENGTH are greater than 1 we are working
-+ on a range of ranges. So we copy the relevant elements into the
-+ new array we return. */
- else
- {
-- slice = allocate_value (slice_type);
-- value_contents_copy (slice, 0, array, offset,
-- type_length_units (slice_type));
-+ int j, offs_store = elt_offs;
-+ LONGEST dst_offset = 0;
-+ LONGEST src_row_length = TYPE_LENGTH (TYPE_TARGET_TYPE (array_type));
-+
-+ if (call_count == 1)
-+ {
-+ /* When CALL_COUNT is equal to 1 we are working on the current range
-+ and use these elements directly. */
-+ element_type = TYPE_TARGET_TYPE (array_type);
-+ }
-+ else
-+ {
-+ /* Working on an array of arrays, the type of the elements is the type
-+ of the subarrays' type. */
-+ element_type = TYPE_TARGET_TYPE (TYPE_TARGET_TYPE (array_type));
-+ }
-+
-+ slice_type = create_array_type (NULL, element_type, slice_range_type);
-+
-+ /* If we have a one dimensional array, we copy its TYPE_CODE. For a
-+ multi dimensional array we copy the embedded type's TYPE_CODE. */
-+ if (call_count == 1)
-+ TYPE_CODE (slice_type) = TYPE_CODE (array_type);
-+ else
-+ TYPE_CODE (slice_type) = TYPE_CODE (TYPE_TARGET_TYPE (array_type));
-+
-+ v = allocate_value (slice_type);
-+
-+ /* Iterate through the rows of the outer array and set the new offset
-+ for each row. */
-+ for (i = 0; i < row_count; i++)
-+ {
-+ elt_offs = offs_store + i * src_row_length;
-+
-+ /* Iterate through the elements in each row to copy only those. */
-+ for (j = 1; j <= elem_count; j++)
-+ {
-+ /* Fetches the contents of ARRAY and copies them into V. */
-+ value_contents_copy (v, dst_offset, array, elt_offs, elt_size);
-+ elt_offs += elt_size * stride_length;
-+ dst_offset += elt_size;
-+ }
-+ }
- }
-
-- set_value_component_location (slice, array);
-- set_value_offset (slice, value_offset (array) + offset);
-+ set_value_component_location (v, array);
-+ if (VALUE_LVAL (v) == lval_register)
-+ {
-+ VALUE_REGNUM (v) = VALUE_REGNUM (array);
-+ VALUE_NEXT_FRAME_ID (v) = VALUE_NEXT_FRAME_ID (array);
-+ }
-+ set_value_offset (v, value_offset (array) + elt_offs);
- }
-
-- return slice;
-+ return v;
- }
-
- /* Create a value for a FORTRAN complex number. Currently most of the
-diff -Naurp insight-7.12.50.20170416.orig/gdb/value.h insight-7.12.50.20170416.new/gdb/value.h
---- insight-7.12.50.20170416.orig/gdb/value.h 2017-04-16 14:23:22.913275366 +0100
-+++ insight-7.12.50.20170416.new/gdb/value.h 2017-04-16 14:24:24.103834122 +0100
-@@ -1106,6 +1106,8 @@ extern struct value *varying_to_slice (s
-
- extern struct value *value_slice (struct value *, int, int);
-
-+extern struct value *value_slice_1 (struct value *, int, int, int, int);
-+
- extern struct value *value_literal_complex (struct value *, struct value *,
- struct type *);
-
diff --git a/insight-7.12-gdb-vla-intel-fortran-vla-strings.patch b/insight-7.12-gdb-vla-intel-fortran-vla-strings.patch
deleted file mode 100644
index 05ee56f..0000000
--- a/insight-7.12-gdb-vla-intel-fortran-vla-strings.patch
+++ /dev/null
@@ -1,1443 +0,0 @@
-diff -Naurp insight-7.12.50.20170416.orig/gdb/c-valprint.c insight-7.12.50.20170416.new/gdb/c-valprint.c
---- insight-7.12.50.20170416.orig/gdb/c-valprint.c 2017-04-16 15:15:34.729718519 +0100
-+++ insight-7.12.50.20170416.new/gdb/c-valprint.c 2017-04-16 15:16:27.465186960 +0100
-@@ -650,6 +650,28 @@ c_value_print (struct value *val, struct
- else
- {
- /* normal case */
-+ if (TYPE_CODE (type) == TYPE_CODE_PTR
-+ && 1 == is_dynamic_type (type))
-+ {
-+ CORE_ADDR addr;
-+ if (NULL != TYPE_DATA_LOCATION (TYPE_TARGET_TYPE (type)))
-+ addr = value_address (val);
-+ else
-+ addr = value_as_address (val);
-+
-+ /* We resolve the target-type only when the
-+ pointer is associated. */
-+ if ((addr != 0)
-+ && (0 == type_not_associated (type)))
-+ TYPE_TARGET_TYPE (type) =
-+ resolve_dynamic_type (TYPE_TARGET_TYPE (type),
-+ NULL, addr);
-+ }
-+ else
-+ {
-+ /* Do nothing. References are already resolved from the beginning,
-+ only pointers are resolved when we actual need the target. */
-+ }
- fprintf_filtered (stream, "(");
- type_print (value_type (val), "", stream, -1);
- fprintf_filtered (stream, ") ");
-diff -Naurp insight-7.12.50.20170416.orig/gdb/dwarf2read.c insight-7.12.50.20170416.new/gdb/dwarf2read.c
---- insight-7.12.50.20170416.orig/gdb/dwarf2read.c 2017-04-16 15:15:34.798719132 +0100
-+++ insight-7.12.50.20170416.new/gdb/dwarf2read.c 2017-04-16 15:18:18.202170620 +0100
-@@ -1873,7 +1873,8 @@ static void read_signatured_type (struct
-
- static int attr_to_dynamic_prop (const struct attribute *attr,
- struct die_info *die, struct dwarf2_cu *cu,
-- struct dynamic_prop *prop);
-+ struct dynamic_prop *prop, const gdb_byte *additional_data,
-+ int additional_data_size);
-
- /* memory allocation interface */
-
-@@ -11579,7 +11580,7 @@ read_func_scope (struct die_info *die, s
- {
- newobj->static_link
- = XOBNEW (&objfile->objfile_obstack, struct dynamic_prop);
-- attr_to_dynamic_prop (attr, die, cu, newobj->static_link);
-+ attr_to_dynamic_prop (attr, die, cu, newobj->static_link, NULL, 0);
- }
-
- cu->list_in_scope = &local_symbols;
-@@ -14813,29 +14814,94 @@ read_tag_string_type (struct die_info *d
- struct gdbarch *gdbarch = get_objfile_arch (objfile);
- struct type *type, *range_type, *index_type, *char_type;
- struct attribute *attr;
-- unsigned int length;
-+ unsigned int length = UINT_MAX;
-
-+ index_type = objfile_type (objfile)->builtin_int;
-+ range_type = create_static_range_type (NULL, index_type, 1, length);
-+
-+ /* If DW_AT_string_length is defined, the length is stored in memory. */
- attr = dwarf2_attr (die, DW_AT_string_length, cu);
- if (attr)
- {
-- length = DW_UNSND (attr);
-+ if (attr_form_is_block (attr))
-+ {
-+ struct attribute *byte_size, *bit_size;
-+ struct dynamic_prop high;
-+
-+ byte_size = dwarf2_attr (die, DW_AT_byte_size, cu);
-+ bit_size = dwarf2_attr (die, DW_AT_bit_size, cu);
-+
-+ /* DW_AT_byte_size should never occur in combination with
-+ DW_AT_bit_size. */
-+ if (byte_size != NULL && bit_size != NULL)
-+ complaint (&symfile_complaints,
-+ _("DW_AT_byte_size AND "
-+ "DW_AT_bit_size found together at the same time."));
-+
-+ /* If DW_AT_string_length AND DW_AT_byte_size exist together,
-+ DW_AT_byte_size describes the number of bytes that should be read
-+ from the length memory location. */
-+ if (byte_size != NULL)
-+ {
-+ /* Build new dwarf2_locexpr_baton structure with additions to the
-+ data attribute, to reflect DWARF specialities to get address
-+ sizes. */
-+ const gdb_byte append_ops[] =
-+ {
-+ /* DW_OP_deref_size: size of an address on the target machine
-+ (bytes), where the size will be specified by the next
-+ operand. */
-+ DW_OP_deref_size,
-+ /* Operand for DW_OP_deref_size. */
-+ DW_UNSND(byte_size) };
-+
-+ if (!attr_to_dynamic_prop (attr, die, cu, &high, append_ops,
-+ ARRAY_SIZE(append_ops)))
-+ complaint (&symfile_complaints,
-+ _("Could not parse DW_AT_byte_size"));
-+ }
-+ else if (bit_size != NULL)
-+ complaint (&symfile_complaints,
-+ _("DW_AT_string_length AND "
-+ "DW_AT_bit_size found but not supported yet."));
-+ /* If DW_AT_string_length WITHOUT DW_AT_byte_size exist, the default
-+ is the address size of the target machine. */
-+ else
-+ {
-+ const gdb_byte append_ops[] =
-+ { DW_OP_deref };
-+
-+ if (!attr_to_dynamic_prop (attr, die, cu, &high, append_ops,
-+ ARRAY_SIZE(append_ops)))
-+ complaint (&symfile_complaints,
-+ _("Could not parse DW_AT_string_length"));
-+ }
-+
-+ TYPE_RANGE_DATA (range_type)->high = high;
-+ }
-+ else
-+ {
-+ TYPE_HIGH_BOUND (range_type) = DW_UNSND(attr);
-+ TYPE_HIGH_BOUND_KIND (range_type) = PROP_CONST;
-+ }
- }
- else
- {
-- /* Check for the DW_AT_byte_size attribute. */
-+ /* Check for the DW_AT_byte_size attribute, which represents the length
-+ in this case. */
- attr = dwarf2_attr (die, DW_AT_byte_size, cu);
- if (attr)
-- {
-- length = DW_UNSND (attr);
-- }
-+ {
-+ TYPE_HIGH_BOUND (range_type) = DW_UNSND(attr);
-+ TYPE_HIGH_BOUND_KIND (range_type) = PROP_CONST;
-+ }
- else
-- {
-- length = 1;
-- }
-+ {
-+ TYPE_HIGH_BOUND (range_type) = 1;
-+ TYPE_HIGH_BOUND_KIND (range_type) = PROP_CONST;
-+ }
- }
-
-- index_type = objfile_type (objfile)->builtin_int;
-- range_type = create_static_range_type (NULL, index_type, 1, length);
- char_type = language_string_char_type (cu->language_defn, gdbarch);
- type = create_string_type (NULL, char_type, range_type);
-
-@@ -15185,7 +15251,8 @@ read_base_type (struct die_info *die, st
-
- static int
- attr_to_dynamic_prop (const struct attribute *attr, struct die_info *die,
-- struct dwarf2_cu *cu, struct dynamic_prop *prop)
-+ struct dwarf2_cu *cu, struct dynamic_prop *prop,
-+ const gdb_byte *additional_data, int additional_data_size)
- {
- struct dwarf2_property_baton *baton;
- struct obstack *obstack = &cu->objfile->objfile_obstack;
-@@ -15195,14 +15262,33 @@ attr_to_dynamic_prop (const struct attri
-
- if (attr_form_is_block (attr))
- {
-- baton = XOBNEW (obstack, struct dwarf2_property_baton);
-+ baton = XOBNEW(obstack, struct dwarf2_property_baton);
- baton->referenced_type = NULL;
- baton->locexpr.per_cu = cu->per_cu;
-- baton->locexpr.size = DW_BLOCK (attr)->size;
-- baton->locexpr.data = DW_BLOCK (attr)->data;
-+
-+ if (additional_data != NULL && additional_data_size > 0)
-+ {
-+ gdb_byte *data;
-+
-+ data = (gdb_byte *) obstack_alloc(
-+ &cu->objfile->objfile_obstack,
-+ DW_BLOCK (attr)->size + additional_data_size);
-+ memcpy (data, DW_BLOCK (attr)->data, DW_BLOCK (attr)->size);
-+ memcpy (data + DW_BLOCK (attr)->size, additional_data,
-+ additional_data_size);
-+
-+ baton->locexpr.data = data;
-+ baton->locexpr.size = DW_BLOCK (attr)->size + additional_data_size;
-+ }
-+ else
-+ {
-+ baton->locexpr.data = DW_BLOCK (attr)->data;
-+ baton->locexpr.size = DW_BLOCK (attr)->size;
-+ }
-+
- prop->data.baton = baton;
- prop->kind = PROP_LOCEXPR;
-- gdb_assert (prop->data.baton != NULL);
-+ gdb_assert(prop->data.baton != NULL);
- }
- else if (attr_form_is_ref (attr))
- {
-@@ -15235,8 +15321,28 @@ attr_to_dynamic_prop (const struct attri
- baton = XOBNEW (obstack, struct dwarf2_property_baton);
- baton->referenced_type = die_type (target_die, target_cu);
- baton->locexpr.per_cu = cu->per_cu;
-- baton->locexpr.size = DW_BLOCK (target_attr)->size;
-- baton->locexpr.data = DW_BLOCK (target_attr)->data;
-+
-+ if (additional_data != NULL && additional_data_size > 0)
-+ {
-+ gdb_byte *data;
-+
-+ data = (gdb_byte *) obstack_alloc (&cu->objfile->objfile_obstack,
-+ DW_BLOCK (target_attr)->size + additional_data_size);
-+ memcpy (data, DW_BLOCK (target_attr)->data,
-+ DW_BLOCK (target_attr)->size);
-+ memcpy (data + DW_BLOCK (target_attr)->size,
-+ additional_data, additional_data_size);
-+
-+ baton->locexpr.data = data;
-+ baton->locexpr.size = (DW_BLOCK (target_attr)->size
-+ + additional_data_size);
-+ }
-+ else
-+ {
-+ baton->locexpr.data = DW_BLOCK (target_attr)->data;
-+ baton->locexpr.size = DW_BLOCK (target_attr)->size;
-+ }
-+
- prop->data.baton = baton;
- prop->kind = PROP_LOCEXPR;
- gdb_assert (prop->data.baton != NULL);
-@@ -15347,24 +15453,24 @@ read_subrange_type (struct die_info *die
-
- attr = dwarf2_attr (die, DW_AT_byte_stride, cu);
- if (attr)
-- if (!attr_to_dynamic_prop (attr, die, cu, &stride))
-+ if (!attr_to_dynamic_prop (attr, die, cu, &stride, NULL, 0))
- complaint (&symfile_complaints, _("Missing DW_AT_byte_stride "
- "- DIE at 0x%x [in module %s]"),
- to_underlying (die->sect_off), objfile_name (cu->objfile));
-
- attr = dwarf2_attr (die, DW_AT_lower_bound, cu);
- if (attr)
-- attr_to_dynamic_prop (attr, die, cu, &low);
-+ attr_to_dynamic_prop (attr, die, cu, &low, NULL, 0);
- else if (!low_default_is_valid)
- complaint (&symfile_complaints, _("Missing DW_AT_lower_bound "
- "- DIE at 0x%x [in module %s]"),
- to_underlying (die->sect_off), objfile_name (cu->objfile));
-
- attr = dwarf2_attr (die, DW_AT_upper_bound, cu);
-- if (!attr_to_dynamic_prop (attr, die, cu, &high))
-+ if (!attr_to_dynamic_prop (attr, die, cu, &high, NULL, 0))
- {
- attr = dwarf2_attr (die, DW_AT_count, cu);
-- if (attr_to_dynamic_prop (attr, die, cu, &high))
-+ if (attr_to_dynamic_prop (attr, die, cu, &high, NULL, 0))
- {
- /* If bounds are constant do the final calculation here. */
- if (low.kind == PROP_CONST && high.kind == PROP_CONST)
-@@ -23009,7 +23115,7 @@ set_die_type (struct die_info *die, stru
- attr = dwarf2_attr (die, DW_AT_allocated, cu);
- if (attr_form_is_block (attr))
- {
-- if (attr_to_dynamic_prop (attr, die, cu, &prop))
-+ if (attr_to_dynamic_prop (attr, die, cu, &prop, NULL, 0))
- add_dyn_prop (DYN_PROP_ALLOCATED, prop, type, objfile);
- }
- else if (attr != NULL)
-@@ -23024,7 +23130,7 @@ set_die_type (struct die_info *die, stru
- attr = dwarf2_attr (die, DW_AT_associated, cu);
- if (attr_form_is_block (attr))
- {
-- if (attr_to_dynamic_prop (attr, die, cu, &prop))
-+ if (attr_to_dynamic_prop (attr, die, cu, &prop, NULL, 0))
- add_dyn_prop (DYN_PROP_ASSOCIATED, prop, type, objfile);
- }
- else if (attr != NULL)
-@@ -23037,7 +23143,7 @@ set_die_type (struct die_info *die, stru
-
- /* Read DW_AT_data_location and set in type. */
- attr = dwarf2_attr (die, DW_AT_data_location, cu);
-- if (attr_to_dynamic_prop (attr, die, cu, &prop))
-+ if (attr_to_dynamic_prop (attr, die, cu, &prop, NULL, 0))
- add_dyn_prop (DYN_PROP_DATA_LOCATION, prop, type, objfile);
-
- if (dwarf2_per_objfile->die_type_hash == NULL)
-diff -Naurp insight-7.12.50.20170416.orig/gdb/f-typeprint.c insight-7.12.50.20170416.new/gdb/f-typeprint.c
---- insight-7.12.50.20170416.orig/gdb/f-typeprint.c 2017-04-16 15:15:34.786719025 +0100
-+++ insight-7.12.50.20170416.new/gdb/f-typeprint.c 2017-04-16 15:31:51.465394712 +0100
-@@ -37,7 +37,7 @@ static void f_type_print_args (struct ty
- #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 c
- {
- 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 c
-
- 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
- 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)
- {
- LONGEST upper_bound, lower_bound;
-
-@@ -183,34 +171,50 @@ f_type_print_varspec_suffix (struct type
- fprintf_filtered (stream, "(");
-
- if (type_not_associated (type))
-- val_print_not_associated (stream);
-+ print_rank_only = 1;
- else if (type_not_allocated (type))
-- val_print_not_allocated (stream);
-+ print_rank_only = 1;
-+ else if ((TYPE_ASSOCIATED_PROP (type)
-+ && PROP_CONST != TYPE_DYN_PROP_KIND (TYPE_ASSOCIATED_PROP (type)))
-+ || (TYPE_ALLOCATED_PROP (type)
-+ && PROP_CONST != TYPE_DYN_PROP_KIND (TYPE_ALLOCATED_PROP (type)))
-+ || (TYPE_DATA_LOCATION (type)
-+ && PROP_CONST != TYPE_DYN_PROP_KIND (TYPE_DATA_LOCATION (type))))
-+ /* This case exist when we ptype a typename which has the
-+ dynamic properties but cannot be resolved as there is
-+ no object. */
-+ print_rank_only = 1;
-+
-+ if (TYPE_CODE (TYPE_TARGET_TYPE (type)) == TYPE_CODE_ARRAY)
-+ f_type_print_varspec_suffix (TYPE_TARGET_TYPE (type), stream, 0,
-+ 0, 0, arrayprint_recurse_level,
-+ print_rank_only);
-+
-+ if (print_rank_only == 1)
-+ fprintf_filtered (stream, ":");
- else
-- {
-- if (TYPE_CODE (TYPE_TARGET_TYPE (type)) == TYPE_CODE_ARRAY)
-- f_type_print_varspec_suffix (TYPE_TARGET_TYPE (type), stream, 0,
-- 0, 0, arrayprint_recurse_level);
--
-- lower_bound = f77_get_lowerbound (type);
-- if (lower_bound != 1) /* Not the default. */
-- fprintf_filtered (stream, "%s:", plongest (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, "%s", plongest (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, "%s:", plongest (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, "%s", plongest (upper_bound));
-+ }
-+ }
-+
-+ if (TYPE_CODE (TYPE_TARGET_TYPE (type)) != TYPE_CODE_ARRAY)
-+ f_type_print_varspec_suffix (TYPE_TARGET_TYPE (type), stream, 0,
-+ 0, 0, arrayprint_recurse_level,
-+ print_rank_only);
-+
- if (arrayprint_recurse_level == 1)
- fprintf_filtered (stream, ")");
- else
-@@ -221,13 +225,14 @@ f_type_print_varspec_suffix (struct type
- case TYPE_CODE_PTR:
- case TYPE_CODE_REF:
- f_type_print_varspec_suffix (TYPE_TARGET_TYPE (type), stream, 0, 1, 0,
-- arrayprint_recurse_level);
-+ arrayprint_recurse_level, 0);
- fprintf_filtered (stream, ")");
- break;
-
- case TYPE_CODE_FUNC:
- f_type_print_varspec_suffix (TYPE_TARGET_TYPE (type), stream, 0,
-- passed_a_ptr, 0, arrayprint_recurse_level);
-+ passed_a_ptr, 0, arrayprint_recurse_level,
-+ 0);
- if (passed_a_ptr)
- fprintf_filtered (stream, ")");
-
-@@ -378,7 +383,7 @@ f_type_print_base (struct type *type, st
- 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 -Naurp insight-7.12.50.20170416.orig/gdb/gdbtypes.c insight-7.12.50.20170416.new/gdb/gdbtypes.c
---- insight-7.12.50.20170416.orig/gdb/gdbtypes.c 2017-04-16 15:15:34.806719203 +0100
-+++ insight-7.12.50.20170416.new/gdb/gdbtypes.c 2017-04-16 15:16:27.473187031 +0100
-@@ -1840,7 +1840,8 @@ is_dynamic_type_internal (struct type *t
- type = check_typedef (type);
-
- /* We only want to recognize references at the outermost level. */
-- if (top_level && TYPE_CODE (type) == TYPE_CODE_REF)
-+ if (top_level &&
-+ (TYPE_CODE (type) == TYPE_CODE_REF || TYPE_CODE (type) == TYPE_CODE_PTR))
- type = check_typedef (TYPE_TARGET_TYPE (type));
-
- /* Types that have a dynamic TYPE_DATA_LOCATION are considered
-@@ -1874,6 +1875,7 @@ is_dynamic_type_internal (struct type *t
- }
-
- case TYPE_CODE_ARRAY:
-+ case TYPE_CODE_STRING:
- {
- gdb_assert (TYPE_NFIELDS (type) == 1);
-
-@@ -1986,7 +1988,8 @@ resolve_dynamic_array (struct type *type
- struct type *ary_dim;
- struct dynamic_prop *prop;
-
-- gdb_assert (TYPE_CODE (type) == TYPE_CODE_ARRAY);
-+ gdb_assert (TYPE_CODE (type) == TYPE_CODE_ARRAY
-+ || TYPE_CODE (type) == TYPE_CODE_STRING);
-
- type = copy_type (type);
-
-@@ -2011,13 +2014,17 @@ resolve_dynamic_array (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);
- else
- elt_type = TYPE_TARGET_TYPE (type);
-
-- return create_array_type_with_stride (type, elt_type, range_type,
-- TYPE_FIELD_BITSIZE (type, 0));
-+ if (TYPE_CODE (type) == TYPE_CODE_STRING)
-+ return create_string_type (type, elt_type, range_type);
-+ else
-+ return create_array_type_with_stride (type, elt_type, range_type,
-+ TYPE_FIELD_BITSIZE (type, 0));
- }
-
- /* Resolve dynamic bounds of members of the union TYPE to static
-@@ -2147,6 +2154,28 @@ resolve_dynamic_struct (struct type *typ
- return resolved_type;
- }
-
-+/* Worker for pointer types. */
-+
-+static struct type *
-+resolve_dynamic_pointer (struct type *type,
-+ struct property_addr_info *addr_stack)
-+{
-+ struct dynamic_prop *prop;
-+ CORE_ADDR value;
-+
-+ type = copy_type (type);
-+
-+ /* Resolve associated property. */
-+ prop = TYPE_ASSOCIATED_PROP (type);
-+ if (prop != NULL && dwarf2_evaluate_property (prop, NULL, addr_stack, &value))
-+ {
-+ TYPE_DYN_PROP_ADDR (prop) = value;
-+ TYPE_DYN_PROP_KIND (prop) = PROP_CONST;
-+ }
-+
-+ return type;
-+}
-+
- /* Worker for resolved_dynamic_type. */
-
- static struct type *
-@@ -2195,7 +2224,12 @@ resolve_dynamic_type_internal (struct ty
- 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;
-
-diff -Naurp insight-7.12.50.20170416.orig/gdb/NEWS insight-7.12.50.20170416.new/gdb/NEWS
---- insight-7.12.50.20170416.orig/gdb/NEWS 2017-04-09 01:11:01.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/NEWS 2017-04-16 15:16:27.475187049 +0100
-@@ -109,6 +109,8 @@ maint print arc arc-instruction address
- Alpha running FreeBSD alpha*-*-freebsd*
- Alpha running GNU/kFreeBSD alpha*-*-kfreebsd*-gnu
-
-+* Fortran: Support pointers to dynamic types.
-+
- *** Changes in GDB 7.12
-
- * GDB and GDBserver now build with a C++ compiler by default.
-diff -Naurp insight-7.12.50.20170416.orig/gdb/testsuite/gdb.cp/vla-cxx.cc insight-7.12.50.20170416.new/gdb/testsuite/gdb.cp/vla-cxx.cc
---- insight-7.12.50.20170416.orig/gdb/testsuite/gdb.cp/vla-cxx.cc 2017-01-03 17:36:55.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/testsuite/gdb.cp/vla-cxx.cc 2017-04-16 15:16:27.475187049 +0100
-@@ -15,6 +15,10 @@
- You should have received a copy of the GNU General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>. */
-
-+extern "C" {
-+#include <stddef.h>
-+}
-+
- struct container;
-
- struct element
-@@ -40,11 +44,16 @@ int main(int argc, char **argv)
- typedef typeof (vla) &vlareftypedef;
- vlareftypedef vlaref2 (vla);
- container c;
-+ typeof (vla) *ptr = NULL;
-+
-+ // Before pointer assignment
-+ ptr = &vla;
-
- for (int i = 0; i < z; ++i)
- vla[i] = 5 + 2 * i;
-
- // vlas_filled
- vla[0] = 2 * vla[0];
-+
- return vla[2];
- }
-diff -Naurp insight-7.12.50.20170416.orig/gdb/testsuite/gdb.cp/vla-cxx.exp insight-7.12.50.20170416.new/gdb/testsuite/gdb.cp/vla-cxx.exp
---- insight-7.12.50.20170416.orig/gdb/testsuite/gdb.cp/vla-cxx.exp 2017-01-03 17:36:55.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/testsuite/gdb.cp/vla-cxx.exp 2017-04-16 15:16:27.476187058 +0100
-@@ -23,6 +23,12 @@ if ![runto_main] {
- return -1
- }
-
-+gdb_breakpoint [gdb_get_line_number "Before pointer assignment"]
-+gdb_continue_to_breakpoint "Before pointer assignment"
-+gdb_test "ptype ptr" "int \\(\\*\\)\\\[variable length\\\]" "ptype ptr, Before pointer assignment"
-+gdb_test "print ptr" "\\(int \\(\\*\\)\\\[variable length\\\]\\) 0x0" "print ptr, Before pointer assignment"
-+gdb_test "print *ptr" "Cannot access memory at address 0x0" "print *ptr, Before pointer assignment"
-+
- gdb_breakpoint [gdb_get_line_number "vlas_filled"]
- gdb_continue_to_breakpoint "vlas_filled"
-
-@@ -33,3 +39,6 @@ gdb_test "print vlaref" " = \\(int \\(&\
- # bug being tested, it's better not to depend on the exact spelling.
- gdb_test "print vlaref2" " = \\(.*\\) @$hex: \\{5, 7, 9\\}"
- gdb_test "print c" " = \\{e = \\{c = @$hex\\}\\}"
-+gdb_test "ptype ptr" "int \\(\\*\\)\\\[3\\\]"
-+gdb_test "print ptr" "\\(int \\(\\*\\)\\\[3\\\]\\) $hex"
-+gdb_test "print *ptr" " = \\{5, 7, 9\\}"
-diff -Naurp insight-7.12.50.20170416.orig/gdb/testsuite/gdb.fortran/pointers.exp insight-7.12.50.20170416.new/gdb/testsuite/gdb.fortran/pointers.exp
---- insight-7.12.50.20170416.orig/gdb/testsuite/gdb.fortran/pointers.exp 1970-01-01 01:00:00.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/testsuite/gdb.fortran/pointers.exp 2017-04-16 15:16:27.476187058 +0100
-@@ -0,0 +1,143 @@
-+# Copyright 2016 Free Software Foundation, Inc.
-+
-+# This program is free software; you can redistribute it and/or modify
-+# it under the terms of the GNU General Public License as published by
-+# the Free Software Foundation; either version 3 of the License, or
-+# (at your option) any later version.
-+#
-+# This program is distributed in the hope that it will be useful,
-+# but WITHOUT ANY WARRANTY; without even the implied warranty of
-+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+# GNU General Public License for more details.
-+#
-+# You should have received a copy of the GNU General Public License
-+# along with this program. If not, see <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 "print logp" "= \\(PTR TO -> \\( $logical \\)\\) 0x0" "print logp, not associated"
-+gdb_test "print *logp" "Cannot access memory at address 0x0" "print *logp, not associated"
-+gdb_test "print comp" "= \\(PTR TO -> \\( $complex \\)\\) 0x0" "print comp, not associated"
-+gdb_test "print *comp" "Cannot access memory at address 0x0" "print *comp, not associated"
-+gdb_test "print charp" "= \\(PTR TO -> \\( character\\*1 \\)\\) 0x0" "print charp, not associated"
-+gdb_test "print *charp" "Cannot access memory at address 0x0" "print *charp, not associated"
-+gdb_test "print charap" "= \\(PTR TO -> \\( character\\*3 \\)\\) 0x0" "print charap, not associated"
-+gdb_test "print *charap" "Cannot access memory at address 0x0" "print *charap, not associated"
-+gdb_test "print intp" "= \\(PTR TO -> \\( $int \\)\\) 0x0" "print intp, not associated"
-+gdb_test "print *intp" "Cannot access memory at address 0x0" "print *intp, not associated"
-+set test "print intap, not associated"
-+gdb_test_multiple "print intap" $test {
-+ -re " = \\(PTR TO -> \\( $int \\(:,:\\)\\)\\) <not associated>\r\n$gdb_prompt $" {
-+ pass $test
-+ }
-+ -re " = <not associated>\r\n$gdb_prompt $" {
-+ pass $test
-+ }
-+}
-+gdb_test "print realp" "= \\(PTR TO -> \\( $real \\)\\) 0x0" "print realp, not associated"
-+gdb_test "print *realp" "Cannot access memory at address 0x0" "print *realp, not associated"
-+gdb_test "print \$my_var = intp" "= \\(PTR TO -> \\( $int \\)\\) 0x0"
-+set test "print cyclicp1, not associated"
-+gdb_test_multiple "print cyclicp1" $test {
-+ -re "= \\( i = -?\\d+, p = 0x0 \\)\r\n$gdb_prompt $" {
-+ pass $test
-+ }
-+ -re "= \\( i = -?\\d+, p = <not associated> \\)\r\n$gdb_prompt $" {
-+ pass $test
-+ }
-+}
-+set test "print cyclicp1%p, not associated"
-+gdb_test_multiple "print cyclicp1%p" $test {
-+ -re "= \\(PTR TO -> \\( Type typewithpointer \\)\\) 0x0\r\n$gdb_prompt $" {
-+ pass $test
-+ }
-+ -re "= \\(PTR TO -> \\( Type typewithpointer \\)\\) <not associated>\r\n$gdb_prompt $" {
-+ pass $test
-+ }
-+}
-+
-+
-+gdb_breakpoint [gdb_get_line_number "Before value assignment"]
-+gdb_continue_to_breakpoint "Before value assignment"
-+gdb_test "print *(twop)%ivla2" "= <not allocated>"
-+
-+
-+gdb_breakpoint [gdb_get_line_number "After value assignment"]
-+gdb_continue_to_breakpoint "After value assignment"
-+gdb_test "print logp" "= \\(PTR TO -> \\( $logical \\)\\) $hex\( <.*>\)?"
-+gdb_test "print *logp" "= \\.TRUE\\."
-+gdb_test "print comp" "= \\(PTR TO -> \\( $complex \\)\\) $hex\( <.*>\)?"
-+gdb_test "print *comp" "= \\(1,2\\)"
-+gdb_test "print charp" "= \\(PTR TO -> \\( character\\*1 \\)\\) $hex\( <.*>\)?"
-+gdb_test "print *charp" "= 'a'"
-+gdb_test "print charap" "= \\(PTR TO -> \\( character\\*3 \\)\\) $hex\( <.*>\)?"
-+gdb_test "print *charap" "= 'abc'"
-+gdb_test "print intp" "= \\(PTR TO -> \\( $int \\)\\) $hex\( <.*>\)?"
-+gdb_test "print *intp" "= 10"
-+set test_name "print intap, associated"
-+gdb_test_multiple "print intap" $test_name {
-+ -re "= \\(\\( 1, 1, 3(, 1){7}\\) \\( 1(, 1){9}\\) \\)\r\n$gdb_prompt $" {
-+ pass $test_name
-+ }
-+ -re "= \\(PTR TO -> \\( $int \\(10,2\\)\\)\\) $hex\( <.*>\)?\r\n$gdb_prompt $" {
-+ gdb_test "print *intap" "= \\(\\( 1, 1, 3(, 1){7}\\) \\( 1(, 1){9}\\) \\)"
-+ pass $test_name
-+ }
-+}
-+set test_name "print intvlap, associated"
-+gdb_test_multiple "print intvlap" $test_name {
-+ -re "= \\(2, 2, 2, 4(, 2){6}\\)\r\n$gdb_prompt $" {
-+ pass $test_name
-+ }
-+ -re "= \\(PTR TO -> \\( $int \\(10\\)\\)\\) $hex\( <.*>\)?\r\n$gdb_prompt $" {
-+ gdb_test "print *intvlap" "= \\(2, 2, 2, 4(, 2){6}\\)"
-+ pass $test_name
-+ }
-+}
-+gdb_test "print realp" "= \\(PTR TO -> \\( $real \\)\\) $hex\( <.*>\)?"
-+gdb_test "print *realp" "= 3\\.14000\\d+"
-+gdb_test "print arrayOfPtr(2)%p" "= \\(PTR TO -> \\( Type two \\)\\) $hex\( <.*>\)?"
-+gdb_test "print *(arrayOfPtr(2)%p)" "= \\( ivla1 = \\(11, 12, 13\\), ivla2 = \\(\\( 211, 221\\) \\( 212, 222\\) \\) \\)"
-+set test_name "print arrayOfPtr(3)%p"
-+gdb_test_multiple $test_name $test_name {
-+ -re "= \\(PTR TO -> \\( Type two \\)\\) <not associated>\r\n$gdb_prompt $" {
-+ pass $test_name
-+ }
-+ -re "= \\(PTR TO -> \\( Type two \\)\\) 0x0\r\n$gdb_prompt $" {
-+ pass $test_name
-+ }
-+}
-+set test_name "print *(arrayOfPtr(3)%p), associated"
-+gdb_test_multiple "print *(arrayOfPtr(3)%p)" $test_name {
-+ -re "Cannot access memory at address 0x0\r\n$gdb_prompt $" {
-+ pass $test_name
-+ }
-+ -re "Attempt to take contents of a not associated pointer.\r\n$gdb_prompt $" {
-+ pass $test_name
-+ }
-+}
-+gdb_test "print cyclicp1" "= \\( i = 1, p = $hex\( <.*>\)? \\)"
-+gdb_test "print cyclicp1%p" "= \\(PTR TO -> \\( Type typewithpointer \\)\\) $hex\( <.*>\)?"
-+gdb_test "print *((integer*) &inta + 2)" "= 3" "print temporary pointer, array"
-+gdb_test "print *((integer*) &intvla + 3)" "= 4" "print temporary pointer, allocated vla"
-+gdb_test "print \$pc" "= \\(PTR TO -> \\( void \\(\\)\\(\\)\\)\\) $hex <pointers\\+\\d+>" "Print program counter"
-diff -Naurp insight-7.12.50.20170416.orig/gdb/testsuite/gdb.fortran/pointers.f90 insight-7.12.50.20170416.new/gdb/testsuite/gdb.fortran/pointers.f90
---- insight-7.12.50.20170416.orig/gdb/testsuite/gdb.fortran/pointers.f90 1970-01-01 01:00:00.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/testsuite/gdb.fortran/pointers.f90 2017-04-16 15:16:27.476187058 +0100
-@@ -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
-+
-+ type :: typeWithPointer
-+ integer i
-+ type(typeWithPointer), pointer:: p
-+ end type typeWithPointer
-+
-+ type :: twoPtr
-+ type (two), pointer :: p
-+ end type twoPtr
-+
-+ logical, target :: logv
-+ complex, target :: comv
-+ character, target :: charv
-+ character (len=3), target :: chara
-+ integer, target :: intv
-+ integer, target, dimension (10,2) :: inta
-+ integer, target, allocatable, dimension (:) :: intvla
-+ real, target :: realv
-+ type(two), target :: twov
-+ type(twoPtr) :: arrayOfPtr (3)
-+ type(typeWithPointer), target:: cyclicp1,cyclicp2
-+
-+ logical, pointer :: logp
-+ complex, pointer :: comp
-+ character, pointer:: charp
-+ character (len=3), pointer:: charap
-+ integer, pointer :: intp
-+ integer, pointer, dimension (:,:) :: intap
-+ integer, pointer, dimension (:) :: intvlap
-+ real, pointer :: realp
-+ type(two), pointer :: twop
-+
-+ nullify (logp)
-+ nullify (comp)
-+ nullify (charp)
-+ nullify (charap)
-+ nullify (intp)
-+ nullify (intap)
-+ nullify (intvlap)
-+ nullify (realp)
-+ nullify (twop)
-+ nullify (arrayOfPtr(1)%p)
-+ nullify (arrayOfPtr(2)%p)
-+ nullify (arrayOfPtr(3)%p)
-+ nullify (cyclicp1%p)
-+ nullify (cyclicp2%p)
-+
-+ logp => logv ! Before pointer assignment
-+ comp => comv
-+ charp => charv
-+ charap => chara
-+ intp => intv
-+ intap => inta
-+ intvlap => intvla
-+ realp => realv
-+ twop => twov
-+ arrayOfPtr(2)%p => twov
-+ cyclicp1%i = 1
-+ cyclicp1%p => cyclicp2
-+ cyclicp2%i = 2
-+ cyclicp2%p => cyclicp1
-+
-+ logv = associated(logp) ! Before value assignment
-+ comv = cmplx(1,2)
-+ charv = "a"
-+ chara = "abc"
-+ intv = 10
-+ inta(:,:) = 1
-+ inta(3,1) = 3
-+ allocate (intvla(10))
-+ intvla(:) = 2
-+ intvla(4) = 4
-+ intvlap => intvla
-+ realv = 3.14
-+
-+ allocate (twov%ivla1(3))
-+ allocate (twov%ivla2(2,2))
-+ twov%ivla1(1) = 11
-+ twov%ivla1(2) = 12
-+ twov%ivla1(3) = 13
-+ twov%ivla2(1,1) = 211
-+ twov%ivla2(2,1) = 221
-+ twov%ivla2(1,2) = 212
-+ twov%ivla2(2,2) = 222
-+
-+ intv = intv + 1 ! After value assignment
-+
-+end program pointers
-diff -Naurp insight-7.12.50.20170416.orig/gdb/testsuite/gdb.fortran/print_type.exp insight-7.12.50.20170416.new/gdb/testsuite/gdb.fortran/print_type.exp
---- insight-7.12.50.20170416.orig/gdb/testsuite/gdb.fortran/print_type.exp 1970-01-01 01:00:00.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/testsuite/gdb.fortran/print_type.exp 2017-04-16 15:16:27.476187058 +0100
-@@ -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 -Naurp insight-7.12.50.20170416.orig/gdb/testsuite/gdb.fortran/vla-ptype.exp insight-7.12.50.20170416.new/gdb/testsuite/gdb.fortran/vla-ptype.exp
---- insight-7.12.50.20170416.orig/gdb/testsuite/gdb.fortran/vla-ptype.exp 2017-04-16 15:15:34.808719221 +0100
-+++ insight-7.12.50.20170416.new/gdb/testsuite/gdb.fortran/vla-ptype.exp 2017-04-16 15:16:27.477187066 +0100
-@@ -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 =
-
- 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 "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 "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"
-diff -Naurp insight-7.12.50.20170416.orig/gdb/testsuite/gdb.fortran/vla-strings.exp insight-7.12.50.20170416.new/gdb/testsuite/gdb.fortran/vla-strings.exp
---- insight-7.12.50.20170416.orig/gdb/testsuite/gdb.fortran/vla-strings.exp 1970-01-01 01:00:00.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/testsuite/gdb.fortran/vla-strings.exp 2017-04-16 15:16:27.477187066 +0100
-@@ -0,0 +1,103 @@
-+# Copyright 2016 Free Software Foundation, Inc.
-+
-+# This program is free software; you can redistribute it and/or modify
-+# it under the terms of the GNU General Public License as published by
-+# the Free Software Foundation; either version 3 of the License, or
-+# (at your option) any later version.
-+#
-+# This program is distributed in the hope that it will be useful,
-+# but WITHOUT ANY WARRANTY; without even the implied warranty of
-+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+# GNU General Public License for more details.
-+#
-+# You should have received a copy of the GNU General Public License
-+# along with this program. If not, see <http://www.gnu.org/licenses/>.
-+
-+standard_testfile ".f90"
-+
-+if { [prepare_for_testing ${testfile}.exp ${testfile} ${srcfile} \
-+ {debug f90 quiet}] } {
-+ return -1
-+}
-+
-+# check that all fortran standard datatypes will be
-+# handled correctly when using as VLA's
-+
-+if ![runto_main] {
-+ untested "could not run to main"
-+ return -1
-+}
-+
-+gdb_breakpoint [gdb_get_line_number "var_char-allocated-1"]
-+gdb_continue_to_breakpoint "var_char-allocated-1"
-+set test "whatis var_char first time"
-+gdb_test_multiple "whatis var_char" $test {
-+ -re "type = PTR TO -> \\( character\\*10 \\)\r\n$gdb_prompt $" {
-+ pass $test
-+ }
-+ -re "type = character\\*10\r\n$gdb_prompt $" {
-+ pass $test
-+ }
-+}
-+set test "ptype var_char first time"
-+gdb_test_multiple "ptype var_char" $test {
-+ -re "type = PTR TO -> \\( character\\*10 \\)\r\n$gdb_prompt $" {
-+ pass $test
-+ }
-+ -re "type = character\\*10\r\n$gdb_prompt $" {
-+ pass $test
-+ }
-+}
-+
-+
-+gdb_test "next" "\\d+.*var_char = 'foo'.*" \
-+ "next to allocation status of var_char"
-+gdb_test "print l" " = \\.TRUE\\." "print allocation status first time"
-+
-+
-+gdb_breakpoint [gdb_get_line_number "var_char-filled-1"]
-+gdb_continue_to_breakpoint "var_char-filled-1"
-+set test "print var_char, var_char-filled-1"
-+gdb_test_multiple "print var_char" $test {
-+ -re "= \\(PTR TO -> \\( character\\*3 \\)\\) $hex\r\n$gdb_prompt $" {
-+ gdb_test "print *var_char" "= 'foo'" "print *var_char, var_char-filled-1"
-+ pass $test
-+ }
-+ -re "= 'foo'\r\n$gdb_prompt $" {
-+ pass $test
-+ }
-+}
-+set test "ptype var_char, var_char-filled-1"
-+gdb_test_multiple "ptype var_char" $test {
-+ -re "type = PTR TO -> \\( character\\*3 \\)\r\n$gdb_prompt $" {
-+ pass $test
-+ }
-+ -re "type = character\\*3\r\n$gdb_prompt $" {
-+ pass $test
-+ }
-+}
-+gdb_test "print var_char(1)" " = 102 'f'" "print var_char(1)"
-+gdb_test "print var_char(3)" " = 111 'o'" "print var_char(3)"
-+
-+
-+gdb_breakpoint [gdb_get_line_number "var_char-filled-2"]
-+gdb_continue_to_breakpoint "var_char-filled-2"
-+set test "print var_char, var_char-filled-2"
-+gdb_test_multiple "print var_char" $test {
-+ -re "= \\(PTR TO -> \\( character\\*6 \\)\\) $hex\r\n$gdb_prompt $" {
-+ gdb_test "print *var_char" "= 'foobar'" "print *var_char, var_char-filled-2"
-+ pass $test
-+ }
-+ -re "= 'foobar'\r\n$gdb_prompt $" {
-+ pass $test
-+ }
-+}
-+set test "ptype var_char, var_char-filled-2"
-+gdb_test_multiple "ptype var_char" $test {
-+ -re "type = PTR TO -> \\( character\\*6 \\)\r\n$gdb_prompt $" {
-+ pass $test
-+ }
-+ -re "type = character\\*6\r\n$gdb_prompt $" {
-+ pass $test
-+ }
-+}
-diff -Naurp insight-7.12.50.20170416.orig/gdb/testsuite/gdb.fortran/vla-strings.f90 insight-7.12.50.20170416.new/gdb/testsuite/gdb.fortran/vla-strings.f90
---- insight-7.12.50.20170416.orig/gdb/testsuite/gdb.fortran/vla-strings.f90 1970-01-01 01:00:00.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/testsuite/gdb.fortran/vla-strings.f90 2017-04-16 15:16:27.477187066 +0100
-@@ -0,0 +1,39 @@
-+! Copyright 2016 Free Software Foundation, Inc.
-+!
-+! This program is free software; you can redistribute it and/or modify
-+! it under the terms of the GNU General Public License as published by
-+! the Free Software Foundation; either version 3 of the License, or
-+! (at your option) any later version.
-+!
-+! This program is distributed in the hope that it will be useful,
-+! but WITHOUT ANY WARRANTY; without even the implied warranty of
-+! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+! GNU General Public License for more details.
-+!
-+! You should have received a copy of the GNU General Public License
-+! along with this program. If not, see <http://www.gnu.org/licenses/>.
-+
-+program vla_strings
-+ character(len=:), target, allocatable :: var_char
-+ character(len=:), pointer :: var_char_p
-+ logical :: l
-+
-+ allocate(character(len=10) :: var_char)
-+ l = allocated(var_char) ! var_char-allocated-1
-+ var_char = 'foo'
-+ deallocate(var_char) ! var_char-filled-1
-+ l = allocated(var_char) ! var_char-deallocated
-+ allocate(character(len=42) :: var_char)
-+ l = allocated(var_char)
-+ var_char = 'foobar'
-+ var_char = '' ! var_char-filled-2
-+ var_char = 'bar' ! var_char-empty
-+ deallocate(var_char)
-+ allocate(character(len=21) :: var_char)
-+ l = allocated(var_char) ! var_char-allocated-3
-+ var_char = 'johndoe'
-+ var_char_p => var_char
-+ l = associated(var_char_p) ! var_char_p-associated
-+ var_char_p => null()
-+ l = associated(var_char_p) ! var_char_p-not-associated
-+end program vla_strings
-diff -Naurp insight-7.12.50.20170416.orig/gdb/testsuite/gdb.fortran/vla-type.exp insight-7.12.50.20170416.new/gdb/testsuite/gdb.fortran/vla-type.exp
---- insight-7.12.50.20170416.orig/gdb/testsuite/gdb.fortran/vla-type.exp 2017-01-03 17:36:55.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/testsuite/gdb.fortran/vla-type.exp 2017-04-16 15:16:27.477187066 +0100
-@@ -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 -Naurp insight-7.12.50.20170416.orig/gdb/testsuite/gdb.fortran/vla-value.exp insight-7.12.50.20170416.new/gdb/testsuite/gdb.fortran/vla-value.exp
---- insight-7.12.50.20170416.orig/gdb/testsuite/gdb.fortran/vla-value.exp 2017-01-03 17:36:55.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/testsuite/gdb.fortran/vla-value.exp 2017-04-16 15:16:27.477187066 +0100
-@@ -14,6 +14,7 @@
- # along with this program. If not, see <http://www.gnu.org/licenses/>.
-
- standard_testfile "vla.f90"
-+load_lib "fortran.exp"
-
- if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile} \
- {debug f90 quiet}] } {
-@@ -25,12 +26,15 @@ if ![runto_main] {
- return -1
- }
-
-+# Depending on the compiler being used, the type names can be printed differently.
-+set real [fortran_real4]
-+
- # Try to access values in non allocated VLA
- gdb_breakpoint [gdb_get_line_number "vla1-init"]
- gdb_continue_to_breakpoint "vla1-init"
- gdb_test "print vla1" " = <not allocated>" "print non-allocated vla1"
- gdb_test "print &vla1" \
-- " = \\\(PTR TO -> \\\( real\\\(kind=4\\\) \\\(<not allocated>\\\)\\\)\\\) $hex" \
-+ " = \\\(PTR TO -> \\\( $real \\\(:,:,:\\\)\\\)\\\) $hex" \
- "print non-allocated &vla1"
- gdb_test "print vla1(1,1,1)" "no such vector element \\\(vector not allocated\\\)" \
- "print member in non-allocated vla1 (1)"
-@@ -51,7 +55,7 @@ with_timeout_factor 15 {
- "step over value assignment of vla1"
- }
- gdb_test "print &vla1" \
-- " = \\\(PTR TO -> \\\( real\\\(kind=4\\\) \\\(10,10,10\\\)\\\)\\\) $hex" \
-+ " = \\\(PTR TO -> \\\( $real \\\(10,10,10\\\)\\\)\\\) $hex" \
- "print allocated &vla1"
- gdb_test "print vla1(3, 6, 9)" " = 1311" "print allocated vla1(3,6,9)"
- gdb_test "print vla1(1, 3, 8)" " = 1311" "print allocated vla1(1,3,8)"
-@@ -71,7 +75,7 @@ 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\\\(kind=4\\\) \\\(<not associated>\\\)\\\)\\\) $hex" \
-+ " = \\\(PTR TO -> \\\( $real \\\(:,:,:\\\)\\\)\\\) $hex" \
- "print non-associated &pvla"
- gdb_test "print pvla(1, 3, 8)" "no such vector element \\\(vector not associated\\\)" \
- "print undefined pvla(1,3,8)"
-@@ -80,7 +84,7 @@ gdb_test "print pvla(1, 3, 8)" "no such
- gdb_breakpoint [gdb_get_line_number "pvla-associated"]
- gdb_continue_to_breakpoint "pvla-associated"
- gdb_test "print &pvla" \
-- " = \\\(PTR TO -> \\\( real\\\(kind=4\\\) \\\(10,10,10\\\)\\\)\\\) $hex" \
-+ " = \\\(PTR TO -> \\\( $real \\\(10,10,10\\\)\\\)\\\) $hex" \
- "print associated &pvla"
- gdb_test "print pvla(3, 6, 9)" " = 42" "print associated pvla(3,6,9)"
- gdb_test "print pvla(1, 3, 8)" " = 1001" "print associated pvla(1,3,8)"
-diff -Naurp insight-7.12.50.20170416.orig/gdb/testsuite/gdb.mi/mi-var-child-f.exp insight-7.12.50.20170416.new/gdb/testsuite/gdb.mi/mi-var-child-f.exp
---- insight-7.12.50.20170416.orig/gdb/testsuite/gdb.mi/mi-var-child-f.exp 2017-01-03 17:36:55.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/testsuite/gdb.mi/mi-var-child-f.exp 2017-04-16 15:16:27.478187075 +0100
-@@ -17,6 +17,7 @@
-
- load_lib mi-support.exp
- set MIFLAGS "-i=mi"
-+load_lib "fortran.exp"
-
- if { [skip_fortran_tests] } { return -1 }
-
-@@ -40,10 +41,8 @@ mi_runto MAIN__
- mi_create_varobj "array" "array" "create local variable array"
-
-
--# Depending on the compiler version being used, the name of the 4-byte integer
--# and real types can be printed differently. For instance, gfortran-4.1 uses
--# "int4" whereas gfortran-4.3 uses "integer(kind=4)".
--set int4 "(int4|integer\\(kind=4\\))"
-+# Depending on the compiler being used, the type names can be printed differently.
-+set int4 [fortran_int4]
-
- set children [list [list "array.-1" "-1" 2 "$int4 \\(2\\)"] \
- [list "array.0" "0" 2 "$int4 \\(2\\)"] \
-diff -Naurp insight-7.12.50.20170416.orig/gdb/testsuite/gdb.mi/mi-vla-fortran.exp insight-7.12.50.20170416.new/gdb/testsuite/gdb.mi/mi-vla-fortran.exp
---- insight-7.12.50.20170416.orig/gdb/testsuite/gdb.mi/mi-vla-fortran.exp 2017-01-03 17:36:55.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/testsuite/gdb.mi/mi-vla-fortran.exp 2017-04-16 15:16:27.478187075 +0100
-@@ -17,7 +17,9 @@
- # Array (VLA).
-
- load_lib mi-support.exp
-+load_lib fortran.exp
- set MIFLAGS "-i=mi"
-+load_lib "fortran.exp"
-
- gdb_exit
- if [mi_gdb_start] {
-@@ -32,6 +34,9 @@ if { [gdb_compile "${srcdir}/${subdir}/$
- return -1
- }
-
-+# Depending on the compiler being used, the type names can be printed differently.
-+set real [fortran_real4]
-+
- mi_delete_breakpoints
- mi_gdb_reinitialize_dir $srcdir/$subdir
- mi_gdb_load ${binfile}
-@@ -46,10 +51,10 @@ mi_expect_stop "breakpoint-hit" "vla" ""
- mi_gdb_test "500-data-evaluate-expression vla1" \
- "500\\^done,value=\"<not allocated>\"" "evaluate not allocated vla"
-
--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\"" \
-@@ -58,7 +63,7 @@ mi_gdb_test "503-var-evaluate-expression
- "503\\^done,value=\"\\\[0\\\]\"" \
- "eval variable vla1_not_allocated"
- mi_list_array_varobj_children_with_index "vla1_not_allocated" "0" "1" \
-- "real\\\(kind=4\\\)" "get children of vla1_not_allocated"
-+ "$real" "get children of vla1_not_allocated"
-
-
-
-@@ -71,10 +76,10 @@ mi_expect_stop "breakpoint-hit" "vla" ""
- mi_gdb_test "510-data-evaluate-expression vla1" \
- "510\\^done,value=\"\\(.*\\)\"" "evaluate allocated vla"
-
--mi_create_varobj_checked vla1_allocated vla1 "real\\\(kind=4\\\) \\\(5\\\)" \
-+mi_create_varobj_checked vla1_allocated vla1 "$real \\\(5\\\)" \
- "create local variable vla1_allocated"
- mi_gdb_test "511-var-info-type vla1_allocated" \
-- "511\\^done,type=\"real\\\(kind=4\\\) \\\(5\\\)\"" \
-+ "511\\^done,type=\"$real \\\(5\\\)\"" \
- "info type variable vla1_allocated"
- mi_gdb_test "512-var-show-format vla1_allocated" \
- "512\\^done,format=\"natural\"" \
-@@ -83,7 +88,7 @@ mi_gdb_test "513-var-evaluate-expression
- "513\\^done,value=\"\\\[5\\\]\"" \
- "eval variable vla1_allocated"
- mi_list_array_varobj_children_with_index "vla1_allocated" "5" "1" \
-- "real\\\(kind=4\\\)" "get children of vla1_allocated"
-+ "$real" "get children of vla1_allocated"
-
-
- set bp_lineno [gdb_get_line_number "vla1-filled"]
-@@ -136,10 +141,10 @@ 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\"" \
-@@ -148,7 +153,7 @@ gdb_expect {
- "583\\^done,value=\"\\\[0\\\]\"" \
- "eval variable pvla2_not_associated"
- mi_list_array_varobj_children_with_index "pvla2_not_associated" "0" "1" \
-- "real\\\(kind=4\\\)" "get children of pvla2_not_associated"
-+ "$real" "get children of pvla2_not_associated"
- }
- -re "580\\^error,msg=\"value contents too large \\(\[0-9\]+ bytes\\).*${mi_gdb_prompt}$" {
- # Undefined behaviour in gfortran.
-@@ -173,9 +178,9 @@ mi_gdb_test "590-data-evaluate-expressio
- "evaluate associated vla"
-
- mi_create_varobj_checked pvla2_associated pvla2 \
-- "real\\\(kind=4\\\) \\\(5,2\\\)" "create local variable pvla2_associated"
-+ "$real \\\(5,2\\\)" "create local variable pvla2_associated"
- mi_gdb_test "591-var-info-type pvla2_associated" \
-- "591\\^done,type=\"real\\\(kind=4\\\) \\\(5,2\\\)\"" \
-+ "591\\^done,type=\"$real \\\(5,2\\\)\"" \
- "info type variable pvla2_associated"
- mi_gdb_test "592-var-show-format pvla2_associated" \
- "592\\^done,format=\"natural\"" \
-diff -Naurp insight-7.12.50.20170416.orig/gdb/typeprint.c insight-7.12.50.20170416.new/gdb/typeprint.c
---- insight-7.12.50.20170416.orig/gdb/typeprint.c 2017-03-25 10:42:37.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/typeprint.c 2017-04-16 15:16:27.478187075 +0100
-@@ -474,6 +474,25 @@ whatis_exp (char *exp, int show)
- printf_filtered (" */\n");
- }
-
-+ /* Resolve any dynamic target type, as we might print
-+ additional information about the target.
-+ For example, in Fortran and C we are printing the dimension of the
-+ dynamic array the pointer is pointing to. */
-+ if (TYPE_CODE (type) == TYPE_CODE_PTR
-+ && is_dynamic_type (type) == 1)
-+ {
-+ CORE_ADDR addr;
-+ if (NULL != TYPE_DATA_LOCATION (TYPE_TARGET_TYPE(type)))
-+ addr = value_address (val);
-+ else
-+ addr = value_as_address (val);
-+
-+ if (addr != 0
-+ && type_not_associated (type) == 0)
-+ TYPE_TARGET_TYPE (type) = resolve_dynamic_type (TYPE_TARGET_TYPE (type),
-+ NULL, addr);
-+ }
-+
- LA_PRINT_TYPE (type, "", gdb_stdout, show, 0, &flags);
- printf_filtered ("\n");
-
-diff -Naurp insight-7.12.50.20170416.orig/gdb/valops.c insight-7.12.50.20170416.new/gdb/valops.c
---- insight-7.12.50.20170416.orig/gdb/valops.c 2017-04-16 15:15:34.809719230 +0100
-+++ insight-7.12.50.20170416.new/gdb/valops.c 2017-04-16 15:16:27.479187084 +0100
-@@ -1574,6 +1574,19 @@ value_ind (struct value *arg1)
- if (TYPE_CODE (base_type) == TYPE_CODE_PTR)
- {
- struct type *enc_type;
-+ CORE_ADDR addr;
-+
-+ if (type_not_associated (base_type))
-+ error (_("Attempt to take contents of a not associated pointer."));
-+
-+ if (NULL != TYPE_DATA_LOCATION (TYPE_TARGET_TYPE (base_type)))
-+ addr = value_address (arg1);
-+ else
-+ addr = value_as_address (arg1);
-+
-+ if (addr != 0)
-+ TYPE_TARGET_TYPE (base_type) =
-+ resolve_dynamic_type (TYPE_TARGET_TYPE (base_type), NULL, addr);
-
- /* We may be pointing to something embedded in a larger object.
- Get the real type of the enclosing object. */
-@@ -1589,8 +1602,7 @@ value_ind (struct value *arg1)
- else
- /* Retrieve the enclosing object pointed to. */
- arg2 = value_at_lazy (enc_type,
-- (value_as_address (arg1)
-- - value_pointed_to_offset (arg1)));
-+ (addr - value_pointed_to_offset (arg1)));
-
- enc_type = value_type (arg2);
- return readjust_indirect_value_type (arg2, enc_type, base_type, arg1);
-diff -Naurp insight-7.12.50.20170416.orig/gdb/valprint.c insight-7.12.50.20170416.new/gdb/valprint.c
---- insight-7.12.50.20170416.orig/gdb/valprint.c 2017-04-16 15:15:34.746718670 +0100
-+++ insight-7.12.50.20170416.new/gdb/valprint.c 2017-04-16 15:16:27.480187093 +0100
-@@ -1166,12 +1166,6 @@ value_check_printable (struct value *val
- return 0;
- }
-
-- if (type_not_associated (value_type (val)))
-- {
-- val_print_not_associated (stream);
-- return 0;
-- }
--
- if (type_not_allocated (value_type (val)))
- {
- val_print_not_allocated (stream);
diff --git a/insight-7.12-gdb-vla-intel-stringbt-fix.patch b/insight-7.12-gdb-vla-intel-stringbt-fix.patch
deleted file mode 100644
index 4a907b2..0000000
--- a/insight-7.12-gdb-vla-intel-stringbt-fix.patch
+++ /dev/null
@@ -1,141 +0,0 @@
-diff -Naurp insight-7.12.50.20170416.orig/gdb/dwarf2loc.c insight-7.12.50.20170416.new/gdb/dwarf2loc.c
---- insight-7.12.50.20170416.orig/gdb/dwarf2loc.c 2017-04-16 13:23:04.683298600 +0100
-+++ insight-7.12.50.20170416.new/gdb/dwarf2loc.c 2017-04-16 13:24:55.140258427 +0100
-@@ -42,6 +42,7 @@
- #include <algorithm>
- #include <vector>
- #include <unordered_set>
-+#include <functional>
- #include "common/underlying.h"
-
- extern int dwarf_always_disassemble;
-@@ -2369,6 +2370,18 @@ dwarf2_evaluate_loc_desc_full (struct ty
- ctx.per_cu = per_cu;
- ctx.obj_address = 0;
-
-+struct frame_info *old_frame (deprecated_safe_get_selected_frame ());
-+class RestoreCall {
-+private:
-+ const std::function<void ()> func;
-+public:
-+ RestoreCall(std::function<void ()> func_):func(func_) {}
-+ ~RestoreCall() { func(); }
-+} restore_frame([&]() {
-+ select_frame (old_frame);
-+});
-+if (frame != NULL) select_frame (frame);
-+
- scoped_value_mark free_values;
-
- ctx.gdbarch = get_objfile_arch (objfile);
-diff -Naurp insight-7.12.50.20170416.orig/gdb/testsuite/gdb.fortran/dynamic-other-frame.exp insight-7.12.50.20170416.new/gdb/testsuite/gdb.fortran/dynamic-other-frame.exp
---- insight-7.12.50.20170416.orig/gdb/testsuite/gdb.fortran/dynamic-other-frame.exp 1970-01-01 01:00:00.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/testsuite/gdb.fortran/dynamic-other-frame.exp 2017-04-16 13:23:54.445731016 +0100
-@@ -0,0 +1,39 @@
-+# Copyright 2010 Free Software Foundation, Inc.
-+
-+# This program is free software; you can redistribute it and/or modify
-+# it under the terms of the GNU General Public License as published by
-+# the Free Software Foundation; either version 2 of the License, or
-+# (at your option) any later version.
-+#
-+# This program is distributed in the hope that it will be useful,
-+# but WITHOUT ANY WARRANTY; without even the implied warranty of
-+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+# GNU General Public License for more details.
-+#
-+# You should have received a copy of the GNU General Public License
-+# along with this program; if not, write to the Free Software
-+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-+
-+set testfile "dynamic-other-frame"
-+set srcfile1 ${testfile}.f90
-+set srcfile2 ${testfile}-stub.f90
-+set objfile2 [standard_output_file ${testfile}-stub.o]
-+set executable ${testfile}
-+set binfile [standard_output_file ${executable}]
-+
-+if { [gdb_compile "${srcdir}/${subdir}/${srcfile2}" "${objfile2}" object {f90}] != ""
-+ || [gdb_compile "${srcdir}/${subdir}/${srcfile1} ${objfile2}" "${binfile}" executable {debug f90}] != "" } {
-+ untested "Couldn't compile ${srcfile1} or ${srcfile2}"
-+ return -1
-+}
-+
-+clean_restart ${executable}
-+
-+gdb_test_no_output "set print frame-arguments all"
-+
-+if ![runto bar_] then {
-+ perror "couldn't run to bar_"
-+ continue
-+}
-+
-+gdb_test "bt" {foo \(string='hello'.*}
-diff -Naurp insight-7.12.50.20170416.orig/gdb/testsuite/gdb.fortran/dynamic-other-frame.f90 insight-7.12.50.20170416.new/gdb/testsuite/gdb.fortran/dynamic-other-frame.f90
---- insight-7.12.50.20170416.orig/gdb/testsuite/gdb.fortran/dynamic-other-frame.f90 1970-01-01 01:00:00.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/testsuite/gdb.fortran/dynamic-other-frame.f90 2017-04-16 13:23:54.445731016 +0100
-@@ -0,0 +1,36 @@
-+! Copyright 2010 Free Software Foundation, Inc.
-+!
-+! This program is free software; you can redistribute it and/or modify
-+! it under the terms of the GNU General Public License as published by
-+! the Free Software Foundation; either version 2 of the License, or
-+! (at your option) any later version.
-+!
-+! This program is distributed in the hope that it will be useful,
-+! but WITHOUT ANY WARRANTY; without even the implied warranty of
-+! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+! GNU General Public License for more details.
-+!
-+! You should have received a copy of the GNU General Public License
-+! along with this program; if not, write to the Free Software
-+! Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-+!
-+! Ihis file is the Fortran source file for dynamic.exp.
-+! Original file written by Jakub Jelinek <jakub(a)redhat.com>.
-+! Modified for the GDB testcase by Jan Kratochvil <jan.kratochvil(a)redhat.com>.
-+
-+subroutine foo (string)
-+ interface
-+ subroutine bar
-+ end subroutine
-+ end interface
-+ character string*(*)
-+ call bar ! stop-here
-+end subroutine foo
-+program test
-+ interface
-+ subroutine foo (string)
-+ character string*(*)
-+ end subroutine
-+ end interface
-+ call foo ('hello')
-+end
-diff -Naurp insight-7.12.50.20170416.orig/gdb/testsuite/gdb.fortran/dynamic-other-frame-stub.f90 insight-7.12.50.20170416.new/gdb/testsuite/gdb.fortran/dynamic-other-frame-stub.f90
---- insight-7.12.50.20170416.orig/gdb/testsuite/gdb.fortran/dynamic-other-frame-stub.f90 1970-01-01 01:00:00.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/testsuite/gdb.fortran/dynamic-other-frame-stub.f90 2017-04-16 13:23:54.444731007 +0100
-@@ -0,0 +1,24 @@
-+! Copyright 2010 Free Software Foundation, Inc.
-+!
-+! This program is free software; you can redistribute it and/or modify
-+! it under the terms of the GNU General Public License as published by
-+! the Free Software Foundation; either version 2 of the License, or
-+! (at your option) any later version.
-+!
-+! This program is distributed in the hope that it will be useful,
-+! but WITHOUT ANY WARRANTY; without even the implied warranty of
-+! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+! GNU General Public License for more details.
-+!
-+! You should have received a copy of the GNU General Public License
-+! along with this program; if not, write to the Free Software
-+! Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-+!
-+! Ihis file is the Fortran source file for dynamic.exp.
-+! Original file written by Jakub Jelinek <jakub(a)redhat.com>.
-+! Modified for the GDB testcase by Jan Kratochvil <jan.kratochvil(a)redhat.com>.
-+
-+subroutine bar
-+ real :: dummy
-+ dummy = 1
-+end subroutine bar
diff --git a/insight-8.1-buildid-locate-solib-missing-ids.patch b/insight-8.1-buildid-locate-solib-missing-ids.patch
new file mode 100644
index 0000000..11e5fc1
--- /dev/null
+++ b/insight-8.1-buildid-locate-solib-missing-ids.patch
@@ -0,0 +1,221 @@
+diff -Naurp insight-8.1.50.20180216.orig/gdb/solib-svr4.c insight-8.1.50.20180216.new/gdb/solib-svr4.c
+--- insight-8.1.50.20180216.orig/gdb/solib-svr4.c 2018-02-17 19:03:36.184146855 +0100
++++ insight-8.1.50.20180216.new/gdb/solib-svr4.c 2018-02-17 19:08:52.181273047 +0100
+@@ -1389,14 +1389,27 @@ svr4_read_so_list (CORE_ADDR lm, CORE_AD
+ }
+
+ {
+- struct bfd_build_id *build_id;
++ struct bfd_build_id *build_id = NULL;
+
+ strncpy (newobj->so_original_name, buffer, SO_NAME_MAX_PATH_SIZE - 1);
+ newobj->so_original_name[SO_NAME_MAX_PATH_SIZE - 1] = '\0';
+ /* May get overwritten below. */
+ strcpy (newobj->so_name, newobj->so_original_name);
+
+- build_id = build_id_addr_get (li->l_ld);
++ /* In the case the main executable was found according to its build-id
++ (from a core file) prevent loading a different build of a library
++ with accidentally the same SO_NAME.
++
++ It suppresses bogus backtraces (and prints "??" there instead) if
++ the on-disk files no longer match the running program version.
++
++ If the main executable was not loaded according to its build-id do
++ not do any build-id checking of the libraries. There may be missing
++ build-ids dumped in the core file and we would map all the libraries
++ to the only existing file loaded that time - the executable. */
++ if (symfile_objfile != NULL
++ && (symfile_objfile->flags & OBJF_BUILD_ID_CORE_LOADED) != 0)
++ build_id = build_id_addr_get (li->l_ld);
+ if (build_id != NULL)
+ {
+ char *name, *build_id_filename;
+@@ -1411,23 +1424,7 @@ svr4_read_so_list (CORE_ADDR lm, CORE_AD
+ xfree (name);
+ }
+ else
+- {
+- debug_print_missing (newobj->so_name, build_id_filename);
+-
+- /* In the case the main executable was found according to
+- its build-id (from a core file) prevent loading
+- a different build of a library with accidentally the
+- same SO_NAME.
+-
+- It suppresses bogus backtraces (and prints "??" there
+- instead) if the on-disk files no longer match the
+- running program version. */
+-
+- if (symfile_objfile != NULL
+- && (symfile_objfile->flags
+- & OBJF_BUILD_ID_CORE_LOADED) != 0)
+- newobj->so_name[0] = 0;
+- }
++ debug_print_missing (newobj->so_name, build_id_filename);
+
+ xfree (build_id_filename);
+ xfree (build_id);
+diff -Naurp insight-8.1.50.20180216.orig/gdb/testsuite/gdb.base/gcore-buildid-exec-but-not-solib.exp insight-8.1.50.20180216.new/gdb/testsuite/gdb.base/gcore-buildid-exec-but-not-solib.exp
+--- insight-8.1.50.20180216.orig/gdb/testsuite/gdb.base/gcore-buildid-exec-but-not-solib.exp 1970-01-01 01:00:00.000000000 +0100
++++ insight-8.1.50.20180216.new/gdb/testsuite/gdb.base/gcore-buildid-exec-but-not-solib.exp 2018-02-17 19:04:46.864844170 +0100
+@@ -0,0 +1,105 @@
++# Copyright 2016 Free Software Foundation, Inc.
++
++# This program is free software; you can redistribute it and/or modify
++# it under the terms of the GNU General Public License as published by
++# the Free Software Foundation; either version 3 of the License, or
++# (at your option) any later version.
++#
++# This program is distributed in the hope that it will be useful,
++# but WITHOUT ANY WARRANTY; without even the implied warranty of
++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++# GNU General Public License for more details.
++#
++# You should have received a copy of the GNU General Public License
++# along with this program. If not, see <http://www.gnu.org/licenses/>.
++
++if {[skip_shlib_tests]} {
++ return 0
++}
++
++set testfile "gcore-buildid-exec-but-not-solib"
++set srcmainfile ${testfile}-main.c
++set srclibfile ${testfile}-lib.c
++set libfile [standard_output_file ${testfile}-lib.so]
++set objfile [standard_output_file ${testfile}-main.o]
++set executable ${testfile}-main
++set binfile [standard_output_file ${executable}]
++set gcorefile [standard_output_file ${executable}.gcore]
++set outdir [file dirname $binfile]
++
++if { [gdb_compile_shlib ${srcdir}/${subdir}/${srclibfile} ${libfile} "debug additional_flags=-Wl,--build-id"] != ""
++ || [gdb_compile ${srcdir}/${subdir}/${srcmainfile} ${objfile} object {debug}] != "" } {
++ unsupported "-Wl,--build-id compilation failed"
++ return -1
++}
++set opts [list debug shlib=${libfile} "additional_flags=-Wl,--build-id"]
++if { [gdb_compile ${objfile} ${binfile} executable $opts] != "" } {
++ unsupported "-Wl,--build-id compilation failed"
++ return -1
++}
++
++clean_restart $executable
++gdb_load_shlib $libfile
++
++# Does this gdb support gcore?
++set test "help gcore"
++gdb_test_multiple $test $test {
++ -re "Undefined command: .gcore.*\r\n$gdb_prompt $" {
++ # gcore command not supported -- nothing to test here.
++ unsupported "gdb does not support gcore on this target"
++ return -1;
++ }
++ -re "Save a core file .*\r\n$gdb_prompt $" {
++ pass $test
++ }
++}
++
++if { ![runto lib] } then {
++ return -1
++}
++
++set escapedfilename [string_to_regexp ${gcorefile}]
++
++set test "save a corefile"
++gdb_test_multiple "gcore ${gcorefile}" $test {
++ -re "Saved corefile ${escapedfilename}\r\n$gdb_prompt $" {
++ pass $test
++ }
++ -re "Can't create a corefile\r\n$gdb_prompt $" {
++ unsupported $test
++ return -1
++ }
++}
++
++# Now restart gdb and load the corefile.
++
++clean_restart $executable
++gdb_load_shlib $libfile
++
++set buildid [build_id_debug_filename_get $libfile]
++
++regsub {\.debug$} $buildid {} buildid
++
++set debugdir [standard_output_file ${testfile}-debugdir]
++file delete -force -- $debugdir
++
++file mkdir $debugdir/[file dirname $libfile]
++file copy $libfile $debugdir/${libfile}
++
++file mkdir $debugdir/[file dirname $buildid]
++file copy $libfile $debugdir/${buildid}
++
++remote_exec build "ln -s /lib ${debugdir}/"
++remote_exec build "ln -s /lib64 ${debugdir}/"
++# /usr is not needed, all the libs are in /lib64: libm.so.6 libc.so.6 ld-linux-x86-64.so.2
++
++gdb_test "set solib-absolute-prefix $debugdir"
++
++gdb_test_no_output "set debug-file-directory $debugdir" "set debug-file-directory"
++
++gdb_test "core ${gcorefile}" "Core was generated by .*" "re-load generated corefile"
++
++gdb_test "frame" "#0 \[^\r\n\]* lib .*" "library got loaded"
++
++gdb_test "bt"
++gdb_test "info shared"
+diff -Naurp insight-8.1.50.20180216.orig/gdb/testsuite/gdb.base/gcore-buildid-exec-but-not-solib-lib.c insight-8.1.50.20180216.new/gdb/testsuite/gdb.base/gcore-buildid-exec-but-not-solib-lib.c
+--- insight-8.1.50.20180216.orig/gdb/testsuite/gdb.base/gcore-buildid-exec-but-not-solib-lib.c 1970-01-01 01:00:00.000000000 +0100
++++ insight-8.1.50.20180216.new/gdb/testsuite/gdb.base/gcore-buildid-exec-but-not-solib-lib.c 2018-02-17 19:04:46.864844170 +0100
+@@ -0,0 +1,21 @@
++/* Copyright 2010 Free Software Foundation, Inc.
++
++ This file is part of GDB.
++
++ This program is free software; you can redistribute it and/or modify
++ it under the terms of the GNU General Public License as published by
++ the Free Software Foundation; either version 3 of the License, or
++ (at your option) any later version.
++
++ This program is distributed in the hope that it will be useful,
++ but WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++ GNU General Public License for more details.
++
++ You should have received a copy of the GNU General Public License
++ along with this program. If not, see <http://www.gnu.org/licenses/>. */
++
++void
++lib (void)
++{
++}
+diff -Naurp insight-8.1.50.20180216.orig/gdb/testsuite/gdb.base/gcore-buildid-exec-but-not-solib-main.c insight-8.1.50.20180216.new/gdb/testsuite/gdb.base/gcore-buildid-exec-but-not-solib-main.c
+--- insight-8.1.50.20180216.orig/gdb/testsuite/gdb.base/gcore-buildid-exec-but-not-solib-main.c 1970-01-01 01:00:00.000000000 +0100
++++ insight-8.1.50.20180216.new/gdb/testsuite/gdb.base/gcore-buildid-exec-but-not-solib-main.c 2018-02-17 19:04:46.864844170 +0100
+@@ -0,0 +1,25 @@
++/* Copyright 2010 Free Software Foundation, Inc.
++
++ This file is part of GDB.
++
++ This program is free software; you can redistribute it and/or modify
++ it under the terms of the GNU General Public License as published by
++ the Free Software Foundation; either version 3 of the License, or
++ (at your option) any later version.
++
++ This program is distributed in the hope that it will be useful,
++ but WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++ GNU General Public License for more details.
++
++ You should have received a copy of the GNU General Public License
++ along with this program. If not, see <http://www.gnu.org/licenses/>. */
++
++extern void lib (void);
++
++int
++main (void)
++{
++ lib ();
++ return 0;
++}
diff --git a/insight-8.1-buildid-locate.patch b/insight-8.1-buildid-locate.patch
new file mode 100644
index 0000000..0636b84
--- /dev/null
+++ b/insight-8.1-buildid-locate.patch
@@ -0,0 +1,1234 @@
+diff -Naurp insight-8.1.50.20180216.orig/gdb/build-id.c insight-8.1.50.20180216.new/gdb/build-id.c
+--- insight-8.1.50.20180216.orig/gdb/build-id.c 2018-02-09 15:06:40.000000000 +0100
++++ insight-8.1.50.20180216.new/gdb/build-id.c 2018-02-17 03:47:58.535668540 +0100
+@@ -26,11 +26,67 @@
+ #include "objfiles.h"
+ #include "filenames.h"
+ #include "gdbcore.h"
++#include "libbfd.h"
++#include "gdbcore.h"
++#include "gdbcmd.h"
++#include "observer.h"
++#include "elf/external.h"
++#include "elf/internal.h"
++#include "elf/common.h"
++#include "elf-bfd.h"
++#include <sys/stat.h>
++
++#define BUILD_ID_VERBOSE_NONE 0
++#define BUILD_ID_VERBOSE_FILENAMES 1
++#define BUILD_ID_VERBOSE_BINARY_PARSE 2
++static int build_id_verbose = BUILD_ID_VERBOSE_FILENAMES;
++static void
++show_build_id_verbose (struct ui_file *file, int from_tty,
++ struct cmd_list_element *c, const char *value)
++{
++ fprintf_filtered (file, _("Verbosity level of the build-id locator is %s.\n"),
++ value);
++}
++/* Locate NT_GNU_BUILD_ID and return its matching debug filename.
++ FIXME: NOTE decoding should be unified with the BFD core notes decoding. */
++
++static struct bfd_build_id *
++build_id_buf_get (bfd *templ, gdb_byte *buf, bfd_size_type size)
++{
++ bfd_byte *p;
++
++ p = buf;
++ while (p < buf + size)
++ {
++ /* FIXME: bad alignment assumption. */
++ Elf_External_Note *xnp = (Elf_External_Note *) p;
++ size_t namesz = H_GET_32 (templ, xnp->namesz);
++ size_t descsz = H_GET_32 (templ, xnp->descsz);
++ bfd_byte *descdata = (gdb_byte *) xnp->name + BFD_ALIGN (namesz, 4);
++
++ if (H_GET_32 (templ, xnp->type) == NT_GNU_BUILD_ID
++ && namesz == sizeof "GNU"
++ && memcmp (xnp->name, "GNU", sizeof "GNU") == 0)
++ {
++ size_t size = descsz;
++ gdb_byte *data = (gdb_byte *) descdata;
++ struct bfd_build_id *retval;
++
++ retval = (struct bfd_build_id *) xmalloc (sizeof *retval - 1 + size);
++ retval->size = size;
++ memcpy (retval->data, data, size);
++
++ return retval;
++ }
++ p = descdata + BFD_ALIGN (descsz, 4);
++ }
++ return NULL;
++}
+
+ /* See build-id.h. */
+
+ const struct bfd_build_id *
+-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)
+ return NULL;
+ }
+
++/* Core files may have missing (corrupt) SHDR but PDHR is correct there.
++ bfd_elf_bfd_from_remote_memory () has too much overhead by
++ allocating/reading all the available ELF PT_LOADs. */
++
++static struct bfd_build_id *
++build_id_phdr_get (bfd *templ, bfd_vma loadbase, unsigned e_phnum,
++ Elf_Internal_Phdr *i_phdr)
++{
++ int i;
++ struct bfd_build_id *retval = NULL;
++
++ for (i = 0; i < e_phnum; i++)
++ if (i_phdr[i].p_type == PT_NOTE && i_phdr[i].p_filesz > 0)
++ {
++ Elf_Internal_Phdr *hdr = &i_phdr[i];
++ gdb_byte *buf;
++ int err;
++
++ buf = (gdb_byte *) xmalloc (hdr->p_filesz);
++ err = target_read_memory (loadbase + i_phdr[i].p_vaddr, buf,
++ hdr->p_filesz);
++ if (err == 0)
++ retval = build_id_buf_get (templ, buf, hdr->p_filesz);
++ else
++ retval = NULL;
++ xfree (buf);
++ if (retval != NULL)
++ break;
++ }
++ return retval;
++}
++
++/* First we validate the file by reading in the ELF header and checking
++ the magic number. */
++
++static inline bfd_boolean
++elf_file_p (Elf64_External_Ehdr *x_ehdrp64)
++{
++ gdb_assert (sizeof (Elf64_External_Ehdr) >= sizeof (Elf32_External_Ehdr));
++ gdb_assert (offsetof (Elf64_External_Ehdr, e_ident)
++ == offsetof (Elf32_External_Ehdr, e_ident));
++ gdb_assert (sizeof (((Elf64_External_Ehdr *) 0)->e_ident)
++ == sizeof (((Elf32_External_Ehdr *) 0)->e_ident));
++
++ return ((x_ehdrp64->e_ident[EI_MAG0] == ELFMAG0)
++ && (x_ehdrp64->e_ident[EI_MAG1] == ELFMAG1)
++ && (x_ehdrp64->e_ident[EI_MAG2] == ELFMAG2)
++ && (x_ehdrp64->e_ident[EI_MAG3] == ELFMAG3));
++}
++
++/* Translate an ELF file header in external format into an ELF file header in
++ internal format. */
++
++#define H_GET_WORD(bfd, ptr) (is64 ? H_GET_64 (bfd, (ptr)) \
++ : H_GET_32 (bfd, (ptr)))
++#define H_GET_SIGNED_WORD(bfd, ptr) (is64 ? H_GET_S64 (bfd, (ptr)) \
++ : H_GET_S32 (bfd, (ptr)))
++
++static void
++elf_swap_ehdr_in (bfd *abfd,
++ const Elf64_External_Ehdr *src64,
++ Elf_Internal_Ehdr *dst)
++{
++ int is64 = bfd_get_arch_size (abfd) == 64;
++#define SRC(field) (is64 ? src64->field \
++ : ((const Elf32_External_Ehdr *) src64)->field)
++
++ int signed_vma = get_elf_backend_data (abfd)->sign_extend_vma;
++ memcpy (dst->e_ident, SRC (e_ident), EI_NIDENT);
++ dst->e_type = H_GET_16 (abfd, SRC (e_type));
++ dst->e_machine = H_GET_16 (abfd, SRC (e_machine));
++ dst->e_version = H_GET_32 (abfd, SRC (e_version));
++ if (signed_vma)
++ dst->e_entry = H_GET_SIGNED_WORD (abfd, SRC (e_entry));
++ else
++ dst->e_entry = H_GET_WORD (abfd, SRC (e_entry));
++ dst->e_phoff = H_GET_WORD (abfd, SRC (e_phoff));
++ dst->e_shoff = H_GET_WORD (abfd, SRC (e_shoff));
++ dst->e_flags = H_GET_32 (abfd, SRC (e_flags));
++ dst->e_ehsize = H_GET_16 (abfd, SRC (e_ehsize));
++ dst->e_phentsize = H_GET_16 (abfd, SRC (e_phentsize));
++ dst->e_phnum = H_GET_16 (abfd, SRC (e_phnum));
++ dst->e_shentsize = H_GET_16 (abfd, SRC (e_shentsize));
++ dst->e_shnum = H_GET_16 (abfd, SRC (e_shnum));
++ dst->e_shstrndx = H_GET_16 (abfd, SRC (e_shstrndx));
++
++#undef SRC
++}
++
++/* Translate an ELF program header table entry in external format into an
++ ELF program header table entry in internal format. */
++
++static void
++elf_swap_phdr_in (bfd *abfd,
++ const Elf64_External_Phdr *src64,
++ Elf_Internal_Phdr *dst)
++{
++ int is64 = bfd_get_arch_size (abfd) == 64;
++#define SRC(field) (is64 ? src64->field \
++ : ((const Elf32_External_Phdr *) src64)->field)
++
++ int signed_vma = get_elf_backend_data (abfd)->sign_extend_vma;
++
++ dst->p_type = H_GET_32 (abfd, SRC (p_type));
++ dst->p_flags = H_GET_32 (abfd, SRC (p_flags));
++ dst->p_offset = H_GET_WORD (abfd, SRC (p_offset));
++ if (signed_vma)
++ {
++ dst->p_vaddr = H_GET_SIGNED_WORD (abfd, SRC (p_vaddr));
++ dst->p_paddr = H_GET_SIGNED_WORD (abfd, SRC (p_paddr));
++ }
++ else
++ {
++ dst->p_vaddr = H_GET_WORD (abfd, SRC (p_vaddr));
++ dst->p_paddr = H_GET_WORD (abfd, SRC (p_paddr));
++ }
++ dst->p_filesz = H_GET_WORD (abfd, SRC (p_filesz));
++ dst->p_memsz = H_GET_WORD (abfd, SRC (p_memsz));
++ dst->p_align = H_GET_WORD (abfd, SRC (p_align));
++
++#undef SRC
++}
++
++#undef H_GET_SIGNED_WORD
++#undef H_GET_WORD
++
++static Elf_Internal_Phdr *
++elf_get_phdr (bfd *templ, bfd_vma ehdr_vma, unsigned *e_phnum_pointer,
++ bfd_vma *loadbase_pointer)
++{
++ /* sizeof (Elf64_External_Ehdr) >= sizeof (Elf32_External_Ehdr) */
++ Elf64_External_Ehdr x_ehdr64; /* Elf file header, external form */
++ Elf_Internal_Ehdr i_ehdr; /* Elf file header, internal form */
++ bfd_size_type x_phdrs_size;
++ gdb_byte *x_phdrs_ptr;
++ Elf_Internal_Phdr *i_phdrs;
++ int err;
++ unsigned int i;
++ bfd_vma loadbase;
++ int loadbase_set;
++
++ gdb_assert (templ != NULL);
++ gdb_assert (sizeof (Elf64_External_Ehdr) >= sizeof (Elf32_External_Ehdr));
++
++ /* Read in the ELF header in external format. */
++ err = target_read_memory (ehdr_vma, (bfd_byte *) &x_ehdr64, sizeof x_ehdr64);
++ if (err)
++ {
++ if (build_id_verbose >= BUILD_ID_VERBOSE_BINARY_PARSE)
++ warning (_("build-id: Error reading ELF header at address 0x%lx"),
++ (unsigned long) ehdr_vma);
++ return NULL;
++ }
++
++ /* Now check to see if we have a valid ELF file, and one that BFD can
++ make use of. The magic number must match, the address size ('class')
++ and byte-swapping must match our XVEC entry. */
++
++ if (! elf_file_p (&x_ehdr64)
++ || x_ehdr64.e_ident[EI_VERSION] != EV_CURRENT
++ || !((bfd_get_arch_size (templ) == 64
++ && x_ehdr64.e_ident[EI_CLASS] == ELFCLASS64)
++ || (bfd_get_arch_size (templ) == 32
++ && x_ehdr64.e_ident[EI_CLASS] == ELFCLASS32)))
++ {
++ if (build_id_verbose >= BUILD_ID_VERBOSE_BINARY_PARSE)
++ warning (_("build-id: Unrecognized ELF header at address 0x%lx"),
++ (unsigned long) ehdr_vma);
++ return NULL;
++ }
++
++ /* Check that file's byte order matches xvec's */
++ switch (x_ehdr64.e_ident[EI_DATA])
++ {
++ case ELFDATA2MSB: /* Big-endian */
++ if (! bfd_header_big_endian (templ))
++ {
++ if (build_id_verbose >= BUILD_ID_VERBOSE_BINARY_PARSE)
++ warning (_("build-id: Unrecognized "
++ "big-endian ELF header at address 0x%lx"),
++ (unsigned long) ehdr_vma);
++ return NULL;
++ }
++ break;
++ case ELFDATA2LSB: /* Little-endian */
++ if (! bfd_header_little_endian (templ))
++ {
++ if (build_id_verbose >= BUILD_ID_VERBOSE_BINARY_PARSE)
++ warning (_("build-id: Unrecognized "
++ "little-endian ELF header at address 0x%lx"),
++ (unsigned long) ehdr_vma);
++ return NULL;
++ }
++ break;
++ case ELFDATANONE: /* No data encoding specified */
++ default: /* Unknown data encoding specified */
++ if (build_id_verbose >= BUILD_ID_VERBOSE_BINARY_PARSE)
++ warning (_("build-id: Unrecognized "
++ "ELF header endianity at address 0x%lx"),
++ (unsigned long) ehdr_vma);
++ return NULL;
++ }
++
++ elf_swap_ehdr_in (templ, &x_ehdr64, &i_ehdr);
++
++ /* The file header tells where to find the program headers.
++ These are what we use to actually choose what to read. */
++
++ if (i_ehdr.e_phentsize != (bfd_get_arch_size (templ) == 64
++ ? sizeof (Elf64_External_Phdr)
++ : sizeof (Elf32_External_Phdr))
++ || i_ehdr.e_phnum == 0)
++ {
++ if (build_id_verbose >= BUILD_ID_VERBOSE_BINARY_PARSE)
++ warning (_("build-id: Invalid ELF program headers from the ELF header "
++ "at address 0x%lx"), (unsigned long) ehdr_vma);
++ return NULL;
++ }
++
++ x_phdrs_size = (bfd_get_arch_size (templ) == 64 ? sizeof (Elf64_External_Phdr)
++ : sizeof (Elf32_External_Phdr));
++
++ i_phdrs = (Elf_Internal_Phdr *) xmalloc (i_ehdr.e_phnum * (sizeof *i_phdrs + x_phdrs_size));
++ x_phdrs_ptr = (gdb_byte *) &i_phdrs[i_ehdr.e_phnum];
++ err = target_read_memory (ehdr_vma + i_ehdr.e_phoff, (bfd_byte *) x_phdrs_ptr,
++ i_ehdr.e_phnum * x_phdrs_size);
++ if (err)
++ {
++ free (i_phdrs);
++ if (build_id_verbose >= BUILD_ID_VERBOSE_BINARY_PARSE)
++ warning (_("build-id: Error reading "
++ "ELF program headers at address 0x%lx"),
++ (unsigned long) (ehdr_vma + i_ehdr.e_phoff));
++ return NULL;
++ }
++
++ loadbase = ehdr_vma;
++ loadbase_set = 0;
++ for (i = 0; i < i_ehdr.e_phnum; ++i)
++ {
++ elf_swap_phdr_in (templ, (Elf64_External_Phdr *)
++ (x_phdrs_ptr + i * x_phdrs_size), &i_phdrs[i]);
++ /* IA-64 vDSO may have two mappings for one segment, where one mapping
++ is executable only, and one is read only. We must not use the
++ executable one (PF_R is the first one, PF_X the second one). */
++ if (i_phdrs[i].p_type == PT_LOAD && (i_phdrs[i].p_flags & PF_R))
++ {
++ /* Only the first PT_LOAD segment indicates the file bias.
++ Next segments may have P_VADDR arbitrarily higher.
++ If the first segment has P_VADDR zero any next segment must not
++ confuse us, the first one sets LOADBASE certainly enough. */
++ if (!loadbase_set && i_phdrs[i].p_offset == 0)
++ {
++ loadbase = ehdr_vma - i_phdrs[i].p_vaddr;
++ loadbase_set = 1;
++ }
++ }
++ }
++
++ if (build_id_verbose >= BUILD_ID_VERBOSE_BINARY_PARSE)
++ warning (_("build-id: Found ELF header at address 0x%lx, loadbase 0x%lx"),
++ (unsigned long) ehdr_vma, (unsigned long) loadbase);
++
++ *e_phnum_pointer = i_ehdr.e_phnum;
++ *loadbase_pointer = loadbase;
++ return i_phdrs;
++}
++
++/* BUILD_ID_ADDR_GET gets ADDR located somewhere in the object.
++ Find the first section before ADDR containing an ELF header.
++ We rely on the fact the sections from multiple files do not mix.
++ FIXME: We should check ADDR is contained _inside_ the section with possibly
++ missing content (P_FILESZ < P_MEMSZ). These omitted sections are currently
++ hidden by _BFD_ELF_MAKE_SECTION_FROM_PHDR. */
++
++static CORE_ADDR build_id_addr;
++struct build_id_addr_sect
++ {
++ struct build_id_addr_sect *next;
++ asection *sect;
++ };
++static struct build_id_addr_sect *build_id_addr_sect;
++
++static void build_id_addr_candidate (bfd *abfd, asection *sect, void *obj)
++{
++ if (build_id_addr >= bfd_section_vma (abfd, sect))
++ {
++ struct build_id_addr_sect *candidate;
++
++ candidate = (struct build_id_addr_sect *) xmalloc (sizeof *candidate);
++ candidate->next = build_id_addr_sect;
++ build_id_addr_sect = candidate;
++ candidate->sect = sect;
++ }
++}
++
++struct bfd_build_id *
++build_id_addr_get (CORE_ADDR addr)
++{
++ struct build_id_addr_sect *candidate;
++ struct bfd_build_id *retval = NULL;
++ Elf_Internal_Phdr *i_phdr = NULL;
++ bfd_vma loadbase = 0;
++ unsigned e_phnum = 0;
++
++ if (core_bfd == NULL)
++ return NULL;
++
++ build_id_addr = addr;
++ gdb_assert (build_id_addr_sect == NULL);
++ bfd_map_over_sections (core_bfd, build_id_addr_candidate, NULL);
++
++ /* Sections are sorted in the high-to-low VMAs order.
++ Stop the search on the first ELF header we find.
++ Do not continue the search even if it does not contain NT_GNU_BUILD_ID. */
++
++ for (candidate = build_id_addr_sect; candidate != NULL;
++ candidate = candidate->next)
++ {
++ i_phdr = elf_get_phdr (core_bfd,
++ bfd_section_vma (core_bfd, candidate->sect),
++ &e_phnum, &loadbase);
++ if (i_phdr != NULL)
++ break;
++ }
++
++ if (i_phdr != NULL)
++ {
++ retval = build_id_phdr_get (core_bfd, loadbase, e_phnum, i_phdr);
++ xfree (i_phdr);
++ }
++
++ while (build_id_addr_sect != NULL)
++ {
++ candidate = build_id_addr_sect;
++ build_id_addr_sect = candidate->next;
++ xfree (candidate);
++ }
++
++ return retval;
++}
++
+ /* See build-id.h. */
+
+ int
+@@ -50,7 +448,7 @@ build_id_verify (bfd *abfd, size_t check
+ const struct bfd_build_id *found;
+ int retval = 0;
+
+- found = build_id_bfd_get (abfd);
++ found = build_id_bfd_shdr_get (abfd);
+
+ if (found == NULL)
+ warning (_("File \"%s\" has no build-id, file skipped"),
+@@ -65,23 +463,57 @@ build_id_verify (bfd *abfd, size_t check
+ return retval;
+ }
+
++static char *
++link_resolve (const char *symlink, int level)
++{
++ char buf[PATH_MAX + 1], *target, *retval;
++ ssize_t got;
++
++ if (level > 10)
++ return xstrdup (symlink);
++
++ got = readlink (symlink, buf, sizeof (buf));
++ if (got < 0 || got >= sizeof (buf))
++ return xstrdup (symlink);
++ buf[got] = '\0';
++
++ if (IS_ABSOLUTE_PATH (buf))
++ target = xstrdup (buf);
++ else
++ {
++ const std::string dir (ldirname (symlink));
++
++ target = xstrprintf ("%s"
++#ifndef HAVE_DOS_BASED_FILE_SYSTEM
++ "/"
++#else /* HAVE_DOS_BASED_FILE_SYSTEM */
++ "\\"
++#endif /* HAVE_DOS_BASED_FILE_SYSTEM */
++ "%s", dir.c_str(), buf);
++ }
++
++ retval = link_resolve (target, level + 1);
++ xfree (target);
++ return retval;
++}
++
+ /* 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, int add_debug_suffix)
+ {
++ gdb::unique_xmalloc_ptr<char> ulink;
++ std::string link_all;
+ char *link, *debugdir;
+ VEC (char_ptr) *debugdir_vec;
+ struct cleanup *back_to;
+ int ix;
+ gdb_bfd_ref_ptr abfd;
+- int alloc_len;
+
+ /* DEBUG_FILE_DIRECTORY/.build-id/ab/cdef */
+- alloc_len = (strlen (debug_file_directory)
+- + (sizeof "/.build-id/" - 1) + 1
+- + 2 * build_id_len + (sizeof ".debug" - 1) + 1);
+- link = (char *) alloca (alloc_len);
++ link = ((char *) xmalloc (strlen (debug_file_directory) + 2 * build_id_len + 50));
++ ulink.reset (link);
+
+ /* Keep backward compatibility so that DEBUG_FILE_DIRECTORY being "" will
+ cause "/.build-id/..." lookups. */
+@@ -94,7 +526,11 @@ build_id_to_debug_bfd (size_t build_id_l
+ size_t debugdir_len = strlen (debugdir);
+ const gdb_byte *data = build_id;
+ size_t size = build_id_len;
++ unsigned int seqno;
++ struct stat statbuf_trash;
+ char *s;
++ gdb::unique_xmalloc_ptr<char> link0;
++ gdb::unique_xmalloc_ptr<char> link0_resolved;
+
+ memcpy (link, debugdir, debugdir_len);
+ s = &link[debugdir_len];
+@@ -108,51 +544,270 @@ build_id_to_debug_bfd (size_t build_id_l
+ *s++ = '/';
+ while (size-- > 0)
+ s += sprintf (s, "%02x", (unsigned) *data++);
+- strcpy (s, ".debug");
+
+ if (separate_debug_file_debug)
+ printf_unfiltered (_(" Trying %s\n"), link);
+
+- /* lrealpath() is expensive even for the usually non-existent files. */
+- gdb::unique_xmalloc_ptr<char> filename;
+- if (access (link, F_OK) == 0)
+- filename.reset (lrealpath (link));
++ for (seqno = 0;; seqno++)
++ {
++ gdb::unique_xmalloc_ptr<char> filename;
++ char *s2;
+
+- if (filename == NULL)
+- continue;
++ if (seqno)
++ {
++ /* There can be multiple build-id symlinks pointing to real files
++ with the same build-id (such as hard links). Some of the real
++ files may not be installed. */
++
++ s2 = s + sprintf (s, ".%u", seqno);
++ }
++ else
++ s2 = s;
++
++ if (add_debug_suffix)
++ strcpy (s2, ".debug");
++ else
++ *s2 = 0;
++
++ if (!seqno)
++ {
++ /* If none of the real files is found report as missing file
++ always the non-.%u-suffixed file. */
++ link0.reset (xstrdup (link));
++ }
++
++ /* `access' automatically dereferences LINK. */
++ if (lstat (link, &statbuf_trash) != 0)
++ {
++ /* Stop increasing SEQNO. */
++ break;
++ }
++
++ /* lrealpath() is expensive even for the non-existent files. */
++ filename.reset (lrealpath (link));
++ if (filename == NULL)
++ continue;
++
++ abfd = gdb_bfd_open (filename.get (), gnutarget, -1);
+
+- /* We expect to be silent on the non-existing files. */
+- abfd = gdb_bfd_open (filename.get (), gnutarget, -1);
++ if (abfd == NULL)
++ continue;
+
+- if (abfd == NULL)
+- continue;
++ if (build_id_verify (abfd.get (), build_id_len, build_id))
++ break;
+
+- if (build_id_verify (abfd.get(), build_id_len, build_id))
+- break;
++ abfd.release ();
++ }
+
+- abfd.release ();
++ /* If the symlink has target request to install the target.
++ BASE-debuginfo.rpm contains the symlink but BASE.rpm may be missing.
++ https://bugzilla.redhat.com/show_bug.cgi?id=981154 */
++ link0_resolved.reset (link_resolve (link0.get (), 0));
++
++ /* Use whitespace instead of DIRNAME_SEPARATOR to be compatible with
++ its possible use as an argument for installation command. */
++ if (link_all.length () != 0)
++ link_all += ' ';
++ link_all += link0_resolved.get ();
++ }
++
++ if (link_return != NULL)
++ {
++ if (abfd != NULL)
++ *link_return = ulink.release ();
++ else
++ *link_return = xstrdup (link_all.c_str ());
+ }
+
+ do_cleanups (back_to);
+ return abfd;
+ }
+
++char *
++build_id_to_filename (const struct bfd_build_id *build_id, char **link_return)
++{
++ gdb_bfd_ref_ptr abfd;
++ char *result;
++
++ abfd = build_id_to_debug_bfd (build_id->size, build_id->data, link_return, 0);
++ if (abfd == NULL)
++ return NULL;
++
++ result = xstrdup (bfd_get_filename (abfd));
++ abfd.release ();
++ return result;
++}
++
++/* This MISSING_FILEPAIR_HASH tracker is used only for the duplicite messages
++ Try to install the hash file ...
++ avoidance. */
++
++struct missing_filepair
++ {
++ char *binary;
++ char *debug;
++ char data[1];
++ };
++
++static struct htab *missing_filepair_hash;
++static struct obstack missing_filepair_obstack;
++
++static void *
++missing_filepair_xcalloc (size_t nmemb, size_t nmemb_size)
++{
++ void *retval;
++ size_t size = nmemb * nmemb_size;
++
++ retval = obstack_alloc (&missing_filepair_obstack, size);
++ memset (retval, 0, size);
++ return retval;
++}
++
++static hashval_t
++missing_filepair_hash_func (const struct missing_filepair *elem)
++{
++ hashval_t retval = 0;
++
++ retval ^= htab_hash_string (elem->binary);
++ if (elem->debug != NULL)
++ retval ^= htab_hash_string (elem->debug);
++
++ return retval;
++}
++
++static int
++missing_filepair_eq (const struct missing_filepair *elem1,
++ const struct missing_filepair *elem2)
++{
++ return strcmp (elem1->binary, elem2->binary) == 0
++ && ((elem1->debug == NULL) == (elem2->debug == NULL))
++ && (elem1->debug == NULL || strcmp (elem1->debug, elem2->debug) == 0);
++}
++
++static void
++missing_filepair_change (void)
++{
++ if (missing_filepair_hash != NULL)
++ {
++ obstack_free (&missing_filepair_obstack, NULL);
++ /* All their memory came just from missing_filepair_OBSTACK. */
++ missing_filepair_hash = NULL;
++ }
++}
++
++static void
++debug_print_executable_changed (void)
++{
++ missing_filepair_change ();
++}
++
++/* Notify user the file BINARY with (possibly NULL) associated separate debug
++ information file DEBUG is missing. DEBUG may or may not be the build-id
++ file such as would be:
++ /usr/lib/debug/.build-id/dd/b1d2ce632721c47bb9e8679f369e2295ce71be.debug
++ */
++
++void
++debug_print_missing (const char *binary, const char *debug)
++{
++ size_t binary_len0 = strlen (binary) + 1;
++ size_t debug_len0 = debug ? strlen (debug) + 1 : 0;
++ struct missing_filepair missing_filepair_find;
++ struct missing_filepair *missing_filepair;
++ struct missing_filepair **slot;
++
++ if (build_id_verbose < BUILD_ID_VERBOSE_FILENAMES)
++ return;
++
++ if (missing_filepair_hash == NULL)
++ {
++ obstack_init (&missing_filepair_obstack);
++ missing_filepair_hash = htab_create_alloc (64,
++ (hashval_t (*) (const void *)) missing_filepair_hash_func,
++ (int (*) (const void *, const void *)) missing_filepair_eq, NULL,
++ missing_filepair_xcalloc, NULL);
++ }
++
++ /* Use MISSING_FILEPAIR_FIND first instead of calling obstack_alloc with
++ obstack_free in the case of a (rare) match. The problem is ALLOC_F for
++ MISSING_FILEPAIR_HASH allocates from MISSING_FILEPAIR_OBSTACK maintenance
++ structures for MISSING_FILEPAIR_HASH. Calling obstack_free would possibly
++ not to free only MISSING_FILEPAIR but also some such structures (allocated
++ during the htab_find_slot call). */
++
++ missing_filepair_find.binary = (char *) binary;
++ missing_filepair_find.debug = (char *) debug;
++ slot = (struct missing_filepair **) htab_find_slot (missing_filepair_hash,
++ &missing_filepair_find,
++ INSERT);
++
++ /* While it may be still printed duplicitely with the missing debuginfo file
++ * it is due to once printing about the binary file build-id link and once
++ * about the .debug file build-id link as both the build-id symlinks are
++ * located in the debuginfo package. */
++
++ if (*slot != NULL)
++ return;
++
++ missing_filepair = (struct missing_filepair *) obstack_alloc (&missing_filepair_obstack,
++ sizeof (*missing_filepair) - 1
++ + binary_len0 + debug_len0);
++ missing_filepair->binary = missing_filepair->data;
++ memcpy (missing_filepair->binary, binary, binary_len0);
++ if (debug != NULL)
++ {
++ missing_filepair->debug = missing_filepair->binary + binary_len0;
++ memcpy (missing_filepair->debug, debug, debug_len0);
++ }
++ else
++ missing_filepair->debug = NULL;
++
++ *slot = missing_filepair;
++
++ /* We do not collect and flush these messages as each such message
++ already requires its own separate lines. */
++
++ 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);
++}
++
++
+ /* See build-id.h. */
+
+ char *
+-find_separate_debug_file_by_buildid (struct objfile *objfile)
++find_separate_debug_file_by_buildid (struct objfile *objfile,
++ gdb::unique_xmalloc_ptr<char> *build_id_filename_return)
+ {
+ const struct bfd_build_id *build_id;
+
+- build_id = build_id_bfd_get (objfile->obfd);
++ if (build_id_filename_return)
++ *build_id_filename_return = NULL;
++
++ build_id = build_id_bfd_shdr_get (objfile->obfd);
+ if (build_id != NULL)
+ {
+ if (separate_debug_file_debug)
+ printf_unfiltered (_("\nLooking for separate debug info (build-id) for "
+ "%s\n"), objfile_name (objfile));
+
++ char *build_id_filename_cstr = NULL;
+ 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));
++ if (build_id_filename_return)
++ {
++ if (!build_id_filename_cstr)
++ gdb_assert (!*build_id_filename_return);
++ else
++ {
++ *build_id_filename_return = gdb::unique_xmalloc_ptr<char> (build_id_filename_cstr);
++ build_id_filename_cstr = NULL;
++ }
++ }
++
+ /* Prevent looping on a stripped .debug file. */
+ if (abfd != NULL
+ && filename_cmp (bfd_get_filename (abfd.get ()),
+@@ -164,3 +819,21 @@ find_separate_debug_file_by_buildid (str
+ }
+ return NULL;
+ }
++
++extern void _initialize_build_id (void);
++
++void
++_initialize_build_id (void)
++{
++ add_setshow_zinteger_cmd ("build-id-verbose", no_class, &build_id_verbose,
++ _("\
++Set debugging level of the build-id locator."), _("\
++Show debugging level of the build-id locator."), _("\
++Level 1 (default) enables printing the missing debug filenames,\n\
++level 2 also prints the parsing of binaries to find the identificators."),
++ NULL,
++ show_build_id_verbose,
++ &setlist, &showlist);
++
++ observer_attach_executable_changed (debug_print_executable_changed);
++}
+diff -Naurp insight-8.1.50.20180216.orig/gdb/build-id.h insight-8.1.50.20180216.new/gdb/build-id.h
+--- insight-8.1.50.20180216.orig/gdb/build-id.h 2018-01-04 17:43:15.000000000 +0100
++++ insight-8.1.50.20180216.new/gdb/build-id.h 2018-02-16 18:22:10.082959421 +0100
+@@ -22,9 +22,10 @@
+
+ #include "gdb_bfd.h"
+
+-/* Locate NT_GNU_BUILD_ID from ABFD and return its content. */
++/* Separate debuginfo files have corrupted PHDR but SHDR is correct there.
++ Locate NT_GNU_BUILD_ID from ABFD and return its content. */
+
+-extern const struct bfd_build_id *build_id_bfd_get (bfd *abfd);
++extern const struct bfd_build_id *build_id_bfd_shdr_get (bfd *abfd);
+
+ /* Return true if ABFD has NT_GNU_BUILD_ID matching the CHECK value.
+ Otherwise, issue a warning and return false. */
+@@ -38,13 +39,19 @@ extern int build_id_verify (bfd *abfd,
+ the caller. */
+
+ 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);
++
++extern char *build_id_to_filename (const struct bfd_build_id *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 a malloc'd
+ file name for the separate debug file. The caller must free this.
+ Otherwise, returns NULL. */
+
+-extern char *find_separate_debug_file_by_buildid (struct objfile *objfile);
++extern char *find_separate_debug_file_by_buildid (struct objfile *objfile,
++ gdb::unique_xmalloc_ptr<char> *build_id_filename_return);
+
+ #endif /* BUILD_ID_H */
+diff -Naurp insight-8.1.50.20180216.orig/gdb/coffread.c insight-8.1.50.20180216.new/gdb/coffread.c
+--- insight-8.1.50.20180216.orig/gdb/coffread.c 2018-01-04 17:43:15.000000000 +0100
++++ insight-8.1.50.20180216.new/gdb/coffread.c 2018-02-16 18:22:10.082959421 +0100
+@@ -735,7 +735,7 @@ coff_symfile_read (struct objfile *objfi
+ {
+ char *debugfile;
+
+- debugfile = find_separate_debug_file_by_buildid (objfile);
++ debugfile = find_separate_debug_file_by_buildid (objfile, NULL);
+
+ if (debugfile == NULL)
+ debugfile = find_separate_debug_file_by_debuglink (objfile);
+diff -Naurp insight-8.1.50.20180216.orig/gdb/corelow.c insight-8.1.50.20180216.new/gdb/corelow.c
+--- insight-8.1.50.20180216.orig/gdb/corelow.c 2018-01-26 13:46:47.000000000 +0100
++++ insight-8.1.50.20180216.new/gdb/corelow.c 2018-02-16 18:22:10.082959421 +0100
+@@ -45,6 +45,10 @@
+ #include "gdb_bfd.h"
+ #include "completer.h"
+ #include "filestuff.h"
++#include "auxv.h"
++#include "elf/common.h"
++#include "gdbcmd.h"
++#include "build-id.h"
+
+ #ifndef O_LARGEFILE
+ #define O_LARGEFILE 0
+@@ -264,6 +268,54 @@ add_to_thread_list (bfd *abfd, asection
+ 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, *debug_filename;
++ char *build_id_filename;
++ struct cleanup *back_to;
++
++ if (exec_bfd != NULL || symfile_objfile != NULL)
++ return;
++
++ if (target_auxv_search (¤t_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. */
++}
++
+ /* This routine opens and sets up the core file bfd. */
+
+ static void
+@@ -391,6 +443,14 @@ core_open (const char *arg, int from_tty
+ switch_to_thread (thread->ptid);
+ }
+
++ /* 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 (&core_ops, from_tty);
+
+ /* Now go through the target stack looking for threads since there
+@@ -1038,4 +1098,11 @@ _initialize_corelow (void)
+ init_core_ops ();
+
+ add_target_with_completer (&core_ops, filename_completer);
++
++ add_setshow_boolean_cmd ("build-id-core-loads", class_files,
++ &build_id_core_loads, _("\
++Set whether CORE-FILE loads the build-id associated files automatically."), _("\
++Show whether CORE-FILE loads the build-id associated files automatically."),
++ NULL, NULL, NULL,
++ &setlist, &showlist);
+ }
+diff -Naurp insight-8.1.50.20180216.orig/gdb/doc/gdb.texinfo insight-8.1.50.20180216.new/gdb/doc/gdb.texinfo
+--- insight-8.1.50.20180216.orig/gdb/doc/gdb.texinfo 2018-02-16 18:21:13.557408356 +0100
++++ insight-8.1.50.20180216.new/gdb/doc/gdb.texinfo 2018-02-16 18:22:10.090959499 +0100
+@@ -19447,6 +19447,27 @@ information files.
+
+ @end table
+
++You can also adjust the current verbosity of the @dfn{build id} locating.
++
++@table @code
++
++@kindex set build-id-verbose
++@item set build-id-verbose 0
++No additional messages are printed.
++
++@item set build-id-verbose 1
++Missing separate debug filenames are printed.
++
++@item set build-id-verbose 2
++Missing separate debug filenames are printed and also all the parsing of the
++binaries to find their @dfn{build id} content is printed.
++
++@kindex show build-id-verbose
++@item show build-id-verbose
++Show the current verbosity value for the @dfn{build id} content locating.
++
++@end table
++
+ @cindex @code{.gnu_debuglink} sections
+ @cindex debug link sections
+ A debug link is a special section of the executable file named
+diff -Naurp insight-8.1.50.20180216.orig/gdb/dwarf2read.c insight-8.1.50.20180216.new/gdb/dwarf2read.c
+--- insight-8.1.50.20180216.orig/gdb/dwarf2read.c 2018-02-16 18:21:13.577408551 +0100
++++ insight-8.1.50.20180216.new/gdb/dwarf2read.c 2018-02-16 18:22:10.095959548 +0100
+@@ -3000,7 +3000,7 @@ dwarf2_get_dwz_file (struct dwarf2_per_o
+ }
+
+ 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);
+
+ if (dwz_bfd == NULL)
+ error (_("could not find '.gnu_debugaltlink' file for %s"),
+diff -Naurp insight-8.1.50.20180216.orig/gdb/elfread.c insight-8.1.50.20180216.new/gdb/elfread.c
+--- insight-8.1.50.20180216.orig/gdb/elfread.c 2018-01-04 17:43:15.000000000 +0100
++++ insight-8.1.50.20180216.new/gdb/elfread.c 2018-02-16 18:22:10.095959548 +0100
+@@ -1259,8 +1259,9 @@ elf_symfile_read (struct objfile *objfil
+ && objfile->separate_debug_objfile == NULL
+ && objfile->separate_debug_objfile_backlink == NULL)
+ {
++ gdb::unique_xmalloc_ptr<char> build_id_filename;
+ gdb::unique_xmalloc_ptr<char> debugfile
+- (find_separate_debug_file_by_buildid (objfile));
++ (find_separate_debug_file_by_buildid (objfile, &build_id_filename));
+
+ if (debugfile == NULL)
+ debugfile.reset (find_separate_debug_file_by_debuglink (objfile));
+@@ -1272,6 +1273,10 @@ elf_symfile_read (struct objfile *objfil
+ symbol_file_add_separate (abfd.get (), debugfile.get (),
+ symfile_flags, objfile);
+ }
++ /* 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 ());
+ }
+ }
+
+diff -Naurp insight-8.1.50.20180216.orig/gdb/objfiles.h insight-8.1.50.20180216.new/gdb/objfiles.h
+--- insight-8.1.50.20180216.orig/gdb/objfiles.h 2018-01-04 17:43:15.000000000 +0100
++++ insight-8.1.50.20180216.new/gdb/objfiles.h 2018-02-16 18:22:10.095959548 +0100
+@@ -470,6 +470,10 @@ struct objfile
+ htab_t static_links {};
+ };
+
++/* This file was loaded according to the BUILD_ID_CORE_LOADS rules. */
++
++#define OBJF_BUILD_ID_CORE_LOADED static_cast<enum objfile_flag>(1 << 12)
++
+ /* Declarations for functions defined in objfiles.c */
+
+ extern struct gdbarch *get_objfile_arch (const struct objfile *);
+diff -Naurp insight-8.1.50.20180216.orig/gdb/python/py-objfile.c insight-8.1.50.20180216.new/gdb/python/py-objfile.c
+--- insight-8.1.50.20180216.orig/gdb/python/py-objfile.c 2018-01-04 17:43:15.000000000 +0100
++++ insight-8.1.50.20180216.new/gdb/python/py-objfile.c 2018-02-16 18:22:10.096959557 +0100
+@@ -137,7 +137,7 @@ objfpy_get_build_id (PyObject *self, voi
+
+ TRY
+ {
+- build_id = build_id_bfd_get (objfile->obfd);
++ build_id = build_id_bfd_shdr_get (objfile->obfd);
+ }
+ CATCH (except, RETURN_MASK_ALL)
+ {
+@@ -544,7 +544,7 @@ objfpy_lookup_objfile_by_build_id (const
+ /* Don't return separate debug files. */
+ if (objfile->separate_debug_objfile_backlink != NULL)
+ continue;
+- obfd_build_id = build_id_bfd_get (objfile->obfd);
++ obfd_build_id = build_id_bfd_shdr_get (objfile->obfd);
+ if (obfd_build_id == NULL)
+ continue;
+ if (objfpy_build_id_matches (obfd_build_id, build_id))
+diff -Naurp insight-8.1.50.20180216.orig/gdb/solib-svr4.c insight-8.1.50.20180216.new/gdb/solib-svr4.c
+--- insight-8.1.50.20180216.orig/gdb/solib-svr4.c 2018-01-12 03:18:43.000000000 +0100
++++ insight-8.1.50.20180216.new/gdb/solib-svr4.c 2018-02-17 03:30:39.527371372 +0100
+@@ -45,6 +45,7 @@
+ #include "auxv.h"
+ #include "gdb_bfd.h"
+ #include "probe.h"
++#include "build-id.h"
+
+ static struct link_map_offsets *svr4_fetch_link_map_offsets (void);
+ static int svr4_have_link_map_offsets (void);
+@@ -1387,9 +1388,52 @@ svr4_read_so_list (CORE_ADDR lm, CORE_AD
+ continue;
+ }
+
+- strncpy (newobj->so_name, buffer, SO_NAME_MAX_PATH_SIZE - 1);
+- newobj->so_name[SO_NAME_MAX_PATH_SIZE - 1] = '\0';
+- strcpy (newobj->so_original_name, newobj->so_name);
++ {
++ struct bfd_build_id *build_id;
++
++ strncpy (newobj->so_original_name, buffer, SO_NAME_MAX_PATH_SIZE - 1);
++ newobj->so_original_name[SO_NAME_MAX_PATH_SIZE - 1] = '\0';
++ /* May get overwritten below. */
++ strcpy (newobj->so_name, newobj->so_original_name);
++
++ build_id = build_id_addr_get (li->l_ld);
++ if (build_id != NULL)
++ {
++ char *name, *build_id_filename;
++
++ /* Missing the build-id matching separate debug info file
++ would be handled while SO_NAME gets loaded. */
++ name = build_id_to_filename (build_id, &build_id_filename);
++ if (name != NULL)
++ {
++ strncpy (newobj->so_name, name, SO_NAME_MAX_PATH_SIZE - 1);
++ newobj->so_name[SO_NAME_MAX_PATH_SIZE - 1] = '\0';
++ xfree (name);
++ }
++ else
++ {
++ debug_print_missing (newobj->so_name, build_id_filename);
++
++ /* In the case the main executable was found according to
++ its build-id (from a core file) prevent loading
++ a different build of a library with accidentally the
++ same SO_NAME.
++
++ It suppresses bogus backtraces (and prints "??" there
++ instead) if the on-disk files no longer match the
++ running program version. */
++
++ if (symfile_objfile != NULL
++ && (symfile_objfile->flags
++ & OBJF_BUILD_ID_CORE_LOADED) != 0)
++ newobj->so_name[0] = 0;
++ }
++
++ xfree (build_id_filename);
++ xfree (build_id);
++ }
++ }
++
+ xfree (buffer);
+
+ /* If this entry has no name, or its name matches the name
+diff -Naurp insight-8.1.50.20180216.orig/gdb/symfile.h insight-8.1.50.20180216.new/gdb/symfile.h
+--- insight-8.1.50.20180216.orig/gdb/symfile.h 2018-01-04 17:43:15.000000000 +0100
++++ insight-8.1.50.20180216.new/gdb/symfile.h 2018-02-16 18:22:10.097959567 +0100
+@@ -543,6 +543,10 @@ void expand_symtabs_matching
+ void map_symbol_filenames (symbol_filename_ftype *fun, void *data,
+ int need_fullname);
+
++/* 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);
++
+ /* From dwarf2read.c */
+
+ /* Names for a dwarf2 debugging section. The field NORMAL is the normal
+diff -Naurp insight-8.1.50.20180216.orig/gdb/testsuite/gdb.base/corefile.exp insight-8.1.50.20180216.new/gdb/testsuite/gdb.base/corefile.exp
+--- insight-8.1.50.20180216.orig/gdb/testsuite/gdb.base/corefile.exp 2018-01-04 17:43:15.000000000 +0100
++++ insight-8.1.50.20180216.new/gdb/testsuite/gdb.base/corefile.exp 2018-02-16 18:22:10.097959567 +0100
+@@ -311,3 +311,33 @@ gdb_test_multiple "core-file $corefile"
+ pass $test
+ }
+ }
++
++
++# Test auto-loading of binary files through build-id from the core file.
++set buildid [build_id_debug_filename_get $binfile]
++set wholetest "binfile found by build-id"
++if {$buildid == ""} {
++ untested "$wholetest (binary has no build-id)"
++} else {
++ gdb_exit
++ gdb_start
++
++ regsub {\.debug$} $buildid {} buildid
++ set debugdir [standard_output_file ${testfile}-debugdir]
++ file delete -force -- $debugdir
++ file mkdir $debugdir/[file dirname $buildid]
++ file copy $binfile $debugdir/$buildid
++
++ set test "show debug-file-directory"
++ gdb_test_multiple $test $test {
++ -re "The directory where separate debug symbols are searched for is \"(.*)\"\\.\r\n$gdb_prompt $" {
++ set debugdir_orig $expect_out(1,string)
++ pass $test
++ }
++ }
++ gdb_test_no_output "set debug-file-directory $debugdir:$debugdir_orig" "set debug-file-directory"
++ gdb_test "show build-id-core-loads" {Whether CORE-FILE loads the build-id associated files automatically is on\.}
++ gdb_test "core-file $corefile" "\r\nProgram terminated with .*" "core-file without executable"
++ gdb_test "info files" "Local exec file:\r\n\[ \t\]*`[string_to_regexp $debugdir/$buildid]', file type .*"
++ pass $wholetest
++}
+diff -Naurp insight-8.1.50.20180216.orig/gdb/testsuite/gdb.base/new-ui-pending-input.exp insight-8.1.50.20180216.new/gdb/testsuite/gdb.base/new-ui-pending-input.exp
+--- insight-8.1.50.20180216.orig/gdb/testsuite/gdb.base/new-ui-pending-input.exp 2018-01-04 17:43:15.000000000 +0100
++++ insight-8.1.50.20180216.new/gdb/testsuite/gdb.base/new-ui-pending-input.exp 2018-02-16 18:22:10.097959567 +0100
+@@ -62,6 +62,7 @@ proc test_command_line_new_ui_pending_in
+ set options ""
+ append options " -iex \"set height 0\""
+ append options " -iex \"set width 0\""
++ append options " -iex \"set build-id-verbose 0\""
+ append options " -iex \"new-ui console $extra_tty_name\""
+ append options " -ex \"b $bpline\""
+ append options " -ex \"run\""
+diff -Naurp insight-8.1.50.20180216.orig/gdb/testsuite/lib/gdb.exp insight-8.1.50.20180216.new/gdb/testsuite/lib/gdb.exp
+--- insight-8.1.50.20180216.orig/gdb/testsuite/lib/gdb.exp 2018-02-09 15:06:40.000000000 +0100
++++ insight-8.1.50.20180216.new/gdb/testsuite/lib/gdb.exp 2018-02-16 18:22:10.098959577 +0100
+@@ -1694,6 +1694,16 @@ proc default_gdb_start { } {
+ warning "Couldn't set the width to 0."
+ }
+ }
++ # Turn off the missing warnings as the testsuite does not expect it.
++ send_gdb "set build-id-verbose 0\n"
++ gdb_expect 10 {
++ -re "$gdb_prompt $" {
++ verbose "Disabled the missing debug infos warnings." 2
++ }
++ timeout {
++ warning "Could not disable the missing debug infos warnings.."
++ }
++ }
+ return 0
+ }
+
+diff -Naurp insight-8.1.50.20180216.orig/gdb/testsuite/lib/mi-support.exp insight-8.1.50.20180216.new/gdb/testsuite/lib/mi-support.exp
+--- insight-8.1.50.20180216.orig/gdb/testsuite/lib/mi-support.exp 2018-01-04 17:43:15.000000000 +0100
++++ insight-8.1.50.20180216.new/gdb/testsuite/lib/mi-support.exp 2018-02-16 18:22:10.098959577 +0100
+@@ -309,6 +309,16 @@ proc default_mi_gdb_start { args } {
+ warning "Couldn't set the width to 0."
+ }
+ }
++ # Turn off the missing warnings as the testsuite does not expect it.
++ send_gdb "190-gdb-set build-id-verbose 0\n"
++ gdb_expect 10 {
++ -re ".*190-gdb-set build-id-verbose 0\r\n190\\\^done\r\n$mi_gdb_prompt$" {
++ verbose "Disabled the missing debug infos warnings." 2
++ }
++ timeout {
++ warning "Could not disable the missing debug infos warnings.."
++ }
++ }
+
+ if { $separate_inferior_pty } {
+ mi_create_inferior_pty
diff --git a/insight-8.1-gdb-6.6-buildid-locate-core-as-arg.patch b/insight-8.1-gdb-6.6-buildid-locate-core-as-arg.patch
new file mode 100644
index 0000000..b8d0bf5
--- /dev/null
+++ b/insight-8.1-gdb-6.6-buildid-locate-core-as-arg.patch
@@ -0,0 +1,134 @@
+diff -Naurp insight-8.1.50.20180216.orig/gdb/common/common-exceptions.h insight-8.1.50.20180216.new/gdb/common/common-exceptions.h
+--- insight-8.1.50.20180216.orig/gdb/common/common-exceptions.h 2018-01-04 17:43:15.000000000 +0100
++++ insight-8.1.50.20180216.new/gdb/common/common-exceptions.h 2018-02-17 19:58:58.465929548 +0100
+@@ -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 -Naurp insight-8.1.50.20180216.orig/gdb/exec.c insight-8.1.50.20180216.new/gdb/exec.c
+--- insight-8.1.50.20180216.orig/gdb/exec.c 2018-02-16 15:19:06.000000000 +0100
++++ insight-8.1.50.20180216.new/gdb/exec.c 2018-02-17 20:00:04.064572871 +0100
+@@ -36,6 +36,7 @@
+ #include "gdb_bfd.h"
+ #include "gcore.h"
+ #include "source.h"
++#include "exceptions.h"
+
+ #include <fcntl.h>
+ #include "readline/readline.h"
+@@ -342,12 +343,27 @@ exec_file_attach (const char *filename,
+
+ if (!bfd_check_format_matches (exec_bfd, bfd_object, &matching))
+ {
++ int is_core;
++
++ /* If the user accidentally did "gdb core", print a useful
++ error message. Check it only after bfd_object has been checked as
++ a valid executable may get recognized for example also as
++ "trad-core". */
++ is_core = bfd_check_format (exec_bfd, bfd_core);
++
+ /* Make sure to close exec_bfd, or else "run" might try to use
+ it. */
+ exec_close ();
+- error (_("\"%s\": not in executable format: %s"),
+- scratch_pathname,
+- gdb_bfd_errmsg (bfd_get_error (), matching));
++
++ if (is_core != 0)
++ throw_error (IS_CORE_ERROR,
++ _("\"%s\" is a core file.\n"
++ "Please specify an executable to debug."),
++ scratch_pathname);
++ else
++ error (_("\"%s\": not in executable format: %s"),
++ scratch_pathname,
++ gdb_bfd_errmsg (bfd_get_error (), matching));
+ }
+
+ if (build_section_table (exec_bfd, §ions, §ions_end))
+diff -Naurp insight-8.1.50.20180216.orig/gdb/main.c insight-8.1.50.20180216.new/gdb/main.c
+--- insight-8.1.50.20180216.orig/gdb/main.c 2018-01-12 03:18:43.000000000 +0100
++++ insight-8.1.50.20180216.new/gdb/main.c 2018-02-17 19:58:58.466929557 +0100
+@@ -446,6 +446,37 @@ struct cmdarg
+ char *string;
+ };
+
++/* Call exec_file_attach. If it detected FILENAME is a core file call
++ core_file_command. Print the original exec_file_attach error only if
++ core_file_command failed to find a matching executable. */
++
++static void
++exec_or_core_file_attach (const char *filename, int from_tty)
++{
++ volatile struct gdb_exception e;
++
++ gdb_assert (exec_bfd == NULL);
++
++ TRY
++ {
++ exec_file_attach (filename, from_tty);
++ }
++ CATCH (e, RETURN_MASK_ALL)
++ {
++ if (e.error == IS_CORE_ERROR)
++ {
++ core_file_command ((char *) filename, from_tty);
++
++ /* Iff the core file found its executable suppress the error message
++ from exec_file_attach. */
++ if (exec_bfd != NULL)
++ return;
++ }
++ throw_exception (e);
++ }
++ END_CATCH
++}
++
+ static void
+ captured_main_1 (struct captured_main_args *context)
+ {
+@@ -882,6 +913,8 @@ captured_main_1 (struct captured_main_ar
+ {
+ symarg = argv[optind];
+ execarg = argv[optind];
++ if (optind + 1 == argc && corearg == NULL)
++ corearg = argv[optind];
+ optind++;
+ }
+
+@@ -1032,11 +1065,25 @@ captured_main_1 (struct captured_main_ar
+ && symarg != NULL
+ && strcmp (execarg, symarg) == 0)
+ {
++ catch_command_errors_const_ftype *func;
++
++ /* Call exec_or_core_file_attach only if the file was specified as
++ a command line argument (and not an a command line option). */
++ if (corearg != NULL && strcmp (corearg, execarg) == 0)
++ {
++ func = exec_or_core_file_attach;
++ corearg = NULL;
++ }
++ else
++ func = exec_file_attach;
++
+ /* The exec file and the symbol-file are the same. If we can't
+ open it, better only print one error message.
+- catch_command_errors returns non-zero on success! */
+- if (catch_command_errors (exec_file_attach, execarg,
+- !batch_flag))
++ catch_command_errors returns non-zero on success!
++ Do not load EXECARG as a symbol file if it has been already processed
++ as a core file. */
++ if (catch_command_errors (func, execarg, !batch_flag)
++ && core_bfd == NULL)
+ catch_command_errors (symbol_file_add_main_adapter, symarg,
+ !batch_flag);
+ }
diff --git a/insight-8.1-gdb-6.6-buildid-locate-rpm.patch b/insight-8.1-gdb-6.6-buildid-locate-rpm.patch
new file mode 100644
index 0000000..0d78ed7
--- /dev/null
+++ b/insight-8.1-gdb-6.6-buildid-locate-rpm.patch
@@ -0,0 +1,1505 @@
+diff -Naurp insight-8.1.50.20180216.orig/gdb/aclocal.m4 insight-8.1.50.20180216.new/gdb/aclocal.m4
+--- insight-8.1.50.20180216.orig/gdb/aclocal.m4 2018-02-16 15:40:17.000000000 +0100
++++ insight-8.1.50.20180216.new/gdb/aclocal.m4 2018-02-17 19:20:52.946384325 +0100
+@@ -12,6 +12,221 @@
+ # PARTICULAR PURPOSE.
+
+ m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])])
++# pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*-
++# serial 1 (pkg-config-0.24)
++#
++# Copyright © 2004 Scott James Remnant <scott(a)netsplit.com>.
++#
++# This program is free software; you can redistribute it and/or modify
++# it under the terms of the GNU General Public License as published by
++# the Free Software Foundation; either version 2 of the License, or
++# (at your option) any later version.
++#
++# This program is distributed in the hope that it will be useful, but
++# WITHOUT ANY WARRANTY; without even the implied warranty of
++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++# General Public License for more details.
++#
++# You should have received a copy of the GNU General Public License
++# along with this program; if not, write to the Free Software
++# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
++#
++# As a special exception to the GNU General Public License, if you
++# distribute this file as part of a program that contains a
++# configuration script generated by Autoconf, you may include it under
++# the same distribution terms that you use for the rest of that program.
++
++# PKG_PROG_PKG_CONFIG([MIN-VERSION])
++# ----------------------------------
++AC_DEFUN([PKG_PROG_PKG_CONFIG],
++[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
++m4_pattern_allow([^PKG_CONFIG(_(PATH|LIBDIR|SYSROOT_DIR|ALLOW_SYSTEM_(CFLAGS|LIBS)))?$])
++m4_pattern_allow([^PKG_CONFIG_(DISABLE_UNINSTALLED|TOP_BUILD_DIR|DEBUG_SPEW)$])
++AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])
++AC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path])
++AC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path])
++
++if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
++ AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
++fi
++if test -n "$PKG_CONFIG"; then
++ _pkg_min_version=m4_default([$1], [0.9.0])
++ AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
++ if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
++ AC_MSG_RESULT([yes])
++ else
++ AC_MSG_RESULT([no])
++ PKG_CONFIG=""
++ fi
++fi[]dnl
++])# PKG_PROG_PKG_CONFIG
++
++# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
++#
++# Check to see whether a particular set of modules exists. Similar
++# to PKG_CHECK_MODULES(), but does not set variables or print errors.
++#
++# Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG])
++# only at the first occurence in configure.ac, so if the first place
++# it's called might be skipped (such as if it is within an "if", you
++# have to call PKG_CHECK_EXISTS manually
++# --------------------------------------------------------------
++AC_DEFUN([PKG_CHECK_EXISTS],
++[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
++if test -n "$PKG_CONFIG" && \
++ AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
++ m4_default([$2], [:])
++m4_ifvaln([$3], [else
++ $3])dnl
++fi])
++
++# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
++# ---------------------------------------------
++m4_define([_PKG_CONFIG],
++[if test -n "$$1"; then
++ pkg_cv_[]$1="$$1"
++ elif test -n "$PKG_CONFIG"; then
++ PKG_CHECK_EXISTS([$3],
++ [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`
++ test "x$?" != "x0" && pkg_failed=yes ],
++ [pkg_failed=yes])
++ else
++ pkg_failed=untried
++fi[]dnl
++])# _PKG_CONFIG
++
++# _PKG_SHORT_ERRORS_SUPPORTED
++# -----------------------------
++AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
++[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
++if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
++ _pkg_short_errors_supported=yes
++else
++ _pkg_short_errors_supported=no
++fi[]dnl
++])# _PKG_SHORT_ERRORS_SUPPORTED
++
++
++# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
++# [ACTION-IF-NOT-FOUND])
++#
++#
++# Note that if there is a possibility the first call to
++# PKG_CHECK_MODULES might not happen, you should be sure to include an
++# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
++#
++#
++# --------------------------------------------------------------
++AC_DEFUN([PKG_CHECK_MODULES],
++[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
++AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
++AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
++
++pkg_failed=no
++AC_MSG_CHECKING([for $1])
++
++_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
++_PKG_CONFIG([$1][_LIBS], [libs], [$2])
++
++m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
++and $1[]_LIBS to avoid the need to call pkg-config.
++See the pkg-config man page for more details.])
++
++if test $pkg_failed = yes; then
++ AC_MSG_RESULT([no])
++ _PKG_SHORT_ERRORS_SUPPORTED
++ if test $_pkg_short_errors_supported = yes; then
++ $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1`
++ else
++ $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1`
++ fi
++ # Put the nasty error message in config.log where it belongs
++ echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
++
++ m4_default([$4], [AC_MSG_ERROR(
++[Package requirements ($2) were not met:
++
++$$1_PKG_ERRORS
++
++Consider adjusting the PKG_CONFIG_PATH environment variable if you
++installed software in a non-standard prefix.
++
++_PKG_TEXT])[]dnl
++ ])
++elif test $pkg_failed = untried; then
++ AC_MSG_RESULT([no])
++ m4_default([$4], [AC_MSG_FAILURE(
++[The pkg-config script could not be found or is too old. Make sure it
++is in your PATH or set the PKG_CONFIG environment variable to the full
++path to pkg-config.
++
++_PKG_TEXT
++
++To get pkg-config, see <http://pkg-config.freedesktop.org/>.])[]dnl
++ ])
++else
++ $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
++ $1[]_LIBS=$pkg_cv_[]$1[]_LIBS
++ AC_MSG_RESULT([yes])
++ $3
++fi[]dnl
++])# PKG_CHECK_MODULES
++
++
++# PKG_INSTALLDIR(DIRECTORY)
++# -------------------------
++# Substitutes the variable pkgconfigdir as the location where a module
++# should install pkg-config .pc files. By default the directory is
++# $libdir/pkgconfig, but the default can be changed by passing
++# DIRECTORY. The user can override through the --with-pkgconfigdir
++# parameter.
++AC_DEFUN([PKG_INSTALLDIR],
++[m4_pushdef([pkg_default], [m4_default([$1], ['${libdir}/pkgconfig'])])
++m4_pushdef([pkg_description],
++ [pkg-config installation directory @<:@]pkg_default[@:>@])
++AC_ARG_WITH([pkgconfigdir],
++ [AS_HELP_STRING([--with-pkgconfigdir], pkg_description)],,
++ [with_pkgconfigdir=]pkg_default)
++AC_SUBST([pkgconfigdir], [$with_pkgconfigdir])
++m4_popdef([pkg_default])
++m4_popdef([pkg_description])
++]) dnl PKG_INSTALLDIR
++
++
++# PKG_NOARCH_INSTALLDIR(DIRECTORY)
++# -------------------------
++# Substitutes the variable noarch_pkgconfigdir as the location where a
++# module should install arch-independent pkg-config .pc files. By
++# default the directory is $datadir/pkgconfig, but the default can be
++# changed by passing DIRECTORY. The user can override through the
++# --with-noarch-pkgconfigdir parameter.
++AC_DEFUN([PKG_NOARCH_INSTALLDIR],
++[m4_pushdef([pkg_default], [m4_default([$1], ['${datadir}/pkgconfig'])])
++m4_pushdef([pkg_description],
++ [pkg-config arch-independent installation directory @<:@]pkg_default[@:>@])
++AC_ARG_WITH([noarch-pkgconfigdir],
++ [AS_HELP_STRING([--with-noarch-pkgconfigdir], pkg_description)],,
++ [with_noarch_pkgconfigdir=]pkg_default)
++AC_SUBST([noarch_pkgconfigdir], [$with_noarch_pkgconfigdir])
++m4_popdef([pkg_default])
++m4_popdef([pkg_description])
++]) dnl PKG_NOARCH_INSTALLDIR
++
++
++# PKG_CHECK_VAR(VARIABLE, MODULE, CONFIG-VARIABLE,
++# [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
++# -------------------------------------------
++# Retrieves the value of the pkg-config variable for the given module.
++AC_DEFUN([PKG_CHECK_VAR],
++[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
++AC_ARG_VAR([$1], [value of $3 for $2, overriding pkg-config])dnl
++
++_PKG_CONFIG([$1], [variable="][$3]["], [$2])
++AS_VAR_COPY([$1], [pkg_cv_][$1])
++
++AS_VAR_IF([$1], [""], [$5], [$4])dnl
++])# PKG_CHECK_VAR
++
+ # AM_AUX_DIR_EXPAND -*- Autoconf -*-
+
+ # Copyright (C) 2001-2017 Free Software Foundation, Inc.
+diff -Naurp insight-8.1.50.20180216.orig/gdb/build-id.c insight-8.1.50.20180216.new/gdb/build-id.c
+--- insight-8.1.50.20180216.orig/gdb/build-id.c 2018-02-17 19:16:18.244670409 +0100
++++ insight-8.1.50.20180216.new/gdb/build-id.c 2018-02-17 19:17:08.714168368 +0100
+@@ -35,6 +35,8 @@
+ #include "elf/common.h"
+ #include "elf-bfd.h"
+ #include <sys/stat.h>
++#include "elf/external.h"
++#include "inferior.h"
+
+ #define BUILD_ID_VERBOSE_NONE 0
+ #define BUILD_ID_VERBOSE_FILENAMES 1
+@@ -638,8 +640,366 @@ build_id_to_filename (const struct bfd_b
+ return result;
+ }
+
++#ifdef HAVE_LIBRPM
++
++#include <rpm/rpmlib.h>
++#include <rpm/rpmts.h>
++#include <rpm/rpmdb.h>
++#include <rpm/header.h>
++#ifdef DLOPEN_LIBRPM
++#include <dlfcn.h>
++#endif
++
++/* This MISSING_RPM_HASH tracker is used to collect all the missing rpm files
++ and avoid their duplicities during a single inferior run. */
++
++static struct htab *missing_rpm_hash;
++
++/* This MISSING_RPM_LIST tracker is used to collect and print as a single line
++ all the rpms right before the nearest GDB prompt. It gets cleared after
++ each such print (it is questionable if we should clear it after the print).
++ */
++
++struct missing_rpm
++ {
++ struct missing_rpm *next;
++ char rpm[1];
++ };
++static struct missing_rpm *missing_rpm_list;
++static int missing_rpm_list_entries;
++
++/* Returns the count of newly added rpms. */
++
++static int
++missing_rpm_enlist (const char *filename)
++{
++ static int rpm_init_done = 0;
++ rpmts ts;
++ rpmdbMatchIterator mi;
++ int count = 0;
++
++#ifdef DLOPEN_LIBRPM
++ /* Duplicate here the declarations to verify they match. The same sanity
++ check is present also in `configure.ac'. */
++ extern char * headerFormat(Header h, const char * fmt, errmsg_t * errmsg);
++ static char *(*headerFormat_p) (Header h, const char * fmt, errmsg_t *errmsg);
++ extern int rpmReadConfigFiles(const char * file, const char * target);
++ static int (*rpmReadConfigFiles_p) (const char * file, const char * target);
++ extern rpmdbMatchIterator rpmdbFreeIterator(rpmdbMatchIterator mi);
++ static rpmdbMatchIterator (*rpmdbFreeIterator_p) (rpmdbMatchIterator mi);
++ extern Header rpmdbNextIterator(rpmdbMatchIterator mi);
++ static Header (*rpmdbNextIterator_p) (rpmdbMatchIterator mi);
++ extern rpmts rpmtsCreate(void);
++ static rpmts (*rpmtsCreate_p) (void);
++ extern rpmts rpmtsFree(rpmts ts);
++ static rpmts (*rpmtsFree_p) (rpmts ts);
++ extern rpmdbMatchIterator rpmtsInitIterator(const rpmts ts, rpmTag rpmtag,
++ const void * keyp, size_t keylen);
++ static rpmdbMatchIterator (*rpmtsInitIterator_p) (const rpmts ts,
++ rpmTag rpmtag,
++ const void *keyp,
++ size_t keylen);
++#else /* !DLOPEN_LIBRPM */
++# define headerFormat_p headerFormat
++# define rpmReadConfigFiles_p rpmReadConfigFiles
++# define rpmdbFreeIterator_p rpmdbFreeIterator
++# define rpmdbNextIterator_p rpmdbNextIterator
++# define rpmtsCreate_p rpmtsCreate
++# define rpmtsFree_p rpmtsFree
++# define rpmtsInitIterator_p rpmtsInitIterator
++#endif /* !DLOPEN_LIBRPM */
++
++ gdb_assert (filename != NULL);
++
++ if (strcmp (filename, BUILD_ID_MAIN_EXECUTABLE_FILENAME) == 0)
++ return 0;
++
++ if (is_target_filename (filename))
++ return 0;
++
++ if (filename[0] != '/')
++ {
++ warning (_("Ignoring non-absolute filename: <%s>"), filename);
++ return 0;
++ }
++
++ if (!rpm_init_done)
++ {
++ static int init_tried;
++
++ /* Already failed the initialization before? */
++ if (init_tried)
++ return 0;
++ init_tried = 1;
++
++#ifdef DLOPEN_LIBRPM
++ {
++ void *h;
++
++ h = dlopen (DLOPEN_LIBRPM, RTLD_LAZY);
++ if (!h)
++ {
++ warning (_("Unable to open \"%s\" (%s), "
++ "missing debuginfos notifications will not be displayed"),
++ DLOPEN_LIBRPM, dlerror ());
++ return 0;
++ }
++
++ if (!((headerFormat_p = (char *(*) (Header h, const char * fmt, errmsg_t *errmsg)) dlsym (h, "headerFormat"))
++ && (rpmReadConfigFiles_p = (int (*) (const char * file, const char * target)) dlsym (h, "rpmReadConfigFiles"))
++ && (rpmdbFreeIterator_p = (rpmdbMatchIterator (*) (rpmdbMatchIterator mi)) dlsym (h, "rpmdbFreeIterator"))
++ && (rpmdbNextIterator_p = (Header (*) (rpmdbMatchIterator mi)) dlsym (h, "rpmdbNextIterator"))
++ && (rpmtsCreate_p = (rpmts (*) (void)) dlsym (h, "rpmtsCreate"))
++ && (rpmtsFree_p = (rpmts (*) (rpmts ts)) dlsym (h, "rpmtsFree"))
++ && (rpmtsInitIterator_p = (rpmdbMatchIterator (*) (const rpmts ts, rpmTag rpmtag, const void *keyp, size_t keylen)) dlsym (h, "rpmtsInitIterator"))))
++ {
++ warning (_("Opened library \"%s\" is incompatible (%s), "
++ "missing debuginfos notifications will not be displayed"),
++ DLOPEN_LIBRPM, dlerror ());
++ if (dlclose (h))
++ warning (_("Error closing library \"%s\": %s\n"), DLOPEN_LIBRPM,
++ dlerror ());
++ return 0;
++ }
++ }
++#endif /* DLOPEN_LIBRPM */
++
++ if (rpmReadConfigFiles_p (NULL, NULL) != 0)
++ {
++ warning (_("Error reading the rpm configuration files"));
++ return 0;
++ }
++
++ rpm_init_done = 1;
++ }
++
++ ts = rpmtsCreate_p ();
++
++ mi = rpmtsInitIterator_p (ts, RPMTAG_BASENAMES, filename, 0);
++ if (mi != NULL)
++ {
++ for (;;)
++ {
++ Header h;
++ char *debuginfo, **slot, *s, *s2;
++ errmsg_t err;
++ size_t srcrpmlen = sizeof (".src.rpm") - 1;
++ size_t debuginfolen = sizeof ("-debuginfo") - 1;
++ rpmdbMatchIterator mi_debuginfo;
++
++ h = rpmdbNextIterator_p (mi);
++ if (h == NULL)
++ break;
++
++ /* Verify the debuginfo file is not already installed. */
++
++ debuginfo = headerFormat_p (h, "%{sourcerpm}-debuginfo.%{arch}",
++ &err);
++ if (!debuginfo)
++ {
++ warning (_("Error querying the rpm file `%s': %s"), filename,
++ err);
++ continue;
++ }
++ /* s = `.src.rpm-debuginfo.%{arch}' */
++ s = strrchr (debuginfo, '-') - srcrpmlen;
++ s2 = NULL;
++ if (s > debuginfo && memcmp (s, ".src.rpm", srcrpmlen) == 0)
++ {
++ /* s2 = `-%{release}.src.rpm-debuginfo.%{arch}' */
++ s2 = (char *) memrchr (debuginfo, '-', s - debuginfo);
++ }
++ if (s2)
++ {
++ /* s2 = `-%{version}-%{release}.src.rpm-debuginfo.%{arch}' */
++ s2 = (char *) memrchr (debuginfo, '-', s2 - debuginfo);
++ }
++ if (!s2)
++ {
++ warning (_("Error querying the rpm file `%s': %s"), filename,
++ debuginfo);
++ xfree (debuginfo);
++ continue;
++ }
++ /* s = `.src.rpm-debuginfo.%{arch}' */
++ /* s2 = `-%{version}-%{release}.src.rpm-debuginfo.%{arch}' */
++ memmove (s2 + debuginfolen, s2, s - s2);
++ memcpy (s2, "-debuginfo", debuginfolen);
++ /* s = `XXXX.%{arch}' */
++ /* strlen ("XXXX") == srcrpmlen + debuginfolen */
++ /* s2 = `-debuginfo-%{version}-%{release}XX.%{arch}' */
++ /* strlen ("XX") == srcrpmlen */
++ memmove (s + debuginfolen, s + srcrpmlen + debuginfolen,
++ strlen (s + srcrpmlen + debuginfolen) + 1);
++ /* s = `-debuginfo-%{version}-%{release}.%{arch}' */
++
++ /* RPMDBI_PACKAGES requires keylen == sizeof (int). */
++ /* RPMDBI_LABEL is an interface for NVR-based dbiFindByLabel(). */
++ mi_debuginfo = rpmtsInitIterator_p (ts, (rpmTag) RPMDBI_LABEL, debuginfo, 0);
++ xfree (debuginfo);
++ if (mi_debuginfo)
++ {
++ rpmdbFreeIterator_p (mi_debuginfo);
++ count = 0;
++ break;
++ }
++
++ /* The allocated memory gets utilized below for MISSING_RPM_HASH. */
++ debuginfo = headerFormat_p (h,
++ "%{name}-%{version}-%{release}.%{arch}",
++ &err);
++ if (!debuginfo)
++ {
++ warning (_("Error querying the rpm file `%s': %s"), filename,
++ err);
++ continue;
++ }
++
++ /* Base package name for `debuginfo-install'. We do not use the
++ `yum' command directly as the line
++ yum --enablerepo='*debug*' install NAME-debuginfo.ARCH
++ would be more complicated than just:
++ debuginfo-install NAME-VERSION-RELEASE.ARCH
++ Do not supply the rpm base name (derived from .src.rpm name) as
++ debuginfo-install is unable to install the debuginfo package if
++ the base name PKG binary rpm is not installed while for example
++ PKG-libs would be installed (RH Bug 467901).
++ FUTURE: After multiple debuginfo versions simultaneously installed
++ get supported the support for the VERSION-RELEASE tags handling
++ may need an update. */
++
++ if (missing_rpm_hash == NULL)
++ {
++ /* DEL_F is passed NULL as MISSING_RPM_LIST's HTAB_DELETE
++ should not deallocate the entries. */
++
++ missing_rpm_hash = htab_create_alloc (64, htab_hash_string,
++ (int (*) (const void *, const void *)) streq,
++ NULL, xcalloc, xfree);
++ }
++ slot = (char **) htab_find_slot (missing_rpm_hash, debuginfo, INSERT);
++ /* XCALLOC never returns NULL. */
++ gdb_assert (slot != NULL);
++ if (*slot == NULL)
++ {
++ struct missing_rpm *missing_rpm;
++
++ *slot = debuginfo;
++
++ missing_rpm = (struct missing_rpm *) xmalloc (sizeof (*missing_rpm) + strlen (debuginfo));
++ strcpy (missing_rpm->rpm, debuginfo);
++ missing_rpm->next = missing_rpm_list;
++ missing_rpm_list = missing_rpm;
++ missing_rpm_list_entries++;
++ }
++ else
++ xfree (debuginfo);
++ count++;
++ }
++
++ rpmdbFreeIterator_p (mi);
++ }
++
++ rpmtsFree_p (ts);
++
++ return count;
++}
++
++static int
++missing_rpm_list_compar (const char *const *ap, const char *const *bp)
++{
++ return strcoll (*ap, *bp);
++}
++
++/* It returns a NULL-terminated array of strings needing to be FREEd. It may
++ also return only NULL. */
++
++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);
++
++ array_iter = array;
++ for (list_iter = missing_rpm_list; list_iter != NULL;
++ list_iter = list_iter->next)
++ {
++ *array_iter++ = list_iter->rpm;
++ }
++ gdb_assert (array_iter == array + missing_rpm_list_entries);
++
++ qsort (array, missing_rpm_list_entries, sizeof (*array),
++ (int (*) (const void *, const void *)) 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++)
++ {
++ putchar_unfiltered (' ');
++ puts_unfiltered (*array_iter);
++ }
++ putchar_unfiltered ('\n');
++
++ while (missing_rpm_list != NULL)
++ {
++ list_iter = missing_rpm_list;
++ missing_rpm_list = list_iter->next;
++ xfree (list_iter);
++ }
++ missing_rpm_list_entries = 0;
++
++ do_cleanups (cleanups);
++}
++
++static void
++missing_rpm_change (void)
++{
++ debug_flush_missing ();
++
++ gdb_assert (missing_rpm_list == NULL);
++ if (missing_rpm_hash != NULL)
++ {
++ htab_delete (missing_rpm_hash);
++ missing_rpm_hash = NULL;
++ }
++}
++
++enum missing_exec
++ {
++ /* Init state. EXEC_BFD also still could be NULL. */
++ MISSING_EXEC_NOT_TRIED,
++ /* We saw a non-NULL EXEC_BFD but RPM has no info about it. */
++ MISSING_EXEC_NOT_FOUND,
++ /* We found EXEC_BFD by RPM and we either have its symbols (either embedded
++ or separate) or the main executable's RPM is now contained in
++ MISSING_RPM_HASH. */
++ MISSING_EXEC_ENLISTED
++ };
++static enum missing_exec missing_exec = MISSING_EXEC_NOT_TRIED;
++
++#endif /* HAVE_LIBRPM */
++
++void
++debug_flush_missing (void)
++{
++#ifdef HAVE_LIBRPM
++ missing_rpm_list_print ();
++#endif
++}
++
+ /* This MISSING_FILEPAIR_HASH tracker is used only for the duplicite messages
+- Try to install the hash file ...
++ yum --enablerepo='*debug*' install ...
+ avoidance. */
+
+ struct missing_filepair
+@@ -693,11 +1053,17 @@ missing_filepair_change (void)
+ /* All their memory came just from missing_filepair_OBSTACK. */
+ missing_filepair_hash = NULL;
+ }
++#ifdef HAVE_LIBRPM
++ missing_exec = MISSING_EXEC_NOT_TRIED;
++#endif
+ }
+
+ static void
+ debug_print_executable_changed (void)
+ {
++#ifdef HAVE_LIBRPM
++ missing_rpm_change ();
++#endif
+ missing_filepair_change ();
+ }
+
+@@ -764,14 +1130,39 @@ debug_print_missing (const char *binary,
+
+ *slot = missing_filepair;
+
+- /* We do not collect and flush these messages as each such message
+- already requires its own separate lines. */
++#ifdef HAVE_LIBRPM
++ if (missing_exec == MISSING_EXEC_NOT_TRIED)
++ {
++ char *execfilename;
+
+- 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)
++ missing_exec = MISSING_EXEC_NOT_FOUND;
++ else
++ missing_exec = MISSING_EXEC_ENLISTED;
++ }
++ }
++ if (missing_exec != MISSING_EXEC_ENLISTED)
++ if ((binary[0] == 0 || missing_rpm_enlist (binary) == 0)
++ && (debug == NULL || missing_rpm_enlist (debug) == 0))
++#endif /* HAVE_LIBRPM */
++ {
++ /* We do not collect and flush these messages as each such message
++ already requires its own separate lines. */
++
++ fprintf_unfiltered (gdb_stdlog,
++ _("Missing separate debuginfo for %s\n"), binary);
++ if (debug != NULL)
++ fprintf_unfiltered (gdb_stdlog, _("Try: %s %s\n"),
++#ifdef DNF_DEBUGINFO_INSTALL
++ "dnf"
++#else
++ "yum"
++#endif
++ " --enablerepo='*debug*' install", debug);
++ }
+ }
+
+
+diff -Naurp insight-8.1.50.20180216.orig/gdb/config.in insight-8.1.50.20180216.new/gdb/config.in
+--- insight-8.1.50.20180216.orig/gdb/config.in 2018-02-02 13:28:13.000000000 +0100
++++ insight-8.1.50.20180216.new/gdb/config.in 2018-02-17 19:17:08.714168368 +0100
+@@ -33,6 +33,9 @@
+ /* Define to BFD's default target vector. */
+ #undef DEFAULT_BFD_VEC
+
++/* librpm version specific library name to dlopen. */
++#undef DLOPEN_LIBRPM
++
+ /* Define to 1 if translation of program messages to the user's native
+ language is requested. */
+ #undef ENABLE_NLS
+@@ -270,6 +273,9 @@
+ /* Define if Python 2.7 is being used. */
+ #undef HAVE_LIBPYTHON2_7
+
++/* Define if librpm library is being used. */
++#undef HAVE_LIBRPM
++
+ /* Define to 1 if you have the <libunwind-ia64.h> header file. */
+ #undef HAVE_LIBUNWIND_IA64_H
+
+diff -Naurp insight-8.1.50.20180216.orig/gdb/configure insight-8.1.50.20180216.new/gdb/configure
+--- insight-8.1.50.20180216.orig/gdb/configure 2018-02-16 15:40:18.000000000 +0100
++++ insight-8.1.50.20180216.new/gdb/configure 2018-02-17 19:22:44.756497106 +0100
+@@ -750,6 +750,11 @@ PKGVERSION
+ HAVE_NATIVE_GCORE_TARGET
+ TARGET_OBS
+ subdirs
++RPM_LIBS
++RPM_CFLAGS
++PKG_CONFIG_LIBDIR
++PKG_CONFIG_PATH
++PKG_CONFIG
+ GDB_DATADIR
+ DEBUGDIR
+ MAKEINFO_EXTRA_FLAGS
+@@ -854,6 +859,7 @@ with_gdb_datadir
+ with_relocated_sources
+ with_auto_load_dir
+ with_auto_load_safe_path
++with_rpm
+ enable_targets
+ enable_64_bit_bfd
+ enable_gdbcli
+@@ -912,6 +918,11 @@ CCC
+ CPP
+ MAKEINFO
+ MAKEINFOFLAGS
++PKG_CONFIG
++PKG_CONFIG_PATH
++PKG_CONFIG_LIBDIR
++RPM_CFLAGS
++RPM_LIBS
+ YACC
+ YFLAGS
+ XMKMF'
+@@ -1582,6 +1593,8 @@ Optional Packages:
+ [--with-auto-load-dir]
+ --without-auto-load-safe-path
+ do not restrict auto-loaded files locations
++ --with-rpm query rpm database for missing debuginfos (yes/no,
++ def. auto=librpm.so)
+ --with-libunwind-ia64 use libunwind frame unwinding for ia64 targets
+ --with-curses use the curses library instead of the termcap
+ library
+@@ -1639,6 +1652,13 @@ Some influential environment variables:
+ MAKEINFO Parent configure detects if it is of sufficient version.
+ MAKEINFOFLAGS
+ Parameters for MAKEINFO.
++ PKG_CONFIG path to pkg-config utility
++ PKG_CONFIG_PATH
++ directories to add to pkg-config's search path
++ PKG_CONFIG_LIBDIR
++ path overriding pkg-config's built-in search path
++ RPM_CFLAGS C compiler flags for RPM, overriding pkg-config
++ RPM_LIBS linker flags for RPM, overriding pkg-config
+ YACC The `Yet Another Compiler Compiler' implementation to use.
+ Defaults to the first program found out of: `bison -y', `byacc',
+ `yacc'.
+@@ -6568,6 +6588,494 @@ _ACEOF
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_auto_load_safe_path" >&5
+ $as_echo "$with_auto_load_safe_path" >&6; }
+
++# Integration with rpm library to support missing debuginfo suggestions.
++# --without-rpm: Disable any rpm support.
++# --with-rpm=libname.so: Try to dynamically open `libname.so' during runtime.
++# Even with runtime missing `libname.so' GDB will still other run correctly.
++# Missing `libname.so' during ./configure will abort the configuration.
++# --with-rpm=librpm.so: Like `--with-rpm=libname.so' but try to find specific
++# minor version first such as `librpm-4.6.so' as minor version differences
++# mean API+ABI incompatibility. If the specific match versioned library name
++# could not be found still open dynamically at least `librpm.so'.
++# --with-rpm: Like `--with-rpm=librpm.so' but if any of its detection fails try
++# to find librpm for compilation-time linking by pkg-config. GDB binary will
++# be probably linked with the version specific library (as `librpm-4.6.so').
++# Failure to find librpm by pkg-config will abort the configuration.
++# (default) --with-rpm=auto: Like `--with-rpm=librpm.so' but if even pkg-config
++# cannot find librpm use to the rpmless compilation (like `--without-rpm').
++
++
++# Check whether --with-rpm was given.
++if test "${with_rpm+set}" = set; then :
++ withval=$with_rpm;
++else
++ with_rpm="auto"
++fi
++
++
++
++
++if test "x$with_rpm" != "xno"; then
++ if test "x$with_rpm" = "xyes"; then
++ LIBRPM="librpm.so"
++ RPM_REQUIRE=true
++ DLOPEN_REQUIRE=false
++ elif test "x$with_rpm" = "xauto"; then
++ LIBRPM="librpm.so"
++ RPM_REQUIRE=false
++ DLOPEN_REQUIRE=false
++ else
++ LIBRPM="$with_rpm"
++ RPM_REQUIRE=true
++ DLOPEN_REQUIRE=true
++ fi
++ LIBRPM_STRING='"'"$LIBRPM"'"'
++
++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking specific librpm version" >&5
++$as_echo_n "checking specific librpm version... " >&6; }
++ HAVE_DLOPEN_LIBRPM=false
++ save_LIBS="$LIBS"
++ LIBS="$LIBS -ldl"
++ if test "$cross_compiling" = yes; then :
++ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
++$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
++as_fn_error "cannot run test program while cross compiling
++See \`config.log' for more details." "$LINENO" 5; }
++else
++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
++/* end confdefs.h. */
++
++#include <rpm/rpmlib.h>
++#include <dlfcn.h>
++#include <errno.h>
++
++int
++main ()
++{
++
++ void *h;
++ const char *const *rpmverp;
++ FILE *f;
++
++ f = fopen ("conftest.out", "w");
++ if (!f)
++ {
++ fprintf (stderr, "Cannot write \"%s\": %s\n", "conftest.out",
++ strerror (errno));
++ return 1;
++ }
++ h = dlopen ($LIBRPM_STRING, RTLD_LAZY);
++ if (!h)
++ {
++ fprintf (stderr, "dlopen (\"%s\"): %s\n", $LIBRPM_STRING, dlerror ());
++ return 1;
++ }
++ rpmverp = dlsym (h, "RPMVERSION");
++ if (!rpmverp)
++ {
++ fprintf (stderr, "dlsym (\"RPMVERSION\"): %s\n", dlerror ());
++ return 1;
++ }
++ fprintf (stderr, "RPMVERSION is: \"");
++ fprintf (stderr, "%s\"\n", *rpmverp);
++
++ /* Try to find the specific librpm version only for "librpm.so" as we do
++ not know how to assemble the version string otherwise. */
++
++ if (strcmp ("librpm.so", $LIBRPM_STRING) != 0)
++ {
++ fprintf (f, "%s\n", $LIBRPM_STRING);
++ return 0;
++ }
++ else
++ {
++ char *h2_name;
++ void *h2;
++ int major, minor;
++
++ if (sscanf (*rpmverp, "%d.%d", &major, &minor) != 2)
++ {
++ fprintf (stderr, "Unable to parse RPMVERSION.\n");
++ fprintf (f, "%s\n", $LIBRPM_STRING);
++ return 0;
++ }
++ /* Avoid the square brackets by malloc. */
++ h2_name = malloc (64);
++ sprintf (h2_name, "librpm-%d.%d.so", major, minor);
++ h2 = dlopen (h2_name, RTLD_LAZY);
++ if (!h2)
++ {
++ fprintf (stderr, "dlopen (\"%s\"): %s\n", h2_name, dlerror ());
++ fprintf (f, "%s\n", $LIBRPM_STRING);
++ return 0;
++ }
++ if (h2 != h)
++ {
++ fprintf (stderr, "dlopen of \"%s\" and \"%s\" are different.\n",
++ $LIBRPM_STRING, h2_name);
++ fprintf (f, "%s\n", $LIBRPM_STRING);
++ return 0;
++ }
++ /* Found the valid .so name with a specific version. */
++ fprintf (f, "%s\n", h2_name);
++ return 0;
++ }
++
++ ;
++ return 0;
++}
++_ACEOF
++if ac_fn_c_try_run "$LINENO"; then :
++
++ DLOPEN_LIBRPM="`cat conftest.out`"
++ if test "x$DLOPEN_LIBRPM" != "x"; then
++ HAVE_DLOPEN_LIBRPM=true
++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DLOPEN_LIBRPM" >&5
++$as_echo "$DLOPEN_LIBRPM" >&6; }
++ fi
++
++fi
++rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
++ conftest.$ac_objext conftest.beam conftest.$ac_ext
++fi
++
++ rm -f conftest.out
++
++
++
++ if $HAVE_DLOPEN_LIBRPM; then
++
++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking rpm library API compatibility" >&5
++$as_echo_n "checking rpm library API compatibility... " >&6; }
++ # The compilation requires -Werror to verify anything.
++ save_CFLAGS="$CFLAGS"
++ CFLAGS="$CFLAGS -Werror"
++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
++/* end confdefs.h. */
++
++/* Duplicate here the declarations to verify they match "elfread.c". */
++#include <rpm/rpmlib.h>
++#include <rpm/rpmts.h>
++#include <rpm/rpmdb.h>
++#include <rpm/header.h>
++extern char * headerFormat(Header h, const char * fmt, errmsg_t * errmsg);
++extern int rpmReadConfigFiles(const char * file, const char * target);
++extern rpmdbMatchIterator rpmdbFreeIterator(rpmdbMatchIterator mi);
++extern Header rpmdbNextIterator(rpmdbMatchIterator mi);
++extern rpmts rpmtsCreate(void);
++extern rpmts rpmtsFree(rpmts ts);
++extern rpmdbMatchIterator rpmtsInitIterator(const rpmts ts, rpmTag rpmtag,
++ const void * keyp, size_t keylen);
++
++int
++main ()
++{
++
++ ;
++ return 0;
++}
++_ACEOF
++if ac_fn_c_try_compile "$LINENO"; then :
++
++ LIBRPM_COMPAT=true
++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
++$as_echo "yes" >&6; }
++
++else
++
++ LIBRPM_COMPAT=false
++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
++$as_echo "no" >&6; }
++
++fi
++rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
++ CFLAGS="$save_CFLAGS"
++
++ if ! $LIBRPM_COMPAT; then
++ HAVE_DLOPEN_LIBRPM=false
++ fi
++ fi
++
++ if $HAVE_DLOPEN_LIBRPM; then
++ DLOPEN_LIBRPM_STRING='"'"$DLOPEN_LIBRPM"'"'
++
++cat >>confdefs.h <<_ACEOF
++#define DLOPEN_LIBRPM $DLOPEN_LIBRPM_STRING
++_ACEOF
++
++
++$as_echo "#define HAVE_LIBRPM 1" >>confdefs.h
++
++ else
++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
++$as_echo "no" >&6; }
++ LIBS="$save_LIBS"
++ if $DLOPEN_REQUIRE; then
++ as_fn_error "Specific name $LIBRPM was requested but it could not be opened." "$LINENO" 5
++ fi
++
++
++
++
++
++
++
++if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
++ if test -n "$ac_tool_prefix"; then
++ # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args.
++set dummy ${ac_tool_prefix}pkg-config; ac_word=$2
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
++$as_echo_n "checking for $ac_word... " >&6; }
++if test "${ac_cv_path_PKG_CONFIG+set}" = set; then :
++ $as_echo_n "(cached) " >&6
++else
++ case $PKG_CONFIG in
++ [\\/]* | ?:[\\/]*)
++ ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
++ ;;
++ *)
++ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
++for as_dir in $PATH
++do
++ IFS=$as_save_IFS
++ test -z "$as_dir" && as_dir=.
++ for ac_exec_ext in '' $ac_executable_extensions; do
++ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
++ ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
++ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
++ break 2
++ fi
++done
++ done
++IFS=$as_save_IFS
++
++ ;;
++esac
++fi
++PKG_CONFIG=$ac_cv_path_PKG_CONFIG
++if test -n "$PKG_CONFIG"; then
++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5
++$as_echo "$PKG_CONFIG" >&6; }
++else
++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
++$as_echo "no" >&6; }
++fi
++
++
++fi
++if test -z "$ac_cv_path_PKG_CONFIG"; then
++ ac_pt_PKG_CONFIG=$PKG_CONFIG
++ # Extract the first word of "pkg-config", so it can be a program name with args.
++set dummy pkg-config; ac_word=$2
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
++$as_echo_n "checking for $ac_word... " >&6; }
++if test "${ac_cv_path_ac_pt_PKG_CONFIG+set}" = set; then :
++ $as_echo_n "(cached) " >&6
++else
++ case $ac_pt_PKG_CONFIG in
++ [\\/]* | ?:[\\/]*)
++ ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path.
++ ;;
++ *)
++ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
++for as_dir in $PATH
++do
++ IFS=$as_save_IFS
++ test -z "$as_dir" && as_dir=.
++ for ac_exec_ext in '' $ac_executable_extensions; do
++ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
++ ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
++ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
++ break 2
++ fi
++done
++ done
++IFS=$as_save_IFS
++
++ ;;
++esac
++fi
++ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG
++if test -n "$ac_pt_PKG_CONFIG"; then
++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKG_CONFIG" >&5
++$as_echo "$ac_pt_PKG_CONFIG" >&6; }
++else
++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
++$as_echo "no" >&6; }
++fi
++
++ if test "x$ac_pt_PKG_CONFIG" = x; then
++ PKG_CONFIG=""
++ else
++ case $cross_compiling:$ac_tool_warned in
++yes:)
++{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
++$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
++ac_tool_warned=yes ;;
++esac
++ PKG_CONFIG=$ac_pt_PKG_CONFIG
++ fi
++else
++ PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
++fi
++
++fi
++if test -n "$PKG_CONFIG"; then
++ _pkg_min_version=0.9.0
++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking pkg-config is at least version $_pkg_min_version" >&5
++$as_echo_n "checking pkg-config is at least version $_pkg_min_version... " >&6; }
++ if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
++$as_echo "yes" >&6; }
++ else
++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
++$as_echo "no" >&6; }
++ PKG_CONFIG=""
++ fi
++fi
++
++pkg_failed=no
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for RPM" >&5
++$as_echo_n "checking for RPM... " >&6; }
++
++if test -n "$RPM_CFLAGS"; then
++ pkg_cv_RPM_CFLAGS="$RPM_CFLAGS"
++ elif test -n "$PKG_CONFIG"; then
++ if test -n "$PKG_CONFIG" && \
++ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"rpm\""; } >&5
++ ($PKG_CONFIG --exists --print-errors "rpm") 2>&5
++ ac_status=$?
++ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
++ test $ac_status = 0; }; then
++ pkg_cv_RPM_CFLAGS=`$PKG_CONFIG --cflags "rpm" 2>/dev/null`
++ test "x$?" != "x0" && pkg_failed=yes
++else
++ pkg_failed=yes
++fi
++ else
++ pkg_failed=untried
++fi
++if test -n "$RPM_LIBS"; then
++ pkg_cv_RPM_LIBS="$RPM_LIBS"
++ elif test -n "$PKG_CONFIG"; then
++ if test -n "$PKG_CONFIG" && \
++ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"rpm\""; } >&5
++ ($PKG_CONFIG --exists --print-errors "rpm") 2>&5
++ ac_status=$?
++ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
++ test $ac_status = 0; }; then
++ pkg_cv_RPM_LIBS=`$PKG_CONFIG --libs "rpm" 2>/dev/null`
++ test "x$?" != "x0" && pkg_failed=yes
++else
++ pkg_failed=yes
++fi
++ else
++ pkg_failed=untried
++fi
++
++
++
++if test $pkg_failed = yes; then
++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
++$as_echo "no" >&6; }
++
++if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
++ _pkg_short_errors_supported=yes
++else
++ _pkg_short_errors_supported=no
++fi
++ if test $_pkg_short_errors_supported = yes; then
++ RPM_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "rpm" 2>&1`
++ else
++ RPM_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "rpm" 2>&1`
++ fi
++ # Put the nasty error message in config.log where it belongs
++ echo "$RPM_PKG_ERRORS" >&5
++
++ HAVE_LIBRPM=false
++elif test $pkg_failed = untried; then
++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
++$as_echo "no" >&6; }
++ HAVE_LIBRPM=false
++else
++ RPM_CFLAGS=$pkg_cv_RPM_CFLAGS
++ RPM_LIBS=$pkg_cv_RPM_LIBS
++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
++$as_echo "yes" >&6; }
++ HAVE_LIBRPM=true
++fi
++
++ if $HAVE_LIBRPM; then
++
++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking rpm library API compatibility" >&5
++$as_echo_n "checking rpm library API compatibility... " >&6; }
++ # The compilation requires -Werror to verify anything.
++ save_CFLAGS="$CFLAGS"
++ CFLAGS="$CFLAGS -Werror"
++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
++/* end confdefs.h. */
++
++/* Duplicate here the declarations to verify they match "elfread.c". */
++#include <rpm/rpmlib.h>
++#include <rpm/rpmts.h>
++#include <rpm/rpmdb.h>
++#include <rpm/header.h>
++extern char * headerFormat(Header h, const char * fmt, errmsg_t * errmsg);
++extern int rpmReadConfigFiles(const char * file, const char * target);
++extern rpmdbMatchIterator rpmdbFreeIterator(rpmdbMatchIterator mi);
++extern Header rpmdbNextIterator(rpmdbMatchIterator mi);
++extern rpmts rpmtsCreate(void);
++extern rpmts rpmtsFree(rpmts ts);
++extern rpmdbMatchIterator rpmtsInitIterator(const rpmts ts, rpmTag rpmtag,
++ const void * keyp, size_t keylen);
++
++int
++main ()
++{
++
++ ;
++ return 0;
++}
++_ACEOF
++if ac_fn_c_try_compile "$LINENO"; then :
++
++ LIBRPM_COMPAT=true
++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
++$as_echo "yes" >&6; }
++
++else
++
++ LIBRPM_COMPAT=false
++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
++$as_echo "no" >&6; }
++
++fi
++rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
++ CFLAGS="$save_CFLAGS"
++
++ if ! $LIBRPM_COMPAT; then
++ HAVE_LIBRPM=false
++ RPM_PKG_ERRORS="Found $LIBRPM API is incompatibile with this GDB"
++ fi
++ fi
++
++ if $HAVE_LIBRPM; then
++
++$as_echo "#define HAVE_LIBRPM 1" >>confdefs.h
++
++ CFLAGS="$CFLAGS $RPM_CFLAGS"
++ LIBS="$LIBS $RPM_LIBS"
++ else
++ if $RPM_REQUIRE; then
++ as_fn_error "$RPM_PKG_ERRORS" "$LINENO" 5
++ else
++ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $RPM_PKG_ERRORS" >&5
++$as_echo "$as_me: WARNING: $RPM_PKG_ERRORS" >&2;}
++ fi
++ fi
++ fi
++fi
++
+
+
+ subdirs="$subdirs testsuite"
+diff -Naurp insight-8.1.50.20180216.orig/gdb/configure.ac insight-8.1.50.20180216.new/gdb/configure.ac
+--- insight-8.1.50.20180216.orig/gdb/configure.ac 2018-02-17 19:16:18.193669906 +0100
++++ insight-8.1.50.20180216.new/gdb/configure.ac 2018-02-17 19:17:08.720168427 +0100
+@@ -167,6 +167,199 @@ AC_DEFINE_DIR(AUTO_LOAD_SAFE_PATH, escap
+ [Directories safe to hold auto-loaded files.])
+ AC_MSG_RESULT([$with_auto_load_safe_path])
+
++# Integration with rpm library to support missing debuginfo suggestions.
++# --without-rpm: Disable any rpm support.
++# --with-rpm=libname.so: Try to dynamically open `libname.so' during runtime.
++# Even with runtime missing `libname.so' GDB will still other run correctly.
++# Missing `libname.so' during ./configure will abort the configuration.
++# --with-rpm=librpm.so: Like `--with-rpm=libname.so' but try to find specific
++# minor version first such as `librpm-4.6.so' as minor version differences
++# mean API+ABI incompatibility. If the specific match versioned library name
++# could not be found still open dynamically at least `librpm.so'.
++# --with-rpm: Like `--with-rpm=librpm.so' but if any of its detection fails try
++# to find librpm for compilation-time linking by pkg-config. GDB binary will
++# be probably linked with the version specific library (as `librpm-4.6.so').
++# Failure to find librpm by pkg-config will abort the configuration.
++# (default) --with-rpm=auto: Like `--with-rpm=librpm.so' but if even pkg-config
++# cannot find librpm use to the rpmless compilation (like `--without-rpm').
++
++AC_ARG_WITH([rpm],
++ [AS_HELP_STRING([--with-rpm],
++ [query rpm database for missing debuginfos (yes/no, def. auto=librpm.so)])], [], [with_rpm="auto"])
++
++m4_pattern_allow([^AC_MSG_ERROR$])
++m4_pattern_allow([^AC_MSG_WARN$])
++if test "x$with_rpm" != "xno"; then
++ if test "x$with_rpm" = "xyes"; then
++ LIBRPM="librpm.so"
++ RPM_REQUIRE=true
++ DLOPEN_REQUIRE=false
++ elif test "x$with_rpm" = "xauto"; then
++ LIBRPM="librpm.so"
++ RPM_REQUIRE=false
++ DLOPEN_REQUIRE=false
++ else
++ LIBRPM="$with_rpm"
++ RPM_REQUIRE=true
++ DLOPEN_REQUIRE=true
++ fi
++ LIBRPM_STRING='"'"$LIBRPM"'"'
++
++ AC_MSG_CHECKING([specific librpm version])
++ HAVE_DLOPEN_LIBRPM=false
++ save_LIBS="$LIBS"
++ LIBS="$LIBS -ldl"
++ AC_RUN_IFELSE(AC_LANG_PROGRAM([[
++#include <rpm/rpmlib.h>
++#include <dlfcn.h>
++#include <errno.h>
++ ]], [[
++ void *h;
++ const char *const *rpmverp;
++ FILE *f;
++
++ f = fopen ("conftest.out", "w");
++ if (!f)
++ {
++ fprintf (stderr, "Cannot write \"%s\": %s\n", "conftest.out",
++ strerror (errno));
++ return 1;
++ }
++ h = dlopen ($LIBRPM_STRING, RTLD_LAZY);
++ if (!h)
++ {
++ fprintf (stderr, "dlopen (\"%s\"): %s\n", $LIBRPM_STRING, dlerror ());
++ return 1;
++ }
++ rpmverp = dlsym (h, "RPMVERSION");
++ if (!rpmverp)
++ {
++ fprintf (stderr, "dlsym (\"RPMVERSION\"): %s\n", dlerror ());
++ return 1;
++ }
++ fprintf (stderr, "RPMVERSION is: \"");
++ fprintf (stderr, "%s\"\n", *rpmverp);
++
++ /* Try to find the specific librpm version only for "librpm.so" as we do
++ not know how to assemble the version string otherwise. */
++
++ if (strcmp ("librpm.so", $LIBRPM_STRING) != 0)
++ {
++ fprintf (f, "%s\n", $LIBRPM_STRING);
++ return 0;
++ }
++ else
++ {
++ char *h2_name;
++ void *h2;
++ int major, minor;
++
++ if (sscanf (*rpmverp, "%d.%d", &major, &minor) != 2)
++ {
++ fprintf (stderr, "Unable to parse RPMVERSION.\n");
++ fprintf (f, "%s\n", $LIBRPM_STRING);
++ return 0;
++ }
++ /* Avoid the square brackets by malloc. */
++ h2_name = malloc (64);
++ sprintf (h2_name, "librpm-%d.%d.so", major, minor);
++ h2 = dlopen (h2_name, RTLD_LAZY);
++ if (!h2)
++ {
++ fprintf (stderr, "dlopen (\"%s\"): %s\n", h2_name, dlerror ());
++ fprintf (f, "%s\n", $LIBRPM_STRING);
++ return 0;
++ }
++ if (h2 != h)
++ {
++ fprintf (stderr, "dlopen of \"%s\" and \"%s\" are different.\n",
++ $LIBRPM_STRING, h2_name);
++ fprintf (f, "%s\n", $LIBRPM_STRING);
++ return 0;
++ }
++ /* Found the valid .so name with a specific version. */
++ fprintf (f, "%s\n", h2_name);
++ return 0;
++ }
++ ]]), [
++ DLOPEN_LIBRPM="`cat conftest.out`"
++ if test "x$DLOPEN_LIBRPM" != "x"; then
++ HAVE_DLOPEN_LIBRPM=true
++ AC_MSG_RESULT($DLOPEN_LIBRPM)
++ fi
++ ])
++ rm -f conftest.out
++
++ m4_define([CHECK_LIBRPM_COMPAT], [
++ AC_MSG_CHECKING([rpm library API compatibility])
++ # The compilation requires -Werror to verify anything.
++ save_CFLAGS="$CFLAGS"
++ CFLAGS="$CFLAGS -Werror"
++ AC_COMPILE_IFELSE(AC_LANG_PROGRAM([[
++/* Duplicate here the declarations to verify they match "elfread.c". */
++#include <rpm/rpmlib.h>
++#include <rpm/rpmts.h>
++#include <rpm/rpmdb.h>
++#include <rpm/header.h>
++extern char * headerFormat(Header h, const char * fmt, errmsg_t * errmsg);
++extern int rpmReadConfigFiles(const char * file, const char * target);
++extern rpmdbMatchIterator rpmdbFreeIterator(rpmdbMatchIterator mi);
++extern Header rpmdbNextIterator(rpmdbMatchIterator mi);
++extern rpmts rpmtsCreate(void);
++extern rpmts rpmtsFree(rpmts ts);
++extern rpmdbMatchIterator rpmtsInitIterator(const rpmts ts, rpmTag rpmtag,
++ const void * keyp, size_t keylen);
++ ]]), [
++ LIBRPM_COMPAT=true
++ AC_MSG_RESULT(yes)
++ ], [
++ LIBRPM_COMPAT=false
++ AC_MSG_RESULT(no)
++ ])
++ CFLAGS="$save_CFLAGS"
++ ])
++
++ if $HAVE_DLOPEN_LIBRPM; then
++ CHECK_LIBRPM_COMPAT
++ if ! $LIBRPM_COMPAT; then
++ HAVE_DLOPEN_LIBRPM=false
++ fi
++ fi
++
++ if $HAVE_DLOPEN_LIBRPM; then
++ DLOPEN_LIBRPM_STRING='"'"$DLOPEN_LIBRPM"'"'
++ AC_DEFINE_UNQUOTED(DLOPEN_LIBRPM, $DLOPEN_LIBRPM_STRING, [librpm version specific library name to dlopen.])
++ AC_DEFINE(HAVE_LIBRPM, 1, [Define if librpm library is being used.])
++ else
++ AC_MSG_RESULT(no)
++ LIBS="$save_LIBS"
++ if $DLOPEN_REQUIRE; then
++ AC_MSG_ERROR([Specific name $LIBRPM was requested but it could not be opened.])
++ fi
++ PKG_CHECK_MODULES(RPM, rpm, [HAVE_LIBRPM=true], [HAVE_LIBRPM=false])
++
++ if $HAVE_LIBRPM; then
++ CHECK_LIBRPM_COMPAT
++ if ! $LIBRPM_COMPAT; then
++ HAVE_LIBRPM=false
++ RPM_PKG_ERRORS="Found $LIBRPM API is incompatibile with this GDB"
++ fi
++ fi
++
++ if $HAVE_LIBRPM; then
++ AC_DEFINE(HAVE_LIBRPM, 1, [Define if librpm library is being used.])
++ CFLAGS="$CFLAGS $RPM_CFLAGS"
++ LIBS="$LIBS $RPM_LIBS"
++ else
++ if $RPM_REQUIRE; then
++ AC_MSG_ERROR($RPM_PKG_ERRORS)
++ else
++ AC_MSG_WARN($RPM_PKG_ERRORS)
++ fi
++ fi
++ fi
++fi
++
+ AC_CONFIG_SUBDIRS(testsuite)
+
+ # Check whether to support alternative target configurations
+diff -Naurp insight-8.1.50.20180216.orig/gdb/corelow.c insight-8.1.50.20180216.new/gdb/corelow.c
+--- insight-8.1.50.20180216.orig/gdb/corelow.c 2018-02-17 19:16:18.245670419 +0100
++++ insight-8.1.50.20180216.new/gdb/corelow.c 2018-02-17 19:17:08.720168427 +0100
+@@ -309,7 +309,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 -Naurp insight-8.1.50.20180216.orig/gdb/event-top.c insight-8.1.50.20180216.new/gdb/event-top.c
+--- insight-8.1.50.20180216.orig/gdb/event-top.c 2018-02-16 15:40:15.000000000 +0100
++++ insight-8.1.50.20180216.new/gdb/event-top.c 2018-02-17 19:17:08.720168427 +0100
+@@ -40,6 +40,7 @@
+ #include "buffer.h"
+ #include "ser-event.h"
+ #include "gdb_select.h"
++#include "symfile.h"
+
+ /* readline include files. */
+ #include "readline/readline.h"
+@@ -359,6 +360,8 @@ display_gdb_prompt (const char *new_prom
+ /* Reset the nesting depth used when trace-commands is set. */
+ reset_command_nest_depth ();
+
++ debug_flush_missing ();
++
+ /* 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. */
+@@ -774,7 +777,10 @@ command_line_handler (char *rl)
+ command_handler (cmd);
+
+ if (ui->prompt_state != PROMPTED)
+- display_gdb_prompt (0);
++ {
++ debug_flush_missing ();
++ display_gdb_prompt (0);
++ }
+ }
+ }
+
+diff -Naurp insight-8.1.50.20180216.orig/gdb/symfile.h insight-8.1.50.20180216.new/gdb/symfile.h
+--- insight-8.1.50.20180216.orig/gdb/symfile.h 2018-02-17 19:16:18.253670497 +0100
++++ insight-8.1.50.20180216.new/gdb/symfile.h 2018-02-17 19:17:08.720168427 +0100
+@@ -546,6 +546,8 @@ void map_symbol_filenames (symbol_filena
+ /* 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);
++extern void debug_flush_missing (void);
++#define BUILD_ID_MAIN_EXECUTABLE_FILENAME _("the main executable file")
+
+ /* From dwarf2read.c */
+
diff --git a/insight-8.1-gdb-6.8-attach-signalled-detach-stopped.patch b/insight-8.1-gdb-6.8-attach-signalled-detach-stopped.patch
new file mode 100644
index 0000000..59f4ab6
--- /dev/null
+++ b/insight-8.1-gdb-6.8-attach-signalled-detach-stopped.patch
@@ -0,0 +1,177 @@
+diff -Naurp insight-8.1.50.20180216.orig/gdb/infrun.c insight-8.1.50.20180216.new/gdb/infrun.c
+--- insight-8.1.50.20180216.orig/gdb/infrun.c 2018-02-18 02:36:22.786760016 +0100
++++ insight-8.1.50.20180216.new/gdb/infrun.c 2018-02-18 02:43:48.225007181 +0100
+@@ -606,6 +606,13 @@ holding the child stopped. Try \"set de
+ target_pid_to_str (process_ptid));
+ }
+
++#ifdef NEED_DETACH_SIGSTOP
++ /* We should check PID_WAS_STOPPED and detach it stopped accordingly.
++ In this point of code it cannot be 1 as we would not get FORK
++ executed without CONTINUE first which resets PID_WAS_STOPPED.
++ We would have to first TARGET_STOP and WAITPID it as with running
++ inferior PTRACE_DETACH, SIGSTOP will ignore the signal. */
++#endif
+ target_detach (parent_inf, 0);
+ }
+
+diff -Naurp insight-8.1.50.20180216.orig/gdb/linux-nat.c insight-8.1.50.20180216.new/gdb/linux-nat.c
+--- insight-8.1.50.20180216.orig/gdb/linux-nat.c 2018-02-18 02:36:22.806760208 +0100
++++ insight-8.1.50.20180216.new/gdb/linux-nat.c 2018-02-18 02:38:47.013127523 +0100
+@@ -194,6 +194,11 @@ enum tribool have_ptrace_getregset = TRI
+ static struct target_ops *linux_ops;
+ static struct target_ops linux_ops_saved;
+
++#ifdef NEED_DETACH_SIGSTOP
++/* PID of the inferior stopped by SIGSTOP before attaching (or zero). */
++static pid_t pid_was_stopped;
++
++#endif
+ /* The method to call, if any, when a new thread is attached. */
+ static void (*linux_nat_new_thread) (struct lwp_info *);
+
+@@ -1065,6 +1070,9 @@ linux_nat_post_attach_wait (ptid_t ptid,
+ if (debug_linux_nat)
+ fprintf_unfiltered (gdb_stdlog,
+ "LNPAW: Attaching to a stopped process\n");
++#ifdef NEED_DETACH_SIGSTOP
++ pid_was_stopped = ptid_get_pid (ptid);
++#endif
+
+ /* The process is definitely stopped. It is in a job control
+ stop, unless the kernel predates the TASK_STOPPED /
+@@ -1405,6 +1413,25 @@ get_detach_signal (struct lwp_info *lp)
+ return gdb_signal_to_host (signo);
+ }
+
++#ifdef NEED_DETACH_SIGSTOP
++ /* Workaround RHEL-5 kernel which has unreliable PTRACE_DETACH, SIGSTOP (that
++ many TIDs are left unstopped). See RH Bug 496732. */
++ if (ptid_get_pid (lp->ptid) == pid_was_stopped)
++ {
++ int err;
++
++ errno = 0;
++ err = kill_lwp (ptid_get_lwp (lp->ptid), SIGSTOP);
++ if (debug_linux_nat)
++ {
++ fprintf_unfiltered (gdb_stdlog,
++ "SC: lwp kill %d %s\n",
++ err,
++ errno ? safe_strerror (errno) : "ERRNO-OK");
++ }
++ }
++
++#endif
+ return 0;
+ }
+
+@@ -1554,6 +1581,10 @@ linux_nat_detach (struct target_ops *ops
+ detach_one_lwp (main_lwp, &signo);
+
+ inf_ptrace_detach_success (ops, inf);
++
++#ifdef NEED_DETACH_SIGSTOP
++ pid_was_stopped = 0;
++#endif
+ }
+ }
+
+@@ -1814,6 +1845,16 @@ linux_nat_resume (struct target_ops *ops
+ return;
+ }
+
++#ifdef NEED_DETACH_SIGSTOP
++ /* At this point, we are going to resume the inferior and if we
++ have attached to a stopped process, we no longer should leave
++ it as stopped if the user detaches. PTID variable has PID set to LWP
++ while we need to check the real PID here. */
++
++ if (!step && lp && pid_was_stopped == ptid_get_pid (lp->ptid))
++ pid_was_stopped = 0;
++
++#endif
+ if (resume_many)
+ iterate_over_lwps (ptid, linux_nat_resume_callback, lp);
+
+@@ -3825,6 +3866,10 @@ linux_nat_mourn_inferior (struct target_
+
+ /* Let the arch-specific native code know this process is gone. */
+ linux_nat_forget_process (pid);
++#ifdef NEED_DETACH_SIGSTOP
++
++ pid_was_stopped = 0;
++#endif
+ }
+
+ /* Convert a native/host siginfo object, into/from the siginfo in the
+diff -Naurp insight-8.1.50.20180216.orig/gdb/testsuite/gdb.threads/attach-stopped.exp insight-8.1.50.20180216.new/gdb/testsuite/gdb.threads/attach-stopped.exp
+--- insight-8.1.50.20180216.orig/gdb/testsuite/gdb.threads/attach-stopped.exp 2018-01-04 17:43:15.000000000 +0100
++++ insight-8.1.50.20180216.new/gdb/testsuite/gdb.threads/attach-stopped.exp 2018-02-18 02:36:48.179004208 +0100
+@@ -56,7 +56,65 @@ proc corefunc { threadtype } {
+ gdb_reinitialize_dir $srcdir/$subdir
+ gdb_load ${binfile}
+
+- # Verify that we can attach to the stopped process.
++ # Verify that we can attach to the process by first giving its
++ # executable name via the file command, and using attach with the
++ # process ID.
++
++ set test "$threadtype: set file, before attach1 to stopped process"
++ gdb_test_multiple "file $binfile" "$test" {
++ -re "Load new symbol table from.*y or n. $" {
++ gdb_test "y" "Reading symbols from $escapedbinfile\.\.\.*done." \
++ "$test (re-read)"
++ }
++ -re "Reading symbols from $escapedbinfile\.\.\.*done.*$gdb_prompt $" {
++ pass "$test"
++ }
++ }
++
++ set test "$threadtype: attach1 to stopped, after setting file"
++ gdb_test_multiple "attach $testpid" "$test" {
++ -re "Attaching to program.*`?$escapedbinfile'?, process $testpid.*$gdb_prompt $" {
++ pass "$test"
++ }
++ }
++
++ # ".*sleep.*clone.*" would fail on s390x as bt stops at START_THREAD there.
++ if {[string equal $threadtype threaded]} {
++ gdb_test "thread apply all bt" ".*sleep.*start_thread.*" "$threadtype: attach1 to stopped bt"
++ } else {
++ gdb_test "bt" ".*sleep.*main.*" "$threadtype: attach1 to stopped bt"
++ }
++
++ # Exit and detach the process.
++
++ gdb_exit
++
++ # Avoid some race:
++ sleep 2
++
++ if [catch {open /proc/${testpid}/status r} fileid] {
++ set line2 "NOTFOUND"
++ } else {
++ gets $fileid line1;
++ gets $fileid line2;
++ close $fileid;
++ }
++
++ set test "$threadtype: attach1, exit leaves process stopped"
++ if {[string match "*(stopped)*" $line2]} {
++ pass $test
++ } else {
++ fail $test
++ }
++
++ # At this point, the process should still be stopped
++
++ gdb_start
++ gdb_reinitialize_dir $srcdir/$subdir
++ gdb_load ${binfile}
++
++ # Verify that we can attach to the process just by giving the
++ # process ID.
+
+ set test "$threadtype: attach2 to stopped, after setting file"
+ gdb_test_multiple "attach $testpid" "$test" {
diff --git a/insight-8.1-gdb-6.8-quit-never-aborts.patch b/insight-8.1-gdb-6.8-quit-never-aborts.patch
new file mode 100644
index 0000000..353e145
--- /dev/null
+++ b/insight-8.1-gdb-6.8-quit-never-aborts.patch
@@ -0,0 +1,63 @@
+diff -Naurp insight-8.1.50.20180216.orig/gdb/defs.h insight-8.1.50.20180216.new/gdb/defs.h
+--- insight-8.1.50.20180216.orig/gdb/defs.h 2018-02-18 02:50:17.453737880 +0100
++++ insight-8.1.50.20180216.new/gdb/defs.h 2018-02-18 02:50:40.712961274 +0100
+@@ -168,6 +168,10 @@ extern void default_quit_handler (void);
+ /* Flag that function quit should call quit_force. */
+ extern volatile int sync_quit_force_run;
+
++#ifdef NEED_DETACH_SIGSTOP
++extern int quit_flag_cleanup;
++#endif
++
+ extern void quit (void);
+
+ /* Helper for the QUIT macro. */
+diff -Naurp insight-8.1.50.20180216.orig/gdb/extension.c insight-8.1.50.20180216.new/gdb/extension.c
+--- insight-8.1.50.20180216.orig/gdb/extension.c 2018-01-12 03:18:43.000000000 +0100
++++ insight-8.1.50.20180216.new/gdb/extension.c 2018-02-18 02:50:40.712961274 +0100
+@@ -830,6 +830,11 @@ check_quit_flag (void)
+ int i, result = 0;
+ const struct extension_language_defn *extlang;
+
++#ifdef NEED_DETACH_SIGSTOP
++ if (quit_flag_cleanup)
++ return 0;
++#endif
++
+ ALL_ENABLED_EXTENSION_LANGUAGES (i, extlang)
+ {
+ if (extlang->ops->check_quit_flag != NULL)
+diff -Naurp insight-8.1.50.20180216.orig/gdb/top.c insight-8.1.50.20180216.new/gdb/top.c
+--- insight-8.1.50.20180216.orig/gdb/top.c 2018-02-16 15:40:15.000000000 +0100
++++ insight-8.1.50.20180216.new/gdb/top.c 2018-02-18 02:50:40.713961283 +0100
+@@ -1578,7 +1578,13 @@ quit_force (int *exit_arg, int from_tty)
+
+ qt.from_tty = from_tty;
+
++#ifndef NEED_DETACH_SIGSTOP
+ /* We want to handle any quit errors and exit regardless. */
++#else
++ /* We want to handle any quit errors and exit regardless but we should never
++ get user-interrupted to properly detach the inferior. */
++ quit_flag_cleanup = 1;
++#endif
+
+ /* Get out of tfind mode, and kill or detach all inferiors. */
+ TRY
+diff -Naurp insight-8.1.50.20180216.orig/gdb/utils.c insight-8.1.50.20180216.new/gdb/utils.c
+--- insight-8.1.50.20180216.orig/gdb/utils.c 2018-02-18 02:50:17.453737880 +0100
++++ insight-8.1.50.20180216.new/gdb/utils.c 2018-02-18 02:50:40.714961293 +0100
+@@ -107,6 +107,13 @@ static std::chrono::steady_clock::durati
+
+ static int debug_timestamp = 0;
+
++#ifdef NEED_DETACH_SIGSTOP
++/* Nonzero means we are already processing the quitting cleanups and we should
++ no longer get aborted. */
++
++int quit_flag_cleanup;
++#endif
++
+ /* Nonzero means that strings with character values >0x7F should be printed
+ as octal escapes. Zero means just print the value (e.g. it's an
+ international character, and the terminal or window can cope.) */
diff --git a/insight-8.1-gdb-attach-fail-reasons-5of5.patch b/insight-8.1-gdb-attach-fail-reasons-5of5.patch
new file mode 100644
index 0000000..d9f0395
--- /dev/null
+++ b/insight-8.1-gdb-attach-fail-reasons-5of5.patch
@@ -0,0 +1,317 @@
+diff -Naurp insight-8.1.50.20180216.orig/gdb/config.in insight-8.1.50.20180216.new/gdb/config.in
+--- insight-8.1.50.20180216.orig/gdb/config.in 2018-02-18 00:23:36.501301300 +0100
++++ insight-8.1.50.20180216.new/gdb/config.in 2018-02-18 00:24:24.300777804 +0100
+@@ -276,6 +276,9 @@
+ /* Define if librpm library is being used. */
+ #undef HAVE_LIBRPM
+
++/* Define to 1 if you have the `selinux' library (-lselinux). */
++#undef HAVE_LIBSELINUX
++
+ /* Define to 1 if you have the <libunwind-ia64.h> header file. */
+ #undef HAVE_LIBUNWIND_IA64_H
+
+@@ -399,6 +402,9 @@
+ /* Define to 1 if you have the `scm_new_smob' function. */
+ #undef HAVE_SCM_NEW_SMOB
+
++/* Define to 1 if you have the <selinux/selinux.h> header file. */
++#undef HAVE_SELINUX_SELINUX_H
++
+ /* Define to 1 if you have the `setlocale' function. */
+ #undef HAVE_SETLOCALE
+
+diff -Naurp insight-8.1.50.20180216.orig/gdb/configure insight-8.1.50.20180216.new/gdb/configure
+--- insight-8.1.50.20180216.orig/gdb/configure 2018-02-18 00:23:36.502301310 +0100
++++ insight-8.1.50.20180216.new/gdb/configure 2018-02-18 00:24:24.301777814 +0100
+@@ -15839,6 +15839,64 @@ cat >>confdefs.h <<_ACEOF
+ _ACEOF
+
+
++for ac_header in selinux/selinux.h
++do :
++ ac_fn_c_check_header_mongrel "$LINENO" "selinux/selinux.h" "ac_cv_header_selinux_selinux_h" "$ac_includes_default"
++if test "x$ac_cv_header_selinux_selinux_h" = x""yes; then :
++ cat >>confdefs.h <<_ACEOF
++#define HAVE_SELINUX_SELINUX_H 1
++_ACEOF
++
++fi
++
++done
++
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for security_get_boolean_active in -lselinux" >&5
++$as_echo_n "checking for security_get_boolean_active in -lselinux... " >&6; }
++if test "${ac_cv_lib_selinux_security_get_boolean_active+set}" = set; then :
++ $as_echo_n "(cached) " >&6
++else
++ ac_check_lib_save_LIBS=$LIBS
++LIBS="-lselinux $LIBS"
++cat confdefs.h - <<_ACEOF >conftest.$ac_ext
++/* end confdefs.h. */
++
++/* Override any GCC internal prototype to avoid an error.
++ Use char because int might match the return type of a GCC
++ builtin and then its argument prototype would still apply. */
++#ifdef __cplusplus
++extern "C"
++#endif
++char security_get_boolean_active ();
++int
++main ()
++{
++return security_get_boolean_active ();
++ ;
++ return 0;
++}
++_ACEOF
++if ac_fn_c_try_link "$LINENO"; then :
++ ac_cv_lib_selinux_security_get_boolean_active=yes
++else
++ ac_cv_lib_selinux_security_get_boolean_active=no
++fi
++rm -f core conftest.err conftest.$ac_objext \
++ conftest$ac_exeext conftest.$ac_ext
++LIBS=$ac_check_lib_save_LIBS
++fi
++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_selinux_security_get_boolean_active" >&5
++$as_echo "$ac_cv_lib_selinux_security_get_boolean_active" >&6; }
++if test "x$ac_cv_lib_selinux_security_get_boolean_active" = x""yes; then :
++ cat >>confdefs.h <<_ACEOF
++#define HAVE_LIBSELINUX 1
++_ACEOF
++
++ LIBS="-lselinux $LIBS"
++
++fi
++
++
+
+ # Support for --with-sysroot is a copy of GDB_AC_WITH_DIR,
+ # except that the argument to --with-sysroot is optional.
+diff -Naurp insight-8.1.50.20180216.orig/gdb/configure.ac insight-8.1.50.20180216.new/gdb/configure.ac
+--- insight-8.1.50.20180216.orig/gdb/configure.ac 2018-02-18 00:23:36.503301320 +0100
++++ insight-8.1.50.20180216.new/gdb/configure.ac 2018-02-18 00:24:24.301777814 +0100
+@@ -2051,6 +2051,10 @@ case $host_os in
+ esac
+ AC_DEFINE_UNQUOTED(GDBINIT,"$gdbinit",[The .gdbinit filename.])
+
++dnl Check security_get_boolean_active availability.
++AC_CHECK_HEADERS(selinux/selinux.h)
++AC_CHECK_LIB(selinux, security_get_boolean_active)
++
+ dnl Handle optional features that can be enabled.
+
+ # Support for --with-sysroot is a copy of GDB_AC_WITH_DIR,
+diff -Naurp insight-8.1.50.20180216.orig/gdb/gdbserver/config.in insight-8.1.50.20180216.new/gdb/gdbserver/config.in
+--- insight-8.1.50.20180216.orig/gdb/gdbserver/config.in 2017-12-01 03:42:32.000000000 +0100
++++ insight-8.1.50.20180216.new/gdb/gdbserver/config.in 2018-02-18 00:24:24.301777814 +0100
+@@ -126,6 +126,9 @@
+ /* Define to 1 if you have the `mcheck' library (-lmcheck). */
+ #undef HAVE_LIBMCHECK
+
++/* Define to 1 if you have the `selinux' library (-lselinux). */
++#undef HAVE_LIBSELINUX
++
+ /* Define if the target supports branch tracing. */
+ #undef HAVE_LINUX_BTRACE
+
+@@ -202,6 +205,9 @@
+ /* Define to 1 if you have the `pwrite' function. */
+ #undef HAVE_PWRITE
+
++/* Define to 1 if you have the <selinux/selinux.h> header file. */
++#undef HAVE_SELINUX_SELINUX_H
++
+ /* Define to 1 if you have the `setns' function. */
+ #undef HAVE_SETNS
+
+diff -Naurp insight-8.1.50.20180216.orig/gdb/gdbserver/configure insight-8.1.50.20180216.new/gdb/gdbserver/configure
+--- insight-8.1.50.20180216.orig/gdb/gdbserver/configure 2018-01-18 19:51:21.000000000 +0100
++++ insight-8.1.50.20180216.new/gdb/gdbserver/configure 2018-02-18 00:24:24.302777824 +0100
+@@ -8455,6 +8455,64 @@ if $want_ipa ; then
+ fi
+ fi
+
++for ac_header in selinux/selinux.h
++do :
++ ac_fn_c_check_header_mongrel "$LINENO" "selinux/selinux.h" "ac_cv_header_selinux_selinux_h" "$ac_includes_default"
++if test "x$ac_cv_header_selinux_selinux_h" = x""yes; then :
++ cat >>confdefs.h <<_ACEOF
++#define HAVE_SELINUX_SELINUX_H 1
++_ACEOF
++
++fi
++
++done
++
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for security_get_boolean_active in -lselinux" >&5
++$as_echo_n "checking for security_get_boolean_active in -lselinux... " >&6; }
++if test "${ac_cv_lib_selinux_security_get_boolean_active+set}" = set; then :
++ $as_echo_n "(cached) " >&6
++else
++ ac_check_lib_save_LIBS=$LIBS
++LIBS="-lselinux $LIBS"
++cat confdefs.h - <<_ACEOF >conftest.$ac_ext
++/* end confdefs.h. */
++
++/* Override any GCC internal prototype to avoid an error.
++ Use char because int might match the return type of a GCC
++ builtin and then its argument prototype would still apply. */
++#ifdef __cplusplus
++extern "C"
++#endif
++char security_get_boolean_active ();
++int
++main ()
++{
++return security_get_boolean_active ();
++ ;
++ return 0;
++}
++_ACEOF
++if ac_fn_c_try_link "$LINENO"; then :
++ ac_cv_lib_selinux_security_get_boolean_active=yes
++else
++ ac_cv_lib_selinux_security_get_boolean_active=no
++fi
++rm -f core conftest.err conftest.$ac_objext \
++ conftest$ac_exeext conftest.$ac_ext
++LIBS=$ac_check_lib_save_LIBS
++fi
++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_selinux_security_get_boolean_active" >&5
++$as_echo "$ac_cv_lib_selinux_security_get_boolean_active" >&6; }
++if test "x$ac_cv_lib_selinux_security_get_boolean_active" = x""yes; then :
++ cat >>confdefs.h <<_ACEOF
++#define HAVE_LIBSELINUX 1
++_ACEOF
++
++ LIBS="-lselinux $LIBS"
++
++fi
++
++
+
+
+
+diff -Naurp insight-8.1.50.20180216.orig/gdb/gdbserver/configure.ac insight-8.1.50.20180216.new/gdb/gdbserver/configure.ac
+--- insight-8.1.50.20180216.orig/gdb/gdbserver/configure.ac 2018-01-18 19:51:21.000000000 +0100
++++ insight-8.1.50.20180216.new/gdb/gdbserver/configure.ac 2018-02-18 00:24:24.302777824 +0100
+@@ -488,6 +488,10 @@ if $want_ipa ; then
+ fi
+ fi
+
++dnl Check security_get_boolean_active availability.
++AC_CHECK_HEADERS(selinux/selinux.h)
++AC_CHECK_LIB(selinux, security_get_boolean_active)
++
+ AC_SUBST(GDBSERVER_DEPFILES)
+ AC_SUBST(GDBSERVER_LIBS)
+ AC_SUBST(srv_xmlbuiltin)
+diff -Naurp insight-8.1.50.20180216.orig/gdb/gdbserver/linux-low.c insight-8.1.50.20180216.new/gdb/gdbserver/linux-low.c
+--- insight-8.1.50.20180216.orig/gdb/gdbserver/linux-low.c 2018-02-09 15:06:40.000000000 +0100
++++ insight-8.1.50.20180216.new/gdb/gdbserver/linux-low.c 2018-02-18 00:48:47.812203733 +0100
+@@ -966,7 +966,16 @@ linux_ptrace_fun ()
+ {
+ if (ptrace (PTRACE_TRACEME, 0, (PTRACE_TYPE_ARG3) 0,
+ (PTRACE_TYPE_ARG4) 0) < 0)
+- trace_start_error_with_name ("ptrace");
++ {
++ int save_errno = errno;
++ std::string msg;
++
++ linux_ptrace_create_warnings (msg);
++ string_appendf (msg, _("Cannot trace created process"));
++
++ errno = save_errno;
++ trace_start_error_with_name (msg.c_str ());
++ }
+
+ if (setpgid (0, 0) < 0)
+ trace_start_error_with_name ("setpgid");
+diff -Naurp insight-8.1.50.20180216.orig/gdb/linux-nat.c insight-8.1.50.20180216.new/gdb/linux-nat.c
+--- insight-8.1.50.20180216.orig/gdb/linux-nat.c 2018-02-16 15:40:15.000000000 +0100
++++ insight-8.1.50.20180216.new/gdb/linux-nat.c 2018-02-18 00:44:21.230638846 +0100
+@@ -1127,7 +1127,24 @@ linux_nat_create_inferior (struct target
+ /* Make sure we report all signals during startup. */
+ linux_nat_pass_signals (ops, 0, NULL);
+
+- linux_ops->to_create_inferior (ops, exec_file, allargs, env, from_tty);
++ volatile struct gdb_exception ex;
++ TRY
++ {
++ linux_ops->to_create_inferior (ops, exec_file, allargs, env, from_tty);
++ }
++ CATCH (ex, RETURN_MASK_ERROR)
++ {
++ std::string buffer;
++ char *message;
++
++ message = xstrdup (ex.message);
++ make_cleanup (xfree, message);
++
++ linux_ptrace_create_warnings (buffer);
++
++ throw_error (ex.error, "%s%s", buffer.c_str (), message);
++ }
++ END_CATCH
+ }
+
+ /* Callback for linux_proc_attach_tgid_threads. Attach to PTID if not
+diff -Naurp insight-8.1.50.20180216.orig/gdb/nat/linux-ptrace.c insight-8.1.50.20180216.new/gdb/nat/linux-ptrace.c
+--- insight-8.1.50.20180216.orig/gdb/nat/linux-ptrace.c 2018-01-26 13:46:47.000000000 +0100
++++ insight-8.1.50.20180216.new/gdb/nat/linux-ptrace.c 2018-02-18 00:53:26.676891379 +0100
+@@ -25,6 +25,10 @@
+ #include <sys/procfs.h>
+ #endif
+
++#ifdef HAVE_SELINUX_SELINUX_H
++# include <selinux/selinux.h>
++#endif /* HAVE_SELINUX_SELINUX_H */
++
+ /* Stores the ptrace options supported by the running kernel.
+ A value of -1 means we did not check for features yet. A value
+ of 0 means there are no supported features. */
+@@ -50,6 +54,8 @@ linux_ptrace_attach_fail_reason (pid_t p
+ "terminated"),
+ (int) pid);
+
++ linux_ptrace_create_warnings (result);
++
+ return result;
+ }
+
+@@ -583,6 +589,22 @@ linux_ptrace_init_warnings (void)
+ linux_ptrace_test_ret_to_nx ();
+ }
+
++/* Print all possible reasons we could fail to create a traced process. */
++
++void
++linux_ptrace_create_warnings (std::string& buffer)
++{
++#ifdef HAVE_LIBSELINUX
++ /* -1 is returned for errors, 0 if it has no effect, 1 if PTRACE_ATTACH is
++ forbidden. */
++ if (security_get_boolean_active ("deny_ptrace") == 1)
++ string_appendf (buffer,
++ _("the SELinux boolean 'deny_ptrace' is enabled, "
++ "you can disable this process attach protection by: "
++ "(gdb) shell sudo setsebool deny_ptrace=0"));
++#endif /* HAVE_LIBSELINUX */
++}
++
+ /* Extract extended ptrace event from wait status. */
+
+ int
+diff -Naurp insight-8.1.50.20180216.orig/gdb/nat/linux-ptrace.h insight-8.1.50.20180216.new/gdb/nat/linux-ptrace.h
+--- insight-8.1.50.20180216.orig/gdb/nat/linux-ptrace.h 2018-01-26 13:46:47.000000000 +0100
++++ insight-8.1.50.20180216.new/gdb/nat/linux-ptrace.h 2018-02-18 00:39:10.140655746 +0100
+@@ -189,6 +189,7 @@ extern std::string linux_ptrace_attach_f
+ extern std::string linux_ptrace_attach_fail_reason_string (ptid_t ptid, int err);
+
+ extern void linux_ptrace_init_warnings (void);
++extern void linux_ptrace_create_warnings (std::string& buffer);
+ extern void linux_check_ptrace_features (void);
+ extern void linux_enable_event_reporting (pid_t pid, int attached);
+ extern void linux_disable_event_reporting (pid_t pid);
diff --git a/insight-8.1-gdb-fedora-libncursesw.patch b/insight-8.1-gdb-fedora-libncursesw.patch
new file mode 100644
index 0000000..79a971f
--- /dev/null
+++ b/insight-8.1-gdb-fedora-libncursesw.patch
@@ -0,0 +1,60 @@
+diff -Naurp insight-8.1.50.20180216.orig/gdb/configure insight-8.1.50.20180216.new/gdb/configure
+--- insight-8.1.50.20180216.orig/gdb/configure 2018-02-18 02:22:43.104874363 +0100
++++ insight-8.1.50.20180216.new/gdb/configure 2018-02-18 02:23:03.691069707 +0100
+@@ -9378,6 +9378,7 @@ if test x"$prefer_curses" = xyes; then
+ # search /usr/local/include, if ncurses is installed in /usr/local. A
+ # default installation of ncurses on alpha*-dec-osf* will lead to such
+ # a situation.
++ # Fedora: Force libncursesw over libncurses to match the includes.
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing waddstr" >&5
+ $as_echo_n "checking for library containing waddstr... " >&6; }
+ if ${ac_cv_search_waddstr+:} false; then :
+@@ -9402,7 +9403,7 @@ return waddstr ();
+ return 0;
+ }
+ _ACEOF
+-for ac_lib in '' ncursesw ncurses cursesX curses; do
++for ac_lib in '' ncursesw; do
+ if test -z "$ac_lib"; then
+ ac_res="none required"
+ else
+@@ -9476,6 +9477,7 @@ case $host_os in
+ esac
+
+ # These are the libraries checked by Readline.
++# Fedora: Force libncursesw over libncurses to match the includes.
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing tgetent" >&5
+ $as_echo_n "checking for library containing tgetent... " >&6; }
+ if ${ac_cv_search_tgetent+:} false; then :
+@@ -9500,7 +9502,7 @@ return tgetent ();
+ return 0;
+ }
+ _ACEOF
+-for ac_lib in '' termcap tinfo curses ncursesw ncurses; do
++for ac_lib in '' termcap tinfo ncursesw; do
+ if test -z "$ac_lib"; then
+ ac_res="none required"
+ else
+diff -Naurp insight-8.1.50.20180216.orig/gdb/configure.ac insight-8.1.50.20180216.new/gdb/configure.ac
+--- insight-8.1.50.20180216.orig/gdb/configure.ac 2018-02-18 02:22:43.104874363 +0100
++++ insight-8.1.50.20180216.new/gdb/configure.ac 2018-02-18 02:23:03.692069716 +0100
+@@ -760,7 +760,8 @@ if test x"$prefer_curses" = xyes; then
+ # search /usr/local/include, if ncurses is installed in /usr/local. A
+ # default installation of ncurses on alpha*-dec-osf* will lead to such
+ # a situation.
+- AC_SEARCH_LIBS(waddstr, [ncursesw ncurses cursesX curses])
++ # Fedora: Force libncursesw over libncurses to match the includes.
++ AC_SEARCH_LIBS(waddstr, [ncursesw])
+
+ if test "$ac_cv_search_waddstr" != no; then
+ curses_found=yes
+@@ -802,7 +803,8 @@ case $host_os in
+ esac
+
+ # These are the libraries checked by Readline.
+-AC_SEARCH_LIBS(tgetent, [termcap tinfo curses ncursesw ncurses])
++# Fedora: Force libncursesw over libncurses to match the includes.
++AC_SEARCH_LIBS(tgetent, [termcap tinfo ncursesw])
+
+ if test "$ac_cv_search_tgetent" = no; then
+ CONFIG_OBS="$CONFIG_OBS stub-termcap.o"
diff --git a/insight-8.1-gdb-rhbz795424-bitpos-20of25.patch b/insight-8.1-gdb-rhbz795424-bitpos-20of25.patch
new file mode 100644
index 0000000..a824597
--- /dev/null
+++ b/insight-8.1-gdb-rhbz795424-bitpos-20of25.patch
@@ -0,0 +1,2946 @@
+diff -Naurp insight-8.1.50.20180216.orig/gdb/aarch64-linux-nat.c insight-8.1.50.20180216.new/gdb/aarch64-linux-nat.c
+--- insight-8.1.50.20180216.orig/gdb/aarch64-linux-nat.c 2018-01-04 17:43:15.000000000 +0100
++++ insight-8.1.50.20180216.new/gdb/aarch64-linux-nat.c 2018-02-18 01:09:36.787116781 +0100
+@@ -708,7 +708,7 @@ aarch64_linux_remove_watchpoint (struct
+
+ static int
+ aarch64_linux_region_ok_for_hw_watchpoint (struct target_ops *self,
+- CORE_ADDR addr, int len)
++ CORE_ADDR addr, LONGEST len)
+ {
+ return aarch64_linux_region_ok_for_watchpoint (addr, len);
+ }
+diff -Naurp insight-8.1.50.20180216.orig/gdb/ada-lang.c insight-8.1.50.20180216.new/gdb/ada-lang.c
+--- insight-8.1.50.20180216.orig/gdb/ada-lang.c 2018-02-16 15:19:06.000000000 +0100
++++ insight-8.1.50.20180216.new/gdb/ada-lang.c 2018-02-18 01:09:36.791116819 +0100
+@@ -78,7 +78,7 @@ static struct type *desc_bounds_type (st
+
+ static struct value *desc_bounds (struct value *);
+
+-static int fat_pntr_bounds_bitpos (struct type *);
++static LONGEST fat_pntr_bounds_bitpos (struct type *);
+
+ static int fat_pntr_bounds_bitsize (struct type *);
+
+@@ -86,13 +86,13 @@ static struct type *desc_data_target_typ
+
+ static struct value *desc_data (struct value *);
+
+-static int fat_pntr_data_bitpos (struct type *);
++static LONGEST fat_pntr_data_bitpos (struct type *);
+
+ static int fat_pntr_data_bitsize (struct type *);
+
+ static struct value *desc_one_bound (struct value *, int, int);
+
+-static int desc_bound_bitpos (struct type *, int, int);
++static LONGEST desc_bound_bitpos (struct type *, int, int);
+
+ static int desc_bound_bitsize (struct type *, int, int);
+
+@@ -175,7 +175,7 @@ static struct type *static_unwrap_type (
+
+ static struct value *unwrap_value (struct value *);
+
+-static struct type *constrained_packed_array_type (struct type *, long *);
++static struct type *constrained_packed_array_type (struct type *, LONGEST *);
+
+ static struct type *decode_constrained_packed_array_type (struct type *);
+
+@@ -190,7 +190,8 @@ static int ada_is_unconstrained_packed_a
+ static struct value *value_subscript_packed (struct value *, int,
+ struct value **);
+
+-static void move_bits (gdb_byte *, int, const gdb_byte *, int, int, int);
++static void move_bits (gdb_byte *, int, const gdb_byte *, LONGEST, LONGEST,
++ int);
+
+ static struct value *coerce_unspec_val_to_type (struct value *,
+ struct type *);
+@@ -216,14 +217,14 @@ static struct value *value_val_atr (stru
+ static struct symbol *standard_lookup (const char *, const struct block *,
+ domain_enum);
+
+-static struct value *ada_search_struct_field (const char *, struct value *, int,
++static struct value *ada_search_struct_field (const char *, struct value *, LONGEST,
+ struct type *);
+
+-static struct value *ada_value_primitive_field (struct value *, int, int,
++static struct value *ada_value_primitive_field (struct value *, LONGEST, int,
+ struct type *);
+
+-static int find_struct_field (const char *, struct type *, int,
+- struct type **, int *, int *, int *, int *);
++static int find_struct_field (const char *, struct type *, LONGEST,
++ struct type **, LONGEST *, int *, int *, int *);
+
+ static int ada_resolve_function (struct block_symbol *, int,
+ struct value **, int, const char *,
+@@ -234,7 +235,7 @@ static int ada_is_direct_array_type (str
+ static void ada_language_arch_info (struct gdbarch *,
+ struct language_arch_info *);
+
+-static struct value *ada_index_struct_field (int, struct value *, int,
++static struct value *ada_index_struct_field (LONGEST, struct value *, LONGEST,
+ struct type *);
+
+ static struct value *assign_aggregate (struct value *, struct value *,
+@@ -697,7 +698,7 @@ coerce_unspec_val_to_type (struct value
+ }
+
+ static const gdb_byte *
+-cond_offset_host (const gdb_byte *valaddr, long offset)
++cond_offset_host (const gdb_byte *valaddr, LONGEST offset)
+ {
+ if (valaddr == NULL)
+ return NULL;
+@@ -706,7 +707,7 @@ cond_offset_host (const gdb_byte *valadd
+ }
+
+ static CORE_ADDR
+-cond_offset_target (CORE_ADDR address, long offset)
++cond_offset_target (CORE_ADDR address, LONGEST offset)
+ {
+ if (address == 0)
+ return 0;
+@@ -1744,7 +1745,7 @@ desc_bounds (struct value *arr)
+ /* If TYPE is the type of an array-descriptor (fat pointer), the bit
+ position of the field containing the address of the bounds data. */
+
+-static int
++static LONGEST
+ fat_pntr_bounds_bitpos (struct type *type)
+ {
+ return TYPE_FIELD_BITPOS (desc_base_type (type), 1);
+@@ -1810,7 +1811,7 @@ desc_data (struct value *arr)
+ /* If TYPE is the type of an array-descriptor (fat pointer), the bit
+ position of the field containing the address of the data. */
+
+-static int
++static LONGEST
+ fat_pntr_data_bitpos (struct type *type)
+ {
+ return TYPE_FIELD_BITPOS (desc_base_type (type), 0);
+@@ -1845,7 +1846,7 @@ desc_one_bound (struct value *bounds, in
+ of the Ith lower bound stored in it, if WHICH is 0, and the Ith upper
+ bound, if WHICH is 1. The first bound is I=1. */
+
+-static int
++static LONGEST
+ desc_bound_bitpos (struct type *type, int i, int which)
+ {
+ return TYPE_FIELD_BITPOS (desc_base_type (type), 2 * i + which - 2);
+@@ -2035,7 +2036,7 @@ ada_type_of_array (struct value *arr, in
+ zero, and does not need to be recomputed. */
+ if (lo < hi)
+ {
+- int array_bitsize =
++ LONGEST array_bitsize =
+ (hi - lo + 1) * TYPE_FIELD_BITSIZE (elt_type, 0);
+
+ TYPE_LENGTH (array_type) = (array_bitsize + 7) / 8;
+@@ -2195,7 +2196,7 @@ decode_packed_array_bitsize (struct type
+ the length is arbitrary. */
+
+ static struct type *
+-constrained_packed_array_type (struct type *type, long *elt_bits)
++constrained_packed_array_type (struct type *type, LONGEST *elt_bits)
+ {
+ struct type *new_elt_type;
+ struct type *new_type;
+@@ -2249,7 +2250,7 @@ decode_constrained_packed_array_type (st
+ char *name;
+ const char *tail;
+ struct type *shadow_type;
+- long bits;
++ LONGEST bits;
+
+ if (!raw_name)
+ raw_name = ada_type_name (desc_base_type (type));
+@@ -2320,7 +2321,8 @@ decode_constrained_packed_array (struct
+ array with no wrapper. In order to interpret the value through
+ the (left-justified) packed array type we just built, we must
+ first left-justify it. */
+- int bit_size, bit_pos;
++ int bit_size;
++ LONGEST bit_pos;
+ ULONGEST mod;
+
+ mod = ada_modulus (value_type (arr)) - 1;
+@@ -2548,7 +2550,7 @@ ada_unpack_from_contents (const gdb_byte
+
+ struct value *
+ ada_value_primitive_packed_val (struct value *obj, const gdb_byte *valaddr,
+- long offset, int bit_offset, int bit_size,
++ LONGEST offset, int bit_offset, int bit_size,
+ struct type *type)
+ {
+ struct value *v;
+@@ -2618,7 +2620,7 @@ ada_value_primitive_packed_val (struct v
+
+ if (obj != NULL)
+ {
+- long new_offset = offset;
++ LONGEST new_offset = offset;
+
+ set_value_component_location (v, obj);
+ set_value_bitpos (v, bit_offset + value_bitpos (obj));
+@@ -2664,7 +2666,7 @@ ada_value_primitive_packed_val (struct v
+ not overlap. */
+ static void
+ move_bits (gdb_byte *target, int targ_offset, const gdb_byte *source,
+- int src_offset, int n, int bits_big_endian_p)
++ LONGEST src_offset, LONGEST n, int bits_big_endian_p)
+ {
+ unsigned int accum, mask;
+ int accum_bits, chunk_size;
+@@ -2754,7 +2756,7 @@ ada_value_assign (struct value *toval, s
+ {
+ int len = (value_bitpos (toval)
+ + bits + HOST_CHAR_BIT - 1) / HOST_CHAR_BIT;
+- int from_size;
++ LONGEST from_size;
+ gdb_byte *buffer = (gdb_byte *) alloca (len);
+ struct value *val;
+ CORE_ADDR to_addr = value_address (toval);
+@@ -2805,7 +2807,7 @@ value_assign_to_component (struct value
+ (LONGEST) (value_address (component) - value_address (container));
+ int bit_offset_in_container =
+ value_bitpos (component) - value_bitpos (container);
+- int bits;
++ LONGEST bits;
+
+ val = value_cast (value_type (component), val);
+
+@@ -4469,7 +4471,7 @@ ensure_lval (struct value *val)
+ if (VALUE_LVAL (val) == not_lval
+ || VALUE_LVAL (val) == lval_internalvar)
+ {
+- int len = TYPE_LENGTH (ada_check_typedef (value_type (val)));
++ LONGEST len = TYPE_LENGTH (ada_check_typedef (value_type (val)));
+ const CORE_ADDR addr =
+ value_as_long (value_allocate_space_in_inferior (len));
+
+@@ -4553,7 +4555,7 @@ static CORE_ADDR
+ value_pointer (struct value *value, struct type *type)
+ {
+ struct gdbarch *gdbarch = get_type_arch (type);
+- unsigned len = TYPE_LENGTH (type);
++ ULONGEST len = TYPE_LENGTH (type);
+ gdb_byte *buf = (gdb_byte *) alloca (len);
+ CORE_ADDR addr;
+
+@@ -6711,7 +6713,7 @@ value_tag_from_contents_and_address (str
+ const gdb_byte *valaddr,
+ CORE_ADDR address)
+ {
+- int tag_byte_offset;
++ LONGEST tag_byte_offset;
+ struct type *tag_type;
+
+ if (find_struct_field ("_tag", type, 0, &tag_type, &tag_byte_offset,
+@@ -7204,7 +7206,7 @@ ada_in_variant (LONGEST val, struct type
+ only in that it can handle packed values of arbitrary type. */
+
+ static struct value *
+-ada_value_primitive_field (struct value *arg1, int offset, int fieldno,
++ada_value_primitive_field (struct value *arg1, LONGEST offset, int fieldno,
+ struct type *arg_type)
+ {
+ struct type *type;
+@@ -7216,7 +7218,7 @@ ada_value_primitive_field (struct value
+
+ if (TYPE_FIELD_BITSIZE (arg_type, fieldno) != 0)
+ {
+- int bit_pos = TYPE_FIELD_BITPOS (arg_type, fieldno);
++ LONGEST bit_pos = TYPE_FIELD_BITPOS (arg_type, fieldno);
+ int bit_size = TYPE_FIELD_BITSIZE (arg_type, fieldno);
+
+ return ada_value_primitive_packed_val (arg1, value_contents (arg1),
+@@ -7293,9 +7295,9 @@ ada_value_primitive_field (struct value
+ Returns 1 if found, 0 otherwise. */
+
+ static int
+-find_struct_field (const char *name, struct type *type, int offset,
++find_struct_field (const char *name, struct type *type, LONGEST offset,
+ struct type **field_type_p,
+- int *byte_offset_p, int *bit_offset_p, int *bit_size_p,
++ LONGEST *byte_offset_p, int *bit_offset_p, int *bit_size_p,
+ int *index_p)
+ {
+ int i;
+@@ -7314,8 +7316,8 @@ find_struct_field (const char *name, str
+
+ for (i = 0; i < TYPE_NFIELDS (type); i += 1)
+ {
+- int bit_pos = TYPE_FIELD_BITPOS (type, i);
+- int fld_offset = offset + bit_pos / 8;
++ LONGEST bit_pos = TYPE_FIELD_BITPOS (type, i);
++ LONGEST fld_offset = offset + bit_pos / 8;
+ const char *t_field_name = TYPE_FIELD_NAME (type, i);
+
+ if (t_field_name == NULL)
+@@ -7417,7 +7419,7 @@ num_visible_fields (struct type *type)
+ long explanation in find_struct_field's function documentation. */
+
+ static struct value *
+-ada_search_struct_field (const char *name, struct value *arg, int offset,
++ada_search_struct_field (const char *name, struct value *arg, LONGEST offset,
+ struct type *type)
+ {
+ int i;
+@@ -7465,7 +7467,7 @@ ada_search_struct_field (const char *nam
+ int j;
+ struct type *field_type = ada_check_typedef (TYPE_FIELD_TYPE (type,
+ i));
+- int var_offset = offset + TYPE_FIELD_BITPOS (type, i) / 8;
++ LONGEST var_offset = offset + TYPE_FIELD_BITPOS (type, i) / 8;
+
+ for (j = 0; j < TYPE_NFIELDS (field_type); j += 1)
+ {
+@@ -7497,8 +7499,8 @@ ada_search_struct_field (const char *nam
+ return NULL;
+ }
+
+-static struct value *ada_index_struct_field_1 (int *, struct value *,
+- int, struct type *);
++static struct value *ada_index_struct_field_1 (LONGEST *, struct value *,
++ LONGEST, struct type *);
+
+
+ /* Return field #INDEX in ARG, where the index is that returned by
+@@ -7507,7 +7509,7 @@ static struct value *ada_index_struct_fi
+ * If found, return value, else return NULL. */
+
+ static struct value *
+-ada_index_struct_field (int index, struct value *arg, int offset,
++ada_index_struct_field (LONGEST index, struct value *arg, LONGEST offset,
+ struct type *type)
+ {
+ return ada_index_struct_field_1 (&index, arg, offset, type);
+@@ -7519,7 +7521,7 @@ ada_index_struct_field (int index, struc
+ * *INDEX_P. */
+
+ static struct value *
+-ada_index_struct_field_1 (int *index_p, struct value *arg, int offset,
++ada_index_struct_field_1 (LONGEST *index_p, struct value *arg, LONGEST offset,
+ struct type *type)
+ {
+ int i;
+@@ -7609,7 +7611,8 @@ ada_value_struct_elt (struct value *arg,
+ v = ada_search_struct_field (name, arg, 0, t);
+ else
+ {
+- int bit_offset, bit_size, byte_offset;
++ int bit_offset, bit_size;
++ LONGEST byte_offset;
+ struct type *field_type;
+ CORE_ADDR address;
+
+@@ -7953,8 +7956,8 @@ ada_coerce_ref (struct value *val0)
+ /* Return OFF rounded upward if necessary to a multiple of
+ ALIGNMENT (a power of 2). */
+
+-static unsigned int
+-align_value (unsigned int off, unsigned int alignment)
++static ULONGEST
++align_value (ULONGEST off, ULONGEST alignment)
+ {
+ return (off + alignment - 1) & ~(alignment - 1);
+ }
+@@ -8348,10 +8351,9 @@ ada_template_to_fixed_record_type_1 (str
+ struct value *mark = value_mark ();
+ struct value *dval;
+ struct type *rtype;
+- int nfields, bit_len;
++ int nfields;
+ int variant_field;
+- long off;
+- int fld_bit_len;
++ LONGEST off, bit_len, fld_bit_len;
+ int f;
+
+ /* Compute the number of fields in this record type that are going
+@@ -8429,7 +8431,7 @@ ada_template_to_fixed_record_type_1 (str
+ that follow this one. */
+ if (ada_is_aligner_type (field_type))
+ {
+- long field_offset = TYPE_FIELD_BITPOS (field_type, f);
++ LONGEST field_offset = TYPE_FIELD_BITPOS (field_type, f);
+
+ field_valaddr = cond_offset_host (field_valaddr, field_offset);
+ field_address = cond_offset_target (field_address, field_offset);
+@@ -8565,11 +8567,11 @@ ada_template_to_fixed_record_type_1 (str
+ if (TYPE_LENGTH (type) <= 0)
+ {
+ if (TYPE_NAME (rtype))
+- warning (_("Invalid type size for `%s' detected: %d."),
+- TYPE_NAME (rtype), TYPE_LENGTH (type));
++ warning (_("Invalid type size for `%s' detected: %s."),
++ TYPE_NAME (rtype), pulongest (TYPE_LENGTH (type)));
+ else
+- warning (_("Invalid type size for <unnamed> detected: %d."),
+- TYPE_LENGTH (type));
++ warning (_("Invalid type size for <unnamed> detected: %s."),
++ pulongest (TYPE_LENGTH (type)));
+ }
+ else
+ {
+@@ -9035,7 +9037,8 @@ to_fixed_array_type (struct type *type0,
+ type was a regular (non-packed) array type. As a result, the
+ bitsize of the array elements needs to be set again, and the array
+ length needs to be recomputed based on that bitsize. */
+- int len = TYPE_LENGTH (result) / TYPE_LENGTH (TYPE_TARGET_TYPE (result));
++ LONGEST len = (TYPE_LENGTH (result)
++ / TYPE_LENGTH (TYPE_TARGET_TYPE (result)));
+ int elt_bitsize = TYPE_FIELD_BITSIZE (type0, 0);
+
+ TYPE_FIELD_BITSIZE (result, 0) = TYPE_FIELD_BITSIZE (type0, 0);
+diff -Naurp insight-8.1.50.20180216.orig/gdb/ada-lang.h insight-8.1.50.20180216.new/gdb/ada-lang.h
+--- insight-8.1.50.20180216.orig/gdb/ada-lang.h 2018-02-16 15:19:06.000000000 +0100
++++ insight-8.1.50.20180216.new/gdb/ada-lang.h 2018-02-18 01:09:36.791116819 +0100
+@@ -175,7 +175,7 @@ extern void ada_print_type (struct type
+ extern void ada_print_typedef (struct type *type, struct symbol *new_symbol,
+ struct ui_file *stream);
+
+-extern void ada_val_print (struct type *, int, CORE_ADDR,
++extern void ada_val_print (struct type *, LONGEST, CORE_ADDR,
+ struct ui_file *, int,
+ struct value *,
+ const struct value_print_options *);
+@@ -190,7 +190,7 @@ extern void ada_emit_char (int, struct t
+ extern void ada_printchar (int, struct type *, struct ui_file *);
+
+ extern void ada_printstr (struct ui_file *, struct type *, const gdb_byte *,
+- unsigned int, const char *, int,
++ ULONGEST, const char *, int,
+ const struct value_print_options *);
+
+ struct value *ada_convert_actual (struct value *actual,
+@@ -262,7 +262,7 @@ extern int ada_is_constrained_packed_arr
+
+ extern struct value *ada_value_primitive_packed_val (struct value *,
+ const gdb_byte *,
+- long, int, int,
++ LONGEST, int, int,
+ struct type *);
+
+ extern struct type *ada_coerce_to_simple_array_type (struct type *);
+diff -Naurp insight-8.1.50.20180216.orig/gdb/ada-typeprint.c insight-8.1.50.20180216.new/gdb/ada-typeprint.c
+--- insight-8.1.50.20180216.orig/gdb/ada-typeprint.c 2018-01-04 17:43:15.000000000 +0100
++++ insight-8.1.50.20180216.new/gdb/ada-typeprint.c 2018-02-18 01:09:36.791116819 +0100
+@@ -896,8 +896,8 @@ ada_print_type (struct type *type0, cons
+ const char *name = ada_type_name (type);
+
+ if (!ada_is_range_type_name (name))
+- fprintf_filtered (stream, _("<%d-byte integer>"),
+- TYPE_LENGTH (type));
++ fprintf_filtered (stream, _("<%s-byte integer>"),
++ pulongest (TYPE_LENGTH (type)));
+ else
+ {
+ fprintf_filtered (stream, "range ");
+@@ -918,7 +918,8 @@ ada_print_type (struct type *type0, cons
+ }
+ break;
+ case TYPE_CODE_FLT:
+- fprintf_filtered (stream, _("<%d-byte float>"), TYPE_LENGTH (type));
++ fprintf_filtered (stream, _("<%s-byte float>"),
++ pulongest (TYPE_LENGTH (type)));
+ break;
+ case TYPE_CODE_ENUM:
+ if (show < 0)
+diff -Naurp insight-8.1.50.20180216.orig/gdb/ada-valprint.c insight-8.1.50.20180216.new/gdb/ada-valprint.c
+--- insight-8.1.50.20180216.orig/gdb/ada-valprint.c 2018-01-12 03:18:43.000000000 +0100
++++ insight-8.1.50.20180216.new/gdb/ada-valprint.c 2018-02-18 01:09:36.792116829 +0100
+@@ -34,11 +34,11 @@
+ #include "target-float.h"
+
+ static int print_field_values (struct type *, const gdb_byte *,
+- int,
++ LONGEST,
+ struct ui_file *, int,
+ struct value *,
+ const struct value_print_options *,
+- int, struct type *, int,
++ int, struct type *, LONGEST,
+ const struct language_defn *);
+
+
+@@ -316,7 +316,7 @@ ada_emit_char (int c, struct type *type,
+ of a character. */
+
+ static int
+-char_at (const gdb_byte *string, int i, int type_len,
++char_at (const gdb_byte *string, LONGEST i, int type_len,
+ enum bfd_endian byte_order)
+ {
+ if (type_len == 1)
+@@ -476,11 +476,11 @@ ada_print_scalar (struct type *type, LON
+
+ static void
+ printstr (struct ui_file *stream, struct type *elttype, const gdb_byte *string,
+- unsigned int length, int force_ellipses, int type_len,
++ ULONGEST length, int force_ellipses, int type_len,
+ const struct value_print_options *options)
+ {
+ enum bfd_endian byte_order = gdbarch_byte_order (get_type_arch (elttype));
+- unsigned int i;
++ ULONGEST i;
+ unsigned int things_printed = 0;
+ int in_quotes = 0;
+ int need_comma = 0;
+@@ -495,9 +495,9 @@ printstr (struct ui_file *stream, struct
+ {
+ /* Position of the character we are examining
+ to see whether it is repeated. */
+- unsigned int rep1;
++ ULONGEST rep1;
+ /* Number of repetitions we have detected so far. */
+- unsigned int reps;
++ ULONGEST reps;
+
+ QUIT;
+
+@@ -528,7 +528,8 @@ printstr (struct ui_file *stream, struct
+ ada_emit_char (char_at (string, i, type_len, byte_order),
+ elttype, stream, '\'', type_len);
+ fputs_filtered ("'", stream);
+- fprintf_filtered (stream, _(" <repeats %u times>"), reps);
++ fprintf_filtered (stream, _(" <repeats %s times>"),
++ pulongest (reps));
+ i = rep1 - 1;
+ things_printed += options->repeat_count_threshold;
+ need_comma = 1;
+@@ -556,7 +557,7 @@ printstr (struct ui_file *stream, struct
+
+ void
+ ada_printstr (struct ui_file *stream, struct type *type,
+- const gdb_byte *string, unsigned int length,
++ const gdb_byte *string, ULONGEST length,
+ const char *encoding, int force_ellipses,
+ const struct value_print_options *options)
+ {
+@@ -566,12 +567,12 @@ ada_printstr (struct ui_file *stream, st
+
+ static int
+ print_variant_part (struct type *type, int field_num,
+- const gdb_byte *valaddr, int offset,
++ const gdb_byte *valaddr, LONGEST offset,
+ struct ui_file *stream, int recurse,
+ struct value *val,
+ const struct value_print_options *options,
+ int comma_needed,
+- struct type *outer_type, int outer_offset,
++ struct type *outer_type, LONGEST outer_offset,
+ const struct language_defn *language)
+ {
+ struct type *var_type = TYPE_FIELD_TYPE (type, field_num);
+@@ -607,11 +608,11 @@ print_variant_part (struct type *type, i
+
+ static int
+ print_field_values (struct type *type, const gdb_byte *valaddr,
+- int offset, struct ui_file *stream, int recurse,
++ LONGEST offset, struct ui_file *stream, int recurse,
+ struct value *val,
+ const struct value_print_options *options,
+ int comma_needed,
+- struct type *outer_type, int outer_offset,
++ struct type *outer_type, LONGEST outer_offset,
+ const struct language_defn *language)
+ {
+ int i, len;
+@@ -677,7 +678,7 @@ print_field_values (struct type *type, c
+ else
+ {
+ struct value *v;
+- int bit_pos = TYPE_FIELD_BITPOS (type, i);
++ LONGEST bit_pos = TYPE_FIELD_BITPOS (type, i);
+ int bit_size = TYPE_FIELD_BITSIZE (type, i);
+ struct value_print_options opts;
+
+@@ -722,8 +723,8 @@ ada_val_print_string (struct type *type,
+ {
+ enum bfd_endian byte_order = gdbarch_byte_order (get_type_arch (type));
+ struct type *elttype = TYPE_TARGET_TYPE (type);
+- unsigned int eltlen;
+- unsigned int len;
++ ULONGEST eltlen;
++ ULONGEST len;
+
+ /* We know that ELTTYPE cannot possibly be null, because we assume
+ that we're called only when TYPE is a string-like type.
+@@ -742,7 +743,7 @@ ada_val_print_string (struct type *type,
+ elements up to it. */
+ if (options->stop_print_at_null)
+ {
+- int temp_len;
++ LONGEST temp_len;
+
+ /* Look for a NULL char. */
+ for (temp_len = 0;
+@@ -1115,7 +1116,7 @@ ada_val_print_ref (struct type *type, co
+
+ static void
+ ada_val_print_1 (struct type *type,
+- int offset, CORE_ADDR address,
++ LONGEST offset, CORE_ADDR address,
+ struct ui_file *stream, int recurse,
+ struct value *original_value,
+ const struct value_print_options *options,
+@@ -1199,7 +1200,7 @@ ada_val_print_1 (struct type *type,
+
+ void
+ ada_val_print (struct type *type,
+- int embedded_offset, CORE_ADDR address,
++ LONGEST embedded_offset, CORE_ADDR address,
+ struct ui_file *stream, int recurse,
+ struct value *val,
+ const struct value_print_options *options)
+diff -Naurp insight-8.1.50.20180216.orig/gdb/amd64-tdep.c insight-8.1.50.20180216.new/gdb/amd64-tdep.c
+--- insight-8.1.50.20180216.orig/gdb/amd64-tdep.c 2018-02-18 01:05:32.134760156 +0100
++++ insight-8.1.50.20180216.new/gdb/amd64-tdep.c 2018-02-18 01:09:36.792116829 +0100
+@@ -726,7 +726,7 @@ amd64_return_value (struct gdbarch *gdba
+ gdb_byte *readbuf, const gdb_byte *writebuf)
+ {
+ enum amd64_reg_class theclass[2];
+- int len = TYPE_LENGTH (type);
++ LONGEST len = TYPE_LENGTH (type);
+ static int integer_regnum[] = { AMD64_RAX_REGNUM, AMD64_RDX_REGNUM };
+ static int sse_regnum[] = { AMD64_XMM0_REGNUM, AMD64_XMM1_REGNUM };
+ int integer_reg = 0;
+@@ -842,11 +842,13 @@ amd64_return_value (struct gdbarch *gdba
+
+ gdb_assert (regnum != -1);
+
++ LONGEST nlen = len < 8 ? len : 8;
++
+ if (readbuf)
+- regcache_raw_read_part (regcache, regnum, offset, std::min (len, 8),
++ regcache_raw_read_part (regcache, regnum, offset, nlen,
+ readbuf + i * 8);
+ if (writebuf)
+- regcache_raw_write_part (regcache, regnum, offset, std::min (len, 8),
++ regcache_raw_write_part (regcache, regnum, offset, nlen,
+ writebuf + i * 8);
+ }
+
+diff -Naurp insight-8.1.50.20180216.orig/gdb/annotate.c insight-8.1.50.20180216.new/gdb/annotate.c
+--- insight-8.1.50.20180216.orig/gdb/annotate.c 2018-01-04 17:43:15.000000000 +0100
++++ insight-8.1.50.20180216.new/gdb/annotate.c 2018-02-18 01:09:36.792116829 +0100
+@@ -531,21 +531,21 @@ annotate_frame_end (void)
+ }
+
+ void
+-annotate_array_section_begin (int idx, struct type *elttype)
++annotate_array_section_begin (LONGEST idx, struct type *elttype)
+ {
+ if (annotation_level == 2)
+ {
+- printf_filtered (("\n\032\032array-section-begin %d "), idx);
++ printf_filtered (("\n\032\032array-section-begin %s "), plongest (idx));
+ print_value_flags (elttype);
+ printf_filtered (("\n"));
+ }
+ }
+
+ void
+-annotate_elt_rep (unsigned int repcount)
++annotate_elt_rep (ULONGEST repcount)
+ {
+ if (annotation_level == 2)
+- printf_filtered (("\n\032\032elt-rep %u\n"), repcount);
++ printf_filtered (("\n\032\032elt-rep %s\n"), pulongest (repcount));
+ }
+
+ void
+diff -Naurp insight-8.1.50.20180216.orig/gdb/annotate.h insight-8.1.50.20180216.new/gdb/annotate.h
+--- insight-8.1.50.20180216.orig/gdb/annotate.h 2018-01-04 17:43:15.000000000 +0100
++++ insight-8.1.50.20180216.new/gdb/annotate.h 2018-02-18 01:09:36.792116829 +0100
+@@ -102,8 +102,8 @@ extern void annotate_frame_source_end (v
+ extern void annotate_frame_where (void);
+ extern void annotate_frame_end (void);
+
+-extern void annotate_array_section_begin (int, struct type *);
+-extern void annotate_elt_rep (unsigned int);
++extern void annotate_array_section_begin (LONGEST, struct type *);
++extern void annotate_elt_rep (ULONGEST);
+ extern void annotate_elt_rep_end (void);
+ extern void annotate_elt (void);
+ extern void annotate_array_section_end (void);
+diff -Naurp insight-8.1.50.20180216.orig/gdb/arch-utils.c insight-8.1.50.20180216.new/gdb/arch-utils.c
+--- insight-8.1.50.20180216.orig/gdb/arch-utils.c 2018-01-04 17:43:15.000000000 +0100
++++ insight-8.1.50.20180216.new/gdb/arch-utils.c 2018-02-18 01:09:36.793116838 +0100
+@@ -228,7 +228,7 @@ legacy_virtual_frame_pointer (struct gdb
+
+ const struct floatformat **
+ default_floatformat_for_type (struct gdbarch *gdbarch,
+- const char *name, int len)
++ const char *name, LONGEST len)
+ {
+ const struct floatformat **format = NULL;
+
+diff -Naurp insight-8.1.50.20180216.orig/gdb/arch-utils.h insight-8.1.50.20180216.new/gdb/arch-utils.h
+--- insight-8.1.50.20180216.orig/gdb/arch-utils.h 2018-01-04 17:43:15.000000000 +0100
++++ insight-8.1.50.20180216.new/gdb/arch-utils.h 2018-02-18 01:09:36.793116838 +0100
+@@ -131,7 +131,7 @@ extern gdbarch_virtual_frame_pointer_fty
+ /* Default implementation of gdbarch_floatformat_for_type. */
+ extern const struct floatformat **
+ default_floatformat_for_type (struct gdbarch *gdbarch,
+- const char *name, int len);
++ const char *name, LONGEST len);
+
+ extern CORE_ADDR generic_skip_trampoline_code (struct frame_info *frame,
+ CORE_ADDR pc);
+diff -Naurp insight-8.1.50.20180216.orig/gdb/arm-linux-nat.c insight-8.1.50.20180216.new/gdb/arm-linux-nat.c
+--- insight-8.1.50.20180216.orig/gdb/arm-linux-nat.c 2018-01-04 17:43:15.000000000 +0100
++++ insight-8.1.50.20180216.new/gdb/arm-linux-nat.c 2018-02-18 01:09:36.793116838 +0100
+@@ -1067,7 +1067,7 @@ arm_linux_remove_hw_breakpoint (struct t
+ ADDR? */
+ static int
+ arm_linux_region_ok_for_hw_watchpoint (struct target_ops *self,
+- CORE_ADDR addr, int len)
++ CORE_ADDR addr, LONGEST len)
+ {
+ const struct arm_linux_hwbp_cap *cap = arm_linux_get_hwbp_cap ();
+ CORE_ADDR max_wp_length, aligned_addr;
+diff -Naurp insight-8.1.50.20180216.orig/gdb/ax-gdb.c insight-8.1.50.20180216.new/gdb/ax-gdb.c
+--- insight-8.1.50.20180216.orig/gdb/ax-gdb.c 2018-01-04 17:43:15.000000000 +0100
++++ insight-8.1.50.20180216.new/gdb/ax-gdb.c 2018-02-18 01:09:36.794116848 +0100
+@@ -82,12 +82,12 @@ static void gen_traced_pop (struct agent
+ static void gen_sign_extend (struct agent_expr *, struct type *);
+ static void gen_extend (struct agent_expr *, struct type *);
+ static void gen_fetch (struct agent_expr *, struct type *);
+-static void gen_left_shift (struct agent_expr *, int);
++static void gen_left_shift (struct agent_expr *, LONGEST);
+
+
+ static void gen_frame_args_address (struct agent_expr *);
+ static void gen_frame_locals_address (struct agent_expr *);
+-static void gen_offset (struct agent_expr *ax, int offset);
++static void gen_offset (struct agent_expr *ax, LONGEST offset);
+ static void gen_sym_offset (struct agent_expr *, struct symbol *);
+ static void gen_var_ref (struct agent_expr *ax, struct axs_value *value,
+ struct symbol *var);
+@@ -132,13 +132,13 @@ static void gen_complement (struct agent
+ static void gen_deref (struct axs_value *);
+ static void gen_address_of (struct axs_value *);
+ static void gen_bitfield_ref (struct agent_expr *ax, struct axs_value *value,
+- struct type *type, int start, int end);
++ struct type *type, LONGEST start, LONGEST end);
+ static void gen_primitive_field (struct agent_expr *ax,
+ struct axs_value *value,
+- int offset, int fieldno, struct type *type);
++ LONGEST offset, int fieldno, struct type *type);
+ static int gen_struct_ref_recursive (struct agent_expr *ax,
+ struct axs_value *value,
+- const char *field, int offset,
++ const char *field, LONGEST offset,
+ struct type *type);
+ static void gen_struct_ref (struct agent_expr *ax,
+ struct axs_value *value,
+@@ -529,7 +529,7 @@ gen_fetch (struct agent_expr *ax, struct
+ right shift it by -DISTANCE bits if DISTANCE < 0. This generates
+ unsigned (logical) right shifts. */
+ static void
+-gen_left_shift (struct agent_expr *ax, int distance)
++gen_left_shift (struct agent_expr *ax, LONGEST distance)
+ {
+ if (distance > 0)
+ {
+@@ -583,7 +583,7 @@ gen_frame_locals_address (struct agent_e
+ programming in ML, it would be clearer why these are the same
+ thing. */
+ static void
+-gen_offset (struct agent_expr *ax, int offset)
++gen_offset (struct agent_expr *ax, LONGEST offset)
+ {
+ /* It would suffice to simply push the offset and add it, but this
+ makes it easier to read positive and negative offsets in the
+@@ -1254,7 +1254,7 @@ gen_address_of (struct axs_value *value)
+ structure. */
+ static void
+ gen_bitfield_ref (struct agent_expr *ax, struct axs_value *value,
+- struct type *type, int start, int end)
++ struct type *type, LONGEST start, LONGEST end)
+ {
+ /* Note that ops[i] fetches 8 << i bits. */
+ static enum agent_op ops[]
+@@ -1289,13 +1289,13 @@ gen_bitfield_ref (struct agent_expr *ax,
+
+ /* The first and one-after-last bits in the field, but rounded down
+ and up to byte boundaries. */
+- int bound_start = (start / TARGET_CHAR_BIT) * TARGET_CHAR_BIT;
+- int bound_end = (((end + TARGET_CHAR_BIT - 1)
+- / TARGET_CHAR_BIT)
+- * TARGET_CHAR_BIT);
++ LONGEST bound_start = (start / TARGET_CHAR_BIT) * TARGET_CHAR_BIT;
++ LONGEST bound_end = (((end + TARGET_CHAR_BIT - 1)
++ / TARGET_CHAR_BIT)
++ * TARGET_CHAR_BIT);
+
+ /* current bit offset within the structure */
+- int offset;
++ LONGEST offset;
+
+ /* The index in ops of the opcode we're considering. */
+ int op;
+@@ -1413,7 +1413,7 @@ gen_bitfield_ref (struct agent_expr *ax,
+
+ static void
+ gen_primitive_field (struct agent_expr *ax, struct axs_value *value,
+- int offset, int fieldno, struct type *type)
++ LONGEST offset, int fieldno, struct type *type)
+ {
+ /* Is this a bitfield? */
+ if (TYPE_FIELD_PACKED (type, fieldno))
+@@ -1437,7 +1437,7 @@ gen_primitive_field (struct agent_expr *
+
+ static int
+ gen_struct_ref_recursive (struct agent_expr *ax, struct axs_value *value,
+- const char *field, int offset, struct type *type)
++ const char *field, LONGEST offset, struct type *type)
+ {
+ int i, rslt;
+ int nbases = TYPE_N_BASECLASSES (type);
+diff -Naurp insight-8.1.50.20180216.orig/gdb/ax-general.c insight-8.1.50.20180216.new/gdb/ax-general.c
+--- insight-8.1.50.20180216.orig/gdb/ax-general.c 2018-01-04 17:43:15.000000000 +0100
++++ insight-8.1.50.20180216.new/gdb/ax-general.c 2018-02-18 01:09:36.794116848 +0100
+@@ -177,7 +177,7 @@ ax_zero_ext (struct agent_expr *x, int n
+
+ /* Append a trace_quick instruction to EXPR, to record N bytes. */
+ void
+-ax_trace_quick (struct agent_expr *x, int n)
++ax_trace_quick (struct agent_expr *x, LONGEST n)
+ {
+ /* N must fit in a byte. */
+ if (n < 0 || n > 255)
+diff -Naurp insight-8.1.50.20180216.orig/gdb/ax.h insight-8.1.50.20180216.new/gdb/ax.h
+--- insight-8.1.50.20180216.orig/gdb/ax.h 2018-01-04 17:43:15.000000000 +0100
++++ insight-8.1.50.20180216.new/gdb/ax.h 2018-02-18 01:09:36.794116848 +0100
+@@ -193,7 +193,7 @@ extern void ax_ext (struct agent_expr *E
+ extern void ax_zero_ext (struct agent_expr *EXPR, int N);
+
+ /* Append a trace_quick instruction to EXPR, to record N bytes. */
+-extern void ax_trace_quick (struct agent_expr *EXPR, int N);
++extern void ax_trace_quick (struct agent_expr *EXPR, LONGEST N);
+
+ /* Append a goto op to EXPR. OP is the actual op (must be aop_goto or
+ aop_if_goto). We assume we don't know the target offset yet,
+diff -Naurp insight-8.1.50.20180216.orig/gdb/breakpoint.c insight-8.1.50.20180216.new/gdb/breakpoint.c
+--- insight-8.1.50.20180216.orig/gdb/breakpoint.c 2018-02-18 01:05:32.195760744 +0100
++++ insight-8.1.50.20180216.new/gdb/breakpoint.c 2018-02-18 01:09:36.797116876 +0100
+@@ -2064,9 +2064,9 @@ should_be_inserted (struct bp_location *
+ {
+ fprintf_unfiltered (gdb_stdlog,
+ "infrun: stepping past non-steppable watchpoint. "
+- "skipping watchpoint at %s:%d\n",
++ "skipping watchpoint at %s:%s\n",
+ paddress (bl->gdbarch, bl->address),
+- bl->length);
++ plongest (bl->length));
+ }
+ return 0;
+ }
+@@ -6851,7 +6851,7 @@ breakpoint_address_match (const address_
+ static int
+ breakpoint_address_match_range (const address_space *aspace1,
+ CORE_ADDR addr1,
+- int len1, const address_space *aspace2,
++ LONGEST len1, const address_space *aspace2,
+ CORE_ADDR addr2)
+ {
+ return ((gdbarch_has_global_breakpoints (target_gdbarch ())
+@@ -10978,7 +10978,7 @@ can_use_hardware_watchpoint (struct valu
+ && TYPE_CODE (vtype) != TYPE_CODE_ARRAY))
+ {
+ CORE_ADDR vaddr = value_address (v);
+- int len;
++ LONGEST len;
+ int num_regs;
+
+ len = (target_exact_watchpoints
+diff -Naurp insight-8.1.50.20180216.orig/gdb/breakpoint.h insight-8.1.50.20180216.new/gdb/breakpoint.h
+--- insight-8.1.50.20180216.orig/gdb/breakpoint.h 2018-02-18 01:05:32.187760667 +0100
++++ insight-8.1.50.20180216.new/gdb/breakpoint.h 2018-02-18 01:09:36.797116876 +0100
+@@ -252,7 +252,7 @@ struct bp_target_info
+
+ /* If this is a ranged breakpoint, then this field contains the
+ length of the range that will be watched for execution. */
+- int length;
++ LONGEST length;
+
+ /* If the breakpoint lives in memory and reading that memory would
+ give back the breakpoint, instead of the original contents, then
+@@ -429,7 +429,7 @@ public:
+ /* For hardware watchpoints, the size of the memory region being
+ watched. For hardware ranged breakpoints, the size of the
+ breakpoint range. */
+- int length = 0;
++ LONGEST length = 0;
+
+ /* Type of hardware watchpoint. */
+ target_hw_bp_type watchpoint_type {};
+diff -Naurp insight-8.1.50.20180216.orig/gdb/c-lang.c insight-8.1.50.20180216.new/gdb/c-lang.c
+--- insight-8.1.50.20180216.orig/gdb/c-lang.c 2018-01-04 17:43:15.000000000 +0100
++++ insight-8.1.50.20180216.new/gdb/c-lang.c 2018-02-18 01:09:36.797116876 +0100
+@@ -184,7 +184,7 @@ c_printchar (int c, struct type *type, s
+
+ void
+ c_printstr (struct ui_file *stream, struct type *type,
+- const gdb_byte *string, unsigned int length,
++ const gdb_byte *string, ULONGEST length,
+ const char *user_encoding, int force_ellipses,
+ const struct value_print_options *options)
+ {
+@@ -666,7 +666,7 @@ evaluate_subexp_c (struct type *expect_t
+ }
+ else
+ {
+- int i;
++ LONGEST i;
+
+ /* Write the terminating character. */
+ for (i = 0; i < TYPE_LENGTH (type); ++i)
+@@ -675,7 +675,7 @@ evaluate_subexp_c (struct type *expect_t
+ if (satisfy_expected)
+ {
+ LONGEST low_bound, high_bound;
+- int element_size = TYPE_LENGTH (type);
++ LONGEST element_size = TYPE_LENGTH (type);
+
+ if (get_discrete_bounds (TYPE_INDEX_TYPE (expect_type),
+ &low_bound, &high_bound) < 0)
+diff -Naurp insight-8.1.50.20180216.orig/gdb/c-lang.h insight-8.1.50.20180216.new/gdb/c-lang.h
+--- insight-8.1.50.20180216.orig/gdb/c-lang.h 2018-01-04 17:43:15.000000000 +0100
++++ insight-8.1.50.20180216.new/gdb/c-lang.h 2018-02-18 01:09:36.797116876 +0100
+@@ -77,7 +77,7 @@ extern void c_print_typedef (struct type
+ struct ui_file *);
+
+ extern void c_val_print (struct type *,
+- int, CORE_ADDR,
++ LONGEST, CORE_ADDR,
+ struct ui_file *, int,
+ struct value *,
+ const struct value_print_options *);
+@@ -97,7 +97,7 @@ extern void c_printchar (int, struct typ
+ extern void c_printstr (struct ui_file * stream,
+ struct type *elttype,
+ const gdb_byte *string,
+- unsigned int length,
++ ULONGEST length,
+ const char *user_encoding,
+ int force_ellipses,
+ const struct value_print_options *options);
+diff -Naurp insight-8.1.50.20180216.orig/gdb/compile/compile-c-support.c insight-8.1.50.20180216.new/gdb/compile/compile-c-support.c
+--- insight-8.1.50.20180216.orig/gdb/compile/compile-c-support.c 2018-02-09 15:06:40.000000000 +0100
++++ insight-8.1.50.20180216.new/gdb/compile/compile-c-support.c 2018-02-18 01:09:36.797116876 +0100
+@@ -307,11 +307,11 @@ generate_register_struct (struct ui_file
+
+ default:
+ fprintf_unfiltered (stream,
+- " unsigned char %s[%d]"
++ " unsigned char %s[%s]"
+ " __attribute__((__aligned__("
+ "__BIGGEST_ALIGNMENT__)))",
+ regname.c_str (),
+- TYPE_LENGTH (regtype));
++ pulongest (TYPE_LENGTH (regtype)));
+ }
+ fputs_unfiltered (";\n", stream);
+ }
+diff -Naurp insight-8.1.50.20180216.orig/gdb/cp-abi.c insight-8.1.50.20180216.new/gdb/cp-abi.c
+--- insight-8.1.50.20180216.orig/gdb/cp-abi.c 2018-01-04 17:43:15.000000000 +0100
++++ insight-8.1.50.20180216.new/gdb/cp-abi.c 2018-02-18 01:09:36.798116886 +0100
+@@ -64,12 +64,12 @@ is_operator_name (const char *name)
+ return (*current_cp_abi.is_operator_name) (name);
+ }
+
+-int
++LONGEST
+ baseclass_offset (struct type *type, int index, const gdb_byte *valaddr,
+ LONGEST embedded_offset, CORE_ADDR address,
+ const struct value *val)
+ {
+- int res = 0;
++ LONGEST res = 0;
+
+ gdb_assert (current_cp_abi.baseclass_offset != NULL);
+
+@@ -96,7 +96,7 @@ baseclass_offset (struct type *type, int
+ struct value *
+ value_virtual_fn_field (struct value **arg1p,
+ struct fn_field *f, int j,
+- struct type *type, int offset)
++ struct type *type, LONGEST offset)
+ {
+ if ((current_cp_abi.virtual_fn_field) == NULL)
+ return NULL;
+diff -Naurp insight-8.1.50.20180216.orig/gdb/cp-abi.h insight-8.1.50.20180216.new/gdb/cp-abi.h
+--- insight-8.1.50.20180216.orig/gdb/cp-abi.h 2018-01-04 17:43:15.000000000 +0100
++++ insight-8.1.50.20180216.new/gdb/cp-abi.h 2018-02-18 01:09:36.798116886 +0100
+@@ -108,7 +108,7 @@ extern struct value *value_virtual_fn_fi
+ struct fn_field *f,
+ int j,
+ struct type *type,
+- int offset);
++ LONGEST offset);
+
+
+ /* Try to find the run-time type of VALUE, using C++ run-time type
+@@ -144,11 +144,11 @@ extern struct type *value_rtti_type (str
+ contents of VAL. The result is the offset of the baseclass value
+ relative to (the address of)(ARG) + OFFSET. */
+
+-extern int baseclass_offset (struct type *type,
+- int index, const gdb_byte *valaddr,
+- LONGEST embedded_offset,
+- CORE_ADDR address,
+- const struct value *val);
++extern LONGEST baseclass_offset (struct type *type,
++ int index, const gdb_byte *valaddr,
++ LONGEST embedded_offset,
++ CORE_ADDR address,
++ const struct value *val);
+
+ /* Describe the target of a pointer to method. CONTENTS is the byte
+ pattern representing the pointer to method. TYPE is the pointer to
+@@ -226,12 +226,12 @@ struct cp_abi_ops
+ struct value *(*virtual_fn_field) (struct value **arg1p,
+ struct fn_field * f,
+ int j, struct type * type,
+- int offset);
++ LONGEST offset);
+ struct type *(*rtti_type) (struct value *v, int *full,
+ LONGEST *top, int *using_enc);
+- int (*baseclass_offset) (struct type *type, int index,
+- const bfd_byte *valaddr, LONGEST embedded_offset,
+- CORE_ADDR address, const struct value *val);
++ LONGEST (*baseclass_offset) (struct type *type, int index,
++ const bfd_byte *valaddr, LONGEST embedded_offset,
++ CORE_ADDR address, const struct value *val);
+ void (*print_method_ptr) (const gdb_byte *contents,
+ struct type *type,
+ struct ui_file *stream);
+diff -Naurp insight-8.1.50.20180216.orig/gdb/cp-valprint.c insight-8.1.50.20180216.new/gdb/cp-valprint.c
+--- insight-8.1.50.20180216.orig/gdb/cp-valprint.c 2018-01-04 17:43:15.000000000 +0100
++++ insight-8.1.50.20180216.new/gdb/cp-valprint.c 2018-02-18 01:09:36.798116886 +0100
+@@ -335,7 +335,7 @@ cp_print_value_fields (struct type *type
+ }
+ else if (i == vptr_fieldno && type == vptr_basetype)
+ {
+- int i_offset = offset + TYPE_FIELD_BITPOS (type, i) / 8;
++ LONGEST i_offset = offset + TYPE_FIELD_BITPOS (type, i) / 8;
+ struct type *i_type = TYPE_FIELD_TYPE (type, i);
+
+ if (valprint_check_validity (stream, i_type, i_offset, val))
+diff -Naurp insight-8.1.50.20180216.orig/gdb/c-typeprint.c insight-8.1.50.20180216.new/gdb/c-typeprint.c
+--- insight-8.1.50.20180216.orig/gdb/c-typeprint.c 2018-01-04 17:43:15.000000000 +0100
++++ insight-8.1.50.20180216.new/gdb/c-typeprint.c 2018-02-18 01:09:36.797116876 +0100
+@@ -933,7 +933,8 @@ c_print_type_union_field_offset (struct
+ {
+ struct type *ftype = check_typedef (TYPE_FIELD_TYPE (type, field_idx));
+
+- fprintf_filtered (stream, "/* %4u */", TYPE_LENGTH (ftype));
++ fprintf_filtered (stream, "/* %4s */",
++ pulongest (TYPE_LENGTH (ftype)));
+ }
+
+ /* Print information about field at index FIELD_IDX of the struct type
+@@ -1507,8 +1508,8 @@ c_type_print_base_struct_union (struct t
+ print_spaces_filtered_with_print_options (level + 4,
+ stream,
+ flags);
+- fprintf_filtered (stream, "/* total size (bytes): %4u */\n",
+- TYPE_LENGTH (type));
++ fprintf_filtered (stream, "/* total size (bytes): %4s */\n",
++ pulongest (TYPE_LENGTH (type)));
+ }
+
+ print_spaces_filtered (OFFSET_SPC_LEN, stream);
+diff -Naurp insight-8.1.50.20180216.orig/gdb/c-valprint.c insight-8.1.50.20180216.new/gdb/c-valprint.c
+--- insight-8.1.50.20180216.orig/gdb/c-valprint.c 2018-02-18 01:05:32.114759963 +0100
++++ insight-8.1.50.20180216.new/gdb/c-valprint.c 2018-02-18 01:09:36.797116876 +0100
+@@ -247,7 +247,7 @@ c_val_print_array (struct type *type, co
+ if (TYPE_LENGTH (type) > 0 && TYPE_LENGTH (unresolved_elttype) > 0)
+ {
+ LONGEST low_bound, high_bound;
+- int eltlen, len;
++ LONGEST eltlen, len;
+ struct gdbarch *gdbarch = get_type_arch (type);
+ enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
+ unsigned int i = 0; /* Number of characters printed. */
+@@ -321,8 +321,8 @@ c_val_print_array (struct type *type, co
+ if (cp_is_vtbl_ptr_type (elttype))
+ {
+ i = 1;
+- fprintf_filtered (stream, _("%d vtable entries"),
+- len - 1);
++ fprintf_filtered (stream, _("%s vtable entries"),
++ plongest (len - 1));
+ }
+ else
+ {
+@@ -399,7 +399,7 @@ c_val_print_struct (struct type *type, c
+ -fvtable_thunks. (Otherwise, look under
+ TYPE_CODE_PTR.) */
+ struct gdbarch *gdbarch = get_type_arch (type);
+- int offset = (embedded_offset
++ LONGEST offset = (embedded_offset
+ + TYPE_FIELD_BITPOS (type,
+ VTBL_FNADDR_OFFSET) / 8);
+ struct type *field_type = TYPE_FIELD_TYPE (type, VTBL_FNADDR_OFFSET);
+@@ -498,7 +498,7 @@ c_val_print_memberptr (struct type *type
+
+ void
+ c_val_print (struct type *type,
+- int embedded_offset, CORE_ADDR address,
++ LONGEST embedded_offset, CORE_ADDR address,
+ struct ui_file *stream, int recurse,
+ struct value *original_value,
+ const struct value_print_options *options)
+diff -Naurp insight-8.1.50.20180216.orig/gdb/d-lang.h insight-8.1.50.20180216.new/gdb/d-lang.h
+--- insight-8.1.50.20180216.orig/gdb/d-lang.h 2018-01-04 17:43:15.000000000 +0100
++++ insight-8.1.50.20180216.new/gdb/d-lang.h 2018-02-18 01:09:36.798116886 +0100
+@@ -81,7 +81,7 @@ extern struct block_symbol d_lookup_nest
+ /* Defined in d-valprint.c */
+
+ extern void d_val_print (struct type *type,
+- int embedded_offset, CORE_ADDR address,
++ LONGEST embedded_offset, CORE_ADDR address,
+ struct ui_file *stream, int recurse,
+ struct value *val,
+ const struct value_print_options *options);
+diff -Naurp insight-8.1.50.20180216.orig/gdb/d-valprint.c insight-8.1.50.20180216.new/gdb/d-valprint.c
+--- insight-8.1.50.20180216.orig/gdb/d-valprint.c 2018-01-04 17:43:15.000000000 +0100
++++ insight-8.1.50.20180216.new/gdb/d-valprint.c 2018-02-18 01:09:36.798116886 +0100
+@@ -73,7 +73,7 @@ dynamic_array_type (struct type *type,
+
+ /* Implements the la_val_print routine for language D. */
+ void
+-d_val_print (struct type *type, int embedded_offset,
++d_val_print (struct type *type, LONGEST embedded_offset,
+ CORE_ADDR address, struct ui_file *stream, int recurse,
+ struct value *val,
+ const struct value_print_options *options)
+diff -Naurp insight-8.1.50.20180216.orig/gdb/dwarf2loc.c insight-8.1.50.20180216.new/gdb/dwarf2loc.c
+--- insight-8.1.50.20180216.orig/gdb/dwarf2loc.c 2018-02-18 01:05:32.125760069 +0100
++++ insight-8.1.50.20180216.new/gdb/dwarf2loc.c 2018-02-18 01:09:36.798116886 +0100
+@@ -1817,7 +1817,7 @@ rw_pieced_value (struct value *v, struct
+ for (; i < c->pieces.size () && offset < max_offset; i++)
+ {
+ struct dwarf_expr_piece *p = &c->pieces[i];
+- size_t this_size_bits, this_size;
++ ULONGEST this_size_bits, this_size;
+
+ this_size_bits = p->size - bits_to_skip;
+ if (this_size_bits > max_offset - offset)
+@@ -2064,7 +2064,7 @@ write_pieced_value (struct value *to, st
+
+ static int
+ check_pieced_synthetic_pointer (const struct value *value, LONGEST bit_offset,
+- int bit_length)
++ LONGEST bit_length)
+ {
+ struct piece_closure *c
+ = (struct piece_closure *) value_computed_closure (value);
+@@ -2077,7 +2077,7 @@ check_pieced_synthetic_pointer (const st
+ for (i = 0; i < c->pieces.size () && bit_length > 0; i++)
+ {
+ struct dwarf_expr_piece *p = &c->pieces[i];
+- size_t this_size_bits = p->size;
++ ULONGEST this_size_bits = p->size;
+
+ if (bit_offset > 0)
+ {
+@@ -2179,8 +2179,8 @@ indirect_pieced_value (struct value *val
+ = (struct piece_closure *) value_computed_closure (value);
+ struct type *type;
+ struct frame_info *frame;
+- int i, bit_length;
+- LONGEST bit_offset;
++ int i;
++ LONGEST bit_length, bit_offset;
+ struct dwarf_expr_piece *piece = NULL;
+ LONGEST byte_offset;
+ enum bfd_endian byte_order;
+@@ -2197,7 +2197,7 @@ indirect_pieced_value (struct value *val
+ for (i = 0; i < c->pieces.size () && bit_length > 0; i++)
+ {
+ struct dwarf_expr_piece *p = &c->pieces[i];
+- size_t this_size_bits = p->size;
++ ULONGEST this_size_bits = p->size;
+
+ if (bit_offset > 0)
+ {
+@@ -2486,9 +2486,9 @@ if (frame != NULL) select_frame (frame);
+ case DWARF_VALUE_STACK:
+ {
+ struct value *value = ctx.fetch (0);
+- size_t n = TYPE_LENGTH (value_type (value));
+- size_t len = TYPE_LENGTH (subobj_type);
+- size_t max = TYPE_LENGTH (type);
++ ULONGEST n = TYPE_LENGTH (value_type (value));
++ ULONGEST len = TYPE_LENGTH (subobj_type);
++ ULONGEST max = TYPE_LENGTH (type);
+ struct gdbarch *objfile_gdbarch = get_objfile_arch (objfile);
+
+ if (subobj_byte_offset + len > max)
+diff -Naurp insight-8.1.50.20180216.orig/gdb/dwarf2read.c insight-8.1.50.20180216.new/gdb/dwarf2read.c
+--- insight-8.1.50.20180216.orig/gdb/dwarf2read.c 2018-02-18 01:05:32.211760898 +0100
++++ insight-8.1.50.20180216.new/gdb/dwarf2read.c 2018-02-18 01:09:36.800116905 +0100
+@@ -2337,12 +2337,12 @@ dwarf2_complex_location_expr_complaint (
+ }
+
+ static void
+-dwarf2_const_value_length_mismatch_complaint (const char *arg1, int arg2,
+- int arg3)
++dwarf2_const_value_length_mismatch_complaint (const char *arg1, LONGEST arg2,
++ LONGEST arg3)
+ {
+ complaint (&symfile_complaints,
+- _("const value length mismatch for '%s', got %d, expected %d"),
+- arg1, arg2, arg3);
++ _("const value length mismatch for '%s', got %s, expected %s"),
++ arg1, plongest (arg2), plongest (arg3));
+ }
+
+ static void
+@@ -15191,8 +15191,8 @@ dwarf2_add_field (struct field_info *fip
+ object, and then subtract off the number of bits of
+ the field itself. The result is the bit offset of
+ the LSB of the field. */
+- int anonymous_size;
+- int bit_offset = DW_UNSND (attr);
++ LONGEST anonymous_size;
++ LONGEST bit_offset = DW_UNSND (attr);
+
+ attr = dwarf2_attr (die, DW_AT_byte_size, cu);
+ if (attr)
+diff -Naurp insight-8.1.50.20180216.orig/gdb/eval.c insight-8.1.50.20180216.new/gdb/eval.c
+--- insight-8.1.50.20180216.orig/gdb/eval.c 2018-02-18 01:05:32.108759905 +0100
++++ insight-8.1.50.20180216.new/gdb/eval.c 2018-02-18 01:09:36.801116914 +0100
+@@ -302,7 +302,8 @@ evaluate_struct_tuple (struct value *str
+ while (--nargs >= 0)
+ {
+ struct value *val = NULL;
+- int bitpos, bitsize;
++ LONGEST bitpos;
++ int bitsize;
+ bfd_byte *addr;
+
+ fieldno++;
+@@ -363,7 +364,7 @@ init_array_element (struct value *array,
+ enum noside noside, LONGEST low_bound, LONGEST high_bound)
+ {
+ LONGEST index;
+- int element_size = TYPE_LENGTH (value_type (element));
++ LONGEST element_size = TYPE_LENGTH (value_type (element));
+
+ if (exp->elts[*pos].opcode == BINOP_COMMA)
+ {
+@@ -807,11 +808,11 @@ binop_promote (const struct language_def
+ /* FIXME: Also mixed integral/booleans, with result an integer. */
+ {
+ const struct builtin_type *builtin = builtin_type (gdbarch);
+- unsigned int promoted_len1 = TYPE_LENGTH (type1);
+- unsigned int promoted_len2 = TYPE_LENGTH (type2);
++ ULONGEST promoted_len1 = TYPE_LENGTH (type1);
++ ULONGEST promoted_len2 = TYPE_LENGTH (type2);
+ int is_unsigned1 = TYPE_UNSIGNED (type1);
+ int is_unsigned2 = TYPE_UNSIGNED (type2);
+- unsigned int result_len;
++ ULONGEST result_len;
+ int unsigned_operation;
+
+ /* Determine type length and signedness after promotion for
+@@ -1548,7 +1549,7 @@ evaluate_subexp_standard (struct type *e
+ struct value **argvec;
+ int code;
+ int ix;
+- long mem_offset;
++ LONGEST mem_offset;
+ struct type **arg_types;
+
+ pc = (*pos)++;
+@@ -1731,7 +1732,7 @@ evaluate_subexp_standard (struct type *e
+ struct type *range_type = TYPE_INDEX_TYPE (type);
+ struct type *element_type = TYPE_TARGET_TYPE (type);
+ struct value *array = allocate_value (expect_type);
+- int element_size = TYPE_LENGTH (check_typedef (element_type));
++ LONGEST element_size = TYPE_LENGTH (check_typedef (element_type));
+ LONGEST low_bound, high_bound, index;
+
+ if (get_discrete_bounds (range_type, &low_bound, &high_bound) < 0)
+diff -Naurp insight-8.1.50.20180216.orig/gdb/findvar.c insight-8.1.50.20180216.new/gdb/findvar.c
+--- insight-8.1.50.20180216.orig/gdb/findvar.c 2018-01-04 17:43:15.000000000 +0100
++++ insight-8.1.50.20180216.new/gdb/findvar.c 2018-02-18 01:09:36.801116914 +0100
+@@ -821,7 +821,7 @@ struct value *
+ default_value_from_register (struct gdbarch *gdbarch, struct type *type,
+ int regnum, struct frame_id frame_id)
+ {
+- int len = TYPE_LENGTH (type);
++ LONGEST len = TYPE_LENGTH (type);
+ struct value *value = allocate_value (type);
+ struct frame_info *frame;
+
+@@ -865,7 +865,7 @@ read_frame_register_value (struct value
+ LONGEST offset = 0;
+ LONGEST reg_offset = value_offset (value);
+ int regnum = VALUE_REGNUM (value);
+- int len = type_length_units (check_typedef (value_type (value)));
++ LONGEST len = type_length_units (check_typedef (value_type (value)));
+
+ gdb_assert (VALUE_LVAL (value) == lval_register);
+
+@@ -880,7 +880,7 @@ read_frame_register_value (struct value
+ while (len > 0)
+ {
+ struct value *regval = get_frame_register_value (frame, regnum);
+- int reg_len = type_length_units (value_type (regval)) - reg_offset;
++ LONGEST reg_len = type_length_units (value_type (regval)) - reg_offset;
+
+ /* If the register length is larger than the number of bytes
+ remaining to copy, then only copy the appropriate bytes. */
+diff -Naurp insight-8.1.50.20180216.orig/gdb/f-lang.c insight-8.1.50.20180216.new/gdb/f-lang.c
+--- insight-8.1.50.20180216.orig/gdb/f-lang.c 2018-01-04 17:43:15.000000000 +0100
++++ insight-8.1.50.20180216.new/gdb/f-lang.c 2018-02-18 01:09:36.801116914 +0100
+@@ -101,7 +101,7 @@ f_printchar (int c, struct type *type, s
+
+ static void
+ f_printstr (struct ui_file *stream, struct type *type, const gdb_byte *string,
+- unsigned int length, const char *encoding, int force_ellipses,
++ ULONGEST length, const char *encoding, int force_ellipses,
+ const struct value_print_options *options)
+ {
+ const char *type_encoding = f_get_encoding (type);
+diff -Naurp insight-8.1.50.20180216.orig/gdb/f-lang.h insight-8.1.50.20180216.new/gdb/f-lang.h
+--- insight-8.1.50.20180216.orig/gdb/f-lang.h 2018-01-04 17:43:15.000000000 +0100
++++ insight-8.1.50.20180216.new/gdb/f-lang.h 2018-02-18 01:09:36.801116914 +0100
+@@ -30,7 +30,7 @@ extern void f_yyerror (const char *); /*
+ extern void f_print_type (struct type *, const char *, struct ui_file *, int,
+ int, const struct type_print_options *);
+
+-extern void f_val_print (struct type *, int, CORE_ADDR,
++extern void f_val_print (struct type *, LONGEST, CORE_ADDR,
+ struct ui_file *, int,
+ struct value *,
+ const struct value_print_options *);
+diff -Naurp insight-8.1.50.20180216.orig/gdb/frame.c insight-8.1.50.20180216.new/gdb/frame.c
+--- insight-8.1.50.20180216.orig/gdb/frame.c 2018-01-04 17:43:15.000000000 +0100
++++ insight-8.1.50.20180216.new/gdb/frame.c 2018-02-18 01:09:36.801116914 +0100
+@@ -1386,7 +1386,7 @@ deprecated_frame_register_read (struct f
+
+ int
+ get_frame_register_bytes (struct frame_info *frame, int regnum,
+- CORE_ADDR offset, int len, gdb_byte *myaddr,
++ CORE_ADDR offset, LONGEST len, gdb_byte *myaddr,
+ int *optimizedp, int *unavailablep)
+ {
+ struct gdbarch *gdbarch = get_frame_arch (frame);
+@@ -1415,7 +1415,7 @@ get_frame_register_bytes (struct frame_i
+ }
+ if (len > maxsize)
+ error (_("Bad debug information detected: "
+- "Attempt to read %d bytes from registers."), len);
++ "Attempt to read %s bytes from registers."), plongest (len));
+
+ /* Copy the data. */
+ while (len > 0)
+diff -Naurp insight-8.1.50.20180216.orig/gdb/frame.h insight-8.1.50.20180216.new/gdb/frame.h
+--- insight-8.1.50.20180216.orig/gdb/frame.h 2018-01-04 17:43:15.000000000 +0100
++++ insight-8.1.50.20180216.new/gdb/frame.h 2018-02-18 01:09:36.801116914 +0100
+@@ -601,7 +601,7 @@ extern void put_frame_register (struct f
+ contents are optimized out or unavailable, set *OPTIMIZEDP,
+ *UNAVAILABLEP accordingly. */
+ extern int get_frame_register_bytes (struct frame_info *frame, int regnum,
+- CORE_ADDR offset, int len,
++ CORE_ADDR offset, LONGEST len,
+ gdb_byte *myaddr,
+ int *optimizedp, int *unavailablep);
+
+diff -Naurp insight-8.1.50.20180216.orig/gdb/f-valprint.c insight-8.1.50.20180216.new/gdb/f-valprint.c
+--- insight-8.1.50.20180216.orig/gdb/f-valprint.c 2018-02-18 01:05:32.109759915 +0100
++++ insight-8.1.50.20180216.new/gdb/f-valprint.c 2018-02-18 01:09:36.801116914 +0100
+@@ -36,7 +36,7 @@
+
+ static void f77_get_dynamic_length_of_aggregate (struct type *);
+
+-int f77_array_offset_tbl[MAX_FORTRAN_DIMS + 1][2];
++LONGEST f77_array_offset_tbl[MAX_FORTRAN_DIMS + 1][2];
+
+ /* Array which holds offsets to be applied to get a row's elements
+ for a given array. Array also holds the size of each subarray. */
+@@ -71,8 +71,8 @@ f77_get_upperbound (struct type *type)
+ static void
+ f77_get_dynamic_length_of_aggregate (struct type *type)
+ {
+- int upper_bound = -1;
+- int lower_bound = 1;
++ LONGEST upper_bound = -1;
++ LONGEST lower_bound = 1;
+
+ /* Recursively go all the way down into a possibly multi-dimensional
+ F77 array and get the bounds. For simple arrays, this is pretty
+@@ -104,7 +104,7 @@ f77_get_dynamic_length_of_aggregate (str
+ static void
+ f77_print_array_1 (int nss, int ndimensions, struct type *type,
+ const gdb_byte *valaddr,
+- int embedded_offset, CORE_ADDR address,
++ LONGEST embedded_offset, CORE_ADDR address,
+ struct ui_file *stream, int recurse,
+ const struct value *val,
+ const struct value_print_options *options,
+@@ -113,7 +113,7 @@ f77_print_array_1 (int nss, int ndimensi
+ struct type *range_type = TYPE_INDEX_TYPE (check_typedef (type));
+ CORE_ADDR addr = address + embedded_offset;
+ LONGEST lowerbound, upperbound;
+- int i;
++ LONGEST i;
+
+ get_discrete_bounds (range_type, &lowerbound, &upperbound);
+
+@@ -175,7 +175,7 @@ f77_print_array_1 (int nss, int ndimensi
+
+ static void
+ f77_print_array (struct type *type, const gdb_byte *valaddr,
+- int embedded_offset,
++ LONGEST embedded_offset,
+ CORE_ADDR address, struct ui_file *stream,
+ int recurse,
+ const struct value *val,
+@@ -214,7 +214,7 @@ static const struct generic_val_print_de
+ function; they are identical. */
+
+ void
+-f_val_print (struct type *type, int embedded_offset,
++f_val_print (struct type *type, LONGEST embedded_offset,
+ CORE_ADDR address, struct ui_file *stream, int recurse,
+ struct value *original_value,
+ const struct value_print_options *options)
+diff -Naurp insight-8.1.50.20180216.orig/gdb/gdbarch.c insight-8.1.50.20180216.new/gdb/gdbarch.c
+--- insight-8.1.50.20180216.orig/gdb/gdbarch.c 2018-01-04 17:43:15.000000000 +0100
++++ insight-8.1.50.20180216.new/gdb/gdbarch.c 2018-02-18 01:09:36.802116924 +0100
+@@ -1811,7 +1811,7 @@ set_gdbarch_wchar_signed (struct gdbarch
+ }
+
+ const struct floatformat **
+-gdbarch_floatformat_for_type (struct gdbarch *gdbarch, const char *name, int length)
++gdbarch_floatformat_for_type (struct gdbarch *gdbarch, const char *name, LONGEST length)
+ {
+ gdb_assert (gdbarch != NULL);
+ gdb_assert (gdbarch->floatformat_for_type != NULL);
+diff -Naurp insight-8.1.50.20180216.orig/gdb/gdbarch.h insight-8.1.50.20180216.new/gdb/gdbarch.h
+--- insight-8.1.50.20180216.orig/gdb/gdbarch.h 2018-01-04 17:43:15.000000000 +0100
++++ insight-8.1.50.20180216.new/gdb/gdbarch.h 2018-02-18 01:09:36.802116924 +0100
+@@ -198,8 +198,8 @@ extern void set_gdbarch_wchar_signed (st
+ NAME, if non-NULL, is the type name, which may be used to distinguish
+ different target formats of the same length. */
+
+-typedef const struct floatformat ** (gdbarch_floatformat_for_type_ftype) (struct gdbarch *gdbarch, const char *name, int length);
+-extern const struct floatformat ** gdbarch_floatformat_for_type (struct gdbarch *gdbarch, const char *name, int length);
++typedef const struct floatformat ** (gdbarch_floatformat_for_type_ftype) (struct gdbarch *gdbarch, const char *name, LONGEST length);
++extern const struct floatformat ** gdbarch_floatformat_for_type (struct gdbarch *gdbarch, const char *name, LONGEST length);
+ extern void set_gdbarch_floatformat_for_type (struct gdbarch *gdbarch, gdbarch_floatformat_for_type_ftype *floatformat_for_type);
+
+ /* For most targets, a pointer on the target and its representation as an
+diff -Naurp insight-8.1.50.20180216.orig/gdb/gdbarch.sh insight-8.1.50.20180216.new/gdb/gdbarch.sh
+--- insight-8.1.50.20180216.orig/gdb/gdbarch.sh 2018-01-04 17:43:15.000000000 +0100
++++ insight-8.1.50.20180216.new/gdb/gdbarch.sh 2018-02-18 01:09:36.802116924 +0100
+@@ -388,7 +388,7 @@ v;int;wchar_signed;;;1;-1;1
+ # Returns the floating-point format to be used for values of length LENGTH.
+ # NAME, if non-NULL, is the type name, which may be used to distinguish
+ # different target formats of the same length.
+-m;const struct floatformat **;floatformat_for_type;const char *name, int length;name, length;0;default_floatformat_for_type;;0
++m;const struct floatformat **;floatformat_for_type;const char *name, LONGEST length;name, length;0;default_floatformat_for_type;;0
+
+ # For most targets, a pointer on the target and its representation as an
+ # address in GDB have the same size and "look the same". For such a
+diff -Naurp insight-8.1.50.20180216.orig/gdb/gdbtypes.c insight-8.1.50.20180216.new/gdb/gdbtypes.c
+--- insight-8.1.50.20180216.orig/gdb/gdbtypes.c 2018-02-18 01:05:32.120760021 +0100
++++ insight-8.1.50.20180216.new/gdb/gdbtypes.c 2018-02-18 01:09:36.803116933 +0100
+@@ -2925,7 +2925,7 @@ floatformat_from_type (const struct type
+ least as long as OBJFILE. */
+
+ struct type *
+-init_type (struct objfile *objfile, enum type_code code, int bit,
++init_type (struct objfile *objfile, enum type_code code, LONGEST bit,
+ const char *name)
+ {
+ struct type *type;
+@@ -3257,8 +3257,8 @@ is_public_ancestor (struct type *base, s
+
+ static int
+ is_unique_ancestor_worker (struct type *base, struct type *dclass,
+- int *offset,
+- const gdb_byte *valaddr, int embedded_offset,
++ LONGEST *offset,
++ const gdb_byte *valaddr, LONGEST embedded_offset,
+ CORE_ADDR address, struct value *val)
+ {
+ int i, count = 0;
+@@ -3269,7 +3269,7 @@ is_unique_ancestor_worker (struct type *
+ for (i = 0; i < TYPE_N_BASECLASSES (dclass) && count < 2; ++i)
+ {
+ struct type *iter;
+- int this_offset;
++ LONGEST this_offset;
+
+ iter = check_typedef (TYPE_BASECLASS (dclass, i));
+
+@@ -3310,7 +3310,7 @@ is_unique_ancestor_worker (struct type *
+ int
+ is_unique_ancestor (struct type *base, struct value *val)
+ {
+- int offset = -1;
++ LONGEST offset = -1;
+
+ return is_unique_ancestor_worker (base, value_type (val), &offset,
+ value_contents_for_printing (val),
+@@ -4555,7 +4555,7 @@ recursive_dump_type (struct type *type,
+ break;
+ }
+ puts_filtered ("\n");
+- printfi_filtered (spaces, "length %d\n", TYPE_LENGTH (type));
++ printfi_filtered (spaces, "length %s\n", pulongest (TYPE_LENGTH (type)));
+ if (TYPE_OBJFILE_OWNED (type))
+ {
+ printfi_filtered (spaces, "objfile ");
+@@ -4996,7 +4996,7 @@ copy_type (const struct type *type)
+
+ struct type *
+ arch_type (struct gdbarch *gdbarch,
+- enum type_code code, int bit, const char *name)
++ enum type_code code, LONGEST bit, const char *name)
+ {
+ struct type *type;
+
+diff -Naurp insight-8.1.50.20180216.orig/gdb/gdbtypes.h insight-8.1.50.20180216.new/gdb/gdbtypes.h
+--- insight-8.1.50.20180216.orig/gdb/gdbtypes.h 2018-02-18 01:05:32.183760628 +0100
++++ insight-8.1.50.20180216.new/gdb/gdbtypes.h 2018-02-18 01:09:36.803116933 +0100
+@@ -805,7 +805,7 @@ struct type
+ type_length_units function should be used in order to get the length
+ expressed in target addressable memory units. */
+
+- unsigned int length;
++ ULONGEST length;
+
+ /* * Core type, shared by a group of qualified types. */
+
+@@ -1707,7 +1707,7 @@ extern unsigned int type_length_units (s
+
+ /* * Helper function to construct objfile-owned types. */
+
+-extern struct type *init_type (struct objfile *, enum type_code, int,
++extern struct type *init_type (struct objfile *, enum type_code, LONGEST,
+ const char *);
+ extern struct type *init_integer_type (struct objfile *, int, int,
+ const char *);
+@@ -1724,7 +1724,7 @@ extern struct type *init_pointer_type (s
+ struct type *);
+
+ /* Helper functions to construct architecture-owned types. */
+-extern struct type *arch_type (struct gdbarch *, enum type_code, int,
++extern struct type *arch_type (struct gdbarch *, enum type_code, LONGEST,
+ const char *);
+ extern struct type *arch_integer_type (struct gdbarch *, int, int,
+ const char *);
+diff -Naurp insight-8.1.50.20180216.orig/gdb/gnu-v2-abi.c insight-8.1.50.20180216.new/gdb/gnu-v2-abi.c
+--- insight-8.1.50.20180216.orig/gdb/gnu-v2-abi.c 2018-01-04 17:43:15.000000000 +0100
++++ insight-8.1.50.20180216.new/gdb/gnu-v2-abi.c 2018-02-18 01:09:36.803116933 +0100
+@@ -82,7 +82,7 @@ gnuv2_is_operator_name (const char *name
+ TYPE is the type in which F is located. */
+ static struct value *
+ gnuv2_virtual_fn_field (struct value **arg1p, struct fn_field * f, int j,
+- struct type * type, int offset)
++ struct type *type, LONGEST offset)
+ {
+ struct value *arg1 = *arg1p;
+ struct type *type1 = check_typedef (value_type (arg1));
+@@ -338,7 +338,7 @@ vb_match (struct type *type, int index,
+ target). The result is the offset of the baseclass value relative
+ to (the address of)(ARG) + OFFSET. */
+
+-static int
++static LONGEST
+ gnuv2_baseclass_offset (struct type *type, int index,
+ const bfd_byte *valaddr, LONGEST embedded_offset,
+ CORE_ADDR address, const struct value *val)
+@@ -358,8 +358,7 @@ gnuv2_baseclass_offset (struct type *typ
+ if (vb_match (type, i, basetype))
+ {
+ struct type *field_type;
+- LONGEST field_offset;
+- int field_length;
++ LONGEST field_offset, field_length;
+ CORE_ADDR addr;
+
+ field_type = check_typedef (TYPE_FIELD_TYPE (type, i));
+@@ -383,7 +382,7 @@ gnuv2_baseclass_offset (struct type *typ
+ /* Don't go through baseclass_offset, as that wraps
+ exceptions, thus, inner exceptions would be wrapped more
+ than once. */
+- int boffset =
++ LONGEST boffset =
+ gnuv2_baseclass_offset (type, i, valaddr,
+ embedded_offset, address, val);
+
+diff -Naurp insight-8.1.50.20180216.orig/gdb/gnu-v3-abi.c insight-8.1.50.20180216.new/gdb/gnu-v3-abi.c
+--- insight-8.1.50.20180216.orig/gdb/gnu-v3-abi.c 2018-01-04 17:43:15.000000000 +0100
++++ insight-8.1.50.20180216.new/gdb/gnu-v3-abi.c 2018-02-18 01:09:36.803116933 +0100
+@@ -109,7 +109,7 @@ build_gdb_vtable_type (struct gdbarch *a
+ {
+ struct type *t;
+ struct field *field_list, *field;
+- int offset;
++ LONGEST offset;
+
+ struct type *void_ptr_type
+ = builtin_type (arch)->builtin_data_ptr;
+@@ -185,7 +185,7 @@ vtable_ptrdiff_type (struct gdbarch *gdb
+ /* Return the offset from the start of the imaginary `struct
+ gdb_gnu_v3_abi_vtable' object to the vtable's "address point"
+ (i.e., where objects' virtual table pointers point). */
+-static int
++static LONGEST
+ vtable_address_point_offset (struct gdbarch *gdbarch)
+ {
+ struct type *vtable_type
+@@ -408,7 +408,7 @@ gnuv3_get_virtual_fn (struct gdbarch *gd
+ static struct value *
+ gnuv3_virtual_fn_field (struct value **value_p,
+ struct fn_field *f, int j,
+- struct type *vfn_base, int offset)
++ struct type *vfn_base, LONGEST offset)
+ {
+ struct type *values_type = check_typedef (value_type (*value_p));
+ struct gdbarch *gdbarch;
+@@ -438,7 +438,7 @@ gnuv3_virtual_fn_field (struct value **v
+
+ -1 is returned on error. */
+
+-static int
++static LONGEST
+ gnuv3_baseclass_offset (struct type *type, int index,
+ const bfd_byte *valaddr, LONGEST embedded_offset,
+ CORE_ADDR address, const struct value *val)
+@@ -447,7 +447,7 @@ gnuv3_baseclass_offset (struct type *typ
+ struct type *ptr_type;
+ struct value *vtable;
+ struct value *vbase_array;
+- long int cur_base_offset, base_offset;
++ LONGEST cur_base_offset, base_offset;
+
+ /* Determine architecture. */
+ gdbarch = get_type_arch (type);
+@@ -470,7 +470,7 @@ gnuv3_baseclass_offset (struct type *typ
+ cur_base_offset = cur_base_offset + vtable_address_point_offset (gdbarch);
+ if ((- cur_base_offset) % TYPE_LENGTH (ptr_type) != 0)
+ error (_("Misaligned vbase offset."));
+- cur_base_offset = cur_base_offset / ((int) TYPE_LENGTH (ptr_type));
++ cur_base_offset = cur_base_offset / ((LONGEST) TYPE_LENGTH (ptr_type));
+
+ vtable = gnuv3_get_vtable (gdbarch, type, address + embedded_offset);
+ gdb_assert (vtable != NULL);
+@@ -514,7 +514,7 @@ gnuv3_find_method_in (struct type *domai
+ we're out of luck. */
+ for (i = 0; i < TYPE_N_BASECLASSES (domain); i++)
+ {
+- int pos;
++ LONGEST pos;
+ struct type *basetype;
+
+ if (BASETYPE_VIA_VIRTUAL (domain, i))
+diff -Naurp insight-8.1.50.20180216.orig/gdb/go-lang.h insight-8.1.50.20180216.new/gdb/go-lang.h
+--- insight-8.1.50.20180216.orig/gdb/go-lang.h 2018-01-04 17:43:15.000000000 +0100
++++ insight-8.1.50.20180216.new/gdb/go-lang.h 2018-02-18 01:09:36.803116933 +0100
+@@ -85,7 +85,7 @@ extern void go_print_type (struct type *
+ /* Defined in go-valprint.c. */
+
+ extern void go_val_print (struct type *type,
+- int embedded_offset, CORE_ADDR address,
++ LONGEST embedded_offset, CORE_ADDR address,
+ struct ui_file *stream, int recurse,
+ struct value *val,
+ const struct value_print_options *options);
+diff -Naurp insight-8.1.50.20180216.orig/gdb/go-valprint.c insight-8.1.50.20180216.new/gdb/go-valprint.c
+--- insight-8.1.50.20180216.orig/gdb/go-valprint.c 2018-01-04 17:43:15.000000000 +0100
++++ insight-8.1.50.20180216.new/gdb/go-valprint.c 2018-02-18 01:09:36.803116933 +0100
+@@ -86,7 +86,7 @@ print_go_string (struct type *type,
+ /* Implements the la_val_print routine for language Go. */
+
+ void
+-go_val_print (struct type *type, int embedded_offset,
++go_val_print (struct type *type, LONGEST embedded_offset,
+ CORE_ADDR address, struct ui_file *stream, int recurse,
+ struct value *val,
+ const struct value_print_options *options)
+diff -Naurp insight-8.1.50.20180216.orig/gdb/i386-tdep.c insight-8.1.50.20180216.new/gdb/i386-tdep.c
+--- insight-8.1.50.20180216.orig/gdb/i386-tdep.c 2018-02-18 01:05:32.134760156 +0100
++++ insight-8.1.50.20180216.new/gdb/i386-tdep.c 2018-02-18 01:09:36.804116943 +0100
+@@ -8163,7 +8163,7 @@ i386_fast_tracepoint_valid_at (struct gd
+
+ const struct floatformat **
+ i386_floatformat_for_type (struct gdbarch *gdbarch,
+- const char *name, int len)
++ const char *name, LONGEST len)
+ {
+ if (len == 128 && name)
+ if (strcmp (name, "__float128") == 0
+diff -Naurp insight-8.1.50.20180216.orig/gdb/language.c insight-8.1.50.20180216.new/gdb/language.c
+--- insight-8.1.50.20180216.orig/gdb/language.c 2018-01-12 03:18:43.000000000 +0100
++++ insight-8.1.50.20180216.new/gdb/language.c 2018-02-18 01:09:36.804116943 +0100
+@@ -773,7 +773,7 @@ unk_lang_printchar (int c, struct type *
+
+ static void
+ unk_lang_printstr (struct ui_file *stream, struct type *type,
+- const gdb_byte *string, unsigned int length,
++ const gdb_byte *string, ULONGEST length,
+ const char *encoding, int force_ellipses,
+ const struct value_print_options *options)
+ {
+@@ -792,7 +792,7 @@ unk_lang_print_type (struct type *type,
+
+ static void
+ unk_lang_val_print (struct type *type,
+- int embedded_offset, CORE_ADDR address,
++ LONGEST embedded_offset, CORE_ADDR address,
+ struct ui_file *stream, int recurse,
+ struct value *val,
+ const struct value_print_options *options)
+diff -Naurp insight-8.1.50.20180216.orig/gdb/language.h insight-8.1.50.20180216.new/gdb/language.h
+--- insight-8.1.50.20180216.orig/gdb/language.h 2018-01-12 03:18:43.000000000 +0100
++++ insight-8.1.50.20180216.new/gdb/language.h 2018-02-18 01:09:36.804116943 +0100
+@@ -188,7 +188,7 @@ struct language_defn
+ struct ui_file * stream);
+
+ void (*la_printstr) (struct ui_file * stream, struct type *elttype,
+- const gdb_byte *string, unsigned int length,
++ const gdb_byte *string, ULONGEST length,
+ const char *encoding, int force_ellipses,
+ const struct value_print_options *);
+
+@@ -226,7 +226,7 @@ struct language_defn
+ printing. */
+
+ void (*la_val_print) (struct type *type,
+- int embedded_offset, CORE_ADDR address,
++ LONGEST embedded_offset, CORE_ADDR address,
+ struct ui_file *stream, int recurse,
+ struct value *val,
+ const struct value_print_options *options);
+diff -Naurp insight-8.1.50.20180216.orig/gdb/m2-lang.c insight-8.1.50.20180216.new/gdb/m2-lang.c
+--- insight-8.1.50.20180216.orig/gdb/m2-lang.c 2018-01-04 17:43:15.000000000 +0100
++++ insight-8.1.50.20180216.new/gdb/m2-lang.c 2018-02-18 01:09:36.804116943 +0100
+@@ -103,10 +103,10 @@ m2_printchar (int c, struct type *type,
+
+ static void
+ m2_printstr (struct ui_file *stream, struct type *type, const gdb_byte *string,
+- unsigned int length, const char *encoding, int force_ellipses,
++ ULONGEST length, const char *encoding, int force_ellipses,
+ const struct value_print_options *options)
+ {
+- unsigned int i;
++ ULONGEST i;
+ unsigned int things_printed = 0;
+ int in_quotes = 0;
+ int need_comma = 0;
+@@ -121,9 +121,9 @@ m2_printstr (struct ui_file *stream, str
+ {
+ /* Position of the character we are examining
+ to see whether it is repeated. */
+- unsigned int rep1;
++ ULONGEST rep1;
+ /* Number of repetitions we have detected so far. */
+- unsigned int reps;
++ ULONGEST reps;
+
+ QUIT;
+
+@@ -149,7 +149,7 @@ m2_printstr (struct ui_file *stream, str
+ in_quotes = 0;
+ }
+ m2_printchar (string[i], type, stream);
+- fprintf_filtered (stream, " <repeats %u times>", reps);
++ fprintf_filtered (stream, " <repeats %s times>", pulongest (reps));
+ i = rep1 - 1;
+ things_printed += options->repeat_count_threshold;
+ need_comma = 1;
+diff -Naurp insight-8.1.50.20180216.orig/gdb/m2-lang.h insight-8.1.50.20180216.new/gdb/m2-lang.h
+--- insight-8.1.50.20180216.orig/gdb/m2-lang.h 2018-01-04 17:43:15.000000000 +0100
++++ insight-8.1.50.20180216.new/gdb/m2-lang.h 2018-02-18 01:09:36.804116943 +0100
+@@ -34,7 +34,7 @@ extern void m2_print_typedef (struct typ
+ extern int m2_is_long_set (struct type *type);
+ extern int m2_is_unbounded_array (struct type *type);
+
+-extern void m2_val_print (struct type *, int, CORE_ADDR,
++extern void m2_val_print (struct type *, LONGEST, CORE_ADDR,
+ struct ui_file *, int,
+ struct value *,
+ const struct value_print_options *);
+diff -Naurp insight-8.1.50.20180216.orig/gdb/m2-typeprint.c insight-8.1.50.20180216.new/gdb/m2-typeprint.c
+--- insight-8.1.50.20180216.orig/gdb/m2-typeprint.c 2018-01-04 17:43:15.000000000 +0100
++++ insight-8.1.50.20180216.new/gdb/m2-typeprint.c 2018-02-18 01:09:36.804116943 +0100
+@@ -234,9 +234,12 @@ static void m2_array (struct type *type,
+ m2_print_bounds (TYPE_INDEX_TYPE (type), stream, show, -1, 1);
+ }
+ else
+- fprintf_filtered (stream, "%d",
+- (TYPE_LENGTH (type)
+- / TYPE_LENGTH (TYPE_TARGET_TYPE (type))));
++ {
++ ULONGEST val = (TYPE_LENGTH (type)
++ / TYPE_LENGTH (TYPE_TARGET_TYPE (type)));
++
++ fprintf_filtered (stream, "%s", pulongest (val));
++ }
+ }
+ fprintf_filtered (stream, "] OF ");
+ m2_print_type (TYPE_TARGET_TYPE (type), "", stream, show, level, flags);
+diff -Naurp insight-8.1.50.20180216.orig/gdb/m2-valprint.c insight-8.1.50.20180216.new/gdb/m2-valprint.c
+--- insight-8.1.50.20180216.orig/gdb/m2-valprint.c 2018-01-04 17:43:15.000000000 +0100
++++ insight-8.1.50.20180216.new/gdb/m2-valprint.c 2018-02-18 01:09:36.804116943 +0100
+@@ -35,7 +35,7 @@ static int print_unpacked_pointer (struc
+ struct ui_file *stream);
+ static void
+ m2_print_array_contents (struct type *type, const gdb_byte *valaddr,
+- int embedded_offset, CORE_ADDR address,
++ LONGEST embedded_offset, CORE_ADDR address,
+ struct ui_file *stream, int recurse,
+ struct value *val,
+ const struct value_print_options *options,
+@@ -67,7 +67,7 @@ get_long_set_bounds (struct type *type,
+
+ static void
+ m2_print_long_set (struct type *type, const gdb_byte *valaddr,
+- int embedded_offset, CORE_ADDR address,
++ LONGEST embedded_offset, CORE_ADDR address,
+ struct ui_file *stream)
+ {
+ int empty_set = 1;
+@@ -158,7 +158,7 @@ m2_print_long_set (struct type *type, co
+
+ static void
+ m2_print_unbounded_array (struct type *type, const gdb_byte *valaddr,
+- int embedded_offset, CORE_ADDR address,
++ LONGEST embedded_offset, CORE_ADDR address,
+ struct ui_file *stream, int recurse,
+ const struct value_print_options *options)
+ {
+@@ -260,7 +260,7 @@ print_variable_at_address (struct type *
+
+ static void
+ m2_print_array_contents (struct type *type, const gdb_byte *valaddr,
+- int embedded_offset, CORE_ADDR address,
++ LONGEST embedded_offset, CORE_ADDR address,
+ struct ui_file *stream, int recurse,
+ struct value *val,
+ const struct value_print_options *options,
+@@ -308,12 +308,12 @@ static const struct generic_val_print_de
+ function; they are identical. */
+
+ void
+-m2_val_print (struct type *type, int embedded_offset,
++m2_val_print (struct type *type, LONGEST embedded_offset,
+ CORE_ADDR address, struct ui_file *stream, int recurse,
+ struct value *original_value,
+ const struct value_print_options *options)
+ {
+- unsigned len;
++ ULONGEST len;
+ struct type *elttype;
+ CORE_ADDR addr;
+ const gdb_byte *valaddr = value_contents_for_printing (original_value);
+@@ -339,7 +339,7 @@ m2_val_print (struct type *type, int emb
+ elements up to it. */
+ if (options->stop_print_at_null)
+ {
+- unsigned int temp_len;
++ ULONGEST temp_len;
+
+ /* Look for a NULL char. */
+ for (temp_len = 0;
+@@ -415,7 +415,7 @@ m2_val_print (struct type *type, int emb
+ {
+ struct type *range = elttype;
+ LONGEST low_bound, high_bound;
+- int i;
++ LONGEST i;
+ int need_comma = 0;
+
+ fputs_filtered ("{", stream);
+diff -Naurp insight-8.1.50.20180216.orig/gdb/memrange.c insight-8.1.50.20180216.new/gdb/memrange.c
+--- insight-8.1.50.20180216.orig/gdb/memrange.c 2018-01-04 17:43:15.000000000 +0100
++++ insight-8.1.50.20180216.new/gdb/memrange.c 2018-02-18 01:09:36.804116943 +0100
+@@ -22,8 +22,8 @@
+ #include <algorithm>
+
+ int
+-mem_ranges_overlap (CORE_ADDR start1, int len1,
+- CORE_ADDR start2, int len2)
++mem_ranges_overlap (CORE_ADDR start1, LONGEST len1,
++ CORE_ADDR start2, LONGEST len2)
+ {
+ ULONGEST h, l;
+
+diff -Naurp insight-8.1.50.20180216.orig/gdb/memrange.h insight-8.1.50.20180216.new/gdb/memrange.h
+--- insight-8.1.50.20180216.orig/gdb/memrange.h 2018-01-04 17:43:15.000000000 +0100
++++ insight-8.1.50.20180216.new/gdb/memrange.h 2018-02-18 01:09:36.804116943 +0100
+@@ -28,7 +28,7 @@ struct mem_range
+ {
+ mem_range () = default;
+
+- mem_range (CORE_ADDR start_, int length_)
++ mem_range (CORE_ADDR start_, LONGEST length_)
+ : start (start_), length (length_)
+ {}
+
+@@ -47,14 +47,14 @@ struct mem_range
+ CORE_ADDR start;
+
+ /* Length of the range. */
+- int length;
++ LONGEST length;
+ };
+
+ /* Returns true if the ranges defined by [start1, start1+len1) and
+ [start2, start2+len2) overlap. */
+
+-extern int mem_ranges_overlap (CORE_ADDR start1, int len1,
+- CORE_ADDR start2, int len2);
++extern int mem_ranges_overlap (CORE_ADDR start1, LONGEST len1,
++ CORE_ADDR start2, LONGEST len2);
+
+ /* Returns true if ADDR is in RANGE. */
+
+diff -Naurp insight-8.1.50.20180216.orig/gdb/mips-linux-nat.c insight-8.1.50.20180216.new/gdb/mips-linux-nat.c
+--- insight-8.1.50.20180216.orig/gdb/mips-linux-nat.c 2018-01-04 17:43:15.000000000 +0100
++++ insight-8.1.50.20180216.new/gdb/mips-linux-nat.c 2018-02-18 01:09:36.804116943 +0100
+@@ -579,7 +579,7 @@ mips_linux_stopped_data_address (struct
+
+ static int
+ mips_linux_region_ok_for_hw_watchpoint (struct target_ops *self,
+- CORE_ADDR addr, int len)
++ CORE_ADDR addr, LONGEST len)
+ {
+ struct pt_watch_regs dummy_regs;
+ int i;
+diff -Naurp insight-8.1.50.20180216.orig/gdb/nat/x86-dregs.c insight-8.1.50.20180216.new/gdb/nat/x86-dregs.c
+--- insight-8.1.50.20180216.orig/gdb/nat/x86-dregs.c 2018-01-04 17:43:15.000000000 +0100
++++ insight-8.1.50.20180216.new/gdb/nat/x86-dregs.c 2018-02-18 01:09:36.804116943 +0100
+@@ -380,7 +380,7 @@ x86_remove_aligned_watchpoint (struct x8
+
+ static int
+ x86_handle_nonaligned_watchpoint (struct x86_debug_reg_state *state,
+- x86_wp_op_t what, CORE_ADDR addr, int len,
++ x86_wp_op_t what, CORE_ADDR addr, LONGEST len,
+ enum target_hw_bp_type type)
+ {
+ int retval = 0;
+@@ -548,7 +548,7 @@ x86_dr_remove_watchpoint (struct x86_deb
+
+ int
+ x86_dr_region_ok_for_watchpoint (struct x86_debug_reg_state *state,
+- CORE_ADDR addr, int len)
++ CORE_ADDR addr, LONGEST len)
+ {
+ int nregs;
+
+diff -Naurp insight-8.1.50.20180216.orig/gdb/nat/x86-dregs.h insight-8.1.50.20180216.new/gdb/nat/x86-dregs.h
+--- insight-8.1.50.20180216.orig/gdb/nat/x86-dregs.h 2018-01-04 17:43:15.000000000 +0100
++++ insight-8.1.50.20180216.new/gdb/nat/x86-dregs.h 2018-02-18 01:09:36.805116952 +0100
+@@ -116,7 +116,7 @@ extern int x86_dr_remove_watchpoint (str
+ /* Return non-zero if we can watch a memory region that starts at
+ address ADDR and whose length is LEN bytes. */
+ extern int x86_dr_region_ok_for_watchpoint (struct x86_debug_reg_state *state,
+- CORE_ADDR addr, int len);
++ CORE_ADDR addr, LONGEST len);
+
+ /* If the inferior has some break/watchpoint that triggered, set the
+ address associated with that break/watchpoint and return true.
+diff -Naurp insight-8.1.50.20180216.orig/gdb/opencl-lang.c insight-8.1.50.20180216.new/gdb/opencl-lang.c
+--- insight-8.1.50.20180216.orig/gdb/opencl-lang.c 2018-01-04 17:43:15.000000000 +0100
++++ insight-8.1.50.20180216.new/gdb/opencl-lang.c 2018-02-18 01:09:36.805116952 +0100
+@@ -76,11 +76,11 @@ builtin_opencl_type (struct gdbarch *gdb
+
+ static struct type *
+ lookup_opencl_vector_type (struct gdbarch *gdbarch, enum type_code code,
+- unsigned int el_length, unsigned int flag_unsigned,
++ ULONGEST el_length, unsigned int flag_unsigned,
+ int n)
+ {
+ int i;
+- unsigned int length;
++ ULONGEST length;
+ struct type *type = NULL;
+ struct type **types = builtin_opencl_type (gdbarch);
+
+@@ -172,7 +172,7 @@ lval_func_read (struct value *v)
+ struct type *eltype = TYPE_TARGET_TYPE (check_typedef (value_type (c->val)));
+ LONGEST offset = value_offset (v);
+ LONGEST elsize = TYPE_LENGTH (eltype);
+- int n, i, j = 0;
++ LONGEST n, i, j = 0;
+ LONGEST lowb = 0;
+ LONGEST highb = 0;
+
+@@ -201,7 +201,7 @@ lval_func_write (struct value *v, struct
+ struct type *eltype = TYPE_TARGET_TYPE (check_typedef (value_type (c->val)));
+ LONGEST offset = value_offset (v);
+ LONGEST elsize = TYPE_LENGTH (eltype);
+- int n, i, j = 0;
++ LONGEST n, i, j = 0;
+ LONGEST lowb = 0;
+ LONGEST highb = 0;
+
+@@ -241,17 +241,17 @@ lval_func_write (struct value *v, struct
+
+ static int
+ lval_func_check_synthetic_pointer (const struct value *v,
+- LONGEST offset, int length)
++ LONGEST offset, LONGEST length)
+ {
+ struct lval_closure *c = (struct lval_closure *) value_computed_closure (v);
+ /* Size of the target type in bits. */
+- int elsize =
++ LONGEST elsize =
+ TYPE_LENGTH (TYPE_TARGET_TYPE (check_typedef (value_type (c->val)))) * 8;
+- int startrest = offset % elsize;
+- int start = offset / elsize;
+- int endrest = (offset + length) % elsize;
+- int end = (offset + length) / elsize;
+- int i;
++ LONGEST startrest = offset % elsize;
++ LONGEST start = offset / elsize;
++ LONGEST endrest = (offset + length) % elsize;
++ LONGEST end = (offset + length) / elsize;
++ LONGEST i;
+
+ if (endrest)
+ end++;
+@@ -261,8 +261,8 @@ lval_func_check_synthetic_pointer (const
+
+ for (i = start; i < end; i++)
+ {
+- int comp_offset = (i == start) ? startrest : 0;
+- int comp_length = (i == end) ? endrest : elsize;
++ LONGEST comp_offset = (i == start) ? startrest : 0;
++ LONGEST comp_length = (i == end) ? endrest : elsize;
+
+ if (!value_bits_synthetic_pointer (c->val,
+ c->indices[i] * elsize + comp_offset,
+diff -Naurp insight-8.1.50.20180216.orig/gdb/p-lang.c insight-8.1.50.20180216.new/gdb/p-lang.c
+--- insight-8.1.50.20180216.orig/gdb/p-lang.c 2018-01-04 17:43:15.000000000 +0100
++++ insight-8.1.50.20180216.new/gdb/p-lang.c 2018-02-18 01:09:36.805116952 +0100
+@@ -93,8 +93,8 @@ pascal_main_name (void)
+ are not multiple of TARGET_CHAR_BIT then the results are wrong
+ but this does not happen for Free Pascal nor for GPC. */
+ int
+-is_pascal_string_type (struct type *type,int *length_pos,
+- int *length_size, int *string_pos,
++is_pascal_string_type (struct type *type, LONGEST *length_pos,
++ LONGEST *length_size, LONGEST *string_pos,
+ struct type **char_type,
+ const char **arrayname)
+ {
+@@ -214,12 +214,12 @@ pascal_printchar (int c, struct type *ty
+
+ void
+ pascal_printstr (struct ui_file *stream, struct type *type,
+- const gdb_byte *string, unsigned int length,
++ const gdb_byte *string, ULONGEST length,
+ const char *encoding, int force_ellipses,
+ const struct value_print_options *options)
+ {
+ enum bfd_endian byte_order = gdbarch_byte_order (get_type_arch (type));
+- unsigned int i;
++ ULONGEST i;
+ unsigned int things_printed = 0;
+ int in_quotes = 0;
+ int need_comma = 0;
+@@ -247,9 +247,9 @@ pascal_printstr (struct ui_file *stream,
+ {
+ /* Position of the character we are examining
+ to see whether it is repeated. */
+- unsigned int rep1;
++ ULONGEST rep1;
+ /* Number of repetitions we have detected so far. */
+- unsigned int reps;
++ ULONGEST reps;
+ unsigned long int current_char;
+
+ QUIT;
+@@ -281,7 +281,7 @@ pascal_printstr (struct ui_file *stream,
+ in_quotes = 0;
+ }
+ pascal_printchar (current_char, type, stream);
+- fprintf_filtered (stream, " <repeats %u times>", reps);
++ fprintf_filtered (stream, " <repeats %s times>", pulongest (reps));
+ i = rep1 - 1;
+ things_printed += options->repeat_count_threshold;
+ need_comma = 1;
+diff -Naurp insight-8.1.50.20180216.orig/gdb/p-lang.h insight-8.1.50.20180216.new/gdb/p-lang.h
+--- insight-8.1.50.20180216.orig/gdb/p-lang.h 2018-01-04 17:43:15.000000000 +0100
++++ insight-8.1.50.20180216.new/gdb/p-lang.h 2018-02-18 01:09:36.805116952 +0100
+@@ -36,7 +36,7 @@ extern void pascal_print_type (struct ty
+ extern void pascal_print_typedef (struct type *, struct symbol *,
+ struct ui_file *);
+
+-extern void pascal_val_print (struct type *, int,
++extern void pascal_val_print (struct type *, LONGEST,
+ CORE_ADDR, struct ui_file *, int,
+ struct value *,
+ const struct value_print_options *);
+@@ -50,13 +50,13 @@ extern void pascal_type_print_method_arg
+ /* These are in p-lang.c: */
+
+ extern int
+- is_pascal_string_type (struct type *, int *, int *, int *,
++ is_pascal_string_type (struct type *, LONGEST *, LONGEST *, LONGEST *,
+ struct type **, const char **);
+
+ extern void pascal_printchar (int, struct type *, struct ui_file *);
+
+ extern void pascal_printstr (struct ui_file *, struct type *, const gdb_byte *,
+- unsigned int, const char *, int,
++ ULONGEST, const char *, int,
+ const struct value_print_options *);
+
+ extern struct type **const pascal_builtin_types[];
+diff -Naurp insight-8.1.50.20180216.orig/gdb/ppc-linux-nat.c insight-8.1.50.20180216.new/gdb/ppc-linux-nat.c
+--- insight-8.1.50.20180216.orig/gdb/ppc-linux-nat.c 2018-01-04 17:43:15.000000000 +0100
++++ insight-8.1.50.20180216.new/gdb/ppc-linux-nat.c 2018-02-18 01:09:36.805116952 +0100
+@@ -1445,7 +1445,7 @@ ppc_linux_can_use_hw_breakpoint (struct
+
+ static int
+ ppc_linux_region_ok_for_hw_watchpoint (struct target_ops *self,
+- CORE_ADDR addr, int len)
++ CORE_ADDR addr, LONGEST len)
+ {
+ /* Handle sub-8-byte quantities. */
+ if (len <= 0)
+diff -Naurp insight-8.1.50.20180216.orig/gdb/ppc-linux-tdep.c insight-8.1.50.20180216.new/gdb/ppc-linux-tdep.c
+--- insight-8.1.50.20180216.orig/gdb/ppc-linux-tdep.c 2018-01-26 13:46:47.000000000 +0100
++++ insight-8.1.50.20180216.new/gdb/ppc-linux-tdep.c 2018-02-18 01:09:36.805116952 +0100
+@@ -1637,7 +1637,7 @@ ppc_init_linux_record_tdep (struct linux
+
+ const struct floatformat **
+ ppc_floatformat_for_type (struct gdbarch *gdbarch,
+- const char *name, int len)
++ const char *name, LONGEST len)
+ {
+ if (len == 128 && name)
+ {
+diff -Naurp insight-8.1.50.20180216.orig/gdb/printcmd.c insight-8.1.50.20180216.new/gdb/printcmd.c
+--- insight-8.1.50.20180216.orig/gdb/printcmd.c 2018-02-18 01:05:32.132760137 +0100
++++ insight-8.1.50.20180216.new/gdb/printcmd.c 2018-02-18 01:09:36.805116952 +0100
+@@ -277,7 +277,7 @@ print_formatted (struct value *val, int
+ struct ui_file *stream)
+ {
+ struct type *type = check_typedef (value_type (val));
+- int len = TYPE_LENGTH (type);
++ LONGEST len = TYPE_LENGTH (type);
+
+ if (VALUE_LVAL (val) == lval_memory)
+ next_address = value_address (val) + len;
+@@ -353,7 +353,7 @@ print_scalar_formatted (const gdb_byte *
+ int size, struct ui_file *stream)
+ {
+ struct gdbarch *gdbarch = get_type_arch (type);
+- unsigned int len = TYPE_LENGTH (type);
++ ULONGEST len = TYPE_LENGTH (type);
+ enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
+
+ /* String printing should go through val_print_scalar_formatted. */
+diff -Naurp insight-8.1.50.20180216.orig/gdb/procfs.c insight-8.1.50.20180216.new/gdb/procfs.c
+--- insight-8.1.50.20180216.orig/gdb/procfs.c 2018-02-02 13:28:13.000000000 +0100
++++ insight-8.1.50.20180216.new/gdb/procfs.c 2018-02-18 01:09:36.806116962 +0100
+@@ -3380,7 +3380,7 @@ procfs_remove_watchpoint (struct target_
+
+ static int
+ procfs_region_ok_for_hw_watchpoint (struct target_ops *self,
+- CORE_ADDR addr, int len)
++ CORE_ADDR addr, LONGEST len)
+ {
+ /* The man page for proc(4) on Solaris 2.6 and up says that the
+ system can support "thousands" of hardware watchpoints, but gives
+diff -Naurp insight-8.1.50.20180216.orig/gdb/p-valprint.c insight-8.1.50.20180216.new/gdb/p-valprint.c
+--- insight-8.1.50.20180216.orig/gdb/p-valprint.c 2018-01-12 03:18:43.000000000 +0100
++++ insight-8.1.50.20180216.new/gdb/p-valprint.c 2018-02-18 01:09:36.805116952 +0100
+@@ -60,7 +60,7 @@ static const struct generic_val_print_de
+
+ void
+ pascal_val_print (struct type *type,
+- int embedded_offset, CORE_ADDR address,
++ LONGEST embedded_offset, CORE_ADDR address,
+ struct ui_file *stream, int recurse,
+ struct value *original_value,
+ const struct value_print_options *options)
+@@ -71,8 +71,8 @@ pascal_val_print (struct type *type,
+ unsigned len;
+ LONGEST low_bound, high_bound;
+ struct type *elttype;
+- unsigned eltlen;
+- int length_pos, length_size, string_pos;
++ ULONGEST eltlen;
++ LONGEST length_pos, length_size, string_pos;
+ struct type *char_type;
+ CORE_ADDR addr;
+ int want_space = 0;
+diff -Naurp insight-8.1.50.20180216.orig/gdb/regcache.c insight-8.1.50.20180216.new/gdb/regcache.c
+--- insight-8.1.50.20180216.orig/gdb/regcache.c 2018-01-26 13:46:47.000000000 +0100
++++ insight-8.1.50.20180216.new/gdb/regcache.c 2018-02-18 01:09:36.806116962 +0100
+@@ -897,7 +897,7 @@ typedef void (regcache_write_ftype) (str
+ const void *buf);
+
+ enum register_status
+-regcache::xfer_part (int regnum, int offset, int len, void *in,
++regcache::xfer_part (int regnum, LONGEST offset, LONGEST len, void *in,
+ const void *out, bool is_raw)
+ {
+ struct gdbarch *gdbarch = arch ();
+@@ -941,13 +941,13 @@ regcache::xfer_part (int regnum, int off
+
+ enum register_status
+ regcache_raw_read_part (struct regcache *regcache, int regnum,
+- int offset, int len, gdb_byte *buf)
++ int offset, LONGEST len, gdb_byte *buf)
+ {
+ return regcache->raw_read_part (regnum, offset, len, buf);
+ }
+
+ enum register_status
+-regcache::raw_read_part (int regnum, int offset, int len, gdb_byte *buf)
++regcache::raw_read_part (int regnum, int offset, LONGEST len, gdb_byte *buf)
+ {
+ assert_regnum (regnum);
+ return xfer_part (regnum, offset, len, buf, NULL, true);
+@@ -955,13 +955,13 @@ regcache::raw_read_part (int regnum, int
+
+ void
+ regcache_raw_write_part (struct regcache *regcache, int regnum,
+- int offset, int len, const gdb_byte *buf)
++ int offset, LONGEST len, const gdb_byte *buf)
+ {
+ regcache->raw_write_part (regnum, offset, len, buf);
+ }
+
+ void
+-regcache::raw_write_part (int regnum, int offset, int len,
++regcache::raw_write_part (int regnum, int offset, LONGEST len,
+ const gdb_byte *buf)
+ {
+ assert_regnum (regnum);
+@@ -970,14 +970,15 @@ regcache::raw_write_part (int regnum, in
+
+ enum register_status
+ regcache_cooked_read_part (struct regcache *regcache, int regnum,
+- int offset, int len, gdb_byte *buf)
++ LONGEST offset, LONGEST len, gdb_byte *buf)
+ {
+ return regcache->cooked_read_part (regnum, offset, len, buf);
+ }
+
+
+ enum register_status
+-regcache::cooked_read_part (int regnum, int offset, int len, gdb_byte *buf)
++regcache::cooked_read_part (int regnum, LONGEST offset, LONGEST len,
++ gdb_byte *buf)
+ {
+ gdb_assert (regnum >= 0 && regnum < m_descr->nr_cooked_registers);
+ return xfer_part (regnum, offset, len, buf, NULL, false);
+@@ -985,13 +986,13 @@ regcache::cooked_read_part (int regnum,
+
+ void
+ regcache_cooked_write_part (struct regcache *regcache, int regnum,
+- int offset, int len, const gdb_byte *buf)
++ LONGEST offset, LONGEST len, const gdb_byte *buf)
+ {
+ regcache->cooked_write_part (regnum, offset, len, buf);
+ }
+
+ void
+-regcache::cooked_write_part (int regnum, int offset, int len,
++regcache::cooked_write_part (int regnum, LONGEST offset, LONGEST len,
+ const gdb_byte *buf)
+ {
+ gdb_assert (regnum >= 0 && regnum < m_descr->nr_cooked_registers);
+diff -Naurp insight-8.1.50.20180216.orig/gdb/regcache.h insight-8.1.50.20180216.new/gdb/regcache.h
+--- insight-8.1.50.20180216.orig/gdb/regcache.h 2018-01-04 17:43:15.000000000 +0100
++++ insight-8.1.50.20180216.new/gdb/regcache.h 2018-02-18 01:09:36.806116962 +0100
+@@ -82,9 +82,9 @@ extern void regcache_raw_set_cached_valu
+
+ extern enum register_status
+ regcache_raw_read_part (struct regcache *regcache, int regnum,
+- int offset, int len, gdb_byte *buf);
++ int offset, LONGEST len, gdb_byte *buf);
+ void regcache_raw_write_part (struct regcache *regcache, int regnum,
+- int offset, int len, const gdb_byte *buf);
++ int offset, LONGEST len, const gdb_byte *buf);
+
+ void regcache_invalidate (struct regcache *regcache, int regnum);
+
+@@ -121,10 +121,11 @@ extern void regcache_cooked_write_unsign
+ write style operations. */
+
+ enum register_status regcache_cooked_read_part (struct regcache *regcache,
+- int regnum, int offset,
+- int len, gdb_byte *buf);
++ int regnum, LONGEST offset,
++ LONGEST len, gdb_byte *buf);
+ void regcache_cooked_write_part (struct regcache *regcache, int regnum,
+- int offset, int len, const gdb_byte *buf);
++ LONGEST offset, LONGEST len,
++ const gdb_byte *buf);
+
+ /* Special routines to read/write the PC. */
+
+@@ -302,15 +303,15 @@ public:
+
+ void invalidate (int regnum);
+
+- enum register_status raw_read_part (int regnum, int offset, int len,
++ enum register_status raw_read_part (int regnum, int offset, LONGEST len,
+ gdb_byte *buf);
+
+- void raw_write_part (int regnum, int offset, int len, const gdb_byte *buf);
++ void raw_write_part (int regnum, int offset, LONGEST len, const gdb_byte *buf);
+
+- enum register_status cooked_read_part (int regnum, int offset, int len,
++ enum register_status cooked_read_part (int regnum, LONGEST offset, LONGEST len,
+ gdb_byte *buf);
+
+- void cooked_write_part (int regnum, int offset, int len,
++ void cooked_write_part (int regnum, LONGEST offset, LONGEST len,
+ const gdb_byte *buf);
+
+ void supply_regset (const struct regset *regset,
+@@ -349,8 +350,8 @@ private:
+
+ void restore (struct regcache *src);
+
+- enum register_status xfer_part (int regnum, int offset, int len, void *in,
+- const void *out, bool is_raw);
++ enum register_status xfer_part (int regnum, LONGEST offset, LONGEST len,
++ void *in, const void *out, bool is_raw);
+
+ void transfer_regset (const struct regset *regset,
+ struct regcache *out_regcache,
+diff -Naurp insight-8.1.50.20180216.orig/gdb/remote.c insight-8.1.50.20180216.new/gdb/remote.c
+--- insight-8.1.50.20180216.orig/gdb/remote.c 2018-02-09 15:06:40.000000000 +0100
++++ insight-8.1.50.20180216.new/gdb/remote.c 2018-02-18 01:09:36.807116971 +0100
+@@ -9966,7 +9966,7 @@ int remote_hw_breakpoint_limit = -1;
+
+ static int
+ remote_region_ok_for_hw_watchpoint (struct target_ops *self,
+- CORE_ADDR addr, int len)
++ CORE_ADDR addr, LONGEST len)
+ {
+ if (remote_hw_watchpoint_length_limit == 0)
+ return 0;
+diff -Naurp insight-8.1.50.20180216.orig/gdb/rust-lang.c insight-8.1.50.20180216.new/gdb/rust-lang.c
+--- insight-8.1.50.20180216.orig/gdb/rust-lang.c 2018-02-18 01:05:32.110759925 +0100
++++ insight-8.1.50.20180216.new/gdb/rust-lang.c 2018-02-18 01:09:36.807116971 +0100
+@@ -472,7 +472,7 @@ rust_printchar (int c, struct type *type
+
+ static void
+ rust_printstr (struct ui_file *stream, struct type *type,
+- const gdb_byte *string, unsigned int length,
++ const gdb_byte *string, ULONGEST length,
+ const char *user_encoding, int force_ellipses,
+ const struct value_print_options *options)
+ {
+@@ -618,7 +618,7 @@ static const struct generic_val_print_de
+ /* la_val_print implementation for Rust. */
+
+ static void
+-rust_val_print (struct type *type, int embedded_offset,
++rust_val_print (struct type *type, LONGEST embedded_offset,
+ CORE_ADDR address, struct ui_file *stream, int recurse,
+ struct value *val,
+ const struct value_print_options *options)
+diff -Naurp insight-8.1.50.20180216.orig/gdb/s390-linux-nat.c insight-8.1.50.20180216.new/gdb/s390-linux-nat.c
+--- insight-8.1.50.20180216.orig/gdb/s390-linux-nat.c 2018-01-26 13:46:47.000000000 +0100
++++ insight-8.1.50.20180216.new/gdb/s390-linux-nat.c 2018-02-18 01:09:36.807116971 +0100
+@@ -922,7 +922,7 @@ s390_remove_hw_breakpoint (struct target
+
+ static int
+ s390_region_ok_for_hw_watchpoint (struct target_ops *self,
+- CORE_ADDR addr, int cnt)
++ CORE_ADDR addr, LONGEST cnt)
+ {
+ return 1;
+ }
+diff -Naurp insight-8.1.50.20180216.orig/gdb/spu-multiarch.c insight-8.1.50.20180216.new/gdb/spu-multiarch.c
+--- insight-8.1.50.20180216.orig/gdb/spu-multiarch.c 2018-01-04 17:43:15.000000000 +0100
++++ insight-8.1.50.20180216.new/gdb/spu-multiarch.c 2018-02-18 01:09:36.807116971 +0100
+@@ -128,7 +128,7 @@ spu_thread_architecture (struct target_o
+ /* Override the to_region_ok_for_hw_watchpoint routine. */
+ static int
+ spu_region_ok_for_hw_watchpoint (struct target_ops *self,
+- CORE_ADDR addr, int len)
++ CORE_ADDR addr, LONGEST len)
+ {
+ struct target_ops *ops_beneath = find_target_beneath (self);
+
+diff -Naurp insight-8.1.50.20180216.orig/gdb/stack.c insight-8.1.50.20180216.new/gdb/stack.c
+--- insight-8.1.50.20180216.orig/gdb/stack.c 2018-01-12 03:18:43.000000000 +0100
++++ insight-8.1.50.20180216.new/gdb/stack.c 2018-02-18 01:09:36.808116981 +0100
+@@ -190,7 +190,7 @@ print_stack_frame (struct frame_info *fr
+ argument (not just the first nameless argument). */
+
+ static void
+-print_frame_nameless_args (struct frame_info *frame, long start, int num,
++print_frame_nameless_args (struct frame_info *frame, LONGEST start, int num,
+ int first, struct ui_file *stream)
+ {
+ struct gdbarch *gdbarch = get_frame_arch (frame);
+@@ -540,7 +540,7 @@ print_frame_args (struct symbol *func, s
+ /* Offset of next stack argument beyond the one we have seen that is
+ at the highest offset, or -1 if we haven't come to a stack
+ argument yet. */
+- long highest_offset = -1;
++ LONGEST highest_offset = -1;
+ /* Number of ints of arguments that we have printed so far. */
+ int args_printed = 0;
+ /* True if we should print arguments, false otherwise. */
+@@ -569,8 +569,8 @@ print_frame_args (struct symbol *func, s
+ case LOC_ARG:
+ case LOC_REF_ARG:
+ {
+- long current_offset = SYMBOL_VALUE (sym);
+- int arg_size = TYPE_LENGTH (SYMBOL_TYPE (sym));
++ LONGEST current_offset = SYMBOL_VALUE (sym);
++ LONGEST arg_size = TYPE_LENGTH (SYMBOL_TYPE (sym));
+
+ /* Compute address of next argument by adding the size of
+ this argument and rounding to an int boundary. */
+@@ -705,7 +705,7 @@ print_frame_args (struct symbol *func, s
+ enough about the stack to find them. */
+ if (num != -1)
+ {
+- long start;
++ LONGEST start;
+
+ if (highest_offset == -1)
+ start = gdbarch_frame_args_skip (get_frame_arch (frame));
+diff -Naurp insight-8.1.50.20180216.orig/gdb/symmisc.c insight-8.1.50.20180216.new/gdb/symmisc.c
+--- insight-8.1.50.20180216.orig/gdb/symmisc.c 2018-01-04 17:43:15.000000000 +0100
++++ insight-8.1.50.20180216.new/gdb/symmisc.c 2018-02-18 01:09:36.808116981 +0100
+@@ -585,11 +585,11 @@ print_symbol (struct gdbarch *gdbarch, s
+
+ case LOC_CONST_BYTES:
+ {
+- unsigned i;
++ ULONGEST i;
+ struct type *type = check_typedef (SYMBOL_TYPE (symbol));
+
+- fprintf_filtered (outfile, "const %u hex bytes:",
+- TYPE_LENGTH (type));
++ fprintf_filtered (outfile, "const %s hex bytes:",
++ pulongest (TYPE_LENGTH (type)));
+ for (i = 0; i < TYPE_LENGTH (type); i++)
+ fprintf_filtered (outfile, " %02x",
+ (unsigned) SYMBOL_VALUE_BYTES (symbol)[i]);
+diff -Naurp insight-8.1.50.20180216.orig/gdb/target.c insight-8.1.50.20180216.new/gdb/target.c
+--- insight-8.1.50.20180216.orig/gdb/target.c 2018-02-09 15:06:40.000000000 +0100
++++ insight-8.1.50.20180216.new/gdb/target.c 2018-02-18 01:09:36.808116981 +0100
+@@ -57,7 +57,7 @@ static int default_watchpoint_addr_withi
+ CORE_ADDR, CORE_ADDR, int);
+
+ static int default_region_ok_for_hw_watchpoint (struct target_ops *,
+- CORE_ADDR, int);
++ CORE_ADDR, LONGEST);
+
+ static void default_rcmd (struct target_ops *, const char *, struct ui_file *);
+
+@@ -3208,7 +3208,7 @@ target_fileio_read_stralloc (struct infe
+
+ static int
+ default_region_ok_for_hw_watchpoint (struct target_ops *self,
+- CORE_ADDR addr, int len)
++ CORE_ADDR addr, LONGEST len)
+ {
+ return (len <= gdbarch_ptr_bit (target_gdbarch ()) / TARGET_CHAR_BIT);
+ }
+diff -Naurp insight-8.1.50.20180216.orig/gdb/target-delegates.c insight-8.1.50.20180216.new/gdb/target-delegates.c
+--- insight-8.1.50.20180216.orig/gdb/target-delegates.c 2018-02-09 15:06:40.000000000 +0100
++++ insight-8.1.50.20180216.new/gdb/target-delegates.c 2018-02-18 01:09:36.808116981 +0100
+@@ -760,14 +760,14 @@ debug_watchpoint_addr_within_range (stru
+ }
+
+ static int
+-delegate_region_ok_for_hw_watchpoint (struct target_ops *self, CORE_ADDR arg1, int arg2)
++delegate_region_ok_for_hw_watchpoint (struct target_ops *self, CORE_ADDR arg1, LONGEST arg2)
+ {
+ self = self->beneath;
+ return self->to_region_ok_for_hw_watchpoint (self, arg1, arg2);
+ }
+
+ static int
+-debug_region_ok_for_hw_watchpoint (struct target_ops *self, CORE_ADDR arg1, int arg2)
++debug_region_ok_for_hw_watchpoint (struct target_ops *self, CORE_ADDR arg1, LONGEST arg2)
+ {
+ int result;
+ fprintf_unfiltered (gdb_stdlog, "-> %s->to_region_ok_for_hw_watchpoint (...)\n", debug_target.to_shortname);
+@@ -777,7 +777,7 @@ debug_region_ok_for_hw_watchpoint (struc
+ fputs_unfiltered (", ", gdb_stdlog);
+ target_debug_print_CORE_ADDR (arg1);
+ fputs_unfiltered (", ", gdb_stdlog);
+- target_debug_print_int (arg2);
++ target_debug_print_LONGEST (arg2);
+ fputs_unfiltered (") = ", gdb_stdlog);
+ target_debug_print_int (result);
+ fputs_unfiltered ("\n", gdb_stdlog);
+diff -Naurp insight-8.1.50.20180216.orig/gdb/target.h insight-8.1.50.20180216.new/gdb/target.h
+--- insight-8.1.50.20180216.orig/gdb/target.h 2018-02-18 01:05:32.191760705 +0100
++++ insight-8.1.50.20180216.new/gdb/target.h 2018-02-18 01:09:36.809116990 +0100
+@@ -541,7 +541,7 @@ struct target_ops
+ /* Documentation of this routine is provided with the corresponding
+ target_* macro. */
+ int (*to_region_ok_for_hw_watchpoint) (struct target_ops *,
+- CORE_ADDR, int)
++ CORE_ADDR, LONGEST)
+ TARGET_DEFAULT_FUNC (default_region_ok_for_hw_watchpoint);
+
+ int (*to_can_accel_watchpoint_condition) (struct target_ops *,
+diff -Naurp insight-8.1.50.20180216.orig/gdb/tracepoint.c insight-8.1.50.20180216.new/gdb/tracepoint.c
+--- insight-8.1.50.20180216.orig/gdb/tracepoint.c 2018-01-12 03:18:43.000000000 +0100
++++ insight-8.1.50.20180216.new/gdb/tracepoint.c 2018-02-18 01:09:36.809116990 +0100
+@@ -852,10 +852,10 @@ collection_list::add_register (unsigned
+ void
+ collection_list::add_memrange (struct gdbarch *gdbarch,
+ int type, bfd_signed_vma base,
+- unsigned long len)
++ ULONGEST len)
+ {
+ if (info_verbose)
+- printf_filtered ("(%d,%s,%ld)\n", type, paddress (gdbarch, base), len);
++ printf_filtered ("(%d,%s,%s)\n", type, paddress (gdbarch, base), pulongest (len));
+
+ /* type: memrange_absolute == memory, other n == basereg */
+ /* base: addr if memory, offset if reg relative. */
+@@ -875,7 +875,7 @@ collection_list::collect_symbol (struct
+ CORE_ADDR scope,
+ int trace_string)
+ {
+- unsigned long len;
++ ULONGEST len;
+ unsigned int reg;
+ bfd_signed_vma offset;
+ int treat_as_expr = 0;
+@@ -896,8 +896,8 @@ collection_list::collect_symbol (struct
+ offset = SYMBOL_VALUE_ADDRESS (sym);
+ if (info_verbose)
+ {
+- printf_filtered ("LOC_STATIC %s: collect %ld bytes at %s.\n",
+- SYMBOL_PRINT_NAME (sym), len,
++ printf_filtered ("LOC_STATIC %s: collect %s bytes at %s.\n",
++ SYMBOL_PRINT_NAME (sym), pulongest (len),
+ paddress (gdbarch, offset));
+ }
+ /* A struct may be a C++ class with static fields, go to general
+@@ -929,9 +929,9 @@ collection_list::collect_symbol (struct
+ offset = frame_offset + SYMBOL_VALUE (sym);
+ if (info_verbose)
+ {
+- printf_filtered ("LOC_LOCAL %s: Collect %ld bytes at offset %s"
++ printf_filtered ("LOC_LOCAL %s: Collect %s bytes at offset %s"
+ " from frame ptr reg %d\n",
+- SYMBOL_PRINT_NAME (sym), len,
++ SYMBOL_PRINT_NAME (sym), pulongest (len),
+ paddress (gdbarch, offset), reg);
+ }
+ add_memrange (gdbarch, reg, offset, len);
+@@ -941,9 +941,9 @@ collection_list::collect_symbol (struct
+ offset = 0;
+ if (info_verbose)
+ {
+- printf_filtered ("LOC_REGPARM_ADDR %s: Collect %ld bytes at offset %s"
++ printf_filtered ("LOC_REGPARM_ADDR %s: Collect %s bytes at offset %s"
+ " from reg %d\n",
+- SYMBOL_PRINT_NAME (sym), len,
++ SYMBOL_PRINT_NAME (sym), pulongest (len),
+ paddress (gdbarch, offset), reg);
+ }
+ add_memrange (gdbarch, reg, offset, len);
+@@ -953,9 +953,9 @@ collection_list::collect_symbol (struct
+ offset = frame_offset + SYMBOL_VALUE (sym);
+ if (info_verbose)
+ {
+- printf_filtered ("LOC_LOCAL %s: Collect %ld bytes at offset %s"
++ printf_filtered ("LOC_LOCAL %s: Collect %s bytes at offset %s"
+ " from frame ptr reg %d\n",
+- SYMBOL_PRINT_NAME (sym), len,
++ SYMBOL_PRINT_NAME (sym), pulongest (len),
+ paddress (gdbarch, offset), reg);
+ }
+ add_memrange (gdbarch, reg, offset, len);
+@@ -2500,7 +2500,8 @@ info_scope_command (const char *args_in,
+ const char *symname;
+ const char *save_args = args_in;
+ struct block_iterator iter;
+- int j, count = 0;
++ int count = 0;
++ LONGEST j;
+ struct gdbarch *gdbarch;
+ int regno;
+ const char *args = args_in;
+@@ -2644,8 +2645,11 @@ info_scope_command (const char *args_in,
+ }
+ }
+ if (SYMBOL_TYPE (sym))
+- printf_filtered (", length %d.\n",
+- TYPE_LENGTH (check_typedef (SYMBOL_TYPE (sym))));
++ {
++ ULONGEST len = TYPE_LENGTH (check_typedef (SYMBOL_TYPE (sym)));
++
++ printf_filtered (", length %s.\n", pulongest (len));
++ }
+ }
+ if (BLOCK_FUNCTION (block))
+ break;
+diff -Naurp insight-8.1.50.20180216.orig/gdb/tracepoint.h insight-8.1.50.20180216.new/gdb/tracepoint.h
+--- insight-8.1.50.20180216.orig/gdb/tracepoint.h 2018-01-04 17:43:15.000000000 +0100
++++ insight-8.1.50.20180216.new/gdb/tracepoint.h 2018-02-18 01:09:36.809116990 +0100
+@@ -255,7 +255,7 @@ public:
+ void add_register (unsigned int regno);
+ void add_memrange (struct gdbarch *gdbarch,
+ int type, bfd_signed_vma base,
+- unsigned long len);
++ ULONGEST len);
+ void collect_symbol (struct symbol *sym,
+ struct gdbarch *gdbarch,
+ long frame_regno, long frame_offset,
+diff -Naurp insight-8.1.50.20180216.orig/gdb/valarith.c insight-8.1.50.20180216.new/gdb/valarith.c
+--- insight-8.1.50.20180216.orig/gdb/valarith.c 2018-02-18 01:05:32.111759934 +0100
++++ insight-8.1.50.20180216.new/gdb/valarith.c 2018-02-18 01:09:36.809116990 +0100
+@@ -184,7 +184,7 @@ value_subscript (struct value *array, LO
+ to doubles, but no longer does. */
+
+ struct value *
+-value_subscripted_rvalue (struct value *array, LONGEST index, int lowerbound)
++value_subscripted_rvalue (struct value *array, LONGEST index, LONGEST lowerbound)
+ {
+ struct type *array_type = check_typedef (value_type (array));
+ struct type *elt_type = check_typedef (TYPE_TARGET_TYPE (array_type));
+@@ -661,7 +661,7 @@ value_concat (struct value *arg1, struct
+ struct value *inval1;
+ struct value *inval2;
+ struct value *outval = NULL;
+- int inval1len, inval2len;
++ ssize_t inval1len, inval2len;
+ int count, idx;
+ char inchar;
+ struct type *type1 = check_typedef (value_type (arg1));
+@@ -1421,7 +1421,7 @@ value_binop (struct value *arg1, struct
+ int
+ value_logical_not (struct value *arg1)
+ {
+- int len;
++ LONGEST len;
+ const gdb_byte *p;
+ struct type *type1;
+
+@@ -1449,11 +1449,11 @@ value_logical_not (struct value *arg1)
+ static int
+ value_strcmp (struct value *arg1, struct value *arg2)
+ {
+- int len1 = TYPE_LENGTH (value_type (arg1));
+- int len2 = TYPE_LENGTH (value_type (arg2));
++ LONGEST len1 = TYPE_LENGTH (value_type (arg1));
++ LONGEST len2 = TYPE_LENGTH (value_type (arg2));
+ const gdb_byte *s1 = value_contents (arg1);
+ const gdb_byte *s2 = value_contents (arg2);
+- int i, len = len1 < len2 ? len1 : len2;
++ LONGEST i, len = len1 < len2 ? len1 : len2;
+
+ for (i = 0; i < len; i++)
+ {
+diff -Naurp insight-8.1.50.20180216.orig/gdb/valops.c insight-8.1.50.20180216.new/gdb/valops.c
+--- insight-8.1.50.20180216.orig/gdb/valops.c 2018-02-18 01:05:32.175760551 +0100
++++ insight-8.1.50.20180216.new/gdb/valops.c 2018-02-18 01:09:36.810117000 +0100
+@@ -81,7 +81,7 @@ oload_classification classify_oload_matc
+ int, int);
+
+ static struct value *value_struct_elt_for_reference (struct type *,
+- int, struct type *,
++ LONGEST, struct type *,
+ const char *,
+ struct type *,
+ int, enum noside);
+@@ -183,7 +183,7 @@ find_function_in_inferior (const char *n
+ space. */
+
+ struct value *
+-value_allocate_space_in_inferior (int len)
++value_allocate_space_in_inferior (LONGEST len)
+ {
+ struct objfile *objf;
+ struct value *val = find_function_in_inferior ("malloc", &objf);
+@@ -398,12 +398,12 @@ value_cast (struct type *type, struct va
+ if (code1 == TYPE_CODE_ARRAY)
+ {
+ struct type *element_type = TYPE_TARGET_TYPE (type);
+- unsigned element_length = TYPE_LENGTH (check_typedef (element_type));
++ ULONGEST element_length = TYPE_LENGTH (check_typedef (element_type));
+
+ if (element_length > 0 && TYPE_ARRAY_UPPER_BOUND_IS_UNDEFINED (type))
+ {
+ struct type *range_type = TYPE_INDEX_TYPE (type);
+- int val_length = TYPE_LENGTH (type2);
++ LONGEST val_length = TYPE_LENGTH (type2);
+ LONGEST low_bound, high_bound, new_length;
+
+ if (get_discrete_bounds (range_type, &low_bound, &high_bound) < 0)
+@@ -1055,7 +1055,7 @@ value_assign (struct value *toval, struc
+ {
+ const gdb_byte *dest_buffer;
+ CORE_ADDR changed_addr;
+- int changed_len;
++ LONGEST changed_len;
+ gdb_byte buffer[sizeof (LONGEST)];
+
+ if (value_bitsize (toval))
+@@ -3313,7 +3313,7 @@ compare_parameters (struct type *t1, str
+ the form "DOMAIN::NAME". */
+
+ static struct value *
+-value_struct_elt_for_reference (struct type *domain, int offset,
++value_struct_elt_for_reference (struct type *domain, LONGEST offset,
+ struct type *curtype, const char *name,
+ struct type *intype,
+ int want_address,
+@@ -3347,7 +3347,7 @@ value_struct_elt_for_reference (struct t
+ if (want_address)
+ return value_from_longest
+ (lookup_memberptr_type (TYPE_FIELD_TYPE (t, i), domain),
+- offset + (LONGEST) (TYPE_FIELD_BITPOS (t, i) >> 3));
++ offset + (TYPE_FIELD_BITPOS (t, i) >> 3));
+ else if (noside != EVAL_NORMAL)
+ return allocate_value (TYPE_FIELD_TYPE (t, i));
+ else
+@@ -3520,7 +3520,7 @@ value_struct_elt_for_reference (struct t
+ for (i = TYPE_N_BASECLASSES (t) - 1; i >= 0; i--)
+ {
+ struct value *v;
+- int base_offset;
++ LONGEST base_offset;
+
+ if (BASETYPE_VIA_VIRTUAL (t, i))
+ base_offset = 0;
+@@ -3669,7 +3669,7 @@ value_rtti_indirect_type (struct value *
+ struct value *
+ value_full_object (struct value *argp,
+ struct type *rtype,
+- int xfull, int xtop,
++ int xfull, LONGEST xtop,
+ int xusing_enc)
+ {
+ struct type *real_type;
+diff -Naurp insight-8.1.50.20180216.orig/gdb/valprint.c insight-8.1.50.20180216.new/gdb/valprint.c
+--- insight-8.1.50.20180216.orig/gdb/valprint.c 2018-02-18 01:05:32.123760050 +0100
++++ insight-8.1.50.20180216.new/gdb/valprint.c 2018-02-18 01:09:36.810117000 +0100
+@@ -879,7 +879,7 @@ generic_val_print_complex (struct type *
+
+ void
+ generic_val_print (struct type *type,
+- int embedded_offset, CORE_ADDR address,
++ LONGEST embedded_offset, CORE_ADDR address,
+ struct ui_file *stream, int recurse,
+ struct value *original_value,
+ const struct value_print_options *options,
+@@ -1773,7 +1773,7 @@ print_decimal_chars (struct ui_file *str
+
+ void
+ print_hex_chars (struct ui_file *stream, const gdb_byte *valaddr,
+- unsigned len, enum bfd_endian byte_order,
++ ULONGEST len, enum bfd_endian byte_order,
+ bool zero_pad)
+ {
+ const gdb_byte *p;
+@@ -1926,17 +1926,17 @@ val_print_array_elements (struct type *t
+ int recurse,
+ struct value *val,
+ const struct value_print_options *options,
+- unsigned int i)
++ ULONGEST i)
+ {
+ unsigned int things_printed = 0;
+- unsigned len;
++ ULONGEST len;
+ struct type *elttype, *index_type, *base_index_type;
+- unsigned eltlen;
++ ULONGEST eltlen;
+ /* Position of the array element we are examining to see
+ whether it is repeated. */
+- unsigned int rep1;
++ ULONGEST rep1;
+ /* Number of repetitions we have detected so far. */
+- unsigned int reps;
++ ULONGEST reps;
+ LONGEST low_bound, high_bound;
+ LONGEST low_pos, high_pos;
+
+@@ -2026,7 +2026,7 @@ val_print_array_elements (struct type *t
+ address, stream, recurse + 1, val, options,
+ current_language);
+ annotate_elt_rep (reps);
+- fprintf_filtered (stream, " <repeats %u times>", reps);
++ fprintf_filtered (stream, " <repeats %s times>", pulongest (reps));
+ annotate_elt_rep_end ();
+
+ i = rep1 - 1;
+@@ -2672,7 +2672,7 @@ print_converted_chars_to_obstack (struct
+
+ void
+ generic_printstr (struct ui_file *stream, struct type *type,
+- const gdb_byte *string, unsigned int length,
++ const gdb_byte *string, ULONGEST length,
+ const char *encoding, int force_ellipses,
+ int quote_char, int c_style_terminator,
+ const struct value_print_options *options)
+diff -Naurp insight-8.1.50.20180216.orig/gdb/valprint.h insight-8.1.50.20180216.new/gdb/valprint.h
+--- insight-8.1.50.20180216.orig/gdb/valprint.h 2018-01-04 17:43:15.000000000 +0100
++++ insight-8.1.50.20180216.new/gdb/valprint.h 2018-02-18 01:09:36.810117000 +0100
+@@ -119,7 +119,7 @@ extern void val_print_array_elements (st
+ CORE_ADDR, struct ui_file *, int,
+ struct value *,
+ const struct value_print_options *,
+- unsigned int);
++ ULONGEST);
+
+ extern void val_print_scalar_formatted (struct type *,
+ LONGEST,
+@@ -138,7 +138,7 @@ extern void print_decimal_chars (struct
+ unsigned int, bool, enum bfd_endian);
+
+ extern void print_hex_chars (struct ui_file *, const gdb_byte *,
+- unsigned int, enum bfd_endian, bool);
++ ULONGEST, enum bfd_endian, bool);
+
+ extern void print_char_chars (struct ui_file *, struct type *,
+ const gdb_byte *, unsigned int, enum bfd_endian);
+@@ -191,7 +191,7 @@ struct generic_val_print_decorations
+
+
+ extern void generic_val_print (struct type *type,
+- int embedded_offset, CORE_ADDR address,
++ LONGEST embedded_offset, CORE_ADDR address,
+ struct ui_file *stream, int recurse,
+ struct value *original_value,
+ const struct value_print_options *options,
+@@ -201,7 +201,7 @@ extern void generic_emit_char (int c, st
+ int quoter, const char *encoding);
+
+ extern void generic_printstr (struct ui_file *stream, struct type *type,
+- const gdb_byte *string, unsigned int length,
++ const gdb_byte *string, ULONGEST length,
+ const char *encoding, int force_ellipses,
+ int quote_char, int c_style_terminator,
+ const struct value_print_options *options);
+diff -Naurp insight-8.1.50.20180216.orig/gdb/value.c insight-8.1.50.20180216.new/gdb/value.c
+--- insight-8.1.50.20180216.orig/gdb/value.c 2018-02-18 01:05:32.183760628 +0100
++++ insight-8.1.50.20180216.new/gdb/value.c 2018-02-18 01:09:36.810117000 +0100
+@@ -363,7 +363,8 @@ value_bytes_available (const struct valu
+ }
+
+ int
+-value_bits_any_optimized_out (const struct value *value, int bit_offset, int bit_length)
++value_bits_any_optimized_out (const struct value *value, LONGEST bit_offset,
++ LONGEST bit_length)
+ {
+ gdb_assert (!value->lazy);
+
+@@ -809,8 +810,8 @@ find_first_range_overlap_and_match (stru
+ Return true if the available bits match. */
+
+ static bool
+-value_contents_bits_eq (const struct value *val1, int offset1,
+- const struct value *val2, int offset2,
++value_contents_bits_eq (const struct value *val1, LONGEST offset1,
++ const struct value *val2, LONGEST offset2,
+ int length)
+ {
+ /* Each array element corresponds to a ranges source (unavailable,
+@@ -1445,7 +1446,8 @@ value_optimized_out (struct value *value
+ the following LENGTH bytes. */
+
+ void
+-mark_value_bytes_optimized_out (struct value *value, int offset, int length)
++mark_value_bytes_optimized_out (struct value *value, LONGEST offset,
++ LONGEST length)
+ {
+ mark_value_bits_optimized_out (value,
+ offset * TARGET_CHAR_BIT,
+diff -Naurp insight-8.1.50.20180216.orig/gdb/value.h insight-8.1.50.20180216.new/gdb/value.h
+--- insight-8.1.50.20180216.orig/gdb/value.h 2018-02-18 01:05:32.111759934 +0100
++++ insight-8.1.50.20180216.new/gdb/value.h 2018-02-18 01:09:36.810117000 +0100
+@@ -245,7 +245,7 @@ struct lval_funcs
+ /* If non-NULL, this is used to determine whether the indicated bits
+ of VALUE are a synthetic pointer. */
+ int (*check_synthetic_pointer) (const struct value *value,
+- LONGEST offset, int length);
++ LONGEST offset, LONGEST length);
+
+ /* Return a duplicate of VALUE's closure, for use in a new value.
+ This may simply return the same closure, if VALUE's is
+@@ -376,7 +376,8 @@ extern int value_optimized_out (struct v
+ otherwise. */
+
+ extern int value_bits_any_optimized_out (const struct value *value,
+- int bit_offset, int bit_length);
++ LONGEST bit_offset,
++ LONGEST bit_length);
+
+ /* Like value_optimized_out, but return true iff the whole value is
+ optimized out. */
+@@ -386,7 +387,7 @@ extern int value_entirely_optimized_out
+ LENGTH bytes as optimized out. */
+
+ extern void mark_value_bytes_optimized_out (struct value *value,
+- int offset, int length);
++ LONGEST offset, LONGEST length);
+
+ /* Mark VALUE's content bits starting at OFFSET and extending for
+ LENGTH bits as optimized out. */
+@@ -820,12 +821,11 @@ extern struct value *value_primitive_fie
+ int fieldno,
+ struct type *arg_type);
+
+-
+ extern struct type *value_rtti_indirect_type (struct value *, int *, LONGEST *,
+ int *);
+
+ extern struct value *value_full_object (struct value *, struct type *, int,
+- int, int);
++ LONGEST, int);
+
+ extern struct value *value_cast_pointers (struct type *, struct value *, int);
+
+@@ -1136,10 +1136,11 @@ extern struct value *value_literal_compl
+ extern struct value *find_function_in_inferior (const char *,
+ struct objfile **);
+
+-extern struct value *value_allocate_space_in_inferior (int);
++extern struct value *value_allocate_space_in_inferior (LONGEST);
+
+ extern struct value *value_subscripted_rvalue (struct value *array,
+- LONGEST index, int lowerbound);
++ LONGEST index,
++ LONGEST lowerbound);
+
+ /* User function handler. */
+
+diff -Naurp insight-8.1.50.20180216.orig/gdb/x86-nat.c insight-8.1.50.20180216.new/gdb/x86-nat.c
+--- insight-8.1.50.20180216.orig/gdb/x86-nat.c 2018-01-04 17:43:15.000000000 +0100
++++ insight-8.1.50.20180216.new/gdb/x86-nat.c 2018-02-18 01:09:36.810117000 +0100
+@@ -174,7 +174,7 @@ x86_remove_watchpoint (struct target_ops
+
+ static int
+ x86_region_ok_for_watchpoint (struct target_ops *self,
+- CORE_ADDR addr, int len)
++ CORE_ADDR addr, LONGEST len)
+ {
+ struct x86_debug_reg_state *state
+ = x86_debug_reg_state (ptid_get_pid (inferior_ptid));
diff --git a/insight-8.1-gdb-rhbz795424-bitpos-23of25.patch b/insight-8.1-gdb-rhbz795424-bitpos-23of25.patch
new file mode 100644
index 0000000..c05a542
--- /dev/null
+++ b/insight-8.1-gdb-rhbz795424-bitpos-23of25.patch
@@ -0,0 +1,1142 @@
+diff -Naurp insight-8.1.50.20180216.orig/gdb/alpha-tdep.c insight-8.1.50.20180216.new/gdb/alpha-tdep.c
+--- insight-8.1.50.20180216.orig/gdb/alpha-tdep.c 2018-02-18 01:25:08.186666439 +0100
++++ insight-8.1.50.20180216.new/gdb/alpha-tdep.c 2018-02-18 01:25:55.083116306 +0100
+@@ -301,17 +301,17 @@ alpha_push_dummy_call (struct gdbarch *g
+ {
+ enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
+ int i;
+- int accumulate_size = struct_return ? 8 : 0;
++ ssize_t accumulate_size = struct_return ? 8 : 0;
+ struct alpha_arg
+ {
+ const gdb_byte *contents;
+- int len;
+- int offset;
++ ssize_t len;
++ ssize_t offset;
+ };
+ struct alpha_arg *alpha_args = XALLOCAVEC (struct alpha_arg, nargs);
+ struct alpha_arg *m_arg;
+ gdb_byte arg_reg_buffer[ALPHA_REGISTER_SIZE * ALPHA_NUM_ARG_REGS];
+- int required_arg_regs;
++ ssize_t required_arg_regs;
+ CORE_ADDR func_addr = find_function_addr (function, NULL);
+
+ /* The ABI places the address of the called function in T12. */
+@@ -431,8 +431,8 @@ alpha_push_dummy_call (struct gdbarch *g
+ for (i = nargs; m_arg--, --i >= 0;)
+ {
+ const gdb_byte *contents = m_arg->contents;
+- int offset = m_arg->offset;
+- int len = m_arg->len;
++ ssize_t offset = m_arg->offset;
++ ssize_t len = m_arg->len;
+
+ /* Copy the bytes destined for registers into arg_reg_buffer. */
+ if (offset < sizeof(arg_reg_buffer))
+@@ -444,7 +444,7 @@ alpha_push_dummy_call (struct gdbarch *g
+ }
+ else
+ {
+- int tlen = sizeof(arg_reg_buffer) - offset;
++ ssize_t tlen = sizeof(arg_reg_buffer) - offset;
+ memcpy (arg_reg_buffer + offset, contents, tlen);
+ offset += tlen;
+ contents += tlen;
+diff -Naurp insight-8.1.50.20180216.orig/gdb/amd64-tdep.c insight-8.1.50.20180216.new/gdb/amd64-tdep.c
+--- insight-8.1.50.20180216.orig/gdb/amd64-tdep.c 2018-02-18 01:25:08.138665978 +0100
++++ insight-8.1.50.20180216.new/gdb/amd64-tdep.c 2018-02-18 01:25:55.084116315 +0100
+@@ -879,8 +879,8 @@ amd64_push_arguments (struct regcache *r
+ };
+ struct value **stack_args = XALLOCAVEC (struct value *, nargs);
+ int num_stack_args = 0;
+- int num_elements = 0;
+- int element = 0;
++ LONGEST num_elements = 0;
++ LONGEST element = 0;
+ int integer_reg = 0;
+ int sse_reg = 0;
+ int i;
+@@ -892,7 +892,7 @@ amd64_push_arguments (struct regcache *r
+ for (i = 0; i < nargs; i++)
+ {
+ struct type *type = value_type (args[i]);
+- int len = TYPE_LENGTH (type);
++ LONGEST len = TYPE_LENGTH (type);
+ enum amd64_reg_class theclass[2];
+ int needed_integer_regs = 0;
+ int needed_sse_regs = 0;
+@@ -956,7 +956,7 @@ amd64_push_arguments (struct regcache *r
+
+ gdb_assert (regnum != -1);
+ memset (buf, 0, sizeof buf);
+- memcpy (buf, valbuf + j * 8, std::min (len, 8));
++ memcpy (buf, valbuf + j * 8, std::min (len, (LONGEST) 8));
+ regcache_raw_write_part (regcache, regnum, offset, 8, buf);
+ }
+ }
+diff -Naurp insight-8.1.50.20180216.orig/gdb/amd64-windows-tdep.c insight-8.1.50.20180216.new/gdb/amd64-windows-tdep.c
+--- insight-8.1.50.20180216.orig/gdb/amd64-windows-tdep.c 2018-01-04 17:43:15.000000000 +0100
++++ insight-8.1.50.20180216.new/gdb/amd64-windows-tdep.c 2018-02-18 01:25:55.084116315 +0100
+@@ -291,7 +291,7 @@ amd64_windows_return_value (struct gdbar
+ struct type *type, struct regcache *regcache,
+ gdb_byte *readbuf, const gdb_byte *writebuf)
+ {
+- int len = TYPE_LENGTH (type);
++ LONGEST len = TYPE_LENGTH (type);
+ int regnum = -1;
+
+ /* See if our value is returned through a register. If it is, then
+diff -Naurp insight-8.1.50.20180216.orig/gdb/arm-tdep.c insight-8.1.50.20180216.new/gdb/arm-tdep.c
+--- insight-8.1.50.20180216.orig/gdb/arm-tdep.c 2018-02-02 13:28:13.000000000 +0100
++++ insight-8.1.50.20180216.new/gdb/arm-tdep.c 2018-02-18 01:25:55.086116334 +0100
+@@ -3477,7 +3477,7 @@ arm_vfp_cprc_reg_char (enum arm_vfp_cprc
+ array). Vector types are not currently supported, matching the
+ generic AAPCS support. */
+
+-static int
++static LONGEST
+ arm_vfp_cprc_sub_candidate (struct type *t,
+ enum arm_vfp_cprc_base_type *base_type)
+ {
+@@ -3560,7 +3560,7 @@ arm_vfp_cprc_sub_candidate (struct type
+ }
+ else
+ {
+- int count;
++ LONGEST count;
+ unsigned unitlen;
+
+ count = arm_vfp_cprc_sub_candidate (TYPE_TARGET_TYPE (t),
+@@ -3583,12 +3583,12 @@ arm_vfp_cprc_sub_candidate (struct type
+
+ case TYPE_CODE_STRUCT:
+ {
+- int count = 0;
++ LONGEST count = 0;
+ unsigned unitlen;
+ int i;
+ for (i = 0; i < TYPE_NFIELDS (t); i++)
+ {
+- int sub_count = 0;
++ LONGEST sub_count = 0;
+
+ if (!field_is_static (&TYPE_FIELD (t, i)))
+ sub_count = arm_vfp_cprc_sub_candidate (TYPE_FIELD_TYPE (t, i),
+@@ -3612,13 +3612,15 @@ arm_vfp_cprc_sub_candidate (struct type
+
+ case TYPE_CODE_UNION:
+ {
+- int count = 0;
++ LONGEST count = 0;
+ unsigned unitlen;
+ int i;
+ for (i = 0; i < TYPE_NFIELDS (t); i++)
+ {
+- int sub_count = arm_vfp_cprc_sub_candidate (TYPE_FIELD_TYPE (t, i),
+- base_type);
++ LONGEST sub_count;
++
++ sub_count = arm_vfp_cprc_sub_candidate (TYPE_FIELD_TYPE (t, i),
++ base_type);
+ if (sub_count == -1)
+ return -1;
+ count = (count > sub_count ? count : sub_count);
+@@ -3654,7 +3656,7 @@ arm_vfp_call_candidate (struct type *t,
+ int *count)
+ {
+ enum arm_vfp_cprc_base_type b = VFP_CPRC_UNKNOWN;
+- int c = arm_vfp_cprc_sub_candidate (t, &b);
++ LONGEST c = arm_vfp_cprc_sub_candidate (t, &b);
+ if (c <= 0 || c > 4)
+ return 0;
+ *base_type = b;
+@@ -3735,7 +3737,7 @@ arm_push_dummy_call (struct gdbarch *gdb
+
+ for (argnum = 0; argnum < nargs; argnum++)
+ {
+- int len;
++ LONGEST len;
+ struct type *arg_type;
+ struct type *target_type;
+ enum type_code typecode;
+diff -Naurp insight-8.1.50.20180216.orig/gdb/avr-tdep.c insight-8.1.50.20180216.new/gdb/avr-tdep.c
+--- insight-8.1.50.20180216.orig/gdb/avr-tdep.c 2018-01-26 13:46:47.000000000 +0100
++++ insight-8.1.50.20180216.new/gdb/avr-tdep.c 2018-02-18 01:25:55.087116344 +0100
+@@ -1191,13 +1191,13 @@ avr_dummy_id (struct gdbarch *gdbarch, s
+
+ struct stack_item
+ {
+- int len;
++ ssize_t len;
+ struct stack_item *prev;
+ gdb_byte *data;
+ };
+
+ static struct stack_item *
+-push_stack_item (struct stack_item *prev, const bfd_byte *contents, int len)
++push_stack_item (struct stack_item *prev, const bfd_byte *contents, ssize_t len)
+ {
+ struct stack_item *si;
+ si = XNEW (struct stack_item);
+@@ -1285,12 +1285,12 @@ avr_push_dummy_call (struct gdbarch *gdb
+
+ for (i = 0; i < nargs; i++)
+ {
+- int last_regnum;
+- int j;
++ ssize_t last_regnum;
++ ssize_t j;
+ struct value *arg = args[i];
+ struct type *type = check_typedef (value_type (arg));
+ const bfd_byte *contents = value_contents (arg);
+- int len = TYPE_LENGTH (type);
++ ssize_t len = TYPE_LENGTH (type);
+
+ /* Calculate the potential last register needed.
+ E.g. For length 2, registers regnum and regnum-1 (say 25 and 24)
+diff -Naurp insight-8.1.50.20180216.orig/gdb/bfin-tdep.c insight-8.1.50.20180216.new/gdb/bfin-tdep.c
+--- insight-8.1.50.20180216.orig/gdb/bfin-tdep.c 2018-01-26 13:46:47.000000000 +0100
++++ insight-8.1.50.20180216.new/gdb/bfin-tdep.c 2018-02-18 01:25:55.087116344 +0100
+@@ -504,7 +504,7 @@ bfin_push_dummy_call (struct gdbarch *gd
+ enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
+ int i;
+ long reg_r0, reg_r1, reg_r2;
+- int total_len = 0;
++ ssize_t total_len = 0;
+
+ for (i = nargs - 1; i >= 0; i--)
+ {
+@@ -526,7 +526,7 @@ bfin_push_dummy_call (struct gdbarch *gd
+ {
+ struct type *value_type = value_enclosing_type (args[i]);
+ struct type *arg_type = check_typedef (value_type);
+- int container_len = (TYPE_LENGTH (value_type) + 3) & ~3;
++ ssize_t container_len = (TYPE_LENGTH (value_type) + 3) & ~3;
+
+ sp -= container_len;
+ write_memory (sp, value_contents (args[i]), container_len);
+diff -Naurp insight-8.1.50.20180216.orig/gdb/cris-tdep.c insight-8.1.50.20180216.new/gdb/cris-tdep.c
+--- insight-8.1.50.20180216.orig/gdb/cris-tdep.c 2018-01-04 17:43:15.000000000 +0100
++++ insight-8.1.50.20180216.new/gdb/cris-tdep.c 2018-02-18 01:25:55.088116353 +0100
+@@ -663,13 +663,13 @@ static CORE_ADDR cris_unwind_sp (struct
+
+ struct stack_item
+ {
+- int len;
++ ssize_t len;
+ struct stack_item *prev;
+ gdb_byte *data;
+ };
+
+ static struct stack_item *
+-push_stack_item (struct stack_item *prev, const gdb_byte *contents, int len)
++push_stack_item (struct stack_item *prev, const gdb_byte *contents, ssize_t len)
+ {
+ struct stack_item *si = XNEW (struct stack_item);
+ si->data = (gdb_byte *) xmalloc (len);
+@@ -833,13 +833,13 @@ cris_push_dummy_call (struct gdbarch *gd
+
+ for (argnum = 0; argnum < nargs; argnum++)
+ {
+- int len;
++ ssize_t len;
+ const gdb_byte *val;
+- int reg_demand;
+- int i;
++ ssize_t reg_demand;
++ ssize_t i;
+
+- len = TYPE_LENGTH (value_type (args[argnum]));
+ val = value_contents (args[argnum]);
++ len = TYPE_LENGTH (value_type (args[argnum]));
+
+ /* How may registers worth of storage do we need for this argument? */
+ reg_demand = (len / 4) + (len % 4 != 0 ? 1 : 0);
+diff -Naurp insight-8.1.50.20180216.orig/gdb/h8300-tdep.c insight-8.1.50.20180216.new/gdb/h8300-tdep.c
+--- insight-8.1.50.20180216.orig/gdb/h8300-tdep.c 2018-01-26 13:46:47.000000000 +0100
++++ insight-8.1.50.20180216.new/gdb/h8300-tdep.c 2018-02-18 01:25:55.088116353 +0100
+@@ -637,7 +637,7 @@ h8300_push_dummy_call (struct gdbarch *g
+ int struct_return, CORE_ADDR struct_addr)
+ {
+ enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
+- int stack_alloc = 0, stack_offset = 0;
++ LONGEST stack_alloc = 0, stack_offset = 0;
+ int wordsize = BINWORD (gdbarch);
+ int reg = E_ARG0_REGNUM;
+ int argument;
+@@ -663,11 +663,11 @@ h8300_push_dummy_call (struct gdbarch *g
+ for (argument = 0; argument < nargs; argument++)
+ {
+ struct type *type = value_type (args[argument]);
+- int len = TYPE_LENGTH (type);
++ ssize_t len = TYPE_LENGTH (type);
+ char *contents = (char *) value_contents (args[argument]);
+
+ /* Pad the argument appropriately. */
+- int padded_len = align_up (len, wordsize);
++ ssize_t padded_len = align_up (len, wordsize);
+ /* Use std::vector here to get zero initialization. */
+ std::vector<gdb_byte> padded (padded_len);
+
+@@ -696,7 +696,7 @@ h8300_push_dummy_call (struct gdbarch *g
+ /* Heavens to Betsy --- it's really going in registers!
+ Note that on the h8/300s, there are gaps between the
+ registers in the register file. */
+- int offset;
++ ssize_t offset;
+
+ for (offset = 0; offset < padded_len; offset += wordsize)
+ {
+diff -Naurp insight-8.1.50.20180216.orig/gdb/hppa-tdep.c insight-8.1.50.20180216.new/gdb/hppa-tdep.c
+--- insight-8.1.50.20180216.orig/gdb/hppa-tdep.c 2018-01-26 13:46:47.000000000 +0100
++++ insight-8.1.50.20180216.new/gdb/hppa-tdep.c 2018-02-18 01:25:55.089116363 +0100
+@@ -989,7 +989,7 @@ hppa64_push_dummy_call (struct gdbarch *
+ {
+ struct value *arg = args[i];
+ struct type *type = value_type (arg);
+- int len = TYPE_LENGTH (type);
++ LONGEST len = TYPE_LENGTH (type);
+ const bfd_byte *valbuf;
+ bfd_byte fptrbuf[8];
+ int regnum;
+@@ -1184,7 +1184,7 @@ hppa64_return_value (struct gdbarch *gdb
+ struct type *type, struct regcache *regcache,
+ gdb_byte *readbuf, const gdb_byte *writebuf)
+ {
+- int len = TYPE_LENGTH (type);
++ LONGEST len = TYPE_LENGTH (type);
+ int regnum, offset;
+
+ if (len > 16)
+diff -Naurp insight-8.1.50.20180216.orig/gdb/i386-darwin-tdep.c insight-8.1.50.20180216.new/gdb/i386-darwin-tdep.c
+--- insight-8.1.50.20180216.orig/gdb/i386-darwin-tdep.c 2018-01-04 17:43:15.000000000 +0100
++++ insight-8.1.50.20180216.new/gdb/i386-darwin-tdep.c 2018-02-18 01:25:55.089116363 +0100
+@@ -166,7 +166,7 @@ i386_darwin_push_dummy_call (struct gdba
+
+ for (write_pass = 0; write_pass < 2; write_pass++)
+ {
+- int args_space = 0;
++ LONGEST args_space = 0;
+ int num_m128 = 0;
+
+ if (struct_return)
+diff -Naurp insight-8.1.50.20180216.orig/gdb/i386-tdep.c insight-8.1.50.20180216.new/gdb/i386-tdep.c
+--- insight-8.1.50.20180216.orig/gdb/i386-tdep.c 2018-02-18 01:25:08.172666304 +0100
++++ insight-8.1.50.20180216.new/gdb/i386-tdep.c 2018-02-18 01:25:55.090116372 +0100
+@@ -2677,7 +2677,7 @@ i386_push_dummy_call (struct gdbarch *gd
+ gdb_byte buf[4];
+ int i;
+ int write_pass;
+- int args_space = 0;
++ LONGEST args_space = 0;
+
+ /* BND registers can be in arbitrary values at the moment of the
+ inferior call. This can cause boundary violations that are not
+@@ -2692,7 +2692,7 @@ i386_push_dummy_call (struct gdbarch *gd
+
+ for (write_pass = 0; write_pass < 2; write_pass++)
+ {
+- int args_space_used = 0;
++ LONGEST args_space_used = 0;
+
+ if (struct_return)
+ {
+@@ -2709,7 +2709,7 @@ i386_push_dummy_call (struct gdbarch *gd
+
+ for (i = 0; i < nargs; i++)
+ {
+- int len = TYPE_LENGTH (value_enclosing_type (args[i]));
++ LONGEST len = TYPE_LENGTH (value_enclosing_type (args[i]));
+
+ if (write_pass)
+ {
+@@ -2916,7 +2916,7 @@ i386_reg_struct_return_p (struct gdbarch
+ {
+ struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
+ enum type_code code = TYPE_CODE (type);
+- int len = TYPE_LENGTH (type);
++ LONGEST len = TYPE_LENGTH (type);
+
+ gdb_assert (code == TYPE_CODE_STRUCT
+ || code == TYPE_CODE_UNION
+@@ -3726,7 +3726,7 @@ static int
+ i386_convert_register_p (struct gdbarch *gdbarch,
+ int regnum, struct type *type)
+ {
+- int len = TYPE_LENGTH (type);
++ LONGEST len = TYPE_LENGTH (type);
+
+ /* Values may be spread across multiple registers. Most debugging
+ formats aren't expressive enough to specify the locations, so
+@@ -3759,7 +3759,7 @@ i386_register_to_value (struct frame_inf
+ int *optimizedp, int *unavailablep)
+ {
+ struct gdbarch *gdbarch = get_frame_arch (frame);
+- int len = TYPE_LENGTH (type);
++ LONGEST len = TYPE_LENGTH (type);
+
+ if (i386_fp_regnum_p (gdbarch, regnum))
+ return i387_register_to_value (frame, regnum, type, to,
+@@ -3795,7 +3795,7 @@ static void
+ i386_value_to_register (struct frame_info *frame, int regnum,
+ struct type *type, const gdb_byte *from)
+ {
+- int len = TYPE_LENGTH (type);
++ LONGEST len = TYPE_LENGTH (type);
+
+ if (i386_fp_regnum_p (get_frame_arch (frame), regnum))
+ {
+diff -Naurp insight-8.1.50.20180216.orig/gdb/iq2000-tdep.c insight-8.1.50.20180216.new/gdb/iq2000-tdep.c
+--- insight-8.1.50.20180216.orig/gdb/iq2000-tdep.c 2018-01-04 17:43:15.000000000 +0100
++++ insight-8.1.50.20180216.new/gdb/iq2000-tdep.c 2018-02-18 01:25:55.091116382 +0100
+@@ -651,8 +651,9 @@ iq2000_push_dummy_call (struct gdbarch *
+ const bfd_byte *val;
+ bfd_byte buf[4];
+ struct type *type;
+- int i, argreg, typelen, slacklen;
+- int stackspace = 0;
++ int i, argreg, slacklen;
++ LONGEST typelen;
++ LONGEST stackspace = 0;
+ /* Used to copy struct arguments into the stack. */
+ CORE_ADDR struct_ptr;
+
+diff -Naurp insight-8.1.50.20180216.orig/gdb/m32r-tdep.c insight-8.1.50.20180216.new/gdb/m32r-tdep.c
+--- insight-8.1.50.20180216.orig/gdb/m32r-tdep.c 2018-02-09 15:06:40.000000000 +0100
++++ insight-8.1.50.20180216.new/gdb/m32r-tdep.c 2018-02-18 01:25:55.091116382 +0100
+@@ -671,7 +671,7 @@ m32r_push_dummy_call (struct gdbarch *gd
+ CORE_ADDR regval;
+ gdb_byte *val;
+ gdb_byte valbuf[M32R_ARG_REGISTER_SIZE];
+- int len;
++ LONGEST len;
+
+ /* First force sp to a 4-byte alignment. */
+ sp = sp & ~3;
+diff -Naurp insight-8.1.50.20180216.orig/gdb/m68k-tdep.c insight-8.1.50.20180216.new/gdb/m68k-tdep.c
+--- insight-8.1.50.20180216.orig/gdb/m68k-tdep.c 2018-01-04 17:43:15.000000000 +0100
++++ insight-8.1.50.20180216.new/gdb/m68k-tdep.c 2018-02-18 01:25:55.091116382 +0100
+@@ -373,7 +373,7 @@ m68k_reg_struct_return_p (struct gdbarch
+ {
+ struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
+ enum type_code code = TYPE_CODE (type);
+- int len = TYPE_LENGTH (type);
++ LONGEST len = TYPE_LENGTH (type);
+
+ gdb_assert (code == TYPE_CODE_STRUCT || code == TYPE_CODE_UNION
+ || code == TYPE_CODE_COMPLEX);
+@@ -505,9 +505,9 @@ m68k_push_dummy_call (struct gdbarch *gd
+ for (i = nargs - 1; i >= 0; i--)
+ {
+ struct type *value_type = value_enclosing_type (args[i]);
+- int len = TYPE_LENGTH (value_type);
+- int container_len = (len + 3) & ~3;
+- int offset;
++ LONGEST len = TYPE_LENGTH (value_type);
++ LONGEST container_len = (len + 3) & ~3;
++ LONGEST offset;
+
+ /* Non-scalars bigger than 4 bytes are left aligned, others are
+ right aligned. */
+diff -Naurp insight-8.1.50.20180216.orig/gdb/m88k-tdep.c insight-8.1.50.20180216.new/gdb/m88k-tdep.c
+--- insight-8.1.50.20180216.orig/gdb/m88k-tdep.c 2018-01-04 17:43:15.000000000 +0100
++++ insight-8.1.50.20180216.new/gdb/m88k-tdep.c 2018-02-18 01:25:55.091116382 +0100
+@@ -254,13 +254,13 @@ m88k_store_arguments (struct regcache *r
+ {
+ struct gdbarch *gdbarch = regcache->arch ();
+ int num_register_words = 0;
+- int num_stack_words = 0;
++ LONGEST num_stack_words = 0;
+ int i;
+
+ for (i = 0; i < nargs; i++)
+ {
+ struct type *type = value_type (args[i]);
+- int len = TYPE_LENGTH (type);
++ LONGEST len = TYPE_LENGTH (type);
+
+ if (m88k_integral_or_pointer_p (type) && len < 4)
+ {
+@@ -302,8 +302,8 @@ m88k_store_arguments (struct regcache *r
+ {
+ const bfd_byte *valbuf = value_contents (args[i]);
+ struct type *type = value_type (args[i]);
+- int len = TYPE_LENGTH (type);
+- int stack_word = num_stack_words;
++ LONGEST len = TYPE_LENGTH (type);
++ LONGEST stack_word = num_stack_words;
+
+ if (m88k_in_register_p (type))
+ {
+diff -Naurp insight-8.1.50.20180216.orig/gdb/mep-tdep.c insight-8.1.50.20180216.new/gdb/mep-tdep.c
+--- insight-8.1.50.20180216.orig/gdb/mep-tdep.c 2018-02-09 15:06:40.000000000 +0100
++++ insight-8.1.50.20180216.new/gdb/mep-tdep.c 2018-02-18 01:25:55.091116382 +0100
+@@ -2244,7 +2244,7 @@ push_large_arguments (CORE_ADDR sp, int
+
+ for (i = 0; i < argc; i++)
+ {
+- unsigned arg_len = TYPE_LENGTH (value_type (argv[i]));
++ ULONGEST arg_len = TYPE_LENGTH (value_type (argv[i]));
+
+ if (arg_len > MEP_GPR_SIZE)
+ {
+diff -Naurp insight-8.1.50.20180216.orig/gdb/mips-tdep.c insight-8.1.50.20180216.new/gdb/mips-tdep.c
+--- insight-8.1.50.20180216.orig/gdb/mips-tdep.c 2018-01-26 13:46:47.000000000 +0100
++++ insight-8.1.50.20180216.new/gdb/mips-tdep.c 2018-02-18 01:25:55.092116391 +0100
+@@ -477,7 +477,7 @@ static void
+ mips_xfer_register (struct gdbarch *gdbarch, struct regcache *regcache,
+ int reg_num, int length,
+ enum bfd_endian endian, gdb_byte *in,
+- const gdb_byte *out, int buf_offset)
++ const gdb_byte *out, LONGEST buf_offset)
+ {
+ int reg_offset = 0;
+
+@@ -500,8 +500,8 @@ mips_xfer_register (struct gdbarch *gdba
+ }
+ if (mips_debug)
+ fprintf_unfiltered (gdb_stderr,
+- "xfer $%d, reg offset %d, buf offset %d, length %d, ",
+- reg_num, reg_offset, buf_offset, length);
++ "xfer $%d, reg offset %d, buf offset %s, length %d, ",
++ reg_num, reg_offset, plongest (buf_offset), length);
+ if (mips_debug && out != NULL)
+ {
+ int i;
+@@ -4533,13 +4533,13 @@ mips_eabi_push_dummy_call (struct gdbarc
+ gdb_byte ref_valbuf[MAX_MIPS_ABI_REGSIZE];
+ struct value *arg = args[argnum];
+ struct type *arg_type = check_typedef (value_type (arg));
+- int len = TYPE_LENGTH (arg_type);
++ LONGEST len = TYPE_LENGTH (arg_type);
+ enum type_code typecode = TYPE_CODE (arg_type);
+
+ if (mips_debug)
+ fprintf_unfiltered (gdb_stdlog,
+- "mips_eabi_push_dummy_call: %d len=%d type=%d",
+- argnum + 1, len, (int) typecode);
++ "mips_eabi_push_dummy_call: %d len=%s type=%d",
++ argnum + 1, plongest (len), (int) typecode);
+
+ /* The EABI passes structures that do not fit in a register by
+ reference. */
+@@ -4809,7 +4809,7 @@ mips_eabi_return_value (struct gdbarch *
+
+ static int
+ mips_n32n64_fp_arg_chunk_p (struct gdbarch *gdbarch, struct type *arg_type,
+- int offset)
++ LONGEST offset)
+ {
+ int i;
+
+@@ -4824,7 +4824,7 @@ mips_n32n64_fp_arg_chunk_p (struct gdbar
+
+ for (i = 0; i < TYPE_NFIELDS (arg_type); i++)
+ {
+- int pos;
++ LONGEST pos;
+ struct type *field_type;
+
+ /* We're only looking at normal fields. */
+@@ -4866,7 +4866,7 @@ mips_n32n64_push_dummy_call (struct gdba
+ int argreg;
+ int float_argreg;
+ int argnum;
+- int len = 0;
++ LONGEST len = 0;
+ int stack_offset = 0;
+ enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
+ CORE_ADDR func_addr = find_function_addr (function, NULL);
+@@ -5217,11 +5217,11 @@ mips_n32n64_return_value (struct gdbarch
+ : MIPS_V0_REGNUM);
+ field < TYPE_NFIELDS (type); field++, regnum += 2)
+ {
+- int offset = (FIELD_BITPOS (TYPE_FIELDS (type)[field])
+- / TARGET_CHAR_BIT);
++ LONGEST offset = (FIELD_BITPOS (TYPE_FIELDS (type)[field])
++ / TARGET_CHAR_BIT);
+ if (mips_debug)
+- fprintf_unfiltered (gdb_stderr, "Return float struct+%d\n",
+- offset);
++ fprintf_unfiltered (gdb_stderr, "Return float struct+%s\n",
++ plongest (offset));
+ if (TYPE_LENGTH (TYPE_FIELD_TYPE (type, field)) == 16)
+ {
+ /* A 16-byte long double field goes in two consecutive
+@@ -5263,8 +5263,8 @@ mips_n32n64_return_value (struct gdbarch
+ if (offset + xfer > TYPE_LENGTH (type))
+ xfer = TYPE_LENGTH (type) - offset;
+ if (mips_debug)
+- fprintf_unfiltered (gdb_stderr, "Return struct+%d:%d in $%d\n",
+- offset, xfer, regnum);
++ fprintf_unfiltered (gdb_stderr, "Return struct+%s:%d in $%d\n",
++ plongest (offset), xfer, regnum);
+ mips_xfer_register (gdbarch, regcache,
+ gdbarch_num_regs (gdbarch) + regnum,
+ xfer, BFD_ENDIAN_UNKNOWN, readbuf, writebuf,
+@@ -5322,7 +5322,7 @@ mips_o32_push_dummy_call (struct gdbarch
+ int argreg;
+ int float_argreg;
+ int argnum;
+- int len = 0;
++ LONGEST len = 0;
+ int stack_offset = 0;
+ enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
+ CORE_ADDR func_addr = find_function_addr (function, NULL);
+@@ -5386,13 +5386,13 @@ mips_o32_push_dummy_call (struct gdbarch
+ const gdb_byte *val;
+ struct value *arg = args[argnum];
+ struct type *arg_type = check_typedef (value_type (arg));
+- int len = TYPE_LENGTH (arg_type);
++ LONGEST len = TYPE_LENGTH (arg_type);
+ enum type_code typecode = TYPE_CODE (arg_type);
+
+ if (mips_debug)
+ fprintf_unfiltered (gdb_stdlog,
+- "mips_o32_push_dummy_call: %d len=%d type=%d",
+- argnum + 1, len, (int) typecode);
++ "mips_o32_push_dummy_call: %d len=%s type=%d",
++ argnum + 1, plongest (len), (int) typecode);
+
+ val = value_contents (arg);
+
+@@ -5846,8 +5846,8 @@ mips_o64_push_dummy_call (struct gdbarch
+ int argreg;
+ int float_argreg;
+ int argnum;
+- int len = 0;
+- int stack_offset = 0;
++ LONGEST len = 0;
++ LONGEST stack_offset = 0;
+ enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
+ CORE_ADDR func_addr = find_function_addr (function, NULL);
+
+@@ -5907,13 +5907,13 @@ mips_o64_push_dummy_call (struct gdbarch
+ const gdb_byte *val;
+ struct value *arg = args[argnum];
+ struct type *arg_type = check_typedef (value_type (arg));
+- int len = TYPE_LENGTH (arg_type);
++ LONGEST len = TYPE_LENGTH (arg_type);
+ enum type_code typecode = TYPE_CODE (arg_type);
+
+ if (mips_debug)
+ fprintf_unfiltered (gdb_stdlog,
+- "mips_o64_push_dummy_call: %d len=%d type=%d",
+- argnum + 1, len, (int) typecode);
++ "mips_o64_push_dummy_call: %d len=%s type=%d",
++ argnum + 1, plongest (len), (int) typecode);
+
+ val = value_contents (arg);
+
+diff -Naurp insight-8.1.50.20180216.orig/gdb/mn10300-tdep.c insight-8.1.50.20180216.new/gdb/mn10300-tdep.c
+--- insight-8.1.50.20180216.orig/gdb/mn10300-tdep.c 2018-02-09 15:06:40.000000000 +0100
++++ insight-8.1.50.20180216.new/gdb/mn10300-tdep.c 2018-02-18 01:25:55.092116391 +0100
+@@ -1198,7 +1198,7 @@ mn10300_push_dummy_call (struct gdbarch
+ enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
+ const int push_size = register_size (gdbarch, E_PC_REGNUM);
+ int regs_used;
+- int len, arg_len;
++ LONGEST len, arg_len;
+ int stack_offset = 0;
+ int argnum;
+ const gdb_byte *val;
+diff -Naurp insight-8.1.50.20180216.orig/gdb/ppc-sysv-tdep.c insight-8.1.50.20180216.new/gdb/ppc-sysv-tdep.c
+--- insight-8.1.50.20180216.orig/gdb/ppc-sysv-tdep.c 2018-01-04 17:43:15.000000000 +0100
++++ insight-8.1.50.20180216.new/gdb/ppc-sysv-tdep.c 2018-02-18 01:29:33.376144677 +0100
+@@ -68,7 +68,7 @@ ppc_sysv_abi_push_dummy_call (struct gdb
+ enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
+ int opencl_abi = ppc_sysv_use_opencl_abi (value_type (function));
+ ULONGEST saved_sp;
+- int argspace = 0; /* 0 is an initial wrong guess. */
++ LONGEST argspace = 0; /* 0 is an initial wrong guess. */
+ int write_pass;
+
+ gdb_assert (tdep->wordsize == 4);
+@@ -99,9 +99,9 @@ ppc_sysv_abi_push_dummy_call (struct gdb
+ /* Next available vector register for vector arguments. */
+ int vreg = 2;
+ /* Arguments start above the "LR save word" and "Back chain". */
+- int argoffset = 2 * tdep->wordsize;
++ LONGEST argoffset = 2 * tdep->wordsize;
+ /* Structures start after the arguments. */
+- int structoffset = argoffset + argspace;
++ LONGEST structoffset = argoffset + argspace;
+
+ /* If the function is returning a `struct', then the first word
+ (which will be passed in r3) is used for struct return
+@@ -120,7 +120,7 @@ ppc_sysv_abi_push_dummy_call (struct gdb
+ {
+ struct value *arg = args[argno];
+ struct type *type = check_typedef (value_type (arg));
+- int len = TYPE_LENGTH (type);
++ ssize_t len = TYPE_LENGTH (type);
+ const bfd_byte *val = value_contents (arg);
+
+ if (TYPE_CODE (type) == TYPE_CODE_FLT && len <= 8
+@@ -1285,11 +1285,11 @@ struct ppc64_sysv_argpos
+
+ static void
+ ppc64_sysv_abi_push_val (struct gdbarch *gdbarch,
+- const bfd_byte *val, int len, int align,
++ const bfd_byte *val, ssize_t len, int align,
+ struct ppc64_sysv_argpos *argpos)
+ {
+ struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
+- int offset = 0;
++ LONGEST offset = 0;
+
+ /* Enforce alignment of stack location, if requested. */
+ if (align > tdep->wordsize)
+@@ -1327,7 +1327,7 @@ ppc64_sysv_abi_push_val (struct gdbarch
+ if (argpos->regcache && argpos->greg <= 10)
+ regcache_cooked_write_part (argpos->regcache,
+ tdep->ppc_gp0_regnum + argpos->greg,
+- offset, len, val);
++ offset, (LONGEST) len, val);
+ argpos->greg++;
+ }
+ }
+@@ -1386,7 +1386,7 @@ ppc64_sysv_abi_push_freg (struct gdbarch
+ if (argpos->regcache && argpos->freg <= 13)
+ {
+ int regnum = tdep->ppc_fp0_regnum + argpos->freg;
+- int offset = 0;
++ LONGEST offset = 0;
+
+ if (gdbarch_byte_order (gdbarch) == BFD_ENDIAN_BIG)
+ offset = 8 - TYPE_LENGTH (type);
+@@ -1836,7 +1836,7 @@ ppc64_sysv_abi_return_value_base (struct
+ && TYPE_CODE (valtype) == TYPE_CODE_DECFLOAT)
+ {
+ int regnum = tdep->ppc_fp0_regnum + 1 + index;
+- int offset = 0;
++ LONGEST offset = 0;
+
+ if (gdbarch_byte_order (gdbarch) == BFD_ENDIAN_BIG)
+ offset = 8 - TYPE_LENGTH (valtype);
+@@ -1912,7 +1912,7 @@ ppc64_sysv_abi_return_value_base (struct
+ && TYPE_CODE (valtype) == TYPE_CODE_ARRAY && TYPE_VECTOR (valtype))
+ {
+ int regnum = tdep->ppc_gp0_regnum + 3 + index;
+- int offset = 0;
++ LONGEST offset = 0;
+
+ if (gdbarch_byte_order (gdbarch) == BFD_ENDIAN_BIG)
+ offset = 8 - TYPE_LENGTH (valtype);
+@@ -2020,7 +2020,8 @@ ppc64_sysv_abi_return_value (struct gdba
+ && TYPE_LENGTH (TYPE_TARGET_TYPE (valtype)) == 1)
+ {
+ int regnum = tdep->ppc_gp0_regnum + 3;
+- int offset = (register_size (gdbarch, regnum) - TYPE_LENGTH (valtype));
++ LONGEST offset
++ = (register_size (gdbarch, regnum) - TYPE_LENGTH (valtype));
+
+ if (writebuf != NULL)
+ regcache_cooked_write_part (regcache, regnum,
+diff -Naurp insight-8.1.50.20180216.orig/gdb/rl78-tdep.c insight-8.1.50.20180216.new/gdb/rl78-tdep.c
+--- insight-8.1.50.20180216.orig/gdb/rl78-tdep.c 2018-01-26 13:46:47.000000000 +0100
++++ insight-8.1.50.20180216.new/gdb/rl78-tdep.c 2018-02-18 01:29:33.377144686 +0100
+@@ -1346,8 +1346,8 @@ rl78_push_dummy_call (struct gdbarch *gd
+ for (i = nargs - 1; i >= 0; i--)
+ {
+ struct type *value_type = value_enclosing_type (args[i]);
+- int len = TYPE_LENGTH (value_type);
+- int container_len = (len + 1) & ~1;
++ LONGEST len = TYPE_LENGTH (value_type);
++ LONGEST container_len = (len + 1) & ~1;
+
+ sp -= container_len;
+ write_memory (rl78_make_data_address (sp),
+diff -Naurp insight-8.1.50.20180216.orig/gdb/rs6000-aix-tdep.c insight-8.1.50.20180216.new/gdb/rs6000-aix-tdep.c
+--- insight-8.1.50.20180216.orig/gdb/rs6000-aix-tdep.c 2018-01-04 17:43:15.000000000 +0100
++++ insight-8.1.50.20180216.new/gdb/rs6000-aix-tdep.c 2018-02-18 01:29:33.377144686 +0100
+@@ -187,9 +187,9 @@ rs6000_push_dummy_call (struct gdbarch *
+ struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
+ enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
+ int ii;
+- int len = 0;
++ LONGEST len = 0;
+ int argno; /* current argument number */
+- int argbytes; /* current argument byte */
++ LONGEST argbytes; /* current argument byte */
+ gdb_byte tmp_buffer[50];
+ int f_argno = 0; /* current floating point argno */
+ int wordsize = gdbarch_tdep (gdbarch)->wordsize;
+@@ -319,7 +319,7 @@ ran_out_of_registers_for_arguments:
+
+ if ((argno < nargs) || argbytes)
+ {
+- int space = 0, jj;
++ LONGEST space = 0, jj;
+
+ if (argbytes)
+ {
+diff -Naurp insight-8.1.50.20180216.orig/gdb/s390-tdep.c insight-8.1.50.20180216.new/gdb/s390-tdep.c
+--- insight-8.1.50.20180216.orig/gdb/s390-tdep.c 2018-02-02 13:28:13.000000000 +0100
++++ insight-8.1.50.20180216.new/gdb/s390-tdep.c 2018-02-18 01:47:13.589382630 +0100
+@@ -1653,7 +1653,7 @@ s390_function_arg_vector (struct type *t
+ /* Determine whether N is a power of two. */
+
+ static int
+-is_power_of_two (unsigned int n)
++is_power_of_two (ULONGEST n)
+ {
+ return n && ((n & (n - 1)) == 0);
+ }
+@@ -1710,7 +1710,7 @@ s390_handle_arg (struct s390_arg_state *
+ enum bfd_endian byte_order, int is_unnamed)
+ {
+ struct type *type = check_typedef (value_type (arg));
+- unsigned int length = TYPE_LENGTH (type);
++ LONGEST length = TYPE_LENGTH (type);
+ int write_mode = as->regcache != NULL;
+
+ if (s390_function_arg_float (type))
+@@ -1975,7 +1975,7 @@ s390_register_return_value (struct gdbar
+ {
+ enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
+ int word_size = gdbarch_ptr_bit (gdbarch) / 8;
+- int length = TYPE_LENGTH (type);
++ LONGEST length = TYPE_LENGTH (type);
+ int code = TYPE_CODE (type);
+
+ if (code == TYPE_CODE_FLT || code == TYPE_CODE_DECFLOAT)
+diff -Naurp insight-8.1.50.20180216.orig/gdb/score-tdep.c insight-8.1.50.20180216.new/gdb/score-tdep.c
+--- insight-8.1.50.20180216.orig/gdb/score-tdep.c 2018-01-04 17:43:15.000000000 +0100
++++ insight-8.1.50.20180216.new/gdb/score-tdep.c 2018-02-18 01:29:33.378144695 +0100
+@@ -516,7 +516,7 @@ score_push_dummy_call (struct gdbarch *g
+ enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
+ int argnum;
+ int argreg;
+- int arglen = 0;
++ LONGEST arglen = 0;
+ CORE_ADDR stack_offset = 0;
+ CORE_ADDR addr = 0;
+
+diff -Naurp insight-8.1.50.20180216.orig/gdb/sh64-tdep.c insight-8.1.50.20180216.new/gdb/sh64-tdep.c
+--- insight-8.1.50.20180216.orig/gdb/sh64-tdep.c 2018-01-26 13:46:47.000000000 +0100
++++ insight-8.1.50.20180216.new/gdb/sh64-tdep.c 2018-02-18 01:29:33.379144705 +0100
+@@ -1079,7 +1079,7 @@ sh64_push_dummy_call (struct gdbarch *gd
+ CORE_ADDR struct_addr)
+ {
+ enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
+- int stack_offset, stack_alloc;
++ LONGEST stack_offset, stack_alloc;
+ int int_argreg;
+ int float_arg_index = 0;
+ int double_arg_index = 0;
+@@ -1088,7 +1088,7 @@ sh64_push_dummy_call (struct gdbarch *gd
+ CORE_ADDR regval;
+ const gdb_byte *val;
+ gdb_byte valbuf[8];
+- int len;
++ LONGEST len;
+ int argreg_size;
+ int fp_args[12];
+
+diff -Naurp insight-8.1.50.20180216.orig/gdb/sh-tdep.c insight-8.1.50.20180216.new/gdb/sh-tdep.c
+--- insight-8.1.50.20180216.orig/gdb/sh-tdep.c 2018-01-26 13:46:47.000000000 +0100
++++ insight-8.1.50.20180216.new/gdb/sh-tdep.c 2018-02-18 01:29:33.379144705 +0100
+@@ -813,7 +813,7 @@ sh_skip_prologue (struct gdbarch *gdbarc
+ static int
+ sh_use_struct_convention (int renesas_abi, struct type *type)
+ {
+- int len = TYPE_LENGTH (type);
++ LONGEST len = TYPE_LENGTH (type);
+ int nelem = TYPE_NFIELDS (type);
+
+ /* The Renesas ABI returns aggregate types always on stack. */
+@@ -915,7 +915,7 @@ sh_frame_align (struct gdbarch *ignore,
+
+ /* Helper function to justify value in register according to endianess. */
+ static const gdb_byte *
+-sh_justify_value_in_reg (struct gdbarch *gdbarch, struct value *val, int len)
++sh_justify_value_in_reg (struct gdbarch *gdbarch, struct value *val, LONGEST len)
+ {
+ static gdb_byte valbuf[4];
+
+@@ -1075,7 +1075,8 @@ sh_push_dummy_call_fpu (struct gdbarch *
+ struct type *type;
+ CORE_ADDR regval;
+ const gdb_byte *val;
+- int len, reg_size = 0;
++ LONGEST len;
++ int reg_size = 0;
+ int pass_on_stack = 0;
+ int treat_as_flt;
+ int last_reg_arg = INT_MAX;
+@@ -1216,7 +1217,8 @@ sh_push_dummy_call_nofpu (struct gdbarch
+ struct type *type;
+ CORE_ADDR regval;
+ const gdb_byte *val;
+- int len, reg_size = 0;
++ LONGEST len;
++ int reg_size = 0;
+ int pass_on_stack = 0;
+ int last_reg_arg = INT_MAX;
+
+diff -Naurp insight-8.1.50.20180216.orig/gdb/sparc64-tdep.c insight-8.1.50.20180216.new/gdb/sparc64-tdep.c
+--- insight-8.1.50.20180216.orig/gdb/sparc64-tdep.c 2018-01-26 13:46:47.000000000 +0100
++++ insight-8.1.50.20180216.new/gdb/sparc64-tdep.c 2018-02-18 01:29:33.380144714 +0100
+@@ -1205,7 +1205,7 @@ sparc64_16_byte_align_p (struct type *ty
+
+ static void
+ sparc64_store_floating_fields (struct regcache *regcache, struct type *type,
+- const gdb_byte *valbuf, int element, int bitpos)
++ const gdb_byte *valbuf, int element, LONGEST bitpos)
+ {
+ struct gdbarch *gdbarch = regcache->arch ();
+ int len = TYPE_LENGTH (type);
+@@ -1265,7 +1265,7 @@ sparc64_store_floating_fields (struct re
+ for (i = 0; i < TYPE_NFIELDS (type); i++)
+ {
+ struct type *subtype = check_typedef (TYPE_FIELD_TYPE (type, i));
+- int subpos = bitpos + TYPE_FIELD_BITPOS (type, i);
++ LONGEST subpos = bitpos + TYPE_FIELD_BITPOS (type, i);
+
+ sparc64_store_floating_fields (regcache, subtype, valbuf,
+ element, subpos);
+@@ -1297,7 +1297,7 @@ sparc64_store_floating_fields (struct re
+
+ static void
+ sparc64_extract_floating_fields (struct regcache *regcache, struct type *type,
+- gdb_byte *valbuf, int bitpos)
++ gdb_byte *valbuf, LONGEST bitpos)
+ {
+ struct gdbarch *gdbarch = regcache->arch ();
+
+@@ -1353,7 +1353,7 @@ sparc64_extract_floating_fields (struct
+ for (i = 0; i < TYPE_NFIELDS (type); i++)
+ {
+ struct type *subtype = check_typedef (TYPE_FIELD_TYPE (type, i));
+- int subpos = bitpos + TYPE_FIELD_BITPOS (type, i);
++ LONGEST subpos = bitpos + TYPE_FIELD_BITPOS (type, i);
+
+ sparc64_extract_floating_fields (regcache, subtype, valbuf, subpos);
+ }
+@@ -1386,7 +1386,7 @@ sparc64_store_arguments (struct regcache
+ for (i = 0; i < nargs; i++)
+ {
+ struct type *type = value_type (args[i]);
+- int len = TYPE_LENGTH (type);
++ LONGEST len = TYPE_LENGTH (type);
+
+ if (sparc64_structure_or_union_p (type)
+ || (sparc64_complex_floating_p (type) && len == 32))
+@@ -1486,7 +1486,7 @@ sparc64_store_arguments (struct regcache
+ {
+ const gdb_byte *valbuf = value_contents (args[i]);
+ struct type *type = value_type (args[i]);
+- int len = TYPE_LENGTH (type);
++ LONGEST len = TYPE_LENGTH (type);
+ int regnum = -1;
+ gdb_byte buf[16];
+
+diff -Naurp insight-8.1.50.20180216.orig/gdb/spu-tdep.c insight-8.1.50.20180216.new/gdb/spu-tdep.c
+--- insight-8.1.50.20180216.orig/gdb/spu-tdep.c 2018-01-26 13:46:47.000000000 +0100
++++ insight-8.1.50.20180216.new/gdb/spu-tdep.c 2018-02-18 01:29:33.380144714 +0100
+@@ -1430,7 +1430,7 @@ spu_push_dummy_call (struct gdbarch *gdb
+ struct value *arg = args[i];
+ struct type *type = check_typedef (value_type (arg));
+ const gdb_byte *contents = value_contents (arg);
+- int n_regs = align_up (TYPE_LENGTH (type), 16) / 16;
++ LONGEST n_regs = align_up (TYPE_LENGTH (type), 16) / 16;
+
+ /* If the argument doesn't wholly fit into registers, it and
+ all subsequent arguments go to the stack. */
+@@ -1462,7 +1462,7 @@ spu_push_dummy_call (struct gdbarch *gdb
+ {
+ struct value *arg = args[i];
+ struct type *type = check_typedef (value_type (arg));
+- int len = TYPE_LENGTH (type);
++ LONGEST len = TYPE_LENGTH (type);
+ int preferred_slot;
+
+ if (spu_scalar_value_p (type))
+diff -Naurp insight-8.1.50.20180216.orig/gdb/tic6x-tdep.c insight-8.1.50.20180216.new/gdb/tic6x-tdep.c
+--- insight-8.1.50.20180216.orig/gdb/tic6x-tdep.c 2018-01-04 17:43:15.000000000 +0100
++++ insight-8.1.50.20180216.new/gdb/tic6x-tdep.c 2018-02-18 01:29:33.380144714 +0100
+@@ -883,7 +883,7 @@ tic6x_push_dummy_call (struct gdbarch *g
+ int argreg = 0;
+ int argnum;
+ int stack_offset = 4;
+- int references_offset = 4;
++ LONGEST references_offset = 4;
+ CORE_ADDR func_addr = find_function_addr (function, NULL);
+ enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
+ struct type *func_type = value_type (function);
+@@ -917,7 +917,7 @@ tic6x_push_dummy_call (struct gdbarch *g
+ /* Now make space on the stack for the args. */
+ for (argnum = 0; argnum < nargs; argnum++)
+ {
+- int len = align_up (TYPE_LENGTH (value_type (args[argnum])), 4);
++ LONGEST len = align_up (TYPE_LENGTH (value_type (args[argnum])), 4);
+ if (argnum >= 10 - argreg)
+ references_offset += len;
+ stack_offset += len;
+@@ -936,7 +936,7 @@ tic6x_push_dummy_call (struct gdbarch *g
+ const gdb_byte *val;
+ struct value *arg = args[argnum];
+ struct type *arg_type = check_typedef (value_type (arg));
+- int len = TYPE_LENGTH (arg_type);
++ ssize_t len = TYPE_LENGTH (arg_type);
+ enum type_code typecode = TYPE_CODE (arg_type);
+
+ val = value_contents (arg);
+@@ -1096,7 +1096,8 @@ tic6x_push_dummy_call (struct gdbarch *g
+ }
+ else
+ internal_error (__FILE__, __LINE__,
+- _("unexpected length %d of arg %d"), len, argnum);
++ _("unexpected length %s of arg %d"),
++ plongest (len), argnum);
+
+ addr = sp + stack_offset;
+ write_memory (addr, val, len);
+diff -Naurp insight-8.1.50.20180216.orig/gdb/tilegx-tdep.c insight-8.1.50.20180216.new/gdb/tilegx-tdep.c
+--- insight-8.1.50.20180216.orig/gdb/tilegx-tdep.c 2018-01-04 17:43:15.000000000 +0100
++++ insight-8.1.50.20180216.new/gdb/tilegx-tdep.c 2018-02-18 01:29:33.381144723 +0100
+@@ -288,7 +288,7 @@ tilegx_push_dummy_call (struct gdbarch *
+ CORE_ADDR stack_dest = sp;
+ int argreg = TILEGX_R0_REGNUM;
+ int i, j;
+- int typelen, slacklen;
++ LONGEST typelen, slacklen;
+ static const gdb_byte four_zero_words[16] = { 0 };
+
+ /* If struct_return is 1, then the struct return address will
+diff -Naurp insight-8.1.50.20180216.orig/gdb/v850-tdep.c insight-8.1.50.20180216.new/gdb/v850-tdep.c
+--- insight-8.1.50.20180216.orig/gdb/v850-tdep.c 2018-01-04 17:43:15.000000000 +0100
++++ insight-8.1.50.20180216.new/gdb/v850-tdep.c 2018-02-18 01:29:33.381144723 +0100
+@@ -1019,7 +1019,7 @@ v850_push_dummy_call (struct gdbarch *gd
+ enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
+ int argreg;
+ int argnum;
+- int len = 0;
++ LONGEST len = 0;
+ int stack_offset;
+
+ if (gdbarch_tdep (gdbarch)->abi == V850_ABI_RH850)
+@@ -1047,7 +1047,7 @@ v850_push_dummy_call (struct gdbarch *gd
+ in four registers available. Loop thru args from first to last. */
+ for (argnum = 0; argnum < nargs; argnum++)
+ {
+- int len;
++ LONGEST len;
+ gdb_byte *val;
+ gdb_byte valbuf[v850_reg_size];
+
+diff -Naurp insight-8.1.50.20180216.orig/gdb/vax-tdep.c insight-8.1.50.20180216.new/gdb/vax-tdep.c
+--- insight-8.1.50.20180216.orig/gdb/vax-tdep.c 2018-02-18 01:25:08.188666458 +0100
++++ insight-8.1.50.20180216.new/gdb/vax-tdep.c 2018-02-18 01:29:33.381144723 +0100
+@@ -110,7 +110,7 @@ vax_store_arguments (struct regcache *re
+ struct gdbarch *gdbarch = regcache->arch ();
+ enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
+ gdb_byte buf[4];
+- int count = 0;
++ LONGEST count = 0;
+ int i;
+
+ /* We create an argument list on the stack, and make the argument
+@@ -119,7 +119,7 @@ vax_store_arguments (struct regcache *re
+ /* Push arguments in reverse order. */
+ for (i = nargs - 1; i >= 0; i--)
+ {
+- int len = TYPE_LENGTH (value_enclosing_type (args[i]));
++ LONGEST len = TYPE_LENGTH (value_enclosing_type (args[i]));
+
+ sp -= (len + 3) & ~3;
+ count += (len + 3) / 4;
+diff -Naurp insight-8.1.50.20180216.orig/gdb/xstormy16-tdep.c insight-8.1.50.20180216.new/gdb/xstormy16-tdep.c
+--- insight-8.1.50.20180216.orig/gdb/xstormy16-tdep.c 2018-01-04 17:43:15.000000000 +0100
++++ insight-8.1.50.20180216.new/gdb/xstormy16-tdep.c 2018-02-18 01:29:33.381144723 +0100
+@@ -232,8 +232,9 @@ xstormy16_push_dummy_call (struct gdbarc
+ enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
+ CORE_ADDR stack_dest = sp;
+ int argreg = E_1ST_ARG_REGNUM;
+- int i, j;
+- int typelen, slacklen;
++ int i, slacklen;
++ LONGEST j;
++ LONGEST typelen;
+ const gdb_byte *val;
+ gdb_byte buf[xstormy16_pc_size];
+
+diff -Naurp insight-8.1.50.20180216.orig/gdb/xtensa-tdep.c insight-8.1.50.20180216.new/gdb/xtensa-tdep.c
+--- insight-8.1.50.20180216.orig/gdb/xtensa-tdep.c 2018-01-26 13:46:47.000000000 +0100
++++ insight-8.1.50.20180216.new/gdb/xtensa-tdep.c 2018-02-18 01:29:33.382144733 +0100
+@@ -1627,8 +1627,7 @@ xtensa_store_return_value (struct type *
+
+ if (len > (callsize > 8 ? 8 : 16))
+ internal_error (__FILE__, __LINE__,
+- _("unimplemented for this length: %d"),
+- TYPE_LENGTH (type));
++ _("unimplemented for this length: %d"), len);
+ areg = arreg_number (gdbarch,
+ gdbarch_tdep (gdbarch)->a0_base + 2 + callsize, wb);
+
+@@ -1702,18 +1701,18 @@ xtensa_push_dummy_call (struct gdbarch *
+ {
+ enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
+ int i;
+- int size, onstack_size;
++ LONGEST size, onstack_size;
+ gdb_byte *buf = (gdb_byte *) alloca (16);
+ CORE_ADDR ra, ps;
+ struct argument_info
+ {
+ const bfd_byte *contents;
+- int length;
++ ssize_t length;
+ int onstack; /* onstack == 0 => in reg */
+ int align; /* alignment */
+ union
+ {
+- int offset; /* stack offset if on stack. */
++ ssize_t offset; /* stack offset if on stack. */
+ int regno; /* regno if in register. */
+ } u;
+ };
+@@ -1737,9 +1736,10 @@ xtensa_push_dummy_call (struct gdbarch *
+ {
+ struct value *arg = args[i];
+ struct type *arg_type = check_typedef (value_type (arg));
+- fprintf_unfiltered (gdb_stdlog, "%2d: %s %3d ", i,
+- host_address_to_string (arg),
+- TYPE_LENGTH (arg_type));
++ const char *arg_type_len_s = pulongest (TYPE_LENGTH (arg_type));
++
++ fprintf_unfiltered (gdb_stdlog, "%2d: %s %s ", i,
++ host_address_to_string (arg), arg_type_len_s);
+ switch (TYPE_CODE (arg_type))
+ {
+ case TYPE_CODE_INT:
+@@ -1809,8 +1809,8 @@ xtensa_push_dummy_call (struct gdbarch *
+ info->align = TYPE_LENGTH (builtin_type (gdbarch)->builtin_long);
+ break;
+ }
+- info->length = TYPE_LENGTH (arg_type);
+ info->contents = value_contents (arg);
++ info->length = TYPE_LENGTH (arg_type);
+
+ /* Align size and onstack_size. */
+ size = (size + info->align - 1) & ~(info->align - 1);
+@@ -1855,7 +1855,7 @@ xtensa_push_dummy_call (struct gdbarch *
+
+ if (info->onstack)
+ {
+- int n = info->length;
++ ssize_t n = info->length;
+ CORE_ADDR offset = sp + info->u.offset;
+
+ /* Odd-sized structs are aligned to the lower side of a memory
+@@ -1871,7 +1871,7 @@ xtensa_push_dummy_call (struct gdbarch *
+ }
+ else
+ {
+- int n = info->length;
++ ssize_t n = info->length;
+ const bfd_byte *cp = info->contents;
+ int r = info->u.regno;
+
diff --git a/insight-8.1-gdb-vla-intel-fortran-vla-strings.patch b/insight-8.1-gdb-vla-intel-fortran-vla-strings.patch
new file mode 100644
index 0000000..4936a4f
--- /dev/null
+++ b/insight-8.1-gdb-vla-intel-fortran-vla-strings.patch
@@ -0,0 +1,1321 @@
+diff -Naurp insight-8.1.50.20180216.orig/gdb/c-valprint.c insight-8.1.50.20180216.new/gdb/c-valprint.c
+--- insight-8.1.50.20180216.orig/gdb/c-valprint.c 2018-01-12 03:18:43.000000000 +0100
++++ insight-8.1.50.20180216.new/gdb/c-valprint.c 2018-02-17 14:58:10.995392193 +0100
+@@ -653,6 +653,28 @@ c_value_print (struct value *val, struct
+ else
+ {
+ /* normal case */
++ if (TYPE_CODE (type) == TYPE_CODE_PTR
++ && 1 == is_dynamic_type (type))
++ {
++ CORE_ADDR addr;
++ if (NULL != TYPE_DATA_LOCATION (TYPE_TARGET_TYPE (type)))
++ addr = value_address (val);
++ else
++ addr = value_as_address (val);
++
++ /* We resolve the target-type only when the
++ pointer is associated. */
++ if ((addr != 0)
++ && (0 == type_not_associated (type)))
++ TYPE_TARGET_TYPE (type) =
++ resolve_dynamic_type (TYPE_TARGET_TYPE (type),
++ NULL, addr);
++ }
++ else
++ {
++ /* Do nothing. References are already resolved from the beginning,
++ only pointers are resolved when we actual need the target. */
++ }
+ fprintf_filtered (stream, "(");
+ type_print (value_type (val), "", stream, -1);
+ fprintf_filtered (stream, ") ");
+diff -Naurp insight-8.1.50.20180216.orig/gdb/dwarf2read.c insight-8.1.50.20180216.new/gdb/dwarf2read.c
+--- insight-8.1.50.20180216.orig/gdb/dwarf2read.c 2018-02-17 14:57:12.613814424 +0100
++++ insight-8.1.50.20180216.new/gdb/dwarf2read.c 2018-02-17 15:22:19.927537926 +0100
+@@ -2108,7 +2108,8 @@ static void read_signatured_type (struct
+
+ static int attr_to_dynamic_prop (const struct attribute *attr,
+ struct die_info *die, struct dwarf2_cu *cu,
+- struct dynamic_prop *prop);
++ struct dynamic_prop *prop, const gdb_byte *additional_data,
++ int additional_data_size);
+
+ /* memory allocation interface */
+
+@@ -13846,7 +13847,7 @@ read_func_scope (struct die_info *die, s
+ {
+ newobj->static_link
+ = XOBNEW (&objfile->objfile_obstack, struct dynamic_prop);
+- attr_to_dynamic_prop (attr, die, cu, newobj->static_link);
++ attr_to_dynamic_prop (attr, die, cu, newobj->static_link, NULL, 0);
+ }
+
+ cu->list_in_scope = &local_symbols;
+@@ -16434,7 +16435,8 @@ read_array_type (struct die_info *die, s
+
+ 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);
+ if (!stride_ok)
+ {
+ complaint (&symfile_complaints,
+@@ -17186,29 +17188,94 @@ read_tag_string_type (struct die_info *d
+ struct gdbarch *gdbarch = get_objfile_arch (objfile);
+ struct type *type, *range_type, *index_type, *char_type;
+ struct attribute *attr;
+- unsigned int length;
++ unsigned int length = UINT_MAX;
+
++ index_type = objfile_type (objfile)->builtin_int;
++ range_type = create_static_range_type (NULL, index_type, 1, length);
++
++ /* If DW_AT_string_length is defined, the length is stored in memory. */
+ attr = dwarf2_attr (die, DW_AT_string_length, cu);
+ if (attr)
+ {
+- length = DW_UNSND (attr);
++ if (attr_form_is_block (attr))
++ {
++ struct attribute *byte_size, *bit_size;
++ struct dynamic_prop high;
++
++ byte_size = dwarf2_attr (die, DW_AT_byte_size, cu);
++ bit_size = dwarf2_attr (die, DW_AT_bit_size, cu);
++
++ /* DW_AT_byte_size should never occur in combination with
++ DW_AT_bit_size. */
++ if (byte_size != NULL && bit_size != NULL)
++ complaint (&symfile_complaints,
++ _("DW_AT_byte_size AND "
++ "DW_AT_bit_size found together at the same time."));
++
++ /* If DW_AT_string_length AND DW_AT_byte_size exist together,
++ DW_AT_byte_size describes the number of bytes that should be read
++ from the length memory location. */
++ if (byte_size != NULL)
++ {
++ /* Build new dwarf2_locexpr_baton structure with additions to the
++ data attribute, to reflect DWARF specialities to get address
++ sizes. */
++ const gdb_byte append_ops[] =
++ {
++ /* DW_OP_deref_size: size of an address on the target machine
++ (bytes), where the size will be specified by the next
++ operand. */
++ DW_OP_deref_size,
++ /* Operand for DW_OP_deref_size. */
++ DW_UNSND(byte_size) };
++
++ if (!attr_to_dynamic_prop (attr, die, cu, &high, append_ops,
++ ARRAY_SIZE(append_ops)))
++ complaint (&symfile_complaints,
++ _("Could not parse DW_AT_byte_size"));
++ }
++ else if (bit_size != NULL)
++ complaint (&symfile_complaints,
++ _("DW_AT_string_length AND "
++ "DW_AT_bit_size found but not supported yet."));
++ /* If DW_AT_string_length WITHOUT DW_AT_byte_size exist, the default
++ is the address size of the target machine. */
++ else
++ {
++ const gdb_byte append_ops[] =
++ { DW_OP_deref };
++
++ if (!attr_to_dynamic_prop (attr, die, cu, &high, append_ops,
++ ARRAY_SIZE(append_ops)))
++ complaint (&symfile_complaints,
++ _("Could not parse DW_AT_string_length"));
++ }
++
++ TYPE_RANGE_DATA (range_type)->high = high;
++ }
++ else
++ {
++ TYPE_HIGH_BOUND (range_type) = DW_UNSND(attr);
++ TYPE_HIGH_BOUND_KIND (range_type) = PROP_CONST;
++ }
+ }
+ else
+ {
+- /* Check for the DW_AT_byte_size attribute. */
++ /* Check for the DW_AT_byte_size attribute, which represents the length
++ in this case. */
+ attr = dwarf2_attr (die, DW_AT_byte_size, cu);
+ if (attr)
+- {
+- length = DW_UNSND (attr);
+- }
++ {
++ TYPE_HIGH_BOUND (range_type) = DW_UNSND(attr);
++ TYPE_HIGH_BOUND_KIND (range_type) = PROP_CONST;
++ }
+ else
+- {
+- length = 1;
+- }
++ {
++ TYPE_HIGH_BOUND (range_type) = 1;
++ TYPE_HIGH_BOUND_KIND (range_type) = PROP_CONST;
++ }
+ }
+
+- index_type = objfile_type (objfile)->builtin_int;
+- range_type = create_static_range_type (NULL, index_type, 1, length);
+ char_type = language_string_char_type (cu->language_defn, gdbarch);
+ type = create_string_type (NULL, char_type, range_type);
+
+@@ -17557,7 +17624,8 @@ read_base_type (struct die_info *die, st
+
+ static int
+ attr_to_dynamic_prop (const struct attribute *attr, struct die_info *die,
+- struct dwarf2_cu *cu, struct dynamic_prop *prop)
++ struct dwarf2_cu *cu, struct dynamic_prop *prop,
++ const gdb_byte *additional_data, int additional_data_size)
+ {
+ struct dwarf2_property_baton *baton;
+ struct obstack *obstack
+@@ -17568,14 +17636,33 @@ attr_to_dynamic_prop (const struct attri
+
+ if (attr_form_is_block (attr))
+ {
+- baton = XOBNEW (obstack, struct dwarf2_property_baton);
++ baton = XOBNEW(obstack, struct dwarf2_property_baton);
+ baton->referenced_type = NULL;
+ baton->locexpr.per_cu = cu->per_cu;
+- baton->locexpr.size = DW_BLOCK (attr)->size;
+- baton->locexpr.data = DW_BLOCK (attr)->data;
++
++ if (additional_data != NULL && additional_data_size > 0)
++ {
++ gdb_byte *data;
++
++ data = (gdb_byte *) obstack_alloc(
++ &cu->per_cu->dwarf2_per_objfile->objfile->objfile_obstack,
++ DW_BLOCK (attr)->size + additional_data_size);
++ memcpy (data, DW_BLOCK (attr)->data, DW_BLOCK (attr)->size);
++ memcpy (data + DW_BLOCK (attr)->size, additional_data,
++ additional_data_size);
++
++ baton->locexpr.data = data;
++ baton->locexpr.size = DW_BLOCK (attr)->size + additional_data_size;
++ }
++ else
++ {
++ baton->locexpr.data = DW_BLOCK (attr)->data;
++ baton->locexpr.size = DW_BLOCK (attr)->size;
++ }
++
+ prop->data.baton = baton;
+ prop->kind = PROP_LOCEXPR;
+- gdb_assert (prop->data.baton != NULL);
++ gdb_assert(prop->data.baton != NULL);
+ }
+ else if (attr_form_is_ref (attr))
+ {
+@@ -17608,8 +17695,28 @@ attr_to_dynamic_prop (const struct attri
+ baton = XOBNEW (obstack, struct dwarf2_property_baton);
+ baton->referenced_type = die_type (target_die, target_cu);
+ baton->locexpr.per_cu = cu->per_cu;
+- baton->locexpr.size = DW_BLOCK (target_attr)->size;
+- baton->locexpr.data = DW_BLOCK (target_attr)->data;
++
++ if (additional_data != NULL && additional_data_size > 0)
++ {
++ gdb_byte *data;
++
++ data = (gdb_byte *) obstack_alloc (&cu->per_cu->dwarf2_per_objfile->objfile->objfile_obstack,
++ DW_BLOCK (target_attr)->size + additional_data_size);
++ memcpy (data, DW_BLOCK (target_attr)->data,
++ DW_BLOCK (target_attr)->size);
++ memcpy (data + DW_BLOCK (target_attr)->size,
++ additional_data, additional_data_size);
++
++ baton->locexpr.data = data;
++ baton->locexpr.size = (DW_BLOCK (target_attr)->size
++ + additional_data_size);
++ }
++ else
++ {
++ baton->locexpr.data = DW_BLOCK (target_attr)->data;
++ baton->locexpr.size = DW_BLOCK (target_attr)->size;
++ }
++
+ prop->data.baton = baton;
+ prop->kind = PROP_LOCEXPR;
+ gdb_assert (prop->data.baton != NULL);
+@@ -17720,14 +17827,14 @@ read_subrange_type (struct die_info *die
+
+ attr = dwarf2_attr (die, DW_AT_byte_stride, cu);
+ if (attr)
+- if (!attr_to_dynamic_prop (attr, die, cu, &stride))
++ if (!attr_to_dynamic_prop (attr, die, cu, &stride, NULL, 0))
+ complaint (&symfile_complaints, _("Missing DW_AT_byte_stride "
+ "- DIE at 0x%x [in module %s]"),
+- to_underlying (die->sect_off), objfile_name (cu->objfile));
++ to_underlying (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);
++ attr_to_dynamic_prop (attr, die, cu, &low, NULL, 0);
+ else if (!low_default_is_valid)
+ complaint (&symfile_complaints, _("Missing DW_AT_lower_bound "
+ "- DIE at 0x%x [in module %s]"),
+@@ -17735,10 +17842,10 @@ read_subrange_type (struct die_info *die
+ objfile_name (cu->per_cu->dwarf2_per_objfile->objfile));
+
+ attr = dwarf2_attr (die, DW_AT_upper_bound, cu);
+- if (!attr_to_dynamic_prop (attr, die, cu, &high))
++ if (!attr_to_dynamic_prop (attr, die, cu, &high, NULL, 0))
+ {
+ attr = dwarf2_attr (die, DW_AT_count, cu);
+- if (attr_to_dynamic_prop (attr, die, cu, &high))
++ if (attr_to_dynamic_prop (attr, die, cu, &high, NULL, 0))
+ {
+ /* If bounds are constant do the final calculation here. */
+ if (low.kind == PROP_CONST && high.kind == PROP_CONST)
+@@ -25311,7 +25418,7 @@ set_die_type (struct die_info *die, stru
+ attr = dwarf2_attr (die, DW_AT_allocated, cu);
+ if (attr_form_is_block (attr))
+ {
+- if (attr_to_dynamic_prop (attr, die, cu, &prop))
++ if (attr_to_dynamic_prop (attr, die, cu, &prop, NULL, 0))
+ add_dyn_prop (DYN_PROP_ALLOCATED, prop, type);
+ }
+ else if (attr != NULL)
+@@ -25326,7 +25433,7 @@ set_die_type (struct die_info *die, stru
+ attr = dwarf2_attr (die, DW_AT_associated, cu);
+ if (attr_form_is_block (attr))
+ {
+- if (attr_to_dynamic_prop (attr, die, cu, &prop))
++ if (attr_to_dynamic_prop (attr, die, cu, &prop, NULL, 0))
+ add_dyn_prop (DYN_PROP_ASSOCIATED, prop, type);
+ }
+ else if (attr != NULL)
+@@ -25339,7 +25446,7 @@ set_die_type (struct die_info *die, stru
+
+ /* Read DW_AT_data_location and set in type. */
+ attr = dwarf2_attr (die, DW_AT_data_location, cu);
+- if (attr_to_dynamic_prop (attr, die, cu, &prop))
++ if (attr_to_dynamic_prop (attr, die, cu, &prop, NULL, 0))
+ add_dyn_prop (DYN_PROP_DATA_LOCATION, prop, type);
+
+ if (dwarf2_per_objfile->die_type_hash == NULL)
+diff -Naurp insight-8.1.50.20180216.orig/gdb/f-typeprint.c insight-8.1.50.20180216.new/gdb/f-typeprint.c
+--- insight-8.1.50.20180216.orig/gdb/f-typeprint.c 2018-01-04 17:43:15.000000000 +0100
++++ insight-8.1.50.20180216.new/gdb/f-typeprint.c 2018-02-17 14:58:10.998392222 +0100
+@@ -37,7 +37,7 @@ static void f_type_print_args (struct ty
+ #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 c
+ {
+ 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 c
+
+ 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
+ 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
+ fprintf_filtered (stream, "(");
+
+ if (type_not_associated (type))
+- val_print_not_associated (stream);
++ print_rank_only = 1;
+ else if (type_not_allocated (type))
+- val_print_not_allocated (stream);
++ print_rank_only = 1;
++ else if ((TYPE_ASSOCIATED_PROP (type)
++ && PROP_CONST != TYPE_DYN_PROP_KIND (TYPE_ASSOCIATED_PROP (type)))
++ || (TYPE_ALLOCATED_PROP (type)
++ && PROP_CONST != TYPE_DYN_PROP_KIND (TYPE_ALLOCATED_PROP (type)))
++ || (TYPE_DATA_LOCATION (type)
++ && PROP_CONST != TYPE_DYN_PROP_KIND (TYPE_DATA_LOCATION (type))))
++ /* This case exist when we ptype a typename which has the
++ dynamic properties but cannot be resolved as there is
++ no object. */
++ print_rank_only = 1;
++
++ if (TYPE_CODE (TYPE_TARGET_TYPE (type)) == TYPE_CODE_ARRAY)
++ f_type_print_varspec_suffix (TYPE_TARGET_TYPE (type), stream, 0,
++ 0, 0, arrayprint_recurse_level,
++ print_rank_only);
++
++ if (print_rank_only == 1)
++ fprintf_filtered (stream, ":");
+ else
+- {
+- if (TYPE_CODE (TYPE_TARGET_TYPE (type)) == TYPE_CODE_ARRAY)
+- f_type_print_varspec_suffix (TYPE_TARGET_TYPE (type), stream, 0,
+- 0, 0, arrayprint_recurse_level);
+-
+- lower_bound = f77_get_lowerbound (type);
+- if (lower_bound != 1) /* Not the default. */
+- fprintf_filtered (stream, "%d:", lower_bound);
+-
+- /* Make sure that, if we have an assumed size array, we
+- print out a warning and print the upperbound as '*'. */
+-
+- if (TYPE_ARRAY_UPPER_BOUND_IS_UNDEFINED (type))
+- fprintf_filtered (stream, "*");
+- else
+- {
+- upper_bound = f77_get_upperbound (type);
+- fprintf_filtered (stream, "%d", upper_bound);
+- }
+-
+- if (TYPE_CODE (TYPE_TARGET_TYPE (type)) != TYPE_CODE_ARRAY)
+- f_type_print_varspec_suffix (TYPE_TARGET_TYPE (type), stream, 0,
+- 0, 0, arrayprint_recurse_level);
+- }
++ {
++ lower_bound = f77_get_lowerbound (type);
++ if (lower_bound != 1) /* Not the default. */
++ fprintf_filtered (stream, "%d:", lower_bound);
++
++ /* Make sure that, if we have an assumed size array, we
++ print out a warning and print the upperbound as '*'. */
++
++ if (TYPE_ARRAY_UPPER_BOUND_IS_UNDEFINED (type))
++ fprintf_filtered (stream, "*");
++ else
++ {
++ upper_bound = f77_get_upperbound (type);
++ fprintf_filtered (stream, "%d", upper_bound);
++ }
++ }
++
++ if (TYPE_CODE (TYPE_TARGET_TYPE (type)) != TYPE_CODE_ARRAY)
++ f_type_print_varspec_suffix (TYPE_TARGET_TYPE (type), stream, 0,
++ 0, 0, arrayprint_recurse_level,
++ print_rank_only);
++
+ if (arrayprint_recurse_level == 1)
+ fprintf_filtered (stream, ")");
+ else
+@@ -221,13 +225,14 @@ f_type_print_varspec_suffix (struct type
+ case TYPE_CODE_PTR:
+ case TYPE_CODE_REF:
+ f_type_print_varspec_suffix (TYPE_TARGET_TYPE (type), stream, 0, 1, 0,
+- arrayprint_recurse_level);
++ arrayprint_recurse_level, 0);
+ fprintf_filtered (stream, ")");
+ break;
+
+ case TYPE_CODE_FUNC:
+ f_type_print_varspec_suffix (TYPE_TARGET_TYPE (type), stream, 0,
+- passed_a_ptr, 0, arrayprint_recurse_level);
++ passed_a_ptr, 0, arrayprint_recurse_level,
++ 0);
+ if (passed_a_ptr)
+ fprintf_filtered (stream, ")");
+
+@@ -383,7 +388,7 @@ f_type_print_base (struct type *type, st
+ 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 -Naurp insight-8.1.50.20180216.orig/gdb/gdbtypes.c insight-8.1.50.20180216.new/gdb/gdbtypes.c
+--- insight-8.1.50.20180216.orig/gdb/gdbtypes.c 2018-02-17 14:57:12.614814435 +0100
++++ insight-8.1.50.20180216.new/gdb/gdbtypes.c 2018-02-17 14:58:10.998392222 +0100
+@@ -1919,7 +1919,8 @@ is_dynamic_type_internal (struct type *t
+ type = check_typedef (type);
+
+ /* We only want to recognize references at the outermost level. */
+- if (top_level && TYPE_CODE (type) == TYPE_CODE_REF)
++ if (top_level &&
++ (TYPE_CODE (type) == TYPE_CODE_REF || TYPE_CODE (type) == TYPE_CODE_PTR))
+ type = check_typedef (TYPE_TARGET_TYPE (type));
+
+ /* Types that have a dynamic TYPE_DATA_LOCATION are considered
+@@ -1953,6 +1954,7 @@ is_dynamic_type_internal (struct type *t
+ }
+
+ case TYPE_CODE_ARRAY:
++ case TYPE_CODE_STRING:
+ {
+ gdb_assert (TYPE_NFIELDS (type) == 1);
+
+@@ -2071,7 +2073,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);
+
+@@ -2096,11 +2099,15 @@ resolve_dynamic_array (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);
+ else
+ elt_type = TYPE_TARGET_TYPE (type);
+
++ if (TYPE_CODE (type) == TYPE_CODE_STRING)
++ return create_string_type (type, elt_type, range_type);
++
+ prop = get_dyn_prop (DYN_PROP_BYTE_STRIDE, type);
+ if (prop != NULL)
+ {
+@@ -2255,6 +2262,28 @@ resolve_dynamic_struct (struct type *typ
+ return resolved_type;
+ }
+
++/* Worker for pointer types. */
++
++static struct type *
++resolve_dynamic_pointer (struct type *type,
++ struct property_addr_info *addr_stack)
++{
++ struct dynamic_prop *prop;
++ CORE_ADDR value;
++
++ type = copy_type (type);
++
++ /* Resolve associated property. */
++ prop = TYPE_ASSOCIATED_PROP (type);
++ if (prop != NULL && dwarf2_evaluate_property (prop, NULL, addr_stack, &value))
++ {
++ TYPE_DYN_PROP_ADDR (prop) = value;
++ TYPE_DYN_PROP_KIND (prop) = PROP_CONST;
++ }
++
++ return type;
++}
++
+ /* Worker for resolved_dynamic_type. */
+
+ static struct type *
+@@ -2303,7 +2332,12 @@ resolve_dynamic_type_internal (struct ty
+ 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;
+
+diff -Naurp insight-8.1.50.20180216.orig/gdb/NEWS insight-8.1.50.20180216.new/gdb/NEWS
+--- insight-8.1.50.20180216.orig/gdb/NEWS 2018-02-09 15:06:40.000000000 +0100
++++ insight-8.1.50.20180216.new/gdb/NEWS 2018-02-17 14:58:10.999392233 +0100
+@@ -1,6 +1,8 @@
+ What has changed in GDB?
+ (Organized release by release)
+
++* Fortran: Support pointers to dynamic types.
++
+ *** Changes since GDB 8.1
+
+ * 'info proc' now works on running processes on FreeBSD systems and core
+diff -Naurp insight-8.1.50.20180216.orig/gdb/testsuite/gdb.cp/vla-cxx.cc insight-8.1.50.20180216.new/gdb/testsuite/gdb.cp/vla-cxx.cc
+--- insight-8.1.50.20180216.orig/gdb/testsuite/gdb.cp/vla-cxx.cc 2018-01-04 17:43:15.000000000 +0100
++++ insight-8.1.50.20180216.new/gdb/testsuite/gdb.cp/vla-cxx.cc 2018-02-17 14:58:10.999392233 +0100
+@@ -15,6 +15,10 @@
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
++extern "C" {
++#include <stddef.h>
++}
++
+ struct container;
+
+ struct element
+@@ -40,11 +44,16 @@ int main(int argc, char **argv)
+ typedef typeof (vla) &vlareftypedef;
+ vlareftypedef vlaref2 (vla);
+ container c;
++ typeof (vla) *ptr = NULL;
++
++ // Before pointer assignment
++ ptr = &vla;
+
+ for (int i = 0; i < z; ++i)
+ vla[i] = 5 + 2 * i;
+
+ // vlas_filled
+ vla[0] = 2 * vla[0];
++
+ return vla[2];
+ }
+diff -Naurp insight-8.1.50.20180216.orig/gdb/testsuite/gdb.cp/vla-cxx.exp insight-8.1.50.20180216.new/gdb/testsuite/gdb.cp/vla-cxx.exp
+--- insight-8.1.50.20180216.orig/gdb/testsuite/gdb.cp/vla-cxx.exp 2018-01-04 17:43:15.000000000 +0100
++++ insight-8.1.50.20180216.new/gdb/testsuite/gdb.cp/vla-cxx.exp 2018-02-17 14:58:10.999392233 +0100
+@@ -23,6 +23,12 @@ if ![runto_main] {
+ return -1
+ }
+
++gdb_breakpoint [gdb_get_line_number "Before pointer assignment"]
++gdb_continue_to_breakpoint "Before pointer assignment"
++gdb_test "ptype ptr" "int \\(\\*\\)\\\[variable length\\\]" "ptype ptr, Before pointer assignment"
++gdb_test "print ptr" "\\(int \\(\\*\\)\\\[variable length\\\]\\) 0x0" "print ptr, Before pointer assignment"
++gdb_test "print *ptr" "Cannot access memory at address 0x0" "print *ptr, Before pointer assignment"
++
+ gdb_breakpoint [gdb_get_line_number "vlas_filled"]
+ gdb_continue_to_breakpoint "vlas_filled"
+
+@@ -33,3 +39,6 @@ gdb_test "print vlaref" " = \\(int \\(&\
+ # bug being tested, it's better not to depend on the exact spelling.
+ gdb_test "print vlaref2" " = \\(.*\\) @$hex: \\{5, 7, 9\\}"
+ gdb_test "print c" " = \\{e = \\{c = @$hex\\}\\}"
++gdb_test "ptype ptr" "int \\(\\*\\)\\\[3\\\]"
++gdb_test "print ptr" "\\(int \\(\\*\\)\\\[3\\\]\\) $hex"
++gdb_test "print *ptr" " = \\{5, 7, 9\\}"
+diff -Naurp insight-8.1.50.20180216.orig/gdb/testsuite/gdb.fortran/pointers.exp insight-8.1.50.20180216.new/gdb/testsuite/gdb.fortran/pointers.exp
+--- insight-8.1.50.20180216.orig/gdb/testsuite/gdb.fortran/pointers.exp 1970-01-01 01:00:00.000000000 +0100
++++ insight-8.1.50.20180216.new/gdb/testsuite/gdb.fortran/pointers.exp 2018-02-17 14:58:10.999392233 +0100
+@@ -0,0 +1,143 @@
++# Copyright 2016 Free Software Foundation, Inc.
++
++# This program is free software; you can redistribute it and/or modify
++# it under the terms of the GNU General Public License as published by
++# the Free Software Foundation; either version 3 of the License, or
++# (at your option) any later version.
++#
++# This program is distributed in the hope that it will be useful,
++# but WITHOUT ANY WARRANTY; without even the implied warranty of
++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++# GNU General Public License for more details.
++#
++# You should have received a copy of the GNU General Public License
++# along with this program. If not, see <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 "print logp" "= \\(PTR TO -> \\( $logical \\)\\) 0x0" "print logp, not associated"
++gdb_test "print *logp" "Cannot access memory at address 0x0" "print *logp, not associated"
++gdb_test "print comp" "= \\(PTR TO -> \\( $complex \\)\\) 0x0" "print comp, not associated"
++gdb_test "print *comp" "Cannot access memory at address 0x0" "print *comp, not associated"
++gdb_test "print charp" "= \\(PTR TO -> \\( character\\*1 \\)\\) 0x0" "print charp, not associated"
++gdb_test "print *charp" "Cannot access memory at address 0x0" "print *charp, not associated"
++gdb_test "print charap" "= \\(PTR TO -> \\( character\\*3 \\)\\) 0x0" "print charap, not associated"
++gdb_test "print *charap" "Cannot access memory at address 0x0" "print *charap, not associated"
++gdb_test "print intp" "= \\(PTR TO -> \\( $int \\)\\) 0x0" "print intp, not associated"
++gdb_test "print *intp" "Cannot access memory at address 0x0" "print *intp, not associated"
++set test "print intap, not associated"
++gdb_test_multiple "print intap" $test {
++ -re " = \\(PTR TO -> \\( $int \\(:,:\\)\\)\\) <not associated>\r\n$gdb_prompt $" {
++ pass $test
++ }
++ -re " = <not associated>\r\n$gdb_prompt $" {
++ pass $test
++ }
++}
++gdb_test "print realp" "= \\(PTR TO -> \\( $real \\)\\) 0x0" "print realp, not associated"
++gdb_test "print *realp" "Cannot access memory at address 0x0" "print *realp, not associated"
++gdb_test "print \$my_var = intp" "= \\(PTR TO -> \\( $int \\)\\) 0x0"
++set test "print cyclicp1, not associated"
++gdb_test_multiple "print cyclicp1" $test {
++ -re "= \\( i = -?\\d+, p = 0x0 \\)\r\n$gdb_prompt $" {
++ pass $test
++ }
++ -re "= \\( i = -?\\d+, p = <not associated> \\)\r\n$gdb_prompt $" {
++ pass $test
++ }
++}
++set test "print cyclicp1%p, not associated"
++gdb_test_multiple "print cyclicp1%p" $test {
++ -re "= \\(PTR TO -> \\( Type typewithpointer \\)\\) 0x0\r\n$gdb_prompt $" {
++ pass $test
++ }
++ -re "= \\(PTR TO -> \\( Type typewithpointer \\)\\) <not associated>\r\n$gdb_prompt $" {
++ pass $test
++ }
++}
++
++
++gdb_breakpoint [gdb_get_line_number "Before value assignment"]
++gdb_continue_to_breakpoint "Before value assignment"
++gdb_test "print *(twop)%ivla2" "= <not allocated>"
++
++
++gdb_breakpoint [gdb_get_line_number "After value assignment"]
++gdb_continue_to_breakpoint "After value assignment"
++gdb_test "print logp" "= \\(PTR TO -> \\( $logical \\)\\) $hex\( <.*>\)?"
++gdb_test "print *logp" "= \\.TRUE\\."
++gdb_test "print comp" "= \\(PTR TO -> \\( $complex \\)\\) $hex\( <.*>\)?"
++gdb_test "print *comp" "= \\(1,2\\)"
++gdb_test "print charp" "= \\(PTR TO -> \\( character\\*1 \\)\\) $hex\( <.*>\)?"
++gdb_test "print *charp" "= 'a'"
++gdb_test "print charap" "= \\(PTR TO -> \\( character\\*3 \\)\\) $hex\( <.*>\)?"
++gdb_test "print *charap" "= 'abc'"
++gdb_test "print intp" "= \\(PTR TO -> \\( $int \\)\\) $hex\( <.*>\)?"
++gdb_test "print *intp" "= 10"
++set test_name "print intap, associated"
++gdb_test_multiple "print intap" $test_name {
++ -re "= \\(\\( 1, 1, 3(, 1){7}\\) \\( 1(, 1){9}\\) \\)\r\n$gdb_prompt $" {
++ pass $test_name
++ }
++ -re "= \\(PTR TO -> \\( $int \\(10,2\\)\\)\\) $hex\( <.*>\)?\r\n$gdb_prompt $" {
++ gdb_test "print *intap" "= \\(\\( 1, 1, 3(, 1){7}\\) \\( 1(, 1){9}\\) \\)"
++ pass $test_name
++ }
++}
++set test_name "print intvlap, associated"
++gdb_test_multiple "print intvlap" $test_name {
++ -re "= \\(2, 2, 2, 4(, 2){6}\\)\r\n$gdb_prompt $" {
++ pass $test_name
++ }
++ -re "= \\(PTR TO -> \\( $int \\(10\\)\\)\\) $hex\( <.*>\)?\r\n$gdb_prompt $" {
++ gdb_test "print *intvlap" "= \\(2, 2, 2, 4(, 2){6}\\)"
++ pass $test_name
++ }
++}
++gdb_test "print realp" "= \\(PTR TO -> \\( $real \\)\\) $hex\( <.*>\)?"
++gdb_test "print *realp" "= 3\\.14000\\d+"
++gdb_test "print arrayOfPtr(2)%p" "= \\(PTR TO -> \\( Type two \\)\\) $hex\( <.*>\)?"
++gdb_test "print *(arrayOfPtr(2)%p)" "= \\( ivla1 = \\(11, 12, 13\\), ivla2 = \\(\\( 211, 221\\) \\( 212, 222\\) \\) \\)"
++set test_name "print arrayOfPtr(3)%p"
++gdb_test_multiple $test_name $test_name {
++ -re "= \\(PTR TO -> \\( Type two \\)\\) <not associated>\r\n$gdb_prompt $" {
++ pass $test_name
++ }
++ -re "= \\(PTR TO -> \\( Type two \\)\\) 0x0\r\n$gdb_prompt $" {
++ pass $test_name
++ }
++}
++set test_name "print *(arrayOfPtr(3)%p), associated"
++gdb_test_multiple "print *(arrayOfPtr(3)%p)" $test_name {
++ -re "Cannot access memory at address 0x0\r\n$gdb_prompt $" {
++ pass $test_name
++ }
++ -re "Attempt to take contents of a not associated pointer.\r\n$gdb_prompt $" {
++ pass $test_name
++ }
++}
++gdb_test "print cyclicp1" "= \\( i = 1, p = $hex\( <.*>\)? \\)"
++gdb_test "print cyclicp1%p" "= \\(PTR TO -> \\( Type typewithpointer \\)\\) $hex\( <.*>\)?"
++gdb_test "print *((integer*) &inta + 2)" "= 3" "print temporary pointer, array"
++gdb_test "print *((integer*) &intvla + 3)" "= 4" "print temporary pointer, allocated vla"
++gdb_test "print \$pc" "= \\(PTR TO -> \\( void \\(\\)\\(\\)\\)\\) $hex <pointers\\+\\d+>" "Print program counter"
+diff -Naurp insight-8.1.50.20180216.orig/gdb/testsuite/gdb.fortran/pointers.f90 insight-8.1.50.20180216.new/gdb/testsuite/gdb.fortran/pointers.f90
+--- insight-8.1.50.20180216.orig/gdb/testsuite/gdb.fortran/pointers.f90 1970-01-01 01:00:00.000000000 +0100
++++ insight-8.1.50.20180216.new/gdb/testsuite/gdb.fortran/pointers.f90 2018-02-17 14:58:10.999392233 +0100
+@@ -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
++
++ type :: typeWithPointer
++ integer i
++ type(typeWithPointer), pointer:: p
++ end type typeWithPointer
++
++ type :: twoPtr
++ type (two), pointer :: p
++ end type twoPtr
++
++ logical, target :: logv
++ complex, target :: comv
++ character, target :: charv
++ character (len=3), target :: chara
++ integer, target :: intv
++ integer, target, dimension (10,2) :: inta
++ integer, target, allocatable, dimension (:) :: intvla
++ real, target :: realv
++ type(two), target :: twov
++ type(twoPtr) :: arrayOfPtr (3)
++ type(typeWithPointer), target:: cyclicp1,cyclicp2
++
++ logical, pointer :: logp
++ complex, pointer :: comp
++ character, pointer:: charp
++ character (len=3), pointer:: charap
++ integer, pointer :: intp
++ integer, pointer, dimension (:,:) :: intap
++ integer, pointer, dimension (:) :: intvlap
++ real, pointer :: realp
++ type(two), pointer :: twop
++
++ nullify (logp)
++ nullify (comp)
++ nullify (charp)
++ nullify (charap)
++ nullify (intp)
++ nullify (intap)
++ nullify (intvlap)
++ nullify (realp)
++ nullify (twop)
++ nullify (arrayOfPtr(1)%p)
++ nullify (arrayOfPtr(2)%p)
++ nullify (arrayOfPtr(3)%p)
++ nullify (cyclicp1%p)
++ nullify (cyclicp2%p)
++
++ logp => logv ! Before pointer assignment
++ comp => comv
++ charp => charv
++ charap => chara
++ intp => intv
++ intap => inta
++ intvlap => intvla
++ realp => realv
++ twop => twov
++ arrayOfPtr(2)%p => twov
++ cyclicp1%i = 1
++ cyclicp1%p => cyclicp2
++ cyclicp2%i = 2
++ cyclicp2%p => cyclicp1
++
++ logv = associated(logp) ! Before value assignment
++ comv = cmplx(1,2)
++ charv = "a"
++ chara = "abc"
++ intv = 10
++ inta(:,:) = 1
++ inta(3,1) = 3
++ allocate (intvla(10))
++ intvla(:) = 2
++ intvla(4) = 4
++ intvlap => intvla
++ realv = 3.14
++
++ allocate (twov%ivla1(3))
++ allocate (twov%ivla2(2,2))
++ twov%ivla1(1) = 11
++ twov%ivla1(2) = 12
++ twov%ivla1(3) = 13
++ twov%ivla2(1,1) = 211
++ twov%ivla2(2,1) = 221
++ twov%ivla2(1,2) = 212
++ twov%ivla2(2,2) = 222
++
++ intv = intv + 1 ! After value assignment
++
++end program pointers
+diff -Naurp insight-8.1.50.20180216.orig/gdb/testsuite/gdb.fortran/print_type.exp insight-8.1.50.20180216.new/gdb/testsuite/gdb.fortran/print_type.exp
+--- insight-8.1.50.20180216.orig/gdb/testsuite/gdb.fortran/print_type.exp 1970-01-01 01:00:00.000000000 +0100
++++ insight-8.1.50.20180216.new/gdb/testsuite/gdb.fortran/print_type.exp 2018-02-17 14:58:11.000392242 +0100
+@@ -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 -Naurp insight-8.1.50.20180216.orig/gdb/testsuite/gdb.fortran/vla-ptype.exp insight-8.1.50.20180216.new/gdb/testsuite/gdb.fortran/vla-ptype.exp
+--- insight-8.1.50.20180216.orig/gdb/testsuite/gdb.fortran/vla-ptype.exp 2018-02-17 14:57:12.616814455 +0100
++++ insight-8.1.50.20180216.new/gdb/testsuite/gdb.fortran/vla-ptype.exp 2018-02-17 14:58:11.000392242 +0100
+@@ -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 =
+
+ 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 "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 "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"
+diff -Naurp insight-8.1.50.20180216.orig/gdb/testsuite/gdb.fortran/vla-strings.exp insight-8.1.50.20180216.new/gdb/testsuite/gdb.fortran/vla-strings.exp
+--- insight-8.1.50.20180216.orig/gdb/testsuite/gdb.fortran/vla-strings.exp 1970-01-01 01:00:00.000000000 +0100
++++ insight-8.1.50.20180216.new/gdb/testsuite/gdb.fortran/vla-strings.exp 2018-02-17 14:58:11.000392242 +0100
+@@ -0,0 +1,103 @@
++# Copyright 2016 Free Software Foundation, Inc.
++
++# This program is free software; you can redistribute it and/or modify
++# it under the terms of the GNU General Public License as published by
++# the Free Software Foundation; either version 3 of the License, or
++# (at your option) any later version.
++#
++# This program is distributed in the hope that it will be useful,
++# but WITHOUT ANY WARRANTY; without even the implied warranty of
++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++# GNU General Public License for more details.
++#
++# You should have received a copy of the GNU General Public License
++# along with this program. If not, see <http://www.gnu.org/licenses/>.
++
++standard_testfile ".f90"
++
++if { [prepare_for_testing ${testfile}.exp ${testfile} ${srcfile} \
++ {debug f90 quiet}] } {
++ return -1
++}
++
++# check that all fortran standard datatypes will be
++# handled correctly when using as VLA's
++
++if ![runto_main] {
++ untested "could not run to main"
++ return -1
++}
++
++gdb_breakpoint [gdb_get_line_number "var_char-allocated-1"]
++gdb_continue_to_breakpoint "var_char-allocated-1"
++set test "whatis var_char first time"
++gdb_test_multiple "whatis var_char" $test {
++ -re "type = PTR TO -> \\( character\\*10 \\)\r\n$gdb_prompt $" {
++ pass $test
++ }
++ -re "type = character\\*10\r\n$gdb_prompt $" {
++ pass $test
++ }
++}
++set test "ptype var_char first time"
++gdb_test_multiple "ptype var_char" $test {
++ -re "type = PTR TO -> \\( character\\*10 \\)\r\n$gdb_prompt $" {
++ pass $test
++ }
++ -re "type = character\\*10\r\n$gdb_prompt $" {
++ pass $test
++ }
++}
++
++
++gdb_test "next" "\\d+.*var_char = 'foo'.*" \
++ "next to allocation status of var_char"
++gdb_test "print l" " = \\.TRUE\\." "print allocation status first time"
++
++
++gdb_breakpoint [gdb_get_line_number "var_char-filled-1"]
++gdb_continue_to_breakpoint "var_char-filled-1"
++set test "print var_char, var_char-filled-1"
++gdb_test_multiple "print var_char" $test {
++ -re "= \\(PTR TO -> \\( character\\*3 \\)\\) $hex\r\n$gdb_prompt $" {
++ gdb_test "print *var_char" "= 'foo'" "print *var_char, var_char-filled-1"
++ pass $test
++ }
++ -re "= 'foo'\r\n$gdb_prompt $" {
++ pass $test
++ }
++}
++set test "ptype var_char, var_char-filled-1"
++gdb_test_multiple "ptype var_char" $test {
++ -re "type = PTR TO -> \\( character\\*3 \\)\r\n$gdb_prompt $" {
++ pass $test
++ }
++ -re "type = character\\*3\r\n$gdb_prompt $" {
++ pass $test
++ }
++}
++gdb_test "print var_char(1)" " = 102 'f'" "print var_char(1)"
++gdb_test "print var_char(3)" " = 111 'o'" "print var_char(3)"
++
++
++gdb_breakpoint [gdb_get_line_number "var_char-filled-2"]
++gdb_continue_to_breakpoint "var_char-filled-2"
++set test "print var_char, var_char-filled-2"
++gdb_test_multiple "print var_char" $test {
++ -re "= \\(PTR TO -> \\( character\\*6 \\)\\) $hex\r\n$gdb_prompt $" {
++ gdb_test "print *var_char" "= 'foobar'" "print *var_char, var_char-filled-2"
++ pass $test
++ }
++ -re "= 'foobar'\r\n$gdb_prompt $" {
++ pass $test
++ }
++}
++set test "ptype var_char, var_char-filled-2"
++gdb_test_multiple "ptype var_char" $test {
++ -re "type = PTR TO -> \\( character\\*6 \\)\r\n$gdb_prompt $" {
++ pass $test
++ }
++ -re "type = character\\*6\r\n$gdb_prompt $" {
++ pass $test
++ }
++}
+diff -Naurp insight-8.1.50.20180216.orig/gdb/testsuite/gdb.fortran/vla-strings.f90 insight-8.1.50.20180216.new/gdb/testsuite/gdb.fortran/vla-strings.f90
+--- insight-8.1.50.20180216.orig/gdb/testsuite/gdb.fortran/vla-strings.f90 1970-01-01 01:00:00.000000000 +0100
++++ insight-8.1.50.20180216.new/gdb/testsuite/gdb.fortran/vla-strings.f90 2018-02-17 14:58:11.000392242 +0100
+@@ -0,0 +1,39 @@
++! Copyright 2016 Free Software Foundation, Inc.
++!
++! This program is free software; you can redistribute it and/or modify
++! it under the terms of the GNU General Public License as published by
++! the Free Software Foundation; either version 3 of the License, or
++! (at your option) any later version.
++!
++! This program is distributed in the hope that it will be useful,
++! but WITHOUT ANY WARRANTY; without even the implied warranty of
++! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++! GNU General Public License for more details.
++!
++! You should have received a copy of the GNU General Public License
++! along with this program. If not, see <http://www.gnu.org/licenses/>.
++
++program vla_strings
++ character(len=:), target, allocatable :: var_char
++ character(len=:), pointer :: var_char_p
++ logical :: l
++
++ allocate(character(len=10) :: var_char)
++ l = allocated(var_char) ! var_char-allocated-1
++ var_char = 'foo'
++ deallocate(var_char) ! var_char-filled-1
++ l = allocated(var_char) ! var_char-deallocated
++ allocate(character(len=42) :: var_char)
++ l = allocated(var_char)
++ var_char = 'foobar'
++ var_char = '' ! var_char-filled-2
++ var_char = 'bar' ! var_char-empty
++ deallocate(var_char)
++ allocate(character(len=21) :: var_char)
++ l = allocated(var_char) ! var_char-allocated-3
++ var_char = 'johndoe'
++ var_char_p => var_char
++ l = associated(var_char_p) ! var_char_p-associated
++ var_char_p => null()
++ l = associated(var_char_p) ! var_char_p-not-associated
++end program vla_strings
+diff -Naurp insight-8.1.50.20180216.orig/gdb/testsuite/gdb.fortran/vla-type.exp insight-8.1.50.20180216.new/gdb/testsuite/gdb.fortran/vla-type.exp
+--- insight-8.1.50.20180216.orig/gdb/testsuite/gdb.fortran/vla-type.exp 2018-01-04 17:43:15.000000000 +0100
++++ insight-8.1.50.20180216.new/gdb/testsuite/gdb.fortran/vla-type.exp 2018-02-17 14:58:11.000392242 +0100
+@@ -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 -Naurp insight-8.1.50.20180216.orig/gdb/testsuite/gdb.fortran/vla-value.exp insight-8.1.50.20180216.new/gdb/testsuite/gdb.fortran/vla-value.exp
+--- insight-8.1.50.20180216.orig/gdb/testsuite/gdb.fortran/vla-value.exp 2018-01-04 17:43:15.000000000 +0100
++++ insight-8.1.50.20180216.new/gdb/testsuite/gdb.fortran/vla-value.exp 2018-02-17 14:58:11.000392242 +0100
+@@ -35,7 +35,7 @@ gdb_breakpoint [gdb_get_line_number "vla
+ 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" \
+ "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)"
+@@ -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" \
+ "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 -Naurp insight-8.1.50.20180216.orig/gdb/testsuite/gdb.mi/mi-vla-fortran.exp insight-8.1.50.20180216.new/gdb/testsuite/gdb.mi/mi-vla-fortran.exp
+--- insight-8.1.50.20180216.orig/gdb/testsuite/gdb.mi/mi-vla-fortran.exp 2018-01-04 17:43:15.000000000 +0100
++++ insight-8.1.50.20180216.new/gdb/testsuite/gdb.mi/mi-vla-fortran.exp 2018-02-17 14:58:11.000392242 +0100
+@@ -51,10 +51,10 @@ mi_expect_stop "breakpoint-hit" "vla" ""
+ 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\"" \
+diff -Naurp insight-8.1.50.20180216.orig/gdb/typeprint.c insight-8.1.50.20180216.new/gdb/typeprint.c
+--- insight-8.1.50.20180216.orig/gdb/typeprint.c 2018-01-26 13:46:47.000000000 +0100
++++ insight-8.1.50.20180216.new/gdb/typeprint.c 2018-02-17 14:58:11.000392242 +0100
+@@ -538,6 +538,25 @@ whatis_exp (const char *exp, int show)
+ printf_filtered (" */\n");
+ }
+
++ /* Resolve any dynamic target type, as we might print
++ additional information about the target.
++ For example, in Fortran and C we are printing the dimension of the
++ dynamic array the pointer is pointing to. */
++ if (TYPE_CODE (type) == TYPE_CODE_PTR
++ && is_dynamic_type (type) == 1)
++ {
++ CORE_ADDR addr;
++ if (NULL != TYPE_DATA_LOCATION (TYPE_TARGET_TYPE(type)))
++ addr = value_address (val);
++ else
++ addr = value_as_address (val);
++
++ if (addr != 0
++ && type_not_associated (type) == 0)
++ TYPE_TARGET_TYPE (type) = resolve_dynamic_type (TYPE_TARGET_TYPE (type),
++ NULL, addr);
++ }
++
+ LA_PRINT_TYPE (type, "", gdb_stdout, show, 0, &flags);
+ printf_filtered ("\n");
+
+diff -Naurp insight-8.1.50.20180216.orig/gdb/valops.c insight-8.1.50.20180216.new/gdb/valops.c
+--- insight-8.1.50.20180216.orig/gdb/valops.c 2018-02-17 14:57:12.616814455 +0100
++++ insight-8.1.50.20180216.new/gdb/valops.c 2018-02-17 14:58:11.001392252 +0100
+@@ -1565,6 +1565,19 @@ value_ind (struct value *arg1)
+ if (TYPE_CODE (base_type) == TYPE_CODE_PTR)
+ {
+ struct type *enc_type;
++ CORE_ADDR addr;
++
++ if (type_not_associated (base_type))
++ error (_("Attempt to take contents of a not associated pointer."));
++
++ if (NULL != TYPE_DATA_LOCATION (TYPE_TARGET_TYPE (base_type)))
++ addr = value_address (arg1);
++ else
++ addr = value_as_address (arg1);
++
++ if (addr != 0)
++ TYPE_TARGET_TYPE (base_type) =
++ resolve_dynamic_type (TYPE_TARGET_TYPE (base_type), NULL, addr);
+
+ /* We may be pointing to something embedded in a larger object.
+ Get the real type of the enclosing object. */
+@@ -1580,8 +1593,7 @@ value_ind (struct value *arg1)
+ else
+ /* Retrieve the enclosing object pointed to. */
+ arg2 = value_at_lazy (enc_type,
+- (value_as_address (arg1)
+- - value_pointed_to_offset (arg1)));
++ (addr - value_pointed_to_offset (arg1)));
+
+ enc_type = value_type (arg2);
+ return readjust_indirect_value_type (arg2, enc_type, base_type, arg1);
+diff -Naurp insight-8.1.50.20180216.orig/gdb/valprint.c insight-8.1.50.20180216.new/gdb/valprint.c
+--- insight-8.1.50.20180216.orig/gdb/valprint.c 2018-01-12 03:18:43.000000000 +0100
++++ insight-8.1.50.20180216.new/gdb/valprint.c 2018-02-17 14:58:11.001392252 +0100
+@@ -1108,12 +1108,6 @@ value_check_printable (struct value *val
+ return 0;
+ }
+
+- if (type_not_associated (value_type (val)))
+- {
+- val_print_not_associated (stream);
+- return 0;
+- }
+-
+ if (type_not_allocated (value_type (val)))
+ {
+ val_print_not_allocated (stream);
diff --git a/insight.spec b/insight.spec
index baab772..8fd5f31 100644
--- a/insight.spec
+++ b/insight.spec
@@ -1,5 +1,5 @@
-%global ver 7.12.50
-%global snap 20170416
+%global ver 8.1.50
+%global snap 20180216
%global gnulibsnap 20160112
%global __python %{__python3}
@@ -10,22 +10,21 @@
# Git snapshots are produced as follows:
#
-# git clone --recursive https://github.com/monnerat/insight.git
+# git clone --recursive git://sourceware.org/git/insight.git
# cd insight.git
# autoconf
# configure
# (cd bundle; ./src-release.sh -x insight)
#
-# Tarball is then found at bundle/insight-%{ver}.%{snap}.tar.xz
+# Tarball is then found at bundle/insight-%<ver>.%<snap>.tar.xz
Name: insight
Version: %(echo %{ver} | tr - .)%{?snap:.%{snap}}
-Release: 5%{?dist}
+Release: 1%{?dist}
Summary: Graphical debugger based on GDB
License: GPLv3+ and GPLv3+ with exceptions and GPLv2+ and GPLv2+ with exceptions and GPL+ and LGPLv2+ and BSD and Public Domain and GFDL
-Group: Development/Debuggers
Url: https://www.sourceware.org/insight/
-# Source0: ftp://sourceware.org/pub/insight/releases/insight-%{ver}.tar.bz2
+# Source0: ftp://sourceware.org/pub/insight/releases/insight-%<ver>.tar.bz2
Source0: insight-%{version}.tar.xz
Source1: insight.1
Requires: iwidgets
@@ -34,16 +33,18 @@ Provides: bundled(binutils) = %{snap}
Provides: bundled(gnulib) = %{gnulibsnap}
Provides: bundled(libiberty) = %{snap}
Provides: bundled(md5-gcc) = %{snap}
-BuildRequires: tcl-devel%{?_isa}
-BuildRequires: tk-devel%{?_isa}
+BuildRequires: gcc
+BuildRequires: gcc-c++
+BuildRequires: tcl-devel
+BuildRequires: tk-devel
BuildRequires: iwidgets
-BuildRequires: ncurses-devel%{?_isa}
-BuildRequires: readline-devel%{?_isa} >= 6.0
-BuildRequires: expat-devel%{?_isa}
+BuildRequires: ncurses-devel
+BuildRequires: readline-devel >= 6.0
+BuildRequires: expat-devel
BuildRequires: python3-devel
-BuildRequires: xz-devel%{?_isa}
-BuildRequires: zlib-devel%{?_isa}
-BuildRequires: desktop-file-utils%{?_isa}
+BuildRequires: xz-devel
+BuildRequires: zlib-devel
+BuildRequires: desktop-file-utils
BuildRequires: autogen
BuildRequires: automake
BuildRequires: autoconf
@@ -52,17 +53,16 @@ BuildRequires: flex
BuildRequires: texinfo-tex
BuildRequires: perl-podlators
BuildRequires: libbabeltrace-devel
+BuildRequires: guile-devel
# For C++ pretty printers.
-BuildRequires: libstdc++%{?_isa}
+BuildRequires: libstdc++
-BuildRequires: itcl-devel%{?_isa} >= 3.3
-BuildRequires: itk-devel%{?_isa} >= 3.3
+BuildRequires: itcl-devel >= 3.3
+BuildRequires: itk-devel >= 3.3
-%if 0%{?fedora} >= 23
%ifarch %{ix86} x86_64
%global have_libipt 1
-BuildRequires: libipt-devel%{?_isa}
-%endif
+BuildRequires: libipt-devel
%endif
# Insight patches.
@@ -72,81 +72,68 @@ Patch2: insight-7.4.50-readline-system.patch
# Some patches from gdb. See gdb spec file for info.
-Patch101: gdb-6.3-rh-dummykfail-20041202.patch
-Patch102: gdb-6.3-rh-testversion-20041202.patch
-Patch103: gdb-6.3-ppc64syscall-20040622.patch
-Patch104: gdb-6.3-ppc64displaysymbol-20041124.patch
-Patch105: gdb-6.6-scheduler_locking-step-is-default.patch
-Patch106: gdb-6.3-gstack-20050411.patch
-Patch107: gdb-archer-pie-addons.patch
-Patch108: insight-7.12-gdb-archer-pie-addons-keep-disabled.patch
-Patch109: insight-7.12-gdb-6.3-readnever-20050907.patch
-Patch110: gdb-6.5-bz203661-emit-relocs.patch
-Patch111: gdb-6.5-bz185337-resolve-tls-without-debuginfo-v2.patch
-Patch112: gdb-6.5-bz216711-clone-is-outermost.patch
-Patch113: gdb-6.5-bz218379-solib-trampoline-lookup-lock-fix.patch
-Patch114: gdb-6.6-bz235197-fork-detach-info.patch
-Patch115: insight-7.12-gdb-6.6-buildid-locate.patch
-Patch116: gdb-6.6-buildid-locate-solib-missing-ids.patch
-Patch117: insight-7.12-gdb-6.6-buildid-locate-rpm.patch
-Patch118: insight-7.12-gdb-6.6-buildid-locate-core-as-arg.patch
-Patch119: gdb-6.6-buildid-locate-rpm-librpm-workaround.patch
-Patch120: gdb-6.6-buildid-locate-rpm-scl.patch
-Patch121: gdb-6.6-buildid-locate-misleading-warning-missing-debuginfo-rhbz981154.patch
-Patch122: gdb-6.8-sparc64-silence-memcpy-check.patch
-Patch123: gdb-6.8-quit-never-aborts.patch
-Patch124: insight-7.12-gdb-6.8-attach-signalled-detach-stopped.patch
-Patch125: insight-7.12-gdb-archer.patch
-Patch126: gdb-core-open-vdso-warning.patch
-Patch127: gdb-x86_64-i386-syscall-restart.patch
-Patch128: gdb-bz533176-fortran-omp-step.patch
-Patch129: gdb-follow-child-stale-parent.patch
-Patch130: gdb-bz541866-rwatch-before-run.patch
-Patch131: gdb-moribund-utrace-workaround.patch
-Patch132: gdb-gdb-add-index-script.patch
-Patch133: gdb-bz568248-oom-is-error.patch
-Patch134: gdb-7.2.50-sparc-add-workaround-to-broken-debug-files.patch
-Patch135: gdb-glibc-vdso-workaround.patch
-Patch136: gdb-readline62-ask-more-rh.patch
-Patch137: gdb-attach-fail-reasons-5of5.patch
-Patch138: gdb-stale-frame_info.patch
-Patch139: gdb-glibc-strstr-workaround.patch
-Patch140: insight-7.12-gdb-rhbz795424-bitpos-20of25.patch
-Patch141: gdb-rhbz795424-bitpos-21of25.patch
-Patch142: gdb-rhbz795424-bitpos-22of25.patch
-Patch143: insight-7.12-gdb-rhbz795424-bitpos-23of25.patch
-Patch144: insight-7.12-gdb-rhbz795424-bitpos-25of25.patch
-Patch145: gdb-rhbz795424-bitpos-lazyvalue.patch
+Patch101: gdb-6.3-rh-testversion-20041202.patch
+Patch102: gdb-vla-intel-fortran-strides.patch
+Patch103: insight-8.1-gdb-vla-intel-fortran-vla-strings.patch
+Patch104: gdb-vla-intel-stringbt-fix.patch
+Patch105: gdb-6.3-ppc64syscall-20040622.patch
+Patch106: gdb-6.3-ppc64displaysymbol-20041124.patch
+Patch107: gdb-6.3-gstack-20050411.patch
+Patch108: gdb-6.3-readnever-20050907.patch
+Patch109: gdb-6.5-bz203661-emit-relocs.patch
+Patch110: gdb-6.5-bz185337-resolve-tls-without-debuginfo-v2.patch
+Patch111: gdb-6.5-bz216711-clone-is-outermost.patch
+Patch112: gdb-6.5-bz218379-solib-trampoline-lookup-lock-fix.patch
+Patch113: gdb-6.6-bz235197-fork-detach-info.patch
+Patch114: gdb-6.6-scheduler_locking-step-is-default.patch
+Patch115: insight-8.1-buildid-locate.patch
+Patch116: insight-8.1-buildid-locate-solib-missing-ids.patch
+Patch117: insight-8.1-gdb-6.6-buildid-locate-rpm.patch
+Patch118: gdb-6.8-sparc64-silence-memcpy-check.patch
+Patch119: gdb-6.8-bz436037-reg-no-longer-active.patch
+Patch120: gdb-x86_64-i386-syscall-restart.patch
+Patch121: gdb-bz533176-fortran-omp-step.patch
+Patch122: gdb-follow-child-stale-parent.patch
+Patch123: gdb-archer-pie-addons.patch
+Patch124: gdb-archer-pie-addons-keep-disabled.patch
+Patch125: gdb-bz541866-rwatch-before-run.patch
+Patch126: gdb-moribund-utrace-workaround.patch
+Patch127: insight-8.1-gdb-6.6-buildid-locate-core-as-arg.patch
+Patch128: gdb-6.6-buildid-locate-rpm-librpm-workaround.patch
+Patch129: gdb-bz568248-oom-is-error.patch
+Patch130: gdb-7.2.50-sparc-add-workaround-to-broken-debug-files.patch
+Patch131: insight-8.1-gdb-attach-fail-reasons-5of5.patch
+Patch132: gdb-stale-frame_info.patch
+Patch133: gdb-glibc-strstr-workaround.patch
+Patch134: insight-8.1-gdb-rhbz795424-bitpos-20of25.patch
+Patch135: gdb-rhbz795424-bitpos-21of25.patch
+Patch136: gdb-rhbz795424-bitpos-22of25.patch
+Patch137: insight-8.1-gdb-rhbz795424-bitpos-23of25.patch
+Patch138: gdb-rhbz795424-bitpos-25of25.patch
+Patch139: gdb-rhbz795424-bitpos-lazyvalue.patch
+Patch140: gdb-gnat-dwarf-crash-3of3.patch
+Patch141: gdb-btrobust.patch
+Patch142: gdb-python-gil.patch
+Patch143: gdb-jit-reader-multilib.patch
+Patch144: gdb-bz1219747-attach-kills.patch
+Patch145: insight-8.1-gdb-fedora-libncursesw.patch
Patch146: gdb-dts-rhel6-python-compat.patch
-Patch147: gdb-gnat-dwarf-crash-3of3.patch
-Patch148: gdb-rhbz1007614-memleak-infpy_read_memory-test.patch
-Patch149: insight-7.12-gdb-vla-intel-fortran-strides.patch
-Patch150: insight-7.12-gdb-vla-intel-fortran-vla-strings.patch
-Patch151: insight-7.12-gdb-vla-intel-stringbt-fix.patch
-Patch152: gdb-archer-vla-tests.patch
-Patch153: gdb-vla-intel-tests.patch
-Patch154: gdb-btrobust.patch
-Patch155: gdb-fortran-frame-string.patch
-Patch156: insight-7.12-gdb-python-gil.patch
-Patch157: gdb-jit-reader-multilib.patch
-Patch158: gdb-rhbz1350436-type-printers-error.patch
-Patch159: gdb-rhbz1084404-ppc64-s390x-wrong-prologue-skip-O2-g-3of3.patch
-Patch160: gdb-bz1219747-attach-kills.patch
-Patch161: gdb-pahole-python2.patch
-Patch162: insight-7.12-gdb-fedora-libncursesw.patch
-Patch163: gdb-container-rh-pkg.patch
-Patch164: gdb-linux_perf-bundle.patch
-Patch165: gdb-tls-1of2.patch
-Patch166: gdb-tls-2of2.patch
-Patch167: gdb-libexec-add-index.patch
-Patch168: gdb-add-index-chmod.patch
+Patch147: gdb-6.6-buildid-locate-rpm-scl.patch
+Patch148: gdb-readline62-ask-more-rh.patch
+Patch149: insight-8.1-gdb-6.8-attach-signalled-detach-stopped.patch
+Patch150: insight-8.1-gdb-6.8-quit-never-aborts.patch
+Patch151: gdb-container-rh-pkg.patch
+Patch152: gdb-linux_perf-bundle.patch
+Patch153: gdb-libexec-add-index.patch
+Patch154: gdb-archer.patch
+Patch155: gdb-vla-intel-fix-print-char-array.patch
%description
Insight is a tight graphical user interface to GDB written in Tcl/Tk.
It provides a comprehensive interface that enables users to harness
most of GDB's power. It's also probably the only up-to-date UI for
-GDB version 7.x.
+GDB version 8.x.
#-------------------------------------------------------------------------------
@@ -213,19 +200,6 @@ GDB version 7.x.
%patch153 -p1
%patch154 -p1
%patch155 -p1
-%patch156 -p1
-%patch157 -p1
-%patch158 -p1
-%patch159 -p1
-%patch160 -p1
-%patch161 -p1
-%patch162 -p1
-%patch163 -p1
-%patch164 -p1
-%patch165 -p1
-%patch166 -p1
-%patch167 -p1
-%patch168 -p1
#-------------------------------------------------------------------------------
@@ -264,8 +238,9 @@ done
. "%{_libdir}/tclConfig.sh"
. "%{_libdir}/tkConfig.sh"
+CFLAGS="${RPM_OPT_FLAGS} -DDNF_DEBUGINFO_INSTALL"; export CFLAGS
+CXXFLAGS="${RPM_OPT_FLAGS} -DDNF_DEBUGINFO_INSTALL"; export CXXFLAGS
%configure --enable-gdbtk \
- --enable-sim \
--disable-binutils \
--disable-elfcpp \
--disable-gas \
@@ -286,22 +261,24 @@ done
--with-tkinclude="${TK_SRC_DIR}" \
--without-libunwind \
--enable-64-bit-bfd \
-%if 0%{!?rhel:1}
--with-babeltrace \
-%else
- --without-babeltrace \
-%endif
-%if 0%{!?rhel:1} || 0%{?rhel} > 6
+ --with-guile \
--with-lzma \
-%else
- --without-lzma \
-%endif
%if 0%{?have_libipt}
--with-intel-pt \
%else
--without-intel-pt \
%endif
+%ifarch sparc sparcv9 sparc64
+ --without-mmap \
+%endif
+%ifarch %{arm}
+ --disable-inprocess-agent \
+%else
+ --enable-inprocess-agent \
+%endif
--with-auto-load-dir='$debugdir:$datadir/auto-load' \
+ --with-auto-load-safe-path='$debugdir:$datadir/auto-load' \
--enable-targets=s390-linux-gnu,powerpc-linux-gnu,arm-linux-gnu,aarch64-linux-gnu \
%{_target_platform}
@@ -312,8 +289,6 @@ make %{?_smp_mflags}
%install
#-------------------------------------------------------------------------------
-rm -rf "${RPM_BUILD_ROOT}"
-
INSTALL="install -p"
make DESTDIR="${RPM_BUILD_ROOT}" INSTALL="${INSTALL}" install
@@ -343,7 +318,13 @@ make DESTDIR="${RPM_BUILD_ROOT}" INSTALL="${INSTALL}" install
rm -rf .%{_datadir}/info
rm -rf .%{_datadir}/locale
+ rm -rf .%{_datadir}/insight/guile
rm -rf .%{_datadir}/insight/system-gdbinit
+
+ # Patch: gdb-dts-rhel6-python-compat.patch
+ rm -rf .%{_datadir}/insight/python/gdb/FrameWrapper.py
+ rm -rf .%{_datadir}/insight/python/gdb/backtrace.py
+ rm -rf .%{_datadir}/insight/python/gdb/command/backtrace.py
)
# Regenerate the libgui pkgIndex.tcl file.
@@ -353,18 +334,24 @@ echo "pkg_mkIndex \"${RPM_BUILD_ROOT}%{_datadir}/insight/gui\"" | tclsh
# Populate the auto-load directory from the libstdc++ gdb-specific
# directory.
-for i in $(echo bin lib $(basename '%{_libdir}') sbin | tr ' ' '\n' | sort -u)
-do mkdir -p "${RPM_BUILD_ROOT}%{_datadir}/insight/auto-load%{_prefix}/$i"
- ln -s "$(echo %{_prefix} | sed 's#^/*##')/$i" \
- "${RPM_BUILD_ROOT}%{_datadir}/insight/auto-load/$i"
- if [ -d "%{_datadir}/gdb/auto-load%{_prefix}/${i}" ]
- then find "%{_datadir}/gdb/auto-load%{_prefix}/${i}" -mindepth 1
- fi
-done | while read FROM
-do TO=`echo "${FROM}" | sed 's#/gdb/#/insight/#'`
- if [ -d "${FROM}" ]
- then mkdir -p "${RPM_BUILD_ROOT}${TO}"
- else ln -s "${FROM}" "${RPM_BUILD_ROOT}${TO}"
+mkdir -p "${RPM_BUILD_ROOT}%{_datadir}/insight/auto-load"
+rpm -ql libstdc++ | grep "^%{_datadir}/gdb/auto-load" | while read T
+do F="${RPM_BUILD_ROOT}%{_datadir}/insight/${T#%{_datadir}/gdb/}"
+ if [[ "${F}/" =~ '/__pycache__/' ]]
+ then : # Do not copy cache.
+ elif [ -e "${F}" ]
+ then : # Already exists: ignore.
+ elif [ -d "${T}" ]
+ then mkdir -p "${F}"
+ else if [ -h "${T}" ]
+ then D=`dirname "${T}"`
+ LINK=`realpath --relative-base="${D}" "${T}"`
+ if [[ "${LINK}" =~ '^/' ]]
+ then T="${LINK}"
+ else T=`realpath --relative-base="${D}" "${T}"`
+ fi
+ fi
+ ln -s "${T}" "${F}"
fi
done
@@ -413,6 +400,12 @@ rm -rf "${RPM_BUILD_ROOT}"
#-------------------------------------------------------------------------------
%changelog
+#-------------------------------------------------------------------------------
+
+* Fri Feb 16 2018 Patrick Monnerat <patrick(a)monnerat.net> 8.1.50.20180216-1
+- New upstream release.
+- Modernize spec file (BZ #1545189).
+
* Wed Feb 07 2018 Fedora Release Engineering <releng(a)fedoraproject.org> - 7.12.50.20170416-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
@@ -425,8 +418,6 @@ rm -rf "${RPM_BUILD_ROOT}"
* Mon May 15 2017 Fedora Release Engineering <rel-eng(a)lists.fedoraproject.org> - 7.12.50.20170416-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_27_Mass_Rebuild
-#-------------------------------------------------------------------------------
-
* Sun Apr 16 2017 Patrick Monnerat <patrick(a)monnerat.net> 7.12.50.20170416-1
- New upstream release.
- Fixes BZ #1409768.
diff --git a/sources b/sources
index 9c4b82c..2c960c3 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-SHA512 (insight-7.12.50.20170416.tar.xz) = c8607823dedf4f02e7df540135723300e19c1f0cced8ac86d997bd019930213d4241f949eba6ac775c0cdfa2a0653b52e2e5cf71ac04c7130a34d9ea3f730a90
+SHA512 (insight-8.1.50.20180216.tar.xz) = a498fbd5ba66c5b5f30e3403a99378cd5c9668e77e7b7d58dc2087c73fdddf29c3e79ad076aa445bfa6d653679422941c4655c8b56c2750e6087882b8f7e684c
6 years, 4 months
Architecture specific change in rpms/insight.git
by githook-noreply@fedoraproject.org
The package rpms/insight.git has added or updated architecture specific content in its
spec file (ExclusiveArch/ExcludeArch or %ifarch/%ifnarch) in commit(s):
https://src.fedoraproject.org/cgit/rpms/insight.git/commit/?id=66631b1b4b....
Change:
+%ifarch %{arm}
Thanks.
Full change:
============
commit 66631b1b4b71cfe922807000bf779151fca24f1d
Author: Patrick Monnerat <patrick(a)monnerat.net>
Date: Tue Feb 20 19:18:01 2018 +0100
- New upstream release.
- Modernize spec file (BZ #1545189).
diff --git a/.gitignore b/.gitignore
index 80d07b6..c3c46c5 100644
--- a/.gitignore
+++ b/.gitignore
@@ -4,3 +4,4 @@ insight-6.8-1.tar.bz2
/insight-7.8.50.20140827.tar.bz2
/insight-7.10.50.20160208.tar.xz
/insight-7.12.50.20170416.tar.xz
+/insight-8.1.50.20180216.tar.xz
diff --git a/gdb-6.3-gstack-20050411.patch b/gdb-6.3-gstack-20050411.patch
index 1a4140e..3619504 100644
--- a/gdb-6.3-gstack-20050411.patch
+++ b/gdb-6.3-gstack-20050411.patch
@@ -1,14 +1,34 @@
+From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
+From: Andrew Cagney <cagney(a)gnu.org>
+Date: Fri, 27 Oct 2017 21:07:50 +0200
+Subject: gdb-6.3-gstack-20050411.patch
+
+FileName: gdb-6.3-gstack-20050411.patch
+
+;; Add a wrapper script to GDB that implements pstack using the
+;; --readnever option.
+;;=push
+
2004-11-23 Andrew Cagney <cagney(a)redhat.com>
* Makefile.in (uninstall-gstack, install-gstack): New rules, add
to install and uninstall.
* gstack.sh, gstack.1: New files.
+---
+ gdb/Makefile.in | 34 ++++++++++++++++++--
+ gdb/gstack.sh | 43 +++++++++++++++++++++++++
+ gdb/testsuite/gdb.base/gstack.c | 43 +++++++++++++++++++++++++
+ gdb/testsuite/gdb.base/gstack.exp | 66 +++++++++++++++++++++++++++++++++++++++
+ 4 files changed, 184 insertions(+), 2 deletions(-)
+ create mode 100644 gdb/gstack.sh
+ create mode 100644 gdb/testsuite/gdb.base/gstack.c
+ create mode 100644 gdb/testsuite/gdb.base/gstack.exp
-Index: gdb-7.7/gdb/Makefile.in
-===================================================================
---- gdb-7.7.orig/gdb/Makefile.in 2014-02-06 20:29:09.401214339 +0100
-+++ gdb-7.7/gdb/Makefile.in 2014-02-06 20:29:09.501214360 +0100
-@@ -1067,7 +1067,7 @@ info install-info clean-info dvi pdf ins
+diff --git a/gdb/Makefile.in b/gdb/Makefile.in
+index 17b71c6e7c..e77d6a5c03 100644
+--- a/gdb/Makefile.in
++++ b/gdb/Makefile.in
+@@ -1744,7 +1744,7 @@ info install-info clean-info dvi pdf install-pdf html install-html: force
install: all
@$(MAKE) $(FLAGS_TO_PASS) install-only
@@ -17,7 +37,7 @@ Index: gdb-7.7/gdb/Makefile.in
transformed_name=`t='$(program_transform_name)'; \
echo gdb | sed -e "$$t"` ; \
if test "x$$transformed_name" = x; then \
-@@ -1104,7 +1104,25 @@ install-strip:
+@@ -1784,7 +1784,25 @@ install-guile:
install-python:
$(SHELL) $(srcdir)/../mkinstalldirs $(DESTDIR)$(GDB_DATADIR)/python/gdb
@@ -44,7 +64,7 @@ Index: gdb-7.7/gdb/Makefile.in
transformed_name=`t='$(program_transform_name)'; \
echo gdb | sed -e $$t` ; \
if test "x$$transformed_name" = x; then \
-@@ -1127,6 +1145,18 @@ uninstall: force $(CONFIG_UNINSTALL)
+@@ -1807,6 +1825,18 @@ uninstall: force $(CONFIG_UNINSTALL)
fi
@$(MAKE) DO=uninstall "DODIRS=$(SUBDIRS)" $(FLAGS_TO_PASS) subdir_do
@@ -63,10 +83,11 @@ Index: gdb-7.7/gdb/Makefile.in
# The C++ name parser can be built standalone for testing.
test-cp-name-parser.o: cp-name-parser.c
$(COMPILE) -DTEST_CPNAMES cp-name-parser.c
-Index: gdb-7.7/gdb/gstack.sh
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ gdb-7.7/gdb/gstack.sh 2014-02-06 20:29:09.501214360 +0100
+diff --git a/gdb/gstack.sh b/gdb/gstack.sh
+new file mode 100644
+index 0000000000..f7f07248f7
+--- /dev/null
++++ b/gdb/gstack.sh
@@ -0,0 +1,43 @@
+#!/bin/sh
+
@@ -111,10 +132,60 @@ Index: gdb-7.7/gdb/gstack.sh
+ -e 's/^\((gdb) \)*//' \
+ -e '/^#/p' \
+ -e '/^Thread/p'
-Index: gdb-7.7/gdb/testsuite/gdb.base/gstack.exp
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ gdb-7.7/gdb/testsuite/gdb.base/gstack.exp 2014-02-06 20:43:17.774747352 +0100
+diff --git a/gdb/testsuite/gdb.base/gstack.c b/gdb/testsuite/gdb.base/gstack.c
+new file mode 100644
+index 0000000000..dc10813f04
+--- /dev/null
++++ b/gdb/testsuite/gdb.base/gstack.c
+@@ -0,0 +1,43 @@
++/* This testcase is part of GDB, the GNU debugger.
++
++ Copyright 2005, 2007, 2008, 2009 Free Software Foundation, Inc.
++
++ This program is free software; you can redistribute it and/or modify
++ it under the terms of the GNU General Public License as published by
++ the Free Software Foundation; either version 3 of the License, or
++ (at your option) any later version.
++
++ This program is distributed in the hope that it will be useful,
++ but WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++ GNU General Public License for more details.
++
++ You should have received a copy of the GNU General Public License
++ along with this program. If not, see <http://www.gnu.org/licenses/>. */
++
++#include <stdio.h>
++#include <unistd.h>
++#include <string.h>
++
++void
++func (void)
++{
++ const char msg[] = "looping\n";
++
++ /* Use the most simple notification not to get caught by attach on exiting
++ the function. */
++ write (1, msg, strlen (msg));
++
++ for (;;);
++}
++
++int
++main (void)
++{
++ alarm (60);
++ nice (100);
++
++ func ();
++
++ return 0;
++}
+diff --git a/gdb/testsuite/gdb.base/gstack.exp b/gdb/testsuite/gdb.base/gstack.exp
+new file mode 100644
+index 0000000000..1186ec57bc
+--- /dev/null
++++ b/gdb/testsuite/gdb.base/gstack.exp
@@ -0,0 +1,66 @@
+# Copyright (C) 2012 Free Software Foundation, Inc.
+
@@ -182,51 +253,6 @@ Index: gdb-7.7/gdb/testsuite/gdb.base/gstack.exp
+gdb_exit
+
+remote_exec host "kill -9 $pid"
-Index: gdb-7.7/gdb/testsuite/gdb.base/gstack.c
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ gdb-7.7/gdb/testsuite/gdb.base/gstack.c 2014-02-06 20:29:09.502214360 +0100
-@@ -0,0 +1,43 @@
-+/* This testcase is part of GDB, the GNU debugger.
-+
-+ Copyright 2005, 2007, 2008, 2009 Free Software Foundation, Inc.
-+
-+ This program is free software; you can redistribute it and/or modify
-+ it under the terms of the GNU General Public License as published by
-+ the Free Software Foundation; either version 3 of the License, or
-+ (at your option) any later version.
-+
-+ This program is distributed in the hope that it will be useful,
-+ but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ GNU General Public License for more details.
-+
-+ You should have received a copy of the GNU General Public License
-+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
-+
-+#include <stdio.h>
-+#include <unistd.h>
-+#include <string.h>
-+
-+void
-+func (void)
-+{
-+ const char msg[] = "looping\n";
-+
-+ /* Use the most simple notification not to get caught by attach on exiting
-+ the function. */
-+ write (1, msg, strlen (msg));
-+
-+ for (;;);
-+}
-+
-+int
-+main (void)
-+{
-+ alarm (60);
-+ nice (100);
-+
-+ func ();
-+
-+ return 0;
-+}
+--
+2.14.3
+
diff --git a/gdb-6.3-ppc64displaysymbol-20041124.patch b/gdb-6.3-ppc64displaysymbol-20041124.patch
index 8e94e00..9dcb927 100644
--- a/gdb-6.3-ppc64displaysymbol-20041124.patch
+++ b/gdb-6.3-ppc64displaysymbol-20041124.patch
@@ -1,13 +1,27 @@
+From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
+From: Andrew Cagney <cagney(a)gnu.org>
+Date: Fri, 27 Oct 2017 21:07:50 +0200
+Subject: gdb-6.3-ppc64displaysymbol-20041124.patch
+
+FileName: gdb-6.3-ppc64displaysymbol-20041124.patch
+
+;; Include the pc's section when doing a symbol lookup so that the
+;; correct symbol is found.
+;;=push: Write new testcase.
+
2004-11-24 Andrew Cagney <cagney(a)gnu.org>
* printcmd.c (build_address_symbolic): Find a section for the
address.
+---
+ gdb/printcmd.c | 8 ++++++++
+ 1 file changed, 8 insertions(+)
-Index: gdb-6.8.50.20081128/gdb/printcmd.c
-===================================================================
---- gdb-6.8.50.20081128.orig/gdb/printcmd.c 2008-12-04 01:36:05.000000000 +0100
-+++ gdb-6.8.50.20081128/gdb/printcmd.c 2008-12-04 01:37:18.000000000 +0100
-@@ -616,6 +616,14 @@ build_address_symbolic (CORE_ADDR addr,
+diff --git a/gdb/printcmd.c b/gdb/printcmd.c
+index 6256f35baa..c52e39f7fc 100644
+--- a/gdb/printcmd.c
++++ b/gdb/printcmd.c
+@@ -602,6 +602,14 @@ build_address_symbolic (struct gdbarch *gdbarch,
addr = overlay_mapped_address (addr, section);
}
}
@@ -22,3 +36,6 @@ Index: gdb-6.8.50.20081128/gdb/printcmd.c
/* First try to find the address in the symbol table, then
in the minsyms. Take the closest one. */
+--
+2.14.3
+
diff --git a/gdb-6.3-ppc64syscall-20040622.patch b/gdb-6.3-ppc64syscall-20040622.patch
index a237cc1..b77b888 100644
--- a/gdb-6.3-ppc64syscall-20040622.patch
+++ b/gdb-6.3-ppc64syscall-20040622.patch
@@ -1,3 +1,13 @@
+From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
+From: Andrew Cagney <cagney(a)gnu.org>
+Date: Fri, 27 Oct 2017 21:07:50 +0200
+Subject: gdb-6.3-ppc64syscall-20040622.patch
+
+FileName: gdb-6.3-ppc64syscall-20040622.patch
+
+;; Better parse 64-bit PPC system call prologues.
+;;=push: Write new testcase.
+
2004-06-22 Andrew Cagney <cagney(a)gnu.org>
* rs6000-tdep.c (struct rs6000_framedata): Add field "func_start".
@@ -5,12 +15,15 @@
"func_start". Add local variable "num_skip_linux_syscall_insn",
use to skip over first half of a GNU/Linux syscall and update
"func_start".
+---
+ gdb/rs6000-tdep.c | 57 ++++++++++++++++++++++++++++++++++++++++++++++++++++---
+ 1 file changed, 54 insertions(+), 3 deletions(-)
-Index: gdb-7.2.50.20110117/gdb/rs6000-tdep.c
-===================================================================
---- gdb-7.2.50.20110117.orig/gdb/rs6000-tdep.c 2011-01-11 20:23:02.000000000 +0100
-+++ gdb-7.2.50.20110117/gdb/rs6000-tdep.c 2011-01-17 15:48:19.000000000 +0100
-@@ -126,6 +126,7 @@ static const char *powerpc_vector_abi_st
+diff --git a/gdb/rs6000-tdep.c b/gdb/rs6000-tdep.c
+index e5a265dbcb..23d0db3b8f 100644
+--- a/gdb/rs6000-tdep.c
++++ b/gdb/rs6000-tdep.c
+@@ -134,6 +134,7 @@ static const char *powerpc_vector_abi_string = "auto";
struct rs6000_framedata
{
@@ -18,7 +31,7 @@ Index: gdb-7.2.50.20110117/gdb/rs6000-tdep.c
int offset; /* total size of frame --- the distance
by which we decrement sp to allocate
the frame */
-@@ -1496,7 +1497,6 @@ static CORE_ADDR
+@@ -1577,7 +1578,6 @@ static CORE_ADDR
skip_prologue (struct gdbarch *gdbarch, CORE_ADDR pc, CORE_ADDR lim_pc,
struct rs6000_framedata *fdata)
{
@@ -26,7 +39,7 @@ Index: gdb-7.2.50.20110117/gdb/rs6000-tdep.c
CORE_ADDR last_prologue_pc = pc;
CORE_ADDR li_found_pc = 0;
gdb_byte buf[4];
-@@ -1514,12 +1514,14 @@ skip_prologue (struct gdbarch *gdbarch,
+@@ -1595,12 +1595,14 @@ skip_prologue (struct gdbarch *gdbarch, CORE_ADDR pc, CORE_ADDR lim_pc,
int minimal_toc_loaded = 0;
int prev_insn_was_prologue_insn = 1;
int num_skip_non_prologue_insns = 0;
@@ -41,7 +54,7 @@ Index: gdb-7.2.50.20110117/gdb/rs6000-tdep.c
fdata->saved_gpr = -1;
fdata->saved_fpr = -1;
fdata->saved_vr = -1;
-@@ -1553,6 +1555,55 @@ skip_prologue (struct gdbarch *gdbarch,
+@@ -1634,6 +1636,55 @@ skip_prologue (struct gdbarch *gdbarch, CORE_ADDR pc, CORE_ADDR lim_pc,
break;
op = extract_unsigned_integer (buf, 4, byte_order);
@@ -97,7 +110,7 @@ Index: gdb-7.2.50.20110117/gdb/rs6000-tdep.c
if ((op & 0xfc1fffff) == 0x7c0802a6)
{ /* mflr Rx */
/* Since shared library / PIC code, which needs to get its
-@@ -1734,9 +1785,9 @@ skip_prologue (struct gdbarch *gdbarch,
+@@ -1825,9 +1876,9 @@ skip_prologue (struct gdbarch *gdbarch, CORE_ADDR pc, CORE_ADDR lim_pc,
we have no line table information or the line info tells
us that the subroutine call is not part of the line
associated with the prologue. */
@@ -109,3 +122,6 @@ Index: gdb-7.2.50.20110117/gdb/rs6000-tdep.c
struct symtab_and_line this_sal = find_pc_line (pc, 0);
if ((prologue_sal.line == 0)
+--
+2.14.3
+
diff --git a/gdb-6.3-readnever-20050907.patch b/gdb-6.3-readnever-20050907.patch
new file mode 100644
index 0000000..964bcf6
--- /dev/null
+++ b/gdb-6.3-readnever-20050907.patch
@@ -0,0 +1,44 @@
+From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
+From: Andrew Cagney <cagney(a)gnu.org>
+Date: Fri, 27 Oct 2017 21:07:50 +0200
+Subject: gdb-6.3-readnever-20050907.patch
+
+FileName: gdb-6.3-readnever-20050907.patch
+
+;; Add readnever option
+;;=push
+
+2004-11-18 Andrew Cagney <cagney(a)gnu.org>
+
+ * dwarf2read.c: Include "top.c".
+ (dwarf2_has_info): Check for readnever_symbol_files.
+ * symfile.c (readnever_symbol_files): Define.
+ * top.h (readnever_symbol_files): Declare.
+ * main.c (captured_main): Add --readnever option.
+ (print_gdb_help): Ditto.
+
+2004-11-18 Andrew Cagney <cagney(a)gnu.org>
+
+ * gdb.texinfo (File Options): Document --readnever.
+
+Pushed upstream: https://sourceware.org/ml/gdb-cvs/2017-12/msg00007.html
+---
+ gdb/gcore.in | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/gdb/gcore.in b/gdb/gcore.in
+index b7f57cd341..c7e0dec574 100644
+--- a/gdb/gcore.in
++++ b/gdb/gcore.in
+@@ -97,7 +97,7 @@ for pid in $*
+ do
+ # `</dev/null' to avoid touching interactive terminal if it is
+ # available but not accessible as GDB would get stopped on SIGTTIN.
+- $binary_path/@GDB_TRANSFORM_NAME@ </dev/null --nx --batch \
++ $binary_path/@GDB_TRANSFORM_NAME@ </dev/null --nx --batch --readnever \
+ -ex "set pagination off" -ex "set height 0" -ex "set width 0" \
+ "${dump_all_cmds[@]}" \
+ -ex "attach $pid" -ex "gcore $name.$pid" -ex detach -ex quit
+--
+2.14.3
+
diff --git a/gdb-6.3-rh-dummykfail-20041202.patch b/gdb-6.3-rh-dummykfail-20041202.patch
deleted file mode 100644
index 1f0bc9d..0000000
--- a/gdb-6.3-rh-dummykfail-20041202.patch
+++ /dev/null
@@ -1,22 +0,0 @@
-2003-07-11 Elena Zannoni <ezannoni(a)redhat.com>
-
- * lib/gdb.exp (setup_kfail, kfail): Redefine procedures.
-
---- ./gdb/testsuite/lib/gdb.exp.1 2004-11-24 15:59:46.131394720 -0500
-+++ ./gdb/testsuite/lib/gdb.exp 2004-11-24 16:01:06.304206600 -0500
-@@ -63,6 +63,15 @@
-
- ### Only procedures should come after this point.
-
-+if {![llength [info procs kfail]]} {
-+ proc setup_kfail { args } {
-+ #setup_xfail args
-+ }
-+ proc kfail { bugid message } {
-+ fail $message
-+ }
-+}
-+
- #
- # gdb_version -- extract and print the version number of GDB
- #
diff --git a/gdb-6.3-rh-testversion-20041202.patch b/gdb-6.3-rh-testversion-20041202.patch
index 8b9a4bf..72ce7a5 100644
--- a/gdb-6.3-rh-testversion-20041202.patch
+++ b/gdb-6.3-rh-testversion-20041202.patch
@@ -1,13 +1,27 @@
+From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
+From: Elena Zannoni <ezannoni(a)redhat.com>
+Date: Fri, 27 Oct 2017 21:07:50 +0200
+Subject: gdb.gdb/selftest.exp: Add matching on specific Red Hat only version
+ string
+
+FileName: gdb-6.3-rh-testversion-20041202.patch
+
+;; Match the Fedora's version info.
+;;=fedora
+
2003-02-24 Elena Zannoni <ezannoni(a)redhat.com>
* gdb.gdb/selftest.exp: Add matching on specific Red Hat only version
string.
+---
+ gdb/testsuite/gdb.gdb/selftest.exp | 3 +++
+ 1 file changed, 3 insertions(+)
-Index: gdb-7.12.50.20170207/gdb/testsuite/gdb.gdb/selftest.exp
-===================================================================
---- gdb-7.12.50.20170207.orig/gdb/testsuite/gdb.gdb/selftest.exp 2017-02-07 19:47:06.472874620 +0100
-+++ gdb-7.12.50.20170207/gdb/testsuite/gdb.gdb/selftest.exp 2017-02-07 19:48:12.593380575 +0100
-@@ -53,6 +53,9 @@
+diff --git a/gdb/testsuite/gdb.gdb/selftest.exp b/gdb/testsuite/gdb.gdb/selftest.exp
+index 20f34983ef..4108e088a9 100644
+--- a/gdb/testsuite/gdb.gdb/selftest.exp
++++ b/gdb/testsuite/gdb.gdb/selftest.exp
+@@ -53,6 +53,9 @@ proc test_with_self { } {
-re ".\[0-9\]+ = +.+ +0x.*\[0-9.\]+.*$gdb_prompt $" {
pass "printed version with cast"
}
@@ -17,3 +31,6 @@ Index: gdb-7.12.50.20170207/gdb/testsuite/gdb.gdb/selftest.exp
}
# start the "xgdb" process
+--
+2.14.3
+
diff --git a/gdb-6.5-bz185337-resolve-tls-without-debuginfo-v2.patch b/gdb-6.5-bz185337-resolve-tls-without-debuginfo-v2.patch
index aa1a646..b00b3d0 100644
--- a/gdb-6.5-bz185337-resolve-tls-without-debuginfo-v2.patch
+++ b/gdb-6.5-bz185337-resolve-tls-without-debuginfo-v2.patch
@@ -1,3 +1,13 @@
+From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
+From: Jan Kratochvil <jan.kratochvil(a)redhat.com>
+Date: Fri, 27 Oct 2017 21:07:50 +0200
+Subject: gdb-6.5-bz185337-resolve-tls-without-debuginfo-v2.patch
+
+FileName: gdb-6.5-bz185337-resolve-tls-without-debuginfo-v2.patch
+
+;; Support TLS symbols (+`errno' suggestion if no pthread is found) (BZ 185337).
+;;=push+jan: It should be replaced by Infinity project.
+
https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=185337
2008-02-24 Jan Kratochvil <jan.kratochvil(a)redhat.com>
@@ -24,7 +34,6 @@ call invalidates `struct frame *' in the callers - RH BZ 690908.
https://bugzilla.redhat.com/show_bug.cgi?id=1166549
-
2007-11-03 Jan Kratochvil <jan.kratochvil(a)redhat.com>
* ./gdb/dwarf2read.c (read_partial_die, dwarf2_linkage_name): Prefer
@@ -33,12 +42,23 @@ https://bugzilla.redhat.com/show_bug.cgi?id=1166549
glibc-debuginfo-2.7-2.x86_64: /usr/lib/debug/lib64/libc.so.6.debug:
<81a2> DW_AT_name : (indirect string, offset: 0x280e): __errno_location
<81a8> DW_AT_MIPS_linkage_name: (indirect string, offset: 0x2808): *__GI___errno_location
+---
+ gdb/printcmd.c | 4 ++
+ gdb/testsuite/gdb.dwarf2/dw2-errno.c | 28 +++++++++++++
+ gdb/testsuite/gdb.dwarf2/dw2-errno.exp | 60 ++++++++++++++++++++++++++++
+ gdb/testsuite/gdb.dwarf2/dw2-errno2.c | 28 +++++++++++++
+ gdb/testsuite/gdb.dwarf2/dw2-errno2.exp | 71 +++++++++++++++++++++++++++++++++
+ 5 files changed, 191 insertions(+)
+ create mode 100644 gdb/testsuite/gdb.dwarf2/dw2-errno.c
+ create mode 100644 gdb/testsuite/gdb.dwarf2/dw2-errno.exp
+ create mode 100644 gdb/testsuite/gdb.dwarf2/dw2-errno2.c
+ create mode 100644 gdb/testsuite/gdb.dwarf2/dw2-errno2.exp
-Index: gdb-7.12.50.20170207/gdb/printcmd.c
-===================================================================
---- gdb-7.12.50.20170207.orig/gdb/printcmd.c 2017-02-07 21:06:20.196593884 +0100
-+++ gdb-7.12.50.20170207/gdb/printcmd.c 2017-02-07 21:07:10.230973906 +0100
-@@ -1258,6 +1258,10 @@
+diff --git a/gdb/printcmd.c b/gdb/printcmd.c
+index c52e39f7fc..ad80b1bebf 100644
+--- a/gdb/printcmd.c
++++ b/gdb/printcmd.c
+@@ -1210,6 +1210,10 @@ print_command_1 (const char *exp, int voidprint)
if (exp && *exp)
{
@@ -49,10 +69,11 @@ Index: gdb-7.12.50.20170207/gdb/printcmd.c
expression_up expr = parse_expression (exp);
val = evaluate_expression (expr.get ());
}
-Index: gdb-7.12.50.20170207/gdb/testsuite/gdb.dwarf2/dw2-errno.c
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ gdb-7.12.50.20170207/gdb/testsuite/gdb.dwarf2/dw2-errno.c 2017-02-07 21:06:20.196593884 +0100
+diff --git a/gdb/testsuite/gdb.dwarf2/dw2-errno.c b/gdb/testsuite/gdb.dwarf2/dw2-errno.c
+new file mode 100644
+index 0000000000..7bd10d0978
+--- /dev/null
++++ b/gdb/testsuite/gdb.dwarf2/dw2-errno.c
@@ -0,0 +1,28 @@
+/* This testcase is part of GDB, the GNU debugger.
+
@@ -82,10 +103,11 @@ Index: gdb-7.12.50.20170207/gdb/testsuite/gdb.dwarf2/dw2-errno.c
+
+ return 0; /* breakpoint */
+}
-Index: gdb-7.12.50.20170207/gdb/testsuite/gdb.dwarf2/dw2-errno.exp
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ gdb-7.12.50.20170207/gdb/testsuite/gdb.dwarf2/dw2-errno.exp 2017-02-07 21:06:20.196593884 +0100
+diff --git a/gdb/testsuite/gdb.dwarf2/dw2-errno.exp b/gdb/testsuite/gdb.dwarf2/dw2-errno.exp
+new file mode 100644
+index 0000000000..1f13cc1323
+--- /dev/null
++++ b/gdb/testsuite/gdb.dwarf2/dw2-errno.exp
@@ -0,0 +1,60 @@
+# Copyright 2007 Free Software Foundation, Inc.
+
@@ -147,10 +169,11 @@ Index: gdb-7.12.50.20170207/gdb/testsuite/gdb.dwarf2/dw2-errno.exp
+
+# TODO: Test the error on resolving ERRNO with only libc loaded.
+# Just how to find the current libc filename?
-Index: gdb-7.12.50.20170207/gdb/testsuite/gdb.dwarf2/dw2-errno2.c
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ gdb-7.12.50.20170207/gdb/testsuite/gdb.dwarf2/dw2-errno2.c 2017-02-07 21:06:20.196593884 +0100
+diff --git a/gdb/testsuite/gdb.dwarf2/dw2-errno2.c b/gdb/testsuite/gdb.dwarf2/dw2-errno2.c
+new file mode 100644
+index 0000000000..7bd10d0978
+--- /dev/null
++++ b/gdb/testsuite/gdb.dwarf2/dw2-errno2.c
@@ -0,0 +1,28 @@
+/* This testcase is part of GDB, the GNU debugger.
+
@@ -180,10 +203,11 @@ Index: gdb-7.12.50.20170207/gdb/testsuite/gdb.dwarf2/dw2-errno2.c
+
+ return 0; /* breakpoint */
+}
-Index: gdb-7.12.50.20170207/gdb/testsuite/gdb.dwarf2/dw2-errno2.exp
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ gdb-7.12.50.20170207/gdb/testsuite/gdb.dwarf2/dw2-errno2.exp 2017-02-07 21:06:20.197593892 +0100
+diff --git a/gdb/testsuite/gdb.dwarf2/dw2-errno2.exp b/gdb/testsuite/gdb.dwarf2/dw2-errno2.exp
+new file mode 100644
+index 0000000000..0f6e66870b
+--- /dev/null
++++ b/gdb/testsuite/gdb.dwarf2/dw2-errno2.exp
@@ -0,0 +1,71 @@
+# Copyright 2007 Free Software Foundation, Inc.
+
@@ -225,7 +249,7 @@ Index: gdb-7.12.50.20170207/gdb/testsuite/gdb.dwarf2/dw2-errno2.exp
+ if $do_xfail {
+ setup_xfail "*-*-*"
+ }
-+ gdb_test "print errno" ".* = 42" "print errno for core"
++ gdb_test "print (int) errno" ".* = 42" "print errno for core"
+}}
+
+set variant g2thrN
@@ -256,3 +280,6 @@ Index: gdb-7.12.50.20170207/gdb/testsuite/gdb.dwarf2/dw2-errno2.exp
+
+# TODO: Test the error on resolving ERRNO with only libc loaded.
+# Just how to find the current libc filename?
+--
+2.14.3
+
diff --git a/gdb-6.5-bz203661-emit-relocs.patch b/gdb-6.5-bz203661-emit-relocs.patch
index cc8e515..56107b2 100644
--- a/gdb-6.5-bz203661-emit-relocs.patch
+++ b/gdb-6.5-bz203661-emit-relocs.patch
@@ -1,8 +1,21 @@
-Index: gdb-7.4.50.20120602/gdb/symfile.c
-===================================================================
---- gdb-7.4.50.20120602.orig/gdb/symfile.c 2012-06-02 18:25:20.000000000 +0200
-+++ gdb-7.4.50.20120602/gdb/symfile.c 2012-06-02 18:26:36.145232057 +0200
-@@ -3630,6 +3630,12 @@ default_symfile_relocate (struct objfile
+From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
+From: Fedora GDB patches <invalid(a)email.com>
+Date: Fri, 27 Oct 2017 21:07:50 +0200
+Subject: gdb-6.5-bz203661-emit-relocs.patch
+
+FileName: gdb-6.5-bz203661-emit-relocs.patch
+
+;; Fix debuginfo addresses resolving for --emit-relocs Linux kernels (BZ 203661).
+;;=push+jan: There was some mail thread about it, this patch may be a hack.
+---
+ gdb/symfile.c | 6 ++++++
+ 1 file changed, 6 insertions(+)
+
+diff --git a/gdb/symfile.c b/gdb/symfile.c
+index f7f75b05d3..7cda615e74 100644
+--- a/gdb/symfile.c
++++ b/gdb/symfile.c
+@@ -3629,6 +3629,12 @@ default_symfile_relocate (struct objfile *objfile, asection *sectp,
DWO file. */
bfd *abfd = sectp->owner;
@@ -15,3 +28,6 @@ Index: gdb-7.4.50.20120602/gdb/symfile.c
/* We're only interested in sections with relocation
information. */
if ((sectp->flags & SEC_RELOC) == 0)
+--
+2.14.3
+
diff --git a/gdb-6.5-bz216711-clone-is-outermost.patch b/gdb-6.5-bz216711-clone-is-outermost.patch
index 657eeb4..d4fb116 100644
--- a/gdb-6.5-bz216711-clone-is-outermost.patch
+++ b/gdb-6.5-bz216711-clone-is-outermost.patch
@@ -1,3 +1,13 @@
+From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
+From: Jan Kratochvil <jan.kratochvil(a)redhat.com>
+Date: Fri, 27 Oct 2017 21:07:50 +0200
+Subject: gdb-6.5-bz216711-clone-is-outermost.patch
+
+FileName: gdb-6.5-bz216711-clone-is-outermost.patch
+
+;; Fix bogus 0x0 unwind of the thread's topmost function clone(3) (BZ 216711).
+;;=fedora
+
https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=216711
FIXME: This workaround should be dropped and
@@ -22,12 +32,22 @@ instead.
2007-10-16 Jan Kratochvil <jan.kratochvil(a)redhat.com>
Port to GDB-6.7.
+---
+ gdb/amd64-linux-tdep.c | 76 +++++++++++++++++++++++++++++
+ gdb/amd64-tdep.c | 11 +++++
+ gdb/i386-tdep.c | 3 ++
+ gdb/i386-tdep.h | 3 ++
+ gdb/testsuite/gdb.threads/bt-clone-stop.c | 39 +++++++++++++++
+ gdb/testsuite/gdb.threads/bt-clone-stop.exp | 61 +++++++++++++++++++++++
+ 6 files changed, 193 insertions(+)
+ create mode 100644 gdb/testsuite/gdb.threads/bt-clone-stop.c
+ create mode 100644 gdb/testsuite/gdb.threads/bt-clone-stop.exp
-Index: gdb-7.10.90.20160211/gdb/amd64-linux-tdep.c
-===================================================================
---- gdb-7.10.90.20160211.orig/gdb/amd64-linux-tdep.c 2016-02-15 23:37:06.936501443 +0100
-+++ gdb-7.10.90.20160211/gdb/amd64-linux-tdep.c 2016-02-15 23:37:39.928735691 +0100
-@@ -292,6 +292,80 @@
+diff --git a/gdb/amd64-linux-tdep.c b/gdb/amd64-linux-tdep.c
+index 2bd3d31b75..2623bae42d 100644
+--- a/gdb/amd64-linux-tdep.c
++++ b/gdb/amd64-linux-tdep.c
+@@ -291,6 +291,80 @@ amd64_linux_register_reggroup_p (struct gdbarch *gdbarch, int regnum,
/* Set the program counter for process PTID to PC. */
@@ -108,7 +128,7 @@ Index: gdb-7.10.90.20160211/gdb/amd64-linux-tdep.c
static void
amd64_linux_write_pc (struct regcache *regcache, CORE_ADDR pc)
{
-@@ -1800,6 +1874,8 @@
+@@ -1807,6 +1881,8 @@ amd64_linux_init_abi_common(struct gdbarch_info info, struct gdbarch *gdbarch)
tdep->xsave_xcr0_offset = I386_LINUX_XSAVE_XCR0_OFFSET;
@@ -117,11 +137,11 @@ Index: gdb-7.10.90.20160211/gdb/amd64-linux-tdep.c
/* Add the %orig_rax register used for syscall restarting. */
set_gdbarch_write_pc (gdbarch, amd64_linux_write_pc);
-Index: gdb-7.10.90.20160211/gdb/amd64-tdep.c
-===================================================================
---- gdb-7.10.90.20160211.orig/gdb/amd64-tdep.c 2016-02-15 23:37:06.936501443 +0100
-+++ gdb-7.10.90.20160211/gdb/amd64-tdep.c 2016-02-15 23:37:39.929735698 +0100
-@@ -2494,6 +2494,7 @@
+diff --git a/gdb/amd64-tdep.c b/gdb/amd64-tdep.c
+index 7b2851f0a6..7c70792b3f 100644
+--- a/gdb/amd64-tdep.c
++++ b/gdb/amd64-tdep.c
+@@ -2595,6 +2595,7 @@ amd64_frame_unwind_stop_reason (struct frame_info *this_frame,
{
struct amd64_frame_cache *cache =
amd64_frame_cache (this_frame, this_cache);
@@ -129,7 +149,7 @@ Index: gdb-7.10.90.20160211/gdb/amd64-tdep.c
if (!cache->base_p)
return UNWIND_UNAVAILABLE;
-@@ -2502,6 +2503,10 @@
+@@ -2603,6 +2604,10 @@ amd64_frame_unwind_stop_reason (struct frame_info *this_frame,
if (cache->base == 0)
return UNWIND_OUTERMOST;
@@ -140,7 +160,7 @@ Index: gdb-7.10.90.20160211/gdb/amd64-tdep.c
return UNWIND_NO_REASON;
}
-@@ -2636,6 +2641,7 @@
+@@ -2737,6 +2742,7 @@ amd64_sigtramp_frame_this_id (struct frame_info *this_frame,
{
struct amd64_frame_cache *cache =
amd64_sigtramp_frame_cache (this_frame, this_cache);
@@ -148,7 +168,7 @@ Index: gdb-7.10.90.20160211/gdb/amd64-tdep.c
if (!cache->base_p)
(*this_id) = frame_id_build_unavailable_stack (get_frame_pc (this_frame));
-@@ -2644,6 +2650,11 @@
+@@ -2745,6 +2751,11 @@ amd64_sigtramp_frame_this_id (struct frame_info *this_frame,
/* This marks the outermost frame. */
return;
}
@@ -160,11 +180,11 @@ Index: gdb-7.10.90.20160211/gdb/amd64-tdep.c
else
(*this_id) = frame_id_build (cache->base + 16, get_frame_pc (this_frame));
}
-Index: gdb-7.10.90.20160211/gdb/i386-tdep.c
-===================================================================
---- gdb-7.10.90.20160211.orig/gdb/i386-tdep.c 2016-02-15 23:37:06.936501443 +0100
-+++ gdb-7.10.90.20160211/gdb/i386-tdep.c 2016-02-15 23:37:39.931735713 +0100
-@@ -8305,6 +8305,9 @@
+diff --git a/gdb/i386-tdep.c b/gdb/i386-tdep.c
+index 9ce329eb20..d1b461b538 100644
+--- a/gdb/i386-tdep.c
++++ b/gdb/i386-tdep.c
+@@ -8401,6 +8401,9 @@ i386_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
tdep->xsave_xcr0_offset = -1;
@@ -174,11 +194,11 @@ Index: gdb-7.10.90.20160211/gdb/i386-tdep.c
tdep->record_regmap = i386_record_regmap;
set_gdbarch_long_long_align_bit (gdbarch, 32);
-Index: gdb-7.10.90.20160211/gdb/i386-tdep.h
-===================================================================
---- gdb-7.10.90.20160211.orig/gdb/i386-tdep.h 2016-02-15 23:37:06.936501443 +0100
-+++ gdb-7.10.90.20160211/gdb/i386-tdep.h 2016-02-15 23:37:39.932735720 +0100
-@@ -240,6 +240,9 @@
+diff --git a/gdb/i386-tdep.h b/gdb/i386-tdep.h
+index a71c103a88..5ee336b8cb 100644
+--- a/gdb/i386-tdep.h
++++ b/gdb/i386-tdep.h
+@@ -251,6 +251,9 @@ struct gdbarch_tdep
/* Regsets. */
const struct regset *fpregset;
@@ -188,10 +208,11 @@ Index: gdb-7.10.90.20160211/gdb/i386-tdep.h
};
/* Floating-point registers. */
-Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.threads/bt-clone-stop.c
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ gdb-7.10.90.20160211/gdb/testsuite/gdb.threads/bt-clone-stop.c 2016-02-15 23:37:39.932735720 +0100
+diff --git a/gdb/testsuite/gdb.threads/bt-clone-stop.c b/gdb/testsuite/gdb.threads/bt-clone-stop.c
+new file mode 100644
+index 0000000000..2ac93f8664
+--- /dev/null
++++ b/gdb/testsuite/gdb.threads/bt-clone-stop.c
@@ -0,0 +1,39 @@
+/* This testcase is part of GDB, the GNU debugger.
+
@@ -232,10 +253,11 @@ Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.threads/bt-clone-stop.c
+ for (;;)
+ pause();
+}
-Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.threads/bt-clone-stop.exp
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ gdb-7.10.90.20160211/gdb/testsuite/gdb.threads/bt-clone-stop.exp 2016-02-15 23:37:56.197851204 +0100
+diff --git a/gdb/testsuite/gdb.threads/bt-clone-stop.exp b/gdb/testsuite/gdb.threads/bt-clone-stop.exp
+new file mode 100644
+index 0000000000..02728e05b9
+--- /dev/null
++++ b/gdb/testsuite/gdb.threads/bt-clone-stop.exp
@@ -0,0 +1,61 @@
+# Copyright 2006 Free Software Foundation, Inc.
+
@@ -298,3 +320,6 @@ Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.threads/bt-clone-stop.exp
+ pass "0x0 entry not found"
+ }
+}
+--
+2.14.3
+
diff --git a/gdb-6.5-bz218379-solib-trampoline-lookup-lock-fix.patch b/gdb-6.5-bz218379-solib-trampoline-lookup-lock-fix.patch
index 58aadbf..e1b718d 100644
--- a/gdb-6.5-bz218379-solib-trampoline-lookup-lock-fix.patch
+++ b/gdb-6.5-bz218379-solib-trampoline-lookup-lock-fix.patch
@@ -1,11 +1,23 @@
-https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=218379
+From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
+From: Fedora GDB patches <invalid(a)email.com>
+Date: Fri, 27 Oct 2017 21:07:50 +0200
+Subject: gdb-6.5-bz218379-solib-trampoline-lookup-lock-fix.patch
+
+FileName: gdb-6.5-bz218379-solib-trampoline-lookup-lock-fix.patch
+;; Fix lockup on trampoline vs. its function lookup; unreproducible (BZ 218379).
+;;=fedora
-Index: gdb-7.7.90.20140613/gdb/symtab.c
-===================================================================
---- gdb-7.7.90.20140613.orig/gdb/symtab.c 2014-06-13 21:52:06.219338401 +0200
-+++ gdb-7.7.90.20140613/gdb/symtab.c 2014-06-13 21:55:02.753531885 +0200
-@@ -2394,6 +2394,13 @@ find_pc_sect_line (CORE_ADDR pc, struct
+https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=218379
+---
+ gdb/symtab.c | 7 +++++++
+ 1 file changed, 7 insertions(+)
+
+diff --git a/gdb/symtab.c b/gdb/symtab.c
+index 146dc2e421..e7223a9a98 100644
+--- a/gdb/symtab.c
++++ b/gdb/symtab.c
+@@ -3167,6 +3167,13 @@ find_pc_sect_line (CORE_ADDR pc, struct obj_section *section, int notcurrent)
SYMBOL_LINKAGE_NAME (msymbol)); */
;
/* fall through */
@@ -19,3 +31,6 @@ Index: gdb-7.7.90.20140613/gdb/symtab.c
else
return find_pc_line (BMSYMBOL_VALUE_ADDRESS (mfunsym), 0);
}
+--
+2.14.3
+
diff --git a/gdb-6.6-buildid-locate-misleading-warning-missing-debuginfo-rhbz981154.patch b/gdb-6.6-buildid-locate-misleading-warning-missing-debuginfo-rhbz981154.patch
deleted file mode 100644
index 32f2a83..0000000
--- a/gdb-6.6-buildid-locate-misleading-warning-missing-debuginfo-rhbz981154.patch
+++ /dev/null
@@ -1,135 +0,0 @@
-Comments by Sergio Durigan Junior <sergiodj(a)redhat.com>:
-
- This is the fix for RH BZ #981154
-
- It is mainly a testcase addition, but a minor fix in the gdb/build-id.c
- file was also needed.
-
- gdb/build-id.c was added by:
-
- commit dc294be54c96414035eed7d53dafdea0a6f31a72
- Author: Tom Tromey <tromey(a)redhat.com>
- Date: Tue Oct 8 19:56:15 2013 +0000
-
- and had a little thinko there. The variable 'filename' needs to be set to
- NULL after it is free'd, otherwise the code below thinks that it is still
- valid and doesn't print the necessary warning ("Try: yum install ...").
-
-Index: gdb-7.12.50.20170207/gdb/testsuite/gdb.base/rhbz981154-misleading-yum-install-warning.exp
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ gdb-7.12.50.20170207/gdb/testsuite/gdb.base/rhbz981154-misleading-yum-install-warning.exp 2017-02-26 19:14:58.492609659 +0100
-@@ -0,0 +1,97 @@
-+# Copyright (C) 2014 Free Software Foundation, Inc.
-+
-+# This program is free software; you can redistribute it and/or modify
-+# it under the terms of the GNU General Public License as published by
-+# the Free Software Foundation; either version 3 of the License, or
-+# (at your option) any later version.
-+#
-+# This program is distributed in the hope that it will be useful,
-+# but WITHOUT ANY WARRANTY; without even the implied warranty of
-+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+# GNU General Public License for more details.
-+#
-+# You should have received a copy of the GNU General Public License
-+# along with this program. If not, see <http://www.gnu.org/licenses/>.
-+
-+standard_testfile "normal.c"
-+
-+if { [prepare_for_testing ${testfile}.exp ${testfile} ${srcfile}] } {
-+ return -1
-+}
-+
-+# Get the build-id of the file
-+set build_id_debug_file [build_id_debug_filename_get $binfile]
-+regsub -all ".debug$" $build_id_debug_file "" build_id_without_debug
-+
-+# Run to main
-+if { ![runto_main] } {
-+ return -1
-+}
-+
-+# We first need to generate a corefile
-+set escapedfilename [string_to_regexp [standard_output_file gcore.test]]
-+set core_supported 0
-+gdb_test_multiple "gcore [standard_output_file gcore.test]" \
-+ "save a corefile" \
-+{
-+ -re "Saved corefile ${escapedfilename}\[\r\n\]+$gdb_prompt $" {
-+ pass "save a corefile"
-+ global core_supported
-+ set core_supported 1
-+ }
-+ -re "Can't create a corefile\[\r\n\]+$gdb_prompt $" {
-+ unsupported "save a corefile"
-+ global core_supported
-+ set core_supported 0
-+ }
-+}
-+
-+if {!$core_supported} {
-+ return -1
-+}
-+
-+# Move the binfile to a temporary name
-+remote_exec build "mv $binfile ${binfile}.old"
-+
-+# Reinitialize GDB and see if we get a yum/dnf warning
-+gdb_exit
-+gdb_start
-+gdb_reinitialize_dir $srcdir/$subdir
-+
-+with_test_prefix "first run:" {
-+ gdb_test "set build-id-verbose 1" "" \
-+ "set build-id-verbose"
-+
-+ gdb_test "set debug-file-directory [file dirname [standard_output_file gcore.test]]" "" \
-+ "set debug-file-directory"
-+
-+ gdb_test "core-file [standard_output_file gcore.test]" \
-+ "Missing separate debuginfo for the main executable file\r\nTry: (yum|dnf) --enablerepo='\\*debug\\*' install [standard_output_file $build_id_without_debug]\r\n.*" \
-+ "test first yum/dnf warning"
-+}
-+
-+# Now we define and create our .build-id
-+file mkdir [file dirname [standard_output_file ${build_id_without_debug}]]
-+# Cannot use "file link" (from TCL) because it requires the target file to
-+# exist.
-+remote_exec build "ln -s $binfile [standard_output_file ${build_id_without_debug}]"
-+
-+# Reinitialize GDB to get the second yum/dnf warning
-+gdb_exit
-+gdb_start
-+gdb_reinitialize_dir $srcdir/$subdir
-+
-+with_test_prefix "second run:" {
-+ gdb_test "set build-id-verbose 1" "" \
-+ "set build-id-verbose"
-+
-+ gdb_test "set debug-file-directory [file dirname [standard_output_file gcore.test]]" "" \
-+ "set debug-file-directory"
-+
-+ gdb_test "core-file [standard_output_file gcore.test]" \
-+ "Missing separate debuginfo for the main executable file\r\nTry: (yum|dnf) --enablerepo='\\*debug\\*' install $binfile\r\n.*" \
-+ "test second yum/dnf warning"
-+}
-+
-+# Leaving the link there will cause breakage in the next run.
-+remote_exec build "rm -f [standard_output_file ${build_id_without_debug}]"
-Index: gdb-7.12.50.20170207/gdb/build-id.c
-===================================================================
---- gdb-7.12.50.20170207.orig/gdb/build-id.c 2017-02-26 19:14:51.943562799 +0100
-+++ gdb-7.12.50.20170207/gdb/build-id.c 2017-02-26 19:14:58.492609659 +0100
-@@ -589,7 +589,10 @@
- do_cleanups (inner);
-
- if (abfd == NULL)
-- continue;
-+ {
-+ filename = NULL;
-+ continue;
-+ }
-
- if (build_id_verify (abfd.get(), build_id_len, build_id))
- break;
diff --git a/gdb-6.6-buildid-locate-rpm-librpm-workaround.patch b/gdb-6.6-buildid-locate-rpm-librpm-workaround.patch
index 3378717..b94cc1f 100644
--- a/gdb-6.6-buildid-locate-rpm-librpm-workaround.patch
+++ b/gdb-6.6-buildid-locate-rpm-librpm-workaround.patch
@@ -1,20 +1,22 @@
-Index: gdb-7.6.90.20140127/gdb/proc-service.list
-===================================================================
---- gdb-7.6.90.20140127.orig/gdb/proc-service.list 2014-02-06 17:32:42.810640320 +0100
-+++ gdb-7.6.90.20140127/gdb/proc-service.list 2014-02-06 17:33:35.406696964 +0100
-@@ -37,4 +37,7 @@
- ps_pstop;
- ps_ptread;
- ps_ptwrite;
-+
-+ /* gdb-6.6-buildid-locate-rpm.patch */
-+ rpmsqEnable;
- };
-Index: gdb-7.6.90.20140127/gdb/build-id.c
-===================================================================
---- gdb-7.6.90.20140127.orig/gdb/build-id.c 2014-02-06 17:30:14.230480264 +0100
-+++ gdb-7.6.90.20140127/gdb/build-id.c 2014-02-06 17:34:28.846754283 +0100
-@@ -677,6 +677,19 @@ build_id_to_filename (const struct elf_b
+From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
+From: Fedora GDB patches <invalid(a)email.com>
+Date: Fri, 27 Oct 2017 21:07:50 +0200
+Subject: gdb-6.6-buildid-locate-rpm-librpm-workaround.patch
+
+FileName: gdb-6.6-buildid-locate-rpm-librpm-workaround.patch
+
+;; Workaround librpm BZ 643031 due to its unexpected exit() calls (BZ 642879).
+;;=push+jan
+---
+ gdb/build-id.c | 13 +++++++++++++
+ gdb/proc-service.list | 3 +++
+ 2 files changed, 16 insertions(+)
+
+diff --git a/gdb/build-id.c b/gdb/build-id.c
+index d60cf622dc..409a5b8c54 100644
+--- a/gdb/build-id.c
++++ b/gdb/build-id.c
+@@ -678,6 +678,19 @@ build_id_to_filename (const struct bfd_build_id *build_id, char **link_return)
#include <dlfcn.h>
#endif
@@ -34,3 +36,18 @@ Index: gdb-7.6.90.20140127/gdb/build-id.c
/* This MISSING_RPM_HASH tracker is used to collect all the missing rpm files
and avoid their duplicities during a single inferior run. */
+diff --git a/gdb/proc-service.list b/gdb/proc-service.list
+index 53f7ed8b1e..323f5e83c2 100644
+--- a/gdb/proc-service.list
++++ b/gdb/proc-service.list
+@@ -37,4 +37,7 @@
+ ps_pstop;
+ ps_ptread;
+ ps_ptwrite;
++
++ /* gdb-6.6-buildid-locate-rpm.patch */
++ rpmsqEnable;
+ };
+--
+2.14.3
+
diff --git a/gdb-6.6-buildid-locate-rpm-scl.patch b/gdb-6.6-buildid-locate-rpm-scl.patch
index f2f605d..9d76821 100644
--- a/gdb-6.6-buildid-locate-rpm-scl.patch
+++ b/gdb-6.6-buildid-locate-rpm-scl.patch
@@ -1,10 +1,25 @@
+From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
+From: Fedora GDB patches <invalid(a)email.com>
+Date: Fri, 27 Oct 2017 21:07:50 +0200
+Subject: gdb-6.6-buildid-locate-rpm-scl.patch
+
+FileName: gdb-6.6-buildid-locate-rpm-scl.patch
+
+;; [SCL] Skip deprecated .gdb_index warning for Red Hat built files (BZ 953585).
+;;=push+jan
+
warning: Skipping deprecated .gdb_index section
https://bugzilla.redhat.com/show_bug.cgi?id=953585
+---
+ gdb/build-id.c | 54 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
+ gdb/dwarf2read.c | 14 ++++++++++++++
+ 2 files changed, 68 insertions(+)
-diff -dup -rup gdb-7.10.50.20160106-orig/gdb/build-id.c gdb-7.10.50.20160106/gdb/build-id.c
---- gdb-7.10.50.20160106-orig/gdb/build-id.c 2016-01-09 14:40:39.420385241 +0100
-+++ gdb-7.10.50.20160106/gdb/build-id.c 2016-01-09 14:41:05.944549393 +0100
-@@ -713,7 +713,11 @@ static int missing_rpm_list_entries;
+diff --git a/gdb/build-id.c b/gdb/build-id.c
+index e2c1e81266..1b75530f91 100644
+--- a/gdb/build-id.c
++++ b/gdb/build-id.c
+@@ -715,7 +715,11 @@ static int missing_rpm_list_entries;
/* Returns the count of newly added rpms. */
static int
@@ -16,7 +31,7 @@ diff -dup -rup gdb-7.10.50.20160106-orig/gdb/build-id.c gdb-7.10.50.20160106/gdb
{
static int rpm_init_done = 0;
rpmts ts;
-@@ -817,7 +821,11 @@ missing_rpm_enlist (const char *filename
+@@ -822,7 +826,11 @@ missing_rpm_enlist (const char *filename)
mi = rpmtsInitIterator_p (ts, RPMTAG_BASENAMES, filename, 0);
if (mi != NULL)
{
@@ -28,7 +43,7 @@ diff -dup -rup gdb-7.10.50.20160106-orig/gdb/build-id.c gdb-7.10.50.20160106/gdb
{
Header h;
char *debuginfo, **slot, *s, *s2;
-@@ -935,6 +943,37 @@ missing_rpm_enlist (const char *filename
+@@ -940,6 +948,37 @@ missing_rpm_enlist (const char *filename)
xfree (debuginfo);
count++;
}
@@ -66,7 +81,7 @@ diff -dup -rup gdb-7.10.50.20160106-orig/gdb/build-id.c gdb-7.10.50.20160106/gdb
rpmdbFreeIterator_p (mi);
}
-@@ -945,6 +984,21 @@ missing_rpm_enlist (const char *filename
+@@ -950,6 +989,21 @@ missing_rpm_enlist (const char *filename)
}
static int
@@ -88,10 +103,11 @@ diff -dup -rup gdb-7.10.50.20160106-orig/gdb/build-id.c gdb-7.10.50.20160106/gdb
missing_rpm_list_compar (const char *const *ap, const char *const *bp)
{
return strcoll (*ap, *bp);
-diff -dup -rup gdb-7.10.50.20160106-orig/gdb/dwarf2read.c gdb-7.10.50.20160106/gdb/dwarf2read.c
---- gdb-7.10.50.20160106-orig/gdb/dwarf2read.c 2016-01-09 14:40:39.416385216 +0100
-+++ gdb-7.10.50.20160106/gdb/dwarf2read.c 2016-01-09 14:41:05.942549381 +0100
-@@ -3111,6 +3111,16 @@ read_index_from_section (struct objfile
+diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c
+index ebded1753f..ba3bed6c63 100644
+--- a/gdb/dwarf2read.c
++++ b/gdb/dwarf2read.c
+@@ -3725,6 +3725,16 @@ read_index_from_section (struct objfile *objfile,
"set use-deprecated-index-sections on". */
if (version < 6 && !deprecated_ok)
{
@@ -108,7 +124,7 @@ diff -dup -rup gdb-7.10.50.20160106-orig/gdb/dwarf2read.c gdb-7.10.50.20160106/g
static int warning_printed = 0;
if (!warning_printed)
{
-@@ -3122,6 +3132,10 @@ to use the section anyway."),
+@@ -3736,6 +3746,10 @@ to use the section anyway."),
warning_printed = 1;
}
return 0;
@@ -119,3 +135,6 @@ diff -dup -rup gdb-7.10.50.20160106-orig/gdb/dwarf2read.c gdb-7.10.50.20160106/g
}
/* Version 7 indices generated by gold refer to the CU for a symbol instead
of the TU (for symbols coming from TUs),
+--
+2.14.3
+
diff --git a/gdb-6.6-buildid-locate-solib-missing-ids.patch b/gdb-6.6-buildid-locate-solib-missing-ids.patch
deleted file mode 100644
index f4dccc9..0000000
--- a/gdb-6.6-buildid-locate-solib-missing-ids.patch
+++ /dev/null
@@ -1,222 +0,0 @@
-gdb returns an incorrect back trace when applying a debuginfo
-https://bugzilla.redhat.com/show_bug.cgi?id=1339862
-
-Index: gdb-7.9.90.20150709/gdb/solib-svr4.c
-===================================================================
---- gdb-7.9.90.20150709.orig/gdb/solib-svr4.c 2015-07-09 18:18:54.526417766 +0200
-+++ gdb-7.9.90.20150709/gdb/solib-svr4.c 2015-07-09 18:19:33.074746586 +0200
-@@ -1381,14 +1381,27 @@ svr4_read_so_list (CORE_ADDR lm, CORE_AD
- }
-
- {
-- struct bfd_build_id *build_id;
-+ struct bfd_build_id *build_id = NULL;
-
- strncpy (newobj->so_original_name, buffer, SO_NAME_MAX_PATH_SIZE - 1);
- newobj->so_original_name[SO_NAME_MAX_PATH_SIZE - 1] = '\0';
- /* May get overwritten below. */
- strcpy (newobj->so_name, newobj->so_original_name);
-
-- build_id = build_id_addr_get (newobj->lm_info->l_ld);
-+ /* In the case the main executable was found according to its build-id
-+ (from a core file) prevent loading a different build of a library
-+ with accidentally the same SO_NAME.
-+
-+ It suppresses bogus backtraces (and prints "??" there instead) if
-+ the on-disk files no longer match the running program version.
-+
-+ If the main executable was not loaded according to its build-id do
-+ not do any build-id checking of the libraries. There may be missing
-+ build-ids dumped in the core file and we would map all the libraries
-+ to the only existing file loaded that time - the executable. */
-+ if (symfile_objfile != NULL
-+ && (symfile_objfile->flags & OBJF_BUILD_ID_CORE_LOADED) != 0)
-+ build_id = build_id_addr_get (newobj->lm_info->l_ld);
- if (build_id != NULL)
- {
- char *name, *build_id_filename;
-@@ -1403,23 +1416,7 @@ svr4_read_so_list (CORE_ADDR lm, CORE_AD
- xfree (name);
- }
- else
-- {
-- debug_print_missing (newobj->so_name, build_id_filename);
--
-- /* In the case the main executable was found according to
-- its build-id (from a core file) prevent loading
-- a different build of a library with accidentally the
-- same SO_NAME.
--
-- It suppresses bogus backtraces (and prints "??" there
-- instead) if the on-disk files no longer match the
-- running program version. */
--
-- if (symfile_objfile != NULL
-- && (symfile_objfile->flags
-- & OBJF_BUILD_ID_CORE_LOADED) != 0)
-- newobj->so_name[0] = 0;
-- }
-+ debug_print_missing (newobj->so_name, build_id_filename);
-
- xfree (build_id_filename);
- xfree (build_id);
---- /dev/null 2016-07-02 20:29:01.679404943 +0200
-+++ gdb-7.11.50.20160721/gdb/testsuite/gdb.base/gcore-buildid-exec-but-not-solib.exp 2016-07-31 23:04:49.062753722 +0200
-@@ -0,0 +1,105 @@
-+# Copyright 2016 Free Software Foundation, Inc.
-+
-+# This program is free software; you can redistribute it and/or modify
-+# it under the terms of the GNU General Public License as published by
-+# the Free Software Foundation; either version 3 of the License, or
-+# (at your option) any later version.
-+#
-+# This program is distributed in the hope that it will be useful,
-+# but WITHOUT ANY WARRANTY; without even the implied warranty of
-+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+# GNU General Public License for more details.
-+#
-+# You should have received a copy of the GNU General Public License
-+# along with this program. If not, see <http://www.gnu.org/licenses/>.
-+
-+if {[skip_shlib_tests]} {
-+ return 0
-+}
-+
-+set testfile "gcore-buildid-exec-but-not-solib"
-+set srcmainfile ${testfile}-main.c
-+set srclibfile ${testfile}-lib.c
-+set libfile [standard_output_file ${testfile}-lib.so]
-+set objfile [standard_output_file ${testfile}-main.o]
-+set executable ${testfile}-main
-+set binfile [standard_output_file ${executable}]
-+set gcorefile [standard_output_file ${executable}.gcore]
-+set outdir [file dirname $binfile]
-+
-+if { [gdb_compile_shlib ${srcdir}/${subdir}/${srclibfile} ${libfile} "debug additional_flags=-Wl,--build-id"] != ""
-+ || [gdb_compile ${srcdir}/${subdir}/${srcmainfile} ${objfile} object {debug}] != "" } {
-+ unsupported "-Wl,--build-id compilation failed"
-+ return -1
-+}
-+set opts [list debug shlib=${libfile} "additional_flags=-Wl,--build-id"]
-+if { [gdb_compile ${objfile} ${binfile} executable $opts] != "" } {
-+ unsupported "-Wl,--build-id compilation failed"
-+ return -1
-+}
-+
-+clean_restart $executable
-+gdb_load_shlib $libfile
-+
-+# Does this gdb support gcore?
-+set test "help gcore"
-+gdb_test_multiple $test $test {
-+ -re "Undefined command: .gcore.*\r\n$gdb_prompt $" {
-+ # gcore command not supported -- nothing to test here.
-+ unsupported "gdb does not support gcore on this target"
-+ return -1;
-+ }
-+ -re "Save a core file .*\r\n$gdb_prompt $" {
-+ pass $test
-+ }
-+}
-+
-+if { ![runto lib] } then {
-+ return -1
-+}
-+
-+set escapedfilename [string_to_regexp ${gcorefile}]
-+
-+set test "save a corefile"
-+gdb_test_multiple "gcore ${gcorefile}" $test {
-+ -re "Saved corefile ${escapedfilename}\r\n$gdb_prompt $" {
-+ pass $test
-+ }
-+ -re "Can't create a corefile\r\n$gdb_prompt $" {
-+ unsupported $test
-+ return -1
-+ }
-+}
-+
-+# Now restart gdb and load the corefile.
-+
-+clean_restart $executable
-+gdb_load_shlib $libfile
-+
-+set buildid [build_id_debug_filename_get $libfile]
-+
-+regsub {\.debug$} $buildid {} buildid
-+
-+set debugdir [standard_output_file ${testfile}-debugdir]
-+file delete -force -- $debugdir
-+
-+file mkdir $debugdir/[file dirname $libfile]
-+file copy $libfile $debugdir/${libfile}
-+
-+file mkdir $debugdir/[file dirname $buildid]
-+file copy $libfile $debugdir/${buildid}
-+
-+remote_exec build "ln -s /lib ${debugdir}/"
-+remote_exec build "ln -s /lib64 ${debugdir}/"
-+# /usr is not needed, all the libs are in /lib64: libm.so.6 libc.so.6 ld-linux-x86-64.so.2
-+
-+gdb_test "set solib-absolute-prefix $debugdir"
-+
-+gdb_test_no_output "set debug-file-directory $debugdir" "set debug-file-directory"
-+
-+gdb_test "core ${gcorefile}" "Core was generated by .*" "re-load generated corefile"
-+
-+gdb_test "frame" "#0 \[^\r\n\]* lib .*" "library got loaded"
-+
-+gdb_test "bt"
-+gdb_test "info shared"
---- /dev/null 2016-07-02 20:29:01.679404943 +0200
-+++ gdb-7.11.50.20160721/gdb/testsuite/gdb.base/gcore-buildid-exec-but-not-solib-main.c 2016-07-28 21:06:40.977786922 +0200
-@@ -0,0 +1,25 @@
-+/* Copyright 2010 Free Software Foundation, Inc.
-+
-+ This file is part of GDB.
-+
-+ This program is free software; you can redistribute it and/or modify
-+ it under the terms of the GNU General Public License as published by
-+ the Free Software Foundation; either version 3 of the License, or
-+ (at your option) any later version.
-+
-+ This program is distributed in the hope that it will be useful,
-+ but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ GNU General Public License for more details.
-+
-+ You should have received a copy of the GNU General Public License
-+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
-+
-+extern void lib (void);
-+
-+int
-+main (void)
-+{
-+ lib ();
-+ return 0;
-+}
---- /dev/null 2016-07-02 20:29:01.679404943 +0200
-+++ gdb-7.11.50.20160721/gdb/testsuite/gdb.base/gcore-buildid-exec-but-not-solib-lib.c 2016-07-28 21:06:40.977786922 +0200
-@@ -0,0 +1,21 @@
-+/* Copyright 2010 Free Software Foundation, Inc.
-+
-+ This file is part of GDB.
-+
-+ This program is free software; you can redistribute it and/or modify
-+ it under the terms of the GNU General Public License as published by
-+ the Free Software Foundation; either version 3 of the License, or
-+ (at your option) any later version.
-+
-+ This program is distributed in the hope that it will be useful,
-+ but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ GNU General Public License for more details.
-+
-+ You should have received a copy of the GNU General Public License
-+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
-+
-+void
-+lib (void)
-+{
-+}
diff --git a/gdb-6.6-bz235197-fork-detach-info.patch b/gdb-6.6-bz235197-fork-detach-info.patch
index 660fa74..57971e8 100644
--- a/gdb-6.6-bz235197-fork-detach-info.patch
+++ b/gdb-6.6-bz235197-fork-detach-info.patch
@@ -1,12 +1,66 @@
+From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
+From: Jan Kratochvil <jan.kratochvil(a)redhat.com>
+Date: Fri, 27 Oct 2017 21:07:50 +0200
+Subject: gdb-6.6-bz235197-fork-detach-info.patch
+
+FileName: gdb-6.6-bz235197-fork-detach-info.patch
+
+;; Notify user of a child forked process being detached (BZ 235197).
+;;=push+jan: This is more about discussion if/what should be printed.
+
2008-03-01 Jan Kratochvil <jan.kratochvil(a)redhat.com>
Port to GDB-6.8pre.
Remove the `[' character from the GDB-6.8 default message.
+---
+ gdb/infrun.c | 2 +-
+ gdb/testsuite/gdb.base/catch-syscall.exp | 4 +--
+ gdb/testsuite/gdb.base/fork-detach.c | 57 ++++++++++++++++++++++++++++++++
+ gdb/testsuite/gdb.base/fork-detach.exp | 36 ++++++++++++++++++++
+ 4 files changed, 96 insertions(+), 3 deletions(-)
+ create mode 100644 gdb/testsuite/gdb.base/fork-detach.c
+ create mode 100644 gdb/testsuite/gdb.base/fork-detach.exp
-Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.base/fork-detach.c
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ gdb-7.10.90.20160211/gdb/testsuite/gdb.base/fork-detach.c 2016-02-15 23:25:36.686600598 +0100
+diff --git a/gdb/infrun.c b/gdb/infrun.c
+index 7e8d8da588..13d0fd2ad9 100644
+--- a/gdb/infrun.c
++++ b/gdb/infrun.c
+@@ -461,7 +461,7 @@ holding the child stopped. Try \"set detach-on-fork\" or \
+ remove_breakpoints_pid (ptid_get_pid (inferior_ptid));
+ }
+
+- if (info_verbose || debug_infrun)
++ if (1 /* Fedora Bug 235197 */ || info_verbose || debug_infrun)
+ {
+ /* Ensure that we have a process ptid. */
+ ptid_t process_ptid = pid_to_ptid (ptid_get_pid (child_ptid));
+diff --git a/gdb/testsuite/gdb.base/catch-syscall.exp b/gdb/testsuite/gdb.base/catch-syscall.exp
+index 2a8bf27e5c..20fa041155 100644
+--- a/gdb/testsuite/gdb.base/catch-syscall.exp
++++ b/gdb/testsuite/gdb.base/catch-syscall.exp
+@@ -179,7 +179,7 @@ proc check_for_program_end {} {
+ # Deleting the catchpoints
+ delete_breakpoints
+
+- gdb_continue_to_end
++ gdb_continue_to_end "" continue 1
+ }
+
+ proc test_catch_syscall_without_args {} {
+@@ -250,7 +250,7 @@ proc test_catch_syscall_with_wrong_args {} {
+ # If it doesn't, everything is right (since we don't have
+ # a syscall named "mlock" in it). Otherwise, this is a failure.
+ set thistest "catch syscall with unused syscall ($syscall_name)"
+- gdb_continue_to_end $thistest
++ gdb_continue_to_end $thistest continue 1
+ }
+ }
+
+diff --git a/gdb/testsuite/gdb.base/fork-detach.c b/gdb/testsuite/gdb.base/fork-detach.c
+new file mode 100644
+index 0000000000..0ba8f465f3
+--- /dev/null
++++ b/gdb/testsuite/gdb.base/fork-detach.c
@@ -0,0 +1,57 @@
+/* This testcase is part of GDB, the GNU debugger.
+
@@ -65,10 +119,11 @@ Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.base/fork-detach.c
+ }
+ return 0;
+}
-Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.base/fork-detach.exp
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ gdb-7.10.90.20160211/gdb/testsuite/gdb.base/fork-detach.exp 2016-02-15 23:27:55.792588265 +0100
+diff --git a/gdb/testsuite/gdb.base/fork-detach.exp b/gdb/testsuite/gdb.base/fork-detach.exp
+new file mode 100644
+index 0000000000..1f1fcef6c4
+--- /dev/null
++++ b/gdb/testsuite/gdb.base/fork-detach.exp
@@ -0,0 +1,36 @@
+# Copyright 2007 Free Software Foundation, Inc.
+
@@ -106,38 +161,6 @@ Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.base/fork-detach.exp
+gdb_test "" \
+ "Detaching after fork from child process.*\\\[Inferior .* exited normally\\\]" \
+ "Info message caught"
-Index: gdb-7.10.90.20160211/gdb/infrun.c
-===================================================================
---- gdb-7.10.90.20160211.orig/gdb/infrun.c 2016-02-15 23:25:01.432350289 +0100
-+++ gdb-7.10.90.20160211/gdb/infrun.c 2016-02-15 23:27:49.274541986 +0100
-@@ -478,7 +478,7 @@
- remove_breakpoints_pid (ptid_get_pid (inferior_ptid));
- }
-
-- if (info_verbose || debug_infrun)
-+ if (1 /* Fedora Bug 235197 */ || info_verbose || debug_infrun)
- {
- /* Ensure that we have a process ptid. */
- ptid_t process_ptid = pid_to_ptid (ptid_get_pid (child_ptid));
-Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.base/catch-syscall.exp
-===================================================================
---- gdb-7.10.90.20160211.orig/gdb/testsuite/gdb.base/catch-syscall.exp 2016-02-15 23:25:01.432350289 +0100
-+++ gdb-7.10.90.20160211/gdb/testsuite/gdb.base/catch-syscall.exp 2016-02-15 23:25:36.689600619 +0100
-@@ -165,7 +165,7 @@
- # Deleting the catchpoints
- delete_breakpoints
-
-- gdb_continue_to_end
-+ gdb_continue_to_end "" continue 1
- }
-
- proc test_catch_syscall_without_args {} {
-@@ -236,7 +236,7 @@
- # If it doesn't, everything is right (since we don't have
- # a syscall named "mlock" in it). Otherwise, this is a failure.
- set thistest "catch syscall with unused syscall ($syscall_name)"
-- gdb_continue_to_end $thistest
-+ gdb_continue_to_end $thistest continue 1
- }
- }
-
+--
+2.14.3
+
diff --git a/gdb-6.6-scheduler_locking-step-is-default.patch b/gdb-6.6-scheduler_locking-step-is-default.patch
index ad9f643..6cb23ab 100644
--- a/gdb-6.6-scheduler_locking-step-is-default.patch
+++ b/gdb-6.6-scheduler_locking-step-is-default.patch
@@ -1,8 +1,25 @@
-Index: gdb-7.12.50.20170207/gdb/infrun.c
-===================================================================
---- gdb-7.12.50.20170207.orig/gdb/infrun.c 2017-02-07 21:07:40.321202448 +0100
-+++ gdb-7.12.50.20170207/gdb/infrun.c 2017-02-07 21:07:42.680220365 +0100
-@@ -2218,7 +2218,7 @@
+From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
+From: Fedora GDB patches <invalid(a)email.com>
+Date: Fri, 27 Oct 2017 21:07:50 +0200
+Subject: gdb-6.6-scheduler_locking-step-is-default.patch
+
+FileName: gdb-6.6-scheduler_locking-step-is-default.patch
+
+;; Make upstream `set scheduler-locking step' as default.
+;;=push+jan: How much is scheduler-locking relevant after non-stop?
+---
+ gdb/infrun.c | 2 +-
+ gdb/testsuite/gdb.mi/mi-cli.exp | 2 +-
+ gdb/testsuite/gdb.mi/mi-console.exp | 3 +++
+ gdb/testsuite/gdb.mi/mi-logging.exp | 4 ++--
+ gdb/testsuite/gdb.opt/inline-cmds.exp | 2 +-
+ 5 files changed, 8 insertions(+), 5 deletions(-)
+
+diff --git a/gdb/infrun.c b/gdb/infrun.c
+index 13d0fd2ad9..8e30aed3b8 100644
+--- a/gdb/infrun.c
++++ b/gdb/infrun.c
+@@ -2202,7 +2202,7 @@ static const char *const scheduler_enums[] = {
schedlock_replay,
NULL
};
@@ -11,11 +28,11 @@ Index: gdb-7.12.50.20170207/gdb/infrun.c
static void
show_scheduler_mode (struct ui_file *file, int from_tty,
struct cmd_list_element *c, const char *value)
-Index: gdb-7.12.50.20170207/gdb/testsuite/gdb.mi/mi-cli.exp
-===================================================================
---- gdb-7.12.50.20170207.orig/gdb/testsuite/gdb.mi/mi-cli.exp 2017-02-07 21:07:40.322202455 +0100
-+++ gdb-7.12.50.20170207/gdb/testsuite/gdb.mi/mi-cli.exp 2017-02-07 21:07:42.680220365 +0100
-@@ -199,7 +199,7 @@
+diff --git a/gdb/testsuite/gdb.mi/mi-cli.exp b/gdb/testsuite/gdb.mi/mi-cli.exp
+index 6ce6439eb7..4f405b5fc1 100644
+--- a/gdb/testsuite/gdb.mi/mi-cli.exp
++++ b/gdb/testsuite/gdb.mi/mi-cli.exp
+@@ -199,7 +199,7 @@ mi_expect_stop "breakpoint-hit" "main" "" ".*basics.c" \
# Test that the token is output even for CLI commands
# Also test that *stopped includes frame information.
mi_gdb_test "34 next" \
@@ -24,11 +41,25 @@ Index: gdb-7.12.50.20170207/gdb/testsuite/gdb.mi/mi-cli.exp
"34 next: run"
# Test that the new current source line is output to the console
-Index: gdb-7.12.50.20170207/gdb/testsuite/gdb.mi/mi-logging.exp
-===================================================================
---- gdb-7.12.50.20170207.orig/gdb/testsuite/gdb.mi/mi-logging.exp 2017-02-07 21:07:42.681220372 +0100
-+++ gdb-7.12.50.20170207/gdb/testsuite/gdb.mi/mi-logging.exp 2017-02-07 21:09:36.950088269 +0100
-@@ -53,7 +53,7 @@
+diff --git a/gdb/testsuite/gdb.mi/mi-console.exp b/gdb/testsuite/gdb.mi/mi-console.exp
+index ec4b006018..05cf7fb889 100644
+--- a/gdb/testsuite/gdb.mi/mi-console.exp
++++ b/gdb/testsuite/gdb.mi/mi-console.exp
+@@ -60,6 +60,9 @@ if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {deb
+
+ mi_run_to_main
+
++# thread-id=\"all\" vs. thread-id=\"1\" below:
++mi_gdb_test "210-gdb-set scheduler-locking off" "210\\^done" "set scheduler-locking off"
++
+ # The output we get from the target depends on how it is hosted. If
+ # we are semihosted (e.g., the sim or a remote target that supports
+ # the File I/O remote protocol extension), we see the target I/O
+diff --git a/gdb/testsuite/gdb.mi/mi-logging.exp b/gdb/testsuite/gdb.mi/mi-logging.exp
+index b09cde2d37..e51d46edb5 100644
+--- a/gdb/testsuite/gdb.mi/mi-logging.exp
++++ b/gdb/testsuite/gdb.mi/mi-logging.exp
+@@ -53,7 +53,7 @@ close $chan
set mi_log_prompt "\[(\]gdb\[)\] \[\r\n\]+"
@@ -37,7 +68,7 @@ Index: gdb-7.12.50.20170207/gdb/testsuite/gdb.mi/mi-logging.exp
pass "log file contents"
} else {
fail "log file contents"
-@@ -76,7 +76,7 @@
+@@ -76,7 +76,7 @@ set chan [open $milogfile]
set logcontent [read $chan]
close $chan
@@ -46,25 +77,11 @@ Index: gdb-7.12.50.20170207/gdb/testsuite/gdb.mi/mi-logging.exp
pass "redirect log file contents"
} else {
fail "redirect log file contents"
-Index: gdb-7.12.50.20170207/gdb/testsuite/gdb.mi/mi-console.exp
-===================================================================
---- gdb-7.12.50.20170207.orig/gdb/testsuite/gdb.mi/mi-console.exp 2017-02-07 21:07:40.323202463 +0100
-+++ gdb-7.12.50.20170207/gdb/testsuite/gdb.mi/mi-console.exp 2017-02-07 21:07:42.681220372 +0100
-@@ -60,6 +60,9 @@
-
- mi_run_to_main
-
-+# thread-id=\"all\" vs. thread-id=\"1\" below:
-+mi_gdb_test "210-gdb-set scheduler-locking off" "210\\^done" "set scheduler-locking off"
-+
- # The output we get from the target depends on how it is hosted. If
- # we are semihosted (e.g., the sim or a remote target that supports
- # the File I/O remote protocol extension), we see the target I/O
-Index: gdb-7.12.50.20170207/gdb/testsuite/gdb.opt/inline-cmds.exp
-===================================================================
---- gdb-7.12.50.20170207.orig/gdb/testsuite/gdb.opt/inline-cmds.exp 2017-02-07 21:07:40.323202463 +0100
-+++ gdb-7.12.50.20170207/gdb/testsuite/gdb.opt/inline-cmds.exp 2017-02-07 21:07:42.681220372 +0100
-@@ -331,7 +331,7 @@
+diff --git a/gdb/testsuite/gdb.opt/inline-cmds.exp b/gdb/testsuite/gdb.opt/inline-cmds.exp
+index 5227d63f5d..782f31c080 100644
+--- a/gdb/testsuite/gdb.opt/inline-cmds.exp
++++ b/gdb/testsuite/gdb.opt/inline-cmds.exp
+@@ -331,7 +331,7 @@ proc mi_cli_step {cli_output_re message} {
send_gdb "interpreter-exec console \"step\"\n"
gdb_expect {
@@ -73,3 +90,6 @@ Index: gdb-7.12.50.20170207/gdb/testsuite/gdb.opt/inline-cmds.exp
pass $message
}
timeout {
+--
+2.14.3
+
diff --git a/gdb-6.8-bz436037-reg-no-longer-active.patch b/gdb-6.8-bz436037-reg-no-longer-active.patch
new file mode 100644
index 0000000..177e024
--- /dev/null
+++ b/gdb-6.8-bz436037-reg-no-longer-active.patch
@@ -0,0 +1,46 @@
+From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
+From: Fedora GDB patches <invalid(a)email.com>
+Date: Fri, 27 Oct 2017 21:07:50 +0200
+Subject: gdb-6.8-bz436037-reg-no-longer-active.patch
+
+FileName: gdb-6.8-bz436037-reg-no-longer-active.patch
+
+;; Fix register assignments with no GDB stack frames (BZ 436037).
+;;=push+jan: This fix is incorrect.
+---
+ gdb/valops.c | 12 ++++++++++--
+ 1 file changed, 10 insertions(+), 2 deletions(-)
+
+diff --git a/gdb/valops.c b/gdb/valops.c
+index 9b25980090..7aacd17d70 100644
+--- a/gdb/valops.c
++++ b/gdb/valops.c
+@@ -1103,6 +1103,8 @@ value_assign (struct value *toval, struct value *fromval)
+ struct gdbarch *gdbarch;
+ int value_reg;
+
++ value_reg = VALUE_REGNUM (toval);
++
+ /* Figure out which frame this is in currently.
+
+ We use VALUE_FRAME_ID for obtaining the value's frame id instead of
+@@ -1112,8 +1114,14 @@ value_assign (struct value *toval, struct value *fromval)
+ frame. */
+ frame = frame_find_by_id (VALUE_FRAME_ID (toval));
+
+- value_reg = VALUE_REGNUM (toval);
+-
++ /* "set $reg+=1" should work on programs with no debug info,
++ but frame_find_by_id returns NULL here (RH bug 436037).
++ Use current frame, it represents CPU state in this case.
++ If frame_find_by_id is changed to do it internally
++ (it is contemplated there), remove this. */
++ if (!frame)
++ frame = get_current_frame ();
++ /* Probably never happens. */
+ if (!frame)
+ error (_("Value being assigned to is no longer active."));
+
+--
+2.14.3
+
diff --git a/gdb-6.8-quit-never-aborts.patch b/gdb-6.8-quit-never-aborts.patch
deleted file mode 100644
index 0dc71b8..0000000
--- a/gdb-6.8-quit-never-aborts.patch
+++ /dev/null
@@ -1,74 +0,0 @@
-We may abort the process of detaching threads with multiple SIGINTs - which are
-being sent during a testcase terminating its child GDB.
-
-Some of the threads may not be properly PTRACE_DETACHed which hurts if they
-should have been detached with SIGSTOP (as they are accidentally left running
-on the debugger termination).
-
-Index: gdb-7.12.50.20170207/gdb/defs.h
-===================================================================
---- gdb-7.12.50.20170207.orig/gdb/defs.h 2017-02-26 21:11:35.654350580 +0100
-+++ gdb-7.12.50.20170207/gdb/defs.h 2017-02-26 21:11:52.932473129 +0100
-@@ -169,6 +169,10 @@
- /* Flag that function quit should call quit_force. */
- extern volatile int sync_quit_force_run;
-
-+#ifdef NEED_DETACH_SIGSTOP
-+extern int quit_flag_cleanup;
-+#endif
-+
- extern void quit (void);
-
- /* Helper for the QUIT macro. */
-Index: gdb-7.12.50.20170207/gdb/extension.c
-===================================================================
---- gdb-7.12.50.20170207.orig/gdb/extension.c 2017-02-26 21:11:35.655350587 +0100
-+++ gdb-7.12.50.20170207/gdb/extension.c 2017-02-26 21:11:52.933473136 +0100
-@@ -830,6 +830,11 @@
- int i, result = 0;
- const struct extension_language_defn *extlang;
-
-+#ifdef NEED_DETACH_SIGSTOP
-+ if (quit_flag_cleanup)
-+ return 0;
-+#endif
-+
- ALL_ENABLED_EXTENSION_LANGUAGES (i, extlang)
- {
- if (extlang->ops->check_quit_flag != NULL)
-Index: gdb-7.12.50.20170207/gdb/top.c
-===================================================================
---- gdb-7.12.50.20170207.orig/gdb/top.c 2017-02-26 21:11:35.655350587 +0100
-+++ gdb-7.12.50.20170207/gdb/top.c 2017-02-26 21:11:52.933473136 +0100
-@@ -1619,7 +1619,13 @@
- qt.args = NULL;
- qt.from_tty = from_tty;
-
-+#ifndef NEED_DETACH_SIGSTOP
- /* We want to handle any quit errors and exit regardless. */
-+#else
-+ /* We want to handle any quit errors and exit regardless but we should never
-+ get user-interrupted to properly detach the inferior. */
-+ quit_flag_cleanup = 1;
-+#endif
-
- /* Get out of tfind mode, and kill or detach all inferiors. */
- TRY
-Index: gdb-7.12.50.20170207/gdb/utils.c
-===================================================================
---- gdb-7.12.50.20170207.orig/gdb/utils.c 2017-02-26 21:11:35.657350601 +0100
-+++ gdb-7.12.50.20170207/gdb/utils.c 2017-02-26 21:11:52.934473143 +0100
-@@ -106,6 +106,13 @@
-
- int job_control;
-
-+#ifdef NEED_DETACH_SIGSTOP
-+/* Nonzero means we are already processing the quitting cleanups and we should
-+ no longer get aborted. */
-+
-+int quit_flag_cleanup;
-+#endif
-+
- /* Nonzero means that strings with character values >0x7F should be printed
- as octal escapes. Zero means just print the value (e.g. it's an
- international character, and the terminal or window can cope.) */
diff --git a/gdb-6.8-sparc64-silence-memcpy-check.patch b/gdb-6.8-sparc64-silence-memcpy-check.patch
index 6df8c9a..a150442 100644
--- a/gdb-6.8-sparc64-silence-memcpy-check.patch
+++ b/gdb-6.8-sparc64-silence-memcpy-check.patch
@@ -1,8 +1,21 @@
-Index: gdb-7.4.50.20111218/gdb/sparc-tdep.c
-===================================================================
---- gdb-7.4.50.20111218.orig/gdb/sparc-tdep.c 2011-09-28 19:59:42.000000000 +0200
-+++ gdb-7.4.50.20111218/gdb/sparc-tdep.c 2011-12-19 01:25:29.294046199 +0100
-@@ -1316,6 +1316,7 @@ sparc32_store_return_value (struct type
+From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
+From: Fedora GDB patches <invalid(a)email.com>
+Date: Fri, 27 Oct 2017 21:07:50 +0200
+Subject: gdb-6.8-sparc64-silence-memcpy-check.patch
+
+FileName: gdb-6.8-sparc64-silence-memcpy-check.patch
+
+;; Silence memcpy check which returns false positive (sparc64)
+;;=push: But it is just a GCC workaround, look up the existing GCC PR for it.
+---
+ gdb/sparc-tdep.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/gdb/sparc-tdep.c b/gdb/sparc-tdep.c
+index 12fd5b9e64..e304ba8dbc 100644
+--- a/gdb/sparc-tdep.c
++++ b/gdb/sparc-tdep.c
+@@ -1444,6 +1444,7 @@ sparc32_store_return_value (struct type *type, struct regcache *regcache,
if (sparc_floating_p (type) || sparc_complex_floating_p (type))
{
/* Floating return values. */
@@ -10,3 +23,6 @@ Index: gdb-7.4.50.20111218/gdb/sparc-tdep.c
memcpy (buf, valbuf, len);
regcache_cooked_write (regcache, SPARC_F0_REGNUM, buf);
if (len > 4)
+--
+2.14.3
+
diff --git a/gdb-7.2.50-sparc-add-workaround-to-broken-debug-files.patch b/gdb-7.2.50-sparc-add-workaround-to-broken-debug-files.patch
index 53ed2cb..cd64dc1 100644
--- a/gdb-7.2.50-sparc-add-workaround-to-broken-debug-files.patch
+++ b/gdb-7.2.50-sparc-add-workaround-to-broken-debug-files.patch
@@ -1,7 +1,30 @@
-Index: gdb-7.9.90.20150709/gdb/gdb_bfd.c
-===================================================================
---- gdb-7.9.90.20150709.orig/gdb/gdb_bfd.c 2015-07-09 18:23:59.344017882 +0200
-+++ gdb-7.9.90.20150709/gdb/gdb_bfd.c 2015-07-09 18:24:06.986083071 +0200
+From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
+From: Fedora GDB patches <invalid(a)email.com>
+Date: Fri, 27 Oct 2017 21:07:50 +0200
+Subject: gdb-7.2.50-sparc-add-workaround-to-broken-debug-files.patch
+
+FileName: gdb-7.2.50-sparc-add-workaround-to-broken-debug-files.patch
+
+;; Toolchain on sparc is slightly broken and debuginfo files are generated
+;; with non 64bit aligned tables/offsets.
+;; See for example readelf -S ../Xvnc.debug.
+;;
+;; As a consenquence calculation of sectp->filepos as used in
+;; dwarf2_read_section (gdb/dwarf2read.c:1525) will return a non aligned buffer
+;; that cannot be used directly as done with MMAP.
+;; Usage will result in a BusError.
+;;
+;; While we figure out what's wrong in the toolchain and do a full archive
+;; rebuild to fix it, we need to be able to use gdb :)
+;;=push
+---
+ gdb/gdb_bfd.c | 6 ++++++
+ 1 file changed, 6 insertions(+)
+
+diff --git a/gdb/gdb_bfd.c b/gdb/gdb_bfd.c
+index 80ddd427af..3e4d3e4444 100644
+--- a/gdb/gdb_bfd.c
++++ b/gdb/gdb_bfd.c
@@ -24,12 +24,14 @@
#include "hashtab.h"
#include "filestuff.h"
@@ -17,7 +40,7 @@ Index: gdb-7.9.90.20150709/gdb/gdb_bfd.c
#include "target.h"
#include "gdb/fileio.h"
#include "inferior.h"
-@@ -397,6 +399,7 @@ free_one_bfd_section (bfd *abfd, asectio
+@@ -484,6 +486,7 @@ free_one_bfd_section (bfd *abfd, asection *sectp, void *ignore)
if (sect != NULL && sect->data != NULL)
{
@@ -25,15 +48,15 @@ Index: gdb-7.9.90.20150709/gdb/gdb_bfd.c
#ifdef HAVE_MMAP
if (sect->map_addr != NULL)
{
-@@ -407,6 +410,7 @@ free_one_bfd_section (bfd *abfd, asectio
+@@ -493,6 +496,7 @@ free_one_bfd_section (bfd *abfd, asection *sectp, void *ignore)
+ gdb_assert (res == 0);
}
else
- #endif
+#endif
+ #endif
xfree (sect->data);
}
- }
-@@ -558,6 +562,7 @@ gdb_bfd_map_section (asection *sectp, bf
+@@ -659,6 +663,7 @@ gdb_bfd_map_section (asection *sectp, bfd_size_type *size)
if (descriptor->data != NULL)
goto done;
@@ -41,7 +64,7 @@ Index: gdb-7.9.90.20150709/gdb/gdb_bfd.c
#ifdef HAVE_MMAP
if (!bfd_is_section_compressed (abfd, sectp))
{
-@@ -592,6 +597,7 @@ gdb_bfd_map_section (asection *sectp, bf
+@@ -693,6 +698,7 @@ gdb_bfd_map_section (asection *sectp, bfd_size_type *size)
}
}
#endif /* HAVE_MMAP */
@@ -49,3 +72,6 @@ Index: gdb-7.9.90.20150709/gdb/gdb_bfd.c
/* Handle compressed sections, or ordinary uncompressed sections in
the no-mmap case. */
+--
+2.14.3
+
diff --git a/gdb-add-index-chmod.patch b/gdb-add-index-chmod.patch
deleted file mode 100644
index 00b37c4..0000000
--- a/gdb-add-index-chmod.patch
+++ /dev/null
@@ -1,69 +0,0 @@
-http://sourceware.org/ml/gdb-patches/2017-01/msg00110.html
-Subject: [patch] contrib/gdb-add-index.sh: chmod u+w
-
-
---AhhlLboLdkugWU4S
-Content-Type: text/plain; charset=us-ascii
-Content-Disposition: inline
-
-Hi,
-
-in Fedora 24 it still worked, in Fedora 25 it does not - *-debuginfo.rpm
-no longer have the .gdb_index accelerating section now.
-
-It happens because:
-objcopy: unable to copy file 'foo.debug'; reason: Permission denied
-
-*.debug files in Fedora were always 444 but the time gdb-add-index is run is
-still before the *.debug split and in Fedora 24 the files were -rwxr-xr-x
-that time while in Fedora 25 they are apparently no longer w.
-
-OK for check-in?
-
-
-Jan
-
---AhhlLboLdkugWU4S
-Content-Type: text/plain; charset=us-ascii
-Content-Disposition: inline; filename=1
-
-gdb/ChangeLog
-2017-01-06 Jan Kratochvil <jan.kratochvil(a)redhat.com>
-
- * contrib/gdb-add-index.sh: Use chmod u+w for $file.
-
-diff --git a/gdb/contrib/gdb-add-index.sh b/gdb/contrib/gdb-add-index.sh
-index 0cd4ce3..5a190a0 100755
---- a/gdb/contrib/gdb-add-index.sh
-+++ b/gdb/contrib/gdb-add-index.sh
-@@ -38,10 +38,11 @@ fi
- dir="${file%/*}"
- test "$dir" = "$file" && dir="."
- index="${file}.gdb-index"
-+mode="${file}.mode"
-
--rm -f $index
-+rm -f $index $mode
- # Ensure intermediate index file is removed when we exit.
--trap "rm -f $index" 0
-+trap "rm -f $index $mode" 0
-
- $GDB --batch -nx -iex 'set auto-load no' \
- -ex "file $file" -ex "save gdb-index $dir" || {
-@@ -58,8 +59,13 @@ $GDB --batch -nx -iex 'set auto-load no' \
- status=0
-
- if test -f "$index"; then
-+ touch "$mode"
-+ chmod --reference="$file" "$mode"
-+ # objcopy: unable to copy file 'foo.debug'; reason: Permission denied
-+ chmod u+w "$file"
- $OBJCOPY --add-section .gdb_index="$index" \
- --set-section-flags .gdb_index=readonly "$file" "$file"
-+ chmod --reference="$mode" "$file"
- status=$?
- else
- echo "$myname: No index was created for $file" 1>&2
-
---AhhlLboLdkugWU4S--
-
diff --git a/gdb-archer-pie-addons-keep-disabled.patch b/gdb-archer-pie-addons-keep-disabled.patch
new file mode 100644
index 0000000..bb5aa1f
--- /dev/null
+++ b/gdb-archer-pie-addons-keep-disabled.patch
@@ -0,0 +1,102 @@
+From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
+From: Fedora GDB patches <invalid(a)email.com>
+Date: Fri, 27 Oct 2017 21:07:50 +0200
+Subject: gdb-archer-pie-addons-keep-disabled.patch
+
+FileName: gdb-archer-pie-addons-keep-disabled.patch
+
+;;=push+jan: Breakpoints disabling matching should not be based on address.
+---
+ gdb/breakpoint.c | 44 ++++++++++++++++++++++++++++++++++++++++++++
+ gdb/breakpoint.h | 3 +++
+ gdb/objfiles.c | 5 +++++
+ 3 files changed, 52 insertions(+)
+
+diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c
+index 2b5eebbbee..814802a0a1 100644
+--- a/gdb/breakpoint.c
++++ b/gdb/breakpoint.c
+@@ -15590,6 +15590,50 @@ initialize_breakpoint_ops (void)
+
+ static struct cmd_list_element *enablebreaklist = NULL;
+
++void
++breakpoints_relocate (struct objfile *objfile, struct section_offsets *delta)
++{
++ struct bp_location *bl, **blp_tmp;
++ int changed = 0;
++
++ gdb_assert (objfile->separate_debug_objfile_backlink == NULL);
++
++ ALL_BP_LOCATIONS (bl, blp_tmp)
++ {
++ struct obj_section *osect;
++
++ /* BL->SECTION can be correctly NULL for breakpoints with multiple
++ locations expanded through symtab. */
++
++ ALL_OBJFILE_OSECTIONS (objfile, osect)
++ {
++ CORE_ADDR relocated_address;
++ CORE_ADDR delta_offset;
++
++ delta_offset = ANOFFSET (delta, osect->the_bfd_section->index);
++ if (delta_offset == 0)
++ continue;
++ relocated_address = bl->address + delta_offset;
++
++ if (obj_section_addr (osect) <= relocated_address
++ && relocated_address < obj_section_endaddr (osect))
++ {
++ if (bl->inserted)
++ remove_breakpoint (bl);
++
++ bl->address += delta_offset;
++ bl->requested_address += delta_offset;
++
++ changed = 1;
++ }
++ }
++ }
++
++ if (changed)
++ qsort (bp_locations, bp_locations_count, sizeof (*bp_locations),
++ bp_locations_compare);
++}
++
+ void
+ _initialize_breakpoint (void)
+ {
+diff --git a/gdb/breakpoint.h b/gdb/breakpoint.h
+index 8bb81d8d17..3fddbaa713 100644
+--- a/gdb/breakpoint.h
++++ b/gdb/breakpoint.h
+@@ -1656,6 +1656,9 @@ extern const char *ep_parse_optional_if_clause (const char **arg);
+ UIOUT iff debugging multiple threads. */
+ extern void maybe_print_thread_hit_breakpoint (struct ui_out *uiout);
+
++extern void breakpoints_relocate (struct objfile *objfile,
++ struct section_offsets *delta);
++
+ /* Print the specified breakpoint. */
+ extern void print_breakpoint (breakpoint *bp);
+
+diff --git a/gdb/objfiles.c b/gdb/objfiles.c
+index 7adaef119d..2f061b47f7 100644
+--- a/gdb/objfiles.c
++++ b/gdb/objfiles.c
+@@ -879,6 +879,11 @@ objfile_relocate1 (struct objfile *objfile,
+ obj_section_addr (s));
+ }
+
++ /* Final call of breakpoint_re_set can keep breakpoint locations disabled if
++ their addresses match. */
++ if (objfile->separate_debug_objfile_backlink == NULL)
++ breakpoints_relocate (objfile, delta);
++
+ /* Data changed. */
+ return 1;
+ }
+--
+2.14.3
+
diff --git a/gdb-archer-pie-addons.patch b/gdb-archer-pie-addons.patch
index 240b17e..8052547 100644
--- a/gdb-archer-pie-addons.patch
+++ b/gdb-archer-pie-addons.patch
@@ -1,8 +1,21 @@
-Index: gdb-7.9.50.20150520/gdb/gdbtypes.h
-===================================================================
---- gdb-7.9.50.20150520.orig/gdb/gdbtypes.h 2015-05-31 16:55:29.723475485 +0200
-+++ gdb-7.9.50.20150520/gdb/gdbtypes.h 2015-05-31 16:55:49.716601669 +0200
-@@ -462,6 +462,7 @@ enum field_loc_kind
+From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
+From: Fedora GDB patches <invalid(a)email.com>
+Date: Fri, 27 Oct 2017 21:07:50 +0200
+Subject: gdb-archer-pie-addons.patch
+
+FileName: gdb-archer-pie-addons.patch
+
+;;=push+jan: May get obsoleted by Tom's unrelocated objfiles patch.
+---
+ gdb/gdbtypes.h | 5 +++++
+ gdb/value.c | 3 ++-
+ 2 files changed, 7 insertions(+), 1 deletion(-)
+
+diff --git a/gdb/gdbtypes.h b/gdb/gdbtypes.h
+index 923ba101ca..9703d966a7 100644
+--- a/gdb/gdbtypes.h
++++ b/gdb/gdbtypes.h
+@@ -443,6 +443,7 @@ enum field_loc_kind
{
FIELD_LOC_KIND_BITPOS, /**< bitpos */
FIELD_LOC_KIND_ENUMVAL, /**< enumval */
@@ -10,7 +23,7 @@ Index: gdb-7.9.50.20150520/gdb/gdbtypes.h
FIELD_LOC_KIND_PHYSADDR, /**< physaddr */
FIELD_LOC_KIND_PHYSNAME, /**< physname */
FIELD_LOC_KIND_DWARF_BLOCK /**< dwarf_block */
-@@ -513,6 +514,7 @@ union field_location
+@@ -494,6 +495,7 @@ union field_location
field. Otherwise, physname is the mangled label of the
static field. */
@@ -18,7 +31,7 @@ Index: gdb-7.9.50.20150520/gdb/gdbtypes.h
CORE_ADDR physaddr;
const char *physname;
-@@ -1386,6 +1388,7 @@ extern void set_type_vptr_basetype (stru
+@@ -1342,6 +1344,7 @@ extern void set_type_vptr_basetype (struct type *, struct type *);
#define FIELD_ENUMVAL_LVAL(thisfld) ((thisfld).loc.enumval)
#define FIELD_ENUMVAL(thisfld) (FIELD_ENUMVAL_LVAL (thisfld) + 0)
#define FIELD_STATIC_PHYSNAME(thisfld) ((thisfld).loc.physname)
@@ -26,7 +39,7 @@ Index: gdb-7.9.50.20150520/gdb/gdbtypes.h
#define FIELD_STATIC_PHYSADDR(thisfld) ((thisfld).loc.physaddr)
#define FIELD_DWARF_BLOCK(thisfld) ((thisfld).loc.dwarf_block)
#define SET_FIELD_BITPOS(thisfld, bitpos) \
-@@ -1397,6 +1400,7 @@ extern void set_type_vptr_basetype (stru
+@@ -1353,6 +1356,7 @@ extern void set_type_vptr_basetype (struct type *, struct type *);
#define SET_FIELD_PHYSNAME(thisfld, name) \
(FIELD_LOC_KIND (thisfld) = FIELD_LOC_KIND_PHYSNAME, \
FIELD_STATIC_PHYSNAME (thisfld) = (name))
@@ -34,7 +47,7 @@ Index: gdb-7.9.50.20150520/gdb/gdbtypes.h
#define SET_FIELD_PHYSADDR(thisfld, addr) \
(FIELD_LOC_KIND (thisfld) = FIELD_LOC_KIND_PHYSADDR, \
FIELD_STATIC_PHYSADDR (thisfld) = (addr))
-@@ -1413,6 +1417,7 @@ extern void set_type_vptr_basetype (stru
+@@ -1369,6 +1373,7 @@ extern void set_type_vptr_basetype (struct type *, struct type *);
#define TYPE_FIELD_BITPOS(thistype, n) FIELD_BITPOS (TYPE_FIELD (thistype, n))
#define TYPE_FIELD_ENUMVAL(thistype, n) FIELD_ENUMVAL (TYPE_FIELD (thistype, n))
#define TYPE_FIELD_STATIC_PHYSNAME(thistype, n) FIELD_STATIC_PHYSNAME (TYPE_FIELD (thistype, n))
@@ -42,11 +55,11 @@ Index: gdb-7.9.50.20150520/gdb/gdbtypes.h
#define TYPE_FIELD_STATIC_PHYSADDR(thistype, n) FIELD_STATIC_PHYSADDR (TYPE_FIELD (thistype, n))
#define TYPE_FIELD_DWARF_BLOCK(thistype, n) FIELD_DWARF_BLOCK (TYPE_FIELD (thistype, n))
#define TYPE_FIELD_ARTIFICIAL(thistype, n) FIELD_ARTIFICIAL(TYPE_FIELD(thistype,n))
-Index: gdb-7.9.50.20150520/gdb/value.c
-===================================================================
---- gdb-7.9.50.20150520.orig/gdb/value.c 2015-05-31 16:55:29.725475497 +0200
-+++ gdb-7.9.50.20150520/gdb/value.c 2015-05-31 16:55:30.821482415 +0200
-@@ -2951,7 +2951,8 @@ value_static_field (struct type *type, i
+diff --git a/gdb/value.c b/gdb/value.c
+index d4b4673f66..558d0bbd7a 100644
+--- a/gdb/value.c
++++ b/gdb/value.c
+@@ -2966,7 +2966,8 @@ value_static_field (struct type *type, int fieldno)
{
case FIELD_LOC_KIND_PHYSADDR:
retval = value_at_lazy (TYPE_FIELD_TYPE (type, fieldno),
@@ -56,3 +69,6 @@ Index: gdb-7.9.50.20150520/gdb/value.c
break;
case FIELD_LOC_KIND_PHYSNAME:
{
+--
+2.14.3
+
diff --git a/gdb-archer-vla-tests.patch b/gdb-archer-vla-tests.patch
deleted file mode 100644
index 6c8a3a6..0000000
--- a/gdb-archer-vla-tests.patch
+++ /dev/null
@@ -1,3735 +0,0 @@
-Index: gdb-7.12.50.20170207/gdb/testsuite/gdb.ada/packed_array.exp
-===================================================================
---- gdb-7.12.50.20170207.orig/gdb/testsuite/gdb.ada/packed_array.exp 2017-02-26 19:15:28.552824751 +0100
-+++ gdb-7.12.50.20170207/gdb/testsuite/gdb.ada/packed_array.exp 2017-02-26 19:15:36.597882316 +0100
-@@ -56,5 +56,11 @@
- # are. Observed with (FSF GNU Ada 4.5.3 20110124).
- xfail $test
- }
-+ -re "= \\(\\)\[\r\n\]+$gdb_prompt $" {
-+ # archer-jankratochvil-vla resolves it as a dynamic type resolved as an
-+ # empty array [0..-1].
-+ # DW_AT_upper_bound : (DW_OP_fbreg: -48; DW_OP_deref)
-+ xfail $test
-+ }
- }
-
-Index: gdb-7.12.50.20170207/gdb/testsuite/gdb.arch/x86_64-vla-pointer-foo.S
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ gdb-7.12.50.20170207/gdb/testsuite/gdb.arch/x86_64-vla-pointer-foo.S 2017-02-26 19:15:36.598882323 +0100
-@@ -0,0 +1,358 @@
-+ .file "x86_64-vla-pointer.c"
-+ .text
-+.Ltext0:
-+ .globl foo
-+ .type foo, @function
-+foo:
-+.LFB0:
-+ .file 1 "gdb.arch/x86_64-vla-pointer.c"
-+ # gdb.arch/x86_64-vla-pointer.c:22
-+ .loc 1 22 0
-+ .cfi_startproc
-+# BLOCK 2 seq:0
-+# PRED: ENTRY (FALLTHRU)
-+ pushq %rbp
-+ .cfi_def_cfa_offset 16
-+ .cfi_offset 6, -16
-+ movq %rsp, %rbp
-+ .cfi_def_cfa_register 6
-+ pushq %rbx
-+ subq $56, %rsp
-+ .cfi_offset 3, -24
-+ movl %edi, -52(%rbp)
-+ # gdb.arch/x86_64-vla-pointer.c:22
-+ .loc 1 22 0
-+ movq %rsp, %rax
-+ movq %rax, %rsi
-+ # gdb.arch/x86_64-vla-pointer.c:23
-+ .loc 1 23 0
-+ movl -52(%rbp), %eax
-+ movslq %eax, %rdx
-+ subq $1, %rdx
-+ movq %rdx, -32(%rbp)
-+ movslq %eax, %rdx
-+ movq %rdx, %r8
-+ movl $0, %r9d
-+ # gdb.arch/x86_64-vla-pointer.c:24
-+ .loc 1 24 0
-+ movslq %eax, %rdx
-+ movq %rdx, %rcx
-+ movl $0, %ebx
-+ cltq
-+ movl $16, %edx
-+ subq $1, %rdx
-+ addq %rdx, %rax
-+ movl $16, %ebx
-+ movl $0, %edx
-+ divq %rbx
-+ imulq $16, %rax, %rax
-+ subq %rax, %rsp
-+ movq %rsp, %rax
-+ addq $0, %rax
-+ movq %rax, -40(%rbp)
-+ # gdb.arch/x86_64-vla-pointer.c:27
-+ .loc 1 27 0
-+ movl $0, -20(%rbp)
-+# SUCC: 4 [100.0%]
-+ jmp .L2
-+# BLOCK 3 seq:1
-+# PRED: 4
-+.L3:
-+ # gdb.arch/x86_64-vla-pointer.c:28
-+ .loc 1 28 0 discriminator 3
-+ movl -20(%rbp), %eax
-+ movl %eax, %ecx
-+ movq -40(%rbp), %rdx
-+ movl -20(%rbp), %eax
-+ cltq
-+ movb %cl, (%rdx,%rax)
-+# SUCC: 4 (FALLTHRU,DFS_BACK)
-+ # gdb.arch/x86_64-vla-pointer.c:27
-+ .loc 1 27 0 discriminator 3
-+ addl $1, -20(%rbp)
-+# BLOCK 4 seq:2
-+# PRED: 3 (FALLTHRU,DFS_BACK) 2 [100.0%]
-+.L2:
-+ # gdb.arch/x86_64-vla-pointer.c:27
-+ .loc 1 27 0 is_stmt 0 discriminator 1
-+ movl -20(%rbp), %eax
-+ cmpl -52(%rbp), %eax
-+# SUCC: 3 5 (FALLTHRU)
-+ jl .L3
-+# BLOCK 5 seq:3
-+# PRED: 4 (FALLTHRU)
-+ # gdb.arch/x86_64-vla-pointer.c:30
-+ .loc 1 30 0 is_stmt 1
-+ movq -40(%rbp), %rax
-+ movb $0, (%rax)
-+ movq %rsi, %rsp
-+ # gdb.arch/x86_64-vla-pointer.c:31
-+ .loc 1 31 0
-+ nop
-+ movq -8(%rbp), %rbx
-+ leave
-+ .cfi_def_cfa 7, 8
-+# SUCC: EXIT [100.0%]
-+ ret
-+ .cfi_endproc
-+.LFE0:
-+ .size foo, .-foo
-+.Letext0:
-+ .section .debug_info,"",@progbits
-+.Ldebug_info0:
-+ .long 0xa5 # Length of Compilation Unit Info
-+ .value 0x4 # DWARF version number
-+ .long .Ldebug_abbrev0 # Offset Into Abbrev. Section
-+ .byte 0x8 # Pointer Size (in bytes)
-+ .uleb128 0x1 # (DIE (0xb) DW_TAG_compile_unit)
-+ .long .LASF3 # DW_AT_producer: "GNU C11 6.2.1 20160916 (Red Hat 6.2.1-2) -mtune=generic -march=x86-64 -g"
-+ .byte 0xc # DW_AT_language
-+ .long .LASF4 # DW_AT_name: "gdb.arch/x86_64-vla-pointer.c"
-+ .long .LASF5 # DW_AT_comp_dir: "/home/jkratoch/redhat/fedora/gdb/master/gdb-7.12/gdb/testsuite"
-+ .quad .Ltext0 # DW_AT_low_pc
-+ .quad .Letext0-.Ltext0 # DW_AT_high_pc
-+ .long .Ldebug_line0 # DW_AT_stmt_list
-+ .uleb128 0x2 # (DIE (0x2d) DW_TAG_subprogram)
-+ # DW_AT_external
-+ .ascii "foo\0" # DW_AT_name
-+ .byte 0x1 # DW_AT_decl_file (gdb.arch/x86_64-vla-pointer.c)
-+ .byte 0x15 # DW_AT_decl_line
-+ # DW_AT_prototyped
-+ .quad .LFB0 # DW_AT_low_pc
-+ .quad .LFE0-.LFB0 # DW_AT_high_pc
-+ .uleb128 0x1 # DW_AT_frame_base
-+ .byte 0x9c # DW_OP_call_frame_cfa
-+ # DW_AT_GNU_all_call_sites
-+ .long 0x80 # DW_AT_sibling
-+ .uleb128 0x3 # (DIE (0x4a) DW_TAG_formal_parameter)
-+ .long .LASF6 # DW_AT_name: "size"
-+ .byte 0x1 # DW_AT_decl_file (gdb.arch/x86_64-vla-pointer.c)
-+ .byte 0x15 # DW_AT_decl_line
-+ .long 0x80 # DW_AT_type
-+ .uleb128 0x3 # DW_AT_location
-+ .byte 0x91 # DW_OP_fbreg
-+ .sleb128 -68
-+ .uleb128 0x4 # (DIE (0x59) DW_TAG_typedef)
-+ .long .LASF7 # DW_AT_name: "array_t"
-+ .byte 0x1 # DW_AT_decl_file (gdb.arch/x86_64-vla-pointer.c)
-+ .byte 0x17 # DW_AT_decl_line
-+ .long 0x87 # DW_AT_type
-+ .uleb128 0x5 # (DIE (0x64) DW_TAG_variable)
-+ .long .LASF0 # DW_AT_name: "array"
-+ .byte 0x1 # DW_AT_decl_file (gdb.arch/x86_64-vla-pointer.c)
-+ .byte 0x18 # DW_AT_decl_line
-+ .long 0x59 # DW_AT_type
-+ .uleb128 0x3 # DW_AT_location
-+ .byte 0x91 # DW_OP_fbreg
-+ .sleb128 -56
-+ .byte 0x6 # DW_OP_deref
-+ .uleb128 0x6 # (DIE (0x73) DW_TAG_variable)
-+ .ascii "i\0" # DW_AT_name
-+ .byte 0x1 # DW_AT_decl_file (gdb.arch/x86_64-vla-pointer.c)
-+ .byte 0x19 # DW_AT_decl_line
-+ .long 0x80 # DW_AT_type
-+ .uleb128 0x2 # DW_AT_location
-+ .byte 0x91 # DW_OP_fbreg
-+ .sleb128 -36
-+ .byte 0 # end of children of DIE 0x2d
-+ .uleb128 0x7 # (DIE (0x80) DW_TAG_base_type)
-+ .byte 0x4 # DW_AT_byte_size
-+ .byte 0x5 # DW_AT_encoding
-+ .ascii "int\0" # DW_AT_name
-+ .uleb128 0x8 # (DIE (0x87) DW_TAG_array_type)
-+ .long 0xa1 # DW_AT_type
-+ .long 0x9a # DW_AT_sibling
-+ .uleb128 0x9 # (DIE (0x90) DW_TAG_subrange_type)
-+ .long 0x9a # DW_AT_type
-+ .uleb128 0x3 # DW_AT_upper_bound
-+ .byte 0x91 # DW_OP_fbreg
-+ .sleb128 -48
-+ .byte 0x6 # DW_OP_deref
-+ .byte 0 # end of children of DIE 0x87
-+ .uleb128 0xa # (DIE (0x9a) DW_TAG_base_type)
-+ .byte 0x8 # DW_AT_byte_size
-+ .byte 0x7 # DW_AT_encoding
-+ .long .LASF1 # DW_AT_name: "sizetype"
-+ .uleb128 0xa # (DIE (0xa1) DW_TAG_base_type)
-+ .byte 0x1 # DW_AT_byte_size
-+ .byte 0x6 # DW_AT_encoding
-+ .long .LASF2 # DW_AT_name: "char"
-+ .byte 0 # end of children of DIE 0xb
-+ .section .debug_abbrev,"",@progbits
-+.Ldebug_abbrev0:
-+ .uleb128 0x1 # (abbrev code)
-+ .uleb128 0x11 # (TAG: DW_TAG_compile_unit)
-+ .byte 0x1 # DW_children_yes
-+ .uleb128 0x25 # (DW_AT_producer)
-+ .uleb128 0xe # (DW_FORM_strp)
-+ .uleb128 0x13 # (DW_AT_language)
-+ .uleb128 0xb # (DW_FORM_data1)
-+ .uleb128 0x3 # (DW_AT_name)
-+ .uleb128 0xe # (DW_FORM_strp)
-+ .uleb128 0x1b # (DW_AT_comp_dir)
-+ .uleb128 0xe # (DW_FORM_strp)
-+ .uleb128 0x11 # (DW_AT_low_pc)
-+ .uleb128 0x1 # (DW_FORM_addr)
-+ .uleb128 0x12 # (DW_AT_high_pc)
-+ .uleb128 0x7 # (DW_FORM_data8)
-+ .uleb128 0x10 # (DW_AT_stmt_list)
-+ .uleb128 0x17 # (DW_FORM_sec_offset)
-+ .byte 0
-+ .byte 0
-+ .uleb128 0x2 # (abbrev code)
-+ .uleb128 0x2e # (TAG: DW_TAG_subprogram)
-+ .byte 0x1 # DW_children_yes
-+ .uleb128 0x3f # (DW_AT_external)
-+ .uleb128 0x19 # (DW_FORM_flag_present)
-+ .uleb128 0x3 # (DW_AT_name)
-+ .uleb128 0x8 # (DW_FORM_string)
-+ .uleb128 0x3a # (DW_AT_decl_file)
-+ .uleb128 0xb # (DW_FORM_data1)
-+ .uleb128 0x3b # (DW_AT_decl_line)
-+ .uleb128 0xb # (DW_FORM_data1)
-+ .uleb128 0x27 # (DW_AT_prototyped)
-+ .uleb128 0x19 # (DW_FORM_flag_present)
-+ .uleb128 0x11 # (DW_AT_low_pc)
-+ .uleb128 0x1 # (DW_FORM_addr)
-+ .uleb128 0x12 # (DW_AT_high_pc)
-+ .uleb128 0x7 # (DW_FORM_data8)
-+ .uleb128 0x40 # (DW_AT_frame_base)
-+ .uleb128 0x18 # (DW_FORM_exprloc)
-+ .uleb128 0x2117 # (DW_AT_GNU_all_call_sites)
-+ .uleb128 0x19 # (DW_FORM_flag_present)
-+ .uleb128 0x1 # (DW_AT_sibling)
-+ .uleb128 0x13 # (DW_FORM_ref4)
-+ .byte 0
-+ .byte 0
-+ .uleb128 0x3 # (abbrev code)
-+ .uleb128 0x5 # (TAG: DW_TAG_formal_parameter)
-+ .byte 0 # DW_children_no
-+ .uleb128 0x3 # (DW_AT_name)
-+ .uleb128 0xe # (DW_FORM_strp)
-+ .uleb128 0x3a # (DW_AT_decl_file)
-+ .uleb128 0xb # (DW_FORM_data1)
-+ .uleb128 0x3b # (DW_AT_decl_line)
-+ .uleb128 0xb # (DW_FORM_data1)
-+ .uleb128 0x49 # (DW_AT_type)
-+ .uleb128 0x13 # (DW_FORM_ref4)
-+ .uleb128 0x2 # (DW_AT_location)
-+ .uleb128 0x18 # (DW_FORM_exprloc)
-+ .byte 0
-+ .byte 0
-+ .uleb128 0x4 # (abbrev code)
-+ .uleb128 0x16 # (TAG: DW_TAG_typedef)
-+ .byte 0 # DW_children_no
-+ .uleb128 0x3 # (DW_AT_name)
-+ .uleb128 0xe # (DW_FORM_strp)
-+ .uleb128 0x3a # (DW_AT_decl_file)
-+ .uleb128 0xb # (DW_FORM_data1)
-+ .uleb128 0x3b # (DW_AT_decl_line)
-+ .uleb128 0xb # (DW_FORM_data1)
-+ .uleb128 0x49 # (DW_AT_type)
-+ .uleb128 0x13 # (DW_FORM_ref4)
-+ .byte 0
-+ .byte 0
-+ .uleb128 0x5 # (abbrev code)
-+ .uleb128 0x34 # (TAG: DW_TAG_variable)
-+ .byte 0 # DW_children_no
-+ .uleb128 0x3 # (DW_AT_name)
-+ .uleb128 0xe # (DW_FORM_strp)
-+ .uleb128 0x3a # (DW_AT_decl_file)
-+ .uleb128 0xb # (DW_FORM_data1)
-+ .uleb128 0x3b # (DW_AT_decl_line)
-+ .uleb128 0xb # (DW_FORM_data1)
-+ .uleb128 0x49 # (DW_AT_type)
-+ .uleb128 0x13 # (DW_FORM_ref4)
-+ .uleb128 0x2 # (DW_AT_location)
-+ .uleb128 0x18 # (DW_FORM_exprloc)
-+ .byte 0
-+ .byte 0
-+ .uleb128 0x6 # (abbrev code)
-+ .uleb128 0x34 # (TAG: DW_TAG_variable)
-+ .byte 0 # DW_children_no
-+ .uleb128 0x3 # (DW_AT_name)
-+ .uleb128 0x8 # (DW_FORM_string)
-+ .uleb128 0x3a # (DW_AT_decl_file)
-+ .uleb128 0xb # (DW_FORM_data1)
-+ .uleb128 0x3b # (DW_AT_decl_line)
-+ .uleb128 0xb # (DW_FORM_data1)
-+ .uleb128 0x49 # (DW_AT_type)
-+ .uleb128 0x13 # (DW_FORM_ref4)
-+ .uleb128 0x2 # (DW_AT_location)
-+ .uleb128 0x18 # (DW_FORM_exprloc)
-+ .byte 0
-+ .byte 0
-+ .uleb128 0x7 # (abbrev code)
-+ .uleb128 0x24 # (TAG: DW_TAG_base_type)
-+ .byte 0 # DW_children_no
-+ .uleb128 0xb # (DW_AT_byte_size)
-+ .uleb128 0xb # (DW_FORM_data1)
-+ .uleb128 0x3e # (DW_AT_encoding)
-+ .uleb128 0xb # (DW_FORM_data1)
-+ .uleb128 0x3 # (DW_AT_name)
-+ .uleb128 0x8 # (DW_FORM_string)
-+ .byte 0
-+ .byte 0
-+ .uleb128 0x8 # (abbrev code)
-+ .uleb128 0x1 # (TAG: DW_TAG_array_type)
-+ .byte 0x1 # DW_children_yes
-+ .uleb128 0x49 # (DW_AT_type)
-+ .uleb128 0x13 # (DW_FORM_ref4)
-+ .uleb128 0x1 # (DW_AT_sibling)
-+ .uleb128 0x13 # (DW_FORM_ref4)
-+ .byte 0
-+ .byte 0
-+ .uleb128 0x9 # (abbrev code)
-+ .uleb128 0x21 # (TAG: DW_TAG_subrange_type)
-+ .byte 0 # DW_children_no
-+ .uleb128 0x49 # (DW_AT_type)
-+ .uleb128 0x13 # (DW_FORM_ref4)
-+ .uleb128 0x2f # (DW_AT_upper_bound)
-+ .uleb128 0x18 # (DW_FORM_exprloc)
-+ .byte 0
-+ .byte 0
-+ .uleb128 0xa # (abbrev code)
-+ .uleb128 0x24 # (TAG: DW_TAG_base_type)
-+ .byte 0 # DW_children_no
-+ .uleb128 0xb # (DW_AT_byte_size)
-+ .uleb128 0xb # (DW_FORM_data1)
-+ .uleb128 0x3e # (DW_AT_encoding)
-+ .uleb128 0xb # (DW_FORM_data1)
-+ .uleb128 0x3 # (DW_AT_name)
-+ .uleb128 0xe # (DW_FORM_strp)
-+ .byte 0
-+ .byte 0
-+ .byte 0
-+ .section .debug_aranges,"",@progbits
-+ .long 0x2c # Length of Address Ranges Info
-+ .value 0x2 # DWARF Version
-+ .long .Ldebug_info0 # Offset of Compilation Unit Info
-+ .byte 0x8 # Size of Address
-+ .byte 0 # Size of Segment Descriptor
-+ .value 0 # Pad to 16 byte boundary
-+ .value 0
-+ .quad .Ltext0 # Address
-+ .quad .Letext0-.Ltext0 # Length
-+ .quad 0
-+ .quad 0
-+ .section .debug_line,"",@progbits
-+.Ldebug_line0:
-+ .section .debug_str,"MS",@progbits,1
-+.LASF4:
-+ .string "gdb.arch/x86_64-vla-pointer.c"
-+.LASF7:
-+ .string "array_t"
-+.LASF3:
-+ .string "GNU C11 6.2.1 20160916 (Red Hat 6.2.1-2) -mtune=generic -march=x86-64 -g"
-+.LASF2:
-+ .string "char"
-+.LASF1:
-+ .string "sizetype"
-+.LASF5:
-+ .string "/home/jkratoch/redhat/fedora/gdb/master/gdb-7.12/gdb/testsuite"
-+.LASF6:
-+ .string "size"
-+.LASF0:
-+ .string "array"
-+ .ident "GCC: (GNU) 6.2.1 20160916 (Red Hat 6.2.1-2)"
-+ .section .note.GNU-stack,"",@progbits
-Index: gdb-7.12.50.20170207/gdb/testsuite/gdb.arch/x86_64-vla-pointer.c
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ gdb-7.12.50.20170207/gdb/testsuite/gdb.arch/x86_64-vla-pointer.c 2017-02-26 19:15:36.598882323 +0100
-@@ -0,0 +1,45 @@
-+/* This testcase is part of GDB, the GNU debugger.
-+
-+ Copyright 2009 Free Software Foundation, Inc.
-+
-+ This program is free software; you can redistribute it and/or modify
-+ it under the terms of the GNU General Public License as published by
-+ the Free Software Foundation; either version 3 of the License, or
-+ (at your option) any later version.
-+
-+ This program is distributed in the hope that it will be useful,
-+ but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ GNU General Public License for more details.
-+
-+ You should have received a copy of the GNU General Public License
-+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
-+
-+#if 0
-+
-+void
-+foo (int size)
-+{
-+ typedef char array_t[size];
-+ array_t array;
-+ int i;
-+
-+ for (i = 0; i < size; i++)
-+ array[i] = i;
-+
-+ array[0] = 0; /* break-here */
-+}
-+
-+#else
-+
-+void foo (int size);
-+
-+int
-+main (void)
-+{
-+ foo (26);
-+ foo (78);
-+ return 0;
-+}
-+
-+#endif
-Index: gdb-7.12.50.20170207/gdb/testsuite/gdb.arch/x86_64-vla-pointer.exp
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ gdb-7.12.50.20170207/gdb/testsuite/gdb.arch/x86_64-vla-pointer.exp 2017-02-26 19:15:36.598882323 +0100
-@@ -0,0 +1,65 @@
-+# Copyright 2009 Free Software Foundation, Inc.
-+
-+# This program is free software; you can redistribute it and/or modify
-+# it under the terms of the GNU General Public License as published by
-+# the Free Software Foundation; either version 3 of the License, or
-+# (at your option) any later version.
-+#
-+# This program is distributed in the hope that it will be useful,
-+# but WITHOUT ANY WARRANTY; without even the implied warranty of
-+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+# GNU General Public License for more details.
-+#
-+# You should have received a copy of the GNU General Public License
-+# along with this program. If not, see <http://www.gnu.org/licenses/>.
-+
-+if ![istarget "x86_64-*-*"] then {
-+ verbose "Skipping over gdb.arch/x86_64-vla-pointer.exp test made only for x86_64."
-+ return
-+}
-+
-+set testfile x86_64-vla-pointer
-+set srcasmfile ${testfile}-foo.S
-+set srcfile ${testfile}.c
-+set binfile [standard_output_file ${testfile}]
-+set binobjfile [standard_output_file ${testfile}-foo.o]
-+if { [gdb_compile "${srcdir}/${subdir}/${srcasmfile}" "${binobjfile}" object {}] != "" } {
-+ untested "Couldn't compile test program"
-+ return -1
-+}
-+if { [gdb_compile "${srcdir}/${subdir}/${srcfile} ${binobjfile}" "${binfile}" executable {}] != "" } {
-+ untested "Couldn't compile test program"
-+ return -1
-+}
-+
-+gdb_exit
-+gdb_start
-+gdb_reinitialize_dir $srcdir/$subdir
-+gdb_load ${binfile}
-+
-+if ![runto_main] {
-+ untested x86_64-vla-pointer
-+ return -1
-+}
-+
-+gdb_breakpoint $srcfile:[gdb_get_line_number "break-here"]
-+
-+gdb_continue_to_breakpoint "break-here"
-+
-+gdb_test "whatis array" "type = array_t" "first: whatis array"
-+gdb_test "whatis array_t" "type = char \\\[variable length\\\]" "first: whatis array_t"
-+gdb_test "ptype array" "type = char \\\[26\\\]" "first: ptype array"
-+
-+gdb_test "whatis *array" "type = char" "first: whatis *array"
-+gdb_test "ptype *array" "type = char" "first: ptype *array"
-+
-+gdb_test "p array\[1\]" "\\$\[0-9\] = 1 '\\\\001'"
-+gdb_test "p array\[2\]" "\\$\[0-9\] = 2 '\\\\002'"
-+gdb_test "p array\[3\]" "\\$\[0-9\] = 3 '\\\\003'"
-+gdb_test "p array\[4\]" "\\$\[0-9\] = 4 '\\\\004'"
-+
-+gdb_continue_to_breakpoint "break_here"
-+
-+gdb_test "whatis array" "type = array_t" "second: whatis array"
-+gdb_test "whatis array_t" "type = char \\\[variable length\\\]" "second: whatis array_t"
-+gdb_test "ptype array" "type = char \\\[78\\\]" "second: ptype array"
-Index: gdb-7.12.50.20170207/gdb/testsuite/gdb.arch/x86_64-vla-typedef-foo.S
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ gdb-7.12.50.20170207/gdb/testsuite/gdb.arch/x86_64-vla-typedef-foo.S 2017-02-26 19:15:36.598882323 +0100
-@@ -0,0 +1,455 @@
-+ .file "x86_64-vla-typedef.c"
-+ .section .debug_abbrev,"",@progbits
-+.Ldebug_abbrev0:
-+ .section .debug_info,"",@progbits
-+.Ldebug_info0:
-+ .section .debug_line,"",@progbits
-+.Ldebug_line0:
-+ .text
-+.Ltext0:
-+.globl foo
-+ .type foo, @function
-+foo:
-+.LFB2:
-+ .file 1 "x86_64-vla-typedef.c"
-+ .loc 1 22 0
-+ pushq %rbp
-+.LCFI0:
-+ movq %rsp, %rbp
-+.LCFI1:
-+ subq $64, %rsp
-+.LCFI2:
-+ movl %edi, -36(%rbp)
-+ .loc 1 22 0
-+ movq %rsp, %rax
-+ movq %rax, -48(%rbp)
-+ .loc 1 23 0
-+ movl -36(%rbp), %edx
-+ movslq %edx,%rax
-+ subq $1, %rax
-+ movq %rax, -24(%rbp)
-+ .loc 1 24 0
-+ movslq %edx,%rax
-+ addq $15, %rax
-+ addq $15, %rax
-+ shrq $4, %rax
-+ salq $4, %rax
-+ subq %rax, %rsp
-+ movq %rsp, -56(%rbp)
-+ movq -56(%rbp), %rax
-+ addq $15, %rax
-+ shrq $4, %rax
-+ salq $4, %rax
-+ movq %rax, -56(%rbp)
-+ movq -56(%rbp), %rax
-+ movq %rax, -16(%rbp)
-+ .loc 1 27 0
-+ movl $0, -4(%rbp)
-+ jmp .L2
-+.L3:
-+ .loc 1 28 0
-+ movl -4(%rbp), %esi
-+ movl -4(%rbp), %eax
-+ movl %eax, %ecx
-+ movq -16(%rbp), %rdx
-+ movslq %esi,%rax
-+ movb %cl, (%rdx,%rax)
-+ .loc 1 27 0
-+ addl $1, -4(%rbp)
-+.L2:
-+ movl -4(%rbp), %eax
-+ cmpl -36(%rbp), %eax
-+ jl .L3
-+ .loc 1 30 0
-+ .globl break_here
-+break_here:
-+ movq -16(%rbp), %rax
-+ movb $0, (%rax)
-+ movq -48(%rbp), %rsp
-+ .loc 1 31 0
-+ leave
-+ ret
-+.LFE2:
-+ .size foo, .-foo
-+ .section .debug_frame,"",@progbits
-+.Lframe0:
-+ .long .LECIE0-.LSCIE0
-+.LSCIE0:
-+ .long 0xffffffff
-+ .byte 0x1
-+ .string ""
-+ .uleb128 0x1
-+ .sleb128 -8
-+ .byte 0x10
-+ .byte 0xc
-+ .uleb128 0x7
-+ .uleb128 0x8
-+ .byte 0x90
-+ .uleb128 0x1
-+ .align 8
-+.LECIE0:
-+.LSFDE0:
-+ .long .LEFDE0-.LASFDE0
-+.LASFDE0:
-+ .long .Lframe0
-+ .quad .LFB2
-+ .quad .LFE2-.LFB2
-+ .byte 0x4
-+ .long .LCFI0-.LFB2
-+ .byte 0xe
-+ .uleb128 0x10
-+ .byte 0x86
-+ .uleb128 0x2
-+ .byte 0x4
-+ .long .LCFI1-.LCFI0
-+ .byte 0xd
-+ .uleb128 0x6
-+ .align 8
-+.LEFDE0:
-+ .section .eh_frame,"a",@progbits
-+.Lframe1:
-+ .long .LECIE1-.LSCIE1
-+.LSCIE1:
-+ .long 0x0
-+ .byte 0x1
-+ .string "zR"
-+ .uleb128 0x1
-+ .sleb128 -8
-+ .byte 0x10
-+ .uleb128 0x1
-+ .byte 0x3
-+ .byte 0xc
-+ .uleb128 0x7
-+ .uleb128 0x8
-+ .byte 0x90
-+ .uleb128 0x1
-+ .align 8
-+.LECIE1:
-+.LSFDE1:
-+ .long .LEFDE1-.LASFDE1
-+.LASFDE1:
-+ .long .LASFDE1-.Lframe1
-+ .long .LFB2
-+ .long .LFE2-.LFB2
-+ .uleb128 0x0
-+ .byte 0x4
-+ .long .LCFI0-.LFB2
-+ .byte 0xe
-+ .uleb128 0x10
-+ .byte 0x86
-+ .uleb128 0x2
-+ .byte 0x4
-+ .long .LCFI1-.LCFI0
-+ .byte 0xd
-+ .uleb128 0x6
-+ .align 8
-+.LEFDE1:
-+ .text
-+.Letext0:
-+ .section .debug_loc,"",@progbits
-+.Ldebug_loc0:
-+.LLST0:
-+ .quad .LFB2-.Ltext0
-+ .quad .LCFI0-.Ltext0
-+ .value 0x2
-+ .byte 0x77
-+ .sleb128 8
-+ .quad .LCFI0-.Ltext0
-+ .quad .LCFI1-.Ltext0
-+ .value 0x2
-+ .byte 0x77
-+ .sleb128 16
-+ .quad .LCFI1-.Ltext0
-+ .quad .LFE2-.Ltext0
-+ .value 0x2
-+ .byte 0x76
-+ .sleb128 16
-+ .quad 0x0
-+ .quad 0x0
-+ .section .debug_info
-+ .long .Ldebug_end - .Ldebug_start
-+.Ldebug_start:
-+ .value 0x2
-+ .long .Ldebug_abbrev0
-+ .byte 0x8
-+ .uleb128 0x1
-+ .long .LASF2
-+ .byte 0x1
-+ .long .LASF3
-+ .long .LASF4
-+ .quad .Ltext0
-+ .quad .Letext0
-+ .long .Ldebug_line0
-+ .uleb128 0x2
-+ .byte 0x1
-+ .string "foo"
-+ .byte 0x1
-+ .byte 0x16
-+ .byte 0x1
-+ .quad .LFB2
-+ .quad .LFE2
-+ .long .LLST0
-+ .long 0x83
-+ .uleb128 0x3
-+ .long .LASF5
-+ .byte 0x1
-+ .byte 0x15
-+ .long 0x83
-+ .byte 0x2
-+ .byte 0x91
-+ .sleb128 -52
-+.Ltag_typedef:
-+ .uleb128 0x4
-+ .long .LASF6
-+ .byte 0x1
-+ .byte 0x17
-+ .long .Ltag_array_type - .debug_info
-+ .uleb128 0x5 /* Abbrev Number: 5 (DW_TAG_variable) */
-+ .long .LASF0
-+ .byte 0x1
-+ .byte 0x18
-+#if 1
-+ .long .Ltag_typedef - .debug_info
-+#else
-+ /* Debugging only: Skip the typedef indirection. */
-+ .long .Ltag_array_type - .debug_info
-+#endif
-+ /* DW_AT_location: DW_FORM_block1: start */
-+ .byte 0x3
-+ .byte 0x91
-+ .sleb128 -32
-+#if 0
-+ .byte 0x6 /* DW_OP_deref */
-+#else
-+ .byte 0x96 /* DW_OP_nop */
-+#endif
-+ /* DW_AT_location: DW_FORM_block1: end */
-+ .uleb128 0x6
-+ .string "i"
-+ .byte 0x1
-+ .byte 0x19
-+ .long 0x83
-+ .byte 0x2
-+ .byte 0x91
-+ .sleb128 -20
-+ .byte 0x0
-+ .uleb128 0x7
-+ .byte 0x4
-+ .byte 0x5
-+ .string "int"
-+.Ltag_array_type:
-+ .uleb128 0x8 /* Abbrev Number: 8 (DW_TAG_array_type) */
-+ .long 0xa0 + (2f - 1f) /* DW_AT_type: DW_FORM_ref4 */
-+ .long 0x9d + (2f - 1f) /* DW_AT_sibling: DW_FORM_ref4 */
-+1: /* DW_AT_data_location: DW_FORM_block1: start */
-+ .byte 2f - 3f /* length */
-+3:
-+ .byte 0x97 /* DW_OP_push_object_address */
-+ .byte 0x6 /* DW_OP_deref */
-+2: /* DW_AT_data_location: DW_FORM_block1: end */
-+ .uleb128 0x9
-+ .long 0x9d + (2b - 1b) /* DW_AT_type: DW_FORM_ref4 */
-+ .byte 0x3
-+ .byte 0x91
-+ .sleb128 -40
-+ .byte 0x6
-+ .byte 0x0
-+ .uleb128 0xa
-+ .byte 0x8
-+ .byte 0x7
-+ .uleb128 0xb
-+ .byte 0x1
-+ .byte 0x6
-+ .long .LASF1
-+ .byte 0x0
-+.Ldebug_end:
-+ .section .debug_abbrev
-+ .uleb128 0x1
-+ .uleb128 0x11
-+ .byte 0x1
-+ .uleb128 0x25
-+ .uleb128 0xe
-+ .uleb128 0x13
-+ .uleb128 0xb
-+ .uleb128 0x3
-+ .uleb128 0xe
-+ .uleb128 0x1b
-+ .uleb128 0xe
-+ .uleb128 0x11
-+ .uleb128 0x1
-+ .uleb128 0x12
-+ .uleb128 0x1
-+ .uleb128 0x10
-+ .uleb128 0x6
-+ .byte 0x0
-+ .byte 0x0
-+ .uleb128 0x2
-+ .uleb128 0x2e
-+ .byte 0x1
-+ .uleb128 0x3f
-+ .uleb128 0xc
-+ .uleb128 0x3
-+ .uleb128 0x8
-+ .uleb128 0x3a
-+ .uleb128 0xb
-+ .uleb128 0x3b
-+ .uleb128 0xb
-+ .uleb128 0x27
-+ .uleb128 0xc
-+ .uleb128 0x11
-+ .uleb128 0x1
-+ .uleb128 0x12
-+ .uleb128 0x1
-+ .uleb128 0x40
-+ .uleb128 0x6
-+ .uleb128 0x1
-+ .uleb128 0x13
-+ .byte 0x0
-+ .byte 0x0
-+ .uleb128 0x3
-+ .uleb128 0x5
-+ .byte 0x0
-+ .uleb128 0x3
-+ .uleb128 0xe
-+ .uleb128 0x3a
-+ .uleb128 0xb
-+ .uleb128 0x3b
-+ .uleb128 0xb
-+ .uleb128 0x49
-+ .uleb128 0x13
-+ .uleb128 0x2
-+ .uleb128 0xa
-+ .byte 0x0
-+ .byte 0x0
-+ .uleb128 0x4
-+ .uleb128 0x16
-+ .byte 0x0
-+ .uleb128 0x3
-+ .uleb128 0xe
-+ .uleb128 0x3a
-+ .uleb128 0xb
-+ .uleb128 0x3b
-+ .uleb128 0xb
-+ .uleb128 0x49
-+ .uleb128 0x13
-+ .byte 0x0
-+ .byte 0x0
-+ .uleb128 0x5
-+ .uleb128 0x34
-+ .byte 0x0
-+ .uleb128 0x3
-+ .uleb128 0xe
-+ .uleb128 0x3a
-+ .uleb128 0xb
-+ .uleb128 0x3b
-+ .uleb128 0xb
-+ .uleb128 0x49
-+ .uleb128 0x13
-+ .uleb128 0x2
-+ .uleb128 0xa
-+ .byte 0x0
-+ .byte 0x0
-+ .uleb128 0x6
-+ .uleb128 0x34
-+ .byte 0x0
-+ .uleb128 0x3
-+ .uleb128 0x8
-+ .uleb128 0x3a
-+ .uleb128 0xb
-+ .uleb128 0x3b
-+ .uleb128 0xb
-+ .uleb128 0x49
-+ .uleb128 0x13
-+ .uleb128 0x2
-+ .uleb128 0xa
-+ .byte 0x0
-+ .byte 0x0
-+ .uleb128 0x7
-+ .uleb128 0x24
-+ .byte 0x0
-+ .uleb128 0xb
-+ .uleb128 0xb
-+ .uleb128 0x3e
-+ .uleb128 0xb
-+ .uleb128 0x3
-+ .uleb128 0x8
-+ .byte 0x0
-+ .byte 0x0
-+ .uleb128 0x8 /* Abbrev Number: 8 (DW_TAG_array_type) */
-+ .uleb128 0x1
-+ .byte 0x1
-+ .uleb128 0x49 /* DW_AT_type */
-+ .uleb128 0x13 /* DW_FORM_ref4 */
-+ .uleb128 0x1 /* DW_AT_sibling */
-+ .uleb128 0x13 /* DW_FORM_ref4 */
-+ .uleb128 0x50 /* DW_AT_data_location */
-+ .uleb128 0xa /* DW_FORM_block1 */
-+ .byte 0x0
-+ .byte 0x0
-+ .uleb128 0x9
-+ .uleb128 0x21
-+ .byte 0x0
-+ .uleb128 0x49 /* DW_AT_type */
-+ .uleb128 0x13 /* DW_FORM_ref4 */
-+ .uleb128 0x2f
-+ .uleb128 0xa
-+ .byte 0x0
-+ .byte 0x0
-+ .uleb128 0xa
-+ .uleb128 0x24
-+ .byte 0x0
-+ .uleb128 0xb
-+ .uleb128 0xb
-+ .uleb128 0x3e
-+ .uleb128 0xb
-+ .byte 0x0
-+ .byte 0x0
-+ .uleb128 0xb
-+ .uleb128 0x24
-+ .byte 0x0
-+ .uleb128 0xb
-+ .uleb128 0xb
-+ .uleb128 0x3e
-+ .uleb128 0xb
-+ .uleb128 0x3
-+ .uleb128 0xe
-+ .byte 0x0
-+ .byte 0x0
-+ .byte 0x0
-+ .section .debug_pubnames,"",@progbits
-+ .long 0x16
-+ .value 0x2
-+ .long .Ldebug_info0
-+ .long 0xa8
-+ .long 0x2d
-+ .string "foo"
-+ .long 0x0
-+ .section .debug_aranges,"",@progbits
-+ .long 0x2c
-+ .value 0x2
-+ .long .Ldebug_info0
-+ .byte 0x8
-+ .byte 0x0
-+ .value 0x0
-+ .value 0x0
-+ .quad .Ltext0
-+ .quad .Letext0-.Ltext0
-+ .quad 0x0
-+ .quad 0x0
-+ .section .debug_str,"MS",@progbits,1
-+.LASF0:
-+ .string "array"
-+.LASF5:
-+ .string "size"
-+.LASF3:
-+ .string "x86_64-vla-typedef.c"
-+.LASF6:
-+ .string "array_t"
-+.LASF1:
-+ .string "char"
-+.LASF4:
-+ .string "gdb.arch"
-+.LASF2:
-+ .string "GNU C 4.3.2 20081105 (Red Hat 4.3.2-7)"
-+ .ident "GCC: (GNU) 4.3.2 20081105 (Red Hat 4.3.2-7)"
-+ .section .note.GNU-stack,"",@progbits
-Index: gdb-7.12.50.20170207/gdb/testsuite/gdb.arch/x86_64-vla-typedef.c
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ gdb-7.12.50.20170207/gdb/testsuite/gdb.arch/x86_64-vla-typedef.c 2017-02-26 19:15:36.599882330 +0100
-@@ -0,0 +1,45 @@
-+/* This testcase is part of GDB, the GNU debugger.
-+
-+ Copyright 2008 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/>. */
-+
-+#if 0
-+
-+void
-+foo (int size)
-+{
-+ typedef char array_t[size];
-+ array_t array;
-+ int i;
-+
-+ for (i = 0; i < size; i++)
-+ array[i] = i;
-+
-+ array[0] = 0; /* break-here */
-+}
-+
-+#else
-+
-+void foo (int size);
-+
-+int
-+main (void)
-+{
-+ foo (26);
-+ foo (78);
-+ return 0;
-+}
-+
-+#endif
-Index: gdb-7.12.50.20170207/gdb/testsuite/gdb.arch/x86_64-vla-typedef.exp
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ gdb-7.12.50.20170207/gdb/testsuite/gdb.arch/x86_64-vla-typedef.exp 2017-02-26 19:15:36.599882330 +0100
-@@ -0,0 +1,64 @@
-+# Copyright 2009 Free Software Foundation, Inc.
-+
-+# This program is free software; you can redistribute it and/or modify
-+# it under the terms of the GNU General Public License as published by
-+# the Free Software Foundation; either version 3 of the License, or
-+# (at your option) any later version.
-+#
-+# This program is distributed in the hope that it will be useful,
-+# but WITHOUT ANY WARRANTY; without even the implied warranty of
-+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+# GNU General Public License for more details.
-+#
-+# You should have received a copy of the GNU General Public License
-+# along with this program. If not, see <http://www.gnu.org/licenses/>.
-+
-+# Test DW_AT_data_location accessed through DW_TAG_typedef intermediate.
-+
-+if ![istarget "x86_64-*-*"] then {
-+ verbose "Skipping over gdb.arch/x86_64-vla-typedef.exp test made only for x86_64."
-+ return
-+}
-+
-+set testfile x86_64-vla-typedef
-+set srcasmfile ${testfile}-foo.S
-+set srcfile ${testfile}.c
-+set binfile [standard_output_file ${testfile}]
-+set binobjfile [standard_output_file ${testfile}-foo.o]
-+if { [gdb_compile "${srcdir}/${subdir}/${srcasmfile}" "${binobjfile}" object {}] != "" } {
-+ untested "Couldn't compile test program"
-+ return -1
-+}
-+if { [gdb_compile "${srcdir}/${subdir}/${srcfile} ${binobjfile}" "${binfile}" executable {debug}] != "" } {
-+ untested "Couldn't compile test program"
-+ return -1
-+}
-+
-+gdb_exit
-+gdb_start
-+gdb_reinitialize_dir $srcdir/$subdir
-+gdb_load ${binfile}
-+
-+if ![runto_main] {
-+ untested x86_64-vla-typedef
-+ return -1
-+}
-+
-+gdb_breakpoint "break_here"
-+
-+gdb_continue_to_breakpoint "break_here"
-+
-+gdb_test "whatis array" "type = array_t" "first: whatis array"
-+
-+gdb_test "ptype array" "type = char \\\[26\\\]" "first: ptype array"
-+
-+gdb_test "p array\[1\]" "\\$\[0-9\] = 1 '\\\\001'"
-+gdb_test "p array\[2\]" "\\$\[0-9\] = 2 '\\\\002'"
-+gdb_test "p array\[3\]" "\\$\[0-9\] = 3 '\\\\003'"
-+gdb_test "p array\[4\]" "\\$\[0-9\] = 4 '\\\\004'"
-+
-+gdb_continue_to_breakpoint "break_here"
-+
-+gdb_test "whatis array" "type = array_t" "second: whatis array"
-+
-+gdb_test "ptype array" "type = char \\\[78\\\]" "second: ptype array"
-Index: gdb-7.12.50.20170207/gdb/testsuite/gdb.base/arrayidx.c
-===================================================================
---- gdb-7.12.50.20170207.orig/gdb/testsuite/gdb.base/arrayidx.c 2017-02-26 19:15:28.555824772 +0100
-+++ gdb-7.12.50.20170207/gdb/testsuite/gdb.base/arrayidx.c 2017-02-26 19:15:36.599882330 +0100
-@@ -17,6 +17,13 @@
-
- int array[] = {1, 2, 3, 4};
-
-+#ifdef __GNUC__
-+struct
-+ {
-+ int a[0];
-+ } unbound;
-+#endif
-+
- int
- main (void)
- {
-Index: gdb-7.12.50.20170207/gdb/testsuite/gdb.base/arrayidx.exp
-===================================================================
---- gdb-7.12.50.20170207.orig/gdb/testsuite/gdb.base/arrayidx.exp 2017-02-26 19:15:28.555824772 +0100
-+++ gdb-7.12.50.20170207/gdb/testsuite/gdb.base/arrayidx.exp 2017-02-26 19:15:36.599882330 +0100
-@@ -49,4 +49,12 @@
- "\\{\\\[0\\\] = 1, \\\[1\\\] = 2, \\\[2\\\] = 3, \\\[3\\\] = 4\\}" \
- "print array with array-indexes on"
-
--
-+set test "p unbound.a == &unbound.a\[0\]"
-+gdb_test_multiple $test $test {
-+ -re " = 1\r\n$gdb_prompt $" {
-+ pass $test
-+ }
-+ -re "No symbol \"unbound\" in current context.\r\n$gdb_prompt $" {
-+ unsupported "$test (no GCC)"
-+ }
-+}
-Index: gdb-7.12.50.20170207/gdb/testsuite/gdb.base/internal-var-field-address.c
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ gdb-7.12.50.20170207/gdb/testsuite/gdb.base/internal-var-field-address.c 2017-02-26 19:15:36.599882330 +0100
-@@ -0,0 +1,20 @@
-+/* This testcase is part of GDB, the GNU debugger.
-+
-+ Copyright 2009 Free Software Foundation, Inc.
-+
-+ This program is free software; you can redistribute it and/or modify
-+ it under the terms of the GNU General Public License as published by
-+ the Free Software Foundation; either version 3 of the License, or
-+ (at your option) any later version.
-+
-+ This program is distributed in the hope that it will be useful,
-+ but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ GNU General Public License for more details.
-+
-+ You should have received a copy of the GNU General Public License
-+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
-+
-+struct {
-+ int field;
-+} staticstruct = { 1 };
-Index: gdb-7.12.50.20170207/gdb/testsuite/gdb.base/internal-var-field-address.exp
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ gdb-7.12.50.20170207/gdb/testsuite/gdb.base/internal-var-field-address.exp 2017-02-26 19:15:36.600882337 +0100
-@@ -0,0 +1,26 @@
-+# Copyright 2009 Free Software Foundation, Inc.
-+
-+# This program is free software; you can redistribute it and/or modify
-+# it under the terms of the GNU General Public License as published by
-+# the Free Software Foundation; either version 3 of the License, or
-+# (at your option) any later version.
-+#
-+# This program is distributed in the hope that it will be useful,
-+# but WITHOUT ANY WARRANTY; without even the implied warranty of
-+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+# GNU General Public License for more details.
-+#
-+# You should have received a copy of the GNU General Public License
-+# along with this program. If not, see <http://www.gnu.org/licenses/>.
-+
-+set test internal-var-field-address
-+set binfile ${test}.x
-+if { [gdb_compile "${srcdir}/${subdir}/${test}.c" "[standard_output_file ${binfile}]" object {debug}] != "" } {
-+ untested "Couldn't compile test program"
-+ return -1
-+}
-+
-+clean_restart $binfile
-+
-+gdb_test {set $varstruct = staticstruct}
-+gdb_test {p $varstruct.field} " = 1"
-Index: gdb-7.12.50.20170207/gdb/testsuite/gdb.base/vla-frame.c
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ gdb-7.12.50.20170207/gdb/testsuite/gdb.base/vla-frame.c 2017-02-26 19:15:36.600882337 +0100
-@@ -0,0 +1,31 @@
-+/* This testcase is part of GDB, the GNU debugger.
-+
-+ Copyright 2011 Free Software Foundation, Inc.
-+
-+ This program is free software; you can redistribute it and/or modify
-+ it under the terms of the GNU General Public License as published by
-+ the Free Software Foundation; either version 3 of the License, or
-+ (at your option) any later version.
-+
-+ This program is distributed in the hope that it will be useful,
-+ but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ GNU General Public License for more details.
-+
-+ You should have received a copy of the GNU General Public License
-+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
-+
-+#include <string.h>
-+
-+int
-+main (int argc, char **argv)
-+{
-+ char s[2 + argc];
-+ void (*f) (char *) = 0;
-+
-+ memset (s, 0, sizeof (s));
-+ s[0] = 'X';
-+
-+ f (s);
-+ return 0;
-+}
-Index: gdb-7.12.50.20170207/gdb/testsuite/gdb.base/vla-frame.exp
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ gdb-7.12.50.20170207/gdb/testsuite/gdb.base/vla-frame.exp 2017-02-26 19:15:36.600882337 +0100
-@@ -0,0 +1,38 @@
-+# Copyright 2011 Free Software Foundation, Inc.
-+#
-+# This program is free software; you can redistribute it and/or modify
-+# it under the terms of the GNU General Public License as published by
-+# the Free Software Foundation; either version 3 of the License, or
-+# (at your option) any later version.
-+#
-+# This program is distributed in the hope that it will be useful,
-+# but WITHOUT ANY WARRANTY; without even the implied warranty of
-+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+# GNU General Public License for more details.
-+#
-+# You should have received a copy of the GNU General Public License
-+# along with this program. If not, see <http://www.gnu.org/licenses/>.
-+
-+set testfile vla-frame
-+set executable ${testfile}
-+
-+if { [prepare_for_testing ${testfile}.exp ${executable}] } {
-+ return -1
-+}
-+
-+if ![runto_main] {
-+ return -1
-+}
-+
-+set test "continue"
-+gdb_test_multiple $test $test {
-+ -re "Continuing\\.\r\n\r\nProgram received signal SIGSEGV, Segmentation fault\\.\r\n0x0+ in \\?\\? \\(\\)\r\n$gdb_prompt $" {
-+ pass $test
-+ }
-+ -re "\r\n$gdb_prompt $" {
-+ untested ${testfile}.exp
-+ return
-+ }
-+}
-+
-+gdb_test "bt full" "\r\n +s = \"X\\\\000\"\r\n.*"
-Index: gdb-7.12.50.20170207/gdb/testsuite/gdb.base/vla-overflow.c
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ gdb-7.12.50.20170207/gdb/testsuite/gdb.base/vla-overflow.c 2017-02-26 19:15:36.600882337 +0100
-@@ -0,0 +1,30 @@
-+/* This testcase is part of GDB, the GNU debugger.
-+
-+ Copyright 2008 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/>. */
-+
-+#include <stdlib.h>
-+
-+int
-+main (int argc, char **argv)
-+{
-+ int array[argc];
-+
-+ array[0] = array[0];
-+
-+ abort ();
-+
-+ return 0;
-+}
-Index: gdb-7.12.50.20170207/gdb/testsuite/gdb.base/vla-overflow.exp
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ gdb-7.12.50.20170207/gdb/testsuite/gdb.base/vla-overflow.exp 2017-02-26 19:15:36.600882337 +0100
-@@ -0,0 +1,109 @@
-+# Copyright 2008 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/>.
-+
-+# We could crash in:
-+# #0 block_linkage_function (bl=0x0) at ../../gdb/block.c:69
-+# #1 in dwarf_block_get_frame_base (...) at ../../gdb/dwarf2block.c:97
-+# 97 framefunc = block_linkage_function (get_frame_block (frame, NULL));
-+# #2 in execute_stack_op (...) at ../../gdb/dwarf2expr.c:496
-+# #3 in dwarf_block_exec_core () at ../../gdb/dwarf2block.c:156
-+# #4 dwarf_block_exec (...) at ../../gdb/dwarf2block.c:206
-+# #5 in range_type_count_bound_internal (...) at ../../gdb/gdbtypes.c:1430
-+# #6 in create_array_type (...) at ../../gdb/gdbtypes.c:840
-+# ...
-+# #21 in psymtab_to_symtab (...) at ../../gdb/symfile.c:292
-+# ...
-+# #29 in backtrace_command_1 () at ../../gdb/stack.c:1273
-+
-+set testfile vla-overflow
-+set shfile [standard_output_file ${testfile}-gdb.sh]
-+set srcfile ${testfile}.c
-+set binfile [standard_output_file ${testfile}]
-+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
-+ untested "Couldn't compile test program"
-+ return -1
-+}
-+
-+set f [open "|getconf PAGESIZE" "r"]
-+gets $f pagesize
-+close $f
-+
-+gdb_exit
-+gdb_start
-+gdb_reinitialize_dir $srcdir/$subdir
-+gdb_load ${binfile}
-+
-+set pid_of_gdb [exp_pid -i [board_info host fileid]]
-+
-+if { [runto_main] < 0 } {
-+ untested vla-overflow
-+ return -1
-+}
-+
-+# Get the GDB memory size when we stay at main.
-+
-+proc memory_v_pages_get {} {
-+ global pid_of_gdb pagesize
-+ set fd [open "/proc/$pid_of_gdb/statm"]
-+ gets $fd line
-+ close $fd
-+ # number of pages of virtual memory
-+ scan $line "%d" drs
-+ return $drs
-+}
-+
-+set pages_found [memory_v_pages_get]
-+
-+# s390x with glibc-debuginfo.s390x installed used approx. 16MB.
-+set mb_reserve 40
-+verbose -log "pages_found = $pages_found, mb_reserve = $mb_reserve"
-+set kb_found [expr $pages_found * $pagesize / 1024]
-+set kb_permit [expr $kb_found + 1 * 1024 + $mb_reserve * 1024]
-+verbose -log "kb_found = $kb_found, kb_permit = $kb_permit"
-+
-+# Create the ulimit wrapper.
-+set f [open $shfile "w"]
-+puts $f "#! /bin/sh"
-+puts $f "ulimit -v $kb_permit"
-+puts $f "exec $GDB \"\$@\""
-+close $f
-+remote_exec host "chmod +x $shfile"
-+
-+gdb_exit
-+set GDBold $GDB
-+set GDB "$shfile"
-+gdb_start
-+set GDB $GDBold
-+
-+gdb_reinitialize_dir $srcdir/$subdir
-+gdb_load ${binfile}
-+
-+set pid_of_gdb [exp_pid -i [board_info host fileid]]
-+
-+# Check the size again after the second run.
-+# We must not stop in main as it would cache `array' and never crash later.
-+
-+gdb_run_cmd
-+
-+verbose -log "kb_found before abort() = [expr [memory_v_pages_get] * $pagesize / 1024]"
-+
-+gdb_test "" "Program received signal SIGABRT, Aborted..*" "Enter abort()"
-+
-+verbose -log "kb_found in abort() = [expr [memory_v_pages_get] * $pagesize / 1024]"
-+
-+# `abort' can get expressed as `*__GI_abort'.
-+gdb_test "bt" "in \[^ \]*abort \\(.* in main \\(.*" "Backtrace after abort()"
-+
-+verbose -log "kb_found in bt after abort() = [expr [memory_v_pages_get] * $pagesize / 1024]"
-Index: gdb-7.12.50.20170207/gdb/testsuite/gdb.base/vla.c
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ gdb-7.12.50.20170207/gdb/testsuite/gdb.base/vla.c 2017-02-26 19:15:36.600882337 +0100
-@@ -0,0 +1,55 @@
-+/* This testcase is part of GDB, the GNU debugger.
-+
-+ Copyright 2008 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/>. */
-+
-+#include <string.h>
-+
-+void
-+marker (void)
-+{
-+}
-+
-+void
-+bar (char *a, char *b, char *c, int size)
-+{
-+ memset (a, '1', size);
-+ memset (b, '2', size);
-+ memset (c, '3', 48);
-+}
-+
-+void
-+foo (int size)
-+{
-+ char temp1[size];
-+ char temp3[48];
-+
-+ temp1[size - 1] = '\0';
-+ {
-+ char temp2[size];
-+
-+ bar (temp1, temp2, temp3, size);
-+
-+ marker (); /* break-here */
-+ }
-+}
-+
-+int
-+main (void)
-+{
-+ foo (26);
-+ foo (78);
-+ return 0;
-+}
-Index: gdb-7.12.50.20170207/gdb/testsuite/gdb.base/vla.exp
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ gdb-7.12.50.20170207/gdb/testsuite/gdb.base/vla.exp 2017-02-26 19:15:36.600882337 +0100
-@@ -0,0 +1,62 @@
-+# Copyright 2008 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/>.
-+
-+set testfile vla
-+set srcfile ${testfile}.c
-+set binfile [standard_output_file ${testfile}]
-+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
-+ untested "Couldn't compile test program"
-+ return -1
-+}
-+
-+gdb_exit
-+gdb_start
-+gdb_reinitialize_dir $srcdir/$subdir
-+gdb_load ${binfile}
-+
-+if ![runto_main] {
-+ untested vla
-+ return -1
-+}
-+
-+gdb_breakpoint [gdb_get_line_number "break-here"]
-+
-+gdb_continue_to_breakpoint "break-here"
-+
-+gdb_test "whatis temp1" "type = char \\\[26\\\]" "first: whatis temp1"
-+gdb_test "whatis temp2" "type = char \\\[26\\\]" "first: whatis temp2"
-+gdb_test "whatis temp3" "type = char \\\[48\\\]" "first: whatis temp3"
-+
-+gdb_test "ptype temp1" "type = char \\\[26\\\]" "first: ptype temp1"
-+gdb_test "ptype temp2" "type = char \\\[26\\\]" "first: ptype temp2"
-+gdb_test "ptype temp3" "type = char \\\[48\\\]" "first: ptype temp3"
-+
-+gdb_test "p temp1" " = '1' <repeats 26 times>" "first: print temp1"
-+gdb_test "p temp2" " = '2' <repeats 26 times>" "first: print temp2"
-+gdb_test "p temp3" " = '3' <repeats 48 times>" "first: print temp3"
-+
-+gdb_continue_to_breakpoint "break-here"
-+
-+gdb_test "whatis temp1" "type = char \\\[78\\\]" "second: whatis temp1"
-+gdb_test "whatis temp2" "type = char \\\[78\\\]" "second: whatis temp2"
-+gdb_test "whatis temp3" "type = char \\\[48\\\]" "second: whatis temp3"
-+
-+gdb_test "ptype temp1" "type = char \\\[78\\\]" "second: ptype temp1"
-+gdb_test "ptype temp2" "type = char \\\[78\\\]" "second: ptype temp2"
-+gdb_test "ptype temp3" "type = char \\\[48\\\]" "second: ptype temp3"
-+
-+gdb_test "p temp1" " = '1' <repeats 78 times>" "second: print temp1"
-+gdb_test "p temp2" " = '2' <repeats 78 times>" "second: print temp2"
-+gdb_test "p temp3" " = '3' <repeats 48 times>" "second: print temp3"
-Index: gdb-7.12.50.20170207/gdb/testsuite/gdb.cp/gdb9593.cc
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ gdb-7.12.50.20170207/gdb/testsuite/gdb.cp/gdb9593.cc 2017-02-26 19:15:36.601882344 +0100
-@@ -0,0 +1,180 @@
-+/* This testcase is part of GDB, the GNU debugger.
-+
-+ Copyright 2008, 2009 Free Software Foundation, Inc.
-+
-+ This program is free software; you can redistribute it and/or modify
-+ it under the terms of the GNU General Public License as published by
-+ the Free Software Foundation; either version 3 of the License, or
-+ (at your option) any later version.
-+
-+ This program is distributed in the hope that it will be useful,
-+ but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ GNU General Public License for more details.
-+
-+ You should have received a copy of the GNU General Public License
-+ along with this program. If not, see <http://www.gnu.org/licenses/>.
-+ */
-+#include <iostream>
-+
-+using namespace std;
-+
-+class NextOverThrowDerivates
-+{
-+
-+public:
-+
-+
-+ // Single throw an exception in this function.
-+ void function1()
-+ {
-+ throw 20;
-+ }
-+
-+ // Throw an exception in another function.
-+ void function2()
-+ {
-+ function1();
-+ }
-+
-+ // Throw an exception in another function, but handle it
-+ // locally.
-+ void function3 ()
-+ {
-+ {
-+ try
-+ {
-+ function1 ();
-+ }
-+ catch (...)
-+ {
-+ cout << "Caught and handled function1 exception" << endl;
-+ }
-+ }
-+ }
-+
-+ void rethrow ()
-+ {
-+ try
-+ {
-+ function1 ();
-+ }
-+ catch (...)
-+ {
-+ throw;
-+ }
-+ }
-+
-+ void finish ()
-+ {
-+ // We use this to test that a "finish" here does not end up in
-+ // this frame, but in the one above.
-+ try
-+ {
-+ function1 ();
-+ }
-+ catch (int x)
-+ {
-+ }
-+ function1 (); // marker for until
-+ }
-+
-+ void until ()
-+ {
-+ function1 ();
-+ function1 (); // until here
-+ }
-+
-+};
-+NextOverThrowDerivates next_cases;
-+
-+
-+int main ()
-+{
-+ try
-+ {
-+ next_cases.function1 ();
-+ }
-+ catch (...)
-+ {
-+ // Discard
-+ }
-+
-+ try
-+ {
-+ next_cases.function2 ();
-+ }
-+ catch (...)
-+ {
-+ // Discard
-+ }
-+
-+ try
-+ {
-+ // This is duplicated so we can next over one but step into
-+ // another.
-+ next_cases.function2 ();
-+ }
-+ catch (...)
-+ {
-+ // Discard
-+ }
-+
-+ next_cases.function3 ();
-+
-+ try
-+ {
-+ next_cases.rethrow ();
-+ }
-+ catch (...)
-+ {
-+ // Discard
-+ }
-+
-+ try
-+ {
-+ // Another duplicate so we can test "finish".
-+ next_cases.function2 ();
-+ }
-+ catch (...)
-+ {
-+ // Discard
-+ }
-+
-+ // Another test for "finish".
-+ try
-+ {
-+ next_cases.finish ();
-+ }
-+ catch (...)
-+ {
-+ }
-+
-+ // Test of "until".
-+ try
-+ {
-+ next_cases.finish ();
-+ }
-+ catch (...)
-+ {
-+ }
-+
-+ // Test of "until" with an argument.
-+ try
-+ {
-+ next_cases.until ();
-+ }
-+ catch (...)
-+ {
-+ }
-+
-+ // Test of "advance".
-+ try
-+ {
-+ next_cases.until ();
-+ }
-+ catch (...)
-+ {
-+ }
-+}
-+
-Index: gdb-7.12.50.20170207/gdb/testsuite/gdb.cp/gdb9593.exp
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ gdb-7.12.50.20170207/gdb/testsuite/gdb.cp/gdb9593.exp 2017-02-26 19:15:36.601882344 +0100
-@@ -0,0 +1,182 @@
-+# Copyright 2008, 2009 Free Software Foundation, Inc.
-+
-+# This program is free software; you can redistribute it and/or modify
-+# it under the terms of the GNU General Public License as published by
-+# the Free Software Foundation; either version 3 of the License, or
-+# (at your option) any later version.
-+#
-+# This program is distributed in the hope that it will be useful,
-+# but WITHOUT ANY WARRANTY; without even the implied warranty of
-+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+# GNU General Public License for more details.
-+#
-+# You should have received a copy of the GNU General Public License
-+# along with this program. If not, see <http://www.gnu.org/licenses/>.
-+
-+
-+if $tracelevel then {
-+ strace $tracelevel
-+}
-+
-+if { [skip_cplus_tests] } { continue }
-+
-+set testfile "gdb9593"
-+set srcfile ${testfile}.cc
-+set binfile [standard_output_file $testfile]
-+
-+# Create and source the file that provides information about the compiler
-+# used to compile the test case.
-+if [get_compiler_info "c++"] {
-+ untested gdb9593.exp
-+ return -1
-+}
-+
-+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug c++}] != "" } {
-+ untested gdb9593.exp
-+ return -1
-+}
-+
-+# Some targets can't do function calls, so don't even bother with this
-+# test.
-+if [target_info exists gdb,cannot_call_functions] {
-+ setup_xfail "*-*-*" 9593
-+ fail "This target can not call functions"
-+ continue
-+}
-+
-+gdb_exit
-+gdb_start
-+gdb_reinitialize_dir $srcdir/$subdir
-+gdb_load ${binfile}
-+
-+if ![runto_main] then {
-+ perror "couldn't run to main"
-+ continue
-+}
-+
-+# See whether we have the needed unwinder hooks.
-+set ok 1
-+gdb_test_multiple "print _Unwind_DebugHook" "check for unwinder hook" {
-+ -re "= .*_Unwind_DebugHook.*\r\n$gdb_prompt $" {
-+ pass "check for unwinder hook"
-+ }
-+ -re "No symbol .* in current context.\r\n$gdb_prompt $" {
-+ # Pass the test so we don't get bogus fails in the results.
-+ pass "check for unwinder hook"
-+ set ok 0
-+ }
-+}
-+if {!$ok} {
-+ untested gdb9593.exp
-+ return -1
-+}
-+
-+# See http://sourceware.org/bugzilla/show_bug.cgi?id=9593
-+
-+gdb_test "next" \
-+ ".*catch (...).*" \
-+ "next over a throw 1"
-+
-+gdb_test "next" \
-+ ".*next_cases.function2.*" \
-+ "next past catch 1"
-+
-+gdb_test "next" \
-+ ".*catch (...).*" \
-+ "next over a throw 2"
-+
-+gdb_test "next" \
-+ ".*next_cases.function2.*" \
-+ "next past catch 2"
-+
-+gdb_test "step" \
-+ ".*function1().*" \
-+ "step into function2 1"
-+
-+gdb_test "next" \
-+ ".*catch (...).*" \
-+ "next over a throw 3"
-+
-+gdb_test "next" \
-+ ".*next_cases.function3.*" \
-+ "next past catch 3"
-+
-+gdb_test "next" \
-+ ".*next_cases.rethrow.*" \
-+ "next over a throw 4"
-+
-+gdb_test "next" \
-+ ".*catch (...).*" \
-+ "next over a rethrow"
-+
-+gdb_test "next" \
-+ ".*next_cases.function2.*" \
-+ "next after a rethrow"
-+
-+gdb_test "step" \
-+ ".*function1().*" \
-+ "step into function2 2"
-+
-+gdb_test "finish" \
-+ ".*catch (...).*" \
-+ "finish 1"
-+
-+gdb_test "next" \
-+ ".*next_cases.finish ().*" \
-+ "next past catch 4"
-+
-+gdb_test "step" \
-+ ".*function1 ().*" \
-+ "step into finish method"
-+
-+gdb_test "finish" \
-+ ".*catch (...).*" \
-+ "finish 2"
-+
-+gdb_test "next" \
-+ ".*next_cases.finish ().*" \
-+ "next past catch 5"
-+
-+gdb_test "step" \
-+ ".*function1 ().*" \
-+ "step into finish, for until"
-+
-+gdb_test "until" \
-+ ".*function1 ().*" \
-+ "until with no argument 1"
-+
-+set line [gdb_get_line_number "marker for until" $testfile.cc]
-+
-+gdb_test "until $line" \
-+ ".*function1 ().*" \
-+ "next past catch 6"
-+
-+gdb_test "until" \
-+ ".*catch (...).*" \
-+ "until with no argument 2"
-+
-+set line [gdb_get_line_number "until here" $testfile.cc]
-+
-+gdb_test "next" \
-+ ".*next_cases.until ().*" \
-+ "next past catch 6"
-+
-+gdb_test "step" \
-+ ".*function1 ().*" \
-+ "step into until"
-+
-+gdb_test "until $line" \
-+ ".*catch (...).*" \
-+ "until-over-throw"
-+
-+gdb_test "next" \
-+ ".*next_cases.until ().*" \
-+ "next past catch 7"
-+
-+gdb_test "step" \
-+ ".*function1 ().*" \
-+ "step into until, for advance"
-+
-+gdb_test "advance $line" \
-+ ".*catch (...).*" \
-+ "advance-over-throw"
-Index: gdb-7.12.50.20170207/gdb/testsuite/gdb.dwarf2/dw2-bound-loclist.S
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ gdb-7.12.50.20170207/gdb/testsuite/gdb.dwarf2/dw2-bound-loclist.S 2017-02-26 19:15:36.601882344 +0100
-@@ -0,0 +1,246 @@
-+/* This testcase is part of GDB, the GNU debugger.
-+
-+ Copyright 2010 Free Software Foundation, Inc.
-+
-+ This program is free software; you can redistribute it and/or modify
-+ it under the terms of the GNU General Public License as published by
-+ the Free Software Foundation; either version 3 of the License, or
-+ (at your option) any later version.
-+
-+ This program is distributed in the hope that it will be useful,
-+ but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ GNU General Public License for more details.
-+
-+ You should have received a copy of the GNU General Public License
-+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
-+
-+/* Debug information */
-+
-+/* We will `break *main' at the very first instruction. */
-+#define main_length 1
-+
-+ .section .data
-+vardata:
-+ /* See DW_OP_lit3 + 1 (0-based). */
-+ .string "seennotseen"
-+
-+ .section .debug_info
-+.Lcu1_begin:
-+ .4byte .Lcu1_end - .Lcu1_start /* Length of Compilation Unit */
-+.Lcu1_start:
-+ .2byte 2 /* DWARF version number */
-+ .4byte .Ldebug_abbrev0 /* Offset Into Abbrev. Section */
-+ .byte 4 /* Pointer Size (in bytes) */
-+
-+ /* CU die */
-+ .uleb128 1 /* Abbrev: DW_TAG_compile_unit */
-+ .4byte .Lproducer /* DW_AT_producer */
-+ /* Use C++ to exploit a bug in parsing DW_AT_name "". */
-+ .byte 4 /* DW_AT_language (C++) - */
-+ .4byte main /* DW_AT_low_pc */
-+ .byte main_length /* DW_AT_high_pc */
-+
-+.Larray_type:
-+ .uleb128 2 /* Abbrev: DW_TAG_array_type */
-+ .4byte .Lchar_type-.Lcu1_begin /* DW_AT_type */
-+
-+ .uleb128 3 /* Abbrev: DW_TAG_subrange_type */
-+ .4byte .Luint_type-.Lcu1_begin /* DW_AT_type */
-+ .byte 0 /* DW_AT_lower_bound */
-+ .4byte .Llen_var-.Lcu1_begin /* DW_AT_upper_bound */
-+ .byte 0 /* End of children of die */
-+
-+ /* DW_AT_upper_bound is referencing an optimized-out variable. */
-+.Larrayb_type:
-+ .uleb128 2 /* Abbrev: DW_TAG_array_type */
-+ .4byte .Lchar_type-.Lcu1_begin /* DW_AT_type */
-+
-+ .uleb128 3 /* Abbrev: DW_TAG_subrange_type */
-+ .4byte .Luint_type-.Lcu1_begin /* DW_AT_type */
-+ .byte 0 /* DW_AT_lower_bound */
-+ .4byte .Llenb_var-.Lcu1_begin /* DW_AT_upper_bound */
-+ .byte 0 /* End of children of die */
-+
-+ /* DW_AT_upper_bound is referencing register. */
-+.Larrayreg_type:
-+ .uleb128 2 /* Abbrev: DW_TAG_array_type */
-+ .4byte .Lchar_type-.Lcu1_begin /* DW_AT_type */
-+
-+ .uleb128 8 /* Abbrev: DW_TAG_subrange_type with block */
-+ .4byte .Luint_type-.Lcu1_begin /* DW_AT_type */
-+ .byte 0 /* DW_AT_lower_bound */
-+ .byte 2f - 1f /* DW_AT_upper_bound */
-+1: .byte 0x50 /* DW_OP_reg0 */
-+2:
-+ .byte 0 /* End of children of die */
-+
-+.Luint_type:
-+ .uleb128 4 /* Abbrev: DW_TAG_base_type */
-+ .4byte .Luint_str /* DW_AT_name */
-+ .byte 4 /* DW_AT_byte_size */
-+ .byte 7 /* DW_AT_encoding */
-+
-+.Lchar_type:
-+ .uleb128 4 /* Abbrev: DW_TAG_base_type */
-+ .4byte .Lchar_str /* DW_AT_name */
-+ .byte 1 /* DW_AT_byte_size */
-+ .byte 6 /* DW_AT_encoding */
-+
-+.Llen_var:
-+ .uleb128 5 /* Abbrev: DW_TAG_variable artificial */
-+ .byte 1 /* DW_AT_artificial */
-+ .4byte .Luint_type-.Lcu1_begin /* DW_AT_type */
-+ .4byte .Llen_loclist-.Lloclist /* DW_AT_location */
-+
-+ /* optimized-out variable for b_string. */
-+.Llenb_var:
-+ .uleb128 7 /* Abbrev: DW_TAG_variable artificial no DW_AT_location */
-+ .byte 1 /* DW_AT_artificial */
-+ .4byte .Luint_type-.Lcu1_begin /* DW_AT_type */
-+
-+ .uleb128 6 /* Abbrev: DW_TAG_variable DW_FORM_string */
-+ .string "a_string" /* DW_AT_name */
-+ .4byte .Larray_type-.Lcu1_begin /* DW_AT_type */
-+ .byte 2f - 1f /* DW_AT_location */
-+1: .byte 3 /* DW_OP_addr */
-+ .4byte vardata /* <addr> */
-+2:
-+
-+ /* DW_AT_upper_bound is referencing an optimized-out variable. */
-+ .uleb128 6 /* Abbrev: DW_TAG_variable DW_FORM_string */
-+ .string "b_string" /* DW_AT_name */
-+ .4byte .Larrayb_type-.Lcu1_begin /* DW_AT_type */
-+ .byte 2f - 1f /* DW_AT_location */
-+1: .byte 3 /* DW_OP_addr */
-+ .4byte vardata /* <addr> */
-+2:
-+
-+ /* DW_AT_upper_bound is referencing register. */
-+ .uleb128 6 /* Abbrev: DW_TAG_variable DW_FORM_string */
-+ .string "reg_string" /* DW_AT_name */
-+ .4byte .Larrayreg_type-.Lcu1_begin /* DW_AT_type */
-+ .byte 2f - 1f /* DW_AT_location */
-+1: .byte 3 /* DW_OP_addr */
-+ .4byte vardata /* <addr> */
-+2:
-+
-+ .byte 0 /* End of children of CU */
-+.Lcu1_end:
-+
-+ .section .debug_loc
-+.Lloclist:
-+.Llen_loclist:
-+ .4byte 0 # Location list begin address
-+ .4byte main_length # Location list end address
-+ .value 2f-1f # Location expression size
-+1: .byte 0x33 # DW_OP_lit3
-+ .byte 0x9f # DW_OP_stack_value
-+2:
-+ .quad 0x0 # Location list terminator begin (*.LLST2)
-+ .quad 0x0 # Location list terminator end (*.LLST2)
-+
-+ .section .debug_abbrev
-+.Ldebug_abbrev0:
-+ .uleb128 1 /* Abbrev code */
-+ .uleb128 0x11 /* DW_TAG_compile_unit */
-+ .byte 0x1 /* has_children */
-+ .uleb128 0x25 /* DW_AT_producer */
-+ .uleb128 0xe /* DW_FORM_strp */
-+ .uleb128 0x13 /* DW_AT_language */
-+ .uleb128 0xb /* DW_FORM_data1 */
-+ .uleb128 0x11 /* DW_AT_low_pc */
-+ .uleb128 0x1 /* DW_FORM_addr */
-+ .uleb128 0x12 /* DW_AT_high_pc */
-+ .uleb128 0xb /* DW_FORM_data1 */
-+ .byte 0x0 /* Terminator */
-+ .byte 0x0 /* Terminator */
-+
-+ .uleb128 2 /* Abbrev code */
-+ .uleb128 0x1 /* TAG: DW_TAG_array_type */
-+ .byte 0x1 /* DW_children_yes */
-+ .uleb128 0x49 /* DW_AT_type */
-+ .uleb128 0x13 /* DW_FORM_ref4 */
-+ .byte 0x0 /* Terminator */
-+ .byte 0x0 /* Terminator */
-+
-+ .uleb128 3 /* Abbrev code */
-+ .uleb128 0x21 /* DW_TAG_subrange_type */
-+ .byte 0x0 /* no children */
-+ .uleb128 0x49 /* DW_AT_type */
-+ .uleb128 0x13 /* DW_FORM_ref4 */
-+ .uleb128 0x22 /* DW_AT_lower_bound */
-+ .uleb128 0xb /* DW_FORM_data1 */
-+ .uleb128 0x2f /* DW_AT_upper_bound */
-+ .uleb128 0x13 /* DW_FORM_ref4 */
-+ .byte 0x0 /* Terminator */
-+ .byte 0x0 /* Terminator */
-+
-+ .uleb128 4 /* Abbrev code */
-+ .uleb128 0x24 /* DW_TAG_base_type */
-+ .byte 0x0 /* no_children */
-+ .uleb128 0x3 /* DW_AT_name */
-+ .uleb128 0xe /* DW_FORM_strp */
-+ .uleb128 0xb /* DW_AT_byte_size */
-+ .uleb128 0xb /* DW_FORM_data1 */
-+ .uleb128 0x3e /* DW_AT_encoding */
-+ .uleb128 0xb /* DW_FORM_data1 */
-+ .byte 0x0 /* Terminator */
-+ .byte 0x0 /* Terminator */
-+
-+ .uleb128 5 /* Abbrev code */
-+ .uleb128 0x34 /* DW_TAG_variable */
-+ .byte 0x0 /* no_children */
-+ .uleb128 0x34 /* DW_AT_artificial */
-+ .uleb128 0x0c /* DW_FORM_flag */
-+ .uleb128 0x49 /* DW_AT_type */
-+ .uleb128 0x13 /* DW_FORM_ref4 */
-+ .uleb128 0x02 /* DW_AT_location */
-+ .uleb128 0x06 /* DW_FORM_data4 */
-+ .byte 0x0 /* Terminator */
-+ .byte 0x0 /* Terminator */
-+
-+ .uleb128 6 /* Abbrev code */
-+ .uleb128 0x34 /* DW_TAG_variable */
-+ .byte 0x0 /* no_children */
-+ .uleb128 0x3 /* DW_AT_name */
-+ .uleb128 0x8 /* DW_FORM_string */
-+ .uleb128 0x49 /* DW_AT_type */
-+ .uleb128 0x13 /* DW_FORM_ref4 */
-+ .uleb128 0x2 /* DW_AT_location */
-+ .uleb128 0xa /* DW_FORM_block1 */
-+ .byte 0x0 /* Terminator */
-+ .byte 0x0 /* Terminator */
-+
-+ .uleb128 7 /* Abbrev code */
-+ .uleb128 0x34 /* DW_TAG_variable */
-+ .byte 0x0 /* no_children */
-+ .uleb128 0x34 /* DW_AT_artificial */
-+ .uleb128 0x0c /* DW_FORM_flag */
-+ .uleb128 0x49 /* DW_AT_type */
-+ .uleb128 0x13 /* DW_FORM_ref4 */
-+ .byte 0x0 /* Terminator */
-+ .byte 0x0 /* Terminator */
-+
-+ .uleb128 8 /* Abbrev code */
-+ .uleb128 0x21 /* DW_TAG_subrange_type with block */
-+ .byte 0x0 /* no children */
-+ .uleb128 0x49 /* DW_AT_type */
-+ .uleb128 0x13 /* DW_FORM_ref4 */
-+ .uleb128 0x22 /* DW_AT_lower_bound */
-+ .uleb128 0xb /* DW_FORM_data1 */
-+ .uleb128 0x2f /* DW_AT_upper_bound */
-+ .uleb128 0xa /* DW_FORM_block1 */
-+ .byte 0x0 /* Terminator */
-+ .byte 0x0 /* Terminator */
-+
-+ .byte 0x0 /* Terminator */
-+
-+/* String table */
-+ .section .debug_str
-+.Lproducer:
-+ .string "GNU C 3.3.3"
-+.Lchar_str:
-+ .string "char"
-+.Luint_str:
-+ .string "unsigned int"
-Index: gdb-7.12.50.20170207/gdb/testsuite/gdb.dwarf2/dw2-bound-loclist.exp
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ gdb-7.12.50.20170207/gdb/testsuite/gdb.dwarf2/dw2-bound-loclist.exp 2017-02-26 19:15:36.602882352 +0100
-@@ -0,0 +1,66 @@
-+# Copyright 2010 Free Software Foundation, Inc.
-+
-+# This program is free software; you can redistribute it and/or modify
-+# it under the terms of the GNU General Public License as published by
-+# the Free Software Foundation; either version 3 of the License, or
-+# (at your option) any later version.
-+#
-+# This program is distributed in the hope that it will be useful,
-+# but WITHOUT ANY WARRANTY; without even the implied warranty of
-+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+# GNU General Public License for more details.
-+#
-+# You should have received a copy of the GNU General Public License
-+# along with this program. If not, see <http://www.gnu.org/licenses/>.
-+
-+# Test printing variable with dynamic bounds which reference a different
-+# (artificial in the GCC case) variable containing loclist as its location.
-+# This testcase uses value (not address) of the referenced variable:
-+# http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43762
-+
-+# This test can only be run on targets which support DWARF-2 and use gas.
-+# For now pick a sampling of likely targets.
-+if {![istarget *-*-linux*]
-+ && ![istarget *-*-gnu*]
-+ && ![istarget *-*-elf*]
-+ && ![istarget *-*-openbsd*]
-+ && ![istarget arm-*-eabi*]
-+ && ![istarget powerpc-*-eabi*]} {
-+ return 0
-+}
-+
-+set testfile dw2-bound-loclist
-+if { [prepare_for_testing ${testfile}.exp ${testfile} [list ${testfile}.S main.c] {}] } {
-+ return -1
-+}
-+
-+# Verify it behaves at least as an unbound array without inferior.
-+
-+# FIXME: FSF GDB crashes due to !has_stack_frames ().
-+# But in practice that should not happen.
-+# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=43762
-+#set test "p a_string"
-+#gdb_test_multiple $test $test {
-+# -re " = 0x\[0-9a-f\]+ \"seennotseen\"\r\n$gdb_prompt $" {
-+# pass $test
-+# }
-+# -re "No registers\\.\r\n$gdb_prompt $" {
-+# kfail "vlaregression" $test
-+# }
-+#}
-+#
-+#gdb_test "ptype a_string" {type = char \[variable length\]}
-+
-+# Not runto_main as dw2-bound-loclist.S handles only the first byte of main.
-+if ![runto "*main"] {
-+ return -1
-+}
-+
-+gdb_test "p a_string" { = "seen"}
-+gdb_test "ptype a_string" {type = char \[4\]}
-+
-+gdb_test "p b_string" { = (0x[0-9a-f]+ )?"seennotseen"}
-+gdb_test "ptype b_string" {type = char \[\]}
-+
-+# The register contains unpredictable value - the array size.
-+gdb_test "ptype reg_string" {type = char \[-?[0-9]+\]}
-Index: gdb-7.12.50.20170207/gdb/testsuite/gdb.dwarf2/dw2-stripped.c
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ gdb-7.12.50.20170207/gdb/testsuite/gdb.dwarf2/dw2-stripped.c 2017-02-26 19:15:36.602882352 +0100
-@@ -0,0 +1,42 @@
-+/* This testcase is part of GDB, the GNU debugger.
-+
-+ Copyright 2004 Free Software Foundation, Inc.
-+
-+ This program is free software; you can redistribute it and/or modify
-+ it under the terms of the GNU General Public License as published by
-+ the Free Software Foundation; either version 2 of the License, or
-+ (at your option) any later version.
-+
-+ This program is distributed in the hope that it will be useful,
-+ but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ GNU General Public License for more details.
-+
-+ You should have received a copy of the GNU General Public License
-+ along with this program; if not, write to the Free Software
-+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
-+ USA. */
-+
-+
-+/* The function `func1' traced into must have debug info on offset > 0;
-+ (DW_UNSND (attr)). This is the reason of `func0' existence. */
-+
-+void
-+func0(int a, int b)
-+{
-+}
-+
-+/* `func1' being traced into must have some arguments to dump. */
-+
-+void
-+func1(int a, int b)
-+{
-+ func0 (a,b);
-+}
-+
-+int
-+main(void)
-+{
-+ func1 (1, 2);
-+ return 0;
-+}
-Index: gdb-7.12.50.20170207/gdb/testsuite/gdb.dwarf2/dw2-stripped.exp
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ gdb-7.12.50.20170207/gdb/testsuite/gdb.dwarf2/dw2-stripped.exp 2017-02-26 19:15:36.602882352 +0100
-@@ -0,0 +1,79 @@
-+# Copyright 2006 Free Software Foundation, Inc.
-+
-+# This program is free software; you can redistribute it and/or modify
-+# it under the terms of the GNU General Public License as published by
-+# the Free Software Foundation; either version 2 of the License, or
-+# (at your option) any later version.
-+#
-+# This program is distributed in the hope that it will be useful,
-+# but WITHOUT ANY WARRANTY; without even the implied warranty of
-+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+# GNU General Public License for more details.
-+#
-+# You should have received a copy of the GNU General Public License
-+# along with this program; if not, write to the Free Software
-+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-+
-+# Minimal DWARF-2 unit test
-+
-+# This test can only be run on targets which support DWARF-2.
-+# For now pick a sampling of likely targets.
-+if {![istarget *-*-linux*]
-+ && ![istarget *-*-gnu*]
-+ && ![istarget *-*-elf*]
-+ && ![istarget *-*-openbsd*]
-+ && ![istarget arm-*-eabi*]
-+ && ![istarget powerpc-*-eabi*]} {
-+ return 0
-+}
-+
-+set testfile "dw2-stripped"
-+set srcfile ${testfile}.c
-+set binfile [standard_output_file ${testfile}.x]
-+
-+remote_exec build "rm -f ${binfile}"
-+
-+# get the value of gcc_compiled
-+if [get_compiler_info ${binfile}] {
-+ return -1
-+}
-+
-+# This test can only be run on gcc as we use additional_flags=FIXME
-+if {$gcc_compiled == 0} {
-+ return 0
-+}
-+
-+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug additional_flags=-ggdb3}] != "" } {
-+ return -1
-+}
-+
-+remote_exec build "objcopy -R .debug_loc ${binfile}"
-+set strip_output [remote_exec build "objdump -h ${binfile}"]
-+
-+set test "stripping test file preservation"
-+if [ regexp ".debug_info " $strip_output] {
-+ pass "$test (.debug_info preserved)"
-+} else {
-+ fail "$test (.debug_info got also stripped)"
-+}
-+
-+set test "stripping test file functionality"
-+if [ regexp ".debug_loc " $strip_output] {
-+ fail "$test (.debug_loc still present)"
-+} else {
-+ pass "$test (.debug_loc stripped)"
-+}
-+
-+gdb_exit
-+gdb_start
-+gdb_reinitialize_dir $srcdir/$subdir
-+gdb_load ${binfile}
-+
-+# For C programs, "start" should stop in main().
-+
-+gdb_test "start" \
-+ ".*main \\(\\) at .*" \
-+ "start"
-+gdb_test "step" \
-+ "func.* \\(.*\\) at .*" \
-+ "step"
-Index: gdb-7.12.50.20170207/gdb/testsuite/gdb.dwarf2/dw2-struct-member-data-location.S
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ gdb-7.12.50.20170207/gdb/testsuite/gdb.dwarf2/dw2-struct-member-data-location.S 2017-02-26 19:15:36.602882352 +0100
-@@ -0,0 +1,83 @@
-+/* This testcase is part of GDB, the GNU debugger.
-+
-+ Copyright 2009 Free Software Foundation, Inc.
-+
-+ This program is free software; you can redistribute it and/or modify
-+ it under the terms of the GNU General Public License as published by
-+ the Free Software Foundation; either version 3 of the License, or
-+ (at your option) any later version.
-+
-+ This program is distributed in the hope that it will be useful,
-+ but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ GNU General Public License for more details.
-+
-+ You should have received a copy of the GNU General Public License
-+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
-+
-+/* Debug information */
-+
-+ .section .debug_info
-+.Lcu1_begin:
-+ /* CU header */
-+ .4byte .Lcu1_end - .Lcu1_start /* Length of Compilation Unit */
-+.Lcu1_start:
-+ .2byte 2 /* DWARF Version */
-+ .4byte .Labbrev1_begin /* Offset into abbrev section */
-+ .byte 4 /* Pointer size */
-+
-+ /* CU die */
-+ .uleb128 1 /* Abbrev: DW_TAG_compile_unit */
-+ .ascii "dw2-struct-member-data-location.c\0" /* DW_AT_name */
-+ .ascii "GNU C 4.3.2\0" /* DW_AT_producer */
-+ .byte 1 /* DW_AT_language (C) */
-+
-+.Ltype_uchar:
-+ .uleb128 2 /* Abbrev: DW_TAG_structure_type */
-+ .ascii "some_struct\0" /* DW_AT_name */
-+
-+ .uleb128 3 /* Abbrev: DW_TAG_member */
-+ .ascii "field\0" /* DW_AT_name */
-+ .byte 0 /* DW_AT_data_member_location */
-+
-+ .byte 0 /* End of children of some_struct */
-+
-+ .byte 0 /* End of children of CU */
-+
-+.Lcu1_end:
-+
-+/* Abbrev table */
-+ .section .debug_abbrev
-+.Labbrev1_begin:
-+ .uleb128 1 /* Abbrev code */
-+ .uleb128 0x11 /* DW_TAG_compile_unit */
-+ .byte 1 /* has_children */
-+ .uleb128 0x3 /* DW_AT_name */
-+ .uleb128 0x8 /* DW_FORM_string */
-+ .uleb128 0x25 /* DW_AT_producer */
-+ .uleb128 0x8 /* DW_FORM_string */
-+ .uleb128 0x13 /* DW_AT_language */
-+ .uleb128 0xb /* DW_FORM_data1 */
-+ .byte 0x0 /* Terminator */
-+ .byte 0x0 /* Terminator */
-+
-+ .uleb128 2 /* Abbrev code */
-+ .uleb128 0x13 /* DW_TAG_structure_type */
-+ .byte 1 /* has_children */
-+ .uleb128 0x3 /* DW_AT_name */
-+ .uleb128 0x8 /* DW_FORM_string */
-+ .byte 0x0 /* Terminator */
-+ .byte 0x0 /* Terminator */
-+
-+ .uleb128 3 /* Abbrev code */
-+ .uleb128 0x0d /* DW_TAG_member */
-+ .byte 0 /* has_children */
-+ .uleb128 0x3 /* DW_AT_name */
-+ .uleb128 0x8 /* DW_FORM_string */
-+ .uleb128 0x38 /* DW_AT_data_member_location */
-+ .uleb128 0x0b /* DW_FORM_data1 */
-+ .byte 0x0 /* Terminator */
-+ .byte 0x0 /* Terminator */
-+
-+ .byte 0x0 /* Terminator */
-+ .byte 0x0 /* Terminator */
-Index: gdb-7.12.50.20170207/gdb/testsuite/gdb.dwarf2/dw2-struct-member-data-location.exp
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ gdb-7.12.50.20170207/gdb/testsuite/gdb.dwarf2/dw2-struct-member-data-location.exp 2017-02-26 19:15:36.602882352 +0100
-@@ -0,0 +1,37 @@
-+# Copyright 2009 Free Software Foundation, Inc.
-+
-+# This program is free software; you can redistribute it and/or modify
-+# it under the terms of the GNU General Public License as published by
-+# the Free Software Foundation; either version 3 of the License, or
-+# (at your option) any later version.
-+#
-+# This program is distributed in the hope that it will be useful,
-+# but WITHOUT ANY WARRANTY; without even the implied warranty of
-+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+# GNU General Public License for more details.
-+#
-+# You should have received a copy of the GNU General Public License
-+# along with this program. If not, see <http://www.gnu.org/licenses/>.
-+
-+# This test can only be run on targets which support DWARF-2 and use gas.
-+# For now pick a sampling of likely targets.
-+if {![istarget *-*-linux*]
-+ && ![istarget *-*-gnu*]
-+ && ![istarget *-*-elf*]
-+ && ![istarget *-*-openbsd*]
-+ && ![istarget arm-*-eabi*]
-+ && ![istarget powerpc-*-eabi*]} {
-+ return 0
-+}
-+
-+set testfile "dw2-struct-member-data-location"
-+set srcfile ${testfile}.S
-+set binfile ${testfile}.x
-+
-+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "[standard_output_file ${binfile}]" object {nodebug}] != "" } {
-+ return -1
-+}
-+
-+clean_restart $binfile
-+
-+gdb_test "ptype struct some_struct" "type = struct some_struct {\[\r\n \t\]*void field;\[\r\n \t\]*}"
-Index: gdb-7.12.50.20170207/gdb/testsuite/gdb.dwarf2/dw2-subrange-no-type.S
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ gdb-7.12.50.20170207/gdb/testsuite/gdb.dwarf2/dw2-subrange-no-type.S 2017-02-26 19:15:36.602882352 +0100
-@@ -0,0 +1,121 @@
-+/* This testcase is part of GDB, the GNU debugger.
-+
-+ Copyright 2012 Free Software Foundation, Inc.
-+
-+ This program is free software; you can redistribute it and/or modify
-+ it under the terms of the GNU General Public License as published by
-+ the Free Software Foundation; either version 3 of the License, or
-+ (at your option) any later version.
-+
-+ This program is distributed in the hope that it will be useful,
-+ but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ GNU General Public License for more details.
-+
-+ You should have received a copy of the GNU General Public License
-+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
-+
-+/* Debug information */
-+
-+ .section .data
-+vardata:
-+ .rept 129
-+ .ascii "x"
-+ .endr
-+ .ascii "UNSEEN\0"
-+
-+ .section .debug_info
-+.Lcu1_begin:
-+ .4byte .Lcu1_end - .Lcu1_start /* Length of Compilation Unit */
-+.Lcu1_start:
-+ .2byte 2 /* DWARF version number */
-+ .4byte .Ldebug_abbrev0 /* Offset Into Abbrev. Section */
-+ .byte 4 /* Pointer Size (in bytes) */
-+
-+ /* CU die */
-+ .uleb128 1 /* Abbrev: DW_TAG_compile_unit */
-+ .ascii "GNU C 3.3.3\0" /* DW_AT_producer */
-+ .byte 2 /* DW_AT_language (C) - */
-+
-+.Larray_type:
-+ .uleb128 2 /* Abbrev: DW_TAG_array_type */
-+ .4byte .Lchar_type-.Lcu1_begin /* DW_AT_type */
-+
-+ .uleb128 8 /* Abbrev: DW_TAG_subrange_type without DW_AT_type */
-+ .byte 0 /* DW_AT_lower_bound */
-+ .byte 128 /* DW_AT_upper_bound */
-+
-+ .byte 0 /* End of children of die */
-+
-+.Lchar_type:
-+ .uleb128 4 /* Abbrev: DW_TAG_base_type */
-+ .ascii "char\0" /* DW_AT_name */
-+ .byte 1 /* DW_AT_byte_size */
-+ .byte 6 /* DW_AT_encoding */
-+
-+ .uleb128 6 /* Abbrev: DW_TAG_variable DW_FORM_string */
-+ .ascii "notype_string\0" /* DW_AT_name */
-+ .4byte .Larray_type-.Lcu1_begin /* DW_AT_type */
-+ .byte 2f - 1f /* DW_AT_location */
-+1: .byte 3 /* DW_OP_addr */
-+ .4byte vardata /* <addr> */
-+2:
-+
-+ .byte 0 /* End of children of CU */
-+.Lcu1_end:
-+
-+ .section .debug_abbrev
-+.Ldebug_abbrev0:
-+ .uleb128 1 /* Abbrev code */
-+ .uleb128 0x11 /* DW_TAG_compile_unit */
-+ .byte 0x1 /* has_children */
-+ .uleb128 0x25 /* DW_AT_producer */
-+ .uleb128 0x8 /* DW_FORM_string */
-+ .uleb128 0x13 /* DW_AT_language */
-+ .uleb128 0xb /* DW_FORM_data1 */
-+ .byte 0x0 /* Terminator */
-+ .byte 0x0 /* Terminator */
-+
-+ .uleb128 2 /* Abbrev code */
-+ .uleb128 0x1 /* TAG: DW_TAG_array_type */
-+ .byte 0x1 /* DW_children_yes */
-+ .uleb128 0x49 /* DW_AT_type */
-+ .uleb128 0x13 /* DW_FORM_ref4 */
-+ .byte 0x0 /* Terminator */
-+ .byte 0x0 /* Terminator */
-+
-+ .uleb128 4 /* Abbrev code */
-+ .uleb128 0x24 /* DW_TAG_base_type */
-+ .byte 0x0 /* no_children */
-+ .uleb128 0x3 /* DW_AT_name */
-+ .uleb128 0x8 /* DW_FORM_string */
-+ .uleb128 0xb /* DW_AT_byte_size */
-+ .uleb128 0xb /* DW_FORM_data1 */
-+ .uleb128 0x3e /* DW_AT_encoding */
-+ .uleb128 0xb /* DW_FORM_data1 */
-+ .byte 0x0 /* Terminator */
-+ .byte 0x0 /* Terminator */
-+
-+ .uleb128 6 /* Abbrev code */
-+ .uleb128 0x34 /* DW_TAG_variable */
-+ .byte 0x0 /* no_children */
-+ .uleb128 0x3 /* DW_AT_name */
-+ .uleb128 0x8 /* DW_FORM_string */
-+ .uleb128 0x49 /* DW_AT_type */
-+ .uleb128 0x13 /* DW_FORM_ref4 */
-+ .uleb128 0x2 /* DW_AT_location */
-+ .uleb128 0xa /* DW_FORM_block1 */
-+ .byte 0x0 /* Terminator */
-+ .byte 0x0 /* Terminator */
-+
-+ .uleb128 8 /* Abbrev code */
-+ .uleb128 0x21 /* DW_TAG_subrange_type without DW_AT_type */
-+ .byte 0x0 /* no children */
-+ .uleb128 0x22 /* DW_AT_lower_bound */
-+ .uleb128 0xb /* DW_FORM_data1 */
-+ .uleb128 0x2f /* DW_AT_upper_bound */
-+ .uleb128 0xb /* DW_FORM_data1 */
-+ .byte 0x0 /* Terminator */
-+ .byte 0x0 /* Terminator */
-+
-+ .byte 0x0 /* Terminator */
-Index: gdb-7.12.50.20170207/gdb/testsuite/gdb.dwarf2/dw2-subrange-no-type.exp
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ gdb-7.12.50.20170207/gdb/testsuite/gdb.dwarf2/dw2-subrange-no-type.exp 2017-02-26 19:15:36.603882359 +0100
-@@ -0,0 +1,39 @@
-+# Copyright 2012 Free Software Foundation, Inc.
-+
-+# This program is free software; you can redistribute it and/or modify
-+# it under the terms of the GNU General Public License as published by
-+# the Free Software Foundation; either version 3 of the License, or
-+# (at your option) any later version.
-+#
-+# This program is distributed in the hope that it will be useful,
-+# but WITHOUT ANY WARRANTY; without even the implied warranty of
-+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+# GNU General Public License for more details.
-+#
-+# You should have received a copy of the GNU General Public License
-+# along with this program. If not, see <http://www.gnu.org/licenses/>.
-+load_lib dwarf.exp
-+
-+# https://bugzilla.redhat.com/show_bug.cgi?id=806920
-+# read_subrange_type <TYPE_CODE (base_type) == TYPE_CODE_VOID> reinitialization
-+# of BASE_TYPE was done too late, it affects DW_TAG_subrange_type without
-+# specified DW_AT_type, present only in XLF produced code.
-+
-+# This test can only be run on targets which support DWARF-2 and use gas.
-+if {![dwarf2_support]} {
-+ return 0
-+}
-+
-+set testfile dw2-subrange-no-type
-+set srcfile ${testfile}.S
-+set executable ${testfile}.x
-+set binfile [standard_output_file ${executable}]
-+
-+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" object {}] != "" } {
-+ return -1
-+}
-+
-+clean_restart $executable
-+
-+gdb_test "ptype notype_string" {type = char \[129\]}
-+gdb_test "p notype_string" " = 'x' <repeats 129 times>"
-Index: gdb-7.12.50.20170207/gdb/testsuite/gdb.fortran/dwarf-stride.exp
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ gdb-7.12.50.20170207/gdb/testsuite/gdb.fortran/dwarf-stride.exp 2017-02-26 19:15:36.603882359 +0100
-@@ -0,0 +1,42 @@
-+# Copyright 2009 Free Software Foundation, Inc.
-+
-+# This program is free software; you can redistribute it and/or modify
-+# it under the terms of the GNU General Public License as published by
-+# the Free Software Foundation; either version 2 of the License, or
-+# (at your option) any later version.
-+#
-+# This program is distributed in the hope that it will be useful,
-+# but WITHOUT ANY WARRANTY; without even the implied warranty of
-+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+# GNU General Public License for more details.
-+#
-+# You should have received a copy of the GNU General Public License
-+# along with this program; if not, write to the Free Software
-+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-+
-+# This file was written by Jan Kratochvil <jan.kratochvil(a)redhat.com>.
-+
-+# This file is part of the gdb testsuite. Array element stride must not be
-+# specified in the number of elements but in a number of bytes instead.
-+# Original problem:
-+# (gdb) p c40pt(1)
-+# $1 = '0-hello', ' ' <repeats 33 times>
-+# (gdb) p c40pt(2)
-+# warning: Fortran array stride not divisible by the element size
-+
-+set testfile dwarf-stride
-+set srcfile ${testfile}.f90
-+
-+if { [prepare_for_testing ${testfile}.exp ${testfile} ${srcfile} {debug f90}] } {
-+ return -1
-+}
-+
-+if ![runto MAIN__] then {
-+ perror "couldn't run to breakpoint MAIN__"
-+ continue
-+}
-+
-+gdb_breakpoint [gdb_get_line_number "break-here"]
-+gdb_continue_to_breakpoint "break-here" ".*break-here.*"
-+gdb_test "p c40pt(1)" " = '0-hello.*"
-+gdb_test "p c40pt(2)" " = '1-hello.*"
-Index: gdb-7.12.50.20170207/gdb/testsuite/gdb.fortran/dwarf-stride.f90
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ gdb-7.12.50.20170207/gdb/testsuite/gdb.fortran/dwarf-stride.f90 2017-02-26 19:15:36.603882359 +0100
-@@ -0,0 +1,40 @@
-+! Copyright 2009 Free Software Foundation, Inc.
-+!
-+! This program is free software; you can redistribute it and/or modify
-+! it under the terms of the GNU General Public License as published by
-+! the Free Software Foundation; either version 2 of the License, or
-+! (at your option) any later version.
-+!
-+! This program is distributed in the hope that it will be useful,
-+! but WITHOUT ANY WARRANTY; without even the implied warranty of
-+! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+! GNU General Public License for more details.
-+!
-+! You should have received a copy of the GNU General Public License
-+! along with this program; if not, write to the Free Software
-+! Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-+!
-+! File written by Alan Matsuoka.
-+
-+program repro
-+
-+ type small_stride
-+ character*40 long_string
-+ integer small_pad
-+ end type small_stride
-+
-+ type(small_stride), dimension (20), target :: unpleasant
-+ character*40, pointer, dimension(:):: c40pt
-+
-+ integer i
-+
-+ do i = 0,19
-+ unpleasant(i+1)%small_pad = i+1
-+ unpleasant(i+1)%long_string = char (ichar('0') + i) // '-hello'
-+ end do
-+
-+ c40pt => unpleasant%long_string
-+
-+ print *, c40pt ! break-here
-+
-+end program repro
-Index: gdb-7.12.50.20170207/gdb/testsuite/gdb.fortran/dynamic.exp
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ gdb-7.12.50.20170207/gdb/testsuite/gdb.fortran/dynamic.exp 2017-02-26 19:15:36.603882359 +0100
-@@ -0,0 +1,154 @@
-+# Copyright 2007 Free Software Foundation, Inc.
-+
-+# This program is free software; you can redistribute it and/or modify
-+# it under the terms of the GNU General Public License as published by
-+# the Free Software Foundation; either version 2 of the License, or
-+# (at your option) any later version.
-+#
-+# This program is distributed in the hope that it will be useful,
-+# but WITHOUT ANY WARRANTY; without even the implied warranty of
-+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+# GNU General Public License for more details.
-+#
-+# You should have received a copy of the GNU General Public License
-+# along with this program; if not, write to the Free Software
-+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-+
-+# This file was written by Jan Kratochvil <jan.kratochvil(a)redhat.com>.
-+
-+# This file is part of the gdb testsuite. It contains tests for dynamically
-+# allocated Fortran arrays.
-+# It depends on the GCC dynamic Fortran arrays DWARF support:
-+# http://gcc.gnu.org/bugzilla/show_bug.cgi?id=22244
-+
-+set testfile "dynamic"
-+set srcfile ${testfile}.f90
-+set binfile [standard_output_file ${testfile}]
-+
-+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug f90 quiet}] != "" } {
-+ untested "Couldn't compile ${srcfile}"
-+ return -1
-+}
-+
-+gdb_exit
-+gdb_start
-+gdb_reinitialize_dir $srcdir/$subdir
-+gdb_load ${binfile}
-+
-+if ![runto MAIN__] then {
-+ perror "couldn't run to breakpoint MAIN__"
-+ continue
-+}
-+
-+gdb_breakpoint [gdb_get_line_number "varx-init"]
-+gdb_continue_to_breakpoint "varx-init"
-+
-+# http://www.cs.rpi.edu/~szymansk/OOF90/bugs.html#5
-+# Do not: gdb_test "p varx" "\\$\[0-9\]* = <not allocated>" "p varx unallocated"
-+# Do not: gdb_test "ptype varx" {type = real\(kind=4\) \(:,:,:\)} "ptype varx unallocated"
-+# Do not: gdb_test "p varx(1,5,17)" {no such vector element \(vector not allocated\)} "p varx(1,5,17) unallocated"
-+# Do not: gdb_test "p varx(1,5,17)=1" {no such vector element \(vector not allocated\)} "p varx(1,5,17)=1 unallocated"
-+# Do not: gdb_test "ptype varx(1,5,17)" {no such vector element \(vector not allocated\)} "ptype varx(1,5,17) unallocated"
-+
-+gdb_breakpoint [gdb_get_line_number "varx-allocated"]
-+gdb_continue_to_breakpoint "varx-allocated"
-+# $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"
-+# 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"
-+
-+gdb_breakpoint [gdb_get_line_number "varx-filled"]
-+gdb_continue_to_breakpoint "varx-filled"
-+gdb_test "p varx(2, 5, 17)" "\\$\[0-9\]* = 6"
-+gdb_test "p varx(1, 5, 17)" "\\$\[0-9\]* = 7"
-+gdb_test "p varx(2, 6, 18)" "\\$\[0-9\]* = 8"
-+gdb_test "p varx(6, 15, 28)" "\\$\[0-9\]* = 9"
-+# http://www.cs.rpi.edu/~szymansk/OOF90/bugs.html#5
-+# Do not: gdb_test "p varv" "\\$\[0-9\]* = <not associated>" "p varv unassociated"
-+# Do not: gdb_test "ptype varv" {type = real\(kind=4\) \(:,:,:\)} "ptype varv unassociated"
-+
-+set test "output varx"
-+gdb_test_multiple $test $test {
-+ -re "^output varx\r\n\[() ,6789.\]*$gdb_prompt $" {
-+ pass $test
-+ }
-+}
-+
-+gdb_breakpoint [gdb_get_line_number "varv-associated"]
-+gdb_continue_to_breakpoint "varv-associated"
-+gdb_test "p varx(3, 7, 19)" "\\$\[0-9\]* = 6" "p varx(3, 7, 19) with varv associated"
-+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"
-+# 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"
-+
-+gdb_breakpoint [gdb_get_line_number "varv-filled"]
-+gdb_continue_to_breakpoint "varv-filled"
-+gdb_test "p varx(3, 7, 19)" "\\$\[0-9\]* = 10" "p varx(3, 7, 19) with varv filled"
-+gdb_test "p varv(3, 7, 19)" "\\$\[0-9\]* = 10" "p varv(3, 7, 19) filled"
-+
-+gdb_breakpoint [gdb_get_line_number "varv-deassociated"]
-+gdb_continue_to_breakpoint "varv-deassociated"
-+# The latter one is for the Intel Fortran Compiler 10.1.008 pointer type.
-+gdb_test "p varv" "\\$\[0-9\]* = (<not associated>|.*(Cannot access it|Unable to access the object) because the object is not associated.)" "p varv deassociated"
-+gdb_test "ptype varv" {type = real\(kind=4\) \(:,:,:\)} "ptype varv deassociated"
-+gdb_test "p l" "\\$\[0-9\]* = \\.FALSE\\." "p l if varv deassociated"
-+gdb_test "p varv(1,5,17)" {no such vector element \(vector not associated\)}
-+gdb_test "ptype varv(1,5,17)" {no such vector element \(vector not associated\)}
-+
-+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 "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"
-+
-+gdb_breakpoint [gdb_get_line_number "vary-passed"]
-+gdb_continue_to_breakpoint "vary-passed"
-+# $1 = (( ( 1, 1, 1, 1, 1, 1) ( 1, 1, 1, 1, 1, 1) --- , 1) ) ( ( 1, 1, ...) ...) ...)
-+gdb_test "p vary" "\\$\[0-9\]* = \\(\[()1, .\]*\\)"
-+
-+gdb_breakpoint [gdb_get_line_number "vary-filled"]
-+gdb_continue_to_breakpoint "vary-filled"
-+gdb_test "ptype vary" "type = real(\\(kind=4\\)|\\*4) \\(10,10\\)"
-+gdb_test "p vary(1, 1)" "\\$\[0-9\]* = 8"
-+gdb_test "p vary(2, 2)" "\\$\[0-9\]* = 9"
-+gdb_test "p vary(1, 3)" "\\$\[0-9\]* = 10"
-+# $1 = (( ( 3, 3, 3, 3, 3, 3) ( 3, 3, 3, 3, 3, 3) --- , 3) ) ( ( 3, 3, ...) ...) ...)
-+gdb_test "p varw" "\\$\[0-9\]* = \\(\[()3, .\]*\\)"
-+
-+gdb_breakpoint [gdb_get_line_number "varw-almostfilled"]
-+gdb_continue_to_breakpoint "varw-almostfilled"
-+gdb_test "ptype varw" "type = real(\\(kind=4\\)|\\*4) \\(5,4,3\\)"
-+gdb_test "p varw(3,1,1)=1" "\\$\[0-9\]* = 1"
-+# $1 = (( ( 6, 5, 1, 5, 5, 5) ( 5, 5, 5, 5, 5, 5) --- , 5) ) ( ( 5, 5, ...) ...) ...)
-+gdb_test "p varw" "\\$\[0-9\]* = \\( *\\( *\\( *6, *5, *1,\[()5, .\]*\\)" "p varw filled"
-+# "up" works with GCC but other Fortran compilers may copy the values into the
-+# outer function only on the exit of the inner function.
-+# We need both variants as depending on the arch we optionally may still be
-+# executing the caller line or not after `finish'.
-+gdb_test "finish" ".*(call bar \\(y, x\\)|call foo \\(x, z\\(2:6, 4:7, 6:8\\)\\))"
-+gdb_test "p z(2,4,5)" "\\$\[0-9\]* = 3"
-+gdb_test "p z(2,4,6)" "\\$\[0-9\]* = 6"
-+gdb_test "p z(2,4,7)" "\\$\[0-9\]* = 5"
-+gdb_test "p z(4,4,6)" "\\$\[0-9\]* = 1"
-+
-+gdb_breakpoint [gdb_get_line_number "varz-almostfilled"]
-+gdb_continue_to_breakpoint "varz-almostfilled"
-+# GCC uses the pointer type here, Intel Fortran Compiler 10.1.008 does not.
-+gdb_test "ptype varz" "type = (PTR TO -> \\( )?real(\\(kind=4\\)|\\*4) \\(\\*\\)\\)?"
-+# Intel Fortran Compiler 10.1.008 has a bug here - (2:11,7:7)
-+# as it produces DW_AT_lower_bound == DW_AT_upper_bound == 7.
-+gdb_test "ptype vart" "type = (PTR TO -> \\( )?real(\\(kind=4\\)|\\*4) \\(2:11,7:\\*\\)\\)?"
-+gdb_test "p varz" "\\$\[0-9\]* = \\(\\)"
-+gdb_test "p vart" "\\$\[0-9\]* = \\(\\)"
-+gdb_test "p varz(3)" "\\$\[0-9\]* = 4"
-+# maps to foo::vary(1,1)
-+gdb_test "p vart(2,7)" "\\$\[0-9\]* = 8"
-+# maps to foo::vary(2,2)
-+gdb_test "p vart(3,8)" "\\$\[0-9\]* = 9"
-+# maps to foo::vary(1,3)
-+gdb_test "p vart(2,9)" "\\$\[0-9\]* = 10"
-Index: gdb-7.12.50.20170207/gdb/testsuite/gdb.fortran/dynamic.f90
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ gdb-7.12.50.20170207/gdb/testsuite/gdb.fortran/dynamic.f90 2017-02-26 19:15:36.603882359 +0100
-@@ -0,0 +1,98 @@
-+! Copyright 2007 Free Software Foundation, Inc.
-+!
-+! This program is free software; you can redistribute it and/or modify
-+! it under the terms of the GNU General Public License as published by
-+! the Free Software Foundation; either version 2 of the License, or
-+! (at your option) any later version.
-+!
-+! This program is distributed in the hope that it will be useful,
-+! but WITHOUT ANY WARRANTY; without even the implied warranty of
-+! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+! GNU General Public License for more details.
-+!
-+! You should have received a copy of the GNU General Public License
-+! along with this program; if not, write to the Free Software
-+! Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-+!
-+! Ihis file is the Fortran source file for dynamic.exp.
-+! Original file written by Jakub Jelinek <jakub(a)redhat.com>.
-+! Modified for the GDB testcase by Jan Kratochvil <jan.kratochvil(a)redhat.com>.
-+
-+subroutine baz
-+ real, target, allocatable :: varx (:, :, :)
-+ real, pointer :: varv (:, :, :)
-+ real, target :: varu (1, 2, 3)
-+ logical :: l
-+ allocate (varx (1:6, 5:15, 17:28)) ! varx-init
-+ l = allocated (varx)
-+ varx(:, :, :) = 6 ! varx-allocated
-+ varx(1, 5, 17) = 7
-+ varx(2, 6, 18) = 8
-+ varx(6, 15, 28) = 9
-+ varv => varx ! varx-filled
-+ l = associated (varv)
-+ varv(3, 7, 19) = 10 ! varv-associated
-+ varv => null () ! varv-filled
-+ l = associated (varv)
-+ deallocate (varx) ! varv-deassociated
-+ l = allocated (varx)
-+ varu(:, :, :) = 10 ! varx-deallocated
-+ allocate (varv (1:6, 5:15, 17:28))
-+ l = associated (varv)
-+ varv(:, :, :) = 6
-+ varv(1, 5, 17) = 7
-+ varv(2, 6, 18) = 8
-+ varv(6, 15, 28) = 9
-+ deallocate (varv)
-+ l = associated (varv)
-+ varv => varu
-+ varv(1, 1, 1) = 6
-+ varv(1, 2, 3) = 7
-+ l = associated (varv)
-+end subroutine baz
-+subroutine foo (vary, varw)
-+ real :: vary (:, :)
-+ real :: varw (:, :, :)
-+ vary(:, :) = 4 ! vary-passed
-+ vary(1, 1) = 8
-+ vary(2, 2) = 9
-+ vary(1, 3) = 10
-+ varw(:, :, :) = 5 ! vary-filled
-+ varw(1, 1, 1) = 6
-+ varw(2, 2, 2) = 7 ! varw-almostfilled
-+end subroutine foo
-+subroutine bar (varz, vart)
-+ real :: varz (*)
-+ real :: vart (2:11, 7:*)
-+ varz(1:3) = 4
-+ varz(2) = 5 ! varz-almostfilled
-+ vart(2,7) = vart(2,7)
-+end subroutine bar
-+program test
-+ interface
-+ subroutine foo (vary, varw)
-+ real :: vary (:, :)
-+ real :: varw (:, :, :)
-+ end subroutine
-+ end interface
-+ interface
-+ subroutine bar (varz, vart)
-+ real :: varz (*)
-+ real :: vart (2:11, 7:*)
-+ end subroutine
-+ end interface
-+ real :: x (10, 10), y (5), z(8, 8, 8)
-+ x(:,:) = 1
-+ y(:) = 2
-+ z(:,:,:) = 3
-+ call baz
-+ call foo (x, z(2:6, 4:7, 6:8))
-+ call bar (y, x)
-+ if (x (1, 1) .ne. 8 .or. x (2, 2) .ne. 9 .or. x (1, 2) .ne. 4) call abort
-+ if (x (1, 3) .ne. 10) call abort
-+ if (z (2, 4, 6) .ne. 6 .or. z (3, 5, 7) .ne. 7 .or. z (2, 4, 7) .ne. 5) call abort
-+ if (any (y .ne. (/4, 5, 4, 2, 2/))) call abort
-+ call foo (transpose (x), z)
-+ if (x (1, 1) .ne. 8 .or. x (2, 2) .ne. 9 .or. x (1, 2) .ne. 4) call abort
-+ if (x (3, 1) .ne. 10) call abort
-+end
-Index: gdb-7.12.50.20170207/gdb/testsuite/gdb.fortran/string.exp
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ gdb-7.12.50.20170207/gdb/testsuite/gdb.fortran/string.exp 2017-02-26 19:15:36.604882366 +0100
-@@ -0,0 +1,59 @@
-+# Copyright 2008 Free Software Foundation, Inc.
-+
-+# This program is free software; you can redistribute it and/or modify
-+# it under the terms of the GNU General Public License as published by
-+# the Free Software Foundation; either version 2 of the License, or
-+# (at your option) any later version.
-+#
-+# This program is distributed in the hope that it will be useful,
-+# but WITHOUT ANY WARRANTY; without even the implied warranty of
-+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+# GNU General Public License for more details.
-+#
-+# You should have received a copy of the GNU General Public License
-+# along with this program; if not, write to the Free Software
-+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-+
-+# This file was written by Jan Kratochvil <jan.kratochvil(a)redhat.com>.
-+
-+# This file is part of the gdb testsuite. It contains tests for Fortran
-+# strings with dynamic length.
-+
-+set testfile "string"
-+set srcfile ${testfile}.f90
-+set binfile [standard_output_file ${testfile}]
-+
-+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug f90 quiet}] != "" } {
-+ untested "Couldn't compile ${srcfile}"
-+ return -1
-+}
-+
-+gdb_exit
-+gdb_start
-+gdb_reinitialize_dir $srcdir/$subdir
-+gdb_load ${binfile}
-+
-+if ![runto MAIN__] then {
-+ perror "couldn't run to breakpoint MAIN__"
-+ continue
-+}
-+
-+gdb_breakpoint [gdb_get_line_number "var-init"]
-+gdb_continue_to_breakpoint "var-init"
-+gdb_test "ptype c" "type = character(\\(kind=1\\)|\\*1)"
-+gdb_test "ptype d" "type = character(\\(kind=8\\)|\\*8)"
-+gdb_test "ptype e" "type = character(\\(kind=4\\)|\\*4)"
-+gdb_test "ptype f" "type = character(\\(kind=4\\)|\\*4) \\(7,8:10\\)"
-+gdb_test "ptype *e" "Attempt to take contents of a non-pointer value."
-+gdb_test "ptype *f" "type = character(\\(kind=4\\)|\\*4) \\(7\\)"
-+gdb_test "p c" "\\$\[0-9\]* = 'c'"
-+gdb_test "p d" "\\$\[0-9\]* = 'd '"
-+gdb_test "p e" "\\$\[0-9\]* = 'g '"
-+gdb_test "p f" "\\$\[0-9\]* = \\(\\( 'h ', 'h ', 'h ', 'h ', 'h ', 'h ', 'h '\\) \\( 'h ', 'h ', 'h ', 'h ', 'h ', 'h ', 'h '\\) \\( 'h ', 'h ', 'h ', 'h ', 'h ', 'h ', 'h '\\) \\)"
-+gdb_test "p *e" "Attempt to take contents of a non-pointer value."
-+gdb_test "p *f" "Attempt to take contents of a non-pointer value."
-+
-+gdb_breakpoint [gdb_get_line_number "var-finish"]
-+gdb_continue_to_breakpoint "var-finish"
-+gdb_test "p e" "\\$\[0-9\]* = 'e '" "p e re-set"
-+gdb_test "p f" "\\$\[0-9\]* = \\(\\( 'f ', 'f ', 'f ', 'f ', 'f ', 'f ', 'f '\\) \\( 'f2 ', 'f ', 'f ', 'f ', 'f ', 'f ', 'f '\\) \\( 'f ', 'f ', 'f ', 'f ', 'f ', 'f ', 'f '\\) \\)" "p *f re-set"
-Index: gdb-7.12.50.20170207/gdb/testsuite/gdb.fortran/string.f90
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ gdb-7.12.50.20170207/gdb/testsuite/gdb.fortran/string.f90 2017-02-26 19:15:36.604882366 +0100
-@@ -0,0 +1,37 @@
-+! Copyright 2008 Free Software Foundation, Inc.
-+!
-+! This program is free software; you can redistribute it and/or modify
-+! it under the terms of the GNU General Public License as published by
-+! the Free Software Foundation; either version 2 of the License, or
-+! (at your option) any later version.
-+!
-+! This program is distributed in the hope that it will be useful,
-+! but WITHOUT ANY WARRANTY; without even the implied warranty of
-+! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+! GNU General Public License for more details.
-+!
-+! You should have received a copy of the GNU General Public License
-+! along with this program; if not, write to the Free Software
-+! Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-+!
-+! Ihis file is the Fortran source file for dynamic.exp.
-+! Original file written by Jakub Jelinek <jakub(a)redhat.com>.
-+! Modified for the GDB testcase by Jan Kratochvil <jan.kratochvil(a)redhat.com>.
-+
-+subroutine foo (e, f)
-+ character (len=1) :: c
-+ character (len=8) :: d
-+ character (len=*) :: e
-+ character (len=*) :: f (1:7, 8:10)
-+ c = 'c'
-+ d = 'd'
-+ e = 'e' ! var-init
-+ f = 'f'
-+ f(1,9) = 'f2'
-+ c = 'c' ! var-finish
-+end subroutine foo
-+ character (len=4) :: g, h (1:7, 8:10)
-+ g = 'g'
-+ h = 'h'
-+ call foo (g, h)
-+end
-Index: gdb-7.12.50.20170207/gdb/testsuite/gdb.fortran/subrange.exp
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ gdb-7.12.50.20170207/gdb/testsuite/gdb.fortran/subrange.exp 2017-02-26 19:15:36.604882366 +0100
-@@ -0,0 +1,72 @@
-+# Copyright 2011 Free Software Foundation, Inc.
-+
-+# This program is free software; you can redistribute it and/or modify
-+# it under the terms of the GNU General Public License as published by
-+# the Free Software Foundation; either version 3 of the License, or
-+# (at your option) any later version.
-+#
-+# This program is distributed in the hope that it will be useful,
-+# but WITHOUT ANY WARRANTY; without even the implied warranty of
-+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+# GNU General Public License for more details.
-+#
-+# You should have received a copy of the GNU General Public License
-+# along with this program. If not, see <http://www.gnu.org/licenses/>.
-+
-+if { [skip_fortran_tests] } { return -1 }
-+
-+set testfile "subrange"
-+set srcfile ${testfile}.f90
-+if { [prepare_for_testing ${testfile}.exp ${testfile} ${srcfile} {debug f90}] } {
-+ return -1
-+}
-+
-+if ![runto MAIN__] {
-+ perror "Couldn't run to MAIN__"
-+ continue
-+}
-+
-+# Depending on the compiler version being used, the name of the 4-byte integer
-+# and real types can be printed differently. For instance, gfortran-4.1 uses
-+# "int4" whereas gfortran-4.3 uses "int(kind=4)".
-+set int4 "(int4|integer\\(kind=4\\))"
-+
-+gdb_breakpoint [gdb_get_line_number "break-static"]
-+gdb_continue_to_breakpoint "break-static" ".*break-static.*"
-+
-+foreach var {a alloc ptr} {
-+ global pf_prefix
-+ set old_prefix $pf_prefix
-+ lappend pf_prefix "$var:"
-+
-+ setup_kfail "*-*-*" "vlaregression/9999"
-+ gdb_test "p $var (2, 2:3)" { = \(22, 32\)}
-+ setup_kfail "*-*-*" "vlaregression/9999"
-+ gdb_test "p $var (2:3, 3)" { = \(32, 33\)}
-+ setup_kfail "*-*-*" "vlaregression/9999"
-+ gdb_test "p $var (1, 2:)" { = \(21, 31\)}
-+ setup_kfail "*-*-*" "vlaregression/9999"
-+ gdb_test "p $var (2, :2)" { = \(12, 22\)}
-+ setup_kfail "*-*-*" "vlaregression/9999"
-+ gdb_test "p $var (3, 2:2)" { = \(23\)}
-+ setup_kfail "*-*-*" "vlaregression/9999"
-+ gdb_test "ptype $var (3, 2:2)" " = $int4 \\(2:2\\)"
-+ setup_kfail "*-*-*" "vlaregression/9999"
-+ gdb_test "p $var (4, :)" { = \(14, 24, 34\)}
-+ setup_kfail "*-*-*" "vlaregression/9999"
-+ gdb_test "p $var (:, :)" { = \(\( *11, 12, 13, 14\) \( *21, 22, 23, 24\) \( *31, 32, 33, 34\) *\)}
-+ setup_kfail "*-*-*" "vlaregression/9999"
-+ gdb_test "ptype $var (:, :)" " = $int4 \\(4,3\\)"
-+ setup_kfail "*-*-*" "vlaregression/9999"
-+ gdb_test "p $var (:)" "Wrong number of subscripts"
-+ setup_kfail "*-*-*" "vlaregression/9999"
-+ gdb_test "p $var (:, :, :)" "Wrong number of subscripts"
-+
-+ set pf_prefix $old_prefix
-+}
-+
-+gdb_test_no_output {set $a=a}
-+delete_breakpoints
-+gdb_unload
-+setup_kfail "*-*-*" "vlaregression/9999"
-+gdb_test {p $a (3, 2:2)} { = \(23\)}
-Index: gdb-7.12.50.20170207/gdb/testsuite/gdb.fortran/subrange.f90
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ gdb-7.12.50.20170207/gdb/testsuite/gdb.fortran/subrange.f90 2017-02-26 19:15:36.604882366 +0100
-@@ -0,0 +1,28 @@
-+! Copyright 2011 Free Software Foundation, Inc.
-+!
-+! This program is free software; you can redistribute it and/or modify
-+! it under the terms of the GNU General Public License as published by
-+! the Free Software Foundation; either version 3 of the License, or
-+! (at your option) any later version.
-+!
-+! This program is distributed in the hope that it will be useful,
-+! but WITHOUT ANY WARRANTY; without even the implied warranty of
-+! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+! GNU General Public License for more details.
-+!
-+! You should have received a copy of the GNU General Public License
-+! along with this program. If not, see <http://www.gnu.org/licenses/>.
-+
-+program test
-+ integer, target :: a (4, 3)
-+ integer, allocatable :: alloc (:, :)
-+ integer, pointer :: ptr (:, :)
-+ do 1 i = 1, 4
-+ do 1 j = 1, 3
-+ a (i, j) = j * 10 + i
-+1 continue
-+ allocate (alloc (4, 3))
-+ alloc = a
-+ ptr => a
-+ write (*,*) a ! break-static
-+end
-Index: gdb-7.12.50.20170207/gdb/testsuite/gdb.mi/mi2-var-stale-type.c
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ gdb-7.12.50.20170207/gdb/testsuite/gdb.mi/mi2-var-stale-type.c 2017-02-26 19:15:36.604882366 +0100
-@@ -0,0 +1,26 @@
-+/* Copyright 2011 Free Software Foundation, Inc.
-+
-+ This file is part of GDB.
-+
-+ This program is free software; you can redistribute it and/or modify
-+ it under the terms of the GNU General Public License as published by
-+ the Free Software Foundation; either version 3 of the License, or
-+ (at your option) any later version.
-+
-+ This program is distributed in the hope that it will be useful,
-+ but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ GNU General Public License for more details.
-+
-+ You should have received a copy of the GNU General Public License
-+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
-+
-+int
-+main (int argc, char **argv)
-+{
-+ char vla[argc];
-+
-+ vla[0] = 0; /* break-here */
-+
-+ return 0;
-+}
-Index: gdb-7.12.50.20170207/gdb/testsuite/gdb.mi/mi2-var-stale-type.exp
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ gdb-7.12.50.20170207/gdb/testsuite/gdb.mi/mi2-var-stale-type.exp 2017-02-26 19:15:36.604882366 +0100
-@@ -0,0 +1,57 @@
-+# Copyright 2011 Free Software Foundation, Inc.
-+#
-+# This program is free software; you can redistribute it and/or modify
-+# it under the terms of the GNU General Public License as published by
-+# the Free Software Foundation; either version 3 of the License, or
-+# (at your option) any later version.
-+#
-+# This program is distributed in the hope that it will be useful,
-+# but WITHOUT ANY WARRANTY; without even the implied warranty of
-+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+# GNU General Public License for more details.
-+#
-+# You should have received a copy of the GNU General Public License
-+# along with this program. If not, see <http://www.gnu.org/licenses/>.
-+
-+load_lib mi-support.exp
-+set MIFLAGS "-i=mi2"
-+
-+gdb_exit
-+if [mi_gdb_start] {
-+ continue
-+}
-+
-+set testfile "mi2-var-stale-type"
-+set srcfile ${testfile}.c
-+set binfile [standard_output_file ${testfile}]
-+if {[build_executable ${testfile}.exp $testfile $srcfile] == -1} {
-+ return -1
-+}
-+
-+mi_delete_breakpoints
-+mi_gdb_reinitialize_dir $srcdir/$subdir
-+mi_gdb_load ${binfile}
-+
-+mi_gdb_test {-interpreter-exec console "maintenance set internal-error quit yes"} \
-+ {\^done} \
-+ "maintenance set internal-error quit yes"
-+
-+mi_gdb_test {-interpreter-exec console "maintenance set internal-error corefile yes"} \
-+ {\^done} \
-+ "maintenance set internal-error corefile yes"
-+
-+set line [gdb_get_line_number "break-here"]
-+set func "main"
-+
-+mi_gdb_test "-break-insert -t $srcfile:$line" \
-+ "\\^done,bkpt=\{number=\"\[0-9\]+\",type=\"breakpoint\",disp=\"del\",enabled=\"y\",addr=\"$hex\",func=\"$func\(\\\(.*\\\)\)?\",file=\".*\",fullname=\".*\",line=\"$line\",\[^\r\n\]*,original-location=\".*\"\}" \
-+ "breakpoint at $func"
-+
-+if { [mi_run_cmd] < 0 } {
-+ return -1
-+}
-+mi_expect_stop "breakpoint-hit" $func ".*" ".*" "\[0-9\]+" { "" "disp=\"del\"" } "stop after initializing vla"
-+
-+mi_create_varobj "vla" "vla" "create local variable vla"
-+
-+mi_gdb_test "-var-update *" "\\^done,changelist=.*" "-var-update *"
-Index: gdb-7.12.50.20170207/gdb/testsuite/gdb.opt/array-from-register-func.c
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ gdb-7.12.50.20170207/gdb/testsuite/gdb.opt/array-from-register-func.c 2017-02-26 19:15:36.604882366 +0100
-@@ -0,0 +1,22 @@
-+/* This file is part of GDB, the GNU debugger.
-+
-+ Copyright 2009 Free Software Foundation, Inc.
-+
-+ This program is free software; you can redistribute it and/or modify
-+ it under the terms of the GNU General Public License as published by
-+ the Free Software Foundation; either version 3 of the License, or
-+ (at your option) any later version.
-+
-+ This program is distributed in the hope that it will be useful,
-+ but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ GNU General Public License for more details.
-+
-+ You should have received a copy of the GNU General Public License
-+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
-+
-+int
-+func (int *arr)
-+{
-+ return arr[0];
-+}
-Index: gdb-7.12.50.20170207/gdb/testsuite/gdb.opt/array-from-register.c
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ gdb-7.12.50.20170207/gdb/testsuite/gdb.opt/array-from-register.c 2017-02-26 19:15:36.605882373 +0100
-@@ -0,0 +1,28 @@
-+/* This file is part of GDB, the GNU debugger.
-+
-+ Copyright 2009 Free Software Foundation, Inc.
-+
-+ This program is free software; you can redistribute it and/or modify
-+ it under the terms of the GNU General Public License as published by
-+ the Free Software Foundation; either version 3 of the License, or
-+ (at your option) any later version.
-+
-+ This program is distributed in the hope that it will be useful,
-+ but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ GNU General Public License for more details.
-+
-+ You should have received a copy of the GNU General Public License
-+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
-+
-+extern int func (int *arr);
-+
-+int
-+main (void)
-+{
-+ int arr[] = { 42 };
-+
-+ func (arr);
-+
-+ return 0;
-+}
-Index: gdb-7.12.50.20170207/gdb/testsuite/gdb.opt/array-from-register.exp
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ gdb-7.12.50.20170207/gdb/testsuite/gdb.opt/array-from-register.exp 2017-02-26 19:15:36.605882373 +0100
-@@ -0,0 +1,33 @@
-+# Copyright 2009 Free Software Foundation, Inc.
-+#
-+# This program is free software; you can redistribute it and/or modify
-+# it under the terms of the GNU General Public License as published by
-+# the Free Software Foundation; either version 2 of the License, or
-+# (at your option) any later version.
-+#
-+# This program is distributed in the hope that it will be useful,
-+# but WITHOUT ANY WARRANTY; without even the implied warranty of
-+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+# GNU General Public License for more details.
-+#
-+# You should have received a copy of the GNU General Public License
-+# along with this program; if not, write to the Free Software
-+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-+#
-+# This file is part of the gdb testsuite.
-+
-+if { [prepare_for_testing array-from-register.exp "array-from-register" \
-+ {array-from-register.c array-from-register-func.c} \
-+ {debug optimize=-O2}] } {
-+ return -1
-+}
-+
-+if ![runto func] then {
-+ return -1
-+}
-+
-+gdb_test "p arr" "\\$\[0-9\]+ = \\(int \\*\\) *0x\[0-9a-f\]+"
-+
-+# Seen regression:
-+# Address requested for identifier "arr" which is in register $rdi
-+gdb_test "p arr\[0\]" "\\$\[0-9\]+ = 42"
-Index: gdb-7.12.50.20170207/gdb/testsuite/gdb.opt/fortran-string.exp
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ gdb-7.12.50.20170207/gdb/testsuite/gdb.opt/fortran-string.exp 2017-02-26 19:15:36.605882373 +0100
-@@ -0,0 +1,39 @@
-+# Copyright 2009 Free Software Foundation, Inc.
-+
-+# This program is free software; you can redistribute it and/or modify
-+# it under the terms of the GNU General Public License as published by
-+# the Free Software Foundation; either version 2 of the License, or
-+# (at your option) any later version.
-+#
-+# This program is distributed in the hope that it will be useful,
-+# but WITHOUT ANY WARRANTY; without even the implied warranty of
-+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+# GNU General Public License for more details.
-+#
-+# You should have received a copy of the GNU General Public License
-+# along with this program; if not, write to the Free Software
-+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-+
-+# This file was written by Jan Kratochvil <jan.kratochvil(a)redhat.com>.
-+
-+# Test GDB can cope with Fortran strings having their length present in a CPU
-+# register. With -O0 the string length is passed on the stack. To make this
-+# test meaningful the follow assertion should pass. It is not being checked
-+# here as the "_s" symbol is compiler dependent:
-+# (gdb) info address _s
-+# Symbol "_s" is a variable in register XX.
-+
-+set test fortran-string
-+set srcfile ${test}.f90
-+if { [prepare_for_testing ${test}.exp ${test} ${srcfile} {debug f90 additional_flags=-O2}] } {
-+ return -1
-+}
-+
-+if ![runto $srcfile:[gdb_get_line_number "s = s"]] then {
-+ perror "couldn't run to breakpoint MAIN__"
-+ continue
-+}
-+
-+gdb_test "frame" ".*s='foo'.*"
-+gdb_test "ptype s" "type = character\\*3"
-+gdb_test "p s" "\\$\[0-9\]* = 'foo'"
-Index: gdb-7.12.50.20170207/gdb/testsuite/gdb.opt/fortran-string.f90
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ gdb-7.12.50.20170207/gdb/testsuite/gdb.opt/fortran-string.f90 2017-02-26 19:15:36.605882373 +0100
-@@ -0,0 +1,28 @@
-+! Copyright 2009 Free Software Foundation, Inc.
-+!
-+! This program is free software; you can redistribute it and/or modify
-+! it under the terms of the GNU General Public License as published by
-+! the Free Software Foundation; either version 2 of the License, or
-+! (at your option) any later version.
-+!
-+! This program is distributed in the hope that it will be useful,
-+! but WITHOUT ANY WARRANTY; without even the implied warranty of
-+! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+! GNU General Public License for more details.
-+!
-+! You should have received a copy of the GNU General Public License
-+! along with this program; if not, write to the Free Software
-+! Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-+!
-+! Ihis file is the Fortran source file for dynamic.exp.
-+! Original file written by Jakub Jelinek <jakub(a)redhat.com>.
-+! Modified for the GDB testcase by Jan Kratochvil <jan.kratochvil(a)redhat.com>.
-+
-+ subroutine f(s)
-+ character*(*) s
-+ s = s
-+ end
-+
-+ program main
-+ call f ('foo')
-+ end
-Index: gdb-7.12.50.20170207/gdb/testsuite/gdb.pascal/arrays.exp
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ gdb-7.12.50.20170207/gdb/testsuite/gdb.pascal/arrays.exp 2017-02-26 19:15:36.605882373 +0100
-@@ -0,0 +1,104 @@
-+# Copyright 2008, 2009 Free Software Foundation, Inc.
-+#
-+# This program is free software; you can redistribute it and/or modify
-+# it under the terms of the GNU General Public License as published by
-+# the Free Software Foundation; either version 3 of the License, or
-+# (at your option) any later version.
-+#
-+# This program is distributed in the hope that it will be useful,
-+# but WITHOUT ANY WARRANTY; without even the implied warranty of
-+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+# GNU General Public License for more details.
-+#
-+# You should have received a copy of the GNU General Public License
-+# along with this program. If not, see <http://www.gnu.org/licenses/>.
-+
-+if $tracelevel then {
-+ strace $tracelevel
-+}
-+
-+load_lib "pascal.exp"
-+
-+set testfile "arrays"
-+set srcfile ${testfile}.pas
-+set binfile [standard_output_file ${testfile}$EXEEXT]
-+
-+# These tests only work with fpc, using the -gw3 compile-option
-+pascal_init
-+if { $pascal_compiler_is_fpc != 1 } {
-+ return -1
-+}
-+
-+# Detect if the fpc version is below 2.3.0
-+set fpc_generates_dwarf_for_dynamic_arrays 1
-+if { ($fpcversion_major < 2) || ( ($fpcversion_major == 2) && ($fpcversion_minor < 3))} {
-+ set fpc_generates_dwarf_for_dynamic_arrays 0
-+}
-+
-+
-+if {[gdb_compile_pascal "-gw3 ${srcdir}/${subdir}/${srcfile}" "${binfile}" executable [list debug ]] != "" } {
-+ return -1
-+}
-+
-+gdb_exit
-+gdb_start
-+gdb_reinitialize_dir $srcdir/$subdir
-+gdb_load ${binfile}
-+set bp_location1 [gdb_get_line_number "set breakpoint 1 here"]
-+set bp_location2 [gdb_get_line_number "set breakpoint 2 here"]
-+
-+
-+if { [gdb_breakpoint ${srcfile}:${bp_location1}] } {
-+ pass "setting breakpoint 1"
-+}
-+if { [gdb_breakpoint ${srcfile}:${bp_location2}] } {
-+ pass "setting breakpoint 2"
-+}
-+
-+# Verify that "start" lands inside the right procedure.
-+if { [gdb_start_cmd] < 0 } {
-+ untested start
-+ return -1
-+}
-+
-+gdb_test "" ".* at .*${srcfile}.*" "start"
-+
-+gdb_test "cont" "Breakpoint .*:${bp_location1}.*" "Going to first breakpoint"
-+
-+gdb_test "print StatArrInt" ".* = \\{50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61\\}" "Print static array of integer type"
-+gdb_test "print StatArrInt_" ".* = \\{50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61\\}" "Print static array of integer"
-+
-+gdb_test "cont" "Breakpoint .*:${bp_location2}.*" "Going to second breakpoint"
-+
-+gdb_test "print StatArrChar" ".* = 'abcdefghijkl'" "Print static array of char"
-+gdb_test "print Stat2dArrInt" ".* = \\{\\{0, 1, 2, 3, 4\\}, \\{1, 2, 3, 4, 5\\}, \\{2, 3, 4, 5, 6\\}, \\{3, 4, 5, 6, 7\\}, \\{4, 5, 6, 7, 8\\}, \\{5, 6, 7, 8, 9\\}, \\{6, 7, 8, 9, 10\\}, \\{7, 8, 9, 10, 11\\}, \\{8, 9, 10, 11, 12\\}, \\{9, 10, 11, 12, 13\\}, \\{10, 11, 12, 13, 14\\}, \\{11, 12, 13, 14, 15\\}\\}" "Print static 2-dimensional array of integer"
-+
-+if { $fpc_generates_dwarf_for_dynamic_arrays == 0} {
-+ setup_xfail "*-*-*"
-+}
-+gdb_test "print DynArrInt" ".* = \\{50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62\\}" "Print dynamic array of integer type"
-+if { $fpc_generates_dwarf_for_dynamic_arrays == 0} {
-+ setup_xfail "*-*-*"
-+}
-+gdb_test "print DynArrInt_" ".* = \\{50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62\\}" "Print dynamic array of integer"
-+
-+if { $fpc_generates_dwarf_for_dynamic_arrays == 0} {
-+ setup_xfail "*-*-*"
-+}
-+gdb_test "print s" ".* = 'test'#0'string'" "Print string containing null-char"
-+
-+if { $fpc_generates_dwarf_for_dynamic_arrays == 0} {
-+ setup_xfail "*-*-*"
-+}
-+gdb_test "print DynArrStr" ".* = \\{'dstr0', 'dstr1', 'dstr2', 'dstr3', 'dstr4', 'dstr5', 'dstr6', 'dstr7', 'dstr8', 'dstr9', 'dstr10', 'dstr11', 'dstr12'\\}" "Print dynamic array of string"
-+
-+if { $fpc_generates_dwarf_for_dynamic_arrays == 0} {
-+ setup_xfail "*-*-*"
-+}
-+gdb_test "print StatArrStr" ".* = \\{'str0', 'str1', 'str2', 'str3', 'str4', 'str5', 'str6', 'str7', 'str8', 'str9', 'str10', 'str11', 'str12'\\}" "Print static array of string"
-+
-+if { $fpc_generates_dwarf_for_dynamic_arrays == 0} {
-+ setup_xfail "*-*-*"
-+}
-+gdb_test "print DynArrChar" ".* = 'abcdefghijklm'" "Print dynamic array of char"
-+
-Index: gdb-7.12.50.20170207/gdb/testsuite/gdb.pascal/arrays.pas
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ gdb-7.12.50.20170207/gdb/testsuite/gdb.pascal/arrays.pas 2017-02-26 19:15:36.605882373 +0100
-@@ -0,0 +1,82 @@
-+{
-+ Copyright 2008, 2009 Free Software Foundation, Inc.
-+
-+ This program is free software; you can redistribute it and/or modify
-+ it under the terms of the GNU General Public License as published by
-+ the Free Software Foundation; either version 3 of the License, or
-+ (at your option) any later version.
-+
-+ This program is distributed in the hope that it will be useful,
-+ but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ GNU General Public License for more details.
-+
-+ You should have received a copy of the GNU General Public License
-+ along with this program. If not, see <http://www.gnu.org/licenses/>.
-+}
-+
-+program arrays;
-+
-+{$mode objfpc}{$h+}
-+
-+uses sysutils;
-+
-+type TStatArrInt= array[0..11] of integer;
-+ TDynArrInt= array of integer;
-+ TStatArrStr= array[0..12] of string;
-+ TDynArrStr= array of string;
-+ TDynArrChar = array of char;
-+ TStatArrChar = array [0..11] of char;
-+
-+ TStat2dArrInt = array[0..11,0..4] of integer;
-+
-+var StatArrInt: TStatArrInt;
-+ StatArrInt_: Array[0..11] of integer;
-+ DynArrInt: TDynArrInt;
-+ DynArrInt_: Array of integer;
-+ StatArrStr: TStatArrStr;
-+ DynArrStr: TDynArrStr;
-+ StatArrChar: TStatArrChar;
-+ DynArrChar: TDynArrChar;
-+
-+ Stat2dArrInt: TStat2dArrInt;
-+
-+ s: string;
-+
-+ i,j : integer;
-+
-+begin
-+ for i := 0 to 11 do
-+ begin
-+ StatArrInt[i]:= i+50;
-+ StatArrInt_[i]:= i+50;
-+ StatArrChar[i]:= chr(ord('a')+i);
-+ for j := 0 to 4 do
-+ Stat2dArrInt[i,j]:=i+j;
-+ end;
-+ writeln(StatArrInt_[0]);
-+ writeln(StatArrInt[0]); { set breakpoint 1 here }
-+ writeln(StatArrChar[0]);
-+ writeln(Stat2dArrInt[0,0]);
-+
-+ setlength(DynArrInt,13);
-+ setlength(DynArrInt_,13);
-+ setlength(DynArrStr,13);
-+ setlength(DynArrChar,13);
-+ for i := 0 to 12 do
-+ begin
-+ DynArrInt[i]:= i+50;
-+ DynArrInt_[i]:= i+50;
-+ DynArrChar[i]:= chr(ord('a')+i);
-+ StatArrStr[i]:='str'+inttostr(i);
-+ DynArrStr[i]:='dstr'+inttostr(i);
-+ end;
-+ writeln(DynArrInt_[1]);
-+ writeln(DynArrInt[1]);
-+ writeln(DynArrStr[1]);
-+ writeln(StatArrStr[1]);
-+ writeln(DynArrChar[1]);
-+
-+ s := 'test'#0'string';
-+ writeln(s); { set breakpoint 2 here }
-+end.
-Index: gdb-7.12.50.20170207/gdb/testsuite/lib/gdb.exp
-===================================================================
---- gdb-7.12.50.20170207.orig/gdb/testsuite/lib/gdb.exp 2017-02-26 19:15:28.564824836 +0100
-+++ gdb-7.12.50.20170207/gdb/testsuite/lib/gdb.exp 2017-02-26 19:15:36.607882387 +0100
-@@ -178,6 +178,11 @@
- send_gdb "y\n"
- exp_continue
- }
-+ -re "A program is being debugged already..*Are you sure you want to change the file.*y or n. $"\
-+ { send_gdb "y\n"
-+ verbose "\t\tUnloading symbols for program being debugged"
-+ exp_continue
-+ }
- -re "Discard symbol table from .*y or n.*$" {
- send_gdb "y\n"
- exp_continue
-Index: gdb-7.12.50.20170207/gdb/testsuite/lib/pascal.exp
-===================================================================
---- gdb-7.12.50.20170207.orig/gdb/testsuite/lib/pascal.exp 2017-02-26 19:15:28.565824844 +0100
-+++ gdb-7.12.50.20170207/gdb/testsuite/lib/pascal.exp 2017-02-26 19:15:36.607882387 +0100
-@@ -37,6 +37,9 @@
- global pascal_compiler_is_fpc
- global gpc_compiler
- global fpc_compiler
-+ global fpcversion_major
-+ global fpcversion_minor
-+ global fpcversion_release
- global env
-
- if { $pascal_init_done == 1 } {
-@@ -64,6 +67,20 @@
- set pascal_compiler_is_fpc 1
- verbose -log "Free Pascal compiler found"
- }
-+
-+ # Detect the fpc-version
-+ if { $pascal_compiler_is_fpc == 1 } {
-+ set fpcversion_major 1
-+ set fpcversion_minor 0
-+ set fpcversion_release 0
-+ set fpcversion [ remote_exec host $fpc_compiler "-iV" ]
-+ if [regexp {.*([0-9]+)\.([0-9]+)\.([0-9]+).?} $fpcversion] {
-+ regsub {.*([0-9]+)\.([0-9]+)\.([0-9]+).?\n?.?} $fpcversion {\1} fpcversion_major
-+ regsub {.*([0-9]+)\.([0-9]+)\.([0-9]+).?\n?.?} $fpcversion {\2} fpcversion_minor
-+ regsub {.*([0-9]+)\.([0-9]+)\.([0-9]+).?\n?.?} $fpcversion {\3} fpcversion_release
-+ }
-+ verbose -log "Freepascal version: $fpcversion_major.$fpcversion_minor.$fpcversion_release"
-+ }
- }
- set pascal_init_done 1
- }
diff --git a/gdb-archer.patch b/gdb-archer.patch
new file mode 100644
index 0000000..9128744
--- /dev/null
+++ b/gdb-archer.patch
@@ -0,0 +1,729 @@
+From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
+From: Fedora GDB patches <invalid(a)email.com>
+Date: Fri, 27 Oct 2017 21:07:50 +0200
+Subject: gdb-archer.patch
+
+FileName: gdb-archer.patch
+
+;; Python patches of: http://sourceware.org/gdb/wiki/ProjectArcher
+;;=push
+
+http://sourceware.org/gdb/wiki/ProjectArcher
+http://sourceware.org/gdb/wiki/ArcherBranchManagement
+
+GIT snapshot:
+commit 718a1618b2f691a7f407213bb50f100ac59f91c3
+
+tromey/python
+---
+ gdb/Makefile.in | 6 ++
+ gdb/data-directory/Makefile.in | 4 +
+ gdb/doc/gdb.texinfo | 10 +++
+ gdb/doc/python.texi | 2 -
+ gdb/gdb-gdb.gdb.in | 10 +++
+ gdb/main.c | 93 ++++++++++++++++++-----
+ gdb/python/lib/gdb/command/ignore_errors.py | 37 +++++++++
+ gdb/python/lib/gdb/command/pahole.py | 81 ++++++++++++++++++++
+ gdb/python/lib/gdb/function/in_scope.py | 47 ++++++++++++
+ gdb/python/python-internal.h | 3 +
+ gdb/python/python.c | 113 ++++++++++++++++++++++++++++
+ gdb/python/python.h | 2 +
+ gdb/testsuite/gdb.python/py-frame.exp | 2 +
+ gdb/testsuite/gdb.python/py-value.exp | 10 +++
+ gdb/varobj.c | 8 ++
+ gdb/varobj.h | 2 +
+ 16 files changed, 411 insertions(+), 19 deletions(-)
+ create mode 100644 gdb/python/lib/gdb/command/ignore_errors.py
+ create mode 100644 gdb/python/lib/gdb/command/pahole.py
+ create mode 100644 gdb/python/lib/gdb/function/in_scope.py
+
+diff --git a/gdb/Makefile.in b/gdb/Makefile.in
+index 3142ad6af1..28d8664236 100644
+--- a/gdb/Makefile.in
++++ b/gdb/Makefile.in
+@@ -2110,6 +2110,12 @@ stamp-h: $(srcdir)/config.in config.status
+ CONFIG_LINKS= \
+ $(SHELL) config.status
+
++.gdbinit: $(srcdir)/gdbinit.in config.status
++ CONFIG_FILES=".gdbinit:gdbinit.in" \
++ CONFIG_COMMANDS= \
++ CONFIG_HEADERS= \
++ $(SHELL) config.status
++
+ config.status: $(srcdir)/configure configure.tgt configure.host ../bfd/development.sh
+ $(SHELL) config.status --recheck
+
+diff --git a/gdb/data-directory/Makefile.in b/gdb/data-directory/Makefile.in
+index 5c7c0b4c2e..2014607e9e 100644
+--- a/gdb/data-directory/Makefile.in
++++ b/gdb/data-directory/Makefile.in
+@@ -80,6 +80,8 @@ PYTHON_FILE_LIST = \
+ gdb/unwinder.py \
+ gdb/xmethod.py \
+ gdb/command/__init__.py \
++ gdb/command/ignore_errors.py \
++ gdb/command/pahole.py \
+ gdb/command/explore.py \
+ gdb/command/backtrace.py \
+ gdb/command/frame_filters.py \
+@@ -92,6 +94,8 @@ PYTHON_FILE_LIST = \
+ gdb/function/as_string.py \
+ gdb/function/caller_is.py \
+ gdb/function/strfns.py \
++ gdb/function/caller_is.py \
++ gdb/function/in_scope.py \
+ gdb/printer/__init__.py \
+ gdb/printer/bound_registers.py
+
+diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo
+index 7b99ae1551..dea17fd5a7 100644
+--- a/gdb/doc/gdb.texinfo
++++ b/gdb/doc/gdb.texinfo
+@@ -1245,6 +1245,16 @@ for remote debugging.
+ Run using @var{device} for your program's standard input and output.
+ @c FIXME: kingdon thinks there is more to -tty. Investigate.
+
++@item -P
++@cindex @code{-P}
++@itemx --python
++@cindex @code{--python}
++Change interpretation of command line so that the argument immediately
++following this switch is taken to be the name of a Python script file.
++This option stops option processing; subsequent options are passed to
++Python as @code{sys.argv}. This option is only available if Python
++scripting support was enabled when @value{GDBN} was configured.
++
+ @c resolve the situation of these eventually
+ @item -tui
+ @cindex @code{--tui}
+diff --git a/gdb/doc/python.texi b/gdb/doc/python.texi
+index ccf011e35e..461e900f77 100644
+--- a/gdb/doc/python.texi
++++ b/gdb/doc/python.texi
+@@ -88,8 +88,6 @@ containing @code{end}. For example:
+
+ @smallexample
+ (@value{GDBP}) python
+-Type python script
+-End with a line saying just "end".
+ >print 23
+ >end
+ 23
+diff --git a/gdb/gdb-gdb.gdb.in b/gdb/gdb-gdb.gdb.in
+index 05a38b2670..9801fdff67 100644
+--- a/gdb/gdb-gdb.gdb.in
++++ b/gdb/gdb-gdb.gdb.in
+@@ -1,5 +1,15 @@
+ echo Setting up the environment for debugging gdb.\n
+
++# Set up the Python library and "require" command.
++python
++from os.path import abspath
++gdb.datadir = abspath ('@srcdir@/python/lib')
++gdb.pythonlibdir = gdb.datadir
++gdb.__path__ = [gdb.datadir + '/gdb']
++sys.path.insert(0, gdb.datadir)
++end
++source @srcdir(a)/python/lib/gdb/__init__.py
++
+ if !$gdb_init_done
+ set variable $gdb_init_done = 1
+
+diff --git a/gdb/main.c b/gdb/main.c
+index b079e79c93..b150af4e70 100644
+--- a/gdb/main.c
++++ b/gdb/main.c
+@@ -33,6 +33,7 @@
+
+ #include "interps.h"
+ #include "main.h"
++#include "python/python.h"
+ #include "source.h"
+ #include "cli/cli-cmds.h"
+ #include "objfiles.h"
+@@ -478,7 +479,7 @@ exec_or_core_file_attach (const char *filename, int from_tty)
+ }
+
+ static void
+-captured_main_1 (struct captured_main_args *context)
++captured_main_1 (struct captured_main_args *context, int &python_script)
+ {
+ int argc = context->argc;
+ char **argv = context->argv;
+@@ -694,10 +695,14 @@ captured_main_1 (struct captured_main_args *context)
+ {"args", no_argument, &set_args, 1},
+ {"l", required_argument, 0, 'l'},
+ {"return-child-result", no_argument, &return_child_result, 1},
++#if HAVE_PYTHON
++ {"python", no_argument, 0, 'P'},
++ {"P", no_argument, 0, 'P'},
++#endif
+ {0, no_argument, 0, 0}
+ };
+
+- while (1)
++ while (!python_script)
+ {
+ int option_index;
+
+@@ -715,6 +720,9 @@ captured_main_1 (struct captured_main_args *context)
+ case 0:
+ /* Long option that just sets a flag. */
+ break;
++ case 'P':
++ python_script = 1;
++ break;
+ case OPT_SE:
+ symarg = optarg;
+ execarg = optarg;
+@@ -889,7 +897,31 @@ captured_main_1 (struct captured_main_args *context)
+
+ /* Now that gdb_init has created the initial inferior, we're in
+ position to set args for that inferior. */
+- if (set_args)
++ if (python_script)
++ {
++ /* The first argument is a python script to evaluate, and
++ subsequent arguments are passed to the script for
++ processing there. */
++ if (optind >= argc)
++ {
++ fprintf_unfiltered (gdb_stderr,
++ _("%s: Python script file name required\n"),
++ argv[0]);
++ exit (1);
++ }
++
++ /* FIXME: should handle inferior I/O intelligently here.
++ E.g., should be possible to run gdb in pipeline and have
++ Python (and gdb) output go to stderr or file; and if a
++ prompt is needed, open the tty. */
++ quiet = 1;
++ /* FIXME: should read .gdbinit if, and only if, a prompt is
++ requested by the script. Though... maybe this is not
++ ideal? */
++ /* FIXME: likewise, reading in history. */
++ inhibit_gdbinit = 1;
++ }
++ else if (set_args)
+ {
+ /* The remaining options are the command-line options for the
+ inferior. The first one is the sym/exec file, and the rest
+@@ -1179,7 +1211,8 @@ captured_main_1 (struct captured_main_args *context)
+
+ /* Read in the old history after all the command files have been
+ read. */
+- init_history ();
++ if (!python_script)
++ init_history ();
+
+ if (batch_flag)
+ {
+@@ -1192,24 +1225,37 @@ static void
+ captured_main (void *data)
+ {
+ struct captured_main_args *context = (struct captured_main_args *) data;
++ int python_script = 0;
+
+- captured_main_1 (context);
++ captured_main_1 (context, python_script);
+
+- /* NOTE: cagney/1999-11-07: There is probably no reason for not
+- moving this loop and the code found in captured_command_loop()
+- into the command_loop() proper. The main thing holding back that
+- change - SET_TOP_LEVEL() - has been eliminated. */
+- while (1)
++#if HAVE_PYTHON
++ if (python_script)
+ {
+- TRY
+- {
+- captured_command_loop ();
+- }
+- CATCH (ex, RETURN_MASK_ALL)
++ extern int pagination_enabled;
++ pagination_enabled = 0;
++ run_python_script (context->argc - optind, &context->argv[optind]);
++ return;
++ }
++ else
++#endif
++ {
++ /* NOTE: cagney/1999-11-07: There is probably no reason for not
++ moving this loop and the code found in captured_command_loop()
++ into the command_loop() proper. The main thing holding back that
++ change - SET_TOP_LEVEL() - has been eliminated. */
++ while (1)
+ {
+- exception_print (gdb_stderr, ex);
++ TRY
++ {
++ captured_command_loop ();
++ }
++ CATCH (ex, RETURN_MASK_ALL)
++ {
++ exception_print (gdb_stderr, ex);
++ }
++ END_CATCH
+ }
+- END_CATCH
+ }
+ /* No exit -- exit is through quit_command. */
+ }
+@@ -1252,6 +1298,12 @@ print_gdb_help (struct ui_file *stream)
+ fputs_unfiltered (_("\
+ This is the GNU debugger. Usage:\n\n\
+ gdb [options] [executable-file [core-file or process-id]]\n\
++ gdb [options] --args executable-file [inferior-arguments ...]\n"), stream);
++#if HAVE_PYTHON
++ fputs_unfiltered (_("\
++ gdb [options] [--python|-P] script-file [script-arguments ...]\n"), stream);
++#endif
++ fputs_unfiltered (_("\n\
+ gdb [options] --args executable-file [inferior-arguments ...]\n\n\
+ "), stream);
+ fputs_unfiltered (_("\
+@@ -1297,6 +1349,13 @@ Output and user interface control:\n\n\
+ #endif
+ fputs_unfiltered (_("\
+ --dbx DBX compatibility mode.\n\
++"), stream);
++#if HAVE_PYTHON
++ fputs_unfiltered (_("\
++ --python, -P Following argument is Python script file; remaining\n\
++ arguments are passed to script.\n"), stream);
++#endif
++ fputs_unfiltered (_("\
+ -q, --quiet, --silent\n\
+ Do not print version number on startup.\n\n\
+ "), stream);
+diff --git a/gdb/python/lib/gdb/command/ignore_errors.py b/gdb/python/lib/gdb/command/ignore_errors.py
+new file mode 100644
+index 0000000000..6fa48ff081
+--- /dev/null
++++ b/gdb/python/lib/gdb/command/ignore_errors.py
+@@ -0,0 +1,37 @@
++# Ignore errors in user commands.
++
++# Copyright (C) 2008 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/>.
++
++import gdb
++
++class IgnoreErrorsCommand (gdb.Command):
++ """Execute a single command, ignoring all errors.
++Only one-line commands are supported.
++This is primarily useful in scripts."""
++
++ def __init__ (self):
++ super (IgnoreErrorsCommand, self).__init__ ("ignore-errors",
++ gdb.COMMAND_OBSCURE,
++ # FIXME...
++ gdb.COMPLETE_COMMAND)
++
++ def invoke (self, arg, from_tty):
++ try:
++ gdb.execute (arg, from_tty)
++ except:
++ pass
++
++IgnoreErrorsCommand ()
+diff --git a/gdb/python/lib/gdb/command/pahole.py b/gdb/python/lib/gdb/command/pahole.py
+new file mode 100644
+index 0000000000..e08eaf5ca8
+--- /dev/null
++++ b/gdb/python/lib/gdb/command/pahole.py
+@@ -0,0 +1,81 @@
++# pahole command for gdb
++
++# Copyright (C) 2008, 2009, 2012 Free Software Foundation, Inc.
++
++# This program is free software; you can redistribute it and/or modify
++# it under the terms of the GNU General Public License as published by
++# the Free Software Foundation; either version 3 of the License, or
++# (at your option) any later version.
++#
++# This program is distributed in the hope that it will be useful,
++# but WITHOUT ANY WARRANTY; without even the implied warranty of
++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++# GNU General Public License for more details.
++#
++# You should have received a copy of the GNU General Public License
++# along with this program. If not, see <http://www.gnu.org/licenses/>.
++
++import gdb
++
++class Pahole (gdb.Command):
++ """Show the holes in a structure.
++This command takes a single argument, a type name.
++It prints the type and displays comments showing where holes are."""
++
++ def __init__ (self):
++ super (Pahole, self).__init__ ("pahole", gdb.COMMAND_NONE,
++ gdb.COMPLETE_SYMBOL)
++
++ def maybe_print_hole(self, bitpos, field_bitpos):
++ if bitpos != field_bitpos:
++ hole = field_bitpos - bitpos
++ print (' /* XXX %d bit hole, try to pack */' % hole)
++
++ def pahole (self, type, level, name):
++ if name is None:
++ name = ''
++ tag = type.tag
++ if tag is None:
++ tag = ''
++ print ('%sstruct %s {' % (' ' * (2 * level), tag))
++ bitpos = 0
++ for field in type.fields ():
++ # Skip static fields.
++ if not hasattr (field, ('bitpos')):
++ continue
++
++ ftype = field.type.strip_typedefs()
++
++ self.maybe_print_hole(bitpos, field.bitpos)
++ bitpos = field.bitpos
++ if field.bitsize > 0:
++ fieldsize = field.bitsize
++ else:
++ # TARGET_CHAR_BIT here...
++ fieldsize = 8 * ftype.sizeof
++
++ # TARGET_CHAR_BIT
++ print (' /* %3d %3d */' % (int (bitpos / 8), int (fieldsize / 8)), end = "")
++ bitpos = bitpos + fieldsize
++
++ if ftype.code == gdb.TYPE_CODE_STRUCT:
++ self.pahole (ftype, level + 1, field.name)
++ else:
++ print (' ' * (2 + 2 * level), end = "")
++ print ('%s %s' % (str (ftype), field.name))
++
++ if level == 0:
++ self.maybe_print_hole(bitpos, 8 * type.sizeof)
++
++ print (' ' * (14 + 2 * level), end = "")
++ print ('} %s' % name)
++
++ def invoke (self, arg, from_tty):
++ type = gdb.lookup_type (arg)
++ type = type.strip_typedefs ()
++ if type.code != gdb.TYPE_CODE_STRUCT:
++ raise (TypeError, '%s is not a struct type' % arg)
++ print (' ' * 14, end = "")
++ self.pahole (type, 0, '')
++
++Pahole()
+diff --git a/gdb/python/lib/gdb/function/in_scope.py b/gdb/python/lib/gdb/function/in_scope.py
+new file mode 100644
+index 0000000000..8742680614
+--- /dev/null
++++ b/gdb/python/lib/gdb/function/in_scope.py
+@@ -0,0 +1,47 @@
++# In-scope function.
++
++# Copyright (C) 2008 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/>.
++
++import gdb
++
++class InScope (gdb.Function):
++ """Return True if all the given variables or macros are in scope.
++Takes one argument for each variable name to be checked."""
++
++ def __init__ (self):
++ super (InScope, self).__init__ ("in_scope")
++
++ def invoke (self, *vars):
++ if len (vars) == 0:
++ raise (TypeError, "in_scope takes at least one argument")
++
++ # gdb.Value isn't hashable so it can't be put in a map.
++ # Convert to string first.
++ wanted = set (map (lambda x: x.string (), vars))
++ found = set ()
++ block = gdb.selected_frame ().block ()
++ while block:
++ for sym in block:
++ if (sym.is_argument or sym.is_constant
++ or sym.is_function or sym.is_variable):
++ if sym.name in wanted:
++ found.add (sym.name)
++
++ block = block.superblock
++
++ return wanted == found
++
++InScope ()
+diff --git a/gdb/python/python-internal.h b/gdb/python/python-internal.h
+index 4556323472..826122b9b9 100644
+--- a/gdb/python/python-internal.h
++++ b/gdb/python/python-internal.h
+@@ -651,6 +651,9 @@ class gdbpy_enter_varobj : public gdbpy_enter
+
+ };
+
++struct cleanup *ensure_python_env (struct gdbarch *gdbarch,
++ const struct language_defn *language);
++
+ extern struct gdbarch *python_gdbarch;
+ extern const struct language_defn *python_language;
+
+diff --git a/gdb/python/python.c b/gdb/python/python.c
+index 610dda828c..de5ffbd70b 100644
+--- a/gdb/python/python.c
++++ b/gdb/python/python.c
+@@ -95,6 +95,8 @@ const struct extension_language_defn extension_language_python =
+ #include "linespec.h"
+ #include "source.h"
+ #include "version.h"
++#include "inferior.h"
++#include "gdbthread.h"
+ #include "target.h"
+ #include "gdbthread.h"
+ #include "interps.h"
+@@ -242,6 +244,29 @@ gdbpy_enter::~gdbpy_enter ()
+ restore_active_ext_lang (m_previous_active);
+ }
+
++static void
++restore_python_env (void *p)
++{
++ gdbpy_enter *env = (gdbpy_enter *) p;
++
++ delete env;
++}
++
++/* Called before entering the Python interpreter to install the
++ current language and architecture to be used for Python values.
++ Also set the active extension language for GDB so that SIGINT's
++ are directed our way, and if necessary install the right SIGINT
++ handler. */
++
++struct cleanup *
++ensure_python_env (struct gdbarch *gdbarch,
++ const struct language_defn *language)
++{
++ gdbpy_enter *env = new gdbpy_enter (gdbarch, language);
++
++ return make_cleanup (restore_python_env, env);
++}
++
+ /* Set the quit flag. */
+
+ static void
+@@ -1356,6 +1381,92 @@ gdbpy_print_stack (void)
+
+ /* Return the current Progspace.
+ There always is one. */
++/* True if 'gdb -P' was used, false otherwise. */
++static int running_python_script;
++
++/* True if we are currently in a call to 'gdb.cli', false otherwise. */
++static int in_cli;
++
++/* Enter the command loop. */
++
++static PyObject *
++gdbpy_cli (PyObject *unused1, PyObject *unused2)
++{
++ if (! running_python_script || in_cli)
++ return PyErr_Format (PyExc_RuntimeError, "cannot invoke CLI recursively");
++
++ if (current_uiout->is_mi_like_p ())
++ return PyErr_Format (PyExc_RuntimeError, _("Cannot invoke CLI from MI."));
++
++ in_cli = 1;
++ /* See captured_command_loop. */
++
++ /* Give the interpreter a chance to print a prompt. */
++ interp_pre_command_loop (top_level_interpreter ());
++
++ /* Now it's time to start the event loop. */
++ start_event_loop ();
++
++ in_cli = 0;
++
++ Py_RETURN_NONE;
++}
++
++/* Set up the Python argument vector and evaluate a script. This is
++ used to implement 'gdb -P'. */
++
++void
++run_python_script (int argc, char **argv)
++{
++ FILE *input;
++
++ /* We never free this, since we plan to exit at the end. */
++ ensure_python_env (get_current_arch (), current_language);
++
++ running_python_script = 1;
++
++#if PYTHON_ABI_VERSION < 3
++ PySys_SetArgv (argc - 1, argv + 1);
++#else
++ {
++ wchar_t **wargv = (wchar_t **) alloca (sizeof (*wargv) * (argc + 1));
++ int i;
++
++ for (i = 1; i < argc; i++)
++ {
++ size_t len = mbstowcs (NULL, argv[i], 0);
++ /* Python-related GDB sources are built with -DNDEBUG
++ https://sourceware.org/bugzilla/show_bug.cgi?id=20445 */
++ size_t len2 ATTRIBUTE_UNUSED;
++
++ if (len == (size_t) -1)
++ {
++ fprintf (stderr, "Invalid multibyte argument #%d \"%s\"\n",
++ i, argv[i]);
++ exit (1);
++ }
++ wargv[i] = (wchar_t *) alloca (sizeof (**wargv) * (len + 1));
++ len2 = mbstowcs (wargv[i], argv[i], len + 1);
++ assert (len2 == len);
++ }
++ wargv[argc] = NULL;
++ PySys_SetArgv (argc - 1, wargv + 1);
++ }
++#endif
++
++ input = fopen (argv[0], "r");
++ if (! input)
++ {
++ fprintf (stderr, "could not open %s: %s\n", argv[0], strerror (errno));
++ exit (1);
++ }
++ PyRun_SimpleFile (input, argv[0]);
++ fclose (input);
++ exit (0);
++}
++
++
++
+
+ static PyObject *
+ gdbpy_get_current_progspace (PyObject *unused1, PyObject *unused2)
+@@ -2034,6 +2145,8 @@ PyMethodDef python_GdbMethods[] =
+ Evaluate command, a string, as a gdb CLI command. Optionally returns\n\
+ a Python String containing the output of the command if to_string is\n\
+ set to True." },
++ { "cli", gdbpy_cli, METH_NOARGS,
++ "Enter the gdb CLI" },
+ { "parameter", gdbpy_parameter, METH_VARARGS,
+ "Return a gdb parameter's value" },
+
+diff --git a/gdb/python/python.h b/gdb/python/python.h
+index de58fd81df..237a84a0b2 100644
+--- a/gdb/python/python.h
++++ b/gdb/python/python.h
+@@ -25,4 +25,6 @@
+ /* This is all that python exports to gdb. */
+ extern const struct extension_language_defn extension_language_python;
+
++extern void run_python_script (int argc, char **argv);
++
+ #endif /* GDB_PYTHON_H */
+diff --git a/gdb/testsuite/gdb.python/py-frame.exp b/gdb/testsuite/gdb.python/py-frame.exp
+index f186fa9578..0327284226 100644
+--- a/gdb/testsuite/gdb.python/py-frame.exp
++++ b/gdb/testsuite/gdb.python/py-frame.exp
+@@ -95,6 +95,8 @@ gdb_test "python print ('result = %s' % f0.read_var ('a'))" " = 1" "test Frame.r
+
+ gdb_test "python print ('result = %s' % (gdb.selected_frame () == f1))" " = True" "test gdb.selected_frame"
+
++gdb_test "python print ('result = %s' % (f0.block ()))" "<gdb.Block object at 0x\[\[:xdigit:\]\]+>" "test Frame.block"
++
+ # Can read SP register.
+ gdb_test "python print ('result = %s' % (gdb.selected_frame ().read_register ('sp') == gdb.parse_and_eval ('\$sp')))" \
+ " = True" \
+diff --git a/gdb/testsuite/gdb.python/py-value.exp b/gdb/testsuite/gdb.python/py-value.exp
+index eb82a7776f..3069a5c6d7 100644
+--- a/gdb/testsuite/gdb.python/py-value.exp
++++ b/gdb/testsuite/gdb.python/py-value.exp
+@@ -384,6 +384,15 @@ proc test_value_after_death {} {
+ "print value's type"
+ }
+
++# Regression test for a cast failure. The bug was that if we cast a
++# value to its own type, gdb could crash. This happened because we
++# could end up double-freeing a struct value.
++proc test_cast_regression {} {
++ gdb_test "python v = gdb.Value(5)" "" "create value for cast test"
++ gdb_test "python v = v.cast(v.type)" "" "cast value for cast test"
++ gdb_test "python print(v)" "5" "print value for cast test"
++}
++
+ # Regression test for invalid subscript operations. The bug was that
+ # the type of the value was not being checked before allowing a
+ # subscript operation to proceed.
+@@ -512,6 +521,7 @@ if ![runto_main] then {
+ test_value_in_inferior
+ test_inferior_function_call
+ test_value_after_death
++test_cast_regression
+
+ # Test either C or C++ values.
+
+diff --git a/gdb/varobj.c b/gdb/varobj.c
+index 01dabef37c..c198731d0b 100644
+--- a/gdb/varobj.c
++++ b/gdb/varobj.c
+@@ -217,6 +217,14 @@ is_root_p (const struct varobj *var)
+ }
+
+ #ifdef HAVE_PYTHON
++/* Helper function to install a Python environment suitable for
++ use during operations on VAR. */
++struct cleanup *
++varobj_ensure_python_env (const struct varobj *var)
++{
++ return ensure_python_env (var->root->exp->gdbarch,
++ var->root->exp->language_defn);
++}
+
+ /* See python-internal.h. */
+ gdbpy_enter_varobj::gdbpy_enter_varobj (const struct varobj *var)
+diff --git a/gdb/varobj.h b/gdb/varobj.h
+index 6e80d1b89e..677547996f 100644
+--- a/gdb/varobj.h
++++ b/gdb/varobj.h
+@@ -327,6 +327,8 @@ extern bool varobj_has_more (const struct varobj *var, int to);
+
+ extern bool varobj_is_dynamic_p (const struct varobj *var);
+
++extern struct cleanup *varobj_ensure_python_env (const struct varobj *var);
++
+ extern bool varobj_default_value_is_changeable_p (const struct varobj *var);
+ extern bool varobj_value_is_changeable_p (const struct varobj *var);
+
+--
+2.14.3
+
diff --git a/gdb-attach-fail-reasons-5of5.patch b/gdb-attach-fail-reasons-5of5.patch
deleted file mode 100644
index d9c55a9..0000000
--- a/gdb-attach-fail-reasons-5of5.patch
+++ /dev/null
@@ -1,399 +0,0 @@
-http://sourceware.org/ml/gdb-patches/2012-03/msg00171.html
-Subject: [patch 3/3] attach-fail-reasons: SELinux deny_ptrace
-
-Hi,
-
-and here is the last bit for new SELinux 'deny_ptrace':
- https://bugzilla.redhat.com/show_bug.cgi?id=786878
-
-As even PTRACE_TRACEME fails in such case it needs to install hook for even
-that event.
-
-
-Thanks,
-Jan
-
-
-gdb/
-2012-03-06 Jan Kratochvil <jan.kratochvil(a)redhat.com>
-
- * common/linux-ptrace.c [HAVE_SELINUX_SELINUX_H]: include
- selinux/selinux.h.
- (linux_ptrace_attach_warnings): Call linux_ptrace_create_warnings.
- (linux_ptrace_create_warnings): New.
- * common/linux-ptrace.h (linux_ptrace_create_warnings): New declaration.
- * config.in: Regenerate.
- * configure: Regenerate.
- * configure.ac: Check selinux/selinux.h and the selinux library.
- * inf-ptrace.c (inf_ptrace_me): Check the ptrace result.
- * linux-nat.c (linux_nat_create_inferior): New variable ex. Wrap
- to_create_inferior into TRY_CATCH, call linux_ptrace_create_warnings.
-
-gdb/gdbserver/
- * config.in: Regenerate.
- * configure: Regenerate.
- * configure.ac: Check selinux/selinux.h and the selinux library.
- * linux-low.c (linux_traceme): New function.
- (linux_create_inferior, linux_tracefork_child): Call it instead of
- direct ptrace.
-
-Index: gdb-7.12.50.20170226/gdb/nat/linux-ptrace.c
-===================================================================
---- gdb-7.12.50.20170226.orig/gdb/nat/linux-ptrace.c 2017-02-26 21:27:14.780009449 +0100
-+++ gdb-7.12.50.20170226/gdb/nat/linux-ptrace.c 2017-02-26 21:27:18.838038193 +0100
-@@ -27,6 +27,10 @@
- #include <sys/procfs.h>
- #endif
-
-+#ifdef HAVE_SELINUX_SELINUX_H
-+# include <selinux/selinux.h>
-+#endif /* HAVE_SELINUX_SELINUX_H */
-+
- /* Stores the ptrace options supported by the running kernel.
- A value of -1 means we did not check for features yet. A value
- of 0 means there are no supported features. */
-@@ -51,6 +55,8 @@
- buffer_xml_printf (buffer, _("process %d is a zombie "
- "- the process has already terminated"),
- (int) pid);
-+
-+ linux_ptrace_create_warnings (buffer);
- }
-
- /* See linux-ptrace.h. */
-@@ -594,6 +600,22 @@
- linux_ptrace_test_ret_to_nx ();
- }
-
-+/* Print all possible reasons we could fail to create a traced process. */
-+
-+void
-+linux_ptrace_create_warnings (struct buffer *buffer)
-+{
-+#ifdef HAVE_LIBSELINUX
-+ /* -1 is returned for errors, 0 if it has no effect, 1 if PTRACE_ATTACH is
-+ forbidden. */
-+ if (security_get_boolean_active ("deny_ptrace") == 1)
-+ buffer_xml_printf (buffer,
-+ _("the SELinux boolean 'deny_ptrace' is enabled, "
-+ "you can disable this process attach protection by: "
-+ "(gdb) shell sudo setsebool deny_ptrace=0"));
-+#endif /* HAVE_LIBSELINUX */
-+}
-+
- /* Extract extended ptrace event from wait status. */
-
- int
-Index: gdb-7.12.50.20170226/gdb/nat/linux-ptrace.h
-===================================================================
---- gdb-7.12.50.20170226.orig/gdb/nat/linux-ptrace.h 2017-02-26 21:27:14.780009449 +0100
-+++ gdb-7.12.50.20170226/gdb/nat/linux-ptrace.h 2017-02-26 21:27:18.838038193 +0100
-@@ -185,6 +185,7 @@
- extern char *linux_ptrace_attach_fail_reason_string (ptid_t ptid, int err);
-
- extern void linux_ptrace_init_warnings (void);
-+extern void linux_ptrace_create_warnings (struct buffer *buffer);
- extern void linux_check_ptrace_features (void);
- extern void linux_enable_event_reporting (pid_t pid, int attached);
- extern void linux_disable_event_reporting (pid_t pid);
-Index: gdb-7.12.50.20170226/gdb/configure.ac
-===================================================================
---- gdb-7.12.50.20170226.orig/gdb/configure.ac 2017-02-26 21:27:14.781009456 +0100
-+++ gdb-7.12.50.20170226/gdb/configure.ac 2017-02-26 21:27:18.839038200 +0100
-@@ -2092,6 +2092,10 @@
- esac
- AC_DEFINE_UNQUOTED(GDBINIT,"$gdbinit",[The .gdbinit filename.])
-
-+dnl Check security_get_boolean_active availability.
-+AC_CHECK_HEADERS(selinux/selinux.h)
-+AC_CHECK_LIB(selinux, security_get_boolean_active)
-+
- dnl Handle optional features that can be enabled.
-
- # Support for --with-sysroot is a copy of GDB_AC_WITH_DIR,
-Index: gdb-7.12.50.20170226/gdb/gdbserver/configure.ac
-===================================================================
---- gdb-7.12.50.20170226.orig/gdb/gdbserver/configure.ac 2017-02-26 21:27:14.781009456 +0100
-+++ gdb-7.12.50.20170226/gdb/gdbserver/configure.ac 2017-02-26 21:27:18.839038200 +0100
-@@ -469,6 +469,10 @@
- fi
- fi
-
-+dnl Check security_get_boolean_active availability.
-+AC_CHECK_HEADERS(selinux/selinux.h)
-+AC_CHECK_LIB(selinux, security_get_boolean_active)
-+
- AC_SUBST(GDBSERVER_DEPFILES)
- AC_SUBST(GDBSERVER_LIBS)
- AC_SUBST(srv_xmlbuiltin)
-Index: gdb-7.12.50.20170226/gdb/gdbserver/linux-low.c
-===================================================================
---- gdb-7.12.50.20170226.orig/gdb/gdbserver/linux-low.c 2017-02-26 21:27:14.783009470 +0100
-+++ gdb-7.12.50.20170226/gdb/gdbserver/linux-low.c 2017-02-26 21:27:18.841038214 +0100
-@@ -946,6 +946,29 @@
- return lwp;
- }
-
-+/* Execute PTRACE_TRACEME with error checking. */
-+
-+static void
-+linux_traceme (const char *program)
-+{
-+ int save_errno;
-+ struct buffer buffer;
-+
-+ errno = 0;
-+ if (ptrace (PTRACE_TRACEME, 0,
-+ (PTRACE_TYPE_ARG3) 0, (PTRACE_TYPE_ARG4) 0) == 0)
-+ return;
-+
-+ save_errno = errno;
-+ buffer_init (&buffer);
-+ linux_ptrace_create_warnings (&buffer);
-+ buffer_grow_str0 (&buffer, "");
-+ fprintf (stderr, _("%sCannot trace created process %s: %s.\n"),
-+ buffer_finish (&buffer), program, strerror (save_errno));
-+ fflush (stderr);
-+ _exit (0177);
-+}
-+
- /* Start an inferior process and returns its pid.
- ALLARGS is a vector of program-name and args. */
-
-@@ -969,7 +992,7 @@
- if (pid == 0)
- {
- close_most_fds ();
-- ptrace (PTRACE_TRACEME, 0, (PTRACE_TYPE_ARG3) 0, (PTRACE_TYPE_ARG4) 0);
-+ linux_traceme (program);
-
- setpgid (0, 0);
-
-Index: gdb-7.12.50.20170226/gdb/linux-nat.c
-===================================================================
---- gdb-7.12.50.20170226.orig/gdb/linux-nat.c 2017-02-26 21:27:14.785009484 +0100
-+++ gdb-7.12.50.20170226/gdb/linux-nat.c 2017-02-26 21:27:18.842038221 +0100
-@@ -1110,6 +1110,7 @@
- {
- struct cleanup *restore_personality
- = maybe_disable_address_space_randomization (disable_randomization);
-+ volatile struct gdb_exception ex;
-
- /* The fork_child mechanism is synchronous and calls target_wait, so
- we have to mask the async mode. */
-@@ -1117,7 +1118,28 @@
- /* Make sure we report all signals during startup. */
- linux_nat_pass_signals (ops, 0, NULL);
-
-- linux_ops->to_create_inferior (ops, exec_file, allargs, env, from_tty);
-+ TRY
-+ {
-+ linux_ops->to_create_inferior (ops, exec_file, allargs, env, from_tty);
-+ }
-+ CATCH (ex, RETURN_MASK_ERROR)
-+ {
-+ struct buffer buffer;
-+ char *message, *buffer_s;
-+
-+ message = xstrdup (ex.message);
-+ make_cleanup (xfree, message);
-+
-+ buffer_init (&buffer);
-+ linux_ptrace_create_warnings (&buffer);
-+
-+ buffer_grow_str0 (&buffer, "");
-+ buffer_s = buffer_finish (&buffer);
-+ make_cleanup (xfree, buffer_s);
-+
-+ throw_error (ex.error, "%s%s", buffer_s, message);
-+ }
-+ END_CATCH
-
- do_cleanups (restore_personality);
- }
-Index: gdb-7.12.50.20170226/gdb/config.in
-===================================================================
---- gdb-7.12.50.20170226.orig/gdb/config.in 2017-02-26 21:27:14.786009491 +0100
-+++ gdb-7.12.50.20170226/gdb/config.in 2017-02-26 21:27:18.842038221 +0100
-@@ -270,6 +270,9 @@
- /* Define if librpm library is being used. */
- #undef HAVE_LIBRPM
-
-+/* Define to 1 if you have the `selinux' library (-lselinux). */
-+#undef HAVE_LIBSELINUX
-+
- /* Define to 1 if you have the <libunwind-ia64.h> header file. */
- #undef HAVE_LIBUNWIND_IA64_H
-
-@@ -402,6 +405,9 @@
- /* Define to 1 if you have the `scm_new_smob' function. */
- #undef HAVE_SCM_NEW_SMOB
-
-+/* Define to 1 if you have the <selinux/selinux.h> header file. */
-+#undef HAVE_SELINUX_SELINUX_H
-+
- /* Define to 1 if you have the `setlocale' function. */
- #undef HAVE_SETLOCALE
-
-Index: gdb-7.12.50.20170226/gdb/configure
-===================================================================
---- gdb-7.12.50.20170226.orig/gdb/configure 2017-02-26 21:27:14.790009519 +0100
-+++ gdb-7.12.50.20170226/gdb/configure 2017-02-26 21:27:18.846038249 +0100
-@@ -15492,6 +15492,64 @@
- _ACEOF
-
-
-+for ac_header in selinux/selinux.h
-+do :
-+ ac_fn_c_check_header_mongrel "$LINENO" "selinux/selinux.h" "ac_cv_header_selinux_selinux_h" "$ac_includes_default"
-+if test "x$ac_cv_header_selinux_selinux_h" = x""yes; then :
-+ cat >>confdefs.h <<_ACEOF
-+#define HAVE_SELINUX_SELINUX_H 1
-+_ACEOF
-+
-+fi
-+
-+done
-+
-+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for security_get_boolean_active in -lselinux" >&5
-+$as_echo_n "checking for security_get_boolean_active in -lselinux... " >&6; }
-+if test "${ac_cv_lib_selinux_security_get_boolean_active+set}" = set; then :
-+ $as_echo_n "(cached) " >&6
-+else
-+ ac_check_lib_save_LIBS=$LIBS
-+LIBS="-lselinux $LIBS"
-+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-+/* end confdefs.h. */
-+
-+/* Override any GCC internal prototype to avoid an error.
-+ Use char because int might match the return type of a GCC
-+ builtin and then its argument prototype would still apply. */
-+#ifdef __cplusplus
-+extern "C"
-+#endif
-+char security_get_boolean_active ();
-+int
-+main ()
-+{
-+return security_get_boolean_active ();
-+ ;
-+ return 0;
-+}
-+_ACEOF
-+if ac_fn_c_try_link "$LINENO"; then :
-+ ac_cv_lib_selinux_security_get_boolean_active=yes
-+else
-+ ac_cv_lib_selinux_security_get_boolean_active=no
-+fi
-+rm -f core conftest.err conftest.$ac_objext \
-+ conftest$ac_exeext conftest.$ac_ext
-+LIBS=$ac_check_lib_save_LIBS
-+fi
-+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_selinux_security_get_boolean_active" >&5
-+$as_echo "$ac_cv_lib_selinux_security_get_boolean_active" >&6; }
-+if test "x$ac_cv_lib_selinux_security_get_boolean_active" = x""yes; then :
-+ cat >>confdefs.h <<_ACEOF
-+#define HAVE_LIBSELINUX 1
-+_ACEOF
-+
-+ LIBS="-lselinux $LIBS"
-+
-+fi
-+
-+
-
- # Support for --with-sysroot is a copy of GDB_AC_WITH_DIR,
- # except that the argument to --with-sysroot is optional.
-Index: gdb-7.12.50.20170226/gdb/gdbserver/config.in
-===================================================================
---- gdb-7.12.50.20170226.orig/gdb/gdbserver/config.in 2017-02-26 21:27:14.791009527 +0100
-+++ gdb-7.12.50.20170226/gdb/gdbserver/config.in 2017-02-26 21:27:18.846038249 +0100
-@@ -123,6 +123,9 @@
- /* Define to 1 if you have the `mcheck' library (-lmcheck). */
- #undef HAVE_LIBMCHECK
-
-+/* Define to 1 if you have the `selinux' library (-lselinux). */
-+#undef HAVE_LIBSELINUX
-+
- /* Define if the target supports branch tracing. */
- #undef HAVE_LINUX_BTRACE
-
-@@ -199,6 +202,9 @@
- /* Define to 1 if you have the `pwrite' function. */
- #undef HAVE_PWRITE
-
-+/* Define to 1 if you have the <selinux/selinux.h> header file. */
-+#undef HAVE_SELINUX_SELINUX_H
-+
- /* Define to 1 if you have the `setns' function. */
- #undef HAVE_SETNS
-
-Index: gdb-7.12.50.20170226/gdb/gdbserver/configure
-===================================================================
---- gdb-7.12.50.20170226.orig/gdb/gdbserver/configure 2017-02-26 21:27:14.793009541 +0100
-+++ gdb-7.12.50.20170226/gdb/gdbserver/configure 2017-02-26 21:27:18.848038263 +0100
-@@ -8429,6 +8429,64 @@
- fi
- fi
-
-+for ac_header in selinux/selinux.h
-+do :
-+ ac_fn_c_check_header_mongrel "$LINENO" "selinux/selinux.h" "ac_cv_header_selinux_selinux_h" "$ac_includes_default"
-+if test "x$ac_cv_header_selinux_selinux_h" = x""yes; then :
-+ cat >>confdefs.h <<_ACEOF
-+#define HAVE_SELINUX_SELINUX_H 1
-+_ACEOF
-+
-+fi
-+
-+done
-+
-+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for security_get_boolean_active in -lselinux" >&5
-+$as_echo_n "checking for security_get_boolean_active in -lselinux... " >&6; }
-+if test "${ac_cv_lib_selinux_security_get_boolean_active+set}" = set; then :
-+ $as_echo_n "(cached) " >&6
-+else
-+ ac_check_lib_save_LIBS=$LIBS
-+LIBS="-lselinux $LIBS"
-+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-+/* end confdefs.h. */
-+
-+/* Override any GCC internal prototype to avoid an error.
-+ Use char because int might match the return type of a GCC
-+ builtin and then its argument prototype would still apply. */
-+#ifdef __cplusplus
-+extern "C"
-+#endif
-+char security_get_boolean_active ();
-+int
-+main ()
-+{
-+return security_get_boolean_active ();
-+ ;
-+ return 0;
-+}
-+_ACEOF
-+if ac_fn_c_try_link "$LINENO"; then :
-+ ac_cv_lib_selinux_security_get_boolean_active=yes
-+else
-+ ac_cv_lib_selinux_security_get_boolean_active=no
-+fi
-+rm -f core conftest.err conftest.$ac_objext \
-+ conftest$ac_exeext conftest.$ac_ext
-+LIBS=$ac_check_lib_save_LIBS
-+fi
-+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_selinux_security_get_boolean_active" >&5
-+$as_echo "$ac_cv_lib_selinux_security_get_boolean_active" >&6; }
-+if test "x$ac_cv_lib_selinux_security_get_boolean_active" = x""yes; then :
-+ cat >>confdefs.h <<_ACEOF
-+#define HAVE_LIBSELINUX 1
-+_ACEOF
-+
-+ LIBS="-lselinux $LIBS"
-+
-+fi
-+
-+
-
-
-
diff --git a/gdb-btrobust.patch b/gdb-btrobust.patch
index dd57543..5175ff0 100644
--- a/gdb-btrobust.patch
+++ b/gdb-btrobust.patch
@@ -1,13 +1,26 @@
+From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
+From: Fedora GDB patches <invalid(a)email.com>
+Date: Fri, 27 Oct 2017 21:07:50 +0200
+Subject: gdb-btrobust.patch
+
+FileName: gdb-btrobust.patch
+
+;; Continue backtrace even if a frame filter throws an exception (Phil Muldoon).
+;;=push
+
This should fix the error with glib. An error message will still be
printed, but a default backtrace will occur in this case.
--
+---
+ gdb/python/py-framefilter.c | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
-Index: gdb-7.12.50.20170226/gdb/python/py-framefilter.c
-===================================================================
---- gdb-7.12.50.20170226.orig/gdb/python/py-framefilter.c 2017-02-26 21:33:23.150618708 +0100
-+++ gdb-7.12.50.20170226/gdb/python/py-framefilter.c 2017-02-26 21:33:29.993667179 +0100
-@@ -1388,6 +1388,7 @@
+diff --git a/gdb/python/py-framefilter.c b/gdb/python/py-framefilter.c
+index e887849c36..a8e4f49eb5 100644
+--- a/gdb/python/py-framefilter.c
++++ b/gdb/python/py-framefilter.c
+@@ -1388,6 +1388,7 @@ gdbpy_apply_frame_filter (const struct extension_language_defn *extlang,
htab_eq_pointer,
NULL));
@@ -15,7 +28,7 @@ Index: gdb-7.12.50.20170226/gdb/python/py-framefilter.c
while (true)
{
gdbpy_ref<> item (PyIter_Next (iterable.get ()));
-@@ -1397,7 +1398,7 @@
+@@ -1397,7 +1398,7 @@ gdbpy_apply_frame_filter (const struct extension_language_defn *extlang,
if (PyErr_Occurred ())
{
gdbpy_print_stack ();
@@ -24,7 +37,7 @@ Index: gdb-7.12.50.20170226/gdb/python/py-framefilter.c
}
break;
}
-@@ -1409,6 +1410,7 @@
+@@ -1409,6 +1410,7 @@ gdbpy_apply_frame_filter (const struct extension_language_defn *extlang,
error and continue with other frames. */
if (success == EXT_LANG_BT_ERROR)
gdbpy_print_stack ();
@@ -32,3 +45,6 @@ Index: gdb-7.12.50.20170226/gdb/python/py-framefilter.c
}
return success;
+--
+2.14.3
+
diff --git a/gdb-bz1219747-attach-kills.patch b/gdb-bz1219747-attach-kills.patch
index fe3781c..0572aa6 100644
--- a/gdb-bz1219747-attach-kills.patch
+++ b/gdb-bz1219747-attach-kills.patch
@@ -1,5 +1,14 @@
+From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
+From: Fedora GDB patches <invalid(a)email.com>
+Date: Fri, 27 Oct 2017 21:07:50 +0200
+Subject: Never kill PID on: gdb exec PID
+
+FileName: gdb-bz1219747-attach-kills.patch
+
+;; Never kill PID on: gdb exec PID (Jan Kratochvil, RH BZ 1219747).
+;;=push+jan
+
http://sourceware.org/ml/gdb-patches/2015-10/msg00301.html
-Subject: [PATCH 1/3] Never kill PID on: gdb exec PID
Hi,
@@ -16,25 +25,13 @@ A program is being debugged already. Kill it? (y or n) _
The first attachment of "/tmp/sleep" commandline argument errors at:
-#0 throw_error (error=GENERIC_ERROR, fmt=0x116d135 "%s.") at ./common/common-exceptions.c:371
-#1 in throw_perror_with_name (errcode=GENERIC_ERROR, string=0x7fffffffdb96 "/dfsfds") at utils.c:974
-#2 in perror_with_name (string=0x7fffffffdb96 "/dfsfds") at utils.c:982
-#3 in exec_file_attach (filename=0x7fffffffdb96 "/dfsfds", from_tty=1) at exec.c:268
267 if (scratch_chan < 0)
268 perror_with_name (filename);
-#4 in catch_command_errors_const (command=0x80f59f <exec_file_attach>, arg=0x7fffffffdb96 "/dfsfds", from_tty=1) at main.c:395
-#5 in captured_main (data=0x7fffffffd6f0) at main.c:1051
1051 if (catch_command_errors_const (exec_file_attach, execarg,
1052 !batch_flag))
Then GDB tries to attach to the process $p:
-#0 inferior_appeared (inf=0x240e0b0, pid=29210) at inferior.c:305
-#1 in inf_ptrace_attach (ops=0x2339540, args=0x21dcdc0 "29210", from_tty=1) at inf-ptrace.c:206
-#2 in linux_nat_attach (ops=0x2339540, args=0x21dcdc0 "29210", from_tty=1) at linux-nat.c:1278
-#3 in attach_command (args=0x21dcdc0 "29210", from_tty=1) at infcmd.c:2748
-#4 in catch_command_errors (command=0x79d7e5 <attach_command>, arg=0x7fffffffdb9e "29210", from_tty=1) at main.c:368
-#5 in captured_main (data=0x7fffffffd6f0) at main.c:1082
1082 if (catch_command_errors (attach_command, pid_or_core_arg,
1083 !batch_flag) == 0)
@@ -45,37 +42,14 @@ the lines
still fail because consequently attach_command() fails to find the associated
executable file:
-#0 throw_error (error=GENERIC_ERROR, fmt=0x116d135 "%s.") at ./common/common-exceptions.c:371
-#1 in throw_perror_with_name (errcode=GENERIC_ERROR, string=0x2477860 "/tmp/sleep (deleted)") at utils.c:974
-#2 in perror_with_name (string=0x2477860 "/tmp/sleep (deleted)") at utils.c:982
-#3 in exec_file_attach (filename=0x2477860 "/tmp/sleep (deleted)", from_tty=1) at exec.c:268
267 if (scratch_chan < 0)
268 perror_with_name (filename);
-#4 in exec_file_locate_attach (pid=29210, from_tty=1) at exec.c:173
-#5 in attach_command_post_wait (args=0x24739b0 "29210", from_tty=1, async_exec=0) at infcmd.c:2628
-#6 in attach_command_continuation (args=0x2473590, err=0) at infcmd.c:2700
-#7 in do_my_continuations_1 (pmy_chain=0x7fffffffd190, err=0) at continuations.c:59
-#8 in do_my_continuations (list=0x240e130, err=0) at continuations.c:83
-#9 in do_all_inferior_continuations (err=0) at continuations.c:125
-#10 in inferior_event_handler (event_type=INF_EXEC_COMPLETE, client_data=0x0) at inf-loop.c:60
-#11 in fetch_inferior_event (client_data=0x0) at infrun.c:3929
-#12 in inferior_event_handler (event_type=INF_REG_EVENT, client_data=0x0) at inf-loop.c:44
-#13 in handle_target_event (error=0, client_data=0x0) at linux-nat.c:4681
-#14 in handle_file_event (file_ptr=0x21e4170, ready_mask=1) at event-loop.c:708
-#15 in gdb_wait_for_event (block=0) at event-loop.c:834
-#16 in gdb_do_one_event () at event-loop.c:298
-#17 in wait_sync_command_done () at top.c:373
-#18 in maybe_wait_sync_command_done (was_sync=0) at top.c:388
-#19 in catch_command_errors (command=0x79d7e5 <attach_command>, arg=0x7fffffffdb9e "29210", from_tty=1) at main.c:370
-#20 in captured_main (data=0x7fffffffd6f0) at main.c:1082
1082 if (catch_command_errors (attach_command, pid_or_core_arg,
1083 !batch_flag) == 0)
and therefore GDB executes the following:
(gdb) bt
-#5 in query (ctlstr=0x1141ae8 "A program is being debugged already. Kill it? ") at utils.c:1371
-#6 in target_preopen (from_tty=1) at target.c:2183
2179 if (have_inferiors ())
2180 {
2181 if (!from_tty
@@ -85,20 +59,14 @@ and therefore GDB executes the following:
2185 else
2186 error (_("Program not killed."));
2187 }
-#7 in core_open (arg=0x7fffffffdb9f "9694", from_tty=1) at corelow.c:283
-#8 in core_file_command (filename=0x7fffffffdb9f "9694", from_tty=1) at corefile.c:77
-#9 in catch_command_errors (command=0x86ca16 <core_file_command>, arg=0x7fffffffdb9f "9694", from_tty=1) at main.c:368
-#10 in captured_main (data=0x7fffffffd6f0) at main.c:1084
1084 catch_command_errors (core_file_command, pid_or_core_arg,
1085 !batch_flag);
No regressions on {x86_64,x86_64-m32,i686}-fedora24pre-linux-gnu.
-
Thanks,
Jan
-
gdb/ChangeLog
2015-10-16 Jan Kratochvil <jan.kratochvil(a)redhat.com>
@@ -111,17 +79,18 @@ gdb/testsuite/ChangeLog
* gdb.base/attach-kills.c: New.
* gdb.base/attach-kills.exp: New.
---
- gdb/testsuite/gdb.base/attach-kills.c | 25 ++++++++++++++++
- gdb/testsuite/gdb.base/attach-kills.exp | 49 +++++++++++++++++++++++++++++++
- 2 files changed, 74 insertions(+)
+ gdb/main.c | 5 +++-
+ gdb/testsuite/gdb.base/attach-kills.c | 25 +++++++++++++++++
+ gdb/testsuite/gdb.base/attach-kills.exp | 49 +++++++++++++++++++++++++++++++++
+ 3 files changed, 78 insertions(+), 1 deletion(-)
create mode 100644 gdb/testsuite/gdb.base/attach-kills.c
create mode 100644 gdb/testsuite/gdb.base/attach-kills.exp
diff --git a/gdb/main.c b/gdb/main.c
-index 49c9b68..bc19699 100644
+index 17d35f4a8a..b079e79c93 100644
--- a/gdb/main.c
+++ b/gdb/main.c
-@@ -1080,7 +1080,10 @@ captured_main (void *data)
+@@ -1114,7 +1114,10 @@ captured_main_1 (struct captured_main_args *context)
if (isdigit (pid_or_core_arg[0]))
{
if (catch_command_errors (attach_command, pid_or_core_arg,
@@ -135,7 +104,7 @@ index 49c9b68..bc19699 100644
}
diff --git a/gdb/testsuite/gdb.base/attach-kills.c b/gdb/testsuite/gdb.base/attach-kills.c
new file mode 100644
-index 0000000..2398f00
+index 0000000000..2398f00442
--- /dev/null
+++ b/gdb/testsuite/gdb.base/attach-kills.c
@@ -0,0 +1,25 @@
@@ -166,7 +135,7 @@ index 0000000..2398f00
+}
diff --git a/gdb/testsuite/gdb.base/attach-kills.exp b/gdb/testsuite/gdb.base/attach-kills.exp
new file mode 100644
-index 0000000..9a93cb7
+index 0000000000..9a93cb7584
--- /dev/null
+++ b/gdb/testsuite/gdb.base/attach-kills.exp
@@ -0,0 +1,49 @@
@@ -219,4 +188,6 @@ index 0000000..9a93cb7
+}
+
+kill_wait_spawned_process $test_spawn_id
+--
+2.14.3
diff --git a/gdb-bz533176-fortran-omp-step.patch b/gdb-bz533176-fortran-omp-step.patch
index 1ad42b9..2f2f820 100644
--- a/gdb-bz533176-fortran-omp-step.patch
+++ b/gdb-bz533176-fortran-omp-step.patch
@@ -1,3 +1,13 @@
+From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
+From: Fedora GDB patches <invalid(a)email.com>
+Date: Fri, 27 Oct 2017 21:07:50 +0200
+Subject: gdb-bz533176-fortran-omp-step.patch
+
+FileName: gdb-bz533176-fortran-omp-step.patch
+
+;; Fix stepping with OMP parallel Fortran sections (BZ 533176).
+;;=push+jan: It requires some better DWARF annotations.
+
https://bugzilla.redhat.com/show_bug.cgi?id=533176#c4
I find it a bug in DWARF and gdb behaves correctly according to it. From the
@@ -18,14 +28,19 @@ upstream) or "step" (default in F/RHEL) the simultaneous execution of the
threads is inconvenient. Setting it to "on" will lockup the debugging as the
threads need to get synchronized at some point. This is a more general
debugging problem of GOMP outside of the scope of this Bug.
+---
+ gdb/infrun.c | 11 +++++++++++
+ gdb/testsuite/gdb.fortran/omp-step.exp | 31 +++++++++++++++++++++++++++++++
+ gdb/testsuite/gdb.fortran/omp-step.f90 | 32 ++++++++++++++++++++++++++++++++
+ 3 files changed, 74 insertions(+)
+ create mode 100644 gdb/testsuite/gdb.fortran/omp-step.exp
+ create mode 100644 gdb/testsuite/gdb.fortran/omp-step.f90
-
-
-Index: gdb-7.7.90.20140613/gdb/infrun.c
-===================================================================
---- gdb-7.7.90.20140613.orig/gdb/infrun.c 2014-06-13 21:59:10.835805512 +0200
-+++ gdb-7.7.90.20140613/gdb/infrun.c 2014-06-13 21:59:31.064829121 +0200
-@@ -4820,6 +4820,16 @@ process_event_stop_test (struct executio
+diff --git a/gdb/infrun.c b/gdb/infrun.c
+index 8e30aed3b8..9b7b238f4d 100644
+--- a/gdb/infrun.c
++++ b/gdb/infrun.c
+@@ -6663,6 +6663,16 @@ process_event_stop_test (struct execution_control_state *ecs)
if (ecs->event_thread->control.step_over_calls == STEP_OVER_ALL)
{
@@ -42,7 +57,7 @@ Index: gdb-7.7.90.20140613/gdb/infrun.c
/* We're doing a "next".
Normal (forward) execution: set a breakpoint at the
-@@ -4855,6 +4865,7 @@ process_event_stop_test (struct executio
+@@ -6696,6 +6706,7 @@ process_event_stop_test (struct execution_control_state *ecs)
keep_going (ecs);
return;
@@ -50,10 +65,11 @@ Index: gdb-7.7.90.20140613/gdb/infrun.c
}
/* If we are in a function call trampoline (a stub between the
-Index: gdb-7.7.90.20140613/gdb/testsuite/gdb.fortran/omp-step.exp
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ gdb-7.7.90.20140613/gdb/testsuite/gdb.fortran/omp-step.exp 2014-06-13 21:59:22.801819481 +0200
+diff --git a/gdb/testsuite/gdb.fortran/omp-step.exp b/gdb/testsuite/gdb.fortran/omp-step.exp
+new file mode 100644
+index 0000000000..66440a7507
+--- /dev/null
++++ b/gdb/testsuite/gdb.fortran/omp-step.exp
@@ -0,0 +1,31 @@
+# Copyright 2009 Free Software Foundation, Inc.
+
@@ -86,10 +102,11 @@ Index: gdb-7.7.90.20140613/gdb/testsuite/gdb.fortran/omp-step.exp
+
+gdb_breakpoint [gdb_get_line_number "success"]
+gdb_continue_to_breakpoint "success" ".*success.*"
-Index: gdb-7.7.90.20140613/gdb/testsuite/gdb.fortran/omp-step.f90
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ gdb-7.7.90.20140613/gdb/testsuite/gdb.fortran/omp-step.f90 2014-06-13 21:59:22.801819481 +0200
+diff --git a/gdb/testsuite/gdb.fortran/omp-step.f90 b/gdb/testsuite/gdb.fortran/omp-step.f90
+new file mode 100644
+index 0000000000..a0cfb37014
+--- /dev/null
++++ b/gdb/testsuite/gdb.fortran/omp-step.f90
@@ -0,0 +1,32 @@
+! Copyright 2009 Free Software Foundation, Inc.
+
@@ -123,3 +140,6 @@ Index: gdb-7.7.90.20140613/gdb/testsuite/gdb.fortran/omp-step.f90
+ end do
+ print *, "success"
+ end
+--
+2.14.3
+
diff --git a/gdb-bz541866-rwatch-before-run.patch b/gdb-bz541866-rwatch-before-run.patch
index ba0622a..bbb65a0 100644
--- a/gdb-bz541866-rwatch-before-run.patch
+++ b/gdb-bz541866-rwatch-before-run.patch
@@ -1,32 +1,52 @@
-Index: gdb-7.11.90.20160807/gdb/config/i386/linux64.mh
-===================================================================
---- gdb-7.11.90.20160807.orig/gdb/config/i386/linux64.mh 2016-08-07 22:27:13.889285274 +0200
-+++ gdb-7.11.90.20160807/gdb/config/i386/linux64.mh 2016-08-07 22:29:20.451311124 +0200
-@@ -7,7 +7,7 @@
- linux-procfs.o linux-ptrace.o linux-btrace.o \
- linux-waitpid.o linux-personality.o x86-linux.o \
- x86-linux-dregs.o amd64-linux-siginfo.o linux-namespaces.o
--NAT_FILE= config/nm-linux.h
-+NAT_FILE= nm-linux64.h
- NAT_CDEPS = $(srcdir)/proc-service.list
+From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
+From: Fedora GDB patches <invalid(a)email.com>
+Date: Fri, 27 Oct 2017 21:07:50 +0200
+Subject: gdb-bz541866-rwatch-before-run.patch
+
+FileName: gdb-bz541866-rwatch-before-run.patch
+
+;; Fix i386+x86_64 rwatch+awatch before run, regression against 6.8 (BZ 541866).
+;; Fix i386 rwatch+awatch before run (BZ 688788, on top of BZ 541866).
+;;=push+jan: It should be fixed properly instead.
+---
+ gdb/breakpoint.c | 4 +--
+ gdb/config/i386/nm-linux.h | 28 +++++++++++++++
+ gdb/config/i386/nm-linux64.h | 28 +++++++++++++++
+ gdb/configure.nat | 2 ++
+ gdb/target.h | 2 ++
+ .../gdb.base/watchpoint-hw-before-run.exp | 40 ++++++++++++++++++++++
+ 6 files changed, 102 insertions(+), 2 deletions(-)
+ create mode 100644 gdb/config/i386/nm-linux.h
+ create mode 100644 gdb/config/i386/nm-linux64.h
+ create mode 100644 gdb/testsuite/gdb.base/watchpoint-hw-before-run.exp
+
+diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c
+index 814802a0a1..5a99de75e1 100644
+--- a/gdb/breakpoint.c
++++ b/gdb/breakpoint.c
+@@ -8864,7 +8864,7 @@ init_breakpoint_sal (struct breakpoint *b, struct gdbarch *gdbarch,
+ int enabled, int internal, unsigned flags,
+ int display_canonical)
+ {
+- int i;
++ int i ATTRIBUTE_UNUSED;
- # The dynamically loaded libthread_db needs access to symbols in the
-Index: gdb-7.11.90.20160807/gdb/config/i386/linux.mh
-===================================================================
---- gdb-7.11.90.20160807.orig/gdb/config/i386/linux.mh 2016-08-07 22:27:13.889285274 +0200
-+++ gdb-7.11.90.20160807/gdb/config/i386/linux.mh 2016-08-07 22:29:20.451311124 +0200
-@@ -1,6 +1,6 @@
- # Host: Intel 386 running GNU/Linux.
+ if (type == bp_hardware_breakpoint)
+ {
+@@ -14425,7 +14425,7 @@ enable_breakpoint_disp (struct breakpoint *bpt, enum bpdisp disposition,
--NAT_FILE= config/nm-linux.h
-+NAT_FILE= nm-linux.h
- NATDEPFILES= inf-ptrace.o fork-child.o \
- x86-nat.o x86-dregs.o i386-linux-nat.o x86-linux-nat.o \
- proc-service.o linux-thread-db.o \
-Index: gdb-7.11.90.20160807/gdb/config/i386/nm-linux.h
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ gdb-7.11.90.20160807/gdb/config/i386/nm-linux.h 2016-08-07 22:29:20.451311124 +0200
+ if (bpt->type == bp_hardware_breakpoint)
+ {
+- int i;
++ int i ATTRIBUTE_UNUSED;
+ i = hw_breakpoint_used_count ();
+ target_resources_ok =
+ target_can_use_hardware_watchpoint (bp_hardware_breakpoint,
+diff --git a/gdb/config/i386/nm-linux.h b/gdb/config/i386/nm-linux.h
+new file mode 100644
+index 0000000000..38e94baab1
+--- /dev/null
++++ b/gdb/config/i386/nm-linux.h
@@ -0,0 +1,28 @@
+/* Native support for GNU/Linux i386.
+
@@ -56,10 +76,11 @@ Index: gdb-7.11.90.20160807/gdb/config/i386/nm-linux.h
+#define target_can_use_hardware_watchpoint(type, cnt, ot) 1
+
+#endif /* NM_LINUX64_H */
-Index: gdb-7.11.90.20160807/gdb/config/i386/nm-linux64.h
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ gdb-7.11.90.20160807/gdb/config/i386/nm-linux64.h 2016-08-07 22:29:20.451311124 +0200
+diff --git a/gdb/config/i386/nm-linux64.h b/gdb/config/i386/nm-linux64.h
+new file mode 100644
+index 0000000000..212daba477
+--- /dev/null
++++ b/gdb/config/i386/nm-linux64.h
@@ -0,0 +1,28 @@
+/* Native support for GNU/Linux amd64.
+
@@ -89,11 +110,31 @@ Index: gdb-7.11.90.20160807/gdb/config/i386/nm-linux64.h
+#define target_can_use_hardware_watchpoint(type, cnt, ot) 1
+
+#endif /* NM_LINUX64_H */
-Index: gdb-7.11.90.20160807/gdb/target.h
-===================================================================
---- gdb-7.11.90.20160807.orig/gdb/target.h 2016-08-07 22:27:13.889285274 +0200
-+++ gdb-7.11.90.20160807/gdb/target.h 2016-08-07 22:29:20.452311132 +0200
-@@ -1939,9 +1939,11 @@
+diff --git a/gdb/configure.nat b/gdb/configure.nat
+index 8e14892722..6dbb072054 100644
+--- a/gdb/configure.nat
++++ b/gdb/configure.nat
+@@ -237,6 +237,7 @@ case ${gdb_host} in
+ ;;
+ i386)
+ # Host: Intel 386 running GNU/Linux.
++ NAT_FILE="${srcdir}/config/${gdb_host_cpu}/nm-linux.h"
+ NATDEPFILES="${NATDEPFILES} x86-nat.o x86-dregs.o \
+ i386-linux-nat.o x86-linux-nat.o linux-btrace.o \
+ x86-linux.o x86-linux-dregs.o"
+@@ -289,6 +290,7 @@ case ${gdb_host} in
+ case ${gdb_host_cpu} in
+ i386)
+ # Host: GNU/Linux x86-64
++ NAT_FILE="${srcdir}/config/${gdb_host_cpu}/nm-linux64.h"
+ NATDEPFILES="${NATDEPFILES} x86-nat.o x86-dregs.o \
+ amd64-nat.o amd64-linux-nat.o x86-linux-nat.o linux-btrace.o \
+ x86-linux.o x86-linux-dregs.o amd64-linux-siginfo.o"
+diff --git a/gdb/target.h b/gdb/target.h
+index 4781fbc59c..e3a2882fe5 100644
+--- a/gdb/target.h
++++ b/gdb/target.h
+@@ -1915,9 +1915,11 @@ extern struct thread_info *target_thread_handle_to_thread_info
one. OTHERTYPE is the number of watchpoints of other types than
this one used so far. */
@@ -105,10 +146,11 @@ Index: gdb-7.11.90.20160807/gdb/target.h
/* Returns the number of debug registers needed to watch the given
memory region, or zero if not supported. */
-Index: gdb-7.11.90.20160807/gdb/testsuite/gdb.base/watchpoint-hw-before-run.exp
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ gdb-7.11.90.20160807/gdb/testsuite/gdb.base/watchpoint-hw-before-run.exp 2016-08-07 22:29:20.452311132 +0200
+diff --git a/gdb/testsuite/gdb.base/watchpoint-hw-before-run.exp b/gdb/testsuite/gdb.base/watchpoint-hw-before-run.exp
+new file mode 100644
+index 0000000000..4ce9997e4a
+--- /dev/null
++++ b/gdb/testsuite/gdb.base/watchpoint-hw-before-run.exp
@@ -0,0 +1,40 @@
+# Copyright 2009, 2010 Free Software Foundation, Inc.
+
@@ -150,16 +192,6 @@ Index: gdb-7.11.90.20160807/gdb/testsuite/gdb.base/watchpoint-hw-before-run.exp
+gdb_test "" "main .* at .*" "start"
+
+gdb_test "continue" "Continuing.\r\n\r\nHardware read watchpoint \[0-9\]+: watchee\r\n\r\nValue = 0\r\n.*"
-Index: gdb-7.11.90.20160807/gdb/breakpoint.c
-===================================================================
---- gdb-7.11.90.20160807.orig/gdb/breakpoint.c 2016-08-07 22:33:38.835405458 +0200
-+++ gdb-7.11.90.20160807/gdb/breakpoint.c 2016-08-07 22:34:45.023941950 +0200
-@@ -14953,7 +14953,7 @@
-
- if (bpt->type == bp_hardware_breakpoint)
- {
-- int i;
-+ int i ATTRIBUTE_UNUSED;
- i = hw_breakpoint_used_count ();
- target_resources_ok =
- target_can_use_hardware_watchpoint (bp_hardware_breakpoint,
+--
+2.14.3
+
diff --git a/gdb-bz568248-oom-is-error.patch b/gdb-bz568248-oom-is-error.patch
index 045d34e..9cc6fa4 100644
--- a/gdb-bz568248-oom-is-error.patch
+++ b/gdb-bz568248-oom-is-error.patch
@@ -1,5 +1,14 @@
+From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
+From: Fedora GDB patches <invalid(a)email.com>
+Date: Fri, 27 Oct 2017 21:07:50 +0200
+Subject: nomem: internal_error -> error
+
+FileName: gdb-bz568248-oom-is-error.patch
+
+;; Out of memory is just an error, not fatal (uninitialized VLS vars, BZ 568248).
+;;=push+jan: Inferior objects should be read in parts, then this patch gets obsoleted.
+
http://sourceware.org/ml/gdb-patches/2010-06/msg00005.html
-Subject: [rfc patch] nomem: internal_error -> error
Hi,
@@ -24,7 +33,6 @@ It is apparently because boundary for the variable `a' is not initialized
there. Users notice it due to Eclipse-CDT trying to automatically display all
the local variables on each step.
-
Apparentl no regressions on {x86_64,x86_64-m32,i686}-fedora13-linux-gnu.
But is anone aware of the reasons to use internal_error there?
I find simple error as a perfectly reasonable there.
@@ -35,22 +43,23 @@ IIRC this idea has been discussed with Tom Tromey, not sure of its origin.
I understand it may be offtopic for FSF GDB but from some GDB crashes I am not
sure if it can happen only due to the VLA variables.
-
Thanks,
Jan
-
gdb/
2010-06-01 Jan Kratochvil <jan.kratochvil(a)redhat.com>
Tom Tromey <tromey(a)redhat.com>
* utils.c (nomem): Change internal_error to error.
-
-Index: gdb-7.3.50.20110722/gdb/utils.c
-===================================================================
---- gdb-7.3.50.20110722.orig/gdb/utils.c 2011-07-22 19:28:58.000000000 +0200
-+++ gdb-7.3.50.20110722/gdb/utils.c 2011-07-22 19:34:25.000000000 +0200
-@@ -1219,13 +1219,11 @@ malloc_failure (long size)
+---
+ gdb/utils.c | 6 ++----
+ 1 file changed, 2 insertions(+), 4 deletions(-)
+
+diff --git a/gdb/utils.c b/gdb/utils.c
+index c531748fe4..0066bfcc4b 100644
+--- a/gdb/utils.c
++++ b/gdb/utils.c
+@@ -774,13 +774,11 @@ malloc_failure (long size)
{
if (size > 0)
{
@@ -66,3 +75,6 @@ Index: gdb-7.3.50.20110722/gdb/utils.c
}
}
+--
+2.14.3
+
diff --git a/gdb-container-rh-pkg.patch b/gdb-container-rh-pkg.patch
index 0b8a3a2..ce648be 100644
--- a/gdb-container-rh-pkg.patch
+++ b/gdb-container-rh-pkg.patch
@@ -1,6 +1,21 @@
---- gdb-7.11/gdb/remote.c-orig 2016-04-06 17:46:52.428921496 +0200
-+++ gdb-7.11/gdb/remote.c 2016-04-06 18:28:26.781923516 +0200
-@@ -13002,7 +13002,17 @@ remote_pid_to_exec_file (struct target_o
+From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
+From: Fedora GDB patches <invalid(a)email.com>
+Date: Fri, 27 Oct 2017 21:07:50 +0200
+Subject: gdb-container-rh-pkg.patch
+
+FileName: gdb-container-rh-pkg.patch
+
+;; Add messages suggesting more recent RHEL gdbserver (RH BZ 1321114).
+;;=fedora
+---
+ gdb/remote.c | 12 +++++++++++-
+ 1 file changed, 11 insertions(+), 1 deletion(-)
+
+diff --git a/gdb/remote.c b/gdb/remote.c
+index 1eee712466..fbade4f267 100644
+--- a/gdb/remote.c
++++ b/gdb/remote.c
+@@ -13431,7 +13431,17 @@ remote_pid_to_exec_file (struct target_ops *self, int pid)
char *annex = NULL;
if (packet_support (PACKET_qXfer_exec_file) != PACKET_ENABLE)
@@ -17,5 +32,8 @@
+ return NULL;
+ }
- if (filename != NULL)
- xfree (filename);
+ inf = find_inferior_pid (pid);
+ if (inf == NULL)
+--
+2.14.3
+
diff --git a/gdb-core-open-vdso-warning.patch b/gdb-core-open-vdso-warning.patch
deleted file mode 100644
index 5bd3ef9..0000000
--- a/gdb-core-open-vdso-warning.patch
+++ /dev/null
@@ -1,50 +0,0 @@
-http://sourceware.org/ml/gdb-patches/2009-10/msg00142.html
-Subject: [patch] Fix GNU/Linux core open: Can't read pathname for load map: Input/output error.
-
-[ New patch variant. ]
-
-commit 7d760051ffb8a23cdc51342d4e6243fbc462f73f
-Author: Ulrich Weigand <uweigand(a)de.ibm.com>
-Date: Wed Sep 25 11:52:50 2013 +0000
-
-Index: gdb-7.6.50.20130731-cvs/gdb/testsuite/gdb.base/solib-symbol.exp
-===================================================================
---- gdb-7.6.50.20130731-cvs.orig/gdb/testsuite/gdb.base/solib-symbol.exp 2013-08-02 16:27:28.833259471 +0200
-+++ gdb-7.6.50.20130731-cvs/gdb/testsuite/gdb.base/solib-symbol.exp 2013-08-02 16:28:22.549330973 +0200
-@@ -29,6 +29,7 @@ set testfile "solib-symbol-main"
- set srcfile ${srcdir}/${subdir}/${testfile}.c
- set binfile [standard_output_file ${testfile}]
- set bin_flags [list debug shlib=${binfile_lib}]
-+set executable ${testfile}
-
- if [get_compiler_info] {
- return -1
-@@ -72,8 +73,26 @@ gdb_test "br foo2" \
- "Breakpoint.*: foo2. .2 locations..*" \
- "foo2 in mdlib"
-
--gdb_exit
-+# Test GDB warns for shared libraris which have not been found.
-
--return 0
-+gdb_test "info sharedlibrary" "/${libname}.*"
-
-+clean_restart ${executable}
-+gdb_breakpoint "main"
-+gdb_run_cmd
-+set test "no warning for missing libraries"
-+gdb_test_multiple "" $test {
-+ -re "warning: Could not load shared library symbols for \[0-9\]+ libraries,.*\r\n$gdb_prompt $" {
-+ fail $test
-+ }
-+ -re "Breakpoint \[0-9\]+, main .*\r\n$gdb_prompt $" {
-+ pass $test
-+ }
-+}
-
-+clean_restart ${executable}
-+gdb_test_no_output "set solib-absolute-prefix /doESnotEXIST"
-+gdb_breakpoint "main"
-+gdb_run_cmd
-+gdb_test "" "warning: Could not load shared library symbols for \[0-9\]+ libraries,.*\r\nBreakpoint \[0-9\]+, main .*" \
-+ "warning for missing libraries"
diff --git a/gdb-dts-rhel6-python-compat.patch b/gdb-dts-rhel6-python-compat.patch
index 8adf7f4..29c2824 100644
--- a/gdb-dts-rhel6-python-compat.patch
+++ b/gdb-dts-rhel6-python-compat.patch
@@ -1,10 +1,29 @@
+From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
+From: Fedora GDB patches <invalid(a)email.com>
+Date: Fri, 27 Oct 2017 21:07:50 +0200
+Subject: gdb-dts-rhel6-python-compat.patch
+
+FileName: gdb-dts-rhel6-python-compat.patch
+
+;; [rhel6] DTS backward Python compatibility API (BZ 1020004, Phil Muldoon).
+;;=fedora
+
https://bugzilla.redhat.com/show_bug.cgi?id=1020004
+---
+ gdb/data-directory/Makefile.in | 3 +
+ gdb/python/lib/gdb/FrameWrapper.py | 122 ++++++++++++++++++++++++++++++++
+ gdb/python/lib/gdb/backtrace.py | 42 +++++++++++
+ gdb/python/lib/gdb/command/backtrace.py | 106 +++++++++++++++++++++++++++
+ 4 files changed, 273 insertions(+)
+ create mode 100644 gdb/python/lib/gdb/FrameWrapper.py
+ create mode 100644 gdb/python/lib/gdb/backtrace.py
+ create mode 100644 gdb/python/lib/gdb/command/backtrace.py
-Index: gdb-7.12.50.20170207/gdb/data-directory/Makefile.in
-===================================================================
---- gdb-7.12.50.20170207.orig/gdb/data-directory/Makefile.in 2017-02-26 21:10:31.418894975 +0100
-+++ gdb-7.12.50.20170207/gdb/data-directory/Makefile.in 2017-02-26 21:11:07.083147930 +0100
-@@ -71,6 +71,8 @@
+diff --git a/gdb/data-directory/Makefile.in b/gdb/data-directory/Makefile.in
+index 753e0b69a3..5c7c0b4c2e 100644
+--- a/gdb/data-directory/Makefile.in
++++ b/gdb/data-directory/Makefile.in
+@@ -71,6 +71,8 @@ PYTHON_FILE_LIST = \
gdb/__init__.py \
gdb/FrameDecorator.py \
gdb/FrameIterator.py \
@@ -13,18 +32,19 @@ Index: gdb-7.12.50.20170207/gdb/data-directory/Makefile.in
gdb/frames.py \
gdb/printing.py \
gdb/prompt.py \
-@@ -83,6 +85,7 @@
- gdb/command/pahole.py \
- gdb/command/xmethods.py \
+@@ -79,6 +81,7 @@ PYTHON_FILE_LIST = \
+ gdb/xmethod.py \
+ gdb/command/__init__.py \
gdb/command/explore.py \
+ gdb/command/backtrace.py \
gdb/command/frame_filters.py \
gdb/command/pretty_printers.py \
gdb/command/prompt.py \
-Index: gdb-7.12.50.20170207/gdb/python/lib/gdb/FrameWrapper.py
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ gdb-7.12.50.20170207/gdb/python/lib/gdb/FrameWrapper.py 2017-02-26 21:10:31.419894983 +0100
+diff --git a/gdb/python/lib/gdb/FrameWrapper.py b/gdb/python/lib/gdb/FrameWrapper.py
+new file mode 100644
+index 0000000000..34ba4a2a12
+--- /dev/null
++++ b/gdb/python/lib/gdb/FrameWrapper.py
@@ -0,0 +1,122 @@
+# Wrapper API for frames.
+
@@ -148,10 +168,11 @@ Index: gdb-7.12.50.20170207/gdb/python/lib/gdb/FrameWrapper.py
+
+ def __getattr__ (self, name):
+ return getattr (self.frame, name)
-Index: gdb-7.12.50.20170207/gdb/python/lib/gdb/backtrace.py
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ gdb-7.12.50.20170207/gdb/python/lib/gdb/backtrace.py 2017-02-26 21:10:31.419894983 +0100
+diff --git a/gdb/python/lib/gdb/backtrace.py b/gdb/python/lib/gdb/backtrace.py
+new file mode 100644
+index 0000000000..06c893f239
+--- /dev/null
++++ b/gdb/python/lib/gdb/backtrace.py
@@ -0,0 +1,42 @@
+# Filtering backtrace.
+
@@ -195,10 +216,11 @@ Index: gdb-7.12.50.20170207/gdb/python/lib/gdb/backtrace.py
+ return iter
+ return old_frame_filter (iter)
+
-Index: gdb-7.12.50.20170207/gdb/python/lib/gdb/command/backtrace.py
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ gdb-7.12.50.20170207/gdb/python/lib/gdb/command/backtrace.py 2017-02-26 21:10:31.419894983 +0100
+diff --git a/gdb/python/lib/gdb/command/backtrace.py b/gdb/python/lib/gdb/command/backtrace.py
+new file mode 100644
+index 0000000000..eeea9093e8
+--- /dev/null
++++ b/gdb/python/lib/gdb/command/backtrace.py
@@ -0,0 +1,106 @@
+# New backtrace command.
+
@@ -306,3 +328,6 @@ Index: gdb-7.12.50.20170207/gdb/python/lib/gdb/command/backtrace.py
+ pair[1].describe (sys.stdout, full)
+
+FilteringBacktrace()
+--
+2.14.3
+
diff --git a/gdb-follow-child-stale-parent.patch b/gdb-follow-child-stale-parent.patch
index 336790c..973a06d 100644
--- a/gdb-follow-child-stale-parent.patch
+++ b/gdb-follow-child-stale-parent.patch
@@ -1,3 +1,13 @@
+From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
+From: Fedora GDB patches <invalid(a)email.com>
+Date: Fri, 27 Oct 2017 21:07:50 +0200
+Subject: gdb-follow-child-stale-parent.patch
+
+FileName: gdb-follow-child-stale-parent.patch
+
+;; Fix regression by python on ia64 due to stale current frame.
+;;=push+jan
+
Problem occurs with python and its get_current_arch () as it selects
selected_frame and current_frame while still inferior_ptid is valid for the
original parent. But since this place it is already attached and later
@@ -12,10 +22,15 @@ unwinders try to access it, breaking:
+FAIL: gdb.threads/watchpoint-fork.exp: child: singlethreaded: breakpoint after the second fork
+FAIL: gdb.threads/watchpoint-fork.exp: child: singlethreaded: watchpoint after the second fork
+FAIL: gdb.threads/watchpoint-fork.exp: child: singlethreaded: finish
+---
+ gdb/infrun.c | 3 +++
+ 1 file changed, 3 insertions(+)
---- ./gdb/infrun.c 2009-12-21 20:26:30.000000000 +0100
-+++ ./gdb/infrun.c 2009-12-21 20:26:11.000000000 +0100
-@@ -375,6 +375,9 @@ follow_fork (void)
+diff --git a/gdb/infrun.c b/gdb/infrun.c
+index 9b7b238f4d..91d6004d0a 100644
+--- a/gdb/infrun.c
++++ b/gdb/infrun.c
+@@ -749,6 +749,9 @@ follow_fork (void)
}
else
{
@@ -25,3 +40,6 @@ unwinders try to access it, breaking:
/* This pending follow fork event is now handled, one way
or another. The previous selected thread may be gone
from the lists by now, but if it is still around, need
+--
+2.14.3
+
diff --git a/gdb-fortran-frame-string.patch b/gdb-fortran-frame-string.patch
deleted file mode 100644
index e07b27b..0000000
--- a/gdb-fortran-frame-string.patch
+++ /dev/null
@@ -1,104 +0,0 @@
-http://sourceware.org/ml/gdb-patches/2014-07/msg00709.html
-Subject: [patch] Display Fortran strings in backtraces
-
-
-Hi,
-
-for Fortran it fixes displaying normal strings also in frames/backtraces:
-
-(gdb) frame
-#0 f (s=..., _s=3) at ./gdb.fortran/fortran-frame-string.f90:24
-->
-#0 f (s='foo', _s=3) at ./gdb.fortran/fortran-frame-string.f90:24
-
-The patch is simple and I do not see why it should not be this way.
-
-For C/C++ TYPE_CODE_STRING is not used. I am not aware of Pascal but that
-language is currently not really much supported in GDB anyway.
-
-This was a part of my archer/jankratochvil/vla branch but it is not a part of
-the Intel VLA patchset as it in fact is completely unrelated to "VLA".
-
-No regressions on {x86_64,x86_64-m32,i686}-fedora22pre-linux-gnu.
-
-
-Thanks,
-Jan
-
-
-diff --git a/gdb/testsuite/gdb.fortran/fortran-frame-string.exp b/gdb/testsuite/gdb.fortran/fortran-frame-string.exp
-new file mode 100644
-index 0000000..4b78266
---- /dev/null
-+++ b/gdb/testsuite/gdb.fortran/fortran-frame-string.exp
-@@ -0,0 +1,36 @@
-+# Copyright 2014 Free Software Foundation, Inc.
-+
-+# This program is free software; you can redistribute it and/or modify
-+# it under the terms of the GNU General Public License as published by
-+# the Free Software Foundation; either version 2 of the License, or
-+# (at your option) any later version.
-+#
-+# This program is distributed in the hope that it will be useful,
-+# but WITHOUT ANY WARRANTY; without even the implied warranty of
-+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+# GNU General Public License for more details.
-+#
-+# You should have received a copy of the GNU General Public License
-+# along with this program; if not, write to the Free Software
-+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-+
-+standard_testfile .f90
-+if { [prepare_for_testing ${testfile}.exp ${testfile} ${srcfile} {debug f90}] } {
-+ return -1
-+}
-+
-+if ![runto MAIN__] then {
-+ perror "couldn't run to breakpoint MAIN__"
-+ continue
-+}
-+
-+gdb_breakpoint [gdb_get_line_number "s = s"]
-+gdb_continue_to_breakpoint "s = s"
-+
-+gdb_test "ptype s" {type = character\*3}
-+gdb_test "p s" " = 'foo'"
-+
-+# Fix rejected upstream:
-+# https://sourceware.org/ml/gdb-patches/2014-07/msg00768.html
-+setup_kfail "rejected" *-*-*
-+gdb_test "frame" { \(s='foo', .*}
-diff --git a/gdb/testsuite/gdb.fortran/fortran-frame-string.f90 b/gdb/testsuite/gdb.fortran/fortran-frame-string.f90
-new file mode 100644
-index 0000000..3d1576f
---- /dev/null
-+++ b/gdb/testsuite/gdb.fortran/fortran-frame-string.f90
-@@ -0,0 +1,28 @@
-+! Copyright 2014 Free Software Foundation, Inc.
-+!
-+! This program is free software; you can redistribute it and/or modify
-+! it under the terms of the GNU General Public License as published by
-+! the Free Software Foundation; either version 2 of the License, or
-+! (at your option) any later version.
-+!
-+! This program is distributed in the hope that it will be useful,
-+! but WITHOUT ANY WARRANTY; without even the implied warranty of
-+! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+! GNU General Public License for more details.
-+!
-+! You should have received a copy of the GNU General Public License
-+! along with this program; if not, write to the Free Software
-+! Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-+!
-+! Ihis file is the Fortran source file for dynamic.exp.
-+! Original file written by Jakub Jelinek <jakub(a)redhat.com>.
-+! Modified for the GDB testcase by Jan Kratochvil <jan.kratochvil(a)redhat.com>.
-+
-+ subroutine f(s)
-+ character*3 s
-+ s = s
-+ end
-+
-+ program main
-+ call f ('foo')
-+ end
diff --git a/gdb-gdb-add-index-script.patch b/gdb-gdb-add-index-script.patch
deleted file mode 100644
index da88642..0000000
--- a/gdb-gdb-add-index-script.patch
+++ /dev/null
@@ -1,171 +0,0 @@
-http://sourceware.org/ml/gdb-patches/2010-07/msg00184.html
-Subject: Re: [0/4] RFC: add DWARF index support
-
-Jan Kratochvil: Fixed $d -> $dir.
-Jan Kratochvil: Remove /dev/null redirection.
-
->>>>> "Tom" == Tom Tromey <tromey(a)redhat.com> writes:
-
-Tom> This patch series adds support for a DWARF index to gdb.
-
-Roland suggested we wrap up the index-creation code into a helper
-script.
-
-I'm not sure if this is something people would want in gdb proper, but I
-figured I would send it here just in case.
-
-Tom
-
-2010-07-09 Tom Tromey <tromey(a)redhat.com>
-
- * Makefile.in (install-only): Install gdb-add-index.
- * gdb-add-index: New file.
-
-2010-07-09 Tom Tromey <tromey(a)redhat.com>
-
- * gdb.texinfo (Index Files): Mention gdb-add-index.
-
->From 30714fe719e61baea03d0dc5793eb0d564faebb7 Mon Sep 17 00:00:00 2001
-From: Tom Tromey <tromey(a)redhat.com>
-Date: Fri, 9 Jul 2010 11:17:54 -0600
-Subject: [PATCH 4/4] add gdb-add-index
-Subject: [PATCH 4/4] add gdb-add-index
-
----
- gdb/ChangeLog | 5 +++++
- gdb/Makefile.in | 11 ++++++++++-
- gdb/doc/ChangeLog | 4 ++++
- gdb/doc/gdb.texinfo | 8 ++++++++
- gdb/gdb-add-index | 30 ++++++++++++++++++++++++++++++
- 5 files changed, 57 insertions(+), 1 deletions(-)
- create mode 100755 gdb/gdb-add-index
-
-Index: gdb-7.6.90.20140127/gdb/Makefile.in
-===================================================================
---- gdb-7.6.90.20140127.orig/gdb/Makefile.in 2014-02-06 17:37:54.555975958 +0100
-+++ gdb-7.6.90.20140127/gdb/Makefile.in 2014-02-06 17:38:52.110038415 +0100
-@@ -1093,6 +1093,15 @@ install-only: install-gstack $(CONFIG_IN
- $(INSTALL_SCRIPT) gcore \
- $(DESTDIR)$(bindir)/$$transformed_name; \
- fi
-+ transformed_name=`t='$(program_transform_name)'; \
-+ echo gdb-add-index | sed -e "$$t"` ; \
-+ if test "x$$transformed_name" = x; then \
-+ transformed_name=gdb-add-index ; \
-+ else \
-+ true ; \
-+ fi ; \
-+ $(INSTALL_PROGRAM) $(srcdir)/contrib/gdb-add-index.sh \
-+ $(DESTDIR)$(bindir)/$$transformed_name$(EXEEXT)
- @$(MAKE) DO=install "DODIRS=$(SUBDIRS)" $(FLAGS_TO_PASS) subdir_do
-
- install-strip:
-Index: gdb-7.6.90.20140127/gdb/doc/gdb.texinfo
-===================================================================
---- gdb-7.6.90.20140127.orig/gdb/doc/gdb.texinfo 2014-02-06 17:37:50.822971940 +0100
-+++ gdb-7.6.90.20140127/gdb/doc/gdb.texinfo 2014-02-06 17:37:54.565975968 +0100
-@@ -17749,6 +17749,14 @@ There are currently some limitation on i
- for DWARF debugging information, not stabs. And, they do not
- currently work for programs using Ada.
-
-+@value{GDBN} comes with a program, @command{gdb-add-index}, which can
-+be used to add the index to a symbol file. It takes the symbol file
-+as its only argument:
-+
-+@smallexample
-+$ gdb-add-index symfile
-+@end smallexample
-+
- @node Symbol Errors
- @section Errors Reading Symbol Files
-
-@@ -43878,6 +43886,7 @@ switch (die->tag)
- * gdbserver man:: Remote Server for the GNU Debugger man page
- * gcore man:: Generate a core file of a running program
- * gdbinit man:: gdbinit scripts
-+* gdb-add-index man:: Add index files to speed up GDB
- @end menu
-
- @node gdb man
-@@ -44530,6 +44539,54 @@ gdb(1), @code{info -f gdb -n Startup}
- The full documentation for @value{GDBN} is maintained as a Texinfo manual.
- If the @code{info} and @code{gdb} programs and @value{GDBN}'s Texinfo
- documentation are properly installed at your site, the command
-+
-+@smallexample
-+info gdb
-+@end smallexample
-+
-+should give you access to the complete manual.
-+
-+@cite{Using GDB: A Guide to the GNU Source-Level Debugger},
-+Richard M. Stallman and Roland H. Pesch, July 1991.
-+@end ifset
-+@c man end
-+
-+@node gdb-add-index man
-+@heading gdb-add-index
-+
-+@c man title gdb-add-index Add index files to speed up GDB
-+
-+@c man begin SYNOPSIS gdb-add-index
-+gdb-add-index @var{filename}
-+@c man end
-+
-+@c man begin DESCRIPTION gdb-add-index
-+When GDB finds a symbol file, it scans the symbols in the file in order
-+to construct an internal symbol table. This lets most GDB operations
-+work quickly--at the cost of a delay early on. For large programs,
-+this delay can be quite lengthy, so GDB provides a way to build an
-+index, which speeds up startup.
-+
-+To determine whether a file contains such an index, use the command
-+@command{readelf -S filename}: the index is stored in a section named
-+(a)code{.gdb_index}. Note that the index is never generated for files that do
-+not contain DWARF debug information (sections named @code{.debug_*}).
-+
-+See more in
-+@ifset man
-+the @value{GDBN} manual in node @code{Index Files}
-+-- shell command @code{info -f gdb -n 'Index Files'}.
-+@end ifset
-+@ifclear man
-+@ref{Index Files}.
-+@end ifclear
-+@c man end
-+
-+@c man begin SEEALSO gdb-add-index
-+@ifset man
-+The full documentation for @value{GDBN} is maintained as a Texinfo manual.
-+If the @code{info} and @code{gdb} programs and @value{GDBN}'s Texinfo
-+documentation are properly installed at your site, the command
-
- @smallexample
- info gdb
-Index: gdb-7.6.90.20140127/gdb/doc/Makefile.in
-===================================================================
---- gdb-7.6.90.20140127.orig/gdb/doc/Makefile.in 2014-02-06 17:37:50.824971942 +0100
-+++ gdb-7.6.90.20140127/gdb/doc/Makefile.in 2014-02-06 17:37:54.565975968 +0100
-@@ -165,7 +165,7 @@ POD2MAN5 = pod2man --center="GNU Develop
- --release="gdb-`sed q version.subst`" --section=5
-
- # List of man pages generated from gdb.texi
--MAN1S = gdb.1 gdbserver.1 gcore.1
-+MAN1S = gdb.1 gdbserver.1 gcore.1 gdb-add-index.1
- MAN5S = gdbinit.5
- MANS = $(MAN1S) $(MAN5S)
-
-@@ -590,6 +590,13 @@ gcore.1: $(GDB_DOC_FILES)
- mv -f $@.T$$$$ $@) || (rm -f $@.T$$$$ && exit 1)
- rm -f gcore.pod
-
-+gdb-add-index.1: $(GDB_DOC_FILES)
-+ touch $@
-+ -$(TEXI2POD) $(MANCONF) -Dgdb-add-index < $(srcdir)/gdb.texinfo > gdb-add-index.pod
-+ -($(POD2MAN1) gdb-add-index.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \
-+ mv -f $@.T$$$$ $@) || (rm -f $@.T$$$$ && exit 1)
-+ rm -f gdb-add-index.pod
-+
- gdbinit.5: $(GDB_DOC_FILES)
- touch $@
- -$(TEXI2POD) $(MANCONF) -Dgdbinit < $(srcdir)/gdb.texinfo > gdbinit.pod
diff --git a/gdb-glibc-strstr-workaround.patch b/gdb-glibc-strstr-workaround.patch
index d3418f3..e850792 100644
--- a/gdb-glibc-strstr-workaround.patch
+++ b/gdb-glibc-strstr-workaround.patch
@@ -1,8 +1,23 @@
-Index: gdb-7.7.90.20140613/gdb/dwarf2read.c
-===================================================================
---- gdb-7.7.90.20140613.orig/gdb/dwarf2read.c 2014-06-13 21:56:54.744653443 +0200
-+++ gdb-7.7.90.20140613/gdb/dwarf2read.c 2014-06-13 22:01:51.529990684 +0200
-@@ -17695,6 +17695,26 @@ new_symbol_full (struct die_info *die, s
+From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
+From: Fedora GDB patches <invalid(a)email.com>
+Date: Fri, 27 Oct 2017 21:07:50 +0200
+Subject: gdb-glibc-strstr-workaround.patch
+
+FileName: gdb-glibc-strstr-workaround.patch
+
+;; Workaround PR libc/14166 for inferior calls of strstr.
+;;=fedora: Compatibility with RHELs (unchecked which ones).
+---
+ gdb/dwarf2read.c | 20 ++++
+ .../gdb.base/gnu-ifunc-strstr-workaround.exp | 108 +++++++++++++++++++++
+ 2 files changed, 128 insertions(+)
+ create mode 100644 gdb/testsuite/gdb.base/gnu-ifunc-strstr-workaround.exp
+
+diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c
+index 86d496312e..babe659539 100644
+--- a/gdb/dwarf2read.c
++++ b/gdb/dwarf2read.c
+@@ -21330,6 +21330,26 @@ new_symbol_full (struct die_info *die, struct type *type, struct dwarf2_cu *cu,
/* Cache this symbol's name and the name's demangled form (if any). */
SYMBOL_SET_LANGUAGE (sym, cu->language, &objfile->objfile_obstack);
linkagename = dwarf2_physname (name, die, cu);
@@ -29,10 +44,11 @@ Index: gdb-7.7.90.20140613/gdb/dwarf2read.c
SYMBOL_SET_NAMES (sym, linkagename, strlen (linkagename), 0, objfile);
/* Fortran does not have mangling standard and the mangling does differ
-Index: gdb-7.7.90.20140613/gdb/testsuite/gdb.base/gnu-ifunc-strstr-workaround.exp
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ gdb-7.7.90.20140613/gdb/testsuite/gdb.base/gnu-ifunc-strstr-workaround.exp 2014-06-13 21:59:41.174840871 +0200
+diff --git a/gdb/testsuite/gdb.base/gnu-ifunc-strstr-workaround.exp b/gdb/testsuite/gdb.base/gnu-ifunc-strstr-workaround.exp
+new file mode 100644
+index 0000000000..5469cd7354
+--- /dev/null
++++ b/gdb/testsuite/gdb.base/gnu-ifunc-strstr-workaround.exp
@@ -0,0 +1,108 @@
+# Copyright (C) 2012 Free Software Foundation, Inc.
+
@@ -142,3 +158,6 @@ Index: gdb-7.7.90.20140613/gdb/testsuite/gdb.base/gnu-ifunc-strstr-workaround.ex
+
+gdb_test {print strstr("abc","b")} { = 0x[0-9a-f]+ "bc"}
+gdb_test {print strstr("def","e")} { = 0x[0-9a-f]+ "ef"}
+--
+2.14.3
+
diff --git a/gdb-glibc-vdso-workaround.patch b/gdb-glibc-vdso-workaround.patch
deleted file mode 100644
index 601cf2a..0000000
--- a/gdb-glibc-vdso-workaround.patch
+++ /dev/null
@@ -1,31 +0,0 @@
-http://sourceware.org/ml/gdb-patches/2011-08/msg00331.html
-Subject: [RFC] Work around PR libc/13097 "linux-vdso.so.1" #2
-
-Hi,
-
-missed the x86_64-m32 case:
-
-gdb/
-2011-08-16 Jan Kratochvil <jan.kratochvil(a)redhat.com>
-
- Work around PR libc/13097.
- * solib.c (update_solib_list): Ignore "linux-vdso.so.1".
-
-Index: gdb-7.9.50.20150520/gdb/solib.c
-===================================================================
---- gdb-7.9.50.20150520.orig/gdb/solib.c 2015-05-31 17:04:16.870802493 +0200
-+++ gdb-7.9.50.20150520/gdb/solib.c 2015-05-31 17:04:38.824941054 +0200
-@@ -893,8 +893,11 @@ update_solib_list (int from_tty, struct
-
- TRY
- {
-- /* Fill in the rest of the `struct so_list' node. */
-- if (!solib_map_sections (i))
-+ /* Fill in the rest of the `struct so_list' node.
-+ Work around PR libc/13097. */
-+ if (!solib_map_sections (i)
-+ && strcmp (i->so_original_name, "linux-vdso.so.1") != 0
-+ && strcmp (i->so_original_name, "linux-gate.so.1") != 0)
- {
- not_found++;
- if (not_found_filename == NULL)
diff --git a/gdb-gnat-dwarf-crash-3of3.patch b/gdb-gnat-dwarf-crash-3of3.patch
index 3f57fd3..559a867 100644
--- a/gdb-gnat-dwarf-crash-3of3.patch
+++ b/gdb-gnat-dwarf-crash-3of3.patch
@@ -1,6 +1,14 @@
-http://sourceware.org/ml/gdb-patches/2014-02/msg00731.html
-Subject: [patch] gdb_assert -> complaint for weird DWARF
+From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
+From: Fedora GDB patches <invalid(a)email.com>
+Date: Fri, 27 Oct 2017 21:07:50 +0200
+Subject: gdb_assert -> complaint for weird DWARF
+
+FileName: gdb-gnat-dwarf-crash-3of3.patch
+;; Fix crash of -readnow /usr/lib/debug/usr/bin/gnatbind.debug (BZ 1069211).
+;;=push+jan
+
+http://sourceware.org/ml/gdb-patches/2014-02/msg00731.html
--6TrnltStXW4iwmi0
Content-Type: text/plain; charset=us-ascii
@@ -21,7 +29,6 @@ Fedora GCC build, not in FSF GCC build, more info at:
https://bugzilla.redhat.com/show_bug.cgi?id=1069382
http://people.redhat.com/jkratoch/gcc-debuginfo-4.8.2-7.fc20.x86_64-gnatb...
-
Thanks,
Jan
@@ -33,26 +40,29 @@ gdb/
2014-02-24 Jan Kratochvil <jan.kratochvil(a)redhat.com>
* dwarf2read.c (process_die): Change gdb_assert to complaint.
+---
+ gdb/dwarf2read.c | 8 ++++++++
+ 1 file changed, 8 insertions(+)
diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c
-index 3eaa0b1..71f5d34 100644
+index 1a62c58614..ebded1753f 100644
--- a/gdb/dwarf2read.c
+++ b/gdb/dwarf2read.c
-@@ -8029,7 +8029,13 @@ process_die (struct die_info *die, struct dwarf2_cu *cu)
- struct cleanup *in_process;
-
- /* We should only be processing those not already in process. */
-- gdb_assert (!die->in_process);
+@@ -10614,6 +10614,14 @@ private:
+ static void
+ process_die (struct die_info *die, struct dwarf2_cu *cu)
+ {
+ if (die->in_process)
+ {
+ complaint (&symfile_complaints,
+ _("DIE at 0x%x attempted to be processed twice"),
-+ die->offset.sect_off);
++ to_underlying (die->sect_off));
+ return;
+ }
++
+ process_die_scope scope (die, cu);
- die->in_process = 1;
- in_process = make_cleanup (reset_die_in_process,die);
-
---6TrnltStXW4iwmi0--
+ switch (die->tag)
+--
+2.14.3
diff --git a/gdb-jit-reader-multilib.patch b/gdb-jit-reader-multilib.patch
index 04aa397..6c83848 100644
--- a/gdb-jit-reader-multilib.patch
+++ b/gdb-jit-reader-multilib.patch
@@ -1,8 +1,22 @@
+From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
+From: Fedora GDB patches <invalid(a)email.com>
+Date: Fri, 27 Oct 2017 21:07:50 +0200
+Subject: gdb-jit-reader-multilib.patch
+
+FileName: gdb-jit-reader-multilib.patch
+
+;; Fix jit-reader.h for multi-lib.
+;;=push+jan
+---
+ gdb/configure | 8 +++++---
+ gdb/configure.ac | 8 +++++---
+ 2 files changed, 10 insertions(+), 6 deletions(-)
+
diff --git a/gdb/configure b/gdb/configure
-index 7ff74ba..00a5b5b 100755
+index aa944a08c4..dbae54b42c 100755
--- a/gdb/configure
+++ b/gdb/configure
-@@ -7382,10 +7382,12 @@ _ACEOF
+@@ -9528,10 +9528,12 @@ _ACEOF
@@ -19,10 +33,10 @@ index 7ff74ba..00a5b5b 100755
TARGET_PTR="unsigned __int128"
else
diff --git a/gdb/configure.ac b/gdb/configure.ac
-index ec776d7..c02ace9 100644
+index 1b6c4d77c3..e94280f773 100644
--- a/gdb/configure.ac
+++ b/gdb/configure.ac
-@@ -648,10 +648,12 @@ AC_CHECK_SIZEOF(unsigned long long)
+@@ -832,10 +832,12 @@ AC_CHECK_SIZEOF(unsigned long long)
AC_CHECK_SIZEOF(unsigned long)
AC_CHECK_SIZEOF(unsigned __int128)
@@ -38,3 +52,6 @@ index ec776d7..c02ace9 100644
elif test "x${ac_cv_sizeof_unsigned___int128}" = "x16"; then
TARGET_PTR="unsigned __int128"
else
+--
+2.14.3
+
diff --git a/gdb-libexec-add-index.patch b/gdb-libexec-add-index.patch
index 8ca579f..f127bab 100644
--- a/gdb-libexec-add-index.patch
+++ b/gdb-libexec-add-index.patch
@@ -1,5 +1,18 @@
+From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
+From: Fedora GDB patches <invalid(a)email.com>
+Date: Fri, 27 Oct 2017 21:07:50 +0200
+Subject: gdb-libexec-add-index.patch
+
+FileName: gdb-libexec-add-index.patch
+
+;; Fix gdb-headless /usr/bin/ executables (BZ 1390251).
+;;=fedora
+---
+ gdb/contrib/gdb-add-index.sh | 5 +++++
+ 1 file changed, 5 insertions(+)
+
diff --git a/gdb/contrib/gdb-add-index.sh b/gdb/contrib/gdb-add-index.sh
-index cca7153..73181ec 100755
+index 71146966ab..500b2f62d5 100755
--- a/gdb/contrib/gdb-add-index.sh
+++ b/gdb/contrib/gdb-add-index.sh
@@ -21,6 +21,11 @@
@@ -14,3 +27,6 @@ index cca7153..73181ec 100755
myname="${0##*/}"
if test $# != 1; then
+--
+2.14.3
+
diff --git a/gdb-linux_perf-bundle.patch b/gdb-linux_perf-bundle.patch
index ead3758..1210bea 100644
--- a/gdb-linux_perf-bundle.patch
+++ b/gdb-linux_perf-bundle.patch
@@ -1,7 +1,73 @@
-Index: gdb-7.11.90.20160904/gdb/nat/linux-btrace.h
-===================================================================
---- gdb-7.11.90.20160904.orig/gdb/nat/linux-btrace.h 2016-09-04 04:02:13.000000000 +0200
-+++ gdb-7.11.90.20160904/gdb/nat/linux-btrace.h 2016-09-04 20:11:47.375275492 +0200
+From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
+From: Fedora GDB patches <invalid(a)email.com>
+Date: Fri, 27 Oct 2017 21:07:50 +0200
+Subject: gdb-linux_perf-bundle.patch
+
+FileName: gdb-linux_perf-bundle.patch
+
+;; [dts+el7] [x86*] Bundle linux_perf.h for libipt (RH BZ 1256513).
+;;=fedora
+---
+ gdb/configure | 2 +-
+ gdb/configure.ac | 2 +-
+ gdb/gdb.c | 8 +++
+ gdb/nat/linux-btrace.h | 171 +++++++++++++++++++++++++++++++++++++++++++++++++
+ 4 files changed, 181 insertions(+), 2 deletions(-)
+
+diff --git a/gdb/configure b/gdb/configure
+index fcd2efd4d7..26f5259b64 100755
+--- a/gdb/configure
++++ b/gdb/configure
+@@ -11907,7 +11907,7 @@ else
+
+ #include <linux/perf_event.h>
+ #ifndef PERF_ATTR_SIZE_VER5
+-# error
++// error // PERF_ATTR_SIZE_VER5_BUNDLE is not available here - Fedora+RHEL
+ #endif
+
+ _ACEOF
+diff --git a/gdb/configure.ac b/gdb/configure.ac
+index ec82a09a0b..6a07648239 100644
+--- a/gdb/configure.ac
++++ b/gdb/configure.ac
+@@ -1466,7 +1466,7 @@ else
+ AC_PREPROC_IFELSE(AC_LANG_SOURCE([[
+ #include <linux/perf_event.h>
+ #ifndef PERF_ATTR_SIZE_VER5
+-# error
++// error // PERF_ATTR_SIZE_VER5_BUNDLE is not available here - Fedora+RHEL
+ #endif
+ ]]), [perf_event=yes], [perf_event=no])
+ if test "$perf_event" != yes; then
+diff --git a/gdb/gdb.c b/gdb/gdb.c
+index b97500e579..151545105c 100644
+--- a/gdb/gdb.c
++++ b/gdb/gdb.c
+@@ -20,11 +20,19 @@
+ #include "main.h"
+ #include "interps.h"
+
++#ifdef PERF_ATTR_SIZE_VER5_BUNDLE
++extern "C" void __libipt_init(void);
++#endif
++
+ int
+ main (int argc, char **argv)
+ {
+ struct captured_main_args args;
+
++#ifdef PERF_ATTR_SIZE_VER5_BUNDLE
++ __libipt_init();
++#endif
++
+ memset (&args, 0, sizeof args);
+ args.argc = argc;
+ args.argv = argv;
+diff --git a/gdb/nat/linux-btrace.h b/gdb/nat/linux-btrace.h
+index 31a8d9e67b..72faf23c5f 100644
+--- a/gdb/nat/linux-btrace.h
++++ b/gdb/nat/linux-btrace.h
@@ -28,6 +28,177 @@
# include <linux/perf_event.h>
#endif
@@ -180,53 +246,6 @@ Index: gdb-7.11.90.20160904/gdb/nat/linux-btrace.h
struct target_ops;
#if HAVE_LINUX_PERF_EVENT_H
-Index: gdb-7.11.90.20160904/gdb/configure
-===================================================================
---- gdb-7.11.90.20160904.orig/gdb/configure 2016-09-04 20:11:47.238274285 +0200
-+++ gdb-7.11.90.20160904/gdb/configure 2016-09-04 20:11:47.378275519 +0200
-@@ -10601,7 +10601,7 @@
-
- #include <linux/perf_event.h>
- #ifndef PERF_ATTR_SIZE_VER5
--# error
-+// error // PERF_ATTR_SIZE_VER5_BUNDLE is not available here - Fedora+RHEL
- #endif
-
- _ACEOF
-Index: gdb-7.11.90.20160904/gdb/configure.ac
-===================================================================
---- gdb-7.11.90.20160904.orig/gdb/configure.ac 2016-09-04 20:11:47.238274285 +0200
-+++ gdb-7.11.90.20160904/gdb/configure.ac 2016-09-04 20:11:47.379275528 +0200
-@@ -1461,7 +1461,7 @@
- AC_PREPROC_IFELSE(AC_LANG_SOURCE([[
- #include <linux/perf_event.h>
- #ifndef PERF_ATTR_SIZE_VER5
--# error
-+// error // PERF_ATTR_SIZE_VER5_BUNDLE is not available here - Fedora+RHEL
- #endif
- ]]), [perf_event=yes], [perf_event=no])
- if test "$perf_event" != yes; then
-Index: gdb-7.11.90.20160904/gdb/gdb.c
-===================================================================
---- gdb-7.11.90.20160904.orig/gdb/gdb.c 2016-09-04 04:02:13.000000000 +0200
-+++ gdb-7.11.90.20160904/gdb/gdb.c 2016-09-04 20:12:28.018633552 +0200
-@@ -20,11 +20,19 @@
- #include "main.h"
- #include "interps.h"
-
-+#ifdef PERF_ATTR_SIZE_VER5_BUNDLE
-+extern "C" void __libipt_init(void);
-+#endif
-+
- int
- main (int argc, char **argv)
- {
- struct captured_main_args args;
-
-+#ifdef PERF_ATTR_SIZE_VER5_BUNDLE
-+ __libipt_init();
-+#endif
-+
- memset (&args, 0, sizeof args);
- args.argc = argc;
- args.argv = argv;
+--
+2.14.3
+
diff --git a/gdb-moribund-utrace-workaround.patch b/gdb-moribund-utrace-workaround.patch
index 6b50a8e..fcdb2d4 100644
--- a/gdb-moribund-utrace-workaround.patch
+++ b/gdb-moribund-utrace-workaround.patch
@@ -1,11 +1,26 @@
+From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
+From: Fedora GDB patches <invalid(a)email.com>
+Date: Fri, 27 Oct 2017 21:07:50 +0200
+Subject: gdb-moribund-utrace-workaround.patch
+
+FileName: gdb-moribund-utrace-workaround.patch
+
+;; Workaround non-stop moribund locations exploited by kernel utrace (BZ 590623).
+;;=push+jan: Currently it is still not fully safe.
+
https://bugzilla.redhat.com/show_bug.cgi?id=590623
http://sources.redhat.com/bugzilla/show_bug.cgi?id=11593
Bug in FSF GDB exploited by the ptrace-on-utrace interaction.
+---
+ gdb/breakpoint.c | 2 ++
+ 1 file changed, 2 insertions(+)
+diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c
+index 5a99de75e1..6a0c15b239 100644
--- a/gdb/breakpoint.c
+++ b/gdb/breakpoint.c
-@@ -9084,6 +9084,8 @@ update_global_location_list (int should_insert)
+@@ -12089,6 +12089,8 @@ update_global_location_list (enum ugll_insert_mode insert_mode)
traps we can no longer explain. */
old_loc->events_till_retirement = 3 * (thread_count () + 1);
@@ -14,3 +29,6 @@ Bug in FSF GDB exploited by the ptrace-on-utrace interaction.
old_loc->owner = NULL;
VEC_safe_push (bp_location_p, moribund_locations, old_loc);
+--
+2.14.3
+
diff --git a/gdb-pahole-python2.patch b/gdb-pahole-python2.patch
deleted file mode 100644
index 473a32e..0000000
--- a/gdb-pahole-python2.patch
+++ /dev/null
@@ -1,36 +0,0 @@
-diff --git a/gdb/python/lib/gdb/command/pahole.py b/gdb/python/lib/gdb/command/pahole.py
-index e08eaf5..56c1737 100644
---- a/gdb/python/lib/gdb/command/pahole.py
-+++ b/gdb/python/lib/gdb/command/pahole.py
-@@ -55,19 +55,19 @@ It prints the type and displays comments showing where holes are."""
- fieldsize = 8 * ftype.sizeof
-
- # TARGET_CHAR_BIT
-- print (' /* %3d %3d */' % (int (bitpos / 8), int (fieldsize / 8)), end = "")
-+ print (' /* %3d %3d */' % (int (bitpos / 8), int (fieldsize / 8))),
- bitpos = bitpos + fieldsize
-
- if ftype.code == gdb.TYPE_CODE_STRUCT:
- self.pahole (ftype, level + 1, field.name)
- else:
-- print (' ' * (2 + 2 * level), end = "")
-+ print (' ' * (2 + 2 * level)),
- print ('%s %s' % (str (ftype), field.name))
-
- if level == 0:
- self.maybe_print_hole(bitpos, 8 * type.sizeof)
-
-- print (' ' * (14 + 2 * level), end = "")
-+ print (' ' * (14 + 2 * level)),
- print ('} %s' % name)
-
- def invoke (self, arg, from_tty):
-@@ -75,7 +75,7 @@ It prints the type and displays comments showing where holes are."""
- type = type.strip_typedefs ()
- if type.code != gdb.TYPE_CODE_STRUCT:
- raise (TypeError, '%s is not a struct type' % arg)
-- print (' ' * 14, end = "")
-+ print (' ' * 14),
- self.pahole (type, 0, '')
-
- Pahole()
diff --git a/gdb-python-gil.patch b/gdb-python-gil.patch
new file mode 100644
index 0000000..b5faf74
--- /dev/null
+++ b/gdb-python-gil.patch
@@ -0,0 +1,262 @@
+From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
+From: Fedora GDB patches <invalid(a)email.com>
+Date: Fri, 27 Oct 2017 21:07:50 +0200
+Subject: gdb-python-gil.patch
+
+FileName: gdb-python-gil.patch
+
+;; Fix Python GIL with gdb.execute("continue") (Phil Muldoon, BZ 1116957).
+;;=push
+---
+ gdb/doc/python.texi | 8 ++++
+ gdb/python/python-internal.h | 2 +
+ gdb/python/python.c | 42 +++++++++++++++---
+ gdb/testsuite/gdb.python/py-gil-mthread.c | 13 ++++++
+ gdb/testsuite/gdb.python/py-gil-mthread.exp | 69 +++++++++++++++++++++++++++++
+ gdb/testsuite/gdb.python/py-gil-mthread.py | 28 ++++++++++++
+ 6 files changed, 157 insertions(+), 5 deletions(-)
+ create mode 100644 gdb/testsuite/gdb.python/py-gil-mthread.c
+ create mode 100644 gdb/testsuite/gdb.python/py-gil-mthread.exp
+ create mode 100644 gdb/testsuite/gdb.python/py-gil-mthread.py
+
+diff --git a/gdb/doc/python.texi b/gdb/doc/python.texi
+index ebd48fffe7..ccf011e35e 100644
+--- a/gdb/doc/python.texi
++++ b/gdb/doc/python.texi
+@@ -232,6 +232,14 @@ returned as a string. The default is @code{False}, in which case the
+ return value is @code{None}. If @var{to_string} is @code{True}, the
+ @value{GDBN} virtual terminal will be temporarily set to unlimited width
+ and height, and its pagination will be disabled; @pxref{Screen Size}.
++
++The @var{release_gil} flag specifies whether @value{GDBN} ought to
++release the Python GIL before executing the command. This is useful
++in multi-threaded Python programs where by default the Python
++interpreter will acquire the GIL and lock other threads from
++executing. After the command has completed executing in @value{GDBN}
++the Python GIL is reacquired. This flag must be a boolean value. If
++omitted, it defaults to @code{False}.
+ @end defun
+
+ @findex gdb.breakpoints
+diff --git a/gdb/python/python-internal.h b/gdb/python/python-internal.h
+index f32a258209..4556323472 100644
+--- a/gdb/python/python-internal.h
++++ b/gdb/python/python-internal.h
+@@ -142,6 +142,8 @@ typedef int Py_ssize_t;
+ #define PyGILState_Release(ARG) ((void)(ARG))
+ #define PyEval_InitThreads()
+ #define PyThreadState_Swap(ARG) ((void)(ARG))
++#define PyEval_SaveThread() ((void)(ARG))
++#define PyEval_RestoreThread(ARG) ((void)(ARG))
+ #define PyEval_ReleaseLock()
+ #endif
+
+diff --git a/gdb/python/python.c b/gdb/python/python.c
+index 4844c86c54..610dda828c 100644
+--- a/gdb/python/python.c
++++ b/gdb/python/python.c
+@@ -554,12 +554,16 @@ execute_gdb_command (PyObject *self, PyObject *args, PyObject *kw)
+ {
+ const char *arg;
+ PyObject *from_tty_obj = NULL, *to_string_obj = NULL;
+- int from_tty, to_string;
+- static const char *keywords[] = { "command", "from_tty", "to_string", NULL };
++ int from_tty, to_string, release_gil;
++ static const char *keywords[] = {"command", "from_tty", "to_string", "release_gil", NULL };
++ PyObject *release_gil_obj = NULL;
++ /* Initialize it just to avoid a GCC false warning. */
++ PyThreadState *state = NULL;
+
+- if (!gdb_PyArg_ParseTupleAndKeywords (args, kw, "s|O!O!", keywords, &arg,
++ if (!gdb_PyArg_ParseTupleAndKeywords (args, kw, "s|O!O!O!", keywords, &arg,
+ &PyBool_Type, &from_tty_obj,
+- &PyBool_Type, &to_string_obj))
++ &PyBool_Type, &to_string_obj,
++ &PyBool_Type, &release_gil_obj))
+ return NULL;
+
+ from_tty = 0;
+@@ -580,12 +584,28 @@ execute_gdb_command (PyObject *self, PyObject *args, PyObject *kw)
+ to_string = cmp;
+ }
+
++ release_gil = 0;
++ if (release_gil_obj)
++ {
++ int cmp = PyObject_IsTrue (release_gil_obj);
++ if (cmp < 0)
++ return NULL;
++ release_gil = cmp;
++ }
++
+ std::string to_string_res;
+
+ TRY
+ {
+ struct interp *interp;
+
++ /* In the case of long running GDB commands, allow the user to
++ release the Python GIL acquired by Python. Restore the GIL
++ after the command has completed before handing back to
++ Python. */
++ if (release_gil)
++ state = PyEval_SaveThread();
++
+ scoped_restore save_async = make_scoped_restore (¤t_ui->async, 0);
+
+ scoped_restore save_uiout = make_scoped_restore (¤t_uiout);
+@@ -600,10 +620,22 @@ execute_gdb_command (PyObject *self, PyObject *args, PyObject *kw)
+ to_string_res = execute_command_to_string (arg, from_tty);
+ else
+ execute_command (arg, from_tty);
++
++ /* Reacquire the GIL if it was released earlier. */
++ if (release_gil)
++ PyEval_RestoreThread (state);
+ }
+ CATCH (except, RETURN_MASK_ALL)
+ {
+- GDB_PY_HANDLE_EXCEPTION (except);
++ if (except.reason < 0)
++ {
++ /* Reacquire the GIL if it was released earlier. */
++ if (release_gil)
++ PyEval_RestoreThread (state);
++
++ gdbpy_convert_exception (except);
++ return NULL;
++ }
+ }
+ END_CATCH
+
+diff --git a/gdb/testsuite/gdb.python/py-gil-mthread.c b/gdb/testsuite/gdb.python/py-gil-mthread.c
+new file mode 100644
+index 0000000000..1a12fc9c6d
+--- /dev/null
++++ b/gdb/testsuite/gdb.python/py-gil-mthread.c
+@@ -0,0 +1,13 @@
++#include <stdio.h>
++#include <unistd.h>
++
++int
++main (void)
++{
++ int i;
++ for (i = 0; i < 10; i++)
++ {
++ sleep (1); /* break-here */
++ printf ("Sleeping %d\n", i);
++ }
++}
+diff --git a/gdb/testsuite/gdb.python/py-gil-mthread.exp b/gdb/testsuite/gdb.python/py-gil-mthread.exp
+new file mode 100644
+index 0000000000..a89c16a45b
+--- /dev/null
++++ b/gdb/testsuite/gdb.python/py-gil-mthread.exp
+@@ -0,0 +1,69 @@
++# Copyright (C) 2014 Free Software Foundation, Inc.
++
++# This program is free software; you can redistribute it and/or modify
++# it under the terms of the GNU General Public License as published by
++# the Free Software Foundation; either version 3 of the License, or
++# (at your option) any later version.
++#
++# This program is distributed in the hope that it will be useful,
++# but WITHOUT ANY WARRANTY; without even the implied warranty of
++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++# GNU General Public License for more details.
++#
++# You should have received a copy of the GNU General Public License
++# along with this program. If not, see <http://www.gnu.org/licenses/>.
++
++standard_testfile .c .py
++set executable $testfile
++
++if { [prepare_for_testing $testfile.exp $executable $srcfile] } {
++ return -1
++}
++
++# Skip all tests if Python scripting is not enabled.
++if { [skip_python_tests] } { continue }
++
++if ![runto_main] {
++ return -1
++}
++
++gdb_breakpoint $srcfile:[gdb_get_line_number "break-here"] temporary
++gdb_continue_to_breakpoint "break-here" ".* break-here .*"
++
++set test "response"
++set timeout 60
++set sleeping_last -1
++set hello_last 0
++set minimal 5
++gdb_test_multiple "python exec (open ('$srcdir/$subdir/$srcfile2').read ())" $test {
++ -re "Error: unable to start thread\r\n" {
++ fail $test
++ # Not $gdb_prompt-synced!
++ }
++ -re "Sleeping (\[0-9\]+)\r\n" {
++ set n $expect_out(1,string)
++ if { $sleeping_last + 1 != $n } {
++ fail $test
++ } else {
++ set sleeping_last $n
++ if { $sleeping_last >= $minimal && $hello_last >= $minimal } {
++ pass $test
++ } else {
++ exp_continue
++ }
++ }
++ }
++ -re "Hello \\( (\[0-9\]+) \\)\r\n" {
++ set n $expect_out(1,string)
++ if { $hello_last + 1 != $n } {
++ fail $test
++ } else {
++ set hello_last $n
++ if { $sleeping_last >= $minimal && $hello_last >= $minimal } {
++ pass $test
++ } else {
++ exp_continue
++ }
++ }
++ }
++}
+diff --git a/gdb/testsuite/gdb.python/py-gil-mthread.py b/gdb/testsuite/gdb.python/py-gil-mthread.py
+new file mode 100644
+index 0000000000..6a89964139
+--- /dev/null
++++ b/gdb/testsuite/gdb.python/py-gil-mthread.py
+@@ -0,0 +1,28 @@
++try:
++ import thread
++except:
++ import _thread
++import time
++import gdb
++
++# Define a function for the thread
++def print_thread_hello():
++ count = 0
++ while count < 10:
++ time.sleep(1)
++ count += 1
++ print ("Hello ( %d )" % count)
++
++# Create a threads a continue
++try:
++ thread.start_new_thread (print_thread_hello, ())
++ gdb.execute ("continue", release_gil=True)
++except:
++ try:
++ _thread.start_new_thread (print_thread_hello, ())
++ gdb.execute ("continue", release_gil=True)
++ except:
++ print ("Error: unable to start thread")
++
++while 1:
++ pass
+--
+2.14.3
+
diff --git a/gdb-readline62-ask-more-rh.patch b/gdb-readline62-ask-more-rh.patch
index 463d9d3..f59b01b 100644
--- a/gdb-readline62-ask-more-rh.patch
+++ b/gdb-readline62-ask-more-rh.patch
@@ -1,8 +1,21 @@
-Index: gdb-7.11.50.20160630/gdb/event-top.c
-===================================================================
---- gdb-7.11.50.20160630.orig/gdb/event-top.c 2016-07-03 16:32:36.108342159 +0200
-+++ gdb-7.11.50.20160630/gdb/event-top.c 2016-07-03 16:32:59.787523733 +0200
-@@ -1252,6 +1252,13 @@
+From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
+From: Fedora GDB patches <invalid(a)email.com>
+Date: Fri, 27 Oct 2017 21:07:50 +0200
+Subject: gdb-readline62-ask-more-rh.patch
+
+FileName: gdb-readline62-ask-more-rh.patch
+
+;; Work around readline-6.2 incompatibility not asking for --more-- (BZ 701131).
+;;=fedora
+---
+ gdb/event-top.c | 7 +++++++
+ 1 file changed, 7 insertions(+)
+
+diff --git a/gdb/event-top.c b/gdb/event-top.c
+index 0d668f35e0..4aa26125f9 100644
+--- a/gdb/event-top.c
++++ b/gdb/event-top.c
+@@ -1183,6 +1183,13 @@ gdb_setup_readline (int editing)
{
struct ui *ui = current_ui;
@@ -16,3 +29,6 @@ Index: gdb-7.11.50.20160630/gdb/event-top.c
/* This function is a noop for the sync case. The assumption is
that the sync setup is ALL done in gdb_init, and we would only
mess it up here. The sync stuff should really go away over
+--
+2.14.3
+
diff --git a/gdb-rhbz1007614-memleak-infpy_read_memory-test.patch b/gdb-rhbz1007614-memleak-infpy_read_memory-test.patch
deleted file mode 100644
index d0aedd7..0000000
--- a/gdb-rhbz1007614-memleak-infpy_read_memory-test.patch
+++ /dev/null
@@ -1,162 +0,0 @@
-Original message by Tom Tromey:
-
- <https://sourceware.org/ml/gdb-patches/2012-03/msg00955.html>
- Message-ID: <871uoc1va3.fsf(a)fleche.redhat.com>
-
-Comment from Sergio Durigan Junior:
-
- In order to correctly test this patch, I wrote a testcase based on Jan
- Kratochvil's <gdb/testsuite/gdb.base/gcore-excessive-memory.exp>. The
- testcase, which can be seen below, tests GDB in order to see if the
- amount of memory being leaked is minimal, as requested in the bugzilla.
- It is hard to define what "minimum" is, so I ran the testcase on all
- supported RHEL architectures and came up with an average.
-
-commit cc0265cdda9dc7e8665e8bfcf5b4477489daf27c
-Author: Tom Tromey <tromey(a)redhat.com>
-Date: Wed Mar 28 17:38:08 2012 +0000
-
- * python/py-inferior.c (infpy_read_memory): Remove cleanups and
- explicitly free 'buffer' on exit paths. Decref 'membuf_object'
- before returning.
-
-Index: gdb-7.2/gdb/testsuite/gdb.python/py-gdb-rhbz1007614-memleak-infpy_read_memory.c
-===================================================================
---- /dev/null
-+++ gdb-7.2/gdb/testsuite/gdb.python/py-gdb-rhbz1007614-memleak-infpy_read_memory.c
-@@ -0,0 +1,27 @@
-+/* This testcase is part of GDB, the GNU debugger.
-+
-+ Copyright 2014 Free Software Foundation, Inc.
-+
-+ This program is free software; you can redistribute it and/or modify
-+ it under the terms of the GNU General Public License as published by
-+ the Free Software Foundation; either version 3 of the License, or
-+ (at your option) any later version.
-+
-+ This program is distributed in the hope that it will be useful,
-+ but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ GNU General Public License for more details.
-+
-+ You should have received a copy of the GNU General Public License
-+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
-+
-+static struct x
-+ {
-+ char unsigned u[4096];
-+ } x, *px = &x;
-+
-+int
-+main (int argc, char *argv[])
-+{
-+ return 0;
-+}
-Index: gdb-7.2/gdb/testsuite/gdb.python/py-gdb-rhbz1007614-memleak-infpy_read_memory.exp
-===================================================================
---- /dev/null
-+++ gdb-7.2/gdb/testsuite/gdb.python/py-gdb-rhbz1007614-memleak-infpy_read_memory.exp
-@@ -0,0 +1,68 @@
-+# Copyright 2014 Free Software Foundation, Inc.
-+
-+# This program is free software; you can redistribute it and/or modify
-+# it under the terms of the GNU General Public License as published by
-+# the Free Software Foundation; either version 3 of the License, or
-+# (at your option) any later version.
-+#
-+# This program is distributed in the hope that it will be useful,
-+# but WITHOUT ANY WARRANTY; without even the implied warranty of
-+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+# GNU General Public License for more details.
-+#
-+# You should have received a copy of the GNU General Public License
-+# along with this program. If not, see <http://www.gnu.org/licenses/>.
-+
-+set testfile py-gdb-rhbz1007614-memleak-infpy_read_memory
-+set srcfile ${testfile}.c
-+set binfile [standard_output_file ${testfile}]
-+
-+if { [prepare_for_testing ${testfile}.exp ${testfile} ${srcfile}] } {
-+ return -1
-+}
-+
-+if { [skip_python_tests] } { continue }
-+
-+set pid_of_gdb [exp_pid -i [board_info host fileid]]
-+
-+proc memory_v_pages_get {} {
-+ global pid_of_gdb
-+ set fd [open "/proc/$pid_of_gdb/statm"]
-+ gets $fd line
-+ close $fd
-+ # number of pages of virtual memory
-+ scan $line "%d" drs
-+ return $drs
-+}
-+
-+if { ![runto_main] } {
-+ untested $testfile.exp
-+ return -1
-+}
-+
-+set remote_python_file [remote_download host ${srcdir}/${subdir}/${testfile}.py]
-+
-+gdb_test "source ${remote_python_file}" ""
-+
-+gdb_test "hello-world" ""
-+
-+set kbytes_before [memory_v_pages_get]
-+verbose -log "kbytes_before = $kbytes_before"
-+
-+gdb_test "hello-world" ""
-+
-+set kbytes_after [memory_v_pages_get]
-+verbose -log "kbytes_after = $kbytes_after"
-+
-+set kbytes_diff [expr $kbytes_after - $kbytes_before]
-+verbose -log "kbytes_diff = $kbytes_diff"
-+
-+# The value "1000" was calculated by running a few GDB sessions with this
-+# testcase, and seeing how much (in average) the memory consumption
-+# increased after the "hello-world" command issued above. The average
-+# was around 500 bytes, so I chose 1000 as a high estimate.
-+if { $kbytes_diff > 1000 } {
-+ fail "there is a memory leak on GDB (RHBZ 1007614)"
-+} else {
-+ pass "there is not a memory leak on GDB (RHBZ 1007614)"
-+}
-Index: gdb-7.2/gdb/testsuite/gdb.python/py-gdb-rhbz1007614-memleak-infpy_read_memory.py
-===================================================================
---- /dev/null
-+++ gdb-7.2/gdb/testsuite/gdb.python/py-gdb-rhbz1007614-memleak-infpy_read_memory.py
-@@ -0,0 +1,30 @@
-+# Copyright (C) 2014 Free Software Foundation, Inc.
-+
-+# This program is free software; you can redistribute it and/or modify
-+# it under the terms of the GNU General Public License as published by
-+# the Free Software Foundation; either version 3 of the License, or
-+# (at your option) any later version.
-+#
-+# This program is distributed in the hope that it will be useful,
-+# but WITHOUT ANY WARRANTY; without even the implied warranty of
-+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+# GNU General Public License for more details.
-+#
-+# You should have received a copy of the GNU General Public License
-+# along with this program. If not, see <http://www.gnu.org/licenses/>.
-+
-+class HelloWorld (gdb.Command):
-+ """Greet the whole world."""
-+
-+ def __init__ (self):
-+ super (HelloWorld, self).__init__ ("hello-world",
-+ gdb.COMMAND_OBSCURE)
-+
-+ def invoke (self, arg, from_tty):
-+ px = gdb.parse_and_eval("px")
-+ core = gdb.inferiors()[0]
-+ for i in range(256 * 1024):
-+ chunk = core.read_memory(px, 4096)
-+ print "Hello, World!"
-+
-+HelloWorld ()
diff --git a/gdb-rhbz1084404-ppc64-s390x-wrong-prologue-skip-O2-g-3of3.patch b/gdb-rhbz1084404-ppc64-s390x-wrong-prologue-skip-O2-g-3of3.patch
deleted file mode 100644
index af7271a..0000000
--- a/gdb-rhbz1084404-ppc64-s390x-wrong-prologue-skip-O2-g-3of3.patch
+++ /dev/null
@@ -1,226 +0,0 @@
-These testcases have been created by compiling glibc-2.17-78 on
-RHEL-7.1 s390x/ppc64 boxes, and then taking the "select.o" file
-present at $builddir/misc/select.o.
-
-Index: gdb-7.6.1/gdb/testsuite/gdb.arch/s390x-prologue-skip.exp
-===================================================================
---- /dev/null
-+++ gdb-7.6.1/gdb/testsuite/gdb.arch/s390x-prologue-skip.exp
-@@ -0,0 +1,34 @@
-+# Copyright 2015 Free Software Foundation, Inc.
-+
-+# This program is free software; you can redistribute it and/or modify
-+# it under the terms of the GNU General Public License as published by
-+# the Free Software Foundation; either version 3 of the License, or
-+# (at your option) any later version.
-+#
-+# This program is distributed in the hope that it will be useful,
-+# but WITHOUT ANY WARRANTY; without even the implied warranty of
-+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+# GNU General Public License for more details.
-+#
-+# You should have received a copy of the GNU General Public License
-+# along with this program. If not, see <http://www.gnu.org/licenses/>.
-+
-+if { ![istarget s390x-*linux-*] || ![is_lp64_target] } {
-+ verbose "Skipping s390x-prologue-skip.exp"
-+ return
-+}
-+
-+set testfile "s390x-prologue-skip"
-+set uufile "${srcdir}/${subdir}/${testfile}.o.uu"
-+set ofile "${srcdir}/${subdir}/${testfile}.o"
-+
-+if { [catch "system \"uudecode -o ${ofile} ${uufile}\"" ] != 0 } {
-+ untested "failed uudecode"
-+ return -1
-+}
-+
-+gdb_exit
-+gdb_start
-+gdb_load $ofile
-+
-+gdb_test "break select" "Breakpoint $decimal at 0x48: file ../sysdeps/unix/syscall-template.S, line 81." "breakpoint on select"
-Index: gdb-7.6.1/gdb/testsuite/gdb.arch/s390x-prologue-skip.o.uu
-===================================================================
---- /dev/null
-+++ gdb-7.6.1/gdb/testsuite/gdb.arch/s390x-prologue-skip.o.uu
-@@ -0,0 +1,64 @@
-+begin 644 s390x-prologue-skip.o.uu
-+M?T5,1@("`0`````````````!`!8````!````````````````````````````
-+M``+```````!```````!``!(`#^LE\!``).O?\&@`)+D$`.^G^_](a)X^#P```D
-+MP.4`````N00``NLE\+``!`J.N00`TKD$`"#`Y0````"Y!``MZ]_Q"``$I_0`
-+M"L`0`````+\/$`"G=/_7"HZG2?`!N2$`),"T``````?^````5@`"````.0$!
-+M^PX-``$!`0$````!```!+BXO<WES9&5P<R]U;FEX``!S>7-C86QL+71E;7!L
-+M871E+E,``0`````)`@```````````]```0)F$P("``$!````CP`"``````@!
-+M```````````````````````````N+B]S>7-D97!S+W5N:7@O<WES8V%L;"UT
-+M96UP;&%T92Y3`"]R;V]T+V=L:6)C+V=L:6)C+3(N,3<M-S@N96PW+G-R8R]G
-+M;&EB8RTR+C$W+6,W-3AA-C@V+VUI<V,`1TY5($%3(#(N,C,N-3(N,"XQ`(`!
-+M`1$`$`81`1(!`P@;""4($P4`````````````````+``"``````@`````````
-+M`````````````````&@`````````````````````````%``````!>E(``7@.
-+M`1L,#Z`!````````&````!P`````````1`!,CP6.!HT'2`[``@```!`````X
-+M`````````"```````"YS>6UT86(`+G-T<G1A8@`N<VAS=')T86(`+G)E;&$N
-+M=&5X=``N9&%T80`N8G-S`"YN;W1E+D=.52US=&%C:P`N<F5L82YD96)U9U]L
-+M:6YE`"YR96QA+F1E8G5G7VEN9F\`+F1E8G5G7V%B8G)E=@`N<F5L82YD96)U
-+M9U]A<F%N9V5S`"YR96QA+F5H7V9R86UE````````````````````````````
-+M````````````````````````````````````````````````````````````
-+M````````(`````$`````````!@```````````````````$``````````:```
-+M``````````````````0``````````````!L````$````````````````````
-+M``````````F``````````&`````0`````0`````````(`````````!@````F
-+M`````0`````````#````````````````````J```````````````````````
-+M````````!```````````````+`````@``````````P``````````````````
-+M`*@```````````````````````````````0``````````````#$````!````
-+M``````````````````````````"H```````````````````````````````!
-+M``````````````!&`````0``````````````````````````````J```````
-+M``!:`````````````````````0``````````````00````0`````````````
-+M````````````````">``````````&````!`````&``````````@`````````
-+M&````%<````!``````````````````````````````$"`````````),`````
-+M```````````````!``````````````!2````!```````````````````````
-+M```````)^`````````!@````$`````@`````````"``````````8````8P``
-+M``$``````````````````````````````94`````````%```````````````
-+M``````$``````````````'8````!``````````````````````````````&P
-+M`````````#`````````````````````0``````````````!Q````!```````
-+M```````````````````````*6``````````P````$`````L`````````"```
-+M```````8````B@````$``````````@```````````````````>``````````
-+M2`````````````````````@``````````````(4````$````````````````
-+M``````````````J(`````````#`````0````#0`````````(`````````!@`
-+M```1`````P`````````````````````````````"*`````````"4````````
-+M`````````````0```````````````0````(`````````````````````````
-+M````!T`````````!L````!$````*``````````@`````````&`````D````#
-+M``````````````````````````````CP`````````(X`````````````````
-+M```!`````````````````````````````````````````````````P```0``
-+M`````````````````````````P```P```````````````````````````P``
-+M!````````````````````````````P``"```````````````````````````
-+M`P``"@```````````````````````````P``!@``````````````````````
-+M`````P``"P```````````````````````````P``#0``````````````````
-+M`````````P``!0`````````````````````````!$```````````````````
-+M```````````;$``````````````````````````````V$@```0````````!(
-+M`````````"`````_$`````````````````````````````!7$@```0``````
-+M``!6`````````!````!I$`````````````````````````````!Y(@```0``
-+M``````!(`````````"````"'(@```0````````!(`````````"``7U]L:6)C
-+M7V5N86)L95]A<WEN8V-A;F-E;`!?7VQI8F-?9&ES86)L95]A<WEN8V-A;F-E
-+M;`!?7W-E;&5C=`!?7VQI8F-?;75L=&EP;&5?=&AR96%D<P!?7W-E;&5C=%]N
-+M;V-A;F-E;`!?7W-Y<V-A;&Q?97)R;W(`7U]L:6)C7W-E;&5C=`!S96QE8W0`
-+M````````````'`````H````3``````````(`````````-@````L````3````
-+M``````(`````````2@````T````3``````````(`````````8@````\````3
-+M``````````(`````````1@````$````6````````````````````!@````4`
-+M```$````````````````````#`````8````$````````````````````$```
-+M``$````6````````````````````&`````$````6`````````&@`````````
-+M!@````0````$````````````````````$`````$````6````````````````
-+L````(`````$````%````````````````````/`````$````%`````````$@`
-+`
-+end
-Index: gdb-7.6.1/gdb/testsuite/gdb.arch/ppc64-prologue-skip.exp
-===================================================================
---- /dev/null
-+++ gdb-7.6.1/gdb/testsuite/gdb.arch/ppc64-prologue-skip.exp
-@@ -0,0 +1,34 @@
-+# Copyright 2015 Free Software Foundation, Inc.
-+
-+# This program is free software; you can redistribute it and/or modify
-+# it under the terms of the GNU General Public License as published by
-+# the Free Software Foundation; either version 3 of the License, or
-+# (at your option) any later version.
-+#
-+# This program is distributed in the hope that it will be useful,
-+# but WITHOUT ANY WARRANTY; without even the implied warranty of
-+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+# GNU General Public License for more details.
-+#
-+# You should have received a copy of the GNU General Public License
-+# along with this program. If not, see <http://www.gnu.org/licenses/>.
-+
-+if { ![istarget powerpc64-*linux-*] || ![is_lp64_target] } {
-+ verbose "Skipping ppc64-prologue-skip.exp"
-+ return
-+}
-+
-+set testfile "ppc64-prologue-skip"
-+set uufile "${srcdir}/${subdir}/${testfile}.o.uu"
-+set ofile "${srcdir}/${subdir}/${testfile}.o"
-+
-+if { [catch "system \"uudecode -o ${ofile} ${uufile}\"" ] != 0 } {
-+ untested "failed uudecode"
-+ return -1
-+}
-+
-+gdb_exit
-+gdb_start
-+gdb_load $ofile
-+
-+gdb_test "break ___newselect_nocancel" "Breakpoint $decimal at 0xc: file ../sysdeps/unix/syscall-template.S, line 81." "breakpoint on ___newselect_nocancel"
-Index: gdb-7.6.1/gdb/testsuite/gdb.arch/ppc64-prologue-skip.o.uu
-===================================================================
---- /dev/null
-+++ gdb-7.6.1/gdb/testsuite/gdb.arch/ppc64-prologue-skip.o.uu
-@@ -0,0 +1,70 @@
-+begin 644 ppc64-skip-prologue.o.uu
-+M?T5,1@("`0`````````````!`!4````!````````````````````````````
-+M``-(``````!```````!``!0`$8%-B-`L"@``0,(`-#@``(Y$```"3.,`('P(
-+M`J;X`0`0^"'_D4@```%@````Z`$`@#@A`'!\"`.F3H``(/@A_X%]*`*F^2$`
-+MD/CA`-#XP0#(^*$`P/B!`+CX80"P2````6````#X80!PZ.$`T.C!`,CHH0#`
-+MZ($`N.AA`+`X``".1````GP``";X80!X^`$`B.AA`'!(```!8````.DA`)#H
-+M`0"(Z&$`>'TH`Z9\#_$@."$`@$SC`"!+__]@```````,($``````````O``(
-+M7U]S96QE8W0```````````````````````````!6``(````Y!`'[#@T``0$!
-+M`0````$```$N+B]S>7-D97!S+W5N:7@``'-Y<V-A;&PM=&5M<&QA=&4N4P`!
-+M``````D"```````````#T``!`BT3`@D``0$```"/``(`````"`$`````````
-+M`````````````````"XN+W-Y<V1E<',O=6YI>"]S>7-C86QL+71E;7!L871E
-+M+E,`+W)O;W0O9VQI8F,O9VQI8F,M,BXQ-RTW."YE;#<N<W)C+V=L:6)C+3(N
-+M,3<M8S<U.&$V.#8O;6ES8P!'3E4@05,@,BXR,RXU,BXP+C$`@`$!$0`0!A$!
-+M$@$#"!L()0@3!0`````````````````L``(`````"```````````````````
-+M````````V``````````````````````````0``````%Z4@`$>$$!&PP!````
-+M`#`````8`````````+P`20YP$4%^1`X`009!0@Z``4(107Y2$49_20X`!D$&
-+M1@``````+G-Y;71A8@`N<W1R=&%B`"YS:'-T<G1A8@`N<F5L82YT97AT`"YD
-+M871A`"YB<W,`+G)E;&$N;W!D`"YN;W1E+D=.52US=&%C:P`N<F5L82YD96)U
-+M9U]L:6YE`"YR96QA+F1E8G5G7VEN9F\`+F1E8G5G7V%B8G)E=@`N<F5L82YD
-+M96)U9U]A<F%N9V5S`"YR96QA+F5H7V9R86UE````````````````````````
-+M````````````````````````````````````````````````````````````
-+M`````````"`````!``````````8```````````````````!``````````-@`
-+M```````````````````$```````````````;````!```````````````````
-+M```````````*>`````````!(````$@````$`````````"``````````8````
-+M)@````$``````````P```````````````````1@`````````````````````
-+M``````````$``````````````"P````(``````````,`````````````````
-+M``$8```````````````````````````````!```````````````V`````0``
-+M```````#```````````````````!&``````````0````````````````````
-+M"```````````````,0````0`````````````````````````````"L``````
-+M````,````!(````%``````````@`````````&````#L````!````````````
-+M``````````````````$H```````````````````````````````!````````
-+M``````!0`````0`````````````````````````````!*`````````!:````
-+M`````````````````0``````````````2P````0`````````````````````
-+M````````"O``````````&````!(````(``````````@`````````&````&$`
-+M```!``````````````````````````````&"`````````),`````````````
-+M```````!``````````````!<````!``````````````````````````````+
-+M"`````````!@````$@````H`````````"``````````8````;0````$`````
-+M`````````````````````````A4`````````%`````````````````````$`
-+M`````````````(`````!``````````````````````````````(P````````
-+M`#`````````````````````0``````````````![````!```````````````
-+M```````````````+:``````````P````$@````T`````````"``````````8
-+M````E`````$``````````@```````````````````F``````````2```````
-+M``````````````@``````````````(\````$````````````````````````
-+M``````N8`````````!@````2````#P`````````(`````````!@````1````
-+M`P`````````````````````````````"J`````````">````````````````
-+M`````0```````````````0````(`````````````````````````````"$@`
-+M```````!L````!,````+``````````@`````````&`````D````#````````
-+M``````````````````````GX`````````'H````````````````````!````
-+M`````````````````````````````````````````````P```0``````````
-+M`````````````````P```P```````````````````````````P``!```````
-+M`````````````````````P``!0```````````````````````````P``"@``
-+M`````````````````````````P``#````````````````````````````P``
-+M"````````````````````````````P``#0``````````````````````````
-+M`P``#P```````````````````````````P``!P``````````````````````
-+M```!$@``!0```````````````````-@````*$@```0`````````,````````
-+M`#`````@$``````````````````````````````P$```````````````````
-+M``````````!*$`````````````````````````````!E(@``!0``````````
-+M`````````-@```!S(@``!0```````````````````-@`7U]S96QE8W0`7U]?
-+M;F5W<V5L96-T7VYO8V%N8V5L`%]?<WES8V%L;%]E<G)O<@!?7VQI8F-?96YA
-+M8FQE7V%S>6YC8V%N8V5L`%]?;&EB8U]D:7-A8FQE7V%S>6YC8V%N8V5L`%]?
-+M;&EB8U]S96QE8W0`<V5L96-T```````````````````D````#0````H`````
-+M``````````````!<````#@````H```````````````````"4````#P````H`
-+M`````````````````````````0```"8````````````````````(````````
-+M`#,```````````````````!&`````0```"8````````````````````&````
-+M!@````$````````````````````,````!P````$````````````````````0
-+M`````0```"8````````````````````8`````0```"8`````````V```````
-+M```&````!0````$````````````````````0`````0```"8`````````````
-+6```````<`````0```!H`````````````
-+`
-+end
diff --git a/gdb-rhbz1350436-type-printers-error.patch b/gdb-rhbz1350436-type-printers-error.patch
deleted file mode 100644
index 278bc2c..0000000
--- a/gdb-rhbz1350436-type-printers-error.patch
+++ /dev/null
@@ -1,73 +0,0 @@
-Typo in Python support breaks info type-printers command
-https://bugzilla.redhat.com/show_bug.cgi?id=1350436
-
-[testsuite patch] PR python/17136: 'info type-printers' causes an exception when there are per-objfile printers
-https://sourceware.org/ml/gdb-patches/2016-06/msg00455.html
-
-diff -dup -rup gdb-7.6.1/gdb/testsuite/gdb.python-orig/py-typeprint.cc gdb-7.6.1/gdb/testsuite/gdb.python/py-typeprint.cc
---- gdb-7.6.1/gdb/testsuite/gdb.python-orig/py-typeprint.cc 2013-01-01 07:41:26.000000000 +0100
-+++ gdb-7.6.1/gdb/testsuite/gdb.python/py-typeprint.cc 2016-06-27 22:57:58.168642470 +0200
-@@ -31,6 +31,12 @@ templ<basic_string> s;
-
- basic_string bs;
-
-+class Other
-+{
-+};
-+
-+Other ovar;
-+
- int main()
- {
- return 0;
-diff -dup -rup gdb-7.6.1/gdb/testsuite/gdb.python-orig/py-typeprint.exp gdb-7.6.1/gdb/testsuite/gdb.python/py-typeprint.exp
---- gdb-7.6.1/gdb/testsuite/gdb.python-orig/py-typeprint.exp 2013-01-01 07:41:26.000000000 +0100
-+++ gdb-7.6.1/gdb/testsuite/gdb.python/py-typeprint.exp 2016-06-27 22:58:13.846785208 +0200
-@@ -51,3 +51,7 @@ gdb_test_no_output "enable type-printer
- gdb_test "whatis bs" "string" "whatis with enabled printer"
-
- gdb_test "whatis s" "templ<string>"
-+
-+gdb_test "info type-printers" "Type printers for \[^\r\n\]*/py-typeprint:\r\n *other\r\n.*" \
-+ "info type-printers for other"
-+gdb_test "whatis ovar" "type = Another"
-diff -dup -rup gdb-7.6.1/gdb/testsuite/gdb.python-orig/py-typeprint.py gdb-7.6.1/gdb/testsuite/gdb.python/py-typeprint.py
---- gdb-7.6.1/gdb/testsuite/gdb.python-orig/py-typeprint.py 2013-01-01 07:41:26.000000000 +0100
-+++ gdb-7.6.1/gdb/testsuite/gdb.python/py-typeprint.py 2016-06-27 22:57:58.169642479 +0200
-@@ -15,7 +15,7 @@
-
- import gdb
-
--class Recognizer(object):
-+class StringRecognizer(object):
- def __init__(self):
- self.enabled = True
-
-@@ -30,6 +30,26 @@ class StringTypePrinter(object):
- self.enabled = True
-
- def instantiate(self):
-- return Recognizer()
-+ return StringRecognizer()
-
- gdb.type_printers.append(StringTypePrinter())
-+
-+class OtherRecognizer(object):
-+ def __init__(self):
-+ self.enabled = True
-+
-+ def recognize(self, type_obj):
-+ if type_obj.tag == 'Other':
-+ return 'Another'
-+ return None
-+
-+class OtherTypePrinter(object):
-+ def __init__(self):
-+ self.name = 'other'
-+ self.enabled = True
-+
-+ def instantiate(self):
-+ return OtherRecognizer()
-+
-+import gdb.types
-+gdb.types.register_type_printer(gdb.objfiles()[0], OtherTypePrinter())
diff --git a/gdb-rhbz795424-bitpos-21of25.patch b/gdb-rhbz795424-bitpos-21of25.patch
index 0fa7ead..42013e1 100644
--- a/gdb-rhbz795424-bitpos-21of25.patch
+++ b/gdb-rhbz795424-bitpos-21of25.patch
@@ -1,6 +1,15 @@
-http://sourceware.org/ml/gdb-patches/2012-09/msg00632.html
-Subject: [PATCH 2/4] Add a check to ensure that a type may fit into host memory
+From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
+From: Fedora GDB patches <invalid(a)email.com>
+Date: Fri, 27 Oct 2017 21:07:50 +0200
+Subject: Add a check to ensure that a type may fit into host memory
+
+FileName: gdb-rhbz795424-bitpos-21of25.patch
+
+;; Fix `GDB cannot access struct member whose offset is larger than 256MB'
+;; (RH BZ 795424).
+;;=push
+http://sourceware.org/ml/gdb-patches/2012-09/msg00632.html
--MP_/PnL6l3LUsXWpZ/olqawWlzb
Content-Type: text/plain; charset=US-ASCII
@@ -51,12 +60,22 @@ gdb/ChangeLog
Content-Type: text/x-patch
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment; filename=bitpos-ensure-size_t.patch
+---
+ gdb/alpha-tdep.c | 7 +++++++
+ gdb/cp-valprint.c | 1 +
+ gdb/defs.h | 2 ++
+ gdb/p-valprint.c | 1 +
+ gdb/utils.c | 12 ++++++++++++
+ gdb/valops.c | 1 +
+ gdb/value.c | 4 ++++
+ gdb/vax-tdep.c | 1 +
+ 8 files changed, 29 insertions(+)
-Index: gdb-7.10.90.20160211/gdb/alpha-tdep.c
-===================================================================
---- gdb-7.10.90.20160211.orig/gdb/alpha-tdep.c 2016-02-11 20:56:59.224850729 +0100
-+++ gdb-7.10.90.20160211/gdb/alpha-tdep.c 2016-02-11 20:57:05.385891225 +0100
-@@ -413,6 +413,13 @@
+diff --git a/gdb/alpha-tdep.c b/gdb/alpha-tdep.c
+index 52a46d96ea..ea53b9ee10 100644
+--- a/gdb/alpha-tdep.c
++++ b/gdb/alpha-tdep.c
+@@ -415,6 +415,13 @@ alpha_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
accumulate_size = 0;
else
accumulate_size -= sizeof(arg_reg_buffer);
@@ -70,69 +89,46 @@ Index: gdb-7.10.90.20160211/gdb/alpha-tdep.c
sp -= accumulate_size;
/* Keep sp aligned to a multiple of 16 as the ABI requires. */
-Index: gdb-7.10.90.20160211/gdb/cp-valprint.c
-===================================================================
---- gdb-7.10.90.20160211.orig/gdb/cp-valprint.c 2016-02-11 20:56:59.224850729 +0100
-+++ gdb-7.10.90.20160211/gdb/cp-valprint.c 2016-02-11 20:57:05.385891225 +0100
-@@ -536,6 +536,8 @@
- gdb_byte *buf;
- struct cleanup *back_to;
-
+diff --git a/gdb/cp-valprint.c b/gdb/cp-valprint.c
+index db3ff338d1..4d06680239 100644
+--- a/gdb/cp-valprint.c
++++ b/gdb/cp-valprint.c
+@@ -529,6 +529,7 @@ cp_print_value (struct type *type, struct type *real_type,
+ if ((boffset + offset) < 0
+ || (boffset + offset) >= TYPE_LENGTH (real_type))
+ {
+ ulongest_fits_host_or_error (TYPE_LENGTH (baseclass));
-+
- buf = (gdb_byte *) xmalloc (TYPE_LENGTH (baseclass));
- back_to = make_cleanup (xfree, buf);
+ gdb::byte_vector buf (TYPE_LENGTH (baseclass));
-Index: gdb-7.10.90.20160211/gdb/dwarf2loc.c
-===================================================================
---- gdb-7.10.90.20160211.orig/gdb/dwarf2loc.c 2016-02-11 20:56:59.225850736 +0100
-+++ gdb-7.10.90.20160211/gdb/dwarf2loc.c 2016-02-11 20:57:05.386891231 +0100
-@@ -1744,6 +1744,8 @@
+ if (target_read_memory (address + boffset, buf.data (),
+diff --git a/gdb/defs.h b/gdb/defs.h
+index 4fb2129b30..0c156d56c3 100644
+--- a/gdb/defs.h
++++ b/gdb/defs.h
+@@ -705,4 +705,6 @@ DEF_ENUM_FLAGS_TYPE (enum user_selected_what_flag, user_selected_what);
- this_size = (this_size_bits + source_offset_bits % 8 + 7) / 8;
- source_offset = source_offset_bits / 8;
-+ ulongest_fits_host_or_error (this_size);
-+
- if (buffer_size < this_size)
- {
- buffer_size = this_size;
-@@ -1926,6 +1928,7 @@
- }
- else
- {
-+ ulongest_fits_host_or_error (this_size);
- if (buffer_size < this_size)
- {
- buffer_size = this_size;
-Index: gdb-7.10.90.20160211/gdb/findcmd.c
-===================================================================
---- gdb-7.10.90.20160211.orig/gdb/findcmd.c 2016-02-11 20:56:59.226850742 +0100
-+++ gdb-7.10.90.20160211/gdb/findcmd.c 2016-02-11 20:57:05.387891238 +0100
-@@ -184,6 +184,7 @@
- size_t current_offset = pattern_buf_end - pattern_buf;
+ #include "utils.h"
- pattern_buf_size = pattern_buf_size_need * 2;
-+ ulongest_fits_host_or_error (pattern_buf_size);
- pattern_buf = (gdb_byte *) xrealloc (pattern_buf, pattern_buf_size);
- pattern_buf_end = pattern_buf + current_offset;
- }
-Index: gdb-7.10.90.20160211/gdb/p-valprint.c
-===================================================================
---- gdb-7.10.90.20160211.orig/gdb/p-valprint.c 2016-02-11 20:56:59.226850742 +0100
-+++ gdb-7.10.90.20160211/gdb/p-valprint.c 2016-02-11 20:57:05.387891238 +0100
-@@ -769,6 +769,7 @@
- gdb_byte *buf;
- struct cleanup *back_to;
++extern void ulongest_fits_host_or_error (ULONGEST num);
++
+ #endif /* #ifndef DEFS_H */
+diff --git a/gdb/p-valprint.c b/gdb/p-valprint.c
+index e5c1b07040..06fb3b77c9 100644
+--- a/gdb/p-valprint.c
++++ b/gdb/p-valprint.c
+@@ -773,6 +773,7 @@ pascal_object_print_value (struct type *type, const gdb_byte *valaddr,
+ if (boffset < 0 || boffset >= TYPE_LENGTH (type))
+ {
+ ulongest_fits_host_or_error (TYPE_LENGTH (baseclass));
- buf = (gdb_byte *) xmalloc (TYPE_LENGTH (baseclass));
- back_to = make_cleanup (xfree, buf);
+ buf.resize (TYPE_LENGTH (baseclass));
-Index: gdb-7.10.90.20160211/gdb/utils.c
-===================================================================
---- gdb-7.10.90.20160211.orig/gdb/utils.c 2016-02-11 20:56:59.227850749 +0100
-+++ gdb-7.10.90.20160211/gdb/utils.c 2016-02-11 20:57:05.388891244 +0100
-@@ -2837,6 +2837,18 @@
+ base_valaddr = buf.data ();
+diff --git a/gdb/utils.c b/gdb/utils.c
+index 0066bfcc4b..6f0abc98a2 100644
+--- a/gdb/utils.c
++++ b/gdb/utils.c
+@@ -2836,6 +2836,18 @@ string_to_core_addr (const char *my_string)
return addr;
}
@@ -148,26 +144,26 @@ Index: gdb-7.10.90.20160211/gdb/utils.c
+ pulongest (SIZE_MAX / 8));
+}
+
- char *
+ gdb::unique_xmalloc_ptr<char>
gdb_realpath (const char *filename)
{
-Index: gdb-7.10.90.20160211/gdb/valops.c
-===================================================================
---- gdb-7.10.90.20160211.orig/gdb/valops.c 2016-02-11 20:56:59.228850755 +0100
-+++ gdb-7.10.90.20160211/gdb/valops.c 2016-02-11 20:57:05.389891251 +0100
-@@ -2057,6 +2057,7 @@
- struct cleanup *back_to;
+diff --git a/gdb/valops.c b/gdb/valops.c
+index fdcb7e49e6..ddc53f131e 100644
+--- a/gdb/valops.c
++++ b/gdb/valops.c
+@@ -2087,6 +2087,7 @@ search_struct_method (const char *name, struct value **arg1p,
+ {
CORE_ADDR address;
+ ulongest_fits_host_or_error (TYPE_LENGTH (baseclass));
- tmp = (gdb_byte *) xmalloc (TYPE_LENGTH (baseclass));
- back_to = make_cleanup (xfree, tmp);
+ gdb::byte_vector tmp (TYPE_LENGTH (baseclass));
address = value_address (*arg1p);
-Index: gdb-7.10.90.20160211/gdb/value.c
-===================================================================
---- gdb-7.10.90.20160211.orig/gdb/value.c 2016-02-11 20:56:59.229850762 +0100
-+++ gdb-7.10.90.20160211/gdb/value.c 2016-02-11 20:58:35.095480877 +0100
-@@ -935,6 +935,7 @@
+
+diff --git a/gdb/value.c b/gdb/value.c
+index b6406fedc9..ac7d07a7b5 100644
+--- a/gdb/value.c
++++ b/gdb/value.c
+@@ -926,6 +926,7 @@ allocate_value_lazy (struct type *type)
description correctly. */
check_typedef (type);
@@ -175,7 +171,7 @@ Index: gdb-7.10.90.20160211/gdb/value.c
val = XCNEW (struct value);
val->contents = NULL;
val->next = all_values;
-@@ -1034,6 +1035,8 @@
+@@ -1023,6 +1024,8 @@ check_type_length_before_alloc (const struct type *type)
static void
allocate_value_contents (struct value *val)
{
@@ -184,7 +180,7 @@ Index: gdb-7.10.90.20160211/gdb/value.c
if (!val->contents)
{
check_type_length_before_alloc (val->enclosing_type);
-@@ -3090,6 +3093,7 @@
+@@ -3015,6 +3018,7 @@ set_value_enclosing_type (struct value *val, struct type *new_encl_type)
if (TYPE_LENGTH (new_encl_type) > TYPE_LENGTH (value_enclosing_type (val)))
{
check_type_length_before_alloc (new_encl_type);
@@ -192,11 +188,11 @@ Index: gdb-7.10.90.20160211/gdb/value.c
val->contents
= (gdb_byte *) xrealloc (val->contents, TYPE_LENGTH (new_encl_type));
}
-Index: gdb-7.10.90.20160211/gdb/vax-tdep.c
-===================================================================
---- gdb-7.10.90.20160211.orig/gdb/vax-tdep.c 2016-02-11 20:56:59.229850762 +0100
-+++ gdb-7.10.90.20160211/gdb/vax-tdep.c 2016-02-11 20:57:05.391891264 +0100
-@@ -219,6 +219,7 @@
+diff --git a/gdb/vax-tdep.c b/gdb/vax-tdep.c
+index 4c1ab2e73e..bd69fd2f48 100644
+--- a/gdb/vax-tdep.c
++++ b/gdb/vax-tdep.c
+@@ -218,6 +218,7 @@ vax_return_value (struct gdbarch *gdbarch, struct value *function,
ULONGEST addr;
regcache_raw_read_unsigned (regcache, VAX_R0_REGNUM, &addr);
@@ -204,14 +200,6 @@ Index: gdb-7.10.90.20160211/gdb/vax-tdep.c
read_memory (addr, readbuf, len);
}
-Index: gdb-7.10.90.20160211/gdb/defs.h
-===================================================================
---- gdb-7.10.90.20160211.orig/gdb/defs.h 2016-02-11 20:56:59.229850762 +0100
-+++ gdb-7.10.90.20160211/gdb/defs.h 2016-02-11 20:57:05.391891264 +0100
-@@ -690,4 +690,6 @@
-
- #include "utils.h"
-
-+extern void ulongest_fits_host_or_error (ULONGEST num);
-+
- #endif /* #ifndef DEFS_H */
+--
+2.14.3
+
diff --git a/gdb-rhbz795424-bitpos-22of25.patch b/gdb-rhbz795424-bitpos-22of25.patch
index 2f5b484..58f53c2 100644
--- a/gdb-rhbz795424-bitpos-22of25.patch
+++ b/gdb-rhbz795424-bitpos-22of25.patch
@@ -1,6 +1,15 @@
-http://sourceware.org/ml/gdb-patches/2012-09/msg00629.html
-Subject: [PATCH 3/4] Expand watchpoint lengths to LONGEST
+From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
+From: Fedora GDB patches <invalid(a)email.com>
+Date: Fri, 27 Oct 2017 21:07:50 +0200
+Subject: Expand watchpoint lengths to LONGEST
+
+FileName: gdb-rhbz795424-bitpos-22of25.patch
+;; Fix `GDB cannot access struct member whose offset is larger than 256MB'
+;; (RH BZ 795424).
+;;=push
+
+http://sourceware.org/ml/gdb-patches/2012-09/msg00629.html
--MP_/6HRlH6vpyqtSy4CYyMrX6b2
Content-Type: text/plain; charset=US-ASCII
@@ -95,12 +104,37 @@ gdb/ChangeLog:
Content-Type: text/x-patch
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment; filename=bitpos-wp.patch
+---
+ gdb/aarch64-linux-nat.c | 2 +-
+ gdb/arm-linux-nat.c | 2 +-
+ gdb/nat/aarch64-linux-hw-point.c | 21 +++++++++++----------
+ gdb/nat/aarch64-linux-hw-point.h | 4 ++--
+ gdb/ppc-linux-nat.c | 14 +++++++-------
+ gdb/procfs.c | 4 ++--
+ gdb/remote.c | 6 +++---
+ gdb/target-delegates.c | 14 +++++++-------
+ gdb/target.c | 4 ++--
+ gdb/target.h | 4 ++--
+ 10 files changed, 38 insertions(+), 37 deletions(-)
-Index: gdb-7.10.50.20151027/gdb/arm-linux-nat.c
-===================================================================
---- gdb-7.10.50.20151027.orig/gdb/arm-linux-nat.c 2015-11-08 10:36:33.050071812 +0100
-+++ gdb-7.10.50.20151027/gdb/arm-linux-nat.c 2015-11-08 10:36:33.094072110 +0100
-@@ -1209,7 +1209,7 @@ arm_linux_stopped_by_watchpoint (struct
+diff --git a/gdb/aarch64-linux-nat.c b/gdb/aarch64-linux-nat.c
+index 08e6f4d4fd..f08bf039e4 100644
+--- a/gdb/aarch64-linux-nat.c
++++ b/gdb/aarch64-linux-nat.c
+@@ -767,7 +767,7 @@ aarch64_linux_stopped_by_watchpoint (struct target_ops *ops)
+ static int
+ aarch64_linux_watchpoint_addr_within_range (struct target_ops *target,
+ CORE_ADDR addr,
+- CORE_ADDR start, int length)
++ CORE_ADDR start, LONGEST length)
+ {
+ return start <= addr && start + length - 1 >= addr;
+ }
+diff --git a/gdb/arm-linux-nat.c b/gdb/arm-linux-nat.c
+index 3b7aa40db8..48dfe22ce1 100644
+--- a/gdb/arm-linux-nat.c
++++ b/gdb/arm-linux-nat.c
+@@ -1177,7 +1177,7 @@ arm_linux_stopped_by_watchpoint (struct target_ops *ops)
static int
arm_linux_watchpoint_addr_within_range (struct target_ops *target,
CORE_ADDR addr,
@@ -109,11 +143,107 @@ Index: gdb-7.10.50.20151027/gdb/arm-linux-nat.c
{
return start <= addr && start + length - 1 >= addr;
}
-Index: gdb-7.10.50.20151027/gdb/ppc-linux-nat.c
-===================================================================
---- gdb-7.10.50.20151027.orig/gdb/ppc-linux-nat.c 2015-11-08 10:36:33.064071907 +0100
-+++ gdb-7.10.50.20151027/gdb/ppc-linux-nat.c 2015-11-08 10:36:33.095072117 +0100
-@@ -1807,11 +1807,11 @@ can_use_watchpoint_cond_accel (void)
+diff --git a/gdb/nat/aarch64-linux-hw-point.c b/gdb/nat/aarch64-linux-hw-point.c
+index ce26f28fad..e9ebc5fba8 100644
+--- a/gdb/nat/aarch64-linux-hw-point.c
++++ b/gdb/nat/aarch64-linux-hw-point.c
+@@ -111,7 +111,7 @@ aarch64_point_encode_ctrl_reg (enum target_hw_bp_type type, int len)
+ Return 0 for any non-compliant ADDR and/or LEN; return 1 otherwise. */
+
+ static int
+-aarch64_point_is_aligned (int is_watchpoint, CORE_ADDR addr, int len)
++aarch64_point_is_aligned (int is_watchpoint, CORE_ADDR addr, LONGEST len)
+ {
+ unsigned int alignment = 0;
+
+@@ -180,9 +180,10 @@ aarch64_point_is_aligned (int is_watchpoint, CORE_ADDR addr, int len)
+ limitations can be largely relaxed with some further work. */
+
+ static void
+-aarch64_align_watchpoint (CORE_ADDR addr, int len, CORE_ADDR *aligned_addr_p,
++aarch64_align_watchpoint (CORE_ADDR addr, LONGEST len,
++ CORE_ADDR *aligned_addr_p,
+ int *aligned_len_p, CORE_ADDR *next_addr_p,
+- int *next_len_p)
++ LONGEST *next_len_p)
+ {
+ int aligned_len;
+ unsigned int offset;
+@@ -501,7 +502,7 @@ aarch64_handle_aligned_watchpoint (enum target_hw_bp_type type,
+
+ static int
+ aarch64_handle_unaligned_watchpoint (enum target_hw_bp_type type,
+- CORE_ADDR addr, int len, int is_insert,
++ CORE_ADDR addr, LONGEST len, int is_insert,
+ struct aarch64_debug_reg_state *state)
+ {
+ while (len > 0)
+@@ -524,9 +525,9 @@ aarch64_handle_unaligned_watchpoint (enum target_hw_bp_type type,
+ " "
+ "aligned_addr: %s, aligned_len: %d\n"
+ " "
+- "next_addr: %s, next_len: %d\n",
++ "next_addr: %s, next_len: %s\n",
+ is_insert, core_addr_to_string_nz (aligned_addr),
+- aligned_len, core_addr_to_string_nz (addr), len);
++ aligned_len, core_addr_to_string_nz (addr), plongest (len));
+
+ if (ret != 0)
+ return ret;
+@@ -537,7 +538,7 @@ aarch64_handle_unaligned_watchpoint (enum target_hw_bp_type type,
+
+ int
+ aarch64_handle_watchpoint (enum target_hw_bp_type type, CORE_ADDR addr,
+- int len, int is_insert,
++ LONGEST len, int is_insert,
+ struct aarch64_debug_reg_state *state)
+ {
+ if (aarch64_point_is_aligned (1 /* is_watchpoint */ , addr, len))
+@@ -588,14 +589,14 @@ aarch64_linux_set_debug_regs (const struct aarch64_debug_reg_state *state,
+ void
+ aarch64_show_debug_reg_state (struct aarch64_debug_reg_state *state,
+ const char *func, CORE_ADDR addr,
+- int len, enum target_hw_bp_type type)
++ LONGEST len, enum target_hw_bp_type type)
+ {
+ int i;
+
+ debug_printf ("%s", func);
+ if (addr || len)
+- debug_printf (" (addr=0x%08lx, len=%d, type=%s)",
+- (unsigned long) addr, len,
++ debug_printf (" (addr=0x%08lx, len=%s, type=%s)",
++ (unsigned long) addr, plongest (len),
+ type == hw_write ? "hw-write-watchpoint"
+ : (type == hw_read ? "hw-read-watchpoint"
+ : (type == hw_access ? "hw-access-watchpoint"
+diff --git a/gdb/nat/aarch64-linux-hw-point.h b/gdb/nat/aarch64-linux-hw-point.h
+index 7c42b96d1b..e1d4fc8dbc 100644
+--- a/gdb/nat/aarch64-linux-hw-point.h
++++ b/gdb/nat/aarch64-linux-hw-point.h
+@@ -172,7 +172,7 @@ int aarch64_handle_breakpoint (enum target_hw_bp_type type, CORE_ADDR addr,
+ int len, int is_insert,
+ struct aarch64_debug_reg_state *state);
+ int aarch64_handle_watchpoint (enum target_hw_bp_type type, CORE_ADDR addr,
+- int len, int is_insert,
++ LONGEST len, int is_insert,
+ struct aarch64_debug_reg_state *state);
+
+ void aarch64_linux_set_debug_regs (const struct aarch64_debug_reg_state *state,
+@@ -180,7 +180,7 @@ void aarch64_linux_set_debug_regs (const struct aarch64_debug_reg_state *state,
+
+ void aarch64_show_debug_reg_state (struct aarch64_debug_reg_state *state,
+ const char *func, CORE_ADDR addr,
+- int len, enum target_hw_bp_type type);
++ LONGEST len, enum target_hw_bp_type type);
+
+ void aarch64_linux_get_debug_reg_capacity (int tid);
+
+diff --git a/gdb/ppc-linux-nat.c b/gdb/ppc-linux-nat.c
+index 4a82434c0d..49a27d8daa 100644
+--- a/gdb/ppc-linux-nat.c
++++ b/gdb/ppc-linux-nat.c
+@@ -1798,11 +1798,11 @@ can_use_watchpoint_cond_accel (void)
CONDITION_VALUE will hold the value which should be put in the
DVC register. */
static void
@@ -128,7 +258,7 @@ Index: gdb-7.10.50.20151027/gdb/ppc-linux-nat.c
CORE_ADDR addr_end_data, addr_end_dvc;
/* The DVC register compares bytes within fixed-length windows which
-@@ -1898,7 +1898,7 @@ num_memory_accesses (struct value *v)
+@@ -1889,7 +1889,7 @@ num_memory_accesses (struct value *v)
of the constant. */
static int
check_condition (CORE_ADDR watch_addr, struct expression *cond,
@@ -137,7 +267,7 @@ Index: gdb-7.10.50.20151027/gdb/ppc-linux-nat.c
{
int pc = 1, num_accesses_left, num_accesses_right;
struct value *left_val, *right_val, *left_chain, *right_chain;
-@@ -1966,7 +1966,7 @@ check_condition (CORE_ADDR watch_addr, s
+@@ -1957,7 +1957,7 @@ check_condition (CORE_ADDR watch_addr, struct expression *cond,
true. */
static int
ppc_linux_can_accel_watchpoint_condition (struct target_ops *self,
@@ -146,7 +276,7 @@ Index: gdb-7.10.50.20151027/gdb/ppc-linux-nat.c
struct expression *cond)
{
CORE_ADDR data_value;
-@@ -1983,7 +1983,7 @@ ppc_linux_can_accel_watchpoint_condition
+@@ -1974,7 +1974,7 @@ ppc_linux_can_accel_watchpoint_condition (struct target_ops *self,
static void
create_watchpoint_request (struct ppc_hw_breakpoint *p, CORE_ADDR addr,
@@ -155,7 +285,7 @@ Index: gdb-7.10.50.20151027/gdb/ppc-linux-nat.c
struct expression *cond, int insert)
{
if (len == 1
-@@ -2249,7 +2249,7 @@ ppc_linux_stopped_by_watchpoint (struct
+@@ -2240,7 +2240,7 @@ ppc_linux_stopped_by_watchpoint (struct target_ops *ops)
static int
ppc_linux_watchpoint_addr_within_range (struct target_ops *target,
CORE_ADDR addr,
@@ -164,20 +294,20 @@ Index: gdb-7.10.50.20151027/gdb/ppc-linux-nat.c
{
int mask;
-Index: gdb-7.10.50.20151027/gdb/procfs.c
-===================================================================
---- gdb-7.10.50.20151027.orig/gdb/procfs.c 2015-11-08 10:36:33.065071913 +0100
-+++ gdb-7.10.50.20151027/gdb/procfs.c 2015-11-08 10:36:33.096072123 +0100
-@@ -2427,7 +2427,7 @@ procfs_address_to_host_pointer (CORE_ADD
- #endif
+diff --git a/gdb/procfs.c b/gdb/procfs.c
+index 887f1201fe..edd1be632a 100644
+--- a/gdb/procfs.c
++++ b/gdb/procfs.c
+@@ -1563,7 +1563,7 @@ procfs_address_to_host_pointer (CORE_ADDR addr)
+ }
static int
-proc_set_watchpoint (procinfo *pi, CORE_ADDR addr, int len, int wflags)
+proc_set_watchpoint (procinfo *pi, CORE_ADDR addr, LONGEST len, int wflags)
{
- #if !defined (PCWATCH) && !defined (PIOCSWATCH)
- /* If neither or these is defined, we can't support watchpoints.
-@@ -4706,7 +4706,7 @@ procfs_pid_to_str (struct target_ops *op
+ struct {
+ procfs_ctl_t cmd;
+@@ -3250,7 +3250,7 @@ procfs_pid_to_str (struct target_ops *ops, ptid_t ptid)
/* Insert a watchpoint. */
static int
@@ -185,12 +315,12 @@ Index: gdb-7.10.50.20151027/gdb/procfs.c
+procfs_set_watchpoint (ptid_t ptid, CORE_ADDR addr, LONGEST len, int rwflag,
int after)
{
- #ifndef AIX5
-Index: gdb-7.10.50.20151027/gdb/remote.c
-===================================================================
---- gdb-7.10.50.20151027.orig/gdb/remote.c 2015-11-08 10:36:33.067071927 +0100
-+++ gdb-7.10.50.20151027/gdb/remote.c 2015-11-08 10:36:33.097072130 +0100
-@@ -9085,7 +9085,7 @@ remote_insert_watchpoint (struct target_
+ int pflags = 0;
+diff --git a/gdb/remote.c b/gdb/remote.c
+index f9f8f973a2..1eee712466 100644
+--- a/gdb/remote.c
++++ b/gdb/remote.c
+@@ -9891,7 +9891,7 @@ remote_insert_watchpoint (struct target_ops *self, CORE_ADDR addr, int len,
p = strchr (rs->buf, '\0');
addr = remote_address_masked (addr);
p += hexnumstr (p, (ULONGEST) addr);
@@ -199,7 +329,7 @@ Index: gdb-7.10.50.20151027/gdb/remote.c
putpkt (rs->buf);
getpkt (&rs->buf, &rs->buf_size, 0);
-@@ -9105,7 +9105,7 @@ remote_insert_watchpoint (struct target_
+@@ -9911,7 +9911,7 @@ remote_insert_watchpoint (struct target_ops *self, CORE_ADDR addr, int len,
static int
remote_watchpoint_addr_within_range (struct target_ops *target, CORE_ADDR addr,
@@ -208,7 +338,7 @@ Index: gdb-7.10.50.20151027/gdb/remote.c
{
CORE_ADDR diff = remote_address_masked (addr - start);
-@@ -9134,7 +9134,7 @@ remote_remove_watchpoint (struct target_
+@@ -9940,7 +9940,7 @@ remote_remove_watchpoint (struct target_ops *self, CORE_ADDR addr, int len,
p = strchr (rs->buf, '\0');
addr = remote_address_masked (addr);
p += hexnumstr (p, (ULONGEST) addr);
@@ -217,68 +347,11 @@ Index: gdb-7.10.50.20151027/gdb/remote.c
putpkt (rs->buf);
getpkt (&rs->buf, &rs->buf_size, 0);
-Index: gdb-7.10.50.20151027/gdb/target.c
-===================================================================
---- gdb-7.10.50.20151027.orig/gdb/target.c 2015-11-08 10:36:33.069071941 +0100
-+++ gdb-7.10.50.20151027/gdb/target.c 2015-11-08 10:36:33.098072137 +0100
-@@ -51,7 +51,7 @@ static void generic_tls_error (void) ATT
- static void default_terminal_info (struct target_ops *, const char *, int);
-
- static int default_watchpoint_addr_within_range (struct target_ops *,
-- CORE_ADDR, CORE_ADDR, int);
-+ CORE_ADDR, CORE_ADDR, LONGEST);
-
- static int default_region_ok_for_hw_watchpoint (struct target_ops *,
- CORE_ADDR, LONGEST);
-@@ -3140,7 +3140,7 @@ default_region_ok_for_hw_watchpoint (str
- static int
- default_watchpoint_addr_within_range (struct target_ops *target,
- CORE_ADDR addr,
-- CORE_ADDR start, int length)
-+ CORE_ADDR start, LONGEST length)
- {
- return addr >= start && addr < start + length;
- }
-Index: gdb-7.10.50.20151027/gdb/target.h
-===================================================================
---- gdb-7.10.50.20151027.orig/gdb/target.h 2015-11-08 10:36:33.069071941 +0100
-+++ gdb-7.10.50.20151027/gdb/target.h 2015-11-08 10:36:33.098072137 +0100
-@@ -543,7 +543,7 @@ struct target_ops
- int (*to_stopped_data_address) (struct target_ops *, CORE_ADDR *)
- TARGET_DEFAULT_RETURN (0);
- int (*to_watchpoint_addr_within_range) (struct target_ops *,
-- CORE_ADDR, CORE_ADDR, int)
-+ CORE_ADDR, CORE_ADDR, LONGEST)
- TARGET_DEFAULT_FUNC (default_watchpoint_addr_within_range);
-
- /* Documentation of this routine is provided with the corresponding
-@@ -553,7 +553,7 @@ struct target_ops
- TARGET_DEFAULT_FUNC (default_region_ok_for_hw_watchpoint);
-
- int (*to_can_accel_watchpoint_condition) (struct target_ops *,
-- CORE_ADDR, int, int,
-+ CORE_ADDR, LONGEST, int,
- struct expression *)
- TARGET_DEFAULT_RETURN (0);
- int (*to_masked_watch_num_registers) (struct target_ops *,
-Index: gdb-7.10.50.20151027/gdb/aarch64-linux-nat.c
-===================================================================
---- gdb-7.10.50.20151027.orig/gdb/aarch64-linux-nat.c 2015-11-08 10:36:33.074071975 +0100
-+++ gdb-7.10.50.20151027/gdb/aarch64-linux-nat.c 2015-11-08 10:36:33.098072137 +0100
-@@ -795,7 +795,7 @@ aarch64_linux_stopped_by_watchpoint (str
- static int
- aarch64_linux_watchpoint_addr_within_range (struct target_ops *target,
- CORE_ADDR addr,
-- CORE_ADDR start, int length)
-+ CORE_ADDR start, LONGEST length)
- {
- return start <= addr && start + length - 1 >= addr;
- }
-Index: gdb-7.10.50.20151027/gdb/target-delegates.c
-===================================================================
---- gdb-7.10.50.20151027.orig/gdb/target-delegates.c 2015-11-08 10:36:33.073071968 +0100
-+++ gdb-7.10.50.20151027/gdb/target-delegates.c 2015-11-08 10:36:33.099072144 +0100
-@@ -709,14 +709,14 @@ debug_stopped_data_address (struct targe
+diff --git a/gdb/target-delegates.c b/gdb/target-delegates.c
+index 2b449cbf01..f725215fff 100644
+--- a/gdb/target-delegates.c
++++ b/gdb/target-delegates.c
+@@ -733,14 +733,14 @@ debug_stopped_data_address (struct target_ops *self, CORE_ADDR *arg1)
}
static int
@@ -295,7 +368,7 @@ Index: gdb-7.10.50.20151027/gdb/target-delegates.c
{
int result;
fprintf_unfiltered (gdb_stdlog, "-> %s->to_watchpoint_addr_within_range (...)\n", debug_target.to_shortname);
-@@ -728,7 +728,7 @@ debug_watchpoint_addr_within_range (stru
+@@ -752,7 +752,7 @@ debug_watchpoint_addr_within_range (struct target_ops *self, CORE_ADDR arg1, COR
fputs_unfiltered (", ", gdb_stdlog);
target_debug_print_CORE_ADDR (arg2);
fputs_unfiltered (", ", gdb_stdlog);
@@ -304,7 +377,7 @@ Index: gdb-7.10.50.20151027/gdb/target-delegates.c
fputs_unfiltered (") = ", gdb_stdlog);
target_debug_print_int (result);
fputs_unfiltered ("\n", gdb_stdlog);
-@@ -761,20 +761,20 @@ debug_region_ok_for_hw_watchpoint (struc
+@@ -785,20 +785,20 @@ debug_region_ok_for_hw_watchpoint (struct target_ops *self, CORE_ADDR arg1, LONG
}
static int
@@ -328,7 +401,7 @@ Index: gdb-7.10.50.20151027/gdb/target-delegates.c
{
int result;
fprintf_unfiltered (gdb_stdlog, "-> %s->to_can_accel_watchpoint_condition (...)\n", debug_target.to_shortname);
-@@ -784,7 +784,7 @@ debug_can_accel_watchpoint_condition (st
+@@ -808,7 +808,7 @@ debug_can_accel_watchpoint_condition (struct target_ops *self, CORE_ADDR arg1, i
fputs_unfiltered (", ", gdb_stdlog);
target_debug_print_CORE_ADDR (arg1);
fputs_unfiltered (", ", gdb_stdlog);
@@ -337,99 +410,50 @@ Index: gdb-7.10.50.20151027/gdb/target-delegates.c
fputs_unfiltered (", ", gdb_stdlog);
target_debug_print_int (arg3);
fputs_unfiltered (", ", gdb_stdlog);
-Index: gdb-7.10.50.20151027/gdb/nat/aarch64-linux-hw-point.c
-===================================================================
---- gdb-7.10.50.20151027.orig/gdb/nat/aarch64-linux-hw-point.c 2015-10-27 02:48:31.000000000 +0100
-+++ gdb-7.10.50.20151027/gdb/nat/aarch64-linux-hw-point.c 2015-11-08 10:36:33.099072144 +0100
-@@ -111,7 +111,7 @@ aarch64_point_encode_ctrl_reg (enum targ
- Return 0 for any non-compliant ADDR and/or LEN; return 1 otherwise. */
-
- static int
--aarch64_point_is_aligned (int is_watchpoint, CORE_ADDR addr, int len)
-+aarch64_point_is_aligned (int is_watchpoint, CORE_ADDR addr, LONGEST len)
- {
- unsigned int alignment = 0;
-
-@@ -180,9 +180,10 @@ aarch64_point_is_aligned (int is_watchpo
- limitations can be largely relaxed with some further work. */
+diff --git a/gdb/target.c b/gdb/target.c
+index a1ac6d0697..eb0538cb82 100644
+--- a/gdb/target.c
++++ b/gdb/target.c
+@@ -53,7 +53,7 @@ static void generic_tls_error (void) ATTRIBUTE_NORETURN;
+ static void default_terminal_info (struct target_ops *, const char *, int);
- static void
--aarch64_align_watchpoint (CORE_ADDR addr, int len, CORE_ADDR *aligned_addr_p,
-+aarch64_align_watchpoint (CORE_ADDR addr, LONGEST len,
-+ CORE_ADDR *aligned_addr_p,
- int *aligned_len_p, CORE_ADDR *next_addr_p,
-- int *next_len_p)
-+ LONGEST *next_len_p)
- {
- int aligned_len;
- unsigned int offset;
-@@ -494,7 +495,7 @@ aarch64_handle_aligned_watchpoint (enum
+ static int default_watchpoint_addr_within_range (struct target_ops *,
+- CORE_ADDR, CORE_ADDR, int);
++ CORE_ADDR, CORE_ADDR, LONGEST);
+ static int default_region_ok_for_hw_watchpoint (struct target_ops *,
+ CORE_ADDR, LONGEST);
+@@ -3120,7 +3120,7 @@ default_region_ok_for_hw_watchpoint (struct target_ops *self,
static int
- aarch64_handle_unaligned_watchpoint (enum target_hw_bp_type type,
-- CORE_ADDR addr, int len, int is_insert,
-+ CORE_ADDR addr, LONGEST len, int is_insert,
- struct aarch64_debug_reg_state *state)
- {
- while (len > 0)
-@@ -517,9 +518,9 @@ aarch64_handle_unaligned_watchpoint (enu
- " "
- "aligned_addr: %s, aligned_len: %d\n"
- " "
-- "next_addr: %s, next_len: %d\n",
-+ "next_addr: %s, next_len: %s\n",
- is_insert, core_addr_to_string_nz (aligned_addr),
-- aligned_len, core_addr_to_string_nz (addr), len);
-+ aligned_len, core_addr_to_string_nz (addr), plongest (len));
-
- if (ret != 0)
- return ret;
-@@ -530,7 +531,7 @@ aarch64_handle_unaligned_watchpoint (enu
-
- int
- aarch64_handle_watchpoint (enum target_hw_bp_type type, CORE_ADDR addr,
-- int len, int is_insert,
-+ LONGEST len, int is_insert,
- struct aarch64_debug_reg_state *state)
- {
- if (aarch64_point_is_aligned (1 /* is_watchpoint */ , addr, len))
-@@ -581,14 +582,14 @@ aarch64_linux_set_debug_regs (const stru
- void
- aarch64_show_debug_reg_state (struct aarch64_debug_reg_state *state,
- const char *func, CORE_ADDR addr,
-- int len, enum target_hw_bp_type type)
-+ LONGEST len, enum target_hw_bp_type type)
+ default_watchpoint_addr_within_range (struct target_ops *target,
+ CORE_ADDR addr,
+- CORE_ADDR start, int length)
++ CORE_ADDR start, LONGEST length)
{
- int i;
-
- debug_printf ("%s", func);
- if (addr || len)
-- debug_printf (" (addr=0x%08lx, len=%d, type=%s)",
-- (unsigned long) addr, len,
-+ debug_printf (" (addr=0x%08lx, len=%s, type=%s)",
-+ (unsigned long) addr, plongest (len),
- type == hw_write ? "hw-write-watchpoint"
- : (type == hw_read ? "hw-read-watchpoint"
- : (type == hw_access ? "hw-access-watchpoint"
-Index: gdb-7.10.50.20151027/gdb/nat/aarch64-linux-hw-point.h
-===================================================================
---- gdb-7.10.50.20151027.orig/gdb/nat/aarch64-linux-hw-point.h 2015-10-27 02:48:31.000000000 +0100
-+++ gdb-7.10.50.20151027/gdb/nat/aarch64-linux-hw-point.h 2015-11-08 10:36:47.656170839 +0100
-@@ -168,7 +168,7 @@ int aarch64_handle_breakpoint (enum targ
- int len, int is_insert,
- struct aarch64_debug_reg_state *state);
- int aarch64_handle_watchpoint (enum target_hw_bp_type type, CORE_ADDR addr,
-- int len, int is_insert,
-+ LONGEST len, int is_insert,
- struct aarch64_debug_reg_state *state);
-
- void aarch64_linux_set_debug_regs (const struct aarch64_debug_reg_state *state,
-@@ -176,7 +176,7 @@ void aarch64_linux_set_debug_regs (const
-
- void aarch64_show_debug_reg_state (struct aarch64_debug_reg_state *state,
- const char *func, CORE_ADDR addr,
-- int len, enum target_hw_bp_type type);
-+ LONGEST len, enum target_hw_bp_type type);
+ return addr >= start && addr < start + length;
+ }
+diff --git a/gdb/target.h b/gdb/target.h
+index 7a70c3f6da..35eee91a83 100644
+--- a/gdb/target.h
++++ b/gdb/target.h
+@@ -535,7 +535,7 @@ struct target_ops
+ int (*to_stopped_data_address) (struct target_ops *, CORE_ADDR *)
+ TARGET_DEFAULT_RETURN (0);
+ int (*to_watchpoint_addr_within_range) (struct target_ops *,
+- CORE_ADDR, CORE_ADDR, int)
++ CORE_ADDR, CORE_ADDR, LONGEST)
+ TARGET_DEFAULT_FUNC (default_watchpoint_addr_within_range);
- void aarch64_linux_get_debug_reg_capacity (int tid);
+ /* Documentation of this routine is provided with the corresponding
+@@ -545,7 +545,7 @@ struct target_ops
+ TARGET_DEFAULT_FUNC (default_region_ok_for_hw_watchpoint);
+ int (*to_can_accel_watchpoint_condition) (struct target_ops *,
+- CORE_ADDR, int, int,
++ CORE_ADDR, LONGEST, int,
+ struct expression *)
+ TARGET_DEFAULT_RETURN (0);
+ int (*to_masked_watch_num_registers) (struct target_ops *,
+--
+2.14.3
+
diff --git a/gdb-rhbz795424-bitpos-25of25.patch b/gdb-rhbz795424-bitpos-25of25.patch
new file mode 100644
index 0000000..bc3c404
--- /dev/null
+++ b/gdb-rhbz795424-bitpos-25of25.patch
@@ -0,0 +1,153 @@
+From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
+From: Fedora GDB patches <invalid(a)email.com>
+Date: Fri, 27 Oct 2017 21:07:50 +0200
+Subject: Expand fortran array bounds sizes to LONGEST
+
+FileName: gdb-rhbz795424-bitpos-25of25.patch
+
+;; Fix `GDB cannot access struct member whose offset is larger than 256MB'
+;; (RH BZ 795424).
+;;=push
+
+http://sourceware.org/ml/gdb-patches/2012-08/msg00562.html
+
+--MP_/90J7bck2fqDySEX9JkZtaqL
+Content-Type: text/plain; charset=US-ASCII
+Content-Transfer-Encoding: 7bit
+Content-Disposition: inline
+
+Hi,
+
+Range bounds for a gdb type can have LONGEST values for low and high
+bounds. Fortran range bounds functions however use only int. The larger
+ranges don't compile by default on gcc, but it is possible to override
+the check in the compiler by using -fno-range-check. As a result, this
+check is necessary so that we don't print junk in case of an overflow.
+
+Attached patch does this expansion and also includes a test case that
+verifies that the problem is fixed. I have also verified on x86_64 that
+this patch does not cause any regressions.
+
+Regards,
+Siddhesh
+
+gdb/ChangeLog:
+
+ * f-lang.h (f77_get_upperbound): Return LONGEST.
+ (f77_get_lowerbound): Likewise.
+ * f-typeprint.c (f_type_print_varspec_suffix): Expand
+ UPPER_BOUND and LOWER_BOUND to LONGEST. Use plongest to format
+ print them.
+ (f_type_print_base): Expand UPPER_BOUND to LONGEST. Use
+ plongest to format print it.
+ * f-valprint.c (f77_get_lowerbound): Return LONGEST.
+ (f77_get_upperbound): Likewise.
+ (f77_get_dynamic_length_of_aggregate): Expand UPPER_BOUND,
+ LOWER_BOUND to LONGEST.
+ (f77_create_arrayprint_offset_tbl): Likewise.
+
+testsuite/ChangeLog:
+
+ * gdb.fortran/array-bounds.exp: New test case.
+ * gdb.fortran/array-bounds.f: New test case.
+
+--MP_/90J7bck2fqDySEX9JkZtaqL
+Content-Type: text/x-patch
+Content-Transfer-Encoding: 7bit
+Content-Disposition: attachment; filename=f77-bounds.patch
+---
+ gdb/f-lang.h | 4 ++--
+ gdb/f-typeprint.c | 10 +++++-----
+ gdb/f-valprint.c | 4 ++--
+ 3 files changed, 9 insertions(+), 9 deletions(-)
+
+diff --git a/gdb/f-lang.h b/gdb/f-lang.h
+index 9171a13bdf..9ec58f808e 100644
+--- a/gdb/f-lang.h
++++ b/gdb/f-lang.h
+@@ -49,9 +49,9 @@ struct common_block
+ struct symbol *contents[1];
+ };
+
+-extern int f77_get_upperbound (struct type *);
++extern LONGEST f77_get_upperbound (struct type *);
+
+-extern int f77_get_lowerbound (struct type *);
++extern LONGEST f77_get_lowerbound (struct type *);
+
+ extern void f77_get_dynamic_array_length (struct type *);
+
+diff --git a/gdb/f-typeprint.c b/gdb/f-typeprint.c
+index 4f6a0ed09a..c330522913 100644
+--- a/gdb/f-typeprint.c
++++ b/gdb/f-typeprint.c
+@@ -149,7 +149,7 @@ f_type_print_varspec_suffix (struct type *type, struct ui_file *stream,
+ int show, int passed_a_ptr, int demangled_args,
+ int arrayprint_recurse_level, int print_rank_only)
+ {
+- int upper_bound, lower_bound;
++ LONGEST upper_bound, lower_bound;
+
+ /* No static variables are permitted as an error call may occur during
+ execution of this function. */
+@@ -196,7 +196,7 @@ f_type_print_varspec_suffix (struct type *type, struct ui_file *stream,
+ {
+ lower_bound = f77_get_lowerbound (type);
+ if (lower_bound != 1) /* Not the default. */
+- fprintf_filtered (stream, "%d:", lower_bound);
++ fprintf_filtered (stream, "%s:", plongest (lower_bound));
+
+ /* Make sure that, if we have an assumed size array, we
+ print out a warning and print the upperbound as '*'. */
+@@ -206,7 +206,7 @@ f_type_print_varspec_suffix (struct type *type, struct ui_file *stream,
+ else
+ {
+ upper_bound = f77_get_upperbound (type);
+- fprintf_filtered (stream, "%d", upper_bound);
++ fprintf_filtered (stream, "%s", plongest (upper_bound));
+ }
+ }
+
+@@ -278,7 +278,7 @@ void
+ f_type_print_base (struct type *type, struct ui_file *stream, int show,
+ int level)
+ {
+- int upper_bound;
++ LONGEST upper_bound;
+ int index;
+
+ QUIT;
+@@ -365,7 +365,7 @@ f_type_print_base (struct type *type, struct ui_file *stream, int show,
+ else
+ {
+ upper_bound = f77_get_upperbound (type);
+- fprintf_filtered (stream, "character*%d", upper_bound);
++ fprintf_filtered (stream, "character*%s", plongest (upper_bound));
+ }
+ break;
+
+diff --git a/gdb/f-valprint.c b/gdb/f-valprint.c
+index 0772f359f0..03400ae431 100644
+--- a/gdb/f-valprint.c
++++ b/gdb/f-valprint.c
+@@ -41,7 +41,7 @@ LONGEST f77_array_offset_tbl[MAX_FORTRAN_DIMS + 1][2];
+ /* Array which holds offsets to be applied to get a row's elements
+ for a given array. Array also holds the size of each subarray. */
+
+-int
++LONGEST
+ f77_get_lowerbound (struct type *type)
+ {
+ if (TYPE_ARRAY_LOWER_BOUND_IS_UNDEFINED (type))
+@@ -50,7 +50,7 @@ f77_get_lowerbound (struct type *type)
+ return TYPE_ARRAY_LOWER_BOUND_VALUE (type);
+ }
+
+-int
++LONGEST
+ f77_get_upperbound (struct type *type)
+ {
+ if (TYPE_ARRAY_UPPER_BOUND_IS_UNDEFINED (type))
+--
+2.14.3
+
diff --git a/gdb-rhbz795424-bitpos-lazyvalue.patch b/gdb-rhbz795424-bitpos-lazyvalue.patch
index 5f427e7..15a0742 100644
--- a/gdb-rhbz795424-bitpos-lazyvalue.patch
+++ b/gdb-rhbz795424-bitpos-lazyvalue.patch
@@ -1,104 +1,29 @@
-Index: gdb-7.11.50.20160630/gdb/testsuite/gdb.base/longest-types-64bit.exp
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ gdb-7.11.50.20160630/gdb/testsuite/gdb.base/longest-types-64bit.exp 2016-07-03 15:00:57.617347850 +0200
-@@ -0,0 +1,59 @@
-+# This testcase is part of GDB, the GNU debugger.
-+
-+# Copyright 2012 Free Software Foundation, Inc.
-+
-+# This program is free software; you can redistribute it and/or modify
-+# it under the terms of the GNU General Public License as published by
-+# the Free Software Foundation; either version 3 of the License, or
-+# (at your option) any later version.
-+#
-+# This program is distributed in the hope that it will be useful,
-+# but WITHOUT ANY WARRANTY; without even the implied warranty of
-+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+# GNU General Public License for more details.
-+#
-+# You should have received a copy of the GNU General Public License
-+# along with this program. If not, see <http://www.gnu.org/licenses/>.
-+
-+standard_testfile .c longest-types-64bit.S
-+
-+proc test { name } { with_test_prefix $name {
-+ # 64-bit array size should not overflow
-+ gdb_test "print &f->buf" {= \(char \(\*\)\[1099494850560\]\) 0x0}
-+
-+ # The offset should not overflow
-+ gdb_test "print &f->buf2" {= \(char \(\*\)\[2\]\) 0xffff000000}
-+}}
-+
-+
-+# Test 64-bit file first as it is not compiled so its compilation never fails.
-+
-+set file64bitbz2uu ${srcdir}/${subdir}/${testfile}.bz2.uu
-+set file64bit [standard_output_file ${testfile}]
-+
-+if {[catch "system \"uudecode -o - ${file64bitbz2uu} | bzip2 -dc >${file64bit}\""] != 0} {
-+ untested "failed uudecode or bzip2"
-+ return -1
-+}
-+file stat ${file64bit} file64bitstat
-+if {$file64bitstat(size) != 9501} {
-+ untested "uudecode or bzip2 produce invalid result"
-+ return -1
-+}
-+
-+clean_restart ${file64bit}
-+
-+#if { [prepare_for_testing ${testfile}.exp ${testfile} $srcfile2 {nodebug}] } {
-+# return -1
-+#}
-+
-+test "64bit"
-+
-+
-+# And here is the native build test.
-+
-+if { [prepare_for_testing ${testfile}.exp ${testfile} $srcfile {debug quiet}] } {
-+ return -1
-+}
-+
-+test "native"
-Index: gdb-7.11.50.20160630/gdb/testsuite/gdb.base/longest-types-64bit.c
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ gdb-7.11.50.20160630/gdb/testsuite/gdb.base/longest-types-64bit.c 2016-07-03 15:00:57.618347859 +0200
-@@ -0,0 +1,28 @@
-+/* This testcase is part of GDB, the GNU debugger.
-+
-+ Copyright 2012 Free Software Foundation, Inc.
-+
-+ This program is free software; you can redistribute it and/or modify
-+ it under the terms of the GNU General Public License as published by
-+ the Free Software Foundation; either version 3 of the License, or
-+ (at your option) any later version.
-+
-+ This program is distributed in the hope that it will be useful,
-+ but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ GNU General Public License for more details.
-+
-+ You should have received a copy of the GNU General Public License
-+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
-+
-+struct foo
-+{
-+ char buf[0xffff000000];
-+ char buf2[2];
-+} *f;
-+
-+int
-+main (void)
-+{
-+ return 0;
-+}
-Index: gdb-7.11.50.20160630/gdb/testsuite/gdb.base/longest-types-64bit.S
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ gdb-7.11.50.20160630/gdb/testsuite/gdb.base/longest-types-64bit.S 2016-07-03 15:00:57.618347859 +0200
+From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
+From: Fedora GDB patches <invalid(a)email.com>
+Date: Fri, 27 Oct 2017 21:07:50 +0200
+Subject: gdb-rhbz795424-bitpos-lazyvalue.patch
+
+FileName: gdb-rhbz795424-bitpos-lazyvalue.patch
+
+;; Fix `GDB cannot access struct member whose offset is larger than 256MB'
+;; (RH BZ 795424).
+;;=push
+---
+ gdb/testsuite/gdb.base/longest-types-64bit.S | 249 ++++++++++++++++++++++
+ gdb/testsuite/gdb.base/longest-types-64bit.bz2.uu | 67 ++++++
+ gdb/testsuite/gdb.base/longest-types-64bit.c | 28 +++
+ gdb/testsuite/gdb.base/longest-types-64bit.exp | 59 +++++
+ 4 files changed, 403 insertions(+)
+ create mode 100644 gdb/testsuite/gdb.base/longest-types-64bit.S
+ create mode 100644 gdb/testsuite/gdb.base/longest-types-64bit.bz2.uu
+ create mode 100644 gdb/testsuite/gdb.base/longest-types-64bit.c
+ create mode 100644 gdb/testsuite/gdb.base/longest-types-64bit.exp
+
+diff --git a/gdb/testsuite/gdb.base/longest-types-64bit.S b/gdb/testsuite/gdb.base/longest-types-64bit.S
+new file mode 100644
+index 0000000000..336d3fdb7a
+--- /dev/null
++++ b/gdb/testsuite/gdb.base/longest-types-64bit.S
@@ -0,0 +1,249 @@
+/* This testcase is part of GDB, the GNU debugger.
+
@@ -349,10 +274,11 @@ Index: gdb-7.11.50.20160630/gdb/testsuite/gdb.base/longest-types-64bit.S
+ .string "char"
+ .ident "GCC: (GNU) 4.7.3 20121109 (prerelease)"
+ .section .note.GNU-stack,"",@progbits
-Index: gdb-7.11.50.20160630/gdb/testsuite/gdb.base/longest-types-64bit.bz2.uu
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ gdb-7.11.50.20160630/gdb/testsuite/gdb.base/longest-types-64bit.bz2.uu 2016-07-03 15:00:57.618347859 +0200
+diff --git a/gdb/testsuite/gdb.base/longest-types-64bit.bz2.uu b/gdb/testsuite/gdb.base/longest-types-64bit.bz2.uu
+new file mode 100644
+index 0000000000..4007da2917
+--- /dev/null
++++ b/gdb/testsuite/gdb.base/longest-types-64bit.bz2.uu
@@ -0,0 +1,67 @@
+begin 755 gdb.base/longest-types-64bit.bz2
+M0EIH.3%!62936<'N#OH`"G/________^______?_Y______//]7SQD5'^/_%
@@ -421,3 +347,105 @@ Index: gdb-7.11.50.20160630/gdb/testsuite/gdb.base/longest-types-64bit.bz2.uu
+?<55!2^6_8J$)-O<>\H0U/6Q^>UG0%W)%.%"0P>X.^@``
+`
+end
+diff --git a/gdb/testsuite/gdb.base/longest-types-64bit.c b/gdb/testsuite/gdb.base/longest-types-64bit.c
+new file mode 100644
+index 0000000000..1394c08bdc
+--- /dev/null
++++ b/gdb/testsuite/gdb.base/longest-types-64bit.c
+@@ -0,0 +1,28 @@
++/* This testcase is part of GDB, the GNU debugger.
++
++ Copyright 2012 Free Software Foundation, Inc.
++
++ This program is free software; you can redistribute it and/or modify
++ it under the terms of the GNU General Public License as published by
++ the Free Software Foundation; either version 3 of the License, or
++ (at your option) any later version.
++
++ This program is distributed in the hope that it will be useful,
++ but WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++ GNU General Public License for more details.
++
++ You should have received a copy of the GNU General Public License
++ along with this program. If not, see <http://www.gnu.org/licenses/>. */
++
++struct foo
++{
++ char buf[0xffff000000];
++ char buf2[2];
++} *f;
++
++int
++main (void)
++{
++ return 0;
++}
+diff --git a/gdb/testsuite/gdb.base/longest-types-64bit.exp b/gdb/testsuite/gdb.base/longest-types-64bit.exp
+new file mode 100644
+index 0000000000..4871dec72f
+--- /dev/null
++++ b/gdb/testsuite/gdb.base/longest-types-64bit.exp
+@@ -0,0 +1,59 @@
++# This testcase is part of GDB, the GNU debugger.
++
++# Copyright 2012 Free Software Foundation, Inc.
++
++# This program is free software; you can redistribute it and/or modify
++# it under the terms of the GNU General Public License as published by
++# the Free Software Foundation; either version 3 of the License, or
++# (at your option) any later version.
++#
++# This program is distributed in the hope that it will be useful,
++# but WITHOUT ANY WARRANTY; without even the implied warranty of
++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++# GNU General Public License for more details.
++#
++# You should have received a copy of the GNU General Public License
++# along with this program. If not, see <http://www.gnu.org/licenses/>.
++
++standard_testfile .c longest-types-64bit.S
++
++proc test { name } { with_test_prefix $name {
++ # 64-bit array size should not overflow
++ gdb_test "print &f->buf" {= \(char \(\*\)\[1099494850560\]\) 0x0}
++
++ # The offset should not overflow
++ gdb_test "print &f->buf2" {= \(char \(\*\)\[2\]\) 0xffff000000}
++}}
++
++
++# Test 64-bit file first as it is not compiled so its compilation never fails.
++
++set file64bitbz2uu ${srcdir}/${subdir}/${testfile}.bz2.uu
++set file64bit [standard_output_file ${testfile}]
++
++if {[catch "system \"uudecode -o - ${file64bitbz2uu} | bzip2 -dc >${file64bit}\""] != 0} {
++ untested "failed uudecode or bzip2"
++ return -1
++}
++file stat ${file64bit} file64bitstat
++if {$file64bitstat(size) != 9501} {
++ untested "uudecode or bzip2 produce invalid result"
++ return -1
++}
++
++clean_restart ${file64bit}
++
++#if { [prepare_for_testing ${testfile}.exp ${testfile} $srcfile2 {nodebug}] } {
++# return -1
++#}
++
++test "64bit"
++
++
++# And here is the native build test.
++
++if { [prepare_for_testing ${testfile}.exp ${testfile} $srcfile {debug quiet}] } {
++ return -1
++}
++
++test "native"
+--
+2.14.3
+
diff --git a/gdb-stale-frame_info.patch b/gdb-stale-frame_info.patch
index bc42e68..8504aba 100644
--- a/gdb-stale-frame_info.patch
+++ b/gdb-stale-frame_info.patch
@@ -1,5 +1,14 @@
+From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
+From: Fedora GDB patches <invalid(a)email.com>
+Date: Fri, 27 Oct 2017 21:07:50 +0200
+Subject: workaround stale frame_info * (PR 13866)
+
+FileName: gdb-stale-frame_info.patch
+
+;; Workaround crashes from stale frame_info pointer (BZ 804256).
+;;=push+jan
+
http://sourceware.org/ml/gdb-patches/2012-04/msg00058.html
-Subject: [downstream patch FYI] workaround stale frame_info * (PR 13866)
Hi,
@@ -21,39 +30,41 @@ testsuite under valgrind I did not find feasible.
No regressions on {x86_64,x86_64-m32,i686}-fedora17-linux-gnu.
-
Thanks,
Jan
-
gdb/
2012-04-04 Jan Kratochvil <jan.kratochvil(a)redhat.com>
Workaround PR backtrace/13866.
* progspace.c (switch_to_program_space_and_thread): Try not to call
switch_to_thread.
-
---- a/gdb/progspace.c
-+++ b/gdb/progspace.c
-@@ -481,17 +481,28 @@ save_current_space_and_thread (void)
+---
+ gdb/progspace-and-thread.c | 18 ++++++++++++++++--
+ 1 file changed, 16 insertions(+), 2 deletions(-)
+
+diff --git a/gdb/progspace-and-thread.c b/gdb/progspace-and-thread.c
+index 27d626b05f..ee6342d96a 100644
+--- a/gdb/progspace-and-thread.c
++++ b/gdb/progspace-and-thread.c
+@@ -23,15 +23,29 @@
void
- switch_to_program_space_and_thread (struct program_space *pspace)
+ switch_to_program_space_and_thread (program_space *pspace)
{
-- struct inferior *inf;
-+ struct inferior *inf = current_inferior ();
-
-- inf = find_inferior_for_program_space (pspace);
+- inferior *inf = find_inferior_for_program_space (pspace);
++ inferior *inf = current_inferior ();
++
+ if (inf->pspace != pspace)
+ inf = find_inferior_for_program_space (pspace);
+
if (inf != NULL && inf->pid != 0)
{
-- struct thread_info *tp;
-+ struct thread_info *tp, *current_tp = NULL;
+ thread_info *tp = any_live_thread_of_process (inf->pid);
++ thread_info *current_tp = NULL;
+
+ if (ptid_get_pid (inferior_ptid) == inf->pid)
+ current_tp = find_thread_ptid (inferior_ptid);
- tp = any_live_thread_of_process (inf->pid);
if (tp != NULL)
{
- switch_to_thread (tp->ptid);
@@ -68,107 +79,6 @@ gdb/
/* Switching thread switches pspace implicitly. We're
done. */
return;
+--
+2.14.3
-
-Reproducer with:
-./gdb -nx ~/t/thread -ex 'b 24' -ex r -ex 'until 25'
-Breakpoint 1, main () at /home/jkratoch/t/thread.c:24
-24 v++;
-Segmentation fault (core dumped)
-
-#include <pthread.h>
-#include <assert.h>
-#include <unistd.h>
-
-static int v;
-
-static void *start (void *arg)
-{
- v++;
- v++;
- v++;
- v++;
- sleep (100);
- return arg;
-}
-
-int main (void)
-{
- pthread_t thread1;
- int i;
-
- i = pthread_create (&thread1, NULL, start, NULL);
- assert (i == 0);
- v++;
- v++;
- v++;
- v++;
- i = pthread_join (thread1, NULL);
- assert (i == 0);
-
- return 0;
-}
-### --- a/gdb/frame.c
-### +++ b/gdb/frame.c
-### @@ -1522,12 +1522,30 @@ frame_observer_target_changed (struct target_ops *target)
-### reinit_frame_cache ();
-### }
-###
-### +typedef struct obstack obstack_s;
-### +DEF_VEC_O (obstack_s);
-### +static VEC (obstack_s) *frame_poison_vec;
-### +
-### +void frame_garbage_collection (void);
-### +void
-### +frame_garbage_collection (void)
-### +{
-### + struct obstack *obstack_p;
-### + int ix;
-### +
-### + for (ix = 0; VEC_iterate (obstack_s, frame_poison_vec, ix, obstack_p); ix++)
-### + obstack_free (obstack_p, 0);
-### +
-### + VEC_free (obstack_s, frame_poison_vec);
-### + frame_poison_vec = NULL;
-### +}
-### +
-### /* Flush the entire frame cache. */
-###
-### void
-### reinit_frame_cache (void)
-### {
-### - struct frame_info *fi;
-### + struct frame_info *fi, *fi_prev;
-###
-### /* Tear down all frame caches. */
-### for (fi = current_frame; fi != NULL; fi = fi->prev)
-### @@ -1538,8 +1556,14 @@ reinit_frame_cache (void)
-### fi->base->unwind->dealloc_cache (fi, fi->base_cache);
-### }
-###
-### + for (fi = current_frame; fi != NULL; fi = fi_prev)
-### + {
-### + fi_prev = fi->prev;
-### + memset (fi, 0, sizeof (*fi));
-### + }
-### + VEC_safe_push (obstack_s, frame_poison_vec, &frame_cache_obstack);
-### +
-### /* Since we can't really be sure what the first object allocated was. */
-### - obstack_free (&frame_cache_obstack, 0);
-### obstack_init (&frame_cache_obstack);
-###
-### if (current_frame != NULL)
-### --- a/gdb/top.c
-### +++ b/gdb/top.c
-### @@ -359,6 +359,11 @@ prepare_execute_command (void)
-### if (non_stop)
-### target_dcache_invalidate ();
-###
-### + {
-### + extern void frame_garbage_collection (void);
-### + frame_garbage_collection ();
-### + }
-### +
-### return cleanup;
-### }
-###
diff --git a/gdb-tls-1of2.patch b/gdb-tls-1of2.patch
deleted file mode 100644
index ef0d416..0000000
--- a/gdb-tls-1of2.patch
+++ /dev/null
@@ -1,47 +0,0 @@
-http://sourceware.org/ml/gdb-patches/2016-10/msg00206.html
-Subject: [patch+7.12.1 1/2] Code cleanup: write_exp_msymbol: +is_tls
-
-
---XMCwj5IQnwKtuyBG
-Content-Type: text/plain; charset=us-ascii
-Content-Disposition: inline
-
-Hi,
-
-no functionality change, for patch 2/2.
-
-
-Jan
-
---XMCwj5IQnwKtuyBG
-Content-Type: text/plain; charset=us-ascii
-Content-Disposition: inline; filename="tls1.patch"
-
-gdb/ChangeLog
-2016-10-09 Jan Kratochvil <jan.kratochvil(a)redhat.com>
-
- * parse.c (write_exp_msymbol): New variable is_tls, use it.
-
---- a/gdb/parse.c
-+++ b/gdb/parse.c
-@@ -484,6 +484,8 @@ write_exp_msymbol (struct parser_state *ps,
- struct obj_section *section = MSYMBOL_OBJ_SECTION (objfile, msymbol);
- enum minimal_symbol_type type = MSYMBOL_TYPE (msymbol);
- CORE_ADDR pc;
-+ const int is_tls = (section != NULL
-+ && section->the_bfd_section->flags & SEC_THREAD_LOCAL);
-
- /* The minimal symbol might point to a function descriptor;
- resolve it to the actual code address instead. */
-@@ -520,7 +522,7 @@ write_exp_msymbol (struct parser_state *ps,
- write_exp_elt_longcst (ps, (LONGEST) addr);
- write_exp_elt_opcode (ps, OP_LONG);
-
-- if (section && section->the_bfd_section->flags & SEC_THREAD_LOCAL)
-+ if (is_tls)
- {
- write_exp_elt_opcode (ps, UNOP_MEMVAL_TLS);
- write_exp_elt_objfile (ps, objfile);
-
---XMCwj5IQnwKtuyBG--
-
diff --git a/gdb-tls-2of2.patch b/gdb-tls-2of2.patch
deleted file mode 100644
index 3d97cb8..0000000
--- a/gdb-tls-2of2.patch
+++ /dev/null
@@ -1,159 +0,0 @@
-http://sourceware.org/ml/gdb-patches/2016-10/msg00207.html
-Subject: [patch+7.12.1 2/2] Fix TLS (such as 'errno') regression
-
-
---3Pql8miugIZX0722
-Content-Type: text/plain; charset=us-ascii
-Content-Disposition: inline
-
-Hi,
-
-2273f0ac95a79ce29ef42025c63f90e82cf907d7 is the first bad commit
-commit 2273f0ac95a79ce29ef42025c63f90e82cf907d7
-Author: Tom Tromey <tromey(a)redhat.com>
-Date: Tue Oct 15 13:28:57 2013 -0600
- change minsyms not to be relocated at read-time
-[FYI v3 06/10] change minsyms not to be relocated at read-time
-Message-Id: <1393441273-32268-7-git-send-email-tromey(a)redhat.com>
-https://sourceware.org/ml/gdb-patches/2014-02/msg00798.html
-
-mv /usr/lib/debug /usr/lib/debug-x
-echo 'int main(){}'|gcc -pthread -x c -
-./gdb -q -ex start -ex 'set debug expr 1' -ex 'p errno' ./a.out
- 0 UNOP_MEMVAL_TLS TLS type @0x35df7e0 (__thread /* "/lib64/libc.so.6" */ <thread local variable, no debug info>)
- 4 OP_LONG Type @0x35df850 (__CORE_ADDR), value 140737345728528 (0x7ffff77fb010)
-Cannot access memory at address 0xffffef7c9698
-->
- 0 UNOP_MEMVAL_TLS TLS type @0x3ad9520 (__thread /* "/lib64/libc.so.6" */ <thread local variable, no debug info>)
- 4 OP_LONG Type @0x3ad9590 (__CORE_ADDR), value 16 (0x10)
-$1 = 0
-
-With glibc debuginfo, that is without: mv /usr/lib/debug /usr/lib/debug-x
- 0 OP_VAR_VALUE Block @0x3b30e70, symbol @0x3b30d10 (errno)
-$1 = 0
-So such case is unrelated to this patch and the regression is not visible with
-glibc debuginfo installed.
-
-I guess all these issues will be solved by Gary Benson's Infinity.
-But at least for older non-Infinity glibcs GDB should not regress.
-
-For the testcase it is important the variable is in objfile with non-zero base
-address. glibc is a shared library for 'errno' but I found easier for the
-testcase to use PIE instead of a shlib. For TLS variables in PT_EXEC the
-regression obviously does not happen.
-
-It has been found by a more complete testcase present in Fedora, the fix there
-also solves more cases where FSF GDB currently cannot resolve 'errno':
- http://pkgs.fedoraproject.org/cgit/rpms/gdb.git/tree/gdb-6.5-bz185337-res...
- FAIL: gdb.dwarf2/dw2-errno2.exp: macros=N threads=Y: print errno for core
-
-No regressions on {x86_64,x86_64-m32,i686}-fedora26pre-linux-gnu.
-
-OK for check-in?
-
-
-Thanks,
-Jan
-
---3Pql8miugIZX0722
-Content-Type: text/plain; charset=us-ascii
-Content-Disposition: inline; filename="tls1-2.patch"
-
-gdb/ChangeLog
-2016-10-09 Jan Kratochvil <jan.kratochvil(a)redhat.com>
-
- * parse.c (write_exp_msymbol): Fix ADDR computation.
-
-gdb/testsuite/ChangeLog
-2016-10-09 Jan Kratochvil <jan.kratochvil(a)redhat.com>
-
- * gdb.threads/tls-nodebug-pie.c: New file.
- * gdb.threads/tls-nodebug-pie.exp: New file.
-
---- a/gdb/parse.c
-+++ b/gdb/parse.c
-@@ -480,13 +480,17 @@ write_exp_msymbol (struct parser_state *ps,
- struct objfile *objfile = bound_msym.objfile;
- struct gdbarch *gdbarch = get_objfile_arch (objfile);
-
-- CORE_ADDR addr = BMSYMBOL_VALUE_ADDRESS (bound_msym);
- struct obj_section *section = MSYMBOL_OBJ_SECTION (objfile, msymbol);
- enum minimal_symbol_type type = MSYMBOL_TYPE (msymbol);
-- CORE_ADDR pc;
-+ CORE_ADDR addr, pc;
- const int is_tls = (section != NULL
- && section->the_bfd_section->flags & SEC_THREAD_LOCAL);
-
-+ if (is_tls)
-+ addr = MSYMBOL_VALUE_RAW_ADDRESS (bound_msym.minsym);
-+ else
-+ addr = BMSYMBOL_VALUE_ADDRESS (bound_msym);
-+
- /* The minimal symbol might point to a function descriptor;
- resolve it to the actual code address instead. */
- pc = gdbarch_convert_from_func_ptr_addr (gdbarch, addr, ¤t_target);
---- /dev/null
-+++ b/gdb/testsuite/gdb.threads/tls-nodebug-pie.c
-@@ -0,0 +1,27 @@
-+/* This testcase is part of GDB, the GNU debugger.
-+
-+ Copyright 2016 Free Software Foundation, Inc.
-+
-+ This program is free software; you can redistribute it and/or modify
-+ it under the terms of the GNU General Public License as published by
-+ the Free Software Foundation; either version 3 of the License, or
-+ (at your option) any later version.
-+
-+ This program is distributed in the hope that it will be useful,
-+ but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ GNU General Public License for more details.
-+
-+ You should have received a copy of the GNU General Public License
-+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
-+
-+#include <pthread.h>
-+
-+__thread int thread_local = 42;
-+
-+int main(void)
-+{
-+ /* Ensure we link against pthreads even with --as-needed. */
-+ pthread_testcancel();
-+ return 0;
-+}
---- /dev/null
-+++ b/gdb/testsuite/gdb.threads/tls-nodebug-pie.exp
-@@ -0,0 +1,29 @@
-+# Copyright 2016 Free Software Foundation, Inc.
-+
-+# This program is free software; you can redistribute it and/or modify
-+# it under the terms of the GNU General Public License as published by
-+# the Free Software Foundation; either version 3 of the License, or
-+# (at your option) any later version.
-+#
-+# This program is distributed in the hope that it will be useful,
-+# but WITHOUT ANY WARRANTY; without even the implied warranty of
-+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+# GNU General Public License for more details.
-+#
-+# You should have received a copy of the GNU General Public License
-+# along with this program. If not, see <http://www.gnu.org/licenses/>.
-+
-+standard_testfile
-+
-+if {[gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable \
-+ [list "additional_flags=-fPIE -pie"]] != "" } {
-+ return -1
-+}
-+
-+clean_restart ${binfile}
-+if ![runto_main] then {
-+ return 0
-+}
-+
-+# Formerly: Cannot access memory at address 0xd5554d5216fc
-+gdb_test "p thread_local" " = 42" "thread local storage"
-
---3Pql8miugIZX0722--
-
diff --git a/gdb-vla-intel-fix-print-char-array.patch b/gdb-vla-intel-fix-print-char-array.patch
new file mode 100644
index 0000000..76cd70f
--- /dev/null
+++ b/gdb-vla-intel-fix-print-char-array.patch
@@ -0,0 +1,72 @@
+From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
+From: Sergio Durigan Junior <sergiodj(a)redhat.com>
+Date: Thu, 7 Dec 2017 16:20:31 -0500
+Subject: gdb-vla-intel-fix-print-char-array.patch
+
+FileName: gdb-vla-intel-fix-print-char-array.patch
+
+;; Revert upstream commit 469412dd9ccc4de5874fd3299b105833f36b34cd
+
+Revert commit (only the part touching gdb/f-valprint.c):
+
+ commit 469412dd9ccc4de5874fd3299b105833f36b34cd
+ Author: Christoph Weinmann <christoph.t.weinmann(a)intel.com>
+ Date: Fri Sep 8 15:11:47 2017 +0200
+
+ Remove C/C++ relevant code in Fortran specific file.
+
+ Remove code relevant for printing C/C++ Integer values in a
+ Fortran specific file to unify printing of Fortran values.
+ This does not change the output.
+
+And adjust its testcase.
+---
+ gdb/f-valprint.c | 18 ++++++++++++++++--
+ gdb/testsuite/gdb.fortran/printing-types.exp | 2 +-
+ 2 files changed, 17 insertions(+), 3 deletions(-)
+
+diff --git a/gdb/f-valprint.c b/gdb/f-valprint.c
+index 03400ae431..aa33d848d6 100644
+--- a/gdb/f-valprint.c
++++ b/gdb/f-valprint.c
+@@ -313,8 +313,22 @@ f_val_print (struct type *type, LONGEST embedded_offset,
+ original_value, &opts, 0, stream);
+ }
+ else
+- val_print_scalar_formatted (type, embedded_offset,
+- original_value, options, 0, stream);
++ {
++ val_print_scalar_formatted (type, embedded_offset,
++ original_value, options, 0, stream);
++ /* C and C++ has no single byte int type, char is used instead.
++ Since we don't know whether the value is really intended to
++ be used as an integer or a character, print the character
++ equivalent as well. */
++ if (TYPE_LENGTH (type) == 1)
++ {
++ LONGEST c;
++
++ fputs_filtered (" ", stream);
++ c = unpack_long (type, valaddr + embedded_offset);
++ LA_PRINT_CHAR ((unsigned char) c, type, stream);
++ }
++ }
+ break;
+
+ case TYPE_CODE_STRUCT:
+diff --git a/gdb/testsuite/gdb.fortran/printing-types.exp b/gdb/testsuite/gdb.fortran/printing-types.exp
+index 9237907ed6..dbd0666422 100644
+--- a/gdb/testsuite/gdb.fortran/printing-types.exp
++++ b/gdb/testsuite/gdb.fortran/printing-types.exp
+@@ -29,7 +29,7 @@ if {![runto MAIN__]} then {
+ gdb_breakpoint [gdb_get_line_number "write"]
+ gdb_continue_to_breakpoint "write"
+
+-gdb_test "print oneByte" " = 1"
++gdb_test "print oneByte" " = 1 \'\\\\001\'"
+ gdb_test "print twobytes" " = 2"
+ gdb_test "print chvalue" " = \'a\'"
+ gdb_test "print logvalue" " = \.TRUE\."
+--
+2.14.3
+
diff --git a/gdb-vla-intel-fortran-strides.patch b/gdb-vla-intel-fortran-strides.patch
new file mode 100644
index 0000000..fc77bf5
--- /dev/null
+++ b/gdb-vla-intel-fortran-strides.patch
@@ -0,0 +1,2021 @@
+From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
+From: Fedora GDB patches <invalid(a)email.com>
+Date: Fri, 27 Oct 2017 21:07:50 +0200
+Subject: gdb-vla-intel-fortran-strides.patch
+
+FileName: gdb-vla-intel-fortran-strides.patch
+
+;; VLA (Fortran dynamic arrays) from Intel + archer-jankratochvil-vla tests.
+;;=push
+
+git diff --stat -p gdb/master...gdb/users/bheckel/fortran-strides
+dbfd7140bf4c0500d1f5d192be781f83f78f7922
+
+ gdb/dwarf2loc.c | 46 ++-
+ gdb/dwarf2loc.h | 6 +
+ gdb/dwarf2read.c | 13 +-
+ gdb/eval.c | 391 +++++++++++++++++++++-----
+ gdb/expprint.c | 20 +-
+ gdb/expression.h | 18 +-
+ gdb/f-exp.y | 42 ++-
+ gdb/f-valprint.c | 8 +-
+ gdb/gdbtypes.c | 34 ++-
+ gdb/gdbtypes.h | 18 +-
+ gdb/parse.c | 24 +-
+ gdb/rust-exp.y | 12 +-
+ gdb/rust-lang.c | 17 +-
+ gdb/testsuite/gdb.fortran/static-arrays.exp | 421 ++++++++++++++++++++++++++++
+ gdb/testsuite/gdb.fortran/static-arrays.f90 | 55 ++++
+ gdb/testsuite/gdb.fortran/vla-ptype.exp | 4 +
+ gdb/testsuite/gdb.fortran/vla-sizeof.exp | 4 +
+ gdb/testsuite/gdb.fortran/vla-stride.exp | 44 +++
+ gdb/testsuite/gdb.fortran/vla-stride.f90 | 29 ++
+ gdb/testsuite/gdb.fortran/vla.f90 | 10 +
+ gdb/valarith.c | 10 +-
+ gdb/valops.c | 197 +++++++++++--
+ gdb/value.h | 2 +
+ 23 files changed, 1242 insertions(+), 183 deletions(-)
+---
+ gdb/dwarf2loc.c | 46 ++-
+ gdb/dwarf2loc.h | 6 +
+ gdb/dwarf2read.c | 13 +-
+ gdb/eval.c | 391 +++++++++++++++++++++-----
+ gdb/expprint.c | 20 +-
+ gdb/expression.h | 18 +-
+ gdb/f-exp.y | 42 ++-
+ gdb/f-valprint.c | 8 +-
+ gdb/gdbtypes.c | 34 ++-
+ gdb/gdbtypes.h | 18 +-
+ gdb/parse.c | 24 +-
+ gdb/rust-exp.y | 12 +-
+ gdb/rust-lang.c | 17 +-
+ gdb/testsuite/gdb.fortran/static-arrays.exp | 421 ++++++++++++++++++++++++++++
+ gdb/testsuite/gdb.fortran/static-arrays.f90 | 55 ++++
+ gdb/testsuite/gdb.fortran/vla-ptype.exp | 4 +
+ gdb/testsuite/gdb.fortran/vla-sizeof.exp | 4 +
+ gdb/testsuite/gdb.fortran/vla-stride.exp | 44 +++
+ gdb/testsuite/gdb.fortran/vla-stride.f90 | 29 ++
+ gdb/testsuite/gdb.fortran/vla.f90 | 10 +
+ gdb/valarith.c | 10 +-
+ gdb/valops.c | 199 +++++++++++--
+ gdb/value.h | 2 +
+ 23 files changed, 1245 insertions(+), 182 deletions(-)
+ create mode 100644 gdb/testsuite/gdb.fortran/static-arrays.exp
+ create mode 100644 gdb/testsuite/gdb.fortran/static-arrays.f90
+ create mode 100644 gdb/testsuite/gdb.fortran/vla-stride.exp
+ create mode 100644 gdb/testsuite/gdb.fortran/vla-stride.f90
+
+diff --git a/gdb/dwarf2loc.c b/gdb/dwarf2loc.c
+index 51f133f1b5..5105c8d23a 100644
+--- a/gdb/dwarf2loc.c
++++ b/gdb/dwarf2loc.c
+@@ -2601,11 +2601,14 @@ dwarf2_locexpr_baton_eval (const struct dwarf2_locexpr_baton *dlbaton,
+ /* See dwarf2loc.h. */
+
+ int
+-dwarf2_evaluate_property (const struct dynamic_prop *prop,
++dwarf2_evaluate_property_signed (const struct dynamic_prop *prop,
+ struct frame_info *frame,
+ struct property_addr_info *addr_stack,
+- CORE_ADDR *value)
++ CORE_ADDR *value,
++ int is_signed)
+ {
++ int rc = 0;
++
+ if (prop == NULL)
+ return 0;
+
+@@ -2629,7 +2632,7 @@ dwarf2_evaluate_property (const struct dynamic_prop *prop,
+
+ *value = value_as_address (val);
+ }
+- return 1;
++ rc = 1;
+ }
+ }
+ break;
+@@ -2651,7 +2654,7 @@ dwarf2_evaluate_property (const struct dynamic_prop *prop,
+ if (!value_optimized_out (val))
+ {
+ *value = value_as_address (val);
+- return 1;
++ rc = 1;
+ }
+ }
+ }
+@@ -2659,8 +2662,8 @@ dwarf2_evaluate_property (const struct dynamic_prop *prop,
+
+ case PROP_CONST:
+ *value = prop->data.const_val;
+- return 1;
+-
++ rc = 1;
++ break;
+ case PROP_ADDR_OFFSET:
+ {
+ struct dwarf2_property_baton *baton
+@@ -2681,11 +2684,38 @@ dwarf2_evaluate_property (const struct dynamic_prop *prop,
+ val = value_at (baton->offset_info.type,
+ pinfo->addr + baton->offset_info.offset);
+ *value = value_as_address (val);
+- return 1;
++ rc = 1;
+ }
++ break;
+ }
+
+- return 0;
++ if (rc == 1 && is_signed == 1)
++ {
++ /* If we have a valid return candidate and it's value is signed,
++ we have to sign-extend the value because CORE_ADDR on 64bit machine has
++ 8 bytes but address size of an 32bit application is 4 bytes. */
++ struct gdbarch * gdbarch = target_gdbarch ();
++ const int addr_bit = gdbarch_addr_bit (gdbarch);
++ const CORE_ADDR neg_mask = ((~0) << (addr_bit - 1));
++
++ /* Check if signed bit is set and sign-extend values. */
++ if (*value & (neg_mask))
++ *value |= (neg_mask );
++ }
++ return rc;
++}
++
++int
++dwarf2_evaluate_property (const struct dynamic_prop *prop,
++ struct frame_info *frame,
++ struct property_addr_info *addr_stack,
++ CORE_ADDR *value)
++{
++ return dwarf2_evaluate_property_signed (prop,
++ frame,
++ addr_stack,
++ value,
++ 0);
+ }
+
+ /* See dwarf2loc.h. */
+diff --git a/gdb/dwarf2loc.h b/gdb/dwarf2loc.h
+index f82e7b2d11..74f0597359 100644
+--- 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
+index a3028e5c52..59e749e416 100644
+--- a/gdb/dwarf2read.c
++++ b/gdb/dwarf2read.c
+@@ -17553,7 +17553,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;
+@@ -17573,7 +17573,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. */
+@@ -17606,6 +17608,13 @@ read_subrange_type (struct die_info *die, struct dwarf2_cu *cu)
+ break;
+ }
+
++ attr = dwarf2_attr (die, DW_AT_byte_stride, cu);
++ if (attr)
++ if (!attr_to_dynamic_prop (attr, die, cu, &stride))
++ complaint (&symfile_complaints, _("Missing DW_AT_byte_stride "
++ "- DIE at 0x%x [in module %s]"),
++ to_underlying (die->sect_off), objfile_name (cu->objfile));
++
+ attr = dwarf2_attr (die, DW_AT_lower_bound, cu);
+ if (attr)
+ attr_to_dynamic_prop (attr, die, cu, &low);
+@@ -17682,7 +17691,7 @@ read_subrange_type (struct die_info *die, struct dwarf2_cu *cu)
+ && !TYPE_UNSIGNED (base_type) && (high.data.const_val & negative_mask))
+ high.data.const_val |= negative_mask;
+
+- range_type = create_range_type (NULL, orig_base_type, &low, &high);
++ range_type = create_range_type (NULL, orig_base_type, &low, &high, &stride);
+
+ if (high_bound_is_count)
+ TYPE_RANGE_DATA (range_type)->flag_upper_bound_is_count = 1;
+diff --git a/gdb/eval.c b/gdb/eval.c
+index 6f74c41b9f..d9bca2791d 100644
+--- a/gdb/eval.c
++++ b/gdb/eval.c
+@@ -384,29 +384,325 @@ init_array_element (struct value *array, struct value *element,
+ return index;
+ }
+
++/* Evaluates any operation on Fortran arrays or strings with at least
++ one user provided parameter. Expects the input ARRAY to be either
++ an array, or a string. Evaluates EXP by incrementing POS, and
++ writes the content from the elt stack into a local struct. NARGS
++ specifies number of literal or range arguments the user provided.
++ NARGS must be the same number as ARRAY has dimensions. */
++
+ static struct value *
+-value_f90_subarray (struct value *array,
+- struct expression *exp, int *pos, enum noside noside)
++value_f90_subarray (struct value *array, struct expression *exp,
++ int *pos, int nargs, enum noside noside)
+ {
+- int pc = (*pos) + 1;
++ int i, dim_count = 0;
+ LONGEST low_bound, high_bound;
+- struct type *range = check_typedef (TYPE_INDEX_TYPE (value_type (array)));
+- enum range_type range_type
+- = (enum range_type) longest_to_int (exp->elts[pc].longconst);
+-
+- *pos += 3;
+-
+- if (range_type == LOW_BOUND_DEFAULT || range_type == BOTH_BOUND_DEFAULT)
+- low_bound = TYPE_LOW_BOUND (range);
+- else
+- low_bound = value_as_long (evaluate_subexp (NULL_TYPE, exp, pos, noside));
++ struct value *new_array = array;
++ struct type *array_type = check_typedef (value_type (new_array));
++ struct type *elt_type;
++
++ typedef struct subscript_range
++ {
++ enum range_type f90_range_type;
++ LONGEST low, high, stride;
++ } subscript_range;
++
++ typedef enum subscript_kind
++ {
++ SUBSCRIPT_RANGE, /* e.g. "(lowbound:highbound)" */
++ SUBSCRIPT_INDEX /* e.g. "(literal)" */
++ } kind;
++
++ /* Local struct to hold user data for Fortran subarray dimensions. */
++ struct subscript_store
++ {
++ /* For every dimension, we are either working on a range or an index
++ expression, so we store this info separately for later. */
++ enum subscript_kind kind;
++
++ /* We also store either the lower and upper bound info, or the index
++ number. Before evaluation of the input values, we do not know if we are
++ actually working on a range of ranges, or an index in a range. So as a
++ first step we store all input in a union. The array calculation itself
++ deals with this later on. */
++ union element_range
++ {
++ subscript_range range;
++ LONGEST number;
++ } U;
++ } *subscript_array;
++
++ /* Check if the number of arguments provided by the user matches
++ the number of dimension of the array. A string has only one
++ dimension. */
++ if (nargs != calc_f77_array_dims (value_type (new_array)))
++ error (_("Wrong number of subscripts"));
++
++ subscript_array = (struct subscript_store*) alloca (sizeof (*subscript_array) * nargs);
++
++ /* Parse the user input into the SUBSCRIPT_ARRAY to store it. We need
++ to evaluate it first, as the input is from left-to-right. The
++ array is stored from right-to-left. So we have to use the user
++ input in reverse order. Later on, we need the input information to
++ re-calculate the output array. For multi-dimensional arrays, we
++ can be dealing with any possible combination of ranges and indices
++ for every dimension. */
++ for (i = 0; i < nargs; i++)
++ {
++ struct subscript_store *index = &subscript_array[i];
+
+- if (range_type == HIGH_BOUND_DEFAULT || range_type == BOTH_BOUND_DEFAULT)
+- high_bound = TYPE_HIGH_BOUND (range);
+- else
+- high_bound = value_as_long (evaluate_subexp (NULL_TYPE, exp, pos, noside));
++ /* The user input is a range, with or without lower and upper bound.
++ E.g.: "p arry(2:5)", "p arry( :5)", "p arry( : )", etc. */
++ if (exp->elts[*pos].opcode == OP_RANGE)
++ {
++ int pc = (*pos) + 1;
++ subscript_range *range;
++
++ index->kind = SUBSCRIPT_RANGE;
++ range = &index->U.range;
++
++ *pos += 3;
++ range->f90_range_type = (enum range_type) exp->elts[pc].longconst;
++
++ /* If a lower bound was provided by the user, the bit has been
++ set and we can assign the value from the elt stack. Same for
++ upper bound. */
++ if ((range->f90_range_type & SUBARRAY_LOW_BOUND)
++ == SUBARRAY_LOW_BOUND)
++ range->low = value_as_long (evaluate_subexp (NULL_TYPE, exp,
++ pos, noside));
++ if ((range->f90_range_type & SUBARRAY_HIGH_BOUND)
++ == SUBARRAY_HIGH_BOUND)
++ range->high = value_as_long (evaluate_subexp (NULL_TYPE, exp,
++ pos, noside));
++
++ /* Assign the user's stride value if provided. */
++ if ((range->f90_range_type & SUBARRAY_STRIDE) == SUBARRAY_STRIDE)
++ range->stride = value_as_long (evaluate_subexp (NULL_TYPE, exp,
++ pos, noside));
++
++ /* Assign the default stride value '1'. */
++ else
++ range->stride = 1;
++
++ /* Check the provided stride value is illegal, aka '0'. */
++ if (range->stride == 0)
++ error (_("Stride must not be 0"));
++ }
++ /* User input is an index. E.g.: "p arry(5)". */
++ else
++ {
++ struct value *val;
++
++ index->kind = SUBSCRIPT_INDEX;
++
++ /* Evaluate each subscript; it must be a legal integer in F77. This
++ ensures the validity of the provided index. */
++ val = evaluate_subexp_with_coercion (exp, pos, noside);
++ index->U.number = value_as_long (val);
++ }
++
++ }
++
++ /* Traverse the array from right to left and set the high and low bounds
++ for later use. */
++ for (i = nargs - 1; i >= 0; i--)
++ {
++ struct subscript_store *index = &subscript_array[i];
++ struct type *index_type = TYPE_INDEX_TYPE (array_type);
++
++ switch (index->kind)
++ {
++ case SUBSCRIPT_RANGE:
++ {
++
++ /* When we hit the first range specified by the user, we must
++ treat any subsequent user entry as a range. We simply
++ increment DIM_COUNT which tells us how many times we are
++ calling VALUE_SLICE_1. */
++ subscript_range *range = &index->U.range;
++
++ /* If no lower bound was provided by the user, we take the
++ default boundary. Same for the high bound. */
++ if ((range->f90_range_type & SUBARRAY_LOW_BOUND) == 0)
++ range->low = TYPE_LOW_BOUND (index_type);
++
++ if ((range->f90_range_type & SUBARRAY_HIGH_BOUND) == 0)
++ range->high = TYPE_HIGH_BOUND (index_type);
++
++ /* Both user provided low and high bound have to be inside the
++ array bounds. Throw an error if not. */
++ if (range->low < TYPE_LOW_BOUND (index_type)
++ || range->low > TYPE_HIGH_BOUND (index_type)
++ || range->high < TYPE_LOW_BOUND (index_type)
++ || range->high > TYPE_HIGH_BOUND (index_type))
++ error (_("provided bound(s) outside array bound(s)"));
++
++ /* For a negative stride the lower boundary must be larger than the
++ upper boundary.
++ For a positive stride the lower boundary must be smaller than the
++ upper boundary. */
++ if ((range->stride < 0 && range->low < range->high)
++ || (range->stride > 0 && range->low > range->high))
++ error (_("Wrong value provided for stride and boundaries"));
++
++ }
++ break;
++
++ case SUBSCRIPT_INDEX:
++ break;
++
++ }
++
++ array_type = TYPE_TARGET_TYPE (array_type);
++ }
++
++ /* Reset ARRAY_TYPE before slicing.*/
++ array_type = check_typedef (value_type (new_array));
++
++ /* Traverse the array from right to left and evaluate each corresponding
++ user input. VALUE_SUBSCRIPT is called for every index, until a range
++ expression is evaluated. After a range expression has been evaluated,
++ every subsequent expression is also treated as a range. */
++ for (i = nargs - 1; i >= 0; i--)
++ {
++ struct subscript_store *index = &subscript_array[i];
++ struct type *index_type = TYPE_INDEX_TYPE (array_type);
++
++ switch (index->kind)
++ {
++ case SUBSCRIPT_RANGE:
++ {
++
++ /* When we hit the first range specified by the user, we must
++ treat any subsequent user entry as a range. We simply
++ increment DIM_COUNT which tells us how many times we are
++ calling VALUE_SLICE_1. */
++ subscript_range *range = &index->U.range;
++
++ /* DIM_COUNT counts every user argument that is treated as a range.
++ This is necessary for expressions like 'print array(7, 8:9).
++ Here the first argument is a literal, but must be treated as a
++ range argument to allow the correct output representation. */
++ dim_count++;
++
++ new_array
++ = value_slice_1 (new_array, range->low,
++ range->high - range->low + 1,
++ range->stride, dim_count);
++ }
++ break;
++
++ case SUBSCRIPT_INDEX:
++ {
++ /* DIM_COUNT only stays '0' when no range argument was processed
++ before, starting from the last dimension. This way we can
++ reduce the number of dimensions from the result array.
++ However, if a range has been processed before an index, we
++ treat the index like a range with equal low- and high bounds
++ to get the value offset right. */
++ if (dim_count == 0)
++ new_array
++ = value_subscripted_rvalue (new_array, index->U.number,
++ f77_get_lowerbound (value_type
++ (new_array)));
++ else
++ {
++ dim_count++;
++
++ /* We might end up here, because we have to treat the provided
++ index like a range. But now VALUE_SUBSCRIPTED_RVALUE
++ cannot do the range checks for us. So we have to make sure
++ ourselves that the user provided index is inside the
++ array bounds. Throw an error if not. */
++ if (index->U.number < TYPE_LOW_BOUND (index_type)
++ && index->U.number > TYPE_HIGH_BOUND (index_type))
++ error (_("provided bound(s) outside array bound(s)"));
++
++ if (index->U.number > TYPE_LOW_BOUND (index_type)
++ && index->U.number > TYPE_HIGH_BOUND (index_type))
++ error (_("provided bound(s) outside array bound(s)"));
++
++ new_array = value_slice_1 (new_array,
++ index->U.number,
++ 1, /* COUNT is '1' element */
++ 1, /* STRIDE set to '1' */
++ dim_count);
++ }
++
++ }
++ break;
++ }
++ array_type = TYPE_TARGET_TYPE (array_type);
++ }
++
++ /* With DIM_COUNT > 1 we currently have a one dimensional array, but expect
++ an array of arrays, depending on how many ranges have been provided by
++ the user. So we need to rebuild the array dimensions for printing it
++ correctly.
++ Starting from right to left in the user input, after we hit the first
++ range argument every subsequent argument is also treated as a range.
++ E.g.:
++ "p ary(3, 7, 2:15)" in Fortran has only 1 dimension, but we calculated 3
++ ranges.
++ "p ary(3, 7:12, 4)" in Fortran has only 1 dimension, but we calculated 2
++ ranges.
++ "p ary(2:4, 5, 7)" in Fortran has only 1 dimension, and we calculated 1
++ range. */
++ if (dim_count > 1)
++ {
++ struct value *v = NULL;
++
++ elt_type = TYPE_TARGET_TYPE (value_type (new_array));
++
++ /* Every SUBSCRIPT_RANGE in the user input signifies an actual range in
++ the output array. So we traverse the SUBSCRIPT_ARRAY again, looking
++ for a range entry. When we find one, we use the range info to create
++ an additional range_type to set the correct bounds and dimensions for
++ the output array. In addition, we may have a stride value that is not
++ '1', forcing us to adjust the number of elements in a range, according
++ to the stride value. */
++ for (i = 0; i < nargs; i++)
++ {
++ struct subscript_store *index = &subscript_array[i];
++
++ if (index->kind == SUBSCRIPT_RANGE)
++ {
++ struct type *range_type, *interim_array_type;
++
++ int new_length;
+
+- return value_slice (array, low_bound, high_bound - low_bound + 1);
++ /* The length of a sub-dimension with all elements between the
++ bounds plus the start element itself. It may be modified by
++ a user provided stride value. */
++ new_length = index->U.range.high - index->U.range.low;
++
++ new_length /= index->U.range.stride;
++
++ range_type
++ = create_static_range_type (NULL,
++ elt_type,
++ index->U.range.low,
++ index->U.range.low + new_length);
++
++ interim_array_type = create_array_type (NULL,
++ elt_type,
++ range_type);
++
++ TYPE_CODE (interim_array_type)
++ = TYPE_CODE (value_type (new_array));
++
++ v = allocate_value (interim_array_type);
++
++ elt_type = value_type (v);
++ }
++
++ }
++ value_contents_copy (v, 0, new_array, 0, TYPE_LENGTH (elt_type));
++ return v;
++ }
++
++ return new_array;
+ }
+
+
+@@ -1928,19 +2224,8 @@ evaluate_subexp_standard (struct type *expect_type,
+ switch (code)
+ {
+ case TYPE_CODE_ARRAY:
+- if (exp->elts[*pos].opcode == OP_RANGE)
+- return value_f90_subarray (arg1, exp, pos, noside);
+- else
+- goto multi_f77_subscript;
+-
+ case TYPE_CODE_STRING:
+- if (exp->elts[*pos].opcode == OP_RANGE)
+- return value_f90_subarray (arg1, exp, pos, noside);
+- else
+- {
+- arg2 = evaluate_subexp_with_coercion (exp, pos, noside);
+- return value_subscript (arg1, value_as_long (arg2));
+- }
++ return value_f90_subarray (arg1, exp, pos, nargs, noside);
+
+ case TYPE_CODE_PTR:
+ case TYPE_CODE_FUNC:
+@@ -2336,49 +2621,6 @@ evaluate_subexp_standard (struct type *expect_type,
+ }
+ return (arg1);
+
+- multi_f77_subscript:
+- {
+- LONGEST subscript_array[MAX_FORTRAN_DIMS];
+- int ndimensions = 1, i;
+- struct value *array = arg1;
+-
+- if (nargs > MAX_FORTRAN_DIMS)
+- error (_("Too many subscripts for F77 (%d Max)"), MAX_FORTRAN_DIMS);
+-
+- ndimensions = calc_f77_array_dims (type);
+-
+- if (nargs != ndimensions)
+- error (_("Wrong number of subscripts"));
+-
+- gdb_assert (nargs > 0);
+-
+- /* Now that we know we have a legal array subscript expression
+- let us actually find out where this element exists in the array. */
+-
+- /* Take array indices left to right. */
+- for (i = 0; i < nargs; i++)
+- {
+- /* Evaluate each subscript; it must be a legal integer in F77. */
+- arg2 = evaluate_subexp_with_coercion (exp, pos, noside);
+-
+- /* Fill in the subscript array. */
+-
+- subscript_array[i] = value_as_long (arg2);
+- }
+-
+- /* Internal type of array is arranged right to left. */
+- for (i = nargs; i > 0; i--)
+- {
+- struct type *array_type = check_typedef (value_type (array));
+- LONGEST index = subscript_array[i - 1];
+-
+- array = value_subscripted_rvalue (array, index,
+- f77_get_lowerbound (array_type));
+- }
+-
+- return array;
+- }
+-
+ case BINOP_LOGICAL_AND:
+ arg1 = evaluate_subexp (NULL_TYPE, exp, pos, noside);
+ if (noside == EVAL_SKIP)
+@@ -3282,6 +3524,9 @@ calc_f77_array_dims (struct type *array_type)
+ int ndimen = 1;
+ struct type *tmp_type;
+
++ if (TYPE_CODE (array_type) == TYPE_CODE_STRING)
++ return 1;
++
+ if ((TYPE_CODE (array_type) != TYPE_CODE_ARRAY))
+ error (_("Can't get dimensions for a non-array type"));
+
+diff --git a/gdb/expprint.c b/gdb/expprint.c
+index ac5ae0fea1..41bb357a27 100644
+--- a/gdb/expprint.c
++++ b/gdb/expprint.c
+@@ -581,12 +581,10 @@ print_subexp_standard (struct expression *exp, int *pos,
+ *pos += 2;
+
+ fputs_filtered ("RANGE(", stream);
+- if (range_type == HIGH_BOUND_DEFAULT
+- || range_type == NONE_BOUND_DEFAULT)
++ if ((range_type & SUBARRAY_LOW_BOUND) == SUBARRAY_LOW_BOUND)
+ print_subexp (exp, pos, stream, PREC_ABOVE_COMMA);
+ fputs_filtered ("..", stream);
+- if (range_type == LOW_BOUND_DEFAULT
+- || range_type == NONE_BOUND_DEFAULT)
++ if ((range_type & SUBARRAY_HIGH_BOUND) == SUBARRAY_HIGH_BOUND)
+ print_subexp (exp, pos, stream, PREC_ABOVE_COMMA);
+ fputs_filtered (")", stream);
+ return;
+@@ -1094,16 +1092,16 @@ dump_subexp_body_standard (struct expression *exp,
+
+ switch (range_type)
+ {
+- case BOTH_BOUND_DEFAULT:
++ case SUBARRAY_NONE_BOUND:
+ fputs_filtered ("Range '..'", stream);
+ break;
+- case LOW_BOUND_DEFAULT:
++ case SUBARRAY_HIGH_BOUND:
+ fputs_filtered ("Range '..EXP'", stream);
+ break;
+- case HIGH_BOUND_DEFAULT:
++ case SUBARRAY_LOW_BOUND:
+ fputs_filtered ("Range 'EXP..'", stream);
+ break;
+- case NONE_BOUND_DEFAULT:
++ case (SUBARRAY_LOW_BOUND | SUBARRAY_HIGH_BOUND):
+ fputs_filtered ("Range 'EXP..EXP'", stream);
+ break;
+ default:
+@@ -1111,11 +1109,9 @@ dump_subexp_body_standard (struct expression *exp,
+ break;
+ }
+
+- if (range_type == HIGH_BOUND_DEFAULT
+- || range_type == NONE_BOUND_DEFAULT)
++ if ((range_type & SUBARRAY_LOW_BOUND) == SUBARRAY_LOW_BOUND)
+ elt = dump_subexp (exp, stream, elt);
+- if (range_type == LOW_BOUND_DEFAULT
+- || range_type == NONE_BOUND_DEFAULT)
++ if ((range_type & SUBARRAY_HIGH_BOUND) == SUBARRAY_HIGH_BOUND)
+ elt = dump_subexp (exp, stream, elt);
+ }
+ break;
+diff --git a/gdb/expression.h b/gdb/expression.h
+index a783ea5fef..be24792eb6 100644
+--- a/gdb/expression.h
++++ b/gdb/expression.h
+@@ -153,17 +153,17 @@ extern void dump_raw_expression (struct expression *,
+ struct ui_file *, const char *);
+ extern void dump_prefix_expression (struct expression *, struct ui_file *);
+
+-/* In an OP_RANGE expression, either bound could be empty, indicating
+- that its value is by default that of the corresponding bound of the
+- array or string. So we have four sorts of subrange. This
+- enumeration type is to identify this. */
+-
++/* In an OP_RANGE expression, either bound can be provided by the user, or not.
++ In addition to this, the user can also specify a stride value to indicated
++ only certain elements of the array. This enumeration type is to identify
++ this. */
++
+ enum range_type
+ {
+- BOTH_BOUND_DEFAULT, /* "(:)" */
+- LOW_BOUND_DEFAULT, /* "(:high)" */
+- HIGH_BOUND_DEFAULT, /* "(low:)" */
+- NONE_BOUND_DEFAULT /* "(low:high)" */
++ SUBARRAY_NONE_BOUND = 0x0, /* "( : )" */
++ SUBARRAY_LOW_BOUND = 0x1, /* "(low:)" */
++ SUBARRAY_HIGH_BOUND = 0x2, /* "(:high)" */
++ SUBARRAY_STRIDE = 0x4 /* "(::stride)" */
+ };
+
+ #endif /* !defined (EXPRESSION_H) */
+diff --git a/gdb/f-exp.y b/gdb/f-exp.y
+index 6495e03cc5..cd89bb7ca2 100644
+--- a/gdb/f-exp.y
++++ b/gdb/f-exp.y
+@@ -257,31 +257,63 @@ arglist : subrange
+
+ arglist : arglist ',' exp %prec ABOVE_COMMA
+ { arglist_len++; }
++ | arglist ',' subrange %prec ABOVE_COMMA
++ { arglist_len++; }
+ ;
+
+ /* There are four sorts of subrange types in F90. */
+
+ subrange: exp ':' exp %prec ABOVE_COMMA
+- { write_exp_elt_opcode (pstate, OP_RANGE);
+- write_exp_elt_longcst (pstate, NONE_BOUND_DEFAULT);
++ { write_exp_elt_opcode (pstate, OP_RANGE);
++ write_exp_elt_longcst (pstate,
++ SUBARRAY_LOW_BOUND | SUBARRAY_HIGH_BOUND);
+ write_exp_elt_opcode (pstate, OP_RANGE); }
+ ;
+
+ subrange: exp ':' %prec ABOVE_COMMA
+ { write_exp_elt_opcode (pstate, OP_RANGE);
+- write_exp_elt_longcst (pstate, HIGH_BOUND_DEFAULT);
++ write_exp_elt_longcst (pstate, SUBARRAY_LOW_BOUND);
+ write_exp_elt_opcode (pstate, OP_RANGE); }
+ ;
+
+ subrange: ':' exp %prec ABOVE_COMMA
+ { write_exp_elt_opcode (pstate, OP_RANGE);
+- write_exp_elt_longcst (pstate, LOW_BOUND_DEFAULT);
++ write_exp_elt_longcst (pstate, SUBARRAY_HIGH_BOUND);
+ write_exp_elt_opcode (pstate, OP_RANGE); }
+ ;
+
+ subrange: ':' %prec ABOVE_COMMA
+ { write_exp_elt_opcode (pstate, OP_RANGE);
+- write_exp_elt_longcst (pstate, BOTH_BOUND_DEFAULT);
++ write_exp_elt_longcst (pstate, SUBARRAY_NONE_BOUND);
++ write_exp_elt_opcode (pstate, OP_RANGE); }
++ ;
++
++/* Each subrange type can have a stride argument. */
++subrange: exp ':' exp ':' exp %prec ABOVE_COMMA
++ { write_exp_elt_opcode (pstate, OP_RANGE);
++ write_exp_elt_longcst (pstate, SUBARRAY_LOW_BOUND
++ | SUBARRAY_HIGH_BOUND
++ | SUBARRAY_STRIDE);
++ write_exp_elt_opcode (pstate, OP_RANGE); }
++ ;
++
++subrange: exp ':' ':' exp %prec ABOVE_COMMA
++ { write_exp_elt_opcode (pstate, OP_RANGE);
++ write_exp_elt_longcst (pstate, SUBARRAY_LOW_BOUND
++ | SUBARRAY_STRIDE);
++ write_exp_elt_opcode (pstate, OP_RANGE); }
++ ;
++
++subrange: ':' exp ':' exp %prec ABOVE_COMMA
++ { write_exp_elt_opcode (pstate, OP_RANGE);
++ write_exp_elt_longcst (pstate, SUBARRAY_HIGH_BOUND
++ | SUBARRAY_STRIDE);
++ write_exp_elt_opcode (pstate, OP_RANGE); }
++ ;
++
++subrange: ':' ':' exp %prec ABOVE_COMMA
++ { write_exp_elt_opcode (pstate, OP_RANGE);
++ write_exp_elt_longcst (pstate, SUBARRAY_STRIDE);
+ write_exp_elt_opcode (pstate, OP_RANGE); }
+ ;
+
+diff --git a/gdb/f-valprint.c b/gdb/f-valprint.c
+index 903f2af638..b4067a8460 100644
+--- a/gdb/f-valprint.c
++++ b/gdb/f-valprint.c
+@@ -119,8 +119,14 @@ f77_print_array_1 (int nss, int ndimensions, struct type *type,
+
+ if (nss != ndimensions)
+ {
+- size_t dim_size = TYPE_LENGTH (TYPE_TARGET_TYPE (type));
++ size_t dim_size;
+ size_t offs = 0;
++ LONGEST byte_stride = abs (TYPE_BYTE_STRIDE (range_type));
++
++ if (byte_stride)
++ dim_size = byte_stride;
++ else
++ dim_size = TYPE_LENGTH (TYPE_TARGET_TYPE (type));
+
+ for (i = lowerbound;
+ (i < upperbound + 1 && (*elts) < options->print_max);
+diff --git a/gdb/gdbtypes.c b/gdb/gdbtypes.c
+index 7ba62df474..519dfebba8 100644
+--- a/gdb/gdbtypes.c
++++ b/gdb/gdbtypes.c
+@@ -864,7 +864,8 @@ allocate_stub_method (struct type *type)
+ struct type *
+ create_range_type (struct type *result_type, struct type *index_type,
+ const struct dynamic_prop *low_bound,
+- const struct dynamic_prop *high_bound)
++ const struct dynamic_prop *high_bound,
++ const struct dynamic_prop *stride)
+ {
+ if (result_type == NULL)
+ result_type = alloc_type_copy (index_type);
+@@ -879,6 +880,7 @@ create_range_type (struct type *result_type, struct type *index_type,
+ TYPE_ZALLOC (result_type, sizeof (struct range_bounds));
+ TYPE_RANGE_DATA (result_type)->low = *low_bound;
+ TYPE_RANGE_DATA (result_type)->high = *high_bound;
++ TYPE_RANGE_DATA (result_type)->stride = *stride;
+
+ if (low_bound->kind == PROP_CONST && low_bound->data.const_val >= 0)
+ TYPE_UNSIGNED (result_type) = 1;
+@@ -907,7 +909,7 @@ struct type *
+ create_static_range_type (struct type *result_type, struct type *index_type,
+ LONGEST low_bound, LONGEST high_bound)
+ {
+- struct dynamic_prop low, high;
++ struct dynamic_prop low, high, stride;
+
+ low.kind = PROP_CONST;
+ low.data.const_val = low_bound;
+@@ -915,7 +917,11 @@ create_static_range_type (struct type *result_type, struct type *index_type,
+ high.kind = PROP_CONST;
+ high.data.const_val = high_bound;
+
+- result_type = create_range_type (result_type, index_type, &low, &high);
++ stride.kind = PROP_CONST;
++ stride.data.const_val = 0;
++
++ result_type = create_range_type (result_type, index_type,
++ &low, &high, &stride);
+
+ return result_type;
+ }
+@@ -1133,16 +1139,20 @@ create_array_type_with_stride (struct type *result_type,
+ && (!type_not_associated (result_type)
+ && !type_not_allocated (result_type)))
+ {
+- LONGEST low_bound, high_bound;
++ LONGEST low_bound, high_bound, byte_stride;
+
+ if (get_discrete_bounds (range_type, &low_bound, &high_bound) < 0)
+ low_bound = high_bound = 0;
+ element_type = check_typedef (element_type);
++ byte_stride = abs (TYPE_BYTE_STRIDE (range_type));
++
+ /* Be careful when setting the array length. Ada arrays can be
+ empty arrays with the high_bound being smaller than the low_bound.
+ In such cases, the array length should be zero. */
+ if (high_bound < low_bound)
+ TYPE_LENGTH (result_type) = 0;
++ else if (byte_stride > 0)
++ TYPE_LENGTH (result_type) = byte_stride * (high_bound - low_bound + 1);
+ else if (bit_stride > 0)
+ TYPE_LENGTH (result_type) =
+ (bit_stride * (high_bound - low_bound + 1) + 7) / 8;
+@@ -1954,12 +1964,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;
+@@ -1971,7 +1981,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;
+@@ -1986,12 +1996,20 @@ resolve_dynamic_range (struct type *dyn_range_type,
+ high_bound.data.const_val = 0;
+ }
+
++ prop = &TYPE_RANGE_DATA (dyn_range_type)->stride;
++ if (dwarf2_evaluate_property_signed (prop, NULL, addr_stack, &value, 1))
++ {
++ stride.kind = PROP_CONST;
++ stride.data.const_val = value;
++ }
++
+ static_target_type
+ = resolve_dynamic_type_internal (TYPE_TARGET_TYPE (dyn_range_type),
+ addr_stack, 0);
+ static_range_type = create_range_type (copy_type (dyn_range_type),
+ static_target_type,
+- &low_bound, &high_bound);
++ &low_bound, &high_bound, &stride);
++
+ TYPE_RANGE_DATA (static_range_type)->flag_bound_evaluated = 1;
+ return static_range_type;
+ }
+diff --git a/gdb/gdbtypes.h b/gdb/gdbtypes.h
+index 5942b5ad48..923ba101ca 100644
+--- a/gdb/gdbtypes.h
++++ b/gdb/gdbtypes.h
+@@ -550,6 +550,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. */
+
+@@ -711,7 +715,6 @@ struct main_type
+ /* * Union member used for range types. */
+
+ struct range_bounds *bounds;
+-
+ } flds_bnds;
+
+ /* * Slot to point to additional language-specific fields of this
+@@ -1233,6 +1236,15 @@ extern void allocate_gnat_aux_type (struct type *);
+ TYPE_RANGE_DATA(range_type)->high.kind
+ #define TYPE_LOW_BOUND_KIND(range_type) \
+ TYPE_RANGE_DATA(range_type)->low.kind
++#define TYPE_BYTE_STRIDE(range_type) \
++ TYPE_RANGE_DATA(range_type)->stride.data.const_val
++#define TYPE_BYTE_STRIDE_BLOCK(range_type) \
++ TYPE_RANGE_DATA(range_type)->stride.data.locexpr
++#define TYPE_BYTE_STRIDE_LOCLIST(range_type) \
++ TYPE_RANGE_DATA(range_type)->stride.data.loclist
++#define TYPE_BYTE_STRIDE_KIND(range_type) \
++ TYPE_RANGE_DATA(range_type)->stride.kind
++
+
+ /* Property accessors for the type data location. */
+ #define TYPE_DATA_LOCATION(thistype) \
+@@ -1267,6 +1279,9 @@ extern void allocate_gnat_aux_type (struct type *);
+ TYPE_HIGH_BOUND_UNDEFINED(TYPE_INDEX_TYPE(arraytype))
+ #define TYPE_ARRAY_LOWER_BOUND_IS_UNDEFINED(arraytype) \
+ TYPE_LOW_BOUND_UNDEFINED(TYPE_INDEX_TYPE(arraytype))
++#define TYPE_ARRAY_STRIDE_IS_UNDEFINED(arraytype) \
++ (TYPE_BYTE_STRIDE(TYPE_INDEX_TYPE(arraytype)) == 0)
++
+
+ #define TYPE_ARRAY_UPPER_BOUND_VALUE(arraytype) \
+ (TYPE_HIGH_BOUND(TYPE_INDEX_TYPE((arraytype))))
+@@ -1798,6 +1813,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
+index 8b2bb22c76..e1bf3edbe2 100644
+--- a/gdb/parse.c
++++ b/gdb/parse.c
+@@ -984,22 +984,20 @@ operator_length_standard (const struct expression *expr, int endpos,
+
+ case OP_RANGE:
+ oplen = 3;
++ args = 0;
+ range_type = (enum range_type)
+ longest_to_int (expr->elts[endpos - 2].longconst);
+
+- switch (range_type)
+- {
+- case LOW_BOUND_DEFAULT:
+- case HIGH_BOUND_DEFAULT:
+- args = 1;
+- break;
+- case BOTH_BOUND_DEFAULT:
+- args = 0;
+- break;
+- case NONE_BOUND_DEFAULT:
+- args = 2;
+- break;
+- }
++ /* Increment the argument counter for each argument
++ provided by the user. */
++ if ((range_type & SUBARRAY_LOW_BOUND) == SUBARRAY_LOW_BOUND)
++ args++;
++
++ if ((range_type & SUBARRAY_HIGH_BOUND) == SUBARRAY_HIGH_BOUND)
++ args++;
++
++ if ((range_type & SUBARRAY_STRIDE) == SUBARRAY_STRIDE)
++ args++;
+
+ break;
+
+diff --git a/gdb/rust-exp.y b/gdb/rust-exp.y
+index 199e87671e..397a92dfdb 100644
+--- a/gdb/rust-exp.y
++++ b/gdb/rust-exp.y
+@@ -2448,23 +2448,17 @@ convert_ast_to_expression (struct parser_state *state,
+
+ case OP_RANGE:
+ {
+- enum range_type kind = BOTH_BOUND_DEFAULT;
++ enum range_type kind = SUBARRAY_NONE_BOUND;
+
+ if (operation->left.op != NULL)
+ {
+ convert_ast_to_expression (state, operation->left.op, top);
+- kind = HIGH_BOUND_DEFAULT;
++ kind = SUBARRAY_LOW_BOUND;
+ }
+ if (operation->right.op != NULL)
+ {
+ convert_ast_to_expression (state, operation->right.op, top);
+- if (kind == BOTH_BOUND_DEFAULT)
+- kind = LOW_BOUND_DEFAULT;
+- else
+- {
+- gdb_assert (kind == HIGH_BOUND_DEFAULT);
+- kind = NONE_BOUND_DEFAULT;
+- }
++ kind = (range_type) (kind | SUBARRAY_HIGH_BOUND);
+ }
+ write_exp_elt_opcode (state, OP_RANGE);
+ write_exp_elt_longcst (state, kind);
+diff --git a/gdb/rust-lang.c b/gdb/rust-lang.c
+index f7bec33a42..cb924e084d 100644
+--- a/gdb/rust-lang.c
++++ b/gdb/rust-lang.c
+@@ -1366,9 +1366,9 @@ rust_range (struct expression *exp, int *pos, enum noside noside)
+ kind = (enum range_type) longest_to_int (exp->elts[*pos + 1].longconst);
+ *pos += 3;
+
+- if (kind == HIGH_BOUND_DEFAULT || kind == NONE_BOUND_DEFAULT)
++ if ((kind & SUBARRAY_LOW_BOUND) == SUBARRAY_LOW_BOUND)
+ low = evaluate_subexp (NULL_TYPE, exp, pos, noside);
+- if (kind == LOW_BOUND_DEFAULT || kind == NONE_BOUND_DEFAULT)
++ if ((kind & SUBARRAY_HIGH_BOUND) == SUBARRAY_HIGH_BOUND)
+ high = evaluate_subexp (NULL_TYPE, exp, pos, noside);
+
+ if (noside == EVAL_SKIP)
+@@ -1457,7 +1457,7 @@ rust_compute_range (struct type *type, struct value *range,
+
+ *low = 0;
+ *high = 0;
+- *kind = BOTH_BOUND_DEFAULT;
++ *kind = SUBARRAY_NONE_BOUND;
+
+ if (TYPE_NFIELDS (type) == 0)
+ return;
+@@ -1465,15 +1465,14 @@ rust_compute_range (struct type *type, struct value *range,
+ i = 0;
+ if (strcmp (TYPE_FIELD_NAME (type, 0), "start") == 0)
+ {
+- *kind = HIGH_BOUND_DEFAULT;
++ *kind = SUBARRAY_LOW_BOUND;
+ *low = value_as_long (value_field (range, 0));
+ ++i;
+ }
+ if (TYPE_NFIELDS (type) > i
+ && strcmp (TYPE_FIELD_NAME (type, i), "end") == 0)
+ {
+- *kind = (*kind == BOTH_BOUND_DEFAULT
+- ? LOW_BOUND_DEFAULT : NONE_BOUND_DEFAULT);
++ *kind = (range_type) (*kind | SUBARRAY_HIGH_BOUND);
+ *high = value_as_long (value_field (range, i));
+ }
+ }
+@@ -1488,7 +1487,7 @@ rust_subscript (struct expression *exp, int *pos, enum noside noside,
+ struct type *rhstype;
+ LONGEST low, high_bound;
+ /* Initialized to appease the compiler. */
+- enum range_type kind = BOTH_BOUND_DEFAULT;
++ enum range_type kind = SUBARRAY_NONE_BOUND;
+ LONGEST high = 0;
+ int want_slice = 0;
+
+@@ -1586,7 +1585,7 @@ rust_subscript (struct expression *exp, int *pos, enum noside noside,
+ error (_("Cannot subscript non-array type"));
+
+ if (want_slice
+- && (kind == BOTH_BOUND_DEFAULT || kind == LOW_BOUND_DEFAULT))
++ && ((kind & SUBARRAY_LOW_BOUND) != SUBARRAY_LOW_BOUND))
+ low = low_bound;
+ if (low < 0)
+ error (_("Index less than zero"));
+@@ -1604,7 +1603,7 @@ rust_subscript (struct expression *exp, int *pos, enum noside noside,
+ CORE_ADDR addr;
+ struct value *addrval, *tem;
+
+- if (kind == BOTH_BOUND_DEFAULT || kind == HIGH_BOUND_DEFAULT)
++ if ((kind & SUBARRAY_HIGH_BOUND) != SUBARRAY_HIGH_BOUND)
+ high = high_bound;
+ if (high < 0)
+ error (_("High index less than zero"));
+diff --git a/gdb/testsuite/gdb.fortran/static-arrays.exp b/gdb/testsuite/gdb.fortran/static-arrays.exp
+new file mode 100644
+index 0000000000..cc9ecc04ab
+--- /dev/null
++++ b/gdb/testsuite/gdb.fortran/static-arrays.exp
+@@ -0,0 +1,421 @@
++# Copyright 2015 Free Software Foundation, Inc.
++#
++# Contributed by Intel Corp. <christoph.t.weinmann(a)intel.com>
++#
++# 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 static-arrays.f90
++
++if { [prepare_for_testing $testfile.exp $testfile $srcfile {debug f90}] } {
++ return -1
++}
++
++if ![runto MAIN__] then {
++ perror "couldn't run to breakpoint MAIN__"
++ continue
++}
++
++gdb_breakpoint [gdb_get_line_number "BP1"]
++gdb_continue_to_breakpoint "BP1" ".*BP1.*"
++
++# Tests subarrays of one dimensional arrays with subrange variations
++gdb_test "print ar1" "\\$\[0-9\]+ = \\(1, 2, 3, 4, 5, 6, 7, 8, 9\\)" \
++ "print ar1."
++gdb_test "print ar1\(4:7\)" "\\$\[0-9\]+ = \\(4, 5, 6, 7\\)" \
++ "print ar1\(4:7\)"
++gdb_test "print ar1\(8:\)" "\\$\[0-9\]+ = \\(8, 9\\).*" \
++ "print ar1\(8:\)"
++gdb_test "print ar1\(:3\)" "\\$\[0-9\]+ = \\(1, 2, 3\\).*" \
++ "print ar1\(:3\)"
++gdb_test "print ar1\(:\)" "\\$\[0-9\]+ = \\(1, 2, 3, 4, 5, 6, 7, 8, 9\\)" \
++ "print ar1\(:\)"
++
++# Check assignment
++gdb_test_no_output "set \$my_ary = ar1\(3:8\)"
++gdb_test "print \$my_ary" \
++ "\\$\[0-9\]+ = \\(3, 4, 5, 6, 7, 8\\)" \
++ "Assignment of subarray to variable"
++gdb_test_no_output "set ar1\(5\) = 42"
++ gdb_test "print ar1\(3:8\)" \
++ "\\$\[0-9\]+ = \\(3, 4, 42, 6, 7, 8\\)" \
++ "print ar1\(3:8\) after assignment"
++gdb_test "print \$my_ary" \
++ "\\$\[0-9\]+ = \\(3, 4, 5, 6, 7, 8\\)" \
++ "Assignment of subarray to variable after original array changed"
++
++# Test for subarrays of one dimensional arrays with literals
++ gdb_test "print ar1\(3\)" "\\$\[0-9\]+ = 3" \
++ "print ar1\(3\)"
++
++# Tests for subranges of 2 dimensional arrays with subrange variations
++gdb_test "print ar2\(2:3, 3:4\)" \
++ "\\$\[0-9\]+ = \\(\\( 23, 33\\) \\( 24, 34\\) \\)" \
++ "print ar2\(2:3, 3:4\)."
++gdb_test "print ar2\(8:9,8:\)" \
++ "\\$\[0-9\]+ = \\(\\( 88, 98\\) \\( 89, 99\\) \\)" \
++ "print ar2\(8:9,8:\)"
++gdb_test "print ar2\(8:9,:2\)" \
++ "\\$\[0-9\]+ = \\(\\( 81, 91\\) \\( 82, 92\\) \\)" \
++ "print ar2\(8:9,:2\)"
++
++gdb_test "print ar2\(8:,8:9\)" \
++ "\\$\[0-9\]+ = \\(\\( 88, 98\\) \\( 89, 99\\) \\)" \
++ "print ar2\(8:,8:9\)"
++gdb_test "print ar2\(8:,8:\)" \
++ "\\$\[0-9\]+ = \\(\\( 88, 98\\) \\( 89, 99\\) \\)" \
++ "print ar2\(8:,8:\)"
++gdb_test "print ar2\(8:,:2\)" \
++ "\\$\[0-9\]+ = \\(\\( 81, 91\\) \\( 82, 92\\) \\)" \
++ "print ar2\(8:,:2\)"
++
++gdb_test "print ar2\(:2,2:3\)" \
++ "\\$\[0-9\]+ = \\(\\( 12, 22\\) \\( 13, 23\\) \\)" \
++ "print ar2\(:2,2:3\)"
++gdb_test "print ar2\(:2,8:\)" \
++ "\\$\[0-9\]+ = \\(\\( 18, 28\\) \\( 19, 29\\) \\)" \
++ "print ar2\(:2,8:\)"
++gdb_test "print ar2\(:2,:2\)" \
++ "\\$\[0-9\]+ = \\(\\( 11, 21\\) \\( 12, 22\\) \\)" \
++ "print ar2\(:2,:2\)"
++
++# Test subranges of 2 dimensional arrays with literals and subrange variations
++gdb_test "print ar2\(7, 3:6\)" \
++ "\\$\[0-9\]+ = \\(73, 74, 75, 76\\)" \
++ "print ar2\(7, 3:6\)"
++gdb_test "print ar2\(7,8:\)" \
++ "\\$\[0-9\]+ = \\(78, 79\\)" \
++ "print ar2\(7,8:\)"
++gdb_test "print ar2\(7,:2\)" \
++ "\\$\[0-9\]+ = \\(71, 72\\)" \
++ "print ar2\(7,:2\)"
++
++gdb_test "print ar2\(7:8,4\)" \
++ "\\$\[0-9\]+ = \\(74, 84\\)" \
++ "print ar2(7:8,4\)"
++gdb_test "print ar2\(8:,4\)" \
++ "\\$\[0-9\]+ = \\(84, 94\\)" \
++ "print ar2\(8:,4\)"
++gdb_test "print ar2\(:2,4\)" \
++ "\\$\[0-9\]+ = \\(14, 24\\)" \
++ "print ar2\(:2,4\)"
++gdb_test "print ar2\(3,4\)" \
++ "\\$\[0-9\]+ = 34" \
++ "print ar2\(3,4\)"
++
++# Test subarrays of 3 dimensional arrays with literals and subrange variations
++gdb_test "print ar3\(2:4,3:4,7:8\)" \
++ "\\$\[0-9\]+ = \\(\\( \\( 237, 337, 437\\) \\( 247, 347, 447\\)\
++ \\) \\( \\( 238, 338, 438\\) \\( 248, 348, 448\\) \\) \\)" \
++ "print ar3\(2:4,3:4,7:8\)"
++gdb_test "print ar3\(2:3,4:5,8:\)" \
++ "\\$\[0-9\]+ = \\(\\( \\( 248, 348\\) \\( 258, 358\\) \\) \\(\
++ \\( 249, 349\\) \\( 259, 359\\) \\) \\)" \
++ "print ar3\(2:3,4:5,8:\)"
++gdb_test "print ar3\(2:3,4:5,:2\)" \
++ "\\$\[0-9\]+ = \\(\\( \\( 241, 341\\) \\( 251, 351\\) \\) \\(\
++ \\( 242, 342\\) \\( 252, 352\\) \\) \\)" \
++ "print ar3\(2:3,4:5,:2\)"
++
++gdb_test "print ar3\(2:3,8:,7:8\)" \
++ "\\$\[0-9\]+ = \\(\\( \\( 287, 387\\) \\( 297, 397\\) \\) \\(\
++ \\( 288, 388\\) \\( 298, 398\\) \\) \\)" \
++ "print ar3\(2:3,8:,7:8\)"
++gdb_test "print ar3\(2:3,8:,8:\)" \
++ "\\$\[0-9\]+ = \\(\\( \\( 288, 388\\) \\( 298, 398\\) \\) \\(\
++ \\( 289, 389\\) \\( 299, 399\\) \\) \\)" \
++ "print ar3\(2:3,8:,8:\)"
++gdb_test "print ar3\(2:3,8:,:2\)" \
++ "\\$\[0-9\]+ = \\(\\( \\( 281, 381\\) \\( 291, 391\\) \\) \\(\
++ \\( 282, 382\\) \\( 292, 392\\) \\) \\)" \
++ "print ar3\(2:3,8:,:2\)"
++
++gdb_test "print ar3\(2:3,:2,7:8\)" \
++ "\\$\[0-9\]+ = \\(\\( \\( 217, 317\\) \\( 227, 327\\) \\) \\(\
++ \\( 218, 318\\) \\( 228, 328\\) \\) \\)" \
++ "print ar3\(2:3,:2,7:8\)"
++gdb_test "print ar3\(2:3,:2,8:\)" \
++ "\\$\[0-9\]+ = \\(\\( \\( 218, 318\\) \\( 228, 328\\) \\) \\(\
++ \\( 219, 319\\) \\( 229, 329\\) \\) \\)" \
++ "print ar3\(2:3,:2,8:\)"
++gdb_test "print ar3\(2:3,:2,:2\)" \
++ "\\$\[0-9\]+ = \\(\\( \\( 211, 311\\) \\( 221, 321\\) \\) \\(\
++ \\( 212, 312\\) \\( 222, 322\\) \\) \\)" \
++ "print ar3\(2:3,:2,:2\)"
++
++gdb_test "print ar3\(8:,3:4,7:8\)" \
++ "\\$\[0-9\]+ = \\(\\( \\( 837, 937\\) \\( 847, 947\\) \\) \\(\
++ \\( 838, 938\\) \\( 848, 948\\) \\) \\)" \
++ "print ar3\(8:,3:4,7:8\)"
++gdb_test "print ar3\(8:,4:5,8:\)" \
++ "\\$\[0-9\]+ = \\(\\( \\( 848, 948\\) \\( 858, 958\\) \\) \\(\
++ \\( 849, 949\\) \\( 859, 959\\) \\) \\)" \
++ "print ar3\(8:,4:5,8:\)"
++gdb_test "print ar3\(8:,4:5,:2\)" \
++ "\\$\[0-9\]+ = \\(\\( \\( 841, 941\\) \\( 851, 951\\) \\) \\(\
++ \\( 842, 942\\) \\( 852, 952\\) \\) \\)" \
++ "print ar3\(8:,4:5,:2\)"
++
++gdb_test "print ar3\(8:,8:,7:8\)" \
++ "\\$\[0-9\]+ = \\(\\( \\( 887, 987\\) \\( 897, 997\\) \\) \\(\
++ \\( 888, 988\\) \\( 898, 998\\) \\) \\)" \
++ "print ar3\(8:,8:,7:8\)"
++gdb_test "print ar3\(8:,8:,8:\)" \
++ "\\$\[0-9\]+ = \\(\\( \\( 888, 988\\) \\( 898, 998\\) \\) \\(\
++ \\( 889, 989\\) \\( 899, 999\\) \\) \\)" \
++ "print ar3\(8:,8:,8:\)"
++gdb_test "print ar3\(8:,8:,:2\)" \
++ "\\$\[0-9\]+ = \\(\\( \\( 881, 981\\) \\( 891, 991\\) \\) \\(\
++ \\( 882, 982\\) \\( 892, 992\\) \\) \\)" \
++ "print ar3\(8:,8:,:2\)"
++
++gdb_test "print ar3\(8:,:2,7:8\)" \
++ "\\$\[0-9\]+ = \\(\\( \\( 817, 917\\) \\( 827, 927\\) \\) \\(\
++ \\( 818, 918\\) \\( 828, 928\\) \\) \\)" \
++ "print ar3\(8:,:2,7:8\)"
++gdb_test "print ar3\(8:,:2,8:\)" \
++ "\\$\[0-9\]+ = \\(\\( \\( 818, 918\\) \\( 828, 928\\) \\) \\(\
++ \\( 819, 919\\) \\( 829, 929\\) \\) \\)" \
++ "print ar3\(8:,:2,8:\)"
++gdb_test "print ar3\(8:,:2,:2\)" \
++ "\\$\[0-9\]+ = \\(\\( \\( 811, 911\\) \\( 821, 921\\) \\) \\(\
++ \\( 812, 912\\) \\( 822, 922\\) \\) \\)" \
++ "print ar3\(8:,:2,:2\)"
++
++
++gdb_test "print ar3\(:2,3:4,7:8\)" \
++ "\\$\[0-9\]+ = \\(\\( \\( 137, 237\\) \\( 147, 247\\) \\) \\(\
++ \\( 138, 238\\) \\( 148, 248\\) \\) \\)" \
++ "print ar3 \(:2,3:4,7:8\)."
++gdb_test "print ar3\(:2,3:4,8:\)" \
++ "\\$\[0-9\]+ = \\(\\( \\( 138, 238\\) \\( 148, 248\\) \\) \\(\
++ \\( 139, 239\\) \\( 149, 249\\) \\) \\)" \
++ "print ar3\(:2,3:4,8:\)"
++gdb_test "print ar3\(:2,3:4,:2\)" \
++ "\\$\[0-9\]+ = \\(\\( \\( 131, 231\\) \\( 141, 241\\) \\) \\(\
++ \\( 132, 232\\) \\( 142, 242\\) \\) \\)" \
++ "print ar3\(:2,3:4,:2\)"
++
++gdb_test "print ar3\(:2,8:,7:8\)" "\\$\[0-9\]+ = \\(\\( \\( 187, 287\\) \\(\
++ 197, 297\\) \\) \\( \\( 188, 288\\) \\( 198, 298\\) \\) \\)" \
++ "print ar3\(:2,8:,7:8\)"
++gdb_test "print ar3\(:2,8:,8:\)" "\\$\[0-9\]+ = \\(\\( \\( 188, 288\\) \\( 198,\
++ 298\\) \\) \\( \\( 189, 289\\) \\( 199, 299\\) \\) \\)" \
++ "print ar3\(:2,8:,8:\)"
++gdb_test "print ar3\(:2,8:,:2\)" "\\$\[0-9\]+ = \\(\\( \\( 181, 281\\) \\( 191,\
++ 291\\) \\) \\( \\( 182, 282\\) \\( 192, 292\\) \\) \\)" \
++ "print ar3\(:2,8:,:2\)"
++
++gdb_test "print ar3\(:2,:2,7:8\)" \
++ "\\$\[0-9\]+ = \\(\\( \\( 117, 217\\) \\( 127, 227\\) \\) \\(\
++ \\( 118, 218\\) \\( 128, 228\\) \\) \\)" \
++ "print ar3\(:2,:2,7:8\)"
++gdb_test "print ar3\(:2,:2,8:\)" \
++ "\\$\[0-9\]+ = \\(\\( \\( 118, 218\\) \\( 128, 228\\) \\) \\(\
++ \\( 119, 219\\) \\( 129, 229\\) \\) \\)" \
++ "print ar3\(:2,:2,8:\)"
++gdb_test "print ar3\(:2,:2,:2\)" \
++ "\\$\[0-9\]+ = \\(\\( \\( 111, 211\\) \\( 121, 221\\) \\) \\(\
++ \\( 112, 212\\) \\( 122, 222\\) \\) \\)" \
++ "print ar3\(:2,:2,:2\)"
++
++#Tests for subarrays of 3 dimensional arrays with literals and subranges
++gdb_test "print ar3\(3,3:4,7:8\)" \
++ "\\$\[0-9\]+ = \\(\\( 337, 347\\) \\( 338, 348\\) \\)" \
++ "print ar3\(3,3:4,7:8\)"
++gdb_test "print ar3\(3,4:5,8:\)" \
++ "\\$\[0-9\]+ = \\(\\( 348, 358\\) \\( 349, 359\\) \\)" \
++ "print ar3\(3,4:5,8:\)"
++gdb_test "print ar3\(3,4:5,:2\)" \
++ "\\$\[0-9\]+ = \\(\\( 341, 351\\) \\( 342, 352\\) \\)" \
++ "print ar3\(3,4:5,:2\)"
++gdb_test "print ar3\(3,4:5,3\)" \
++ "\\$\[0-9\]+ = \\(343, 353\\)" \
++ "print ar3\(3,4:5,3\)"
++
++gdb_test "print ar3\(2,8:,7:8\)" \
++ "\\$\[0-9\]+ = \\(\\( 287, 297\\) \\( 288, 298\\) \\)" \
++ "print ar3\(2,8:,7:8\)"
++gdb_test "print ar3\(2,8:,8:\)" \
++ "\\$\[0-9\]+ = \\(\\( 288, 298\\) \\( 289, 299\\) \\)" \
++ "print ar3\(2,8:,8:\)"
++gdb_test "print ar3\(2,8:,:2\)"\
++ "\\$\[0-9\]+ = \\(\\( 281, 291\\) \\( 282, 292\\) \\)" \
++ "print ar3\(2,8:,:2\)"
++gdb_test "print ar3\(2,8:,3\)" \
++ "\\$\[0-9\]+ = \\(283, 293\\)" \
++ "print ar3\(2,8:,3\)"
++
++gdb_test "print ar3\(2,:2,7:8\)" \
++ "\\$\[0-9\]+ = \\(\\( 217, 227\\) \\( 218, 228\\) \\)" \
++ "print ar3\(2,:2,7:8\)"
++gdb_test "print ar3\(2,:2,8:\)" \
++ "\\$\[0-9\]+ = \\(\\( 218, 228\\) \\( 219, 229\\) \\)" \
++ "print ar3\(2,:2,8:\)"
++gdb_test "print ar3\(2,:2,:2\)" \
++ "\\$\[0-9\]+ = \\(\\( 211, 221\\) \\( 212, 222\\) \\)" \
++ "print ar3\(2,:2,:2\)"
++gdb_test "print ar3\(2,:2,3\)" \
++ "\\$\[0-9\]+ = \\(213, 223\\)" \
++ "print ar3\(2,:2,3\)"
++
++gdb_test "print ar3\(3,4,7:8\)" \
++ "\\$\[0-9\]+ = \\(347, 348\\)" \
++ "print ar3\(3,4,7:8\)"
++gdb_test "print ar3\(3,4,8:\)" \
++ "\\$\[0-9\]+ = \\(348, 349\\)" \
++i "print ar3\(3,4,8:\)"
++gdb_test "print ar3\(3,4,:2\)" \
++ "\\$\[0-9\]+ = \\(341, 342\\)" \
++ "print ar3\(3,4,:2\)"
++gdb_test "print ar3\(5,6,7\)" \
++ "\\$\[0-9\]+ = 567" \
++ "print ar3\(5,6,7\)"
++
++gdb_test "print ar3\(3:4,6,7:8\)" \
++ "\\$\[0-9\]+ = \\(\\( 367, 467\\) \\( 368, 468\\) \\)" \
++ "print ar3\(3:4,6,7:8\)"
++gdb_test "print ar3\(3:4,6,8:\)" \
++ "\\$\[0-9\]+ = \\(\\( 368, 468\\) \\( 369, 469\\) \\)" \
++ "print ar3\(3:4,6,8:\)"
++gdb_test "print ar3\(3:4,6,:2\)" \
++ "\\$\[0-9\]+ = \\(\\( 361, 461\\) \\( 362, 462\\) \\)" \
++ "print ar3\(3:4,6,:2\)"
++gdb_test "print ar3\(3:4,6,5\)" \
++ "\\$\[0-9\]+ = \\(365, 465\\)" \
++ "print ar3\(3:4,6,5\)"
++
++gdb_test "print ar3\(8:,6,7:8\)" \
++ "\\$\[0-9\]+ = \\(\\( 867, 967\\) \\( 868, 968\\) \\)" \
++ "print ar3\(8:,6,7:8\)"
++gdb_test "print ar3\(8:,6,8:\)" \
++ "\\$\[0-9\]+ = \\(\\( 868, 968\\) \\( 869, 969\\) \\)" \
++ "print ar3\(8:,6,8:\)"
++gdb_test "print ar3\(8:,6,:2\)" \
++ "\\$\[0-9\]+ = \\(\\( 861, 961\\) \\( 862, 962\\) \\)" \
++ "print ar3\(8:,6,:2\)"
++gdb_test "print ar3\(8:,6,5\)" \
++ "\\$\[0-9\]+ = \\(865, 965\\)" \
++ "print ar3\(8:,6,5\)"
++
++gdb_test "print ar3\(:2,6,7:8\)" \
++ "\\$\[0-9\]+ = \\(\\( 167, 267\\) \\( 168, 268\\) \\)" \
++ "print ar3\(:2,6,7:8\)"
++gdb_test "print ar3\(:2,6,8:\)" \
++ "\\$\[0-9\]+ = \\(\\( 168, 268\\) \\( 169, 269\\) \\)" \
++ "print ar3\(:2,6,8:\)"
++gdb_test "print ar3\(:2,6,:2\)" \
++ "\\$\[0-9\]+ = \\(\\( 161, 261\\) \\( 162, 262\\) \\)" \
++ "print ar3\(:2,6,:2\)"
++gdb_test "print ar3\(:2,6,5\)" \
++ "\\$\[0-9\]+ = \\(165, 265\\)" \
++ "print ar3\(:2,6,5\)"
++
++gdb_test "print ar3\(3:4,5:6,4\)" \
++ "\\$\[0-9\]+ = \\(\\( 354, 454\\) \\( 364, 464\\) \\)" \
++ "print ar2\(3:4,5:6,4\)"
++gdb_test "print ar3\(8:,5:6,4\)" \
++ "\\$\[0-9\]+ = \\(\\( 854, 954\\) \\( 864, 964\\) \\)" \
++ "print ar2\(8:,5:6,4\)"
++gdb_test "print ar3\(:2,5:6,4\)" \
++ "\\$\[0-9\]+ = \\(\\( 154, 254\\) \\( 164, 264\\) \\)" \
++ "print ar2\(:2,5:6,4\)"
++
++# Stride > 1
++gdb_test "print ar1\(2:6:2\)" \
++ "\\$\[0-9\]+ = \\(2, 4, 6\\)" \
++ "print ar1\(2:6:2\)"
++gdb_test "print ar2\(2:6:2,3:4\)" \
++ "\\$\[0-9\]+ = \\(\\( 23, 43, 63\\) \\( 24, 44, 64\\) \\)" \
++ "print ar2\(2:6:2,3:4\)"
++gdb_test "print ar2\(2:6:2,3\)" \
++ "\\$\[0-9\]+ = \\(23, 43, 63\\)" \
++ "print ar2\(2:6:2,3\)"
++gdb_test "print ar3\(2:6:2,3:5:2,4:7:3\)" \
++ "\\$\[0-9\]+ = \\(\\( \\( 234, 434, 634\\) \\( 254, 454, 654\\)\
++ \\) \\( \\( 237, 437, 637\\) \\( 257, 457, 657\\) \\) \\)" \
++ "print ar3\(2:6:2,3:5:2,4:7:3\)"
++gdb_test "print ar3\(2:6:2,5,4:7:3\)" \
++ "\\$\[0-9\]+ = \\(\\( 254, 454, 654\\) \\( 257, 457, 657\\)\
++ \\)" \
++ "print ar3\(2:6:2,5,4:7:3\)"
++
++# Stride < 0
++gdb_test "print ar1\(8:2:-2\)" \
++ "\\$\[0-9\]+ = \\(8, 6, 4, 2\\)" \
++ "print ar1\(8:2:-2\)"
++gdb_test "print ar2\(8:2:-2,3:4\)" \
++ "\\$\[0-9\]+ = \\(\\( 83, 63, 43, 23\\) \\( 84, 64, 44, 24\\)\
++ \\)" \
++ "print ar2\(8:2:-2,3:4\)"
++gdb_test "print ar2\(2:6:2,3\)" \
++ "\\$\[0-9\]+ = \\(23, 43, 63\\)" \
++ "print ar2\(2:6:2,3\)"
++gdb_test "print ar3\(2:3,7:3:-4,4:7:3\)" \
++ "\\$\[0-9\]+ = \\(\\( \\( 274, 374\\) \\( 234, 334\\) \\) \\(\
++ \\( 277, 377\\) \\( 237, 337\\) \\) \\)" \
++ "print ar3\(2:3,7:3:-4,4:7:3\)"
++gdb_test "print ar3\(2:6:2,5,7:4:-3\)" \
++ "\\$\[0-9\]+ = \\(\\( 257, 457, 657\\) \\( 254, 454, 654\\)\
++ \\)" \
++ "print ar3\(2:6:2,5,7:4:-3\)"
++
++# Tests with negative and mixed indices
++gdb_test "p ar4\(2:4, -2:1, -15:-14\)" \
++ "\\$\[0-9\]+ = \\(\\( \\( 261, 361, 461\\) \\( 271, 371, 471\\)\
++ \\( 281, 381, 481\\) \\( 291, 391, 491\\) \\) \\( \\( 262,\
++ 362, 462\\) \\( 272, 372, 472\\) \\( 282, 382, 482\\) \\( 292,\
++ 392, 492\\) \\) \\)" \
++ "print ar4(2:4, -2:1, -15:-14)"
++
++gdb_test "p ar4\(7,-6:2:3,-7\)" \
++ "\\$\[0-9\]+ = \\(729, 759, 789\\)" \
++ "print ar4(7,-6:2:3,-7)"
++
++gdb_test "p ar4\(9:2:-2, -6:2:3, -6:-15:-3\)" \
++ "\\$\[0-9\]+ = \\(\\( \\( 930, 730, 530, 330\\) \\( 960, 760,\
++ 560, 360\\) \\( 990, 790, 590, 390\\) \\) \\( \\( 927, 727,\
++ 527, 327\\) \\( 957, 757, 557, 357\\) \\( 987, 787, 587,\
++ 387\\) \\) \\( \\( 924, 724, 524, 324\\) \\( 954, 754, 554,\
++ 354\\) \\( 984, 784, 584, 384\\) \\) \\( \\( 921, 721, 521,\
++ 321\\) \\( 951, 751, 551, 351\\) \\( 981, 781, 581, 381\\) \\)\
++ \\)" \
++ "print ar4(9:2:-2, -6:2:3, -6:-15:-3)"
++
++gdb_test "p ar4\(:,:,:\)" \
++ "\\$\[0-9\]+ = \\(\\( \\( 111, 211, 311, 411, 511, 611, 711,\
++ 811, .*" \
++ "print ar4(:,:,:)"
++
++# Provoke error messages for bad user input
++gdb_test "print ar1\(0:4\)" \
++ "provided bound\\(s\\) outside array bound\\(s\\)" \
++ "print ar1\(0:4\)"
++gdb_test "print ar1\(8:12\)" \
++ "provided bound\\(s\\) outside array bound\\(s\\)" \
++ "print ar1\(8:12\)"
++gdb_test "print ar1\(8:2:\)" \
++ "A syntax error in expression, near `\\)'." \
++ "print ar1\(8:2:\)"
++gdb_test "print ar1\(8:2:2\)" \
++ "Wrong value provided for stride and boundaries" \
++ "print ar1\(8:2:2\)"
++gdb_test "print ar1\(2:8:-2\)" \
++ "Wrong value provided for stride and boundaries" \
++ "print ar1\(2:8:-2\)"
++gdb_test "print ar1\(2:7:0\)" \
++ "Stride must not be 0" \
++ "print ar1\(2:7:0\)"
++gdb_test "print ar1\(3:7\) = 42" \
++ "Invalid cast." \
++ "Assignment of value to subarray"
+diff --git a/gdb/testsuite/gdb.fortran/static-arrays.f90 b/gdb/testsuite/gdb.fortran/static-arrays.f90
+new file mode 100644
+index 0000000000..f22fcbe124
+--- /dev/null
++++ b/gdb/testsuite/gdb.fortran/static-arrays.f90
+@@ -0,0 +1,55 @@
++! Copyright 2015 Free Software Foundation, Inc.
++!
++! Contributed by Intel Corp. <christoph.t.weinmann(a)intel.com>
++!
++! 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/>.
++
++subroutine sub
++ integer, dimension(9) :: ar1
++ integer, dimension(9,9) :: ar2
++ integer, dimension(9,9,9) :: ar3
++ integer, dimension(10,-7:3, -15:-5) :: ar4
++ integer :: i,j,k
++
++ ar1 = 1
++ ar2 = 1
++ ar3 = 1
++ ar4 = 4
++
++ ! Resulting array ar3 looks like ((( 111, 112, 113, 114,...)))
++ do i = 1, 9, 1
++ ar1(i) = i
++ do j = 1, 9, 1
++ ar2(i,j) = i*10 + j
++ do k = 1, 9, 1
++ ar3(i,j,k) = i*100 + j*10 + k
++ end do
++ end do
++ end do
++
++ do i = 1, 10, 1
++ do j = -7, 3, 1
++ do k = -15, -5, 1
++ ar4(i,j,k) = i*100 + (j+8)*10 + (k+16)
++ end do
++ end do
++ end do
++
++ ar1(1) = 11 !BP1
++ return
++end
++
++program testprog
++ call sub
++end
+diff --git a/gdb/testsuite/gdb.fortran/vla-ptype.exp b/gdb/testsuite/gdb.fortran/vla-ptype.exp
+index 5f367348b0..5351a0aa2e 100644
+--- a/gdb/testsuite/gdb.fortran/vla-ptype.exp
++++ b/gdb/testsuite/gdb.fortran/vla-ptype.exp
+@@ -98,3 +98,7 @@ gdb_test "ptype vla2" "type = <not allocated>" "ptype vla2 not allocated"
+ gdb_test "ptype vla2(5, 45, 20)" \
+ "no such vector element \\\(vector not allocated\\\)" \
+ "ptype vla2(5, 45, 20) not allocated"
++
++gdb_breakpoint [gdb_get_line_number "vla1-neg-bounds"]
++gdb_continue_to_breakpoint "vla1-neg-bounds"
++gdb_test "ptype vla1" "type = $real \\(-2:1,-5:4,-3:-1\\)" "ptype vla1 negative bounds"
+diff --git a/gdb/testsuite/gdb.fortran/vla-sizeof.exp b/gdb/testsuite/gdb.fortran/vla-sizeof.exp
+index 3113983ba4..83bc849619 100644
+--- a/gdb/testsuite/gdb.fortran/vla-sizeof.exp
++++ b/gdb/testsuite/gdb.fortran/vla-sizeof.exp
+@@ -44,3 +44,7 @@ gdb_test "print sizeof(pvla)" " = 0" "print sizeof non-associated pvla"
+ gdb_breakpoint [gdb_get_line_number "pvla-associated"]
+ gdb_continue_to_breakpoint "pvla-associated"
+ gdb_test "print sizeof(pvla)" " = 4000" "print sizeof associated pvla"
++
++gdb_breakpoint [gdb_get_line_number "vla1-neg-bounds"]
++gdb_continue_to_breakpoint "vla1-neg-bounds"
++gdb_test "print sizeof(vla1)" " = 480" "print sizeof vla1 negative bounds"
+diff --git a/gdb/testsuite/gdb.fortran/vla-stride.exp b/gdb/testsuite/gdb.fortran/vla-stride.exp
+new file mode 100644
+index 0000000000..dcf15e5daf
+--- /dev/null
++++ b/gdb/testsuite/gdb.fortran/vla-stride.exp
+@@ -0,0 +1,44 @@
++# Copyright 2016 Free Software Foundation, Inc.
++
++# This program is free software; you can redistribute it and/or modify
++# it under the terms of the GNU General Public License as published by
++# the Free Software Foundation; either version 3 of the License, or
++# (at your option) any later version.
++#
++# This program is distributed in the hope that it will be useful,
++# but WITHOUT ANY WARRANTY; without even the implied warranty of
++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++# GNU General Public License for more details.
++#
++# You should have received a copy of the GNU General Public License
++# along with this program. If not, see <http://www.gnu.org/licenses/>.
++
++standard_testfile ".f90"
++
++if { [prepare_for_testing ${testfile}.exp ${testfile} ${srcfile} \
++ {debug f90 quiet}] } {
++ return -1
++}
++
++if ![runto MAIN__] then {
++ perror "couldn't run to breakpoint MAIN__"
++ continue
++}
++
++gdb_breakpoint [gdb_get_line_number "re-reverse-elements"]
++gdb_continue_to_breakpoint "re-reverse-elements"
++gdb_test "print pvla" " = \\\(1, 2, 3, 4, 5, 6, 7, 8, 9, 10\\\)" \
++ "print re-reverse-elements"
++gdb_test "print pvla(1)" " = 1" "print first re-reverse-element"
++gdb_test "print pvla(10)" " = 10" "print last re-reverse-element"
++
++gdb_breakpoint [gdb_get_line_number "odd-elements"]
++gdb_continue_to_breakpoint "odd-elements"
++gdb_test "print pvla" " = \\\(1, 3, 5, 7, 9\\\)" "print odd-elements"
++gdb_test "print pvla(1)" " = 1" "print first odd-element"
++gdb_test "print pvla(5)" " = 9" "print last odd-element"
++
++gdb_breakpoint [gdb_get_line_number "single-element"]
++gdb_continue_to_breakpoint "single-element"
++gdb_test "print pvla" " = \\\(5\\\)" "print single-element"
++gdb_test "print pvla(1)" " = 5" "print one single-element"
+diff --git a/gdb/testsuite/gdb.fortran/vla-stride.f90 b/gdb/testsuite/gdb.fortran/vla-stride.f90
+new file mode 100644
+index 0000000000..8d2425222e
+--- /dev/null
++++ b/gdb/testsuite/gdb.fortran/vla-stride.f90
+@@ -0,0 +1,29 @@
++! Copyright 2016 Free Software Foundation, Inc.
++!
++! This program is free software; you can redistribute it and/or modify
++! it under the terms of the GNU General Public License as published by
++! the Free Software Foundation; either version 3 of the License, or
++! (at your option) any later version.
++!
++! This program is distributed in the hope that it will be useful,
++! but WITHOUT ANY WARRANTY; without even the implied warranty of
++! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++! GNU General Public License for more details.
++!
++! You should have received a copy of the GNU General Public License
++! along with this program. If not, see <http://www.gnu.org/licenses/>.
++
++program vla_stride
++ integer, target, allocatable :: vla (:)
++ integer, pointer :: pvla (:)
++
++ allocate(vla(10))
++ vla = (/ (I, I = 1,10) /)
++
++ pvla => vla(10:1:-1)
++ pvla => pvla(10:1:-1)
++ pvla => vla(1:10:2) ! re-reverse-elements
++ pvla => vla(5:4:-2) ! odd-elements
++
++ pvla => null() ! single-element
++end program vla_stride
+diff --git a/gdb/testsuite/gdb.fortran/vla.f90 b/gdb/testsuite/gdb.fortran/vla.f90
+index 508290a36e..d87f59b92b 100644
+--- a/gdb/testsuite/gdb.fortran/vla.f90
++++ b/gdb/testsuite/gdb.fortran/vla.f90
+@@ -54,4 +54,14 @@ program vla
+
+ allocate (vla3 (2,2)) ! vla2-deallocated
+ vla3(:,:) = 13
++
++ allocate (vla1 (-2:1, -5:4, -3:-1))
++ l = allocated(vla1)
++
++ vla1(:, :, :) = 1
++ vla1(-2, -3, -1) = -231
++
++ deallocate (vla1) ! vla1-neg-bounds
++ l = allocated(vla1)
++
+ end program vla
+diff --git a/gdb/valarith.c b/gdb/valarith.c
+index 58e3a09c37..035def5466 100644
+--- a/gdb/valarith.c
++++ b/gdb/valarith.c
+@@ -189,10 +189,16 @@ value_subscripted_rvalue (struct value *array, LONGEST index, int lowerbound)
+ 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)))
+ {
+ if (type_not_associated (array_type))
+ error (_("no such vector element (vector not associated)"));
+diff --git a/gdb/valops.c b/gdb/valops.c
+index 9525dc8499..4cd4fd96ae 100644
+--- a/gdb/valops.c
++++ b/gdb/valops.c
+@@ -3776,56 +3776,195 @@ value_of_this_silent (const struct language_defn *lang)
+
+ struct value *
+ value_slice (struct value *array, int lowbound, int length)
++{
++ /* Pass unaltered arguments to VALUE_SLICE_1, plus a default stride
++ value of '1', which returns every element between LOWBOUND and
++ (LOWBOUND + LENGTH). We also provide a default CALL_COUNT of '1'
++ as we are only considering the highest dimension, or we are
++ working on a one dimensional array. So we call VALUE_SLICE_1
++ exactly once. */
++ return value_slice_1 (array, lowbound, length, 1, 1);
++}
++
++/* VALUE_SLICE_1 is called for each array dimension to calculate the number
++ of elements as defined by the subscript expression.
++ CALL_COUNT is used to determine if we are calling the function once, e.g.
++ we are working on the current dimension of ARRAY, or if we are calling
++ the function repeatedly. In the later case we need to take elements
++ from the TARGET_TYPE of ARRAY.
++ With a CALL_COUNT greater than 1 we calculate the offsets for every element
++ that should be in the result array. Then we fetch the contents and then
++ copy them into the result array. The result array will have one dimension
++ less than the input array, so later on we need to recreate the indices and
++ ranges in the calling function. */
++
++struct value *
++value_slice_1 (struct value *array, int lowbound, int length,
++ int stride_length, int call_count)
+ {
+ struct type *slice_range_type, *slice_type, *range_type;
+- LONGEST lowerbound, upperbound;
+- struct value *slice;
+- struct type *array_type;
++ struct type *array_type = check_typedef (value_type (array));
++ struct type *elt_type = check_typedef (TYPE_TARGET_TYPE (array_type));
++ unsigned int elt_size, elt_offs;
++ LONGEST ary_high_bound, ary_low_bound;
++ struct value *v;
++ int slice_range_size, i = 0, row_count = 1, elem_count = 1;
+
+- array_type = check_typedef (value_type (array));
++ /* Check for legacy code if we are actually dealing with an array or
++ string. */
+ if (TYPE_CODE (array_type) != TYPE_CODE_ARRAY
+ && TYPE_CODE (array_type) != TYPE_CODE_STRING)
+ error (_("cannot take slice of non-array"));
+
+- range_type = TYPE_INDEX_TYPE (array_type);
+- if (get_discrete_bounds (range_type, &lowerbound, &upperbound) < 0)
+- error (_("slice from bad array or bitstring"));
++ ary_low_bound = TYPE_LOW_BOUND (TYPE_INDEX_TYPE (array_type));
++ ary_high_bound = TYPE_HIGH_BOUND (TYPE_INDEX_TYPE (array_type));
++
++ /* When we are working on a multi-dimensional array, we need to get the
++ attributes of the underlying type. */
++ if (call_count > 1)
++ {
++ ary_low_bound = TYPE_LOW_BOUND (TYPE_INDEX_TYPE (elt_type));
++ ary_high_bound = TYPE_HIGH_BOUND (TYPE_INDEX_TYPE (elt_type));
++ elt_type = check_typedef (TYPE_TARGET_TYPE (elt_type));
++ row_count = TYPE_LENGTH (array_type)
++ / TYPE_LENGTH (TYPE_TARGET_TYPE (array_type));
++ }
++
++ /* With a stride of '1', the number of elements per result row is equal to
++ the LENGTH of the subarray. With non-default stride values, we skip
++ elements, but have to add the start element to the total number of
++ elements per row. */
++ if (stride_length == 1)
++ elem_count = length;
++ else
++ elem_count = ((length - 1) / stride_length) + 1;
++
++ elt_size = TYPE_LENGTH (elt_type);
++ elt_offs = lowbound - ary_low_bound;
+
+- if (lowbound < lowerbound || length < 0
+- || lowbound + length - 1 > upperbound)
+- error (_("slice out of range"));
++ elt_offs *= elt_size;
++
++ /* Check for valid user input. In case of Fortran this was already done
++ in the calling function. */
++ if (call_count == 1
++ && (!TYPE_ARRAY_UPPER_BOUND_IS_UNDEFINED (array_type)
++ && elt_offs >= TYPE_LENGTH (array_type)))
++ error (_("no such vector element"));
++
++ /* CALL_COUNT is 1 when we are dealing either with the highest dimension
++ of the array, or a one dimensional array. Set RANGE_TYPE accordingly.
++ In both cases we calculate how many rows/elements will be in the output
++ array by setting slice_range_size. */
++ if (call_count == 1)
++ {
++ range_type = TYPE_INDEX_TYPE (array_type);
++ slice_range_size = ary_low_bound + elem_count - 1;
++
++ /* Check if the array bounds are valid. */
++ if (get_discrete_bounds (range_type, &ary_low_bound, &ary_high_bound) < 0)
++ error (_("slice from bad array or bitstring"));
++ }
++ /* When CALL_COUNT is greater than 1, we are dealing with an array of arrays.
++ So we need to get the type below the current one and set the RANGE_TYPE
++ accordingly. */
++ else
++ {
++ range_type = TYPE_INDEX_TYPE (TYPE_TARGET_TYPE (array_type));
++ slice_range_size = ary_low_bound + (row_count * elem_count) - 1;
++ ary_low_bound = TYPE_LOW_BOUND (range_type);
++ }
+
+ /* FIXME-type-allocation: need a way to free this type when we are
+- done with it. */
+- slice_range_type = create_static_range_type ((struct type *) NULL,
+- TYPE_TARGET_TYPE (range_type),
+- lowbound,
+- lowbound + length - 1);
++ done with it. */
+
++ slice_range_type = create_static_range_type (NULL, TYPE_TARGET_TYPE (range_type),
++ ary_low_bound, slice_range_size);
+ {
+- struct type *element_type = TYPE_TARGET_TYPE (array_type);
+- LONGEST offset
+- = (lowbound - lowerbound) * TYPE_LENGTH (check_typedef (element_type));
++ struct type *element_type;
++
++ /* When both CALL_COUNT and STRIDE_LENGTH equal 1, we can use the legacy
++ code for subarrays. */
++ if (call_count == 1 && stride_length == 1)
++ {
++ element_type = TYPE_TARGET_TYPE (array_type);
++
++ slice_type = create_array_type (NULL, element_type, slice_range_type);
+
+- slice_type = create_array_type ((struct type *) NULL,
+- element_type,
+- slice_range_type);
+- TYPE_CODE (slice_type) = TYPE_CODE (array_type);
++ TYPE_CODE (slice_type) = TYPE_CODE (array_type);
+
+- if (VALUE_LVAL (array) == lval_memory && value_lazy (array))
+- slice = allocate_value_lazy (slice_type);
++ if (VALUE_LVAL (array) == lval_memory && value_lazy (array))
++ v = allocate_value_lazy (slice_type);
++ else
++ {
++ v = allocate_value (slice_type);
++ value_contents_copy (v,
++ value_embedded_offset (v),
++ array,
++ value_embedded_offset (array) + elt_offs,
++ elt_size * longest_to_int (length));
++ }
++
++ }
++ /* With a CALL_COUNT or STRIDE_LENGTH are greater than 1 we are working
++ on a range of ranges. So we copy the relevant elements into the
++ new array we return. */
+ else
+ {
+- slice = allocate_value (slice_type);
+- value_contents_copy (slice, 0, array, offset,
+- type_length_units (slice_type));
++ int j, offs_store = elt_offs;
++ LONGEST dst_offset = 0;
++ LONGEST src_row_length = TYPE_LENGTH (TYPE_TARGET_TYPE (array_type));
++
++ if (call_count == 1)
++ {
++ /* When CALL_COUNT is equal to 1 we are working on the current range
++ and use these elements directly. */
++ element_type = TYPE_TARGET_TYPE (array_type);
++ }
++ else
++ {
++ /* Working on an array of arrays, the type of the elements is the type
++ of the subarrays' type. */
++ element_type = TYPE_TARGET_TYPE (TYPE_TARGET_TYPE (array_type));
++ }
++
++ slice_type = create_array_type (NULL, element_type, slice_range_type);
++
++ /* If we have a one dimensional array, we copy its TYPE_CODE. For a
++ multi dimensional array we copy the embedded type's TYPE_CODE. */
++ if (call_count == 1)
++ TYPE_CODE (slice_type) = TYPE_CODE (array_type);
++ else
++ TYPE_CODE (slice_type) = TYPE_CODE (TYPE_TARGET_TYPE (array_type));
++
++ v = allocate_value (slice_type);
++
++ /* Iterate through the rows of the outer array and set the new offset
++ for each row. */
++ for (i = 0; i < row_count; i++)
++ {
++ elt_offs = offs_store + i * src_row_length;
++
++ /* Iterate through the elements in each row to copy only those. */
++ for (j = 1; j <= elem_count; j++)
++ {
++ /* Fetches the contents of ARRAY and copies them into V. */
++ value_contents_copy (v, dst_offset, array, elt_offs, elt_size);
++ elt_offs += elt_size * stride_length;
++ dst_offset += elt_size;
++ }
++ }
+ }
+
+- set_value_component_location (slice, array);
+- set_value_offset (slice, value_offset (array) + offset);
++ set_value_component_location (v, array);
++ if (VALUE_LVAL (v) == lval_register)
++ {
++ VALUE_REGNUM (v) = VALUE_REGNUM (array);
++ VALUE_NEXT_FRAME_ID (v) = VALUE_NEXT_FRAME_ID (array);
++ }
++ set_value_offset (v, value_offset (array) + elt_offs);
+ }
+
+- return slice;
++ return v;
+ }
+
+ /* Create a value for a FORTRAN complex number. Currently most of the
+diff --git a/gdb/value.h b/gdb/value.h
+index 7dc67dc721..03ca06448f 100644
+--- a/gdb/value.h
++++ b/gdb/value.h
+@@ -1128,6 +1128,8 @@ extern struct value *varying_to_slice (struct value *);
+
+ extern struct value *value_slice (struct value *, int, int);
+
++extern struct value *value_slice_1 (struct value *, int, int, int, int);
++
+ extern struct value *value_literal_complex (struct value *, struct value *,
+ struct type *);
+
+--
+2.14.3
+
diff --git a/gdb-vla-intel-stringbt-fix.patch b/gdb-vla-intel-stringbt-fix.patch
new file mode 100644
index 0000000..6f4c625
--- /dev/null
+++ b/gdb-vla-intel-stringbt-fix.patch
@@ -0,0 +1,194 @@
+From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
+From: Jan Kratochvil <jan.kratochvil(a)redhat.com>
+Date: Fri, 1 Aug 2014 23:02:17 +0200
+Subject: Crash regression(?) printing Fortran strings in bt [Re: [V2 00/23]
+ Fortran dynamic array support]
+
+FileName: gdb-vla-intel-stringbt-fix.patch
+
+;;=push+jan
+
+http://sourceware.org/ml/gdb-patches/2014-08/msg00025.html
+
+On Fri, 01 Aug 2014 09:20:19 +0200, Keven Boell wrote:
+> I just tried it on Fedora 20 i686. Applied the patch, you mentioned, on top of
+> the Fortran VLA series and executed your dynamic-other-frame test. Everything
+> is working fine here, I cannot reproduce the crash.
+
+I have it reproducible on Fedora 20 i686 with plain
+CFLAGS=-g ./configure;make;cd gdb/testsuite;make site.exp;runtest gdb.fortran/dynamic-other-frame.exp
+
+Besides that I have updated the testcase with
+ gdb_test_no_output "set print frame-arguments all"
+so that there is no longer needed the patch:
+ [patch] Display Fortran strings in backtraces
+ https://sourceware.org/ml/gdb-patches/2014-07/msg00709.html
+
+The fix below has no regressions for me. Unfortunately I do not see why you
+cannot reproduce it.
+
+Thanks,
+Jan
+---
+ gdb/dwarf2loc.c | 15 +++++++++
+ .../gdb.fortran/dynamic-other-frame-stub.f90 | 24 +++++++++++++
+ gdb/testsuite/gdb.fortran/dynamic-other-frame.exp | 39 ++++++++++++++++++++++
+ gdb/testsuite/gdb.fortran/dynamic-other-frame.f90 | 36 ++++++++++++++++++++
+ 4 files changed, 114 insertions(+)
+ create mode 100644 gdb/testsuite/gdb.fortran/dynamic-other-frame-stub.f90
+ create mode 100644 gdb/testsuite/gdb.fortran/dynamic-other-frame.exp
+ create mode 100644 gdb/testsuite/gdb.fortran/dynamic-other-frame.f90
+
+diff --git a/gdb/dwarf2loc.c b/gdb/dwarf2loc.c
+index 5105c8d23a..5486e4dc12 100644
+--- a/gdb/dwarf2loc.c
++++ b/gdb/dwarf2loc.c
+@@ -42,6 +42,7 @@
+ #include <algorithm>
+ #include <vector>
+ #include <unordered_set>
++#include <functional>
+ #include "common/underlying.h"
+ #include "common/byte-vector.h"
+
+@@ -2348,6 +2349,20 @@ dwarf2_evaluate_loc_desc_full (struct type *type, struct frame_info *frame,
+ ctx.per_cu = per_cu;
+ ctx.obj_address = 0;
+
++frame_id old_frame_id (get_frame_id (deprecated_safe_get_selected_frame ()));
++class RestoreCall {
++private:
++ const std::function<void ()> func;
++public:
++ RestoreCall(std::function<void ()> func_):func(func_) {}
++ ~RestoreCall() { func(); }
++} restore_frame([=]() {
++ frame_info *old_frame (frame_find_by_id (old_frame_id));
++ if (old_frame != NULL)
++ select_frame (old_frame);
++});
++if (frame != NULL) select_frame (frame);
++
+ scoped_value_mark free_values;
+
+ ctx.gdbarch = get_objfile_arch (objfile);
+diff --git a/gdb/testsuite/gdb.fortran/dynamic-other-frame-stub.f90 b/gdb/testsuite/gdb.fortran/dynamic-other-frame-stub.f90
+new file mode 100644
+index 0000000000..261ce17ae5
+--- /dev/null
++++ b/gdb/testsuite/gdb.fortran/dynamic-other-frame-stub.f90
+@@ -0,0 +1,24 @@
++! Copyright 2010 Free Software Foundation, Inc.
++!
++! This program is free software; you can redistribute it and/or modify
++! it under the terms of the GNU General Public License as published by
++! the Free Software Foundation; either version 2 of the License, or
++! (at your option) any later version.
++!
++! This program is distributed in the hope that it will be useful,
++! but WITHOUT ANY WARRANTY; without even the implied warranty of
++! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++! GNU General Public License for more details.
++!
++! You should have received a copy of the GNU General Public License
++! along with this program; if not, write to the Free Software
++! Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
++!
++! Ihis file is the Fortran source file for dynamic.exp.
++! Original file written by Jakub Jelinek <jakub(a)redhat.com>.
++! Modified for the GDB testcase by Jan Kratochvil <jan.kratochvil(a)redhat.com>.
++
++subroutine bar
++ real :: dummy
++ dummy = 1
++end subroutine bar
+diff --git a/gdb/testsuite/gdb.fortran/dynamic-other-frame.exp b/gdb/testsuite/gdb.fortran/dynamic-other-frame.exp
+new file mode 100644
+index 0000000000..570a28ca65
+--- /dev/null
++++ b/gdb/testsuite/gdb.fortran/dynamic-other-frame.exp
+@@ -0,0 +1,39 @@
++# Copyright 2010 Free Software Foundation, Inc.
++
++# This program is free software; you can redistribute it and/or modify
++# it under the terms of the GNU General Public License as published by
++# the Free Software Foundation; either version 2 of the License, or
++# (at your option) any later version.
++#
++# This program is distributed in the hope that it will be useful,
++# but WITHOUT ANY WARRANTY; without even the implied warranty of
++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++# GNU General Public License for more details.
++#
++# You should have received a copy of the GNU General Public License
++# along with this program; if not, write to the Free Software
++# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
++
++set testfile "dynamic-other-frame"
++set srcfile1 ${testfile}.f90
++set srcfile2 ${testfile}-stub.f90
++set objfile2 [standard_output_file ${testfile}-stub.o]
++set executable ${testfile}
++set binfile [standard_output_file ${executable}]
++
++if { [gdb_compile "${srcdir}/${subdir}/${srcfile2}" "${objfile2}" object {f90}] != ""
++ || [gdb_compile "${srcdir}/${subdir}/${srcfile1} ${objfile2}" "${binfile}" executable {debug f90}] != "" } {
++ untested "Couldn't compile ${srcfile1} or ${srcfile2}"
++ return -1
++}
++
++clean_restart ${executable}
++
++gdb_test_no_output "set print frame-arguments all"
++
++if ![runto bar_] then {
++ perror "couldn't run to bar_"
++ continue
++}
++
++gdb_test "bt" {foo \(string='hello'.*}
+diff --git a/gdb/testsuite/gdb.fortran/dynamic-other-frame.f90 b/gdb/testsuite/gdb.fortran/dynamic-other-frame.f90
+new file mode 100644
+index 0000000000..2bc637db49
+--- /dev/null
++++ b/gdb/testsuite/gdb.fortran/dynamic-other-frame.f90
+@@ -0,0 +1,36 @@
++! Copyright 2010 Free Software Foundation, Inc.
++!
++! This program is free software; you can redistribute it and/or modify
++! it under the terms of the GNU General Public License as published by
++! the Free Software Foundation; either version 2 of the License, or
++! (at your option) any later version.
++!
++! This program is distributed in the hope that it will be useful,
++! but WITHOUT ANY WARRANTY; without even the implied warranty of
++! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++! GNU General Public License for more details.
++!
++! You should have received a copy of the GNU General Public License
++! along with this program; if not, write to the Free Software
++! Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
++!
++! Ihis file is the Fortran source file for dynamic.exp.
++! Original file written by Jakub Jelinek <jakub(a)redhat.com>.
++! Modified for the GDB testcase by Jan Kratochvil <jan.kratochvil(a)redhat.com>.
++
++subroutine foo (string)
++ interface
++ subroutine bar
++ end subroutine
++ end interface
++ character string*(*)
++ call bar ! stop-here
++end subroutine foo
++program test
++ interface
++ subroutine foo (string)
++ character string*(*)
++ end subroutine
++ end interface
++ call foo ('hello')
++end
+--
+2.14.3
+
diff --git a/gdb-vla-intel-tests.patch b/gdb-vla-intel-tests.patch
deleted file mode 100644
index 427ec95..0000000
--- a/gdb-vla-intel-tests.patch
+++ /dev/null
@@ -1,293 +0,0 @@
-Index: gdb-7.10.50.20160106/gdb/testsuite/gdb.fortran/vla-func.exp
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ gdb-7.10.50.20160106/gdb/testsuite/gdb.fortran/vla-func.exp 2016-01-08 19:15:44.983637680 +0100
-@@ -0,0 +1,61 @@
-+# Copyright 2014 Free Software Foundation, Inc.
-+
-+# This program is free software; you can redistribute it and/or modify
-+# it under the terms of the GNU General Public License as published by
-+# the Free Software Foundation; either version 3 of the License, or
-+# (at your option) any later version.
-+#
-+# This program is distributed in the hope that it will be useful,
-+# but WITHOUT ANY WARRANTY; without even the implied warranty of
-+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+# GNU General Public License for more details.
-+#
-+# You should have received a copy of the GNU General Public License
-+# along with this program. If not, see <http://www.gnu.org/licenses/>.
-+
-+standard_testfile ".f90"
-+
-+if { [prepare_for_testing ${testfile}.exp ${testfile} ${srcfile} \
-+ {debug f90 quiet}] } {
-+ return -1
-+}
-+
-+if ![runto MAIN__] then {
-+ perror "couldn't run to breakpoint MAIN__"
-+ continue
-+}
-+
-+# Check VLA passed to first Fortran function.
-+gdb_breakpoint [gdb_get_line_number "func1-vla-passed"]
-+gdb_continue_to_breakpoint "func1-vla-passed"
-+gdb_test "print vla" " = \\( *\\( *22, *22, *22,\[()22, .\]*\\)" \
-+ "print vla (func1)"
-+gdb_test "ptype vla" "type = integer\\\(kind=4\\\) \\\(10,10\\\)" \
-+ "ptype vla (func1)"
-+
-+gdb_breakpoint [gdb_get_line_number "func1-vla-modified"]
-+gdb_continue_to_breakpoint "func1-vla-modified"
-+gdb_test "print vla(5,5)" " = 55" "print vla(5,5) (func1)"
-+gdb_test "print vla(7,7)" " = 77" "print vla(5,5) (func1)"
-+
-+# Check if the values are correct after returning from func1
-+gdb_breakpoint [gdb_get_line_number "func1-returned"]
-+gdb_continue_to_breakpoint "func1-returned"
-+gdb_test "print ret" " = .TRUE." "print ret after func1 returned"
-+
-+# Check VLA passed to second Fortran function
-+gdb_breakpoint [gdb_get_line_number "func2-vla-passed"]
-+gdb_continue_to_breakpoint "func2-vla-passed"
-+gdb_test "print vla" \
-+ " = \\\(44, 44, 44, 44, 44, 44, 44, 44, 44, 44\\\)" \
-+ "print vla (func2)"
-+gdb_test "ptype vla" "type = integer\\\(kind=4\\\) \\\(10\\\)" \
-+ "ptype vla (func2)"
-+
-+# Check if the returned VLA has the correct values and ptype.
-+gdb_breakpoint [gdb_get_line_number "func2-returned"]
-+gdb_continue_to_breakpoint "func2-returned"
-+gdb_test "print vla3" " = \\\(1, 2, 44, 4, 44, 44, 44, 8, 44, 44\\\)" \
-+ "print vla3 (after func2)"
-+gdb_test "ptype vla3" "type = integer\\\(kind=4\\\) \\\(10\\\)" \
-+ "ptype vla3 (after func2)"
-Index: gdb-7.10.50.20160106/gdb/testsuite/gdb.fortran/vla-func.f90
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ gdb-7.10.50.20160106/gdb/testsuite/gdb.fortran/vla-func.f90 2016-01-08 19:15:44.983637680 +0100
-@@ -0,0 +1,71 @@
-+! Copyright 2014 Free Software Foundation, Inc.
-+!
-+! This program is free software; you can redistribute it and/or modify
-+! it under the terms of the GNU General Public License as published by
-+! the Free Software Foundation; either version 2 of the License, or
-+! (at your option) any later version.
-+!
-+! This program is distributed in the hope that it will be useful,
-+! but WITHOUT ANY WARRANTY; without even the implied warranty of
-+! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+! GNU General Public License for more details.
-+!
-+! You should have received a copy of the GNU General Public License
-+! along with this program; if not, write to the Free Software
-+! Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-+
-+logical function func1 (vla)
-+ implicit none
-+ integer, allocatable :: vla (:, :)
-+ func1 = allocated(vla)
-+ vla(5,5) = 55 ! func1-vla-passed
-+ vla(7,7) = 77
-+ return ! func1-vla-modified
-+end function func1
-+
-+function func2(vla)
-+ implicit none
-+ integer :: vla (:)
-+ integer :: func2(size(vla))
-+ integer :: k
-+
-+ vla(1) = 1 ! func2-vla-passed
-+ vla(2) = 2
-+ vla(4) = 4
-+ vla(8) = 8
-+
-+ func2 = vla
-+end function func2
-+
-+program vla_func
-+ implicit none
-+ interface
-+ logical function func1 (vla)
-+ integer, allocatable :: vla (:, :)
-+ end function
-+ end interface
-+ interface
-+ function func2 (vla)
-+ integer :: vla (:)
-+ integer func2(size(vla))
-+ end function
-+ end interface
-+
-+ logical :: ret
-+ integer, allocatable :: vla1 (:, :)
-+ integer, allocatable :: vla2 (:)
-+ integer, allocatable :: vla3 (:)
-+
-+ ret = .FALSE.
-+
-+ allocate (vla1 (10,10))
-+ vla1(:,:) = 22
-+
-+ allocate (vla2 (10))
-+ vla2(:) = 44
-+
-+ ret = func1(vla1)
-+ vla3 = func2(vla2) ! func1-returned
-+
-+ ret = .TRUE. ! func2-returned
-+end program vla_func
-Index: gdb-7.10.50.20160106/gdb/testsuite/gdb.fortran/vla-stringsold.exp
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ gdb-7.10.50.20160106/gdb/testsuite/gdb.fortran/vla-stringsold.exp 2016-01-08 19:15:44.984637686 +0100
-@@ -0,0 +1,101 @@
-+# Copyright 2014 Free Software Foundation, Inc.
-+
-+# This program is free software; you can redistribute it and/or modify
-+# it under the terms of the GNU General Public License as published by
-+# the Free Software Foundation; either version 3 of the License, or
-+# (at your option) any later version.
-+#
-+# This program is distributed in the hope that it will be useful,
-+# but WITHOUT ANY WARRANTY; without even the implied warranty of
-+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+# GNU General Public License for more details.
-+#
-+# You should have received a copy of the GNU General Public License
-+# along with this program. If not, see <http://www.gnu.org/licenses/>.
-+
-+standard_testfile ".f90"
-+
-+if { [prepare_for_testing ${testfile}.exp ${testfile} ${srcfile} \
-+ {debug f90 quiet}] } {
-+ return -1
-+}
-+
-+# check that all fortran standard datatypes will be
-+# handled correctly when using as VLA's
-+
-+if ![runto MAIN__] then {
-+ perror "couldn't run to breakpoint MAIN__"
-+ continue
-+}
-+
-+gdb_breakpoint [gdb_get_line_number "var_char-allocated-1"]
-+gdb_continue_to_breakpoint "var_char-allocated-1"
-+gdb_test "print var_char" \
-+ " = \\(PTR TO -> \\( character\\*10 \\)\\) ${hex}" \
-+ "print var_char after allocated first time"
-+gdb_test "whatis var_char" "type = PTR TO -> \\( character\\*10 \\)" \
-+ "whatis var_char first time"
-+gdb_test "ptype var_char" "type = PTR TO -> \\( character\\*10 \\)" \
-+ "ptype var_char first time"
-+gdb_test "next" "\\d+.*var_char = 'foo'.*" \
-+ "next to allocation status of var_char"
-+gdb_test "print l" " = .TRUE." "print allocation status first time"
-+
-+gdb_breakpoint [gdb_get_line_number "var_char-filled-1"]
-+gdb_continue_to_breakpoint "var_char-filled-1"
-+gdb_test "print var_char" \
-+ " = \\(PTR TO -> \\( character\\*3 \\)\\) ${hex}" \
-+ "print var_char after filled first time"
-+gdb_test "print *var_char" " = 'foo'" \
-+ "print *var_char after filled first time"
-+gdb_test "whatis var_char" "type = PTR TO -> \\( character\\*3 \\)" \
-+ "whatis var_char after filled first time"
-+gdb_test "ptype var_char" "type = PTR TO -> \\( character\\*3 \\)" \
-+ "ptype var_char after filled first time"
-+gdb_test "print var_char(1)" " = 102 'f'" "print var_char(1)"
-+gdb_test "print var_char(3)" " = 111 'o'" "print var_char(3)"
-+
-+gdb_breakpoint [gdb_get_line_number "var_char-filled-2"]
-+gdb_continue_to_breakpoint "var_char-filled-2"
-+gdb_test "print var_char" \
-+ " = \\(PTR TO -> \\( character\\*6 \\)\\) ${hex}" \
-+ "print var_char after allocated second time"
-+gdb_test "print *var_char" " = 'foobar'" \
-+ "print *var_char after allocated second time"
-+gdb_test "whatis var_char" "type = PTR TO -> \\( character\\*6 \\)" \
-+ "whatis var_char second time"
-+gdb_test "ptype var_char" "type = PTR TO -> \\( character\\*6 \\)" \
-+ "ptype var_char second time"
-+
-+gdb_breakpoint [gdb_get_line_number "var_char-empty"]
-+gdb_continue_to_breakpoint "var_char-empty"
-+gdb_test "print var_char" \
-+ " = \\(PTR TO -> \\( character\\*0 \\)\\) ${hex}" \
-+ "print var_char after set empty"
-+gdb_test "print *var_char" " = \"\"" "print *var_char after set empty"
-+gdb_test "whatis var_char" "type = PTR TO -> \\( character\\*0 \\)" \
-+ "whatis var_char after set empty"
-+gdb_test "ptype var_char" "type = PTR TO -> \\( character\\*0 \\)" \
-+ "ptype var_char after set empty"
-+
-+gdb_breakpoint [gdb_get_line_number "var_char-allocated-3"]
-+gdb_continue_to_breakpoint "var_char-allocated-3"
-+gdb_test "print var_char" \
-+ " = \\(PTR TO -> \\( character\\*21 \\)\\) ${hex}" \
-+ "print var_char after allocated third time"
-+gdb_test "whatis var_char" "type = PTR TO -> \\( character\\*21 \\)" \
-+ "whatis var_char after allocated third time"
-+gdb_test "ptype var_char" "type = PTR TO -> \\( character\\*21 \\)" \
-+ "ptype var_char after allocated third time"
-+
-+gdb_breakpoint [gdb_get_line_number "var_char_p-associated"]
-+gdb_continue_to_breakpoint "var_char_p-associated"
-+gdb_test "print var_char_p" \
-+ " = \\(PTR TO -> \\( character\\*7 \\)\\) ${hex}" \
-+ "print var_char_p after associated"
-+gdb_test "print *var_char_p" " = 'johndoe'" \
-+ "print *var_char_ after associated"
-+gdb_test "whatis var_char_p" "type = PTR TO -> \\( character\\*7 \\)" \
-+ "whatis var_char_p after associated"
-+gdb_test "ptype var_char_p" "type = PTR TO -> \\( character\\*7 \\)" \
-+ "ptype var_char_p after associated"
-Index: gdb-7.10.50.20160106/gdb/testsuite/gdb.fortran/vla-stringsold.f90
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ gdb-7.10.50.20160106/gdb/testsuite/gdb.fortran/vla-stringsold.f90 2016-01-08 19:15:44.984637686 +0100
-@@ -0,0 +1,40 @@
-+! Copyright 2014 Free Software Foundation, Inc.
-+!
-+! This program is free software; you can redistribute it and/or modify
-+! it under the terms of the GNU General Public License as published by
-+! the Free Software Foundation; either version 2 of the License, or
-+! (at your option) any later version.
-+!
-+! This program is distributed in the hope that it will be useful,
-+! but WITHOUT ANY WARRANTY; without even the implied warranty of
-+! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+! GNU General Public License for more details.
-+!
-+! You should have received a copy of the GNU General Public License
-+! along with this program; if not, write to the Free Software
-+! Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-+
-+program vla_strings
-+ character(len=:), target, allocatable :: var_char
-+ character(len=:), pointer :: var_char_p
-+ logical :: l
-+
-+ allocate(character(len=10) :: var_char)
-+ l = allocated(var_char) ! var_char-allocated-1
-+ var_char = 'foo'
-+ deallocate(var_char) ! var_char-filled-1
-+ l = allocated(var_char) ! var_char-deallocated
-+ allocate(character(len=42) :: var_char)
-+ l = allocated(var_char)
-+ var_char = 'foobar'
-+ var_char = '' ! var_char-filled-2
-+ var_char = 'bar' ! var_char-empty
-+ deallocate(var_char)
-+ allocate(character(len=21) :: var_char)
-+ l = allocated(var_char) ! var_char-allocated-3
-+ var_char = 'johndoe'
-+ var_char_p => var_char
-+ l = associated(var_char_p) ! var_char_p-associated
-+ var_char_p => null()
-+ l = associated(var_char_p) ! var_char_p-not-associated
-+end program vla_strings
diff --git a/gdb-x86_64-i386-syscall-restart.patch b/gdb-x86_64-i386-syscall-restart.patch
index af3cccd..7c731e3 100644
--- a/gdb-x86_64-i386-syscall-restart.patch
+++ b/gdb-x86_64-i386-syscall-restart.patch
@@ -1,3 +1,13 @@
+From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
+From: Fedora GDB patches <invalid(a)email.com>
+Date: Fri, 27 Oct 2017 21:07:50 +0200
+Subject: gdb-x86_64-i386-syscall-restart.patch
+
+FileName: gdb-x86_64-i386-syscall-restart.patch
+
+;; Fix syscall restarts for amd64->i386 biarch.
+;;=push+jan
+
http://sourceware.org/ml/gdb-patches/2009-11/msg00592.html
Subject: [patch] Fix syscall restarts for amd64->i386 biarch
@@ -15,7 +25,6 @@ x86_64 i386 i386 PASS on recent kernels
(PASS: kernel-2.6.32-0.55.rc8.git1.fc13.x86_64)
i386 i386 i386 PASS
-
Currently gdb.base/interrupt.exp fails on amd64 host running under
--target_board unix/-m32 with:
continue
@@ -29,7 +38,6 @@ Currently gdb.base/interrupt.exp fails on amd64 host running under
* at syscall exit tracing, but they will never be left for the debugged user
* process to see.
*/
-#define ERESTARTSYS 512
"Unknown error 512" printed above is printed by the inferior itself, not by GDB.
@@ -39,7 +47,6 @@ It is because GDB reads it as 0xfffffffffffffe00 but writes it back as
+ for -ERESTART* values -512 being above 0xfffffffffffffe00; tested by
+ interrupt.exp. */
-
Quote of Roland McGrath from IRC:
roland: in the user_regset model, there are 64-bit user_regset flavors and
@@ -62,7 +69,6 @@ roland: so a 64-bit debugger should see and be able to fiddle the full
registers. it can even change cs via ptrace to force the inferior into
running 32 or 64 bit code.
-
Saving whole 64bits for i386 targets on x86_64 hosts does not much match the
GDB architecture as `struct type' for these registers still should be 32bit
etc. Therefore provided just this exception.
@@ -72,20 +78,23 @@ interruption to do full inferior save/restore from GDB regcache.
Regression tested on {x86_64,x86_64-m32,i686}-fedora12-linux-gnu.
-
Thanks,
Jan
-
gdb/
2009-11-29 Jan Kratochvil <jan.kratochvil(a)redhat.com>
* amd64-nat.c (amd64_collect_native_gregset): Do not pre-clear %eax.
Sign extend it afterwards.
+---
+ gdb/amd64-nat.c | 20 ++++++++++++++++++--
+ 1 file changed, 18 insertions(+), 2 deletions(-)
+diff --git a/gdb/amd64-nat.c b/gdb/amd64-nat.c
+index 12d364a716..0359edf041 100644
--- a/gdb/amd64-nat.c
+++ b/gdb/amd64-nat.c
-@@ -131,9 +131,9 @@ amd64_collect_native_gregset (const struct regcache *regcache,
+@@ -135,9 +135,9 @@ amd64_collect_native_gregset (const struct regcache *regcache,
{
num_regs = amd64_native_gregset32_num_regs;
@@ -97,7 +106,7 @@ gdb/
{
if (regnum == -1 || regnum == i)
memset (regs + amd64_native_gregset_reg_offset (gdbarch, i), 0, 8);
-@@ -159,4 +159,20 @@ amd64_collect_native_gregset (const struct regcache *regcache,
+@@ -163,4 +163,20 @@ amd64_collect_native_gregset (const struct regcache *regcache,
regcache_raw_collect (regcache, i, regs + offset);
}
}
@@ -118,4 +127,6 @@ gdb/
+ }
+ }
}
+--
+2.14.3
diff --git a/insight-7.12-gdb-6.3-readnever-20050907.patch b/insight-7.12-gdb-6.3-readnever-20050907.patch
deleted file mode 100644
index 21c467a..0000000
--- a/insight-7.12-gdb-6.3-readnever-20050907.patch
+++ /dev/null
@@ -1,78 +0,0 @@
-diff -Naurp insight-7.12.50.20170416.orig/gdb/doc/gdb.texinfo insight-7.12.50.20170416.new/gdb/doc/gdb.texinfo
---- insight-7.12.50.20170416.orig/gdb/doc/gdb.texinfo 2017-04-16 11:51:34.697009514 +0100
-+++ insight-7.12.50.20170416.new/gdb/doc/gdb.texinfo 2017-04-16 11:56:31.611716645 +0100
-@@ -1037,6 +1037,12 @@ Read each symbol file's entire symbol ta
- the default, which is to read it incrementally as it is needed.
- This makes startup slower, but makes future operations faster.
-
-+@item --readnever
-+@cindex @code{--readnever}
-+Do not read each symbol file's symbolic debug information. This makes
-+startup faster but at the expense of not being able to perform
-+symbolic debugging.
-+
- @end table
-
- @node Mode Options
-diff -Naurp insight-7.12.50.20170416.orig/gdb/dwarf2read.c insight-7.12.50.20170416.new/gdb/dwarf2read.c
---- insight-7.12.50.20170416.orig/gdb/dwarf2read.c 2017-04-15 01:21:12.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/dwarf2read.c 2017-04-16 11:58:01.869539574 +0100
-@@ -73,6 +73,7 @@
- #include "common/function-view.h"
- #include "common/gdb_optional.h"
- #include "common/underlying.h"
-+#include "top.h"
-
- #include <fcntl.h>
- #include <sys/types.h>
-@@ -2207,7 +2208,8 @@ dwarf2_has_info (struct objfile *objfile
- (void *) names);
- dwarf2_per_objfile->objfile = objfile;
- }
-- return (!dwarf2_per_objfile->info.is_virtual
-+ return !readnever_symbol_files &&
-+ (!dwarf2_per_objfile->info.is_virtual
- && dwarf2_per_objfile->info.s.section != NULL
- && !dwarf2_per_objfile->abbrev.is_virtual
- && dwarf2_per_objfile->abbrev.s.section != NULL);
-diff -Naurp insight-7.12.50.20170416.orig/gdb/main.c insight-7.12.50.20170416.new/gdb/main.c
---- insight-7.12.50.20170416.orig/gdb/main.c 2017-04-09 01:11:01.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/main.c 2017-04-16 11:56:31.612716654 +0100
-@@ -614,6 +614,7 @@ captured_main_1 (struct captured_main_ar
- {"tui", no_argument, 0, OPT_TUI},
- {"dbx", no_argument, &dbx_commands, 1},
- {"readnow", no_argument, &readnow_symbol_files, 1},
-+ {"readnever", no_argument, &readnever_symbol_files, 1},
- {"r", no_argument, &readnow_symbol_files, 1},
- {"quiet", no_argument, &quiet, 1},
- {"q", no_argument, &quiet, 1},
-@@ -1202,6 +1203,7 @@ Selection of debuggee and its files:\n\n
- --se=FILE Use FILE as symbol file and executable file.\n\
- --symbols=SYMFILE Read symbols from SYMFILE.\n\
- --readnow Fully read symbol files on first access.\n\
-+ --readnever Do not read symbol files.\n\
- --write Set writing into executable and core files.\n\n\
- "), stream);
- fputs_unfiltered (_("\
-diff -Naurp insight-7.12.50.20170416.orig/gdb/symfile.c insight-7.12.50.20170416.new/gdb/symfile.c
---- insight-7.12.50.20170416.orig/gdb/symfile.c 2017-04-15 01:21:12.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/symfile.c 2017-04-16 11:56:31.614716672 +0100
-@@ -79,6 +79,7 @@ static void clear_symtab_users_cleanup (
-
- /* Global variables owned by this file. */
- int readnow_symbol_files; /* Read full symbols immediately. */
-+int readnever_symbol_files; /* Never read full symbols. */
-
- /* Functions this file defines. */
-
-diff -Naurp insight-7.12.50.20170416.orig/gdb/top.h insight-7.12.50.20170416.new/gdb/top.h
---- insight-7.12.50.20170416.orig/gdb/top.h 2017-04-09 01:11:01.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/top.h 2017-04-16 11:56:31.622716745 +0100
-@@ -269,6 +269,7 @@ extern int gdb_in_secondary_prompt_p (st
-
- /* From random places. */
- extern int readnow_symbol_files;
-+extern int readnever_symbol_files;
-
- /* Perform _initialize initialization. */
- extern void gdb_init (char *);
diff --git a/insight-7.12-gdb-6.6-buildid-locate-core-as-arg.patch b/insight-7.12-gdb-6.6-buildid-locate-core-as-arg.patch
deleted file mode 100644
index a43b4aa..0000000
--- a/insight-7.12-gdb-6.6-buildid-locate-core-as-arg.patch
+++ /dev/null
@@ -1,134 +0,0 @@
-diff -Naurp insight-7.12.50.20170416.orig/gdb/common/common-exceptions.h insight-7.12.50.20170416.new/gdb/common/common-exceptions.h
---- insight-7.12.50.20170416.orig/gdb/common/common-exceptions.h 2017-03-04 04:09:18.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/common/common-exceptions.h 2017-04-16 12:17:55.954426687 +0100
-@@ -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 -Naurp insight-7.12.50.20170416.orig/gdb/exec.c insight-7.12.50.20170416.new/gdb/exec.c
---- insight-7.12.50.20170416.orig/gdb/exec.c 2017-01-21 02:32:23.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/exec.c 2017-04-16 12:17:55.952426669 +0100
-@@ -35,6 +35,7 @@
- #include "progspace.h"
- #include "gdb_bfd.h"
- #include "gcore.h"
-+#include "exceptions.h"
-
- #include <fcntl.h>
- #include "readline/readline.h"
-@@ -359,12 +360,27 @@ exec_file_attach (const char *filename,
-
- if (!bfd_check_format_matches (exec_bfd, bfd_object, &matching))
- {
-+ int is_core;
-+
-+ /* If the user accidentally did "gdb core", print a useful
-+ error message. Check it only after bfd_object has been checked as
-+ a valid executable may get recognized for example also as
-+ "trad-core". */
-+ is_core = bfd_check_format (exec_bfd, bfd_core);
-+
- /* Make sure to close exec_bfd, or else "run" might try to use
- it. */
- exec_close ();
-- error (_("\"%s\": not in executable format: %s"),
-- scratch_pathname,
-- gdb_bfd_errmsg (bfd_get_error (), matching));
-+
-+ if (is_core != 0)
-+ throw_error (IS_CORE_ERROR,
-+ _("\"%s\" is a core file.\n"
-+ "Please specify an executable to debug."),
-+ scratch_pathname);
-+ else
-+ error (_("\"%s\": not in executable format: %s"),
-+ scratch_pathname,
-+ gdb_bfd_errmsg (bfd_get_error (), matching));
- }
-
- if (build_section_table (exec_bfd, §ions, §ions_end))
-diff -Naurp insight-7.12.50.20170416.orig/gdb/main.c insight-7.12.50.20170416.new/gdb/main.c
---- insight-7.12.50.20170416.orig/gdb/main.c 2017-04-16 12:16:41.229745385 +0100
-+++ insight-7.12.50.20170416.new/gdb/main.c 2017-04-16 12:17:55.953426678 +0100
-@@ -458,6 +458,37 @@ struct cmdarg
- char *string;
- };
-
-+/* Call exec_file_attach. If it detected FILENAME is a core file call
-+ core_file_command. Print the original exec_file_attach error only if
-+ core_file_command failed to find a matching executable. */
-+
-+static void
-+exec_or_core_file_attach (const char *filename, int from_tty)
-+{
-+ volatile struct gdb_exception e;
-+
-+ gdb_assert (exec_bfd == NULL);
-+
-+ TRY
-+ {
-+ exec_file_attach (filename, from_tty);
-+ }
-+ CATCH (e, RETURN_MASK_ALL)
-+ {
-+ if (e.error == IS_CORE_ERROR)
-+ {
-+ core_file_command ((char *) filename, from_tty);
-+
-+ /* Iff the core file found its executable suppress the error message
-+ from exec_file_attach. */
-+ if (exec_bfd != NULL)
-+ return;
-+ }
-+ throw_exception (e);
-+ }
-+ END_CATCH
-+}
-+
- static void
- captured_main_1 (struct captured_main_args *context)
- {
-@@ -880,6 +911,8 @@ captured_main_1 (struct captured_main_ar
- {
- symarg = argv[optind];
- execarg = argv[optind];
-+ if (optind + 1 == argc && corearg == NULL)
-+ corearg = argv[optind];
- optind++;
- }
-
-@@ -1030,11 +1063,25 @@ captured_main_1 (struct captured_main_ar
- && symarg != NULL
- && strcmp (execarg, symarg) == 0)
- {
-+ catch_command_errors_const_ftype *func;
-+
-+ /* Call exec_or_core_file_attach only if the file was specified as
-+ a command line argument (and not an a command line option). */
-+ if (corearg != NULL && strcmp (corearg, execarg) == 0)
-+ {
-+ func = exec_or_core_file_attach;
-+ corearg = NULL;
-+ }
-+ else
-+ func = exec_file_attach;
-+
- /* The exec file and the symbol-file are the same. If we can't
- open it, better only print one error message.
-- catch_command_errors returns non-zero on success! */
-- if (catch_command_errors_const (exec_file_attach, execarg,
-- !batch_flag))
-+ catch_command_errors returns non-zero on success!
-+ Do not load EXECARG as a symbol file if it has been already processed
-+ as a core file. */
-+ if (catch_command_errors_const (func, execarg, !batch_flag)
-+ && core_bfd == NULL)
- catch_command_errors_const (symbol_file_add_main_adapter, symarg,
- !batch_flag);
- }
diff --git a/insight-7.12-gdb-6.6-buildid-locate-rpm.patch b/insight-7.12-gdb-6.6-buildid-locate-rpm.patch
deleted file mode 100644
index 5f17b7c..0000000
--- a/insight-7.12-gdb-6.6-buildid-locate-rpm.patch
+++ /dev/null
@@ -1,1504 +0,0 @@
-diff -Naurp insight-7.12.50.20170416.orig/gdb/aclocal.m4 insight-7.12.50.20170416.new/gdb/aclocal.m4
---- insight-7.12.50.20170416.orig/gdb/aclocal.m4 2017-04-16 10:13:12.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/aclocal.m4 2017-04-16 12:12:54.707680063 +0100
-@@ -12,6 +12,221 @@
- # PARTICULAR PURPOSE.
-
- m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])])
-+# pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*-
-+# serial 1 (pkg-config-0.24)
-+#
-+# Copyright © 2004 Scott James Remnant <scott(a)netsplit.com>.
-+#
-+# This program is free software; you can redistribute it and/or modify
-+# it under the terms of the GNU General Public License as published by
-+# the Free Software Foundation; either version 2 of the License, or
-+# (at your option) any later version.
-+#
-+# This program is distributed in the hope that it will be useful, but
-+# WITHOUT ANY WARRANTY; without even the implied warranty of
-+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-+# General Public License for more details.
-+#
-+# You should have received a copy of the GNU General Public License
-+# along with this program; if not, write to the Free Software
-+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-+#
-+# As a special exception to the GNU General Public License, if you
-+# distribute this file as part of a program that contains a
-+# configuration script generated by Autoconf, you may include it under
-+# the same distribution terms that you use for the rest of that program.
-+
-+# PKG_PROG_PKG_CONFIG([MIN-VERSION])
-+# ----------------------------------
-+AC_DEFUN([PKG_PROG_PKG_CONFIG],
-+[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
-+m4_pattern_allow([^PKG_CONFIG(_(PATH|LIBDIR|SYSROOT_DIR|ALLOW_SYSTEM_(CFLAGS|LIBS)))?$])
-+m4_pattern_allow([^PKG_CONFIG_(DISABLE_UNINSTALLED|TOP_BUILD_DIR|DEBUG_SPEW)$])
-+AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])
-+AC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path])
-+AC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path])
-+
-+if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
-+ AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
-+fi
-+if test -n "$PKG_CONFIG"; then
-+ _pkg_min_version=m4_default([$1], [0.9.0])
-+ AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
-+ if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
-+ AC_MSG_RESULT([yes])
-+ else
-+ AC_MSG_RESULT([no])
-+ PKG_CONFIG=""
-+ fi
-+fi[]dnl
-+])# PKG_PROG_PKG_CONFIG
-+
-+# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
-+#
-+# Check to see whether a particular set of modules exists. Similar
-+# to PKG_CHECK_MODULES(), but does not set variables or print errors.
-+#
-+# Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG])
-+# only at the first occurence in configure.ac, so if the first place
-+# it's called might be skipped (such as if it is within an "if", you
-+# have to call PKG_CHECK_EXISTS manually
-+# --------------------------------------------------------------
-+AC_DEFUN([PKG_CHECK_EXISTS],
-+[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
-+if test -n "$PKG_CONFIG" && \
-+ AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
-+ m4_default([$2], [:])
-+m4_ifvaln([$3], [else
-+ $3])dnl
-+fi])
-+
-+# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
-+# ---------------------------------------------
-+m4_define([_PKG_CONFIG],
-+[if test -n "$$1"; then
-+ pkg_cv_[]$1="$$1"
-+ elif test -n "$PKG_CONFIG"; then
-+ PKG_CHECK_EXISTS([$3],
-+ [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`
-+ test "x$?" != "x0" && pkg_failed=yes ],
-+ [pkg_failed=yes])
-+ else
-+ pkg_failed=untried
-+fi[]dnl
-+])# _PKG_CONFIG
-+
-+# _PKG_SHORT_ERRORS_SUPPORTED
-+# -----------------------------
-+AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
-+[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
-+if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
-+ _pkg_short_errors_supported=yes
-+else
-+ _pkg_short_errors_supported=no
-+fi[]dnl
-+])# _PKG_SHORT_ERRORS_SUPPORTED
-+
-+
-+# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
-+# [ACTION-IF-NOT-FOUND])
-+#
-+#
-+# Note that if there is a possibility the first call to
-+# PKG_CHECK_MODULES might not happen, you should be sure to include an
-+# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
-+#
-+#
-+# --------------------------------------------------------------
-+AC_DEFUN([PKG_CHECK_MODULES],
-+[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
-+AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
-+AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
-+
-+pkg_failed=no
-+AC_MSG_CHECKING([for $1])
-+
-+_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
-+_PKG_CONFIG([$1][_LIBS], [libs], [$2])
-+
-+m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
-+and $1[]_LIBS to avoid the need to call pkg-config.
-+See the pkg-config man page for more details.])
-+
-+if test $pkg_failed = yes; then
-+ AC_MSG_RESULT([no])
-+ _PKG_SHORT_ERRORS_SUPPORTED
-+ if test $_pkg_short_errors_supported = yes; then
-+ $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1`
-+ else
-+ $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1`
-+ fi
-+ # Put the nasty error message in config.log where it belongs
-+ echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
-+
-+ m4_default([$4], [AC_MSG_ERROR(
-+[Package requirements ($2) were not met:
-+
-+$$1_PKG_ERRORS
-+
-+Consider adjusting the PKG_CONFIG_PATH environment variable if you
-+installed software in a non-standard prefix.
-+
-+_PKG_TEXT])[]dnl
-+ ])
-+elif test $pkg_failed = untried; then
-+ AC_MSG_RESULT([no])
-+ m4_default([$4], [AC_MSG_FAILURE(
-+[The pkg-config script could not be found or is too old. Make sure it
-+is in your PATH or set the PKG_CONFIG environment variable to the full
-+path to pkg-config.
-+
-+_PKG_TEXT
-+
-+To get pkg-config, see <http://pkg-config.freedesktop.org/>.])[]dnl
-+ ])
-+else
-+ $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
-+ $1[]_LIBS=$pkg_cv_[]$1[]_LIBS
-+ AC_MSG_RESULT([yes])
-+ $3
-+fi[]dnl
-+])# PKG_CHECK_MODULES
-+
-+
-+# PKG_INSTALLDIR(DIRECTORY)
-+# -------------------------
-+# Substitutes the variable pkgconfigdir as the location where a module
-+# should install pkg-config .pc files. By default the directory is
-+# $libdir/pkgconfig, but the default can be changed by passing
-+# DIRECTORY. The user can override through the --with-pkgconfigdir
-+# parameter.
-+AC_DEFUN([PKG_INSTALLDIR],
-+[m4_pushdef([pkg_default], [m4_default([$1], ['${libdir}/pkgconfig'])])
-+m4_pushdef([pkg_description],
-+ [pkg-config installation directory @<:@]pkg_default[@:>@])
-+AC_ARG_WITH([pkgconfigdir],
-+ [AS_HELP_STRING([--with-pkgconfigdir], pkg_description)],,
-+ [with_pkgconfigdir=]pkg_default)
-+AC_SUBST([pkgconfigdir], [$with_pkgconfigdir])
-+m4_popdef([pkg_default])
-+m4_popdef([pkg_description])
-+]) dnl PKG_INSTALLDIR
-+
-+
-+# PKG_NOARCH_INSTALLDIR(DIRECTORY)
-+# -------------------------
-+# Substitutes the variable noarch_pkgconfigdir as the location where a
-+# module should install arch-independent pkg-config .pc files. By
-+# default the directory is $datadir/pkgconfig, but the default can be
-+# changed by passing DIRECTORY. The user can override through the
-+# --with-noarch-pkgconfigdir parameter.
-+AC_DEFUN([PKG_NOARCH_INSTALLDIR],
-+[m4_pushdef([pkg_default], [m4_default([$1], ['${datadir}/pkgconfig'])])
-+m4_pushdef([pkg_description],
-+ [pkg-config arch-independent installation directory @<:@]pkg_default[@:>@])
-+AC_ARG_WITH([noarch-pkgconfigdir],
-+ [AS_HELP_STRING([--with-noarch-pkgconfigdir], pkg_description)],,
-+ [with_noarch_pkgconfigdir=]pkg_default)
-+AC_SUBST([noarch_pkgconfigdir], [$with_noarch_pkgconfigdir])
-+m4_popdef([pkg_default])
-+m4_popdef([pkg_description])
-+]) dnl PKG_NOARCH_INSTALLDIR
-+
-+
-+# PKG_CHECK_VAR(VARIABLE, MODULE, CONFIG-VARIABLE,
-+# [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
-+# -------------------------------------------
-+# Retrieves the value of the pkg-config variable for the given module.
-+AC_DEFUN([PKG_CHECK_VAR],
-+[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
-+AC_ARG_VAR([$1], [value of $3 for $2, overriding pkg-config])dnl
-+
-+_PKG_CONFIG([$1], [variable="][$3]["], [$2])
-+AS_VAR_COPY([$1], [pkg_cv_][$1])
-+
-+AS_VAR_IF([$1], [""], [$5], [$4])dnl
-+])# PKG_CHECK_VAR
-+
- # AM_AUX_DIR_EXPAND -*- Autoconf -*-
-
- # Copyright (C) 2001-2014 Free Software Foundation, Inc.
-diff -Naurp insight-7.12.50.20170416.orig/gdb/build-id.c insight-7.12.50.20170416.new/gdb/build-id.c
---- insight-7.12.50.20170416.orig/gdb/build-id.c 2017-04-16 12:02:56.905229574 +0100
-+++ insight-7.12.50.20170416.new/gdb/build-id.c 2017-04-16 12:04:34.197116635 +0100
-@@ -35,6 +35,7 @@
- #include "elf/common.h"
- #include "elf-bfd.h"
- #include <sys/stat.h>
-+#include "elf/external.h"
-
- #define BUILD_ID_VERBOSE_NONE 0
- #define BUILD_ID_VERBOSE_FILENAMES 1
-@@ -664,8 +665,366 @@ build_id_to_filename (const struct bfd_b
- return result;
- }
-
-+#ifdef HAVE_LIBRPM
-+
-+#include <rpm/rpmlib.h>
-+#include <rpm/rpmts.h>
-+#include <rpm/rpmdb.h>
-+#include <rpm/header.h>
-+#ifdef DLOPEN_LIBRPM
-+#include <dlfcn.h>
-+#endif
-+
-+/* This MISSING_RPM_HASH tracker is used to collect all the missing rpm files
-+ and avoid their duplicities during a single inferior run. */
-+
-+static struct htab *missing_rpm_hash;
-+
-+/* This MISSING_RPM_LIST tracker is used to collect and print as a single line
-+ all the rpms right before the nearest GDB prompt. It gets cleared after
-+ each such print (it is questionable if we should clear it after the print).
-+ */
-+
-+struct missing_rpm
-+ {
-+ struct missing_rpm *next;
-+ char rpm[1];
-+ };
-+static struct missing_rpm *missing_rpm_list;
-+static int missing_rpm_list_entries;
-+
-+/* Returns the count of newly added rpms. */
-+
-+static int
-+missing_rpm_enlist (const char *filename)
-+{
-+ static int rpm_init_done = 0;
-+ rpmts ts;
-+ rpmdbMatchIterator mi;
-+ int count = 0;
-+
-+#ifdef DLOPEN_LIBRPM
-+ /* Duplicate here the declarations to verify they match. The same sanity
-+ check is present also in `configure.ac'. */
-+ extern char * headerFormat(Header h, const char * fmt, errmsg_t * errmsg);
-+ static char *(*headerFormat_p) (Header h, const char * fmt, errmsg_t *errmsg);
-+ extern int rpmReadConfigFiles(const char * file, const char * target);
-+ static int (*rpmReadConfigFiles_p) (const char * file, const char * target);
-+ extern rpmdbMatchIterator rpmdbFreeIterator(rpmdbMatchIterator mi);
-+ static rpmdbMatchIterator (*rpmdbFreeIterator_p) (rpmdbMatchIterator mi);
-+ extern Header rpmdbNextIterator(rpmdbMatchIterator mi);
-+ static Header (*rpmdbNextIterator_p) (rpmdbMatchIterator mi);
-+ extern rpmts rpmtsCreate(void);
-+ static rpmts (*rpmtsCreate_p) (void);
-+ extern rpmts rpmtsFree(rpmts ts);
-+ static rpmts (*rpmtsFree_p) (rpmts ts);
-+ extern rpmdbMatchIterator rpmtsInitIterator(const rpmts ts, rpmTag rpmtag,
-+ const void * keyp, size_t keylen);
-+ static rpmdbMatchIterator (*rpmtsInitIterator_p) (const rpmts ts,
-+ rpmTag rpmtag,
-+ const void *keyp,
-+ size_t keylen);
-+#else /* !DLOPEN_LIBRPM */
-+# define headerFormat_p headerFormat
-+# define rpmReadConfigFiles_p rpmReadConfigFiles
-+# define rpmdbFreeIterator_p rpmdbFreeIterator
-+# define rpmdbNextIterator_p rpmdbNextIterator
-+# define rpmtsCreate_p rpmtsCreate
-+# define rpmtsFree_p rpmtsFree
-+# define rpmtsInitIterator_p rpmtsInitIterator
-+#endif /* !DLOPEN_LIBRPM */
-+
-+ gdb_assert (filename != NULL);
-+
-+ if (strcmp (filename, BUILD_ID_MAIN_EXECUTABLE_FILENAME) == 0)
-+ return 0;
-+
-+ if (is_target_filename (filename))
-+ return 0;
-+
-+ if (filename[0] != '/')
-+ {
-+ warning (_("Ignoring non-absolute filename: <%s>"), filename);
-+ return 0;
-+ }
-+
-+ if (!rpm_init_done)
-+ {
-+ static int init_tried;
-+
-+ /* Already failed the initialization before? */
-+ if (init_tried)
-+ return 0;
-+ init_tried = 1;
-+
-+#ifdef DLOPEN_LIBRPM
-+ {
-+ void *h;
-+
-+ h = dlopen (DLOPEN_LIBRPM, RTLD_LAZY);
-+ if (!h)
-+ {
-+ warning (_("Unable to open \"%s\" (%s), "
-+ "missing debuginfos notifications will not be displayed"),
-+ DLOPEN_LIBRPM, dlerror ());
-+ return 0;
-+ }
-+
-+ if (!((headerFormat_p = (char *(*) (Header h, const char * fmt, errmsg_t *errmsg)) dlsym (h, "headerFormat"))
-+ && (rpmReadConfigFiles_p = (int (*) (const char * file, const char * target)) dlsym (h, "rpmReadConfigFiles"))
-+ && (rpmdbFreeIterator_p = (rpmdbMatchIterator (*) (rpmdbMatchIterator mi)) dlsym (h, "rpmdbFreeIterator"))
-+ && (rpmdbNextIterator_p = (Header (*) (rpmdbMatchIterator mi)) dlsym (h, "rpmdbNextIterator"))
-+ && (rpmtsCreate_p = (rpmts (*) (void)) dlsym (h, "rpmtsCreate"))
-+ && (rpmtsFree_p = (rpmts (*) (rpmts ts)) dlsym (h, "rpmtsFree"))
-+ && (rpmtsInitIterator_p = (rpmdbMatchIterator (*) (const rpmts ts, rpmTag rpmtag, const void *keyp, size_t keylen)) dlsym (h, "rpmtsInitIterator"))))
-+ {
-+ warning (_("Opened library \"%s\" is incompatible (%s), "
-+ "missing debuginfos notifications will not be displayed"),
-+ DLOPEN_LIBRPM, dlerror ());
-+ if (dlclose (h))
-+ warning (_("Error closing library \"%s\": %s\n"), DLOPEN_LIBRPM,
-+ dlerror ());
-+ return 0;
-+ }
-+ }
-+#endif /* DLOPEN_LIBRPM */
-+
-+ if (rpmReadConfigFiles_p (NULL, NULL) != 0)
-+ {
-+ warning (_("Error reading the rpm configuration files"));
-+ return 0;
-+ }
-+
-+ rpm_init_done = 1;
-+ }
-+
-+ ts = rpmtsCreate_p ();
-+
-+ mi = rpmtsInitIterator_p (ts, RPMTAG_BASENAMES, filename, 0);
-+ if (mi != NULL)
-+ {
-+ for (;;)
-+ {
-+ Header h;
-+ char *debuginfo, **slot, *s, *s2;
-+ errmsg_t err;
-+ size_t srcrpmlen = sizeof (".src.rpm") - 1;
-+ size_t debuginfolen = sizeof ("-debuginfo") - 1;
-+ rpmdbMatchIterator mi_debuginfo;
-+
-+ h = rpmdbNextIterator_p (mi);
-+ if (h == NULL)
-+ break;
-+
-+ /* Verify the debuginfo file is not already installed. */
-+
-+ debuginfo = headerFormat_p (h, "%{sourcerpm}-debuginfo.%{arch}",
-+ &err);
-+ if (!debuginfo)
-+ {
-+ warning (_("Error querying the rpm file `%s': %s"), filename,
-+ err);
-+ continue;
-+ }
-+ /* s = `.src.rpm-debuginfo.%{arch}' */
-+ s = strrchr (debuginfo, '-') - srcrpmlen;
-+ s2 = NULL;
-+ if (s > debuginfo && memcmp (s, ".src.rpm", srcrpmlen) == 0)
-+ {
-+ /* s2 = `-%{release}.src.rpm-debuginfo.%{arch}' */
-+ s2 = (char *) memrchr (debuginfo, '-', s - debuginfo);
-+ }
-+ if (s2)
-+ {
-+ /* s2 = `-%{version}-%{release}.src.rpm-debuginfo.%{arch}' */
-+ s2 = (char *) memrchr (debuginfo, '-', s2 - debuginfo);
-+ }
-+ if (!s2)
-+ {
-+ warning (_("Error querying the rpm file `%s': %s"), filename,
-+ debuginfo);
-+ xfree (debuginfo);
-+ continue;
-+ }
-+ /* s = `.src.rpm-debuginfo.%{arch}' */
-+ /* s2 = `-%{version}-%{release}.src.rpm-debuginfo.%{arch}' */
-+ memmove (s2 + debuginfolen, s2, s - s2);
-+ memcpy (s2, "-debuginfo", debuginfolen);
-+ /* s = `XXXX.%{arch}' */
-+ /* strlen ("XXXX") == srcrpmlen + debuginfolen */
-+ /* s2 = `-debuginfo-%{version}-%{release}XX.%{arch}' */
-+ /* strlen ("XX") == srcrpmlen */
-+ memmove (s + debuginfolen, s + srcrpmlen + debuginfolen,
-+ strlen (s + srcrpmlen + debuginfolen) + 1);
-+ /* s = `-debuginfo-%{version}-%{release}.%{arch}' */
-+
-+ /* RPMDBI_PACKAGES requires keylen == sizeof (int). */
-+ /* RPMDBI_LABEL is an interface for NVR-based dbiFindByLabel(). */
-+ mi_debuginfo = rpmtsInitIterator_p (ts, (rpmTag) RPMDBI_LABEL, debuginfo, 0);
-+ xfree (debuginfo);
-+ if (mi_debuginfo)
-+ {
-+ rpmdbFreeIterator_p (mi_debuginfo);
-+ count = 0;
-+ break;
-+ }
-+
-+ /* The allocated memory gets utilized below for MISSING_RPM_HASH. */
-+ debuginfo = headerFormat_p (h,
-+ "%{name}-%{version}-%{release}.%{arch}",
-+ &err);
-+ if (!debuginfo)
-+ {
-+ warning (_("Error querying the rpm file `%s': %s"), filename,
-+ err);
-+ continue;
-+ }
-+
-+ /* Base package name for `debuginfo-install'. We do not use the
-+ `yum' command directly as the line
-+ yum --enablerepo='*debug*' install NAME-debuginfo.ARCH
-+ would be more complicated than just:
-+ debuginfo-install NAME-VERSION-RELEASE.ARCH
-+ Do not supply the rpm base name (derived from .src.rpm name) as
-+ debuginfo-install is unable to install the debuginfo package if
-+ the base name PKG binary rpm is not installed while for example
-+ PKG-libs would be installed (RH Bug 467901).
-+ FUTURE: After multiple debuginfo versions simultaneously installed
-+ get supported the support for the VERSION-RELEASE tags handling
-+ may need an update. */
-+
-+ if (missing_rpm_hash == NULL)
-+ {
-+ /* DEL_F is passed NULL as MISSING_RPM_LIST's HTAB_DELETE
-+ should not deallocate the entries. */
-+
-+ missing_rpm_hash = htab_create_alloc (64, htab_hash_string,
-+ (int (*) (const void *, const void *)) streq,
-+ NULL, xcalloc, xfree);
-+ }
-+ slot = (char **) htab_find_slot (missing_rpm_hash, debuginfo, INSERT);
-+ /* XCALLOC never returns NULL. */
-+ gdb_assert (slot != NULL);
-+ if (*slot == NULL)
-+ {
-+ struct missing_rpm *missing_rpm;
-+
-+ *slot = debuginfo;
-+
-+ missing_rpm = (struct missing_rpm *) xmalloc (sizeof (*missing_rpm) + strlen (debuginfo));
-+ strcpy (missing_rpm->rpm, debuginfo);
-+ missing_rpm->next = missing_rpm_list;
-+ missing_rpm_list = missing_rpm;
-+ missing_rpm_list_entries++;
-+ }
-+ else
-+ xfree (debuginfo);
-+ count++;
-+ }
-+
-+ rpmdbFreeIterator_p (mi);
-+ }
-+
-+ rpmtsFree_p (ts);
-+
-+ return count;
-+}
-+
-+static int
-+missing_rpm_list_compar (const char *const *ap, const char *const *bp)
-+{
-+ return strcoll (*ap, *bp);
-+}
-+
-+/* It returns a NULL-terminated array of strings needing to be FREEd. It may
-+ also return only NULL. */
-+
-+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);
-+
-+ array_iter = array;
-+ for (list_iter = missing_rpm_list; list_iter != NULL;
-+ list_iter = list_iter->next)
-+ {
-+ *array_iter++ = list_iter->rpm;
-+ }
-+ gdb_assert (array_iter == array + missing_rpm_list_entries);
-+
-+ qsort (array, missing_rpm_list_entries, sizeof (*array),
-+ (int (*) (const void *, const void *)) 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++)
-+ {
-+ putchar_unfiltered (' ');
-+ puts_unfiltered (*array_iter);
-+ }
-+ putchar_unfiltered ('\n');
-+
-+ while (missing_rpm_list != NULL)
-+ {
-+ list_iter = missing_rpm_list;
-+ missing_rpm_list = list_iter->next;
-+ xfree (list_iter);
-+ }
-+ missing_rpm_list_entries = 0;
-+
-+ do_cleanups (cleanups);
-+}
-+
-+static void
-+missing_rpm_change (void)
-+{
-+ debug_flush_missing ();
-+
-+ gdb_assert (missing_rpm_list == NULL);
-+ if (missing_rpm_hash != NULL)
-+ {
-+ htab_delete (missing_rpm_hash);
-+ missing_rpm_hash = NULL;
-+ }
-+}
-+
-+enum missing_exec
-+ {
-+ /* Init state. EXEC_BFD also still could be NULL. */
-+ MISSING_EXEC_NOT_TRIED,
-+ /* We saw a non-NULL EXEC_BFD but RPM has no info about it. */
-+ MISSING_EXEC_NOT_FOUND,
-+ /* We found EXEC_BFD by RPM and we either have its symbols (either embedded
-+ or separate) or the main executable's RPM is now contained in
-+ MISSING_RPM_HASH. */
-+ MISSING_EXEC_ENLISTED
-+ };
-+static enum missing_exec missing_exec = MISSING_EXEC_NOT_TRIED;
-+
-+#endif /* HAVE_LIBRPM */
-+
-+void
-+debug_flush_missing (void)
-+{
-+#ifdef HAVE_LIBRPM
-+ missing_rpm_list_print ();
-+#endif
-+}
-+
- /* This MISSING_FILEPAIR_HASH tracker is used only for the duplicite messages
-- Try to install the hash file ...
-+ yum --enablerepo='*debug*' install ...
- avoidance. */
-
- struct missing_filepair
-@@ -719,11 +1078,17 @@ missing_filepair_change (void)
- /* All their memory came just from missing_filepair_OBSTACK. */
- missing_filepair_hash = NULL;
- }
-+#ifdef HAVE_LIBRPM
-+ missing_exec = MISSING_EXEC_NOT_TRIED;
-+#endif
- }
-
- static void
- debug_print_executable_changed (void)
- {
-+#ifdef HAVE_LIBRPM
-+ missing_rpm_change ();
-+#endif
- missing_filepair_change ();
- }
-
-@@ -790,14 +1155,39 @@ debug_print_missing (const char *binary,
-
- *slot = missing_filepair;
-
-- /* We do not collect and flush these messages as each such message
-- already requires its own separate lines. */
-+#ifdef HAVE_LIBRPM
-+ if (missing_exec == MISSING_EXEC_NOT_TRIED)
-+ {
-+ char *execfilename;
-
-- 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)
-+ missing_exec = MISSING_EXEC_NOT_FOUND;
-+ else
-+ missing_exec = MISSING_EXEC_ENLISTED;
-+ }
-+ }
-+ if (missing_exec != MISSING_EXEC_ENLISTED)
-+ if ((binary[0] == 0 || missing_rpm_enlist (binary) == 0)
-+ && (debug == NULL || missing_rpm_enlist (debug) == 0))
-+#endif /* HAVE_LIBRPM */
-+ {
-+ /* We do not collect and flush these messages as each such message
-+ already requires its own separate lines. */
-+
-+ fprintf_unfiltered (gdb_stdlog,
-+ _("Missing separate debuginfo for %s\n"), binary);
-+ if (debug != NULL)
-+ fprintf_unfiltered (gdb_stdlog, _("Try: %s %s\n"),
-+#ifdef DNF_DEBUGINFO_INSTALL
-+ "dnf"
-+#else
-+ "yum"
-+#endif
-+ " --enablerepo='*debug*' install", debug);
-+ }
- }
-
- /* See build-id.h. */
-diff -Naurp insight-7.12.50.20170416.orig/gdb/config.in insight-7.12.50.20170416.new/gdb/config.in
---- insight-7.12.50.20170416.orig/gdb/config.in 2016-11-06 09:57:37.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/config.in 2017-04-16 12:04:34.188116553 +0100
-@@ -33,6 +33,9 @@
- /* Define to BFD's default target vector. */
- #undef DEFAULT_BFD_VEC
-
-+/* librpm version specific library name to dlopen. */
-+#undef DLOPEN_LIBRPM
-+
- /* Define to 1 if translation of program messages to the user's native
- language is requested. */
- #undef ENABLE_NLS
-@@ -264,6 +267,9 @@
- /* Define if Python 2.7 is being used. */
- #undef HAVE_LIBPYTHON2_7
-
-+/* Define if librpm library is being used. */
-+#undef HAVE_LIBRPM
-+
- /* Define to 1 if you have the <libunwind-ia64.h> header file. */
- #undef HAVE_LIBUNWIND_IA64_H
-
-diff -Naurp insight-7.12.50.20170416.orig/gdb/configure insight-7.12.50.20170416.new/gdb/configure
---- insight-7.12.50.20170416.orig/gdb/configure 2017-04-16 10:13:12.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/configure 2017-04-16 12:08:10.902092451 +0100
-@@ -740,6 +740,11 @@ PKGVERSION
- HAVE_NATIVE_GCORE_TARGET
- TARGET_OBS
- subdirs
-+RPM_LIBS
-+RPM_CFLAGS
-+PKG_CONFIG_LIBDIR
-+PKG_CONFIG_PATH
-+PKG_CONFIG
- GDB_DATADIR
- DEBUGDIR
- MAKEINFO_EXTRA_FLAGS
-@@ -844,6 +849,7 @@ with_gdb_datadir
- with_relocated_sources
- with_auto_load_dir
- with_auto_load_safe_path
-+with_rpm
- enable_targets
- enable_64_bit_bfd
- enable_gdbcli
-@@ -900,6 +906,11 @@ CCC
- CPP
- MAKEINFO
- MAKEINFOFLAGS
-+PKG_CONFIG
-+PKG_CONFIG_PATH
-+PKG_CONFIG_LIBDIR
-+RPM_CFLAGS
-+RPM_LIBS
- YACC
- YFLAGS
- XMKMF'
-@@ -1570,6 +1581,8 @@ Optional Packages:
- [--with-auto-load-dir]
- --without-auto-load-safe-path
- do not restrict auto-loaded files locations
-+ --with-rpm query rpm database for missing debuginfos (yes/no,
-+ def. auto=librpm.so)
- --with-libunwind-ia64 use libunwind frame unwinding for ia64 targets
- --with-curses use the curses library instead of the termcap
- library
-@@ -1624,6 +1637,13 @@ Some influential environment variables:
- MAKEINFO Parent configure detects if it is of sufficient version.
- MAKEINFOFLAGS
- Parameters for MAKEINFO.
-+ PKG_CONFIG path to pkg-config utility
-+ PKG_CONFIG_PATH
-+ directories to add to pkg-config's search path
-+ PKG_CONFIG_LIBDIR
-+ path overriding pkg-config's built-in search path
-+ RPM_CFLAGS C compiler flags for RPM, overriding pkg-config
-+ RPM_LIBS linker flags for RPM, overriding pkg-config
- YACC The `Yet Another Compiler Compiler' implementation to use.
- Defaults to the first program found out of: `bison -y', `byacc',
- `yacc'.
-@@ -6553,6 +6573,494 @@ _ACEOF
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_auto_load_safe_path" >&5
- $as_echo "$with_auto_load_safe_path" >&6; }
-
-+# Integration with rpm library to support missing debuginfo suggestions.
-+# --without-rpm: Disable any rpm support.
-+# --with-rpm=libname.so: Try to dynamically open `libname.so' during runtime.
-+# Even with runtime missing `libname.so' GDB will still other run correctly.
-+# Missing `libname.so' during ./configure will abort the configuration.
-+# --with-rpm=librpm.so: Like `--with-rpm=libname.so' but try to find specific
-+# minor version first such as `librpm-4.6.so' as minor version differences
-+# mean API+ABI incompatibility. If the specific match versioned library name
-+# could not be found still open dynamically at least `librpm.so'.
-+# --with-rpm: Like `--with-rpm=librpm.so' but if any of its detection fails try
-+# to find librpm for compilation-time linking by pkg-config. GDB binary will
-+# be probably linked with the version specific library (as `librpm-4.6.so').
-+# Failure to find librpm by pkg-config will abort the configuration.
-+# (default) --with-rpm=auto: Like `--with-rpm=librpm.so' but if even pkg-config
-+# cannot find librpm use to the rpmless compilation (like `--without-rpm').
-+
-+
-+# Check whether --with-rpm was given.
-+if test "${with_rpm+set}" = set; then :
-+ withval=$with_rpm;
-+else
-+ with_rpm="auto"
-+fi
-+
-+
-+
-+
-+if test "x$with_rpm" != "xno"; then
-+ if test "x$with_rpm" = "xyes"; then
-+ LIBRPM="librpm.so"
-+ RPM_REQUIRE=true
-+ DLOPEN_REQUIRE=false
-+ elif test "x$with_rpm" = "xauto"; then
-+ LIBRPM="librpm.so"
-+ RPM_REQUIRE=false
-+ DLOPEN_REQUIRE=false
-+ else
-+ LIBRPM="$with_rpm"
-+ RPM_REQUIRE=true
-+ DLOPEN_REQUIRE=true
-+ fi
-+ LIBRPM_STRING='"'"$LIBRPM"'"'
-+
-+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking specific librpm version" >&5
-+$as_echo_n "checking specific librpm version... " >&6; }
-+ HAVE_DLOPEN_LIBRPM=false
-+ save_LIBS="$LIBS"
-+ LIBS="$LIBS -ldl"
-+ if test "$cross_compiling" = yes; then :
-+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-+as_fn_error "cannot run test program while cross compiling
-+See \`config.log' for more details." "$LINENO" 5; }
-+else
-+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-+/* end confdefs.h. */
-+
-+#include <rpm/rpmlib.h>
-+#include <dlfcn.h>
-+#include <errno.h>
-+
-+int
-+main ()
-+{
-+
-+ void *h;
-+ const char *const *rpmverp;
-+ FILE *f;
-+
-+ f = fopen ("conftest.out", "w");
-+ if (!f)
-+ {
-+ fprintf (stderr, "Cannot write \"%s\": %s\n", "conftest.out",
-+ strerror (errno));
-+ return 1;
-+ }
-+ h = dlopen ($LIBRPM_STRING, RTLD_LAZY);
-+ if (!h)
-+ {
-+ fprintf (stderr, "dlopen (\"%s\"): %s\n", $LIBRPM_STRING, dlerror ());
-+ return 1;
-+ }
-+ rpmverp = dlsym (h, "RPMVERSION");
-+ if (!rpmverp)
-+ {
-+ fprintf (stderr, "dlsym (\"RPMVERSION\"): %s\n", dlerror ());
-+ return 1;
-+ }
-+ fprintf (stderr, "RPMVERSION is: \"");
-+ fprintf (stderr, "%s\"\n", *rpmverp);
-+
-+ /* Try to find the specific librpm version only for "librpm.so" as we do
-+ not know how to assemble the version string otherwise. */
-+
-+ if (strcmp ("librpm.so", $LIBRPM_STRING) != 0)
-+ {
-+ fprintf (f, "%s\n", $LIBRPM_STRING);
-+ return 0;
-+ }
-+ else
-+ {
-+ char *h2_name;
-+ void *h2;
-+ int major, minor;
-+
-+ if (sscanf (*rpmverp, "%d.%d", &major, &minor) != 2)
-+ {
-+ fprintf (stderr, "Unable to parse RPMVERSION.\n");
-+ fprintf (f, "%s\n", $LIBRPM_STRING);
-+ return 0;
-+ }
-+ /* Avoid the square brackets by malloc. */
-+ h2_name = malloc (64);
-+ sprintf (h2_name, "librpm-%d.%d.so", major, minor);
-+ h2 = dlopen (h2_name, RTLD_LAZY);
-+ if (!h2)
-+ {
-+ fprintf (stderr, "dlopen (\"%s\"): %s\n", h2_name, dlerror ());
-+ fprintf (f, "%s\n", $LIBRPM_STRING);
-+ return 0;
-+ }
-+ if (h2 != h)
-+ {
-+ fprintf (stderr, "dlopen of \"%s\" and \"%s\" are different.\n",
-+ $LIBRPM_STRING, h2_name);
-+ fprintf (f, "%s\n", $LIBRPM_STRING);
-+ return 0;
-+ }
-+ /* Found the valid .so name with a specific version. */
-+ fprintf (f, "%s\n", h2_name);
-+ return 0;
-+ }
-+
-+ ;
-+ return 0;
-+}
-+_ACEOF
-+if ac_fn_c_try_run "$LINENO"; then :
-+
-+ DLOPEN_LIBRPM="`cat conftest.out`"
-+ if test "x$DLOPEN_LIBRPM" != "x"; then
-+ HAVE_DLOPEN_LIBRPM=true
-+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DLOPEN_LIBRPM" >&5
-+$as_echo "$DLOPEN_LIBRPM" >&6; }
-+ fi
-+
-+fi
-+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
-+ conftest.$ac_objext conftest.beam conftest.$ac_ext
-+fi
-+
-+ rm -f conftest.out
-+
-+
-+
-+ if $HAVE_DLOPEN_LIBRPM; then
-+
-+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking rpm library API compatibility" >&5
-+$as_echo_n "checking rpm library API compatibility... " >&6; }
-+ # The compilation requires -Werror to verify anything.
-+ save_CFLAGS="$CFLAGS"
-+ CFLAGS="$CFLAGS -Werror"
-+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-+/* end confdefs.h. */
-+
-+/* Duplicate here the declarations to verify they match "elfread.c". */
-+#include <rpm/rpmlib.h>
-+#include <rpm/rpmts.h>
-+#include <rpm/rpmdb.h>
-+#include <rpm/header.h>
-+extern char * headerFormat(Header h, const char * fmt, errmsg_t * errmsg);
-+extern int rpmReadConfigFiles(const char * file, const char * target);
-+extern rpmdbMatchIterator rpmdbFreeIterator(rpmdbMatchIterator mi);
-+extern Header rpmdbNextIterator(rpmdbMatchIterator mi);
-+extern rpmts rpmtsCreate(void);
-+extern rpmts rpmtsFree(rpmts ts);
-+extern rpmdbMatchIterator rpmtsInitIterator(const rpmts ts, rpmTag rpmtag,
-+ const void * keyp, size_t keylen);
-+
-+int
-+main ()
-+{
-+
-+ ;
-+ return 0;
-+}
-+_ACEOF
-+if ac_fn_c_try_compile "$LINENO"; then :
-+
-+ LIBRPM_COMPAT=true
-+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-+$as_echo "yes" >&6; }
-+
-+else
-+
-+ LIBRPM_COMPAT=false
-+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-+$as_echo "no" >&6; }
-+
-+fi
-+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-+ CFLAGS="$save_CFLAGS"
-+
-+ if ! $LIBRPM_COMPAT; then
-+ HAVE_DLOPEN_LIBRPM=false
-+ fi
-+ fi
-+
-+ if $HAVE_DLOPEN_LIBRPM; then
-+ DLOPEN_LIBRPM_STRING='"'"$DLOPEN_LIBRPM"'"'
-+
-+cat >>confdefs.h <<_ACEOF
-+#define DLOPEN_LIBRPM $DLOPEN_LIBRPM_STRING
-+_ACEOF
-+
-+
-+$as_echo "#define HAVE_LIBRPM 1" >>confdefs.h
-+
-+ else
-+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-+$as_echo "no" >&6; }
-+ LIBS="$save_LIBS"
-+ if $DLOPEN_REQUIRE; then
-+ as_fn_error "Specific name $LIBRPM was requested but it could not be opened." "$LINENO" 5
-+ fi
-+
-+
-+
-+
-+
-+
-+
-+if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
-+ if test -n "$ac_tool_prefix"; then
-+ # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args.
-+set dummy ${ac_tool_prefix}pkg-config; ac_word=$2
-+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-+$as_echo_n "checking for $ac_word... " >&6; }
-+if test "${ac_cv_path_PKG_CONFIG+set}" = set; then :
-+ $as_echo_n "(cached) " >&6
-+else
-+ case $PKG_CONFIG in
-+ [\\/]* | ?:[\\/]*)
-+ ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
-+ ;;
-+ *)
-+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-+for as_dir in $PATH
-+do
-+ IFS=$as_save_IFS
-+ test -z "$as_dir" && as_dir=.
-+ for ac_exec_ext in '' $ac_executable_extensions; do
-+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
-+ ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
-+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-+ break 2
-+ fi
-+done
-+ done
-+IFS=$as_save_IFS
-+
-+ ;;
-+esac
-+fi
-+PKG_CONFIG=$ac_cv_path_PKG_CONFIG
-+if test -n "$PKG_CONFIG"; then
-+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5
-+$as_echo "$PKG_CONFIG" >&6; }
-+else
-+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-+$as_echo "no" >&6; }
-+fi
-+
-+
-+fi
-+if test -z "$ac_cv_path_PKG_CONFIG"; then
-+ ac_pt_PKG_CONFIG=$PKG_CONFIG
-+ # Extract the first word of "pkg-config", so it can be a program name with args.
-+set dummy pkg-config; ac_word=$2
-+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-+$as_echo_n "checking for $ac_word... " >&6; }
-+if test "${ac_cv_path_ac_pt_PKG_CONFIG+set}" = set; then :
-+ $as_echo_n "(cached) " >&6
-+else
-+ case $ac_pt_PKG_CONFIG in
-+ [\\/]* | ?:[\\/]*)
-+ ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path.
-+ ;;
-+ *)
-+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-+for as_dir in $PATH
-+do
-+ IFS=$as_save_IFS
-+ test -z "$as_dir" && as_dir=.
-+ for ac_exec_ext in '' $ac_executable_extensions; do
-+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
-+ ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
-+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-+ break 2
-+ fi
-+done
-+ done
-+IFS=$as_save_IFS
-+
-+ ;;
-+esac
-+fi
-+ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG
-+if test -n "$ac_pt_PKG_CONFIG"; then
-+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKG_CONFIG" >&5
-+$as_echo "$ac_pt_PKG_CONFIG" >&6; }
-+else
-+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-+$as_echo "no" >&6; }
-+fi
-+
-+ if test "x$ac_pt_PKG_CONFIG" = x; then
-+ PKG_CONFIG=""
-+ else
-+ case $cross_compiling:$ac_tool_warned in
-+yes:)
-+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
-+ac_tool_warned=yes ;;
-+esac
-+ PKG_CONFIG=$ac_pt_PKG_CONFIG
-+ fi
-+else
-+ PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
-+fi
-+
-+fi
-+if test -n "$PKG_CONFIG"; then
-+ _pkg_min_version=0.9.0
-+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking pkg-config is at least version $_pkg_min_version" >&5
-+$as_echo_n "checking pkg-config is at least version $_pkg_min_version... " >&6; }
-+ if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
-+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-+$as_echo "yes" >&6; }
-+ else
-+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-+$as_echo "no" >&6; }
-+ PKG_CONFIG=""
-+ fi
-+fi
-+
-+pkg_failed=no
-+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for RPM" >&5
-+$as_echo_n "checking for RPM... " >&6; }
-+
-+if test -n "$RPM_CFLAGS"; then
-+ pkg_cv_RPM_CFLAGS="$RPM_CFLAGS"
-+ elif test -n "$PKG_CONFIG"; then
-+ if test -n "$PKG_CONFIG" && \
-+ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"rpm\""; } >&5
-+ ($PKG_CONFIG --exists --print-errors "rpm") 2>&5
-+ ac_status=$?
-+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-+ test $ac_status = 0; }; then
-+ pkg_cv_RPM_CFLAGS=`$PKG_CONFIG --cflags "rpm" 2>/dev/null`
-+ test "x$?" != "x0" && pkg_failed=yes
-+else
-+ pkg_failed=yes
-+fi
-+ else
-+ pkg_failed=untried
-+fi
-+if test -n "$RPM_LIBS"; then
-+ pkg_cv_RPM_LIBS="$RPM_LIBS"
-+ elif test -n "$PKG_CONFIG"; then
-+ if test -n "$PKG_CONFIG" && \
-+ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"rpm\""; } >&5
-+ ($PKG_CONFIG --exists --print-errors "rpm") 2>&5
-+ ac_status=$?
-+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-+ test $ac_status = 0; }; then
-+ pkg_cv_RPM_LIBS=`$PKG_CONFIG --libs "rpm" 2>/dev/null`
-+ test "x$?" != "x0" && pkg_failed=yes
-+else
-+ pkg_failed=yes
-+fi
-+ else
-+ pkg_failed=untried
-+fi
-+
-+
-+
-+if test $pkg_failed = yes; then
-+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-+$as_echo "no" >&6; }
-+
-+if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
-+ _pkg_short_errors_supported=yes
-+else
-+ _pkg_short_errors_supported=no
-+fi
-+ if test $_pkg_short_errors_supported = yes; then
-+ RPM_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "rpm" 2>&1`
-+ else
-+ RPM_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "rpm" 2>&1`
-+ fi
-+ # Put the nasty error message in config.log where it belongs
-+ echo "$RPM_PKG_ERRORS" >&5
-+
-+ HAVE_LIBRPM=false
-+elif test $pkg_failed = untried; then
-+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-+$as_echo "no" >&6; }
-+ HAVE_LIBRPM=false
-+else
-+ RPM_CFLAGS=$pkg_cv_RPM_CFLAGS
-+ RPM_LIBS=$pkg_cv_RPM_LIBS
-+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-+$as_echo "yes" >&6; }
-+ HAVE_LIBRPM=true
-+fi
-+
-+ if $HAVE_LIBRPM; then
-+
-+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking rpm library API compatibility" >&5
-+$as_echo_n "checking rpm library API compatibility... " >&6; }
-+ # The compilation requires -Werror to verify anything.
-+ save_CFLAGS="$CFLAGS"
-+ CFLAGS="$CFLAGS -Werror"
-+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-+/* end confdefs.h. */
-+
-+/* Duplicate here the declarations to verify they match "elfread.c". */
-+#include <rpm/rpmlib.h>
-+#include <rpm/rpmts.h>
-+#include <rpm/rpmdb.h>
-+#include <rpm/header.h>
-+extern char * headerFormat(Header h, const char * fmt, errmsg_t * errmsg);
-+extern int rpmReadConfigFiles(const char * file, const char * target);
-+extern rpmdbMatchIterator rpmdbFreeIterator(rpmdbMatchIterator mi);
-+extern Header rpmdbNextIterator(rpmdbMatchIterator mi);
-+extern rpmts rpmtsCreate(void);
-+extern rpmts rpmtsFree(rpmts ts);
-+extern rpmdbMatchIterator rpmtsInitIterator(const rpmts ts, rpmTag rpmtag,
-+ const void * keyp, size_t keylen);
-+
-+int
-+main ()
-+{
-+
-+ ;
-+ return 0;
-+}
-+_ACEOF
-+if ac_fn_c_try_compile "$LINENO"; then :
-+
-+ LIBRPM_COMPAT=true
-+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-+$as_echo "yes" >&6; }
-+
-+else
-+
-+ LIBRPM_COMPAT=false
-+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-+$as_echo "no" >&6; }
-+
-+fi
-+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-+ CFLAGS="$save_CFLAGS"
-+
-+ if ! $LIBRPM_COMPAT; then
-+ HAVE_LIBRPM=false
-+ RPM_PKG_ERRORS="Found $LIBRPM API is incompatibile with this GDB"
-+ fi
-+ fi
-+
-+ if $HAVE_LIBRPM; then
-+
-+$as_echo "#define HAVE_LIBRPM 1" >>confdefs.h
-+
-+ CFLAGS="$CFLAGS $RPM_CFLAGS"
-+ LIBS="$LIBS $RPM_LIBS"
-+ else
-+ if $RPM_REQUIRE; then
-+ as_fn_error "$RPM_PKG_ERRORS" "$LINENO" 5
-+ else
-+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $RPM_PKG_ERRORS" >&5
-+$as_echo "$as_me: WARNING: $RPM_PKG_ERRORS" >&2;}
-+ fi
-+ fi
-+ fi
-+fi
-+
-
-
- subdirs="$subdirs testsuite"
-diff -Naurp insight-7.12.50.20170416.orig/gdb/configure.ac insight-7.12.50.20170416.new/gdb/configure.ac
---- insight-7.12.50.20170416.orig/gdb/configure.ac 2017-04-16 12:02:56.836228945 +0100
-+++ insight-7.12.50.20170416.new/gdb/configure.ac 2017-04-16 12:04:34.195116617 +0100
-@@ -167,6 +167,199 @@ AC_DEFINE_DIR(AUTO_LOAD_SAFE_PATH, escap
- [Directories safe to hold auto-loaded files.])
- AC_MSG_RESULT([$with_auto_load_safe_path])
-
-+# Integration with rpm library to support missing debuginfo suggestions.
-+# --without-rpm: Disable any rpm support.
-+# --with-rpm=libname.so: Try to dynamically open `libname.so' during runtime.
-+# Even with runtime missing `libname.so' GDB will still other run correctly.
-+# Missing `libname.so' during ./configure will abort the configuration.
-+# --with-rpm=librpm.so: Like `--with-rpm=libname.so' but try to find specific
-+# minor version first such as `librpm-4.6.so' as minor version differences
-+# mean API+ABI incompatibility. If the specific match versioned library name
-+# could not be found still open dynamically at least `librpm.so'.
-+# --with-rpm: Like `--with-rpm=librpm.so' but if any of its detection fails try
-+# to find librpm for compilation-time linking by pkg-config. GDB binary will
-+# be probably linked with the version specific library (as `librpm-4.6.so').
-+# Failure to find librpm by pkg-config will abort the configuration.
-+# (default) --with-rpm=auto: Like `--with-rpm=librpm.so' but if even pkg-config
-+# cannot find librpm use to the rpmless compilation (like `--without-rpm').
-+
-+AC_ARG_WITH([rpm],
-+ [AS_HELP_STRING([--with-rpm],
-+ [query rpm database for missing debuginfos (yes/no, def. auto=librpm.so)])], [], [with_rpm="auto"])
-+
-+m4_pattern_allow([^AC_MSG_ERROR$])
-+m4_pattern_allow([^AC_MSG_WARN$])
-+if test "x$with_rpm" != "xno"; then
-+ if test "x$with_rpm" = "xyes"; then
-+ LIBRPM="librpm.so"
-+ RPM_REQUIRE=true
-+ DLOPEN_REQUIRE=false
-+ elif test "x$with_rpm" = "xauto"; then
-+ LIBRPM="librpm.so"
-+ RPM_REQUIRE=false
-+ DLOPEN_REQUIRE=false
-+ else
-+ LIBRPM="$with_rpm"
-+ RPM_REQUIRE=true
-+ DLOPEN_REQUIRE=true
-+ fi
-+ LIBRPM_STRING='"'"$LIBRPM"'"'
-+
-+ AC_MSG_CHECKING([specific librpm version])
-+ HAVE_DLOPEN_LIBRPM=false
-+ save_LIBS="$LIBS"
-+ LIBS="$LIBS -ldl"
-+ AC_RUN_IFELSE(AC_LANG_PROGRAM([[
-+#include <rpm/rpmlib.h>
-+#include <dlfcn.h>
-+#include <errno.h>
-+ ]], [[
-+ void *h;
-+ const char *const *rpmverp;
-+ FILE *f;
-+
-+ f = fopen ("conftest.out", "w");
-+ if (!f)
-+ {
-+ fprintf (stderr, "Cannot write \"%s\": %s\n", "conftest.out",
-+ strerror (errno));
-+ return 1;
-+ }
-+ h = dlopen ($LIBRPM_STRING, RTLD_LAZY);
-+ if (!h)
-+ {
-+ fprintf (stderr, "dlopen (\"%s\"): %s\n", $LIBRPM_STRING, dlerror ());
-+ return 1;
-+ }
-+ rpmverp = dlsym (h, "RPMVERSION");
-+ if (!rpmverp)
-+ {
-+ fprintf (stderr, "dlsym (\"RPMVERSION\"): %s\n", dlerror ());
-+ return 1;
-+ }
-+ fprintf (stderr, "RPMVERSION is: \"");
-+ fprintf (stderr, "%s\"\n", *rpmverp);
-+
-+ /* Try to find the specific librpm version only for "librpm.so" as we do
-+ not know how to assemble the version string otherwise. */
-+
-+ if (strcmp ("librpm.so", $LIBRPM_STRING) != 0)
-+ {
-+ fprintf (f, "%s\n", $LIBRPM_STRING);
-+ return 0;
-+ }
-+ else
-+ {
-+ char *h2_name;
-+ void *h2;
-+ int major, minor;
-+
-+ if (sscanf (*rpmverp, "%d.%d", &major, &minor) != 2)
-+ {
-+ fprintf (stderr, "Unable to parse RPMVERSION.\n");
-+ fprintf (f, "%s\n", $LIBRPM_STRING);
-+ return 0;
-+ }
-+ /* Avoid the square brackets by malloc. */
-+ h2_name = malloc (64);
-+ sprintf (h2_name, "librpm-%d.%d.so", major, minor);
-+ h2 = dlopen (h2_name, RTLD_LAZY);
-+ if (!h2)
-+ {
-+ fprintf (stderr, "dlopen (\"%s\"): %s\n", h2_name, dlerror ());
-+ fprintf (f, "%s\n", $LIBRPM_STRING);
-+ return 0;
-+ }
-+ if (h2 != h)
-+ {
-+ fprintf (stderr, "dlopen of \"%s\" and \"%s\" are different.\n",
-+ $LIBRPM_STRING, h2_name);
-+ fprintf (f, "%s\n", $LIBRPM_STRING);
-+ return 0;
-+ }
-+ /* Found the valid .so name with a specific version. */
-+ fprintf (f, "%s\n", h2_name);
-+ return 0;
-+ }
-+ ]]), [
-+ DLOPEN_LIBRPM="`cat conftest.out`"
-+ if test "x$DLOPEN_LIBRPM" != "x"; then
-+ HAVE_DLOPEN_LIBRPM=true
-+ AC_MSG_RESULT($DLOPEN_LIBRPM)
-+ fi
-+ ])
-+ rm -f conftest.out
-+
-+ m4_define([CHECK_LIBRPM_COMPAT], [
-+ AC_MSG_CHECKING([rpm library API compatibility])
-+ # The compilation requires -Werror to verify anything.
-+ save_CFLAGS="$CFLAGS"
-+ CFLAGS="$CFLAGS -Werror"
-+ AC_COMPILE_IFELSE(AC_LANG_PROGRAM([[
-+/* Duplicate here the declarations to verify they match "elfread.c". */
-+#include <rpm/rpmlib.h>
-+#include <rpm/rpmts.h>
-+#include <rpm/rpmdb.h>
-+#include <rpm/header.h>
-+extern char * headerFormat(Header h, const char * fmt, errmsg_t * errmsg);
-+extern int rpmReadConfigFiles(const char * file, const char * target);
-+extern rpmdbMatchIterator rpmdbFreeIterator(rpmdbMatchIterator mi);
-+extern Header rpmdbNextIterator(rpmdbMatchIterator mi);
-+extern rpmts rpmtsCreate(void);
-+extern rpmts rpmtsFree(rpmts ts);
-+extern rpmdbMatchIterator rpmtsInitIterator(const rpmts ts, rpmTag rpmtag,
-+ const void * keyp, size_t keylen);
-+ ]]), [
-+ LIBRPM_COMPAT=true
-+ AC_MSG_RESULT(yes)
-+ ], [
-+ LIBRPM_COMPAT=false
-+ AC_MSG_RESULT(no)
-+ ])
-+ CFLAGS="$save_CFLAGS"
-+ ])
-+
-+ if $HAVE_DLOPEN_LIBRPM; then
-+ CHECK_LIBRPM_COMPAT
-+ if ! $LIBRPM_COMPAT; then
-+ HAVE_DLOPEN_LIBRPM=false
-+ fi
-+ fi
-+
-+ if $HAVE_DLOPEN_LIBRPM; then
-+ DLOPEN_LIBRPM_STRING='"'"$DLOPEN_LIBRPM"'"'
-+ AC_DEFINE_UNQUOTED(DLOPEN_LIBRPM, $DLOPEN_LIBRPM_STRING, [librpm version specific library name to dlopen.])
-+ AC_DEFINE(HAVE_LIBRPM, 1, [Define if librpm library is being used.])
-+ else
-+ AC_MSG_RESULT(no)
-+ LIBS="$save_LIBS"
-+ if $DLOPEN_REQUIRE; then
-+ AC_MSG_ERROR([Specific name $LIBRPM was requested but it could not be opened.])
-+ fi
-+ PKG_CHECK_MODULES(RPM, rpm, [HAVE_LIBRPM=true], [HAVE_LIBRPM=false])
-+
-+ if $HAVE_LIBRPM; then
-+ CHECK_LIBRPM_COMPAT
-+ if ! $LIBRPM_COMPAT; then
-+ HAVE_LIBRPM=false
-+ RPM_PKG_ERRORS="Found $LIBRPM API is incompatibile with this GDB"
-+ fi
-+ fi
-+
-+ if $HAVE_LIBRPM; then
-+ AC_DEFINE(HAVE_LIBRPM, 1, [Define if librpm library is being used.])
-+ CFLAGS="$CFLAGS $RPM_CFLAGS"
-+ LIBS="$LIBS $RPM_LIBS"
-+ else
-+ if $RPM_REQUIRE; then
-+ AC_MSG_ERROR($RPM_PKG_ERRORS)
-+ else
-+ AC_MSG_WARN($RPM_PKG_ERRORS)
-+ fi
-+ fi
-+ fi
-+fi
-+
- AC_CONFIG_SUBDIRS(testsuite)
-
- # Check whether to support alternative target configurations
-diff -Naurp insight-7.12.50.20170416.orig/gdb/corelow.c insight-7.12.50.20170416.new/gdb/corelow.c
---- insight-7.12.50.20170416.orig/gdb/corelow.c 2017-04-16 12:02:56.896229492 +0100
-+++ insight-7.12.50.20170416.new/gdb/corelow.c 2017-04-16 12:04:34.196116626 +0100
-@@ -311,7 +311,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 -Naurp insight-7.12.50.20170416.orig/gdb/event-top.c insight-7.12.50.20170416.new/gdb/event-top.c
---- insight-7.12.50.20170416.orig/gdb/event-top.c 2017-04-16 10:13:09.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/event-top.c 2017-04-16 12:04:34.185116525 +0100
-@@ -40,6 +40,7 @@
- #include "buffer.h"
- #include "ser-event.h"
- #include "gdb_select.h"
-+#include "symfile.h"
-
- /* readline include files. */
- #include "readline/readline.h"
-@@ -360,6 +361,8 @@ display_gdb_prompt (const char *new_prom
- /* Reset the nesting depth used when trace-commands is set. */
- reset_command_nest_depth ();
-
-+ debug_flush_missing ();
-+
- old_chain = make_cleanup (free_current_contents, &actual_gdb_prompt);
-
- /* Do not call the python hook on an explicit prompt change as
-@@ -780,7 +783,10 @@ command_line_handler (char *rl)
- command_handler (cmd);
-
- if (ui->prompt_state != PROMPTED)
-- display_gdb_prompt (0);
-+ {
-+ debug_flush_missing ();
-+ display_gdb_prompt (0);
-+ }
- }
- }
-
-diff -Naurp insight-7.12.50.20170416.orig/gdb/symfile.h insight-7.12.50.20170416.new/gdb/symfile.h
---- insight-7.12.50.20170416.orig/gdb/symfile.h 2017-04-16 12:02:56.903229555 +0100
-+++ insight-7.12.50.20170416.new/gdb/symfile.h 2017-04-16 12:04:34.186116534 +0100
-@@ -570,6 +570,8 @@ void map_symbol_filenames (symbol_filena
- /* 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);
-+extern void debug_flush_missing (void);
-+#define BUILD_ID_MAIN_EXECUTABLE_FILENAME _("the main executable file")
-
- /* From dwarf2read.c */
-
diff --git a/insight-7.12-gdb-6.6-buildid-locate.patch b/insight-7.12-gdb-6.6-buildid-locate.patch
deleted file mode 100644
index 8e0826c..0000000
--- a/insight-7.12-gdb-6.6-buildid-locate.patch
+++ /dev/null
@@ -1,1257 +0,0 @@
-diff -Naurp insight-7.12.50.20170416.orig/gdb/build-id.c insight-7.12.50.20170416.new/gdb/build-id.c
---- insight-7.12.50.20170416.orig/gdb/build-id.c 2017-01-21 02:32:23.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/build-id.c 2017-04-16 13:55:30.668769990 +0100
-@@ -26,11 +26,67 @@
- #include "objfiles.h"
- #include "filenames.h"
- #include "gdbcore.h"
-+#include "libbfd.h"
-+#include "gdbcore.h"
-+#include "gdbcmd.h"
-+#include "observer.h"
-+#include "elf/external.h"
-+#include "elf/internal.h"
-+#include "elf/common.h"
-+#include "elf-bfd.h"
-+#include <sys/stat.h>
-+
-+#define BUILD_ID_VERBOSE_NONE 0
-+#define BUILD_ID_VERBOSE_FILENAMES 1
-+#define BUILD_ID_VERBOSE_BINARY_PARSE 2
-+static int build_id_verbose = BUILD_ID_VERBOSE_FILENAMES;
-+static void
-+show_build_id_verbose (struct ui_file *file, int from_tty,
-+ struct cmd_list_element *c, const char *value)
-+{
-+ fprintf_filtered (file, _("Verbosity level of the build-id locator is %s.\n"),
-+ value);
-+}
-+/* Locate NT_GNU_BUILD_ID and return its matching debug filename.
-+ FIXME: NOTE decoding should be unified with the BFD core notes decoding. */
-+
-+static struct bfd_build_id *
-+build_id_buf_get (bfd *templ, gdb_byte *buf, bfd_size_type size)
-+{
-+ bfd_byte *p;
-+
-+ p = buf;
-+ while (p < buf + size)
-+ {
-+ /* FIXME: bad alignment assumption. */
-+ Elf_External_Note *xnp = (Elf_External_Note *) p;
-+ size_t namesz = H_GET_32 (templ, xnp->namesz);
-+ size_t descsz = H_GET_32 (templ, xnp->descsz);
-+ bfd_byte *descdata = (gdb_byte *) xnp->name + BFD_ALIGN (namesz, 4);
-+
-+ if (H_GET_32 (templ, xnp->type) == NT_GNU_BUILD_ID
-+ && namesz == sizeof "GNU"
-+ && memcmp (xnp->name, "GNU", sizeof "GNU") == 0)
-+ {
-+ size_t size = descsz;
-+ gdb_byte *data = (gdb_byte *) descdata;
-+ struct bfd_build_id *retval;
-+
-+ retval = (struct bfd_build_id *) xmalloc (sizeof *retval - 1 + size);
-+ retval->size = size;
-+ memcpy (retval->data, data, size);
-+
-+ return retval;
-+ }
-+ p = descdata + BFD_ALIGN (descsz, 4);
-+ }
-+ return NULL;
-+}
-
- /* See build-id.h. */
-
- const struct bfd_build_id *
--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)
- return NULL;
- }
-
-+/* Core files may have missing (corrupt) SHDR but PDHR is correct there.
-+ bfd_elf_bfd_from_remote_memory () has too much overhead by
-+ allocating/reading all the available ELF PT_LOADs. */
-+
-+static struct bfd_build_id *
-+build_id_phdr_get (bfd *templ, bfd_vma loadbase, unsigned e_phnum,
-+ Elf_Internal_Phdr *i_phdr)
-+{
-+ int i;
-+ struct bfd_build_id *retval = NULL;
-+
-+ for (i = 0; i < e_phnum; i++)
-+ if (i_phdr[i].p_type == PT_NOTE && i_phdr[i].p_filesz > 0)
-+ {
-+ Elf_Internal_Phdr *hdr = &i_phdr[i];
-+ gdb_byte *buf;
-+ int err;
-+
-+ buf = (gdb_byte *) xmalloc (hdr->p_filesz);
-+ err = target_read_memory (loadbase + i_phdr[i].p_vaddr, buf,
-+ hdr->p_filesz);
-+ if (err == 0)
-+ retval = build_id_buf_get (templ, buf, hdr->p_filesz);
-+ else
-+ retval = NULL;
-+ xfree (buf);
-+ if (retval != NULL)
-+ break;
-+ }
-+ return retval;
-+}
-+
-+/* First we validate the file by reading in the ELF header and checking
-+ the magic number. */
-+
-+static inline bfd_boolean
-+elf_file_p (Elf64_External_Ehdr *x_ehdrp64)
-+{
-+ gdb_assert (sizeof (Elf64_External_Ehdr) >= sizeof (Elf32_External_Ehdr));
-+ gdb_assert (offsetof (Elf64_External_Ehdr, e_ident)
-+ == offsetof (Elf32_External_Ehdr, e_ident));
-+ gdb_assert (sizeof (((Elf64_External_Ehdr *) 0)->e_ident)
-+ == sizeof (((Elf32_External_Ehdr *) 0)->e_ident));
-+
-+ return ((x_ehdrp64->e_ident[EI_MAG0] == ELFMAG0)
-+ && (x_ehdrp64->e_ident[EI_MAG1] == ELFMAG1)
-+ && (x_ehdrp64->e_ident[EI_MAG2] == ELFMAG2)
-+ && (x_ehdrp64->e_ident[EI_MAG3] == ELFMAG3));
-+}
-+
-+/* Translate an ELF file header in external format into an ELF file header in
-+ internal format. */
-+
-+#define H_GET_WORD(bfd, ptr) (is64 ? H_GET_64 (bfd, (ptr)) \
-+ : H_GET_32 (bfd, (ptr)))
-+#define H_GET_SIGNED_WORD(bfd, ptr) (is64 ? H_GET_S64 (bfd, (ptr)) \
-+ : H_GET_S32 (bfd, (ptr)))
-+
-+static void
-+elf_swap_ehdr_in (bfd *abfd,
-+ const Elf64_External_Ehdr *src64,
-+ Elf_Internal_Ehdr *dst)
-+{
-+ int is64 = bfd_get_arch_size (abfd) == 64;
-+#define SRC(field) (is64 ? src64->field \
-+ : ((const Elf32_External_Ehdr *) src64)->field)
-+
-+ int signed_vma = get_elf_backend_data (abfd)->sign_extend_vma;
-+ memcpy (dst->e_ident, SRC (e_ident), EI_NIDENT);
-+ dst->e_type = H_GET_16 (abfd, SRC (e_type));
-+ dst->e_machine = H_GET_16 (abfd, SRC (e_machine));
-+ dst->e_version = H_GET_32 (abfd, SRC (e_version));
-+ if (signed_vma)
-+ dst->e_entry = H_GET_SIGNED_WORD (abfd, SRC (e_entry));
-+ else
-+ dst->e_entry = H_GET_WORD (abfd, SRC (e_entry));
-+ dst->e_phoff = H_GET_WORD (abfd, SRC (e_phoff));
-+ dst->e_shoff = H_GET_WORD (abfd, SRC (e_shoff));
-+ dst->e_flags = H_GET_32 (abfd, SRC (e_flags));
-+ dst->e_ehsize = H_GET_16 (abfd, SRC (e_ehsize));
-+ dst->e_phentsize = H_GET_16 (abfd, SRC (e_phentsize));
-+ dst->e_phnum = H_GET_16 (abfd, SRC (e_phnum));
-+ dst->e_shentsize = H_GET_16 (abfd, SRC (e_shentsize));
-+ dst->e_shnum = H_GET_16 (abfd, SRC (e_shnum));
-+ dst->e_shstrndx = H_GET_16 (abfd, SRC (e_shstrndx));
-+
-+#undef SRC
-+}
-+
-+/* Translate an ELF program header table entry in external format into an
-+ ELF program header table entry in internal format. */
-+
-+static void
-+elf_swap_phdr_in (bfd *abfd,
-+ const Elf64_External_Phdr *src64,
-+ Elf_Internal_Phdr *dst)
-+{
-+ int is64 = bfd_get_arch_size (abfd) == 64;
-+#define SRC(field) (is64 ? src64->field \
-+ : ((const Elf32_External_Phdr *) src64)->field)
-+
-+ int signed_vma = get_elf_backend_data (abfd)->sign_extend_vma;
-+
-+ dst->p_type = H_GET_32 (abfd, SRC (p_type));
-+ dst->p_flags = H_GET_32 (abfd, SRC (p_flags));
-+ dst->p_offset = H_GET_WORD (abfd, SRC (p_offset));
-+ if (signed_vma)
-+ {
-+ dst->p_vaddr = H_GET_SIGNED_WORD (abfd, SRC (p_vaddr));
-+ dst->p_paddr = H_GET_SIGNED_WORD (abfd, SRC (p_paddr));
-+ }
-+ else
-+ {
-+ dst->p_vaddr = H_GET_WORD (abfd, SRC (p_vaddr));
-+ dst->p_paddr = H_GET_WORD (abfd, SRC (p_paddr));
-+ }
-+ dst->p_filesz = H_GET_WORD (abfd, SRC (p_filesz));
-+ dst->p_memsz = H_GET_WORD (abfd, SRC (p_memsz));
-+ dst->p_align = H_GET_WORD (abfd, SRC (p_align));
-+
-+#undef SRC
-+}
-+
-+#undef H_GET_SIGNED_WORD
-+#undef H_GET_WORD
-+
-+static Elf_Internal_Phdr *
-+elf_get_phdr (bfd *templ, bfd_vma ehdr_vma, unsigned *e_phnum_pointer,
-+ bfd_vma *loadbase_pointer)
-+{
-+ /* sizeof (Elf64_External_Ehdr) >= sizeof (Elf32_External_Ehdr) */
-+ Elf64_External_Ehdr x_ehdr64; /* Elf file header, external form */
-+ Elf_Internal_Ehdr i_ehdr; /* Elf file header, internal form */
-+ bfd_size_type x_phdrs_size;
-+ gdb_byte *x_phdrs_ptr;
-+ Elf_Internal_Phdr *i_phdrs;
-+ int err;
-+ unsigned int i;
-+ bfd_vma loadbase;
-+ int loadbase_set;
-+
-+ gdb_assert (templ != NULL);
-+ gdb_assert (sizeof (Elf64_External_Ehdr) >= sizeof (Elf32_External_Ehdr));
-+
-+ /* Read in the ELF header in external format. */
-+ err = target_read_memory (ehdr_vma, (bfd_byte *) &x_ehdr64, sizeof x_ehdr64);
-+ if (err)
-+ {
-+ if (build_id_verbose >= BUILD_ID_VERBOSE_BINARY_PARSE)
-+ warning (_("build-id: Error reading ELF header at address 0x%lx"),
-+ (unsigned long) ehdr_vma);
-+ return NULL;
-+ }
-+
-+ /* Now check to see if we have a valid ELF file, and one that BFD can
-+ make use of. The magic number must match, the address size ('class')
-+ and byte-swapping must match our XVEC entry. */
-+
-+ if (! elf_file_p (&x_ehdr64)
-+ || x_ehdr64.e_ident[EI_VERSION] != EV_CURRENT
-+ || !((bfd_get_arch_size (templ) == 64
-+ && x_ehdr64.e_ident[EI_CLASS] == ELFCLASS64)
-+ || (bfd_get_arch_size (templ) == 32
-+ && x_ehdr64.e_ident[EI_CLASS] == ELFCLASS32)))
-+ {
-+ if (build_id_verbose >= BUILD_ID_VERBOSE_BINARY_PARSE)
-+ warning (_("build-id: Unrecognized ELF header at address 0x%lx"),
-+ (unsigned long) ehdr_vma);
-+ return NULL;
-+ }
-+
-+ /* Check that file's byte order matches xvec's */
-+ switch (x_ehdr64.e_ident[EI_DATA])
-+ {
-+ case ELFDATA2MSB: /* Big-endian */
-+ if (! bfd_header_big_endian (templ))
-+ {
-+ if (build_id_verbose >= BUILD_ID_VERBOSE_BINARY_PARSE)
-+ warning (_("build-id: Unrecognized "
-+ "big-endian ELF header at address 0x%lx"),
-+ (unsigned long) ehdr_vma);
-+ return NULL;
-+ }
-+ break;
-+ case ELFDATA2LSB: /* Little-endian */
-+ if (! bfd_header_little_endian (templ))
-+ {
-+ if (build_id_verbose >= BUILD_ID_VERBOSE_BINARY_PARSE)
-+ warning (_("build-id: Unrecognized "
-+ "little-endian ELF header at address 0x%lx"),
-+ (unsigned long) ehdr_vma);
-+ return NULL;
-+ }
-+ break;
-+ case ELFDATANONE: /* No data encoding specified */
-+ default: /* Unknown data encoding specified */
-+ if (build_id_verbose >= BUILD_ID_VERBOSE_BINARY_PARSE)
-+ warning (_("build-id: Unrecognized "
-+ "ELF header endianity at address 0x%lx"),
-+ (unsigned long) ehdr_vma);
-+ return NULL;
-+ }
-+
-+ elf_swap_ehdr_in (templ, &x_ehdr64, &i_ehdr);
-+
-+ /* The file header tells where to find the program headers.
-+ These are what we use to actually choose what to read. */
-+
-+ if (i_ehdr.e_phentsize != (bfd_get_arch_size (templ) == 64
-+ ? sizeof (Elf64_External_Phdr)
-+ : sizeof (Elf32_External_Phdr))
-+ || i_ehdr.e_phnum == 0)
-+ {
-+ if (build_id_verbose >= BUILD_ID_VERBOSE_BINARY_PARSE)
-+ warning (_("build-id: Invalid ELF program headers from the ELF header "
-+ "at address 0x%lx"), (unsigned long) ehdr_vma);
-+ return NULL;
-+ }
-+
-+ x_phdrs_size = (bfd_get_arch_size (templ) == 64 ? sizeof (Elf64_External_Phdr)
-+ : sizeof (Elf32_External_Phdr));
-+
-+ i_phdrs = (Elf_Internal_Phdr *) xmalloc (i_ehdr.e_phnum * (sizeof *i_phdrs + x_phdrs_size));
-+ x_phdrs_ptr = (gdb_byte *) &i_phdrs[i_ehdr.e_phnum];
-+ err = target_read_memory (ehdr_vma + i_ehdr.e_phoff, (bfd_byte *) x_phdrs_ptr,
-+ i_ehdr.e_phnum * x_phdrs_size);
-+ if (err)
-+ {
-+ free (i_phdrs);
-+ if (build_id_verbose >= BUILD_ID_VERBOSE_BINARY_PARSE)
-+ warning (_("build-id: Error reading "
-+ "ELF program headers at address 0x%lx"),
-+ (unsigned long) (ehdr_vma + i_ehdr.e_phoff));
-+ return NULL;
-+ }
-+
-+ loadbase = ehdr_vma;
-+ loadbase_set = 0;
-+ for (i = 0; i < i_ehdr.e_phnum; ++i)
-+ {
-+ elf_swap_phdr_in (templ, (Elf64_External_Phdr *)
-+ (x_phdrs_ptr + i * x_phdrs_size), &i_phdrs[i]);
-+ /* IA-64 vDSO may have two mappings for one segment, where one mapping
-+ is executable only, and one is read only. We must not use the
-+ executable one (PF_R is the first one, PF_X the second one). */
-+ if (i_phdrs[i].p_type == PT_LOAD && (i_phdrs[i].p_flags & PF_R))
-+ {
-+ /* Only the first PT_LOAD segment indicates the file bias.
-+ Next segments may have P_VADDR arbitrarily higher.
-+ If the first segment has P_VADDR zero any next segment must not
-+ confuse us, the first one sets LOADBASE certainly enough. */
-+ if (!loadbase_set && i_phdrs[i].p_offset == 0)
-+ {
-+ loadbase = ehdr_vma - i_phdrs[i].p_vaddr;
-+ loadbase_set = 1;
-+ }
-+ }
-+ }
-+
-+ if (build_id_verbose >= BUILD_ID_VERBOSE_BINARY_PARSE)
-+ warning (_("build-id: Found ELF header at address 0x%lx, loadbase 0x%lx"),
-+ (unsigned long) ehdr_vma, (unsigned long) loadbase);
-+
-+ *e_phnum_pointer = i_ehdr.e_phnum;
-+ *loadbase_pointer = loadbase;
-+ return i_phdrs;
-+}
-+
-+/* BUILD_ID_ADDR_GET gets ADDR located somewhere in the object.
-+ Find the first section before ADDR containing an ELF header.
-+ We rely on the fact the sections from multiple files do not mix.
-+ FIXME: We should check ADDR is contained _inside_ the section with possibly
-+ missing content (P_FILESZ < P_MEMSZ). These omitted sections are currently
-+ hidden by _BFD_ELF_MAKE_SECTION_FROM_PHDR. */
-+
-+static CORE_ADDR build_id_addr;
-+struct build_id_addr_sect
-+ {
-+ struct build_id_addr_sect *next;
-+ asection *sect;
-+ };
-+static struct build_id_addr_sect *build_id_addr_sect;
-+
-+static void build_id_addr_candidate (bfd *abfd, asection *sect, void *obj)
-+{
-+ if (build_id_addr >= bfd_section_vma (abfd, sect))
-+ {
-+ struct build_id_addr_sect *candidate;
-+
-+ candidate = (struct build_id_addr_sect *) xmalloc (sizeof *candidate);
-+ candidate->next = build_id_addr_sect;
-+ build_id_addr_sect = candidate;
-+ candidate->sect = sect;
-+ }
-+}
-+
-+struct bfd_build_id *
-+build_id_addr_get (CORE_ADDR addr)
-+{
-+ struct build_id_addr_sect *candidate;
-+ struct bfd_build_id *retval = NULL;
-+ Elf_Internal_Phdr *i_phdr = NULL;
-+ bfd_vma loadbase = 0;
-+ unsigned e_phnum = 0;
-+
-+ if (core_bfd == NULL)
-+ return NULL;
-+
-+ build_id_addr = addr;
-+ gdb_assert (build_id_addr_sect == NULL);
-+ bfd_map_over_sections (core_bfd, build_id_addr_candidate, NULL);
-+
-+ /* Sections are sorted in the high-to-low VMAs order.
-+ Stop the search on the first ELF header we find.
-+ Do not continue the search even if it does not contain NT_GNU_BUILD_ID. */
-+
-+ for (candidate = build_id_addr_sect; candidate != NULL;
-+ candidate = candidate->next)
-+ {
-+ i_phdr = elf_get_phdr (core_bfd,
-+ bfd_section_vma (core_bfd, candidate->sect),
-+ &e_phnum, &loadbase);
-+ if (i_phdr != NULL)
-+ break;
-+ }
-+
-+ if (i_phdr != NULL)
-+ {
-+ retval = build_id_phdr_get (core_bfd, loadbase, e_phnum, i_phdr);
-+ xfree (i_phdr);
-+ }
-+
-+ while (build_id_addr_sect != NULL)
-+ {
-+ candidate = build_id_addr_sect;
-+ build_id_addr_sect = candidate->next;
-+ xfree (candidate);
-+ }
-+
-+ return retval;
-+}
-+
- /* See build-id.h. */
-
- int
-@@ -50,7 +448,7 @@ build_id_verify (bfd *abfd, size_t check
- const struct bfd_build_id *found;
- int retval = 0;
-
-- found = build_id_bfd_get (abfd);
-+ found = build_id_bfd_shdr_get (abfd);
-
- if (found == NULL)
- warning (_("File \"%s\" has no build-id, file skipped"),
-@@ -65,23 +463,56 @@ build_id_verify (bfd *abfd, size_t check
- return retval;
- }
-
-+static char *
-+link_resolve (const char *symlink, int level)
-+{
-+ char buf[PATH_MAX + 1], *target, *retval;
-+ ssize_t got;
-+
-+ if (level > 10)
-+ return xstrdup (symlink);
-+
-+ got = readlink (symlink, buf, sizeof (buf));
-+ if (got < 0 || got >= sizeof (buf))
-+ return xstrdup (symlink);
-+ buf[got] = '\0';
-+
-+ if (IS_ABSOLUTE_PATH (buf))
-+ target = xstrdup (buf);
-+ else
-+ {
-+ std::string dir = ldirname (symlink);
-+
-+ if (dir.length () == 0)
-+ return xstrdup (symlink);
-+ target = xstrprintf ("%s"
-+#ifndef HAVE_DOS_BASED_FILE_SYSTEM
-+ "/"
-+#else /* HAVE_DOS_BASED_FILE_SYSTEM */
-+ "\\"
-+#endif /* HAVE_DOS_BASED_FILE_SYSTEM */
-+ "%s", dir.c_str (), buf);
-+ }
-+
-+ retval = link_resolve (target, level + 1);
-+ xfree (target);
-+ return retval;
-+}
-+
- /* 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, int add_debug_suffix)
- {
-- char *link, *debugdir;
-+ char *link, *debugdir, *link_all = NULL;
- VEC (char_ptr) *debugdir_vec;
- struct cleanup *back_to;
- int ix;
- gdb_bfd_ref_ptr abfd;
-- int alloc_len;
-
- /* DEBUG_FILE_DIRECTORY/.build-id/ab/cdef */
-- alloc_len = (strlen (debug_file_directory)
-- + (sizeof "/.build-id/" - 1) + 1
-- + 2 * build_id_len + (sizeof ".debug" - 1) + 1);
-- link = (char *) alloca (alloc_len);
-+ link = (char *) xmalloc (strlen (debug_file_directory) + 2 * build_id_len + 50);
-
- /* Keep backward compatibility so that DEBUG_FILE_DIRECTORY being "" will
- cause "/.build-id/..." lookups. */
-@@ -94,9 +525,12 @@ build_id_to_debug_bfd (size_t build_id_l
- size_t debugdir_len = strlen (debugdir);
- const gdb_byte *data = build_id;
- size_t size = build_id_len;
-- char *s;
- char *filename = NULL;
- struct cleanup *inner;
-+ unsigned seqno;
-+ struct stat statbuf_trash;
-+ /* Initialize it just to avoid a GCC false warning. */
-+ char *s, *link0 = NULL, *link0_resolved;
-
- memcpy (link, debugdir, debugdir_len);
- s = &link[debugdir_len];
-@@ -110,45 +544,290 @@ build_id_to_debug_bfd (size_t build_id_l
- *s++ = '/';
- while (size-- > 0)
- s += sprintf (s, "%02x", (unsigned) *data++);
-- strcpy (s, ".debug");
-+ for (seqno = 0;; seqno++)
-+ {
-+ char *s2;
-
-- /* lrealpath() is expensive even for the usually non-existent files. */
-- if (access (link, F_OK) == 0)
-- filename = lrealpath (link);
-+ if (seqno)
-+ {
-+ /* There can be multiple build-id symlinks pointing to real files
-+ with the same build-id (such as hard links). Some of the real
-+ files may not be installed. */
-+
-+ s2 = s + sprintf (s, ".%u", seqno);
-+ }
-+ else
-+ s2 = s;
-+
-+ if (add_debug_suffix)
-+ strcpy (s2, ".debug");
-+ else
-+ *s2 = 0;
-+
-+ if (!seqno)
-+ {
-+ /* If none of the real files is found report as missing file
-+ always the non-.%u-suffixed file. */
-+ link0 = xstrdup (link);
-+ }
-+
-+ /* `access' automatically dereferences LINK. */
-+ if (lstat (link, &statbuf_trash) != 0)
-+ {
-+ /* Stop increasing SEQNO. */
-+ break;
-+ }
-+
-+ filename = lrealpath (link);
-+ if (filename == NULL)
-+ continue;
-+
-+ /* We expect to be silent on the non-existing files. */
-+ inner = make_cleanup (xfree, filename);
-+ abfd = gdb_bfd_open (filename, gnutarget, -1);
-+ do_cleanups (inner);
-+
-+ if (abfd == NULL)
-+ continue;
-
-- if (filename == NULL)
-- continue;
-+ if (build_id_verify (abfd.get(), build_id_len, build_id))
-+ break;
-
-- /* We expect to be silent on the non-existing files. */
-- inner = make_cleanup (xfree, filename);
-- abfd = gdb_bfd_open (filename, gnutarget, -1);
-- do_cleanups (inner);
-+ abfd.release ();
-
-- if (abfd == NULL)
-- continue;
-+ filename = NULL;
-+ }
-
-- if (build_id_verify (abfd.get(), build_id_len, build_id))
-- break;
-+ if (filename != NULL)
-+ {
-+ /* LINK_ALL is not used below in this non-NULL FILENAME case. */
-+ xfree (link0);
-+ break;
-+ }
-
-- abfd.release ();
-+ /* If the symlink has target request to install the target.
-+ BASE-debuginfo.rpm contains the symlink but BASE.rpm may be missing.
-+ https://bugzilla.redhat.com/show_bug.cgi?id=981154 */
-+ link0_resolved = link_resolve (link0, 0);
-+ xfree (link0);
-+
-+ if (link_all == NULL)
-+ link_all = link0_resolved;
-+ else
-+ {
-+ size_t len_orig = strlen (link_all);
-+
-+ link_all = (char *) xrealloc (link_all,
-+ len_orig + 1 + strlen (link0_resolved) + 1);
-+
-+ /* Use whitespace instead of DIRNAME_SEPARATOR to be compatible with
-+ its possible use as an argument for installation command. */
-+ link_all[len_orig] = ' ';
-+
-+ strcpy (&link_all[len_orig + 1], link0_resolved);
-+ xfree (link0_resolved);
-+ }
-+ }
-+
-+ if (link_return != NULL)
-+ {
-+ if (abfd != NULL)
-+ {
-+ *link_return = link;
-+ link = NULL;
-+ }
-+ else
-+ {
-+ *link_return = link_all;
-+ link_all = NULL;
-+ }
- }
-+ xfree (link);
-+ xfree (link_all);
-
- do_cleanups (back_to);
- return abfd;
- }
-
-+char *
-+build_id_to_filename (const struct bfd_build_id *build_id, char **link_return)
-+{
-+ gdb_bfd_ref_ptr abfd;
-+ char *result;
-+
-+ abfd = build_id_to_debug_bfd (build_id->size, build_id->data, link_return, 0);
-+ if (abfd == NULL)
-+ return NULL;
-+
-+ result = xstrdup (bfd_get_filename (abfd));
-+ abfd.release ();
-+ return result;
-+}
-+
-+/* This MISSING_FILEPAIR_HASH tracker is used only for the duplicite messages
-+ Try to install the hash file ...
-+ avoidance. */
-+
-+struct missing_filepair
-+ {
-+ char *binary;
-+ char *debug;
-+ char data[1];
-+ };
-+
-+static struct htab *missing_filepair_hash;
-+static struct obstack missing_filepair_obstack;
-+
-+static void *
-+missing_filepair_xcalloc (size_t nmemb, size_t nmemb_size)
-+{
-+ void *retval;
-+ size_t size = nmemb * nmemb_size;
-+
-+ retval = obstack_alloc (&missing_filepair_obstack, size);
-+ memset (retval, 0, size);
-+ return retval;
-+}
-+
-+static hashval_t
-+missing_filepair_hash_func (const struct missing_filepair *elem)
-+{
-+ hashval_t retval = 0;
-+
-+ retval ^= htab_hash_string (elem->binary);
-+ if (elem->debug != NULL)
-+ retval ^= htab_hash_string (elem->debug);
-+
-+ return retval;
-+}
-+
-+static int
-+missing_filepair_eq (const struct missing_filepair *elem1,
-+ const struct missing_filepair *elem2)
-+{
-+ return strcmp (elem1->binary, elem2->binary) == 0
-+ && ((elem1->debug == NULL) == (elem2->debug == NULL))
-+ && (elem1->debug == NULL || strcmp (elem1->debug, elem2->debug) == 0);
-+}
-+
-+static void
-+missing_filepair_change (void)
-+{
-+ if (missing_filepair_hash != NULL)
-+ {
-+ obstack_free (&missing_filepair_obstack, NULL);
-+ /* All their memory came just from missing_filepair_OBSTACK. */
-+ missing_filepair_hash = NULL;
-+ }
-+}
-+
-+static void
-+debug_print_executable_changed (void)
-+{
-+ missing_filepair_change ();
-+}
-+
-+/* Notify user the file BINARY with (possibly NULL) associated separate debug
-+ information file DEBUG is missing. DEBUG may or may not be the build-id
-+ file such as would be:
-+ /usr/lib/debug/.build-id/dd/b1d2ce632721c47bb9e8679f369e2295ce71be.debug
-+ */
-+
-+void
-+debug_print_missing (const char *binary, const char *debug)
-+{
-+ size_t binary_len0 = strlen (binary) + 1;
-+ size_t debug_len0 = debug ? strlen (debug) + 1 : 0;
-+ struct missing_filepair missing_filepair_find;
-+ struct missing_filepair *missing_filepair;
-+ struct missing_filepair **slot;
-+
-+ if (build_id_verbose < BUILD_ID_VERBOSE_FILENAMES)
-+ return;
-+
-+ if (missing_filepair_hash == NULL)
-+ {
-+ obstack_init (&missing_filepair_obstack);
-+ missing_filepair_hash = htab_create_alloc (64,
-+ (hashval_t (*) (const void *)) missing_filepair_hash_func,
-+ (int (*) (const void *, const void *)) missing_filepair_eq, NULL,
-+ missing_filepair_xcalloc, NULL);
-+ }
-+
-+ /* Use MISSING_FILEPAIR_FIND first instead of calling obstack_alloc with
-+ obstack_free in the case of a (rare) match. The problem is ALLOC_F for
-+ MISSING_FILEPAIR_HASH allocates from MISSING_FILEPAIR_OBSTACK maintenance
-+ structures for MISSING_FILEPAIR_HASH. Calling obstack_free would possibly
-+ not to free only MISSING_FILEPAIR but also some such structures (allocated
-+ during the htab_find_slot call). */
-+
-+ missing_filepair_find.binary = (char *) binary;
-+ missing_filepair_find.debug = (char *) debug;
-+ slot = (struct missing_filepair **) htab_find_slot (missing_filepair_hash,
-+ &missing_filepair_find,
-+ INSERT);
-+
-+ /* While it may be still printed duplicitely with the missing debuginfo file
-+ * it is due to once printing about the binary file build-id link and once
-+ * about the .debug file build-id link as both the build-id symlinks are
-+ * located in the debuginfo package. */
-+
-+ if (*slot != NULL)
-+ return;
-+
-+ missing_filepair = (struct missing_filepair *) obstack_alloc (&missing_filepair_obstack,
-+ sizeof (*missing_filepair) - 1
-+ + binary_len0 + debug_len0);
-+ missing_filepair->binary = missing_filepair->data;
-+ memcpy (missing_filepair->binary, binary, binary_len0);
-+ if (debug != NULL)
-+ {
-+ missing_filepair->debug = missing_filepair->binary + binary_len0;
-+ memcpy (missing_filepair->debug, debug, debug_len0);
-+ }
-+ else
-+ missing_filepair->debug = NULL;
-+
-+ *slot = missing_filepair;
-+
-+ /* We do not collect and flush these messages as each such message
-+ already requires its own separate lines. */
-+
-+ 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);
-+}
-+
- /* See build-id.h. */
-
- char *
--find_separate_debug_file_by_buildid (struct objfile *objfile)
-+find_separate_debug_file_by_buildid (struct objfile *objfile,
-+ gdb::unique_xmalloc_ptr<char> *build_id_filename_return)
- {
- const struct bfd_build_id *build_id;
-
-- build_id = build_id_bfd_get (objfile->obfd);
-+ if (build_id_filename_return)
-+ *build_id_filename_return = NULL;
-+
-+ build_id = build_id_bfd_shdr_get (objfile->obfd);
- if (build_id != NULL)
- {
-+ char *build_id_filename_cstr = NULL;
- 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));
-+ if (build_id_filename_return)
-+ {
-+ if (!build_id_filename_cstr)
-+ gdb_assert (!*build_id_filename_return);
-+ else
-+ {
-+ *build_id_filename_return = gdb::unique_xmalloc_ptr<char> (build_id_filename_cstr);
-+ build_id_filename_cstr = NULL;
-+ }
-+ }
- /* Prevent looping on a stripped .debug file. */
- if (abfd != NULL
- && filename_cmp (bfd_get_filename (abfd.get ()),
-@@ -160,3 +839,21 @@ find_separate_debug_file_by_buildid (str
- }
- return NULL;
- }
-+
-+extern void _initialize_build_id (void);
-+
-+void
-+_initialize_build_id (void)
-+{
-+ add_setshow_zinteger_cmd ("build-id-verbose", no_class, &build_id_verbose,
-+ _("\
-+Set debugging level of the build-id locator."), _("\
-+Show debugging level of the build-id locator."), _("\
-+Level 1 (default) enables printing the missing debug filenames,\n\
-+level 2 also prints the parsing of binaries to find the identificators."),
-+ NULL,
-+ show_build_id_verbose,
-+ &setlist, &showlist);
-+
-+ observer_attach_executable_changed (debug_print_executable_changed);
-+}
-diff -Naurp insight-7.12.50.20170416.orig/gdb/build-id.h insight-7.12.50.20170416.new/gdb/build-id.h
---- insight-7.12.50.20170416.orig/gdb/build-id.h 2017-01-21 02:32:23.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/build-id.h 2017-04-16 13:52:31.767187912 +0100
-@@ -22,9 +22,10 @@
-
- #include "gdb_bfd.h"
-
--/* Locate NT_GNU_BUILD_ID from ABFD and return its content. */
-+/* Separate debuginfo files have corrupted PHDR but SHDR is correct there.
-+ Locate NT_GNU_BUILD_ID from ABFD and return its content. */
-
--extern const struct bfd_build_id *build_id_bfd_get (bfd *abfd);
-+extern const struct bfd_build_id *build_id_bfd_shdr_get (bfd *abfd);
-
- /* Return true if ABFD has NT_GNU_BUILD_ID matching the CHECK value.
- Otherwise, issue a warning and return false. */
-@@ -38,13 +39,19 @@ extern int build_id_verify (bfd *abfd,
- the caller. */
-
- 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);
-+
-+extern char *build_id_to_filename (const struct bfd_build_id *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 a malloc'd
- file name for the separate debug file. The caller must free this.
- Otherwise, returns NULL. */
-
--extern char *find_separate_debug_file_by_buildid (struct objfile *objfile);
-+extern char *find_separate_debug_file_by_buildid (struct objfile *objfile,
-+ gdb::unique_xmalloc_ptr<char> *build_id_filename_return);
-
- #endif /* BUILD_ID_H */
-diff -Naurp insight-7.12.50.20170416.orig/gdb/coffread.c insight-7.12.50.20170416.new/gdb/coffread.c
---- insight-7.12.50.20170416.orig/gdb/coffread.c 2017-01-21 02:32:23.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/coffread.c 2017-04-16 13:52:31.773187966 +0100
-@@ -734,7 +734,7 @@ coff_symfile_read (struct objfile *objfi
- {
- char *debugfile;
-
-- debugfile = find_separate_debug_file_by_buildid (objfile);
-+ debugfile = find_separate_debug_file_by_buildid (objfile, NULL);
-
- if (debugfile == NULL)
- debugfile = find_separate_debug_file_by_debuglink (objfile);
-diff -Naurp insight-7.12.50.20170416.orig/gdb/corelow.c insight-7.12.50.20170416.new/gdb/corelow.c
---- insight-7.12.50.20170416.orig/gdb/corelow.c 2017-04-09 01:11:01.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/corelow.c 2017-04-16 13:52:31.752187778 +0100
-@@ -45,6 +45,10 @@
- #include "gdb_bfd.h"
- #include "completer.h"
- #include "filestuff.h"
-+#include "auxv.h"
-+#include "elf/common.h"
-+#include "gdbcmd.h"
-+#include "build-id.h"
-
- #ifndef O_LARGEFILE
- #define O_LARGEFILE 0
-@@ -266,6 +270,54 @@ add_to_thread_list (bfd *abfd, asection
- 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, *debug_filename;
-+ char *build_id_filename;
-+ struct cleanup *back_to;
-+
-+ if (exec_bfd != NULL || symfile_objfile != NULL)
-+ return;
-+
-+ if (target_auxv_search (¤t_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. */
-+}
-+
- /* This routine opens and sets up the core file bfd. */
-
- static void
-@@ -402,6 +454,14 @@ core_open (const char *arg, int from_tty
- switch_to_thread (thread->ptid);
- }
-
-+ /* 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 (&core_ops, from_tty);
-
- /* Now go through the target stack looking for threads since there
-@@ -1079,4 +1139,11 @@ _initialize_corelow (void)
- init_core_ops ();
-
- add_target_with_completer (&core_ops, filename_completer);
-+
-+ add_setshow_boolean_cmd ("build-id-core-loads", class_files,
-+ &build_id_core_loads, _("\
-+Set whether CORE-FILE loads the build-id associated files automatically."), _("\
-+Show whether CORE-FILE loads the build-id associated files automatically."),
-+ NULL, NULL, NULL,
-+ &setlist, &showlist);
- }
-diff -Naurp insight-7.12.50.20170416.orig/gdb/doc/gdb.texinfo insight-7.12.50.20170416.new/gdb/doc/gdb.texinfo
---- insight-7.12.50.20170416.orig/gdb/doc/gdb.texinfo 2017-04-16 13:51:32.834666757 +0100
-+++ insight-7.12.50.20170416.new/gdb/doc/gdb.texinfo 2017-04-16 13:52:31.761187859 +0100
-@@ -18977,6 +18977,27 @@ information files.
-
- @end table
-
-+You can also adjust the current verbosity of the @dfn{build id} locating.
-+
-+@table @code
-+
-+@kindex set build-id-verbose
-+@item set build-id-verbose 0
-+No additional messages are printed.
-+
-+@item set build-id-verbose 1
-+Missing separate debug filenames are printed.
-+
-+@item set build-id-verbose 2
-+Missing separate debug filenames are printed and also all the parsing of the
-+binaries to find their @dfn{build id} content is printed.
-+
-+@kindex show build-id-verbose
-+@item show build-id-verbose
-+Show the current verbosity value for the @dfn{build id} content locating.
-+
-+@end table
-+
- @cindex @code{.gnu_debuglink} sections
- @cindex debug link sections
- A debug link is a special section of the executable file named
-diff -Naurp insight-7.12.50.20170416.orig/gdb/dwarf2read.c insight-7.12.50.20170416.new/gdb/dwarf2read.c
---- insight-7.12.50.20170416.orig/gdb/dwarf2read.c 2017-04-16 13:51:32.837666783 +0100
-+++ insight-7.12.50.20170416.new/gdb/dwarf2read.c 2017-04-16 13:52:31.772187957 +0100
-@@ -2670,7 +2670,7 @@ dwarf2_get_dwz_file (void)
- }
-
- 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);
-
- if (dwz_bfd == NULL)
- error (_("could not find '.gnu_debugaltlink' file for %s"),
-diff -Naurp insight-7.12.50.20170416.orig/gdb/elfread.c insight-7.12.50.20170416.new/gdb/elfread.c
---- insight-7.12.50.20170416.orig/gdb/elfread.c 2017-04-15 01:21:12.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/elfread.c 2017-04-16 13:52:31.762187868 +0100
-@@ -1265,8 +1265,9 @@ elf_symfile_read (struct objfile *objfil
- && objfile->separate_debug_objfile == NULL
- && objfile->separate_debug_objfile_backlink == NULL)
- {
-+ gdb::unique_xmalloc_ptr<char> build_id_filename;
- gdb::unique_xmalloc_ptr<char> debugfile
-- (find_separate_debug_file_by_buildid (objfile));
-+ (find_separate_debug_file_by_buildid (objfile, &build_id_filename));
-
- if (debugfile == NULL)
- debugfile.reset (find_separate_debug_file_by_debuglink (objfile));
-@@ -1278,6 +1279,10 @@ elf_symfile_read (struct objfile *objfil
- symbol_file_add_separate (abfd.get (), debugfile.get (),
- symfile_flags, objfile);
- }
-+ /* 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 ());
- }
- }
-
-diff -Naurp insight-7.12.50.20170416.orig/gdb/objfiles.h insight-7.12.50.20170416.new/gdb/objfiles.h
---- insight-7.12.50.20170416.orig/gdb/objfiles.h 2017-04-09 01:11:01.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/objfiles.h 2017-04-16 13:52:31.766187903 +0100
-@@ -444,6 +444,10 @@ struct objfile
- htab_t static_links;
- };
-
-+/* This file was loaded according to the BUILD_ID_CORE_LOADS rules. */
-+
-+#define OBJF_BUILD_ID_CORE_LOADED static_cast<enum objfile_flag>(1 << 12)
-+
- /* Declarations for functions defined in objfiles.c */
-
- extern struct objfile *allocate_objfile (bfd *, const char *name,
-diff -Naurp insight-7.12.50.20170416.orig/gdb/python/py-objfile.c insight-7.12.50.20170416.new/gdb/python/py-objfile.c
---- insight-7.12.50.20170416.orig/gdb/python/py-objfile.c 2017-04-09 01:11:01.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/python/py-objfile.c 2017-04-16 13:52:31.772187957 +0100
-@@ -137,7 +137,7 @@ objfpy_get_build_id (PyObject *self, voi
-
- TRY
- {
-- build_id = build_id_bfd_get (objfile->obfd);
-+ build_id = build_id_bfd_shdr_get (objfile->obfd);
- }
- CATCH (except, RETURN_MASK_ALL)
- {
-@@ -544,7 +544,7 @@ objfpy_lookup_objfile_by_build_id (const
- /* Don't return separate debug files. */
- if (objfile->separate_debug_objfile_backlink != NULL)
- continue;
-- obfd_build_id = build_id_bfd_get (objfile->obfd);
-+ obfd_build_id = build_id_bfd_shdr_get (objfile->obfd);
- if (obfd_build_id == NULL)
- continue;
- if (objfpy_build_id_matches (obfd_build_id, build_id))
-diff -Naurp insight-7.12.50.20170416.orig/gdb/solib-svr4.c insight-7.12.50.20170416.new/gdb/solib-svr4.c
---- insight-7.12.50.20170416.orig/gdb/solib-svr4.c 2017-03-25 10:42:37.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/solib-svr4.c 2017-04-16 13:52:31.762187868 +0100
-@@ -45,6 +45,7 @@
- #include "auxv.h"
- #include "gdb_bfd.h"
- #include "probe.h"
-+#include "build-id.h"
-
- static struct link_map_offsets *svr4_fetch_link_map_offsets (void);
- static int svr4_have_link_map_offsets (void);
-@@ -1420,9 +1421,52 @@ svr4_read_so_list (CORE_ADDR lm, CORE_AD
- continue;
- }
-
-- strncpy (newobj->so_name, buffer, SO_NAME_MAX_PATH_SIZE - 1);
-- newobj->so_name[SO_NAME_MAX_PATH_SIZE - 1] = '\0';
-- strcpy (newobj->so_original_name, newobj->so_name);
-+ {
-+ struct bfd_build_id *build_id;
-+
-+ strncpy (newobj->so_original_name, buffer, SO_NAME_MAX_PATH_SIZE - 1);
-+ newobj->so_original_name[SO_NAME_MAX_PATH_SIZE - 1] = '\0';
-+ /* May get overwritten below. */
-+ strcpy (newobj->so_name, newobj->so_original_name);
-+
-+ build_id = build_id_addr_get (newobj->lm_info->l_ld);
-+ if (build_id != NULL)
-+ {
-+ char *name, *build_id_filename;
-+
-+ /* Missing the build-id matching separate debug info file
-+ would be handled while SO_NAME gets loaded. */
-+ name = build_id_to_filename (build_id, &build_id_filename);
-+ if (name != NULL)
-+ {
-+ strncpy (newobj->so_name, name, SO_NAME_MAX_PATH_SIZE - 1);
-+ newobj->so_name[SO_NAME_MAX_PATH_SIZE - 1] = '\0';
-+ xfree (name);
-+ }
-+ else
-+ {
-+ debug_print_missing (newobj->so_name, build_id_filename);
-+
-+ /* In the case the main executable was found according to
-+ its build-id (from a core file) prevent loading
-+ a different build of a library with accidentally the
-+ same SO_NAME.
-+
-+ It suppresses bogus backtraces (and prints "??" there
-+ instead) if the on-disk files no longer match the
-+ running program version. */
-+
-+ if (symfile_objfile != NULL
-+ && (symfile_objfile->flags
-+ & OBJF_BUILD_ID_CORE_LOADED) != 0)
-+ newobj->so_name[0] = 0;
-+ }
-+
-+ xfree (build_id_filename);
-+ xfree (build_id);
-+ }
-+ }
-+
- xfree (buffer);
-
- /* If this entry has no name, or its name matches the name
-diff -Naurp insight-7.12.50.20170416.orig/gdb/symfile.h insight-7.12.50.20170416.new/gdb/symfile.h
---- insight-7.12.50.20170416.orig/gdb/symfile.h 2017-04-15 01:21:12.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/symfile.h 2017-04-16 13:52:31.763187877 +0100
-@@ -567,6 +567,10 @@ void expand_symtabs_matching
- void map_symbol_filenames (symbol_filename_ftype *fun, void *data,
- int need_fullname);
-
-+/* 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);
-+
- /* From dwarf2read.c */
-
- /* Names for a dwarf2 debugging section. The field NORMAL is the normal
-diff -Naurp insight-7.12.50.20170416.orig/gdb/testsuite/gdb.base/corefile.exp insight-7.12.50.20170416.new/gdb/testsuite/gdb.base/corefile.exp
---- insight-7.12.50.20170416.orig/gdb/testsuite/gdb.base/corefile.exp 2017-01-03 17:36:55.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/testsuite/gdb.base/corefile.exp 2017-04-16 13:52:31.766187903 +0100
-@@ -293,3 +293,33 @@ gdb_test_multiple "core-file $corefile"
- pass $test
- }
- }
-+
-+
-+# Test auto-loading of binary files through build-id from the core file.
-+set buildid [build_id_debug_filename_get $binfile]
-+set wholetest "binfile found by build-id"
-+if {$buildid == ""} {
-+ untested "$wholetest (binary has no build-id)"
-+} else {
-+ gdb_exit
-+ gdb_start
-+
-+ regsub {\.debug$} $buildid {} buildid
-+ set debugdir [standard_output_file ${testfile}-debugdir]
-+ file delete -force -- $debugdir
-+ file mkdir $debugdir/[file dirname $buildid]
-+ file copy $binfile $debugdir/$buildid
-+
-+ set test "show debug-file-directory"
-+ gdb_test_multiple $test $test {
-+ -re "The directory where separate debug symbols are searched for is \"(.*)\"\\.\r\n$gdb_prompt $" {
-+ set debugdir_orig $expect_out(1,string)
-+ pass $test
-+ }
-+ }
-+ gdb_test_no_output "set debug-file-directory $debugdir:$debugdir_orig" "set debug-file-directory"
-+ gdb_test "show build-id-core-loads" {Whether CORE-FILE loads the build-id associated files automatically is on\.}
-+ gdb_test "core-file $corefile" "\r\nProgram terminated with .*" "core-file without executable"
-+ gdb_test "info files" "Local exec file:\r\n\[ \t\]*`[string_to_regexp $debugdir/$buildid]', file type .*"
-+ pass $wholetest
-+}
-diff -Naurp insight-7.12.50.20170416.orig/gdb/testsuite/gdb.base/new-ui-pending-input.exp insight-7.12.50.20170416.new/gdb/testsuite/gdb.base/new-ui-pending-input.exp
---- insight-7.12.50.20170416.orig/gdb/testsuite/gdb.base/new-ui-pending-input.exp 2017-01-03 17:36:55.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/testsuite/gdb.base/new-ui-pending-input.exp 2017-04-16 13:52:31.765187895 +0100
-@@ -62,6 +62,7 @@ proc test_command_line_new_ui_pending_in
- set options ""
- append options " -iex \"set height 0\""
- append options " -iex \"set width 0\""
-+ append options " -iex \"set build-id-verbose 0\""
- append options " -iex \"new-ui console $extra_tty_name\""
- append options " -ex \"b $bpline\""
- append options " -ex \"run\""
-diff -Naurp insight-7.12.50.20170416.orig/gdb/testsuite/lib/gdb.exp insight-7.12.50.20170416.new/gdb/testsuite/lib/gdb.exp
---- insight-7.12.50.20170416.orig/gdb/testsuite/lib/gdb.exp 2017-04-16 13:51:32.814666580 +0100
-+++ insight-7.12.50.20170416.new/gdb/testsuite/lib/gdb.exp 2017-04-16 13:52:31.764187886 +0100
-@@ -1646,6 +1646,16 @@ proc default_gdb_start { } {
- warning "Couldn't set the width to 0."
- }
- }
-+ # Turn off the missing warnings as the testsuite does not expect it.
-+ send_gdb "set build-id-verbose 0\n"
-+ gdb_expect 10 {
-+ -re "$gdb_prompt $" {
-+ verbose "Disabled the missing debug infos warnings." 2
-+ }
-+ timeout {
-+ warning "Could not disable the missing debug infos warnings.."
-+ }
-+ }
- return 0
- }
-
-diff -Naurp insight-7.12.50.20170416.orig/gdb/testsuite/lib/mi-support.exp insight-7.12.50.20170416.new/gdb/testsuite/lib/mi-support.exp
---- insight-7.12.50.20170416.orig/gdb/testsuite/lib/mi-support.exp 2017-03-25 10:42:37.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/testsuite/lib/mi-support.exp 2017-04-16 13:52:31.765187895 +0100
-@@ -309,6 +309,16 @@ proc default_mi_gdb_start { args } {
- warning "Couldn't set the width to 0."
- }
- }
-+ # Turn off the missing warnings as the testsuite does not expect it.
-+ send_gdb "190-gdb-set build-id-verbose 0\n"
-+ gdb_expect 10 {
-+ -re ".*190-gdb-set build-id-verbose 0\r\n190\\\^done\r\n$mi_gdb_prompt$" {
-+ verbose "Disabled the missing debug infos warnings." 2
-+ }
-+ timeout {
-+ warning "Could not disable the missing debug infos warnings.."
-+ }
-+ }
-
- if { $separate_inferior_pty } {
- mi_create_inferior_pty
diff --git a/insight-7.12-gdb-6.8-attach-signalled-detach-stopped.patch b/insight-7.12-gdb-6.8-attach-signalled-detach-stopped.patch
deleted file mode 100644
index 6126c41..0000000
--- a/insight-7.12-gdb-6.8-attach-signalled-detach-stopped.patch
+++ /dev/null
@@ -1,177 +0,0 @@
-diff -Naurp insight-7.12.50.20170416.orig/gdb/infrun.c insight-7.12.50.20170416.new/gdb/infrun.c
---- insight-7.12.50.20170416.orig/gdb/infrun.c 2017-04-16 12:20:48.912021636 +0100
-+++ insight-7.12.50.20170416.new/gdb/infrun.c 2017-04-16 12:21:43.277528153 +0100
-@@ -620,6 +620,13 @@ holding the child stopped. Try \"set de
- target_pid_to_str (process_ptid));
- }
-
-+#ifdef NEED_DETACH_SIGSTOP
-+ /* We should check PID_WAS_STOPPED and detach it stopped accordingly.
-+ In this point of code it cannot be 1 as we would not get FORK
-+ executed without CONTINUE first which resets PID_WAS_STOPPED.
-+ We would have to first TARGET_STOP and WAITPID it as with running
-+ inferior PTRACE_DETACH, SIGSTOP will ignore the signal. */
-+#endif
- target_detach (NULL, 0);
- }
-
-diff -Naurp insight-7.12.50.20170416.orig/gdb/linux-nat.c insight-7.12.50.20170416.new/gdb/linux-nat.c
---- insight-7.12.50.20170416.orig/gdb/linux-nat.c 2017-04-16 10:13:09.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/linux-nat.c 2017-04-16 12:21:43.941534340 +0100
-@@ -194,6 +194,11 @@ enum tribool have_ptrace_getregset = TRI
- static struct target_ops *linux_ops;
- static struct target_ops linux_ops_saved;
-
-+#ifdef NEED_DETACH_SIGSTOP
-+/* PID of the inferior stopped by SIGSTOP before attaching (or zero). */
-+static pid_t pid_was_stopped;
-+
-+#endif
- /* The method to call, if any, when a new thread is attached. */
- static void (*linux_nat_new_thread) (struct lwp_info *);
-
-@@ -1055,6 +1060,9 @@ linux_nat_post_attach_wait (ptid_t ptid,
- if (debug_linux_nat)
- fprintf_unfiltered (gdb_stdlog,
- "LNPAW: Attaching to a stopped process\n");
-+#ifdef NEED_DETACH_SIGSTOP
-+ pid_was_stopped = ptid_get_pid (ptid);
-+#endif
-
- /* The process is definitely stopped. It is in a job control
- stop, unless the kernel predates the TASK_STOPPED /
-@@ -1390,6 +1398,25 @@ get_detach_signal (struct lwp_info *lp)
- return gdb_signal_to_host (signo);
- }
-
-+#ifdef NEED_DETACH_SIGSTOP
-+ /* Workaround RHEL-5 kernel which has unreliable PTRACE_DETACH, SIGSTOP (that
-+ many TIDs are left unstopped). See RH Bug 496732. */
-+ if (ptid_get_pid (lp->ptid) == pid_was_stopped)
-+ {
-+ int err;
-+
-+ errno = 0;
-+ err = kill_lwp (ptid_get_lwp (lp->ptid), SIGSTOP);
-+ if (debug_linux_nat)
-+ {
-+ fprintf_unfiltered (gdb_stdlog,
-+ "SC: lwp kill %d %s\n",
-+ err,
-+ errno ? safe_strerror (errno) : "ERRNO-OK");
-+ }
-+ }
-+
-+#endif
- return 0;
- }
-
-@@ -1548,6 +1575,10 @@ linux_nat_detach (struct target_ops *ops
- detach_one_lwp (main_lwp, &signo);
-
- inf_ptrace_detach_success (ops);
-+
-+#ifdef NEED_DETACH_SIGSTOP
-+ pid_was_stopped = 0;
-+#endif
- }
- }
-
-@@ -1808,6 +1839,16 @@ linux_nat_resume (struct target_ops *ops
- return;
- }
-
-+#ifdef NEED_DETACH_SIGSTOP
-+ /* At this point, we are going to resume the inferior and if we
-+ have attached to a stopped process, we no longer should leave
-+ it as stopped if the user detaches. PTID variable has PID set to LWP
-+ while we need to check the real PID here. */
-+
-+ if (!step && lp && pid_was_stopped == ptid_get_pid (lp->ptid))
-+ pid_was_stopped = 0;
-+
-+#endif
- if (resume_many)
- iterate_over_lwps (ptid, linux_nat_resume_callback, lp);
-
-@@ -3804,6 +3845,10 @@ linux_nat_mourn_inferior (struct target_
-
- /* Let the arch-specific native code know this process is gone. */
- linux_nat_forget_process (pid);
-+#ifdef NEED_DETACH_SIGSTOP
-+
-+ pid_was_stopped = 0;
-+#endif
- }
-
- /* Convert a native/host siginfo object, into/from the siginfo in the
-diff -Naurp insight-7.12.50.20170416.orig/gdb/testsuite/gdb.threads/attach-stopped.exp insight-7.12.50.20170416.new/gdb/testsuite/gdb.threads/attach-stopped.exp
---- insight-7.12.50.20170416.orig/gdb/testsuite/gdb.threads/attach-stopped.exp 2017-01-03 17:36:55.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/testsuite/gdb.threads/attach-stopped.exp 2017-04-16 12:21:43.942534349 +0100
-@@ -56,7 +56,65 @@ proc corefunc { threadtype } {
- gdb_reinitialize_dir $srcdir/$subdir
- gdb_load ${binfile}
-
-- # Verify that we can attach to the stopped process.
-+ # Verify that we can attach to the process by first giving its
-+ # executable name via the file command, and using attach with the
-+ # process ID.
-+
-+ set test "$threadtype: set file, before attach1 to stopped process"
-+ gdb_test_multiple "file $binfile" "$test" {
-+ -re "Load new symbol table from.*y or n. $" {
-+ gdb_test "y" "Reading symbols from $escapedbinfile\.\.\.*done." \
-+ "$test (re-read)"
-+ }
-+ -re "Reading symbols from $escapedbinfile\.\.\.*done.*$gdb_prompt $" {
-+ pass "$test"
-+ }
-+ }
-+
-+ set test "$threadtype: attach1 to stopped, after setting file"
-+ gdb_test_multiple "attach $testpid" "$test" {
-+ -re "Attaching to program.*`?$escapedbinfile'?, process $testpid.*$gdb_prompt $" {
-+ pass "$test"
-+ }
-+ }
-+
-+ # ".*sleep.*clone.*" would fail on s390x as bt stops at START_THREAD there.
-+ if {[string equal $threadtype threaded]} {
-+ gdb_test "thread apply all bt" ".*sleep.*start_thread.*" "$threadtype: attach1 to stopped bt"
-+ } else {
-+ gdb_test "bt" ".*sleep.*main.*" "$threadtype: attach1 to stopped bt"
-+ }
-+
-+ # Exit and detach the process.
-+
-+ gdb_exit
-+
-+ # Avoid some race:
-+ sleep 2
-+
-+ if [catch {open /proc/${testpid}/status r} fileid] {
-+ set line2 "NOTFOUND"
-+ } else {
-+ gets $fileid line1;
-+ gets $fileid line2;
-+ close $fileid;
-+ }
-+
-+ set test "$threadtype: attach1, exit leaves process stopped"
-+ if {[string match "*(stopped)*" $line2]} {
-+ pass $test
-+ } else {
-+ fail $test
-+ }
-+
-+ # At this point, the process should still be stopped
-+
-+ gdb_start
-+ gdb_reinitialize_dir $srcdir/$subdir
-+ gdb_load ${binfile}
-+
-+ # Verify that we can attach to the process just by giving the
-+ # process ID.
-
- set test "$threadtype: attach2 to stopped, after setting file"
- gdb_test_multiple "attach $testpid" "$test" {
diff --git a/insight-7.12-gdb-archer-pie-addons-keep-disabled.patch b/insight-7.12-gdb-archer-pie-addons-keep-disabled.patch
deleted file mode 100644
index 371711b..0000000
--- a/insight-7.12-gdb-archer-pie-addons-keep-disabled.patch
+++ /dev/null
@@ -1,80 +0,0 @@
-diff -Naurp insight-7.12.50.20170416.orig/gdb/breakpoint.c insight-7.12.50.20170416.new/gdb/breakpoint.c
---- insight-7.12.50.20170416.orig/gdb/breakpoint.c 2017-04-15 01:21:12.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/breakpoint.c 2017-04-16 14:14:26.217661774 +0100
-@@ -16086,6 +16086,50 @@ initialize_breakpoint_ops (void)
- static struct cmd_list_element *enablebreaklist = NULL;
-
- void
-+breakpoints_relocate (struct objfile *objfile, struct section_offsets *delta)
-+{
-+ struct bp_location *bl, **blp_tmp;
-+ int changed = 0;
-+
-+ gdb_assert (objfile->separate_debug_objfile_backlink == NULL);
-+
-+ ALL_BP_LOCATIONS (bl, blp_tmp)
-+ {
-+ struct obj_section *osect;
-+
-+ /* BL->SECTION can be correctly NULL for breakpoints with multiple
-+ locations expanded through symtab. */
-+
-+ ALL_OBJFILE_OSECTIONS (objfile, osect)
-+ {
-+ CORE_ADDR relocated_address;
-+ CORE_ADDR delta_offset;
-+
-+ delta_offset = ANOFFSET (delta, osect->the_bfd_section->index);
-+ if (delta_offset == 0)
-+ continue;
-+ relocated_address = bl->address + delta_offset;
-+
-+ if (obj_section_addr (osect) <= relocated_address
-+ && relocated_address < obj_section_endaddr (osect))
-+ {
-+ if (bl->inserted)
-+ remove_breakpoint (bl);
-+
-+ bl->address += delta_offset;
-+ bl->requested_address += delta_offset;
-+
-+ changed = 1;
-+ }
-+ }
-+ }
-+
-+ if (changed)
-+ qsort (bp_locations, bp_locations_count, sizeof (*bp_locations),
-+ bp_locations_compare);
-+}
-+
-+void
- _initialize_breakpoint (void)
- {
- struct cmd_list_element *c;
-diff -Naurp insight-7.12.50.20170416.orig/gdb/breakpoint.h insight-7.12.50.20170416.new/gdb/breakpoint.h
---- insight-7.12.50.20170416.orig/gdb/breakpoint.h 2017-04-15 01:21:12.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/breakpoint.h 2017-04-16 14:02:21.816405874 +0100
-@@ -1646,4 +1646,7 @@ extern const char *ep_parse_optional_if_
- UIOUT iff debugging multiple threads. */
- extern void maybe_print_thread_hit_breakpoint (struct ui_out *uiout);
-
-+extern void breakpoints_relocate (struct objfile *objfile,
-+ struct section_offsets *delta);
-+
- #endif /* !defined (BREAKPOINT_H) */
-diff -Naurp insight-7.12.50.20170416.orig/gdb/objfiles.c insight-7.12.50.20170416.new/gdb/objfiles.c
---- insight-7.12.50.20170416.orig/gdb/objfiles.c 2017-04-09 01:11:01.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/objfiles.c 2017-04-16 14:02:21.817405883 +0100
-@@ -909,6 +909,11 @@ objfile_relocate1 (struct objfile *objfi
- obj_section_addr (s));
- }
-
-+ /* Final call of breakpoint_re_set can keep breakpoint locations disabled if
-+ their addresses match. */
-+ if (objfile->separate_debug_objfile_backlink == NULL)
-+ breakpoints_relocate (objfile, delta);
-+
- /* Data changed. */
- return 1;
- }
diff --git a/insight-7.12-gdb-archer.patch b/insight-7.12-gdb-archer.patch
deleted file mode 100644
index 4b4c57e..0000000
--- a/insight-7.12-gdb-archer.patch
+++ /dev/null
@@ -1,663 +0,0 @@
-diff -Naurp insight-7.12.50.20170416.orig/gdb/data-directory/Makefile.in insight-7.12.50.20170416.new/gdb/data-directory/Makefile.in
---- insight-7.12.50.20170416.orig/gdb/data-directory/Makefile.in 2017-01-03 17:36:55.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/data-directory/Makefile.in 2017-04-16 12:26:17.155076938 +0100
-@@ -77,7 +77,11 @@ PYTHON_FILE_LIST = \
- gdb/types.py \
- gdb/unwinder.py \
- gdb/xmethod.py \
-+ gdb/types.py \
- gdb/command/__init__.py \
-+ gdb/command/ignore_errors.py \
-+ gdb/command/pahole.py \
-+ gdb/command/xmethods.py \
- gdb/command/explore.py \
- gdb/command/frame_filters.py \
- gdb/command/pretty_printers.py \
-@@ -89,6 +93,8 @@ PYTHON_FILE_LIST = \
- gdb/function/as_string.py \
- gdb/function/caller_is.py \
- gdb/function/strfns.py \
-+ gdb/function/caller_is.py \
-+ gdb/function/in_scope.py \
- gdb/printer/__init__.py \
- gdb/printer/bound_registers.py
-
-diff -Naurp insight-7.12.50.20170416.orig/gdb/doc/gdb.texinfo insight-7.12.50.20170416.new/gdb/doc/gdb.texinfo
---- insight-7.12.50.20170416.orig/gdb/doc/gdb.texinfo 2017-04-16 12:25:21.689560997 +0100
-+++ insight-7.12.50.20170416.new/gdb/doc/gdb.texinfo 2017-04-16 12:26:17.163077013 +0100
-@@ -1236,6 +1236,16 @@ for remote debugging.
- Run using @var{device} for your program's standard input and output.
- @c FIXME: kingdon thinks there is more to -tty. Investigate.
-
-+@item -P
-+@cindex @code{-P}
-+@itemx --python
-+@cindex @code{--python}
-+Change interpretation of command line so that the argument immediately
-+following this switch is taken to be the name of a Python script file.
-+This option stops option processing; subsequent options are passed to
-+Python as @code{sys.argv}. This option is only available if Python
-+scripting support was enabled when @value{GDBN} was configured.
-+
- @c resolve the situation of these eventually
- @item -tui
- @cindex @code{--tui}
-diff -Naurp insight-7.12.50.20170416.orig/gdb/doc/python.texi insight-7.12.50.20170416.new/gdb/doc/python.texi
---- insight-7.12.50.20170416.orig/gdb/doc/python.texi 2017-03-25 10:42:37.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/doc/python.texi 2017-04-16 12:26:17.164077022 +0100
-@@ -88,8 +88,6 @@ containing @code{end}. For example:
-
- @smallexample
- (@value{GDBP}) python
--Type python script
--End with a line saying just "end".
- >print 23
- >end
- 23
-diff -Naurp insight-7.12.50.20170416.orig/gdb/gdb-gdb.gdb.in insight-7.12.50.20170416.new/gdb/gdb-gdb.gdb.in
---- insight-7.12.50.20170416.orig/gdb/gdb-gdb.gdb.in 2015-08-15 00:31:38.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/gdb-gdb.gdb.in 2017-04-16 12:26:17.164077022 +0100
-@@ -1,5 +1,15 @@
- echo Setting up the environment for debugging gdb.\n
-
-+# Set up the Python library and "require" command.
-+python
-+from os.path import abspath
-+gdb.datadir = abspath ('@srcdir@/python/lib')
-+gdb.pythonlibdir = gdb.datadir
-+gdb.__path__ = [gdb.datadir + '/gdb']
-+sys.path.insert(0, gdb.datadir)
-+end
-+source @srcdir(a)/python/lib/gdb/__init__.py
-+
- if !$gdb_init_done
- set variable $gdb_init_done = 1
-
-diff -Naurp insight-7.12.50.20170416.orig/gdb/main.c insight-7.12.50.20170416.new/gdb/main.c
---- insight-7.12.50.20170416.orig/gdb/main.c 2017-04-16 12:25:21.792561955 +0100
-+++ insight-7.12.50.20170416.new/gdb/main.c 2017-04-16 12:26:17.165077031 +0100
-@@ -33,6 +33,7 @@
-
- #include "interps.h"
- #include "main.h"
-+#include "python/python.h"
- #include "source.h"
- #include "cli/cli-cmds.h"
- #include "objfiles.h"
-@@ -490,7 +491,7 @@ exec_or_core_file_attach (const char *fi
- }
-
- static void
--captured_main_1 (struct captured_main_args *context)
-+captured_main_1 (struct captured_main_args *context, int &python_script)
- {
- int argc = context->argc;
- char **argv = context->argv;
-@@ -708,10 +709,14 @@ captured_main_1 (struct captured_main_ar
- {"args", no_argument, &set_args, 1},
- {"l", required_argument, 0, 'l'},
- {"return-child-result", no_argument, &return_child_result, 1},
-+#if HAVE_PYTHON
-+ {"python", no_argument, 0, 'P'},
-+ {"P", no_argument, 0, 'P'},
-+#endif
- {0, no_argument, 0, 0}
- };
-
-- while (1)
-+ while (!python_script)
- {
- int option_index;
-
-@@ -729,6 +734,9 @@ captured_main_1 (struct captured_main_ar
- case 0:
- /* Long option that just sets a flag. */
- break;
-+ case 'P':
-+ python_script = 1;
-+ break;
- case OPT_SE:
- symarg = optarg;
- execarg = optarg;
-@@ -887,7 +895,31 @@ captured_main_1 (struct captured_main_ar
-
- /* Now that gdb_init has created the initial inferior, we're in
- position to set args for that inferior. */
-- if (set_args)
-+ if (python_script)
-+ {
-+ /* The first argument is a python script to evaluate, and
-+ subsequent arguments are passed to the script for
-+ processing there. */
-+ if (optind >= argc)
-+ {
-+ fprintf_unfiltered (gdb_stderr,
-+ _("%s: Python script file name required\n"),
-+ argv[0]);
-+ exit (1);
-+ }
-+
-+ /* FIXME: should handle inferior I/O intelligently here.
-+ E.g., should be possible to run gdb in pipeline and have
-+ Python (and gdb) output go to stderr or file; and if a
-+ prompt is needed, open the tty. */
-+ quiet = 1;
-+ /* FIXME: should read .gdbinit if, and only if, a prompt is
-+ requested by the script. Though... maybe this is not
-+ ideal? */
-+ /* FIXME: likewise, reading in history. */
-+ inhibit_gdbinit = 1;
-+ }
-+ else if (set_args)
- {
- /* The remaining options are the command-line options for the
- inferior. The first one is the sym/exec file, and the rest
-@@ -1173,7 +1205,8 @@ captured_main_1 (struct captured_main_ar
-
- /* Read in the old history after all the command files have been
- read. */
-- init_history ();
-+ if (!python_script)
-+ init_history ();
-
- if (batch_flag)
- {
-@@ -1186,16 +1219,29 @@ static void
- captured_main (void *data)
- {
- struct captured_main_args *context = (struct captured_main_args *) data;
-+ int python_script = 0;
-
-- captured_main_1 (context);
-+ captured_main_1 (context, python_script);
-
-- /* NOTE: cagney/1999-11-07: There is probably no reason for not
-- moving this loop and the code found in captured_command_loop()
-- into the command_loop() proper. The main thing holding back that
-- change - SET_TOP_LEVEL() - has been eliminated. */
-- while (1)
-+#if HAVE_PYTHON
-+ if (python_script)
- {
-- catch_errors (captured_command_loop, 0, "", RETURN_MASK_ALL);
-+ extern int pagination_enabled;
-+ pagination_enabled = 0;
-+ run_python_script (context->argc - optind, &context->argv[optind]);
-+ return;
-+ }
-+ else
-+#endif
-+ {
-+ /* NOTE: cagney/1999-11-07: There is probably no reason for not
-+ moving this loop and the code found in captured_command_loop()
-+ into the command_loop() proper. The main thing holding back that
-+ change - SET_TOP_LEVEL() - has been eliminated. */
-+ while (1)
-+ {
-+ catch_errors (captured_command_loop, 0, "", RETURN_MASK_ALL);
-+ }
- }
- /* No exit -- exit is through quit_command. */
- }
-@@ -1238,6 +1284,12 @@ print_gdb_help (struct ui_file *stream)
- fputs_unfiltered (_("\
- This is the GNU debugger. Usage:\n\n\
- gdb [options] [executable-file [core-file or process-id]]\n\
-+ gdb [options] --args executable-file [inferior-arguments ...]\n"), stream);
-+#if HAVE_PYTHON
-+ fputs_unfiltered (_("\
-+ gdb [options] [--python|-P] script-file [script-arguments ...]\n"), stream);
-+#endif
-+ fputs_unfiltered (_("\n\
- gdb [options] --args executable-file [inferior-arguments ...]\n\n\
- "), stream);
- fputs_unfiltered (_("\
-@@ -1283,6 +1335,13 @@ Output and user interface control:\n\n\
- #endif
- fputs_unfiltered (_("\
- --dbx DBX compatibility mode.\n\
-+"), stream);
-+#if HAVE_PYTHON
-+ fputs_unfiltered (_("\
-+ --python, -P Following argument is Python script file; remaining\n\
-+ arguments are passed to script.\n"), stream);
-+#endif
-+ fputs_unfiltered (_("\
- -q, --quiet, --silent\n\
- Do not print version number on startup.\n\n\
- "), stream);
-diff -Naurp insight-7.12.50.20170416.orig/gdb/Makefile.in insight-7.12.50.20170416.new/gdb/Makefile.in
---- insight-7.12.50.20170416.orig/gdb/Makefile.in 2017-04-16 12:25:21.544559648 +0100
-+++ insight-7.12.50.20170416.new/gdb/Makefile.in 2017-04-16 12:26:17.155076938 +0100
-@@ -2379,6 +2379,12 @@ stamp-h: $(srcdir)/config.in config.stat
- CONFIG_LINKS= \
- $(SHELL) config.status
-
-+.gdbinit: $(srcdir)/gdbinit.in config.status
-+ CONFIG_FILES=".gdbinit:gdbinit.in" \
-+ CONFIG_COMMANDS= \
-+ CONFIG_HEADERS= \
-+ $(SHELL) config.status
-+
- config.status: $(srcdir)/configure configure.tgt configure.host ../bfd/development.sh
- $(SHELL) config.status --recheck
-
-diff -Naurp insight-7.12.50.20170416.orig/gdb/python/lib/gdb/command/ignore_errors.py insight-7.12.50.20170416.new/gdb/python/lib/gdb/command/ignore_errors.py
---- insight-7.12.50.20170416.orig/gdb/python/lib/gdb/command/ignore_errors.py 1970-01-01 01:00:00.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/python/lib/gdb/command/ignore_errors.py 2017-04-16 12:26:17.165077031 +0100
-@@ -0,0 +1,37 @@
-+# Ignore errors in user commands.
-+
-+# Copyright (C) 2008 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/>.
-+
-+import gdb
-+
-+class IgnoreErrorsCommand (gdb.Command):
-+ """Execute a single command, ignoring all errors.
-+Only one-line commands are supported.
-+This is primarily useful in scripts."""
-+
-+ def __init__ (self):
-+ super (IgnoreErrorsCommand, self).__init__ ("ignore-errors",
-+ gdb.COMMAND_OBSCURE,
-+ # FIXME...
-+ gdb.COMPLETE_COMMAND)
-+
-+ def invoke (self, arg, from_tty):
-+ try:
-+ gdb.execute (arg, from_tty)
-+ except:
-+ pass
-+
-+IgnoreErrorsCommand ()
-diff -Naurp insight-7.12.50.20170416.orig/gdb/python/lib/gdb/command/pahole.py insight-7.12.50.20170416.new/gdb/python/lib/gdb/command/pahole.py
---- insight-7.12.50.20170416.orig/gdb/python/lib/gdb/command/pahole.py 1970-01-01 01:00:00.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/python/lib/gdb/command/pahole.py 2017-04-16 12:26:17.165077031 +0100
-@@ -0,0 +1,81 @@
-+# pahole command for gdb
-+
-+# Copyright (C) 2008, 2009, 2012 Free Software Foundation, Inc.
-+
-+# This program is free software; you can redistribute it and/or modify
-+# it under the terms of the GNU General Public License as published by
-+# the Free Software Foundation; either version 3 of the License, or
-+# (at your option) any later version.
-+#
-+# This program is distributed in the hope that it will be useful,
-+# but WITHOUT ANY WARRANTY; without even the implied warranty of
-+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+# GNU General Public License for more details.
-+#
-+# You should have received a copy of the GNU General Public License
-+# along with this program. If not, see <http://www.gnu.org/licenses/>.
-+
-+import gdb
-+
-+class Pahole (gdb.Command):
-+ """Show the holes in a structure.
-+This command takes a single argument, a type name.
-+It prints the type and displays comments showing where holes are."""
-+
-+ def __init__ (self):
-+ super (Pahole, self).__init__ ("pahole", gdb.COMMAND_NONE,
-+ gdb.COMPLETE_SYMBOL)
-+
-+ def maybe_print_hole(self, bitpos, field_bitpos):
-+ if bitpos != field_bitpos:
-+ hole = field_bitpos - bitpos
-+ print (' /* XXX %d bit hole, try to pack */' % hole)
-+
-+ def pahole (self, type, level, name):
-+ if name is None:
-+ name = ''
-+ tag = type.tag
-+ if tag is None:
-+ tag = ''
-+ print ('%sstruct %s {' % (' ' * (2 * level), tag))
-+ bitpos = 0
-+ for field in type.fields ():
-+ # Skip static fields.
-+ if not hasattr (field, ('bitpos')):
-+ continue
-+
-+ ftype = field.type.strip_typedefs()
-+
-+ self.maybe_print_hole(bitpos, field.bitpos)
-+ bitpos = field.bitpos
-+ if field.bitsize > 0:
-+ fieldsize = field.bitsize
-+ else:
-+ # TARGET_CHAR_BIT here...
-+ fieldsize = 8 * ftype.sizeof
-+
-+ # TARGET_CHAR_BIT
-+ print (' /* %3d %3d */' % (int (bitpos / 8), int (fieldsize / 8)), end = "")
-+ bitpos = bitpos + fieldsize
-+
-+ if ftype.code == gdb.TYPE_CODE_STRUCT:
-+ self.pahole (ftype, level + 1, field.name)
-+ else:
-+ print (' ' * (2 + 2 * level), end = "")
-+ print ('%s %s' % (str (ftype), field.name))
-+
-+ if level == 0:
-+ self.maybe_print_hole(bitpos, 8 * type.sizeof)
-+
-+ print (' ' * (14 + 2 * level), end = "")
-+ print ('} %s' % name)
-+
-+ def invoke (self, arg, from_tty):
-+ type = gdb.lookup_type (arg)
-+ type = type.strip_typedefs ()
-+ if type.code != gdb.TYPE_CODE_STRUCT:
-+ raise (TypeError, '%s is not a struct type' % arg)
-+ print (' ' * 14, end = "")
-+ self.pahole (type, 0, '')
-+
-+Pahole()
-diff -Naurp insight-7.12.50.20170416.orig/gdb/python/lib/gdb/function/in_scope.py insight-7.12.50.20170416.new/gdb/python/lib/gdb/function/in_scope.py
---- insight-7.12.50.20170416.orig/gdb/python/lib/gdb/function/in_scope.py 1970-01-01 01:00:00.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/python/lib/gdb/function/in_scope.py 2017-04-16 12:26:17.165077031 +0100
-@@ -0,0 +1,47 @@
-+# In-scope function.
-+
-+# Copyright (C) 2008 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/>.
-+
-+import gdb
-+
-+class InScope (gdb.Function):
-+ """Return True if all the given variables or macros are in scope.
-+Takes one argument for each variable name to be checked."""
-+
-+ def __init__ (self):
-+ super (InScope, self).__init__ ("in_scope")
-+
-+ def invoke (self, *vars):
-+ if len (vars) == 0:
-+ raise (TypeError, "in_scope takes at least one argument")
-+
-+ # gdb.Value isn't hashable so it can't be put in a map.
-+ # Convert to string first.
-+ wanted = set (map (lambda x: x.string (), vars))
-+ found = set ()
-+ block = gdb.selected_frame ().block ()
-+ while block:
-+ for sym in block:
-+ if (sym.is_argument or sym.is_constant
-+ or sym.is_function or sym.is_variable):
-+ if sym.name in wanted:
-+ found.add (sym.name)
-+
-+ block = block.superblock
-+
-+ return wanted == found
-+
-+InScope ()
-diff -Naurp insight-7.12.50.20170416.orig/gdb/python/python.c insight-7.12.50.20170416.new/gdb/python/python.c
---- insight-7.12.50.20170416.orig/gdb/python/python.c 2017-04-16 10:13:09.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/python/python.c 2017-04-16 12:26:17.166077041 +0100
-@@ -95,6 +95,8 @@ const struct extension_language_defn ext
- #include "linespec.h"
- #include "source.h"
- #include "version.h"
-+#include "inferior.h"
-+#include "gdbthread.h"
- #include "target.h"
- #include "gdbthread.h"
- #include "interps.h"
-@@ -242,6 +244,29 @@ gdbpy_enter::~gdbpy_enter ()
- restore_active_ext_lang (m_previous_active);
- }
-
-+static void
-+restore_python_env (void *p)
-+{
-+ gdbpy_enter *env = (gdbpy_enter *) p;
-+
-+ delete env;
-+}
-+
-+/* Called before entering the Python interpreter to install the
-+ current language and architecture to be used for Python values.
-+ Also set the active extension language for GDB so that SIGINT's
-+ are directed our way, and if necessary install the right SIGINT
-+ handler. */
-+
-+struct cleanup *
-+ensure_python_env (struct gdbarch *gdbarch,
-+ const struct language_defn *language)
-+{
-+ gdbpy_enter *env = new gdbpy_enter (gdbarch, language);
-+
-+ return make_cleanup (restore_python_env, env);
-+}
-+
- /* Set the quit flag. */
-
- static void
-@@ -1187,6 +1212,92 @@ gdbpy_print_stack (void)
-
- /* Return the current Progspace.
- There always is one. */
-+/* True if 'gdb -P' was used, false otherwise. */
-+static int running_python_script;
-+
-+/* True if we are currently in a call to 'gdb.cli', false otherwise. */
-+static int in_cli;
-+
-+/* Enter the command loop. */
-+
-+static PyObject *
-+gdbpy_cli (PyObject *unused1, PyObject *unused2)
-+{
-+ if (! running_python_script || in_cli)
-+ return PyErr_Format (PyExc_RuntimeError, "cannot invoke CLI recursively");
-+
-+ if (current_uiout->is_mi_like_p ())
-+ return PyErr_Format (PyExc_RuntimeError, _("Cannot invoke CLI from MI."));
-+
-+ in_cli = 1;
-+ /* See captured_command_loop. */
-+
-+ /* Give the interpreter a chance to print a prompt. */
-+ interp_pre_command_loop (top_level_interpreter ());
-+
-+ /* Now it's time to start the event loop. */
-+ start_event_loop ();
-+
-+ in_cli = 0;
-+
-+ Py_RETURN_NONE;
-+}
-+
-+/* Set up the Python argument vector and evaluate a script. This is
-+ used to implement 'gdb -P'. */
-+
-+void
-+run_python_script (int argc, char **argv)
-+{
-+ FILE *input;
-+
-+ /* We never free this, since we plan to exit at the end. */
-+ ensure_python_env (get_current_arch (), current_language);
-+
-+ running_python_script = 1;
-+
-+#if PYTHON_ABI_VERSION < 3
-+ PySys_SetArgv (argc - 1, argv + 1);
-+#else
-+ {
-+ wchar_t **wargv = (wchar_t **) alloca (sizeof (*wargv) * (argc + 1));
-+ int i;
-+
-+ for (i = 1; i < argc; i++)
-+ {
-+ size_t len = mbstowcs (NULL, argv[i], 0);
-+ /* Python-related GDB sources are built with -DNDEBUG
-+ https://sourceware.org/bugzilla/show_bug.cgi?id=20445 */
-+ size_t len2 ATTRIBUTE_UNUSED;
-+
-+ if (len == (size_t) -1)
-+ {
-+ fprintf (stderr, "Invalid multibyte argument #%d \"%s\"\n",
-+ i, argv[i]);
-+ exit (1);
-+ }
-+ wargv[i] = (wchar_t *) alloca (sizeof (**wargv) * (len + 1));
-+ len2 = mbstowcs (wargv[i], argv[i], len + 1);
-+ assert (len2 == len);
-+ }
-+ wargv[argc] = NULL;
-+ PySys_SetArgv (argc - 1, wargv + 1);
-+ }
-+#endif
-+
-+ input = fopen (argv[0], "r");
-+ if (! input)
-+ {
-+ fprintf (stderr, "could not open %s: %s\n", argv[0], strerror (errno));
-+ exit (1);
-+ }
-+ PyRun_SimpleFile (input, argv[0]);
-+ fclose (input);
-+ exit (0);
-+}
-+
-+
-+
-
- static PyObject *
- gdbpy_get_current_progspace (PyObject *unused1, PyObject *unused2)
-@@ -1881,6 +1992,8 @@ PyMethodDef python_GdbMethods[] =
- Evaluate command, a string, as a gdb CLI command. Optionally returns\n\
- a Python String containing the output of the command if to_string is\n\
- set to True." },
-+ { "cli", gdbpy_cli, METH_NOARGS,
-+ "Enter the gdb CLI" },
- { "parameter", gdbpy_parameter, METH_VARARGS,
- "Return a gdb parameter's value" },
-
-diff -Naurp insight-7.12.50.20170416.orig/gdb/python/python.h insight-7.12.50.20170416.new/gdb/python/python.h
---- insight-7.12.50.20170416.orig/gdb/python/python.h 2017-01-03 17:36:55.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/python/python.h 2017-04-16 12:26:17.166077041 +0100
-@@ -25,4 +25,6 @@
- /* This is all that python exports to gdb. */
- extern const struct extension_language_defn extension_language_python;
-
-+extern void run_python_script (int argc, char **argv);
-+
- #endif /* GDB_PYTHON_H */
-diff -Naurp insight-7.12.50.20170416.orig/gdb/python/python-internal.h insight-7.12.50.20170416.new/gdb/python/python-internal.h
---- insight-7.12.50.20170416.orig/gdb/python/python-internal.h 2017-04-09 01:11:01.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/python/python-internal.h 2017-04-16 12:26:17.166077041 +0100
-@@ -672,6 +672,9 @@ class gdbpy_enter_varobj : public gdbpy_
-
- };
-
-+struct cleanup *ensure_python_env (struct gdbarch *gdbarch,
-+ const struct language_defn *language);
-+
- extern struct gdbarch *python_gdbarch;
- extern const struct language_defn *python_language;
-
-diff -Naurp insight-7.12.50.20170416.orig/gdb/testsuite/gdb.python/py-frame.exp insight-7.12.50.20170416.new/gdb/testsuite/gdb.python/py-frame.exp
---- insight-7.12.50.20170416.orig/gdb/testsuite/gdb.python/py-frame.exp 2017-01-03 17:36:55.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/testsuite/gdb.python/py-frame.exp 2017-04-16 12:26:17.166077041 +0100
-@@ -95,6 +95,8 @@ gdb_test "python print ('result = %s' %
-
- gdb_test "python print ('result = %s' % (gdb.selected_frame () == f1))" " = True" "test gdb.selected_frame"
-
-+gdb_test "python print ('result = %s' % (f0.block ()))" "<gdb.Block object at 0x\[\[:xdigit:\]\]+>" "test Frame.block"
-+
- # Can read SP register.
- gdb_test "python print ('result = %s' % (gdb.selected_frame ().read_register ('sp') == gdb.parse_and_eval ('\$sp')))" \
- " = True" \
-diff -Naurp insight-7.12.50.20170416.orig/gdb/testsuite/gdb.python/py-value.exp insight-7.12.50.20170416.new/gdb/testsuite/gdb.python/py-value.exp
---- insight-7.12.50.20170416.orig/gdb/testsuite/gdb.python/py-value.exp 2017-03-18 01:22:31.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/testsuite/gdb.python/py-value.exp 2017-04-16 12:26:17.166077041 +0100
-@@ -384,6 +384,15 @@ proc test_value_after_death {} {
- "print value's type"
- }
-
-+# Regression test for a cast failure. The bug was that if we cast a
-+# value to its own type, gdb could crash. This happened because we
-+# could end up double-freeing a struct value.
-+proc test_cast_regression {} {
-+ gdb_test "python v = gdb.Value(5)" "" "create value for cast test"
-+ gdb_test "python v = v.cast(v.type)" "" "cast value for cast test"
-+ gdb_test "python print(v)" "5" "print value for cast test"
-+}
-+
- # Regression test for invalid subscript operations. The bug was that
- # the type of the value was not being checked before allowing a
- # subscript operation to proceed.
-@@ -512,6 +521,7 @@ if ![runto_main] then {
- test_value_in_inferior
- test_inferior_function_call
- test_value_after_death
-+test_cast_regression
-
- # Test either C or C++ values.
-
-diff -Naurp insight-7.12.50.20170416.orig/gdb/varobj.c insight-7.12.50.20170416.new/gdb/varobj.c
---- insight-7.12.50.20170416.orig/gdb/varobj.c 2017-04-09 01:11:01.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/varobj.c 2017-04-16 12:26:17.167077050 +0100
-@@ -226,6 +226,14 @@ is_root_p (const struct varobj *var)
- }
-
- #ifdef HAVE_PYTHON
-+/* Helper function to install a Python environment suitable for
-+ use during operations on VAR. */
-+struct cleanup *
-+varobj_ensure_python_env (const struct varobj *var)
-+{
-+ return ensure_python_env (var->root->exp->gdbarch,
-+ var->root->exp->language_defn);
-+}
-
- /* See python-internal.h. */
- gdbpy_enter_varobj::gdbpy_enter_varobj (const struct varobj *var)
-diff -Naurp insight-7.12.50.20170416.orig/gdb/varobj.h insight-7.12.50.20170416.new/gdb/varobj.h
---- insight-7.12.50.20170416.orig/gdb/varobj.h 2017-04-09 01:11:01.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/varobj.h 2017-04-16 12:26:17.167077050 +0100
-@@ -320,6 +320,8 @@ extern int varobj_has_more (const struct
-
- extern int varobj_is_dynamic_p (const struct varobj *var);
-
-+extern struct cleanup *varobj_ensure_python_env (const struct varobj *var);
-+
- extern int varobj_default_value_is_changeable_p (const struct varobj *var);
- extern int varobj_value_is_changeable_p (const struct varobj *var);
-
-diff -Naurp insight-7.12.50.20170416.orig/README.archer insight-7.12.50.20170416.new/README.archer
---- insight-7.12.50.20170416.orig/README.archer 1970-01-01 01:00:00.000000000 +0100
-+++ insight-7.12.50.20170416.new/README.archer 2017-04-16 12:26:17.154076929 +0100
-@@ -0,0 +1,2 @@
-+This branch originally held the Python code for gdb. It still exists
-+because a small amount of code here has not yet been merged upstream.
diff --git a/insight-7.12-gdb-fedora-libncursesw.patch b/insight-7.12-gdb-fedora-libncursesw.patch
deleted file mode 100644
index 5e7aa46..0000000
--- a/insight-7.12-gdb-fedora-libncursesw.patch
+++ /dev/null
@@ -1,60 +0,0 @@
-diff -Naurp insight-7.12.50.20170416.orig/gdb/configure insight-7.12.50.20170416.new/gdb/configure
---- insight-7.12.50.20170416.orig/gdb/configure 2017-04-16 13:35:12.113725974 +0100
-+++ insight-7.12.50.20170416.new/gdb/configure 2017-04-16 13:36:16.306314191 +0100
-@@ -9359,6 +9359,7 @@ if test x"$prefer_curses" = xyes; then
- # search /usr/local/include, if ncurses is installed in /usr/local. A
- # default installation of ncurses on alpha*-dec-osf* will lead to such
- # a situation.
-+ # Fedora: Force libncursesw over libncurses to match the includes.
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing waddstr" >&5
- $as_echo_n "checking for library containing waddstr... " >&6; }
- if ${ac_cv_search_waddstr+:} false; then :
-@@ -9383,7 +9384,7 @@ return waddstr ();
- return 0;
- }
- _ACEOF
--for ac_lib in '' ncurses cursesX curses; do
-+for ac_lib in '' ncursesw; do
- if test -z "$ac_lib"; then
- ac_res="none required"
- else
-@@ -9457,6 +9458,7 @@ case $host_os in
- esac
-
- # These are the libraries checked by Readline.
-+# Fedora: Force libncursesw over libncurses to match the includes.
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing tgetent" >&5
- $as_echo_n "checking for library containing tgetent... " >&6; }
- if ${ac_cv_search_tgetent+:} false; then :
-@@ -9481,7 +9483,7 @@ return tgetent ();
- return 0;
- }
- _ACEOF
--for ac_lib in '' termcap tinfo curses ncurses; do
-+for ac_lib in '' termcap tinfo ncursesw; do
- if test -z "$ac_lib"; then
- ac_res="none required"
- else
-diff -Naurp insight-7.12.50.20170416.orig/gdb/configure.ac insight-7.12.50.20170416.new/gdb/configure.ac
---- insight-7.12.50.20170416.orig/gdb/configure.ac 2017-04-16 13:35:12.113725974 +0100
-+++ insight-7.12.50.20170416.new/gdb/configure.ac 2017-04-16 13:36:16.307314200 +0100
-@@ -762,7 +762,8 @@ if test x"$prefer_curses" = xyes; then
- # search /usr/local/include, if ncurses is installed in /usr/local. A
- # default installation of ncurses on alpha*-dec-osf* will lead to such
- # a situation.
-- AC_SEARCH_LIBS(waddstr, [ncurses cursesX curses])
-+ # Fedora: Force libncursesw over libncurses to match the includes.
-+ AC_SEARCH_LIBS(waddstr, [ncursesw])
-
- if test "$ac_cv_search_waddstr" != no; then
- curses_found=yes
-@@ -804,7 +805,8 @@ case $host_os in
- esac
-
- # These are the libraries checked by Readline.
--AC_SEARCH_LIBS(tgetent, [termcap tinfo curses ncurses])
-+# Fedora: Force libncursesw over libncurses to match the includes.
-+AC_SEARCH_LIBS(tgetent, [termcap tinfo ncursesw])
-
- if test "$ac_cv_search_tgetent" = no; then
- CONFIG_OBS="$CONFIG_OBS stub-termcap.o"
diff --git a/insight-7.12-gdb-python-gil.patch b/insight-7.12-gdb-python-gil.patch
deleted file mode 100644
index 4c41efe..0000000
--- a/insight-7.12-gdb-python-gil.patch
+++ /dev/null
@@ -1,230 +0,0 @@
-diff -Naurp insight-7.12.50.20170416.orig/gdb/doc/python.texi insight-7.12.50.20170416.new/gdb/doc/python.texi
---- insight-7.12.50.20170416.orig/gdb/doc/python.texi 2017-04-16 13:26:46.610227059 +0100
-+++ insight-7.12.50.20170416.new/gdb/doc/python.texi 2017-04-16 13:27:34.573643843 +0100
-@@ -230,6 +230,14 @@ returned as a string. The default is @c
- return value is @code{None}. If @var{to_string} is @code{True}, the
- @value{GDBN} virtual terminal will be temporarily set to unlimited width
- and height, and its pagination will be disabled; @pxref{Screen Size}.
-+
-+The @var{release_gil} flag specifies whether @value{GDBN} ought to
-+release the Python GIL before executing the command. This is useful
-+in multi-threaded Python programs where by default the Python
-+interpreter will acquire the GIL and lock other threads from
-+executing. After the command has completed executing in @value{GDBN}
-+the Python GIL is reacquired. This flag must be a boolean value. If
-+omitted, it defaults to @code{False}.
- @end defun
-
- @findex gdb.breakpoints
-diff -Naurp insight-7.12.50.20170416.orig/gdb/python/python.c insight-7.12.50.20170416.new/gdb/python/python.c
---- insight-7.12.50.20170416.orig/gdb/python/python.c 2017-04-16 13:26:46.612227077 +0100
-+++ insight-7.12.50.20170416.new/gdb/python/python.c 2017-04-16 13:31:19.962602386 +0100
-@@ -594,12 +594,16 @@ execute_gdb_command (PyObject *self, PyO
- {
- const char *arg;
- PyObject *from_tty_obj = NULL, *to_string_obj = NULL;
-- int from_tty, to_string;
-- static const char *keywords[] = { "command", "from_tty", "to_string", NULL };
-+ int from_tty, to_string, release_gil;
-+ static const char *keywords[] = { "command", "from_tty", "to_string", "release_gil", NULL };
-+ PyObject *release_gil_obj = NULL;
-+ /* Initialize it just to avoid a GCC false warning. */
-+ PyThreadState *state = NULL;
-
-- if (!gdb_PyArg_ParseTupleAndKeywords (args, kw, "s|O!O!", keywords, &arg,
-+ if (!gdb_PyArg_ParseTupleAndKeywords (args, kw, "s|O!O!O!", keywords, &arg,
- &PyBool_Type, &from_tty_obj,
-- &PyBool_Type, &to_string_obj))
-+ &PyBool_Type, &to_string_obj,
-+ &PyBool_Type, &release_gil_obj))
- return NULL;
-
- from_tty = 0;
-@@ -620,6 +624,15 @@ execute_gdb_command (PyObject *self, PyO
- to_string = cmp;
- }
-
-+ release_gil = 0;
-+ if (release_gil_obj)
-+ {
-+ int cmp = PyObject_IsTrue (release_gil_obj);
-+ if (cmp < 0)
-+ return NULL;
-+ release_gil = cmp;
-+ }
-+
- std::string to_string_res;
-
- TRY
-@@ -628,6 +641,13 @@ execute_gdb_command (PyObject *self, PyO
- std::string copy (arg);
- struct interp *interp;
-
-+ /* In the case of long running GDB commands, allow the user to
-+ release the Python GIL acquired by Python. Restore the GIL
-+ after the command has completed before handing back to
-+ Python. */
-+ if (release_gil)
-+ state = PyEval_SaveThread();
-+
- scoped_restore save_async = make_scoped_restore (¤t_ui->async, 0);
-
- scoped_restore save_uiout = make_scoped_restore (¤t_uiout);
-@@ -642,10 +662,22 @@ execute_gdb_command (PyObject *self, PyO
- to_string_res = execute_command_to_string (©[0], from_tty);
- else
- execute_command (©[0], from_tty);
-+
-+ /* Reacquire the GIL if it was released earlier. */
-+ if (release_gil)
-+ PyEval_RestoreThread (state);
- }
- CATCH (except, RETURN_MASK_ALL)
- {
-- GDB_PY_HANDLE_EXCEPTION (except);
-+ if (except.reason < 0)
-+ {
-+ /* Reacquire the GIL if it was released earlier. */
-+ if (release_gil)
-+ PyEval_RestoreThread (state);
-+
-+ gdbpy_convert_exception (except);
-+ return NULL;
-+ }
- }
- END_CATCH
-
-diff -Naurp insight-7.12.50.20170416.orig/gdb/python/python-internal.h insight-7.12.50.20170416.new/gdb/python/python-internal.h
---- insight-7.12.50.20170416.orig/gdb/python/python-internal.h 2017-04-16 13:26:46.612227077 +0100
-+++ insight-7.12.50.20170416.new/gdb/python/python-internal.h 2017-04-16 13:27:34.573643843 +0100
-@@ -142,6 +142,8 @@ typedef int Py_ssize_t;
- #define PyGILState_Release(ARG) ((void)(ARG))
- #define PyEval_InitThreads()
- #define PyThreadState_Swap(ARG) ((void)(ARG))
-+#define PyEval_SaveThread() ((void)(ARG))
-+#define PyEval_RestoreThread(ARG) ((void)(ARG))
- #define PyEval_ReleaseLock()
- #endif
-
-diff -Naurp insight-7.12.50.20170416.orig/gdb/testsuite/gdb.python/py-gil-mthread.c insight-7.12.50.20170416.new/gdb/testsuite/gdb.python/py-gil-mthread.c
---- insight-7.12.50.20170416.orig/gdb/testsuite/gdb.python/py-gil-mthread.c 1970-01-01 01:00:00.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/testsuite/gdb.python/py-gil-mthread.c 2017-04-16 13:27:34.574643851 +0100
-@@ -0,0 +1,13 @@
-+#include <stdio.h>
-+#include <unistd.h>
-+
-+int
-+main (void)
-+{
-+ int i;
-+ for (i = 0; i < 10; i++)
-+ {
-+ sleep (1); /* break-here */
-+ printf ("Sleeping %d\n", i);
-+ }
-+}
-diff -Naurp insight-7.12.50.20170416.orig/gdb/testsuite/gdb.python/py-gil-mthread.exp insight-7.12.50.20170416.new/gdb/testsuite/gdb.python/py-gil-mthread.exp
---- insight-7.12.50.20170416.orig/gdb/testsuite/gdb.python/py-gil-mthread.exp 1970-01-01 01:00:00.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/testsuite/gdb.python/py-gil-mthread.exp 2017-04-16 13:27:34.574643851 +0100
-@@ -0,0 +1,69 @@
-+# Copyright (C) 2014 Free Software Foundation, Inc.
-+
-+# This program is free software; you can redistribute it and/or modify
-+# it under the terms of the GNU General Public License as published by
-+# the Free Software Foundation; either version 3 of the License, or
-+# (at your option) any later version.
-+#
-+# This program is distributed in the hope that it will be useful,
-+# but WITHOUT ANY WARRANTY; without even the implied warranty of
-+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+# GNU General Public License for more details.
-+#
-+# You should have received a copy of the GNU General Public License
-+# along with this program. If not, see <http://www.gnu.org/licenses/>.
-+
-+standard_testfile .c .py
-+set executable $testfile
-+
-+if { [prepare_for_testing $testfile.exp $executable $srcfile] } {
-+ return -1
-+}
-+
-+# Skip all tests if Python scripting is not enabled.
-+if { [skip_python_tests] } { continue }
-+
-+if ![runto_main] {
-+ return -1
-+}
-+
-+gdb_breakpoint $srcfile:[gdb_get_line_number "break-here"] temporary
-+gdb_continue_to_breakpoint "break-here" ".* break-here .*"
-+
-+set test "response"
-+set timeout 60
-+set sleeping_last -1
-+set hello_last 0
-+set minimal 5
-+gdb_test_multiple "python exec (open ('$srcdir/$subdir/$srcfile2').read ())" $test {
-+ -re "Error: unable to start thread\r\n" {
-+ fail $test
-+ # Not $gdb_prompt-synced!
-+ }
-+ -re "Sleeping (\[0-9\]+)\r\n" {
-+ set n $expect_out(1,string)
-+ if { $sleeping_last + 1 != $n } {
-+ fail $test
-+ } else {
-+ set sleeping_last $n
-+ if { $sleeping_last >= $minimal && $hello_last >= $minimal } {
-+ pass $test
-+ } else {
-+ exp_continue
-+ }
-+ }
-+ }
-+ -re "Hello \\( (\[0-9\]+) \\)\r\n" {
-+ set n $expect_out(1,string)
-+ if { $hello_last + 1 != $n } {
-+ fail $test
-+ } else {
-+ set hello_last $n
-+ if { $sleeping_last >= $minimal && $hello_last >= $minimal } {
-+ pass $test
-+ } else {
-+ exp_continue
-+ }
-+ }
-+ }
-+}
-diff -Naurp insight-7.12.50.20170416.orig/gdb/testsuite/gdb.python/py-gil-mthread.py insight-7.12.50.20170416.new/gdb/testsuite/gdb.python/py-gil-mthread.py
---- insight-7.12.50.20170416.orig/gdb/testsuite/gdb.python/py-gil-mthread.py 1970-01-01 01:00:00.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/testsuite/gdb.python/py-gil-mthread.py 2017-04-16 13:27:34.574643851 +0100
-@@ -0,0 +1,28 @@
-+try:
-+ import thread
-+except:
-+ import _thread
-+import time
-+import gdb
-+
-+# Define a function for the thread
-+def print_thread_hello():
-+ count = 0
-+ while count < 10:
-+ time.sleep(1)
-+ count += 1
-+ print ("Hello ( %d )" % count)
-+
-+# Create a threads a continue
-+try:
-+ thread.start_new_thread (print_thread_hello, ())
-+ gdb.execute ("continue", release_gil=True)
-+except:
-+ try:
-+ _thread.start_new_thread (print_thread_hello, ())
-+ gdb.execute ("continue", release_gil=True)
-+ except:
-+ print ("Error: unable to start thread")
-+
-+while 1:
-+ pass
diff --git a/insight-7.12-gdb-rhbz795424-bitpos-20of25.patch b/insight-7.12-gdb-rhbz795424-bitpos-20of25.patch
deleted file mode 100644
index 6b22704..0000000
--- a/insight-7.12-gdb-rhbz795424-bitpos-20of25.patch
+++ /dev/null
@@ -1,2887 +0,0 @@
-diff -Naurp insight-7.12.50.20170416.orig/gdb/aarch64-linux-nat.c insight-7.12.50.20170416.new/gdb/aarch64-linux-nat.c
---- insight-7.12.50.20170416.orig/gdb/aarch64-linux-nat.c 2017-03-18 01:22:31.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/aarch64-linux-nat.c 2017-04-16 12:29:51.472070521 +0100
-@@ -708,7 +708,7 @@ aarch64_linux_remove_watchpoint (struct
-
- static int
- aarch64_linux_region_ok_for_hw_watchpoint (struct target_ops *self,
-- CORE_ADDR addr, int len)
-+ CORE_ADDR addr, LONGEST len)
- {
- return aarch64_linux_region_ok_for_watchpoint (addr, len);
- }
-diff -Naurp insight-7.12.50.20170416.orig/gdb/ada-lang.c insight-7.12.50.20170416.new/gdb/ada-lang.c
---- insight-7.12.50.20170416.orig/gdb/ada-lang.c 2017-04-09 01:11:01.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/ada-lang.c 2017-04-16 12:29:51.435070177 +0100
-@@ -76,7 +76,7 @@ static struct type *desc_bounds_type (st
-
- static struct value *desc_bounds (struct value *);
-
--static int fat_pntr_bounds_bitpos (struct type *);
-+static LONGEST fat_pntr_bounds_bitpos (struct type *);
-
- static int fat_pntr_bounds_bitsize (struct type *);
-
-@@ -84,13 +84,13 @@ static struct type *desc_data_target_typ
-
- static struct value *desc_data (struct value *);
-
--static int fat_pntr_data_bitpos (struct type *);
-+static LONGEST fat_pntr_data_bitpos (struct type *);
-
- static int fat_pntr_data_bitsize (struct type *);
-
- static struct value *desc_one_bound (struct value *, int, int);
-
--static int desc_bound_bitpos (struct type *, int, int);
-+static LONGEST desc_bound_bitpos (struct type *, int, int);
-
- static int desc_bound_bitsize (struct type *, int, int);
-
-@@ -173,7 +173,7 @@ static struct type *static_unwrap_type (
-
- static struct value *unwrap_value (struct value *);
-
--static struct type *constrained_packed_array_type (struct type *, long *);
-+static struct type *constrained_packed_array_type (struct type *, LONGEST *);
-
- static struct type *decode_constrained_packed_array_type (struct type *);
-
-@@ -188,7 +188,8 @@ static int ada_is_unconstrained_packed_a
- static struct value *value_subscript_packed (struct value *, int,
- struct value **);
-
--static void move_bits (gdb_byte *, int, const gdb_byte *, int, int, int);
-+static void move_bits (gdb_byte *, int, const gdb_byte *, LONGEST, LONGEST,
-+ int);
-
- static struct value *coerce_unspec_val_to_type (struct value *,
- struct type *);
-@@ -216,14 +217,14 @@ static struct value *value_val_atr (stru
- static struct symbol *standard_lookup (const char *, const struct block *,
- domain_enum);
-
--static struct value *ada_search_struct_field (const char *, struct value *, int,
-+static struct value *ada_search_struct_field (const char *, struct value *, LONGEST,
- struct type *);
-
--static struct value *ada_value_primitive_field (struct value *, int, int,
-+static struct value *ada_value_primitive_field (struct value *, LONGEST, int,
- struct type *);
-
--static int find_struct_field (const char *, struct type *, int,
-- struct type **, int *, int *, int *, int *);
-+static int find_struct_field (const char *, struct type *, LONGEST,
-+ struct type **, LONGEST *, int *, int *, int *);
-
- static struct value *ada_to_fixed_value_create (struct type *, CORE_ADDR,
- struct value *);
-@@ -237,7 +238,7 @@ static int ada_is_direct_array_type (str
- static void ada_language_arch_info (struct gdbarch *,
- struct language_arch_info *);
-
--static struct value *ada_index_struct_field (int, struct value *, int,
-+static struct value *ada_index_struct_field (LONGEST, struct value *, LONGEST,
- struct type *);
-
- static struct value *assign_aggregate (struct value *, struct value *,
-@@ -699,7 +700,7 @@ coerce_unspec_val_to_type (struct value
- }
-
- static const gdb_byte *
--cond_offset_host (const gdb_byte *valaddr, long offset)
-+cond_offset_host (const gdb_byte *valaddr, LONGEST offset)
- {
- if (valaddr == NULL)
- return NULL;
-@@ -708,7 +709,7 @@ cond_offset_host (const gdb_byte *valadd
- }
-
- static CORE_ADDR
--cond_offset_target (CORE_ADDR address, long offset)
-+cond_offset_target (CORE_ADDR address, LONGEST offset)
- {
- if (address == 0)
- return 0;
-@@ -1755,7 +1756,7 @@ desc_bounds (struct value *arr)
- /* If TYPE is the type of an array-descriptor (fat pointer), the bit
- position of the field containing the address of the bounds data. */
-
--static int
-+static LONGEST
- fat_pntr_bounds_bitpos (struct type *type)
- {
- return TYPE_FIELD_BITPOS (desc_base_type (type), 1);
-@@ -1821,7 +1822,7 @@ desc_data (struct value *arr)
- /* If TYPE is the type of an array-descriptor (fat pointer), the bit
- position of the field containing the address of the data. */
-
--static int
-+static LONGEST
- fat_pntr_data_bitpos (struct type *type)
- {
- return TYPE_FIELD_BITPOS (desc_base_type (type), 0);
-@@ -1856,7 +1857,7 @@ desc_one_bound (struct value *bounds, in
- of the Ith lower bound stored in it, if WHICH is 0, and the Ith upper
- bound, if WHICH is 1. The first bound is I=1. */
-
--static int
-+static LONGEST
- desc_bound_bitpos (struct type *type, int i, int which)
- {
- return TYPE_FIELD_BITPOS (desc_base_type (type), 2 * i + which - 2);
-@@ -2046,7 +2047,7 @@ ada_type_of_array (struct value *arr, in
- zero, and does not need to be recomputed. */
- if (lo < hi)
- {
-- int array_bitsize =
-+ LONGEST array_bitsize =
- (hi - lo + 1) * TYPE_FIELD_BITSIZE (elt_type, 0);
-
- TYPE_LENGTH (array_type) = (array_bitsize + 7) / 8;
-@@ -2206,7 +2207,7 @@ decode_packed_array_bitsize (struct type
- the length is arbitrary. */
-
- static struct type *
--constrained_packed_array_type (struct type *type, long *elt_bits)
-+constrained_packed_array_type (struct type *type, LONGEST *elt_bits)
- {
- struct type *new_elt_type;
- struct type *new_type;
-@@ -2260,7 +2261,7 @@ decode_constrained_packed_array_type (st
- char *name;
- const char *tail;
- struct type *shadow_type;
-- long bits;
-+ LONGEST bits;
-
- if (!raw_name)
- raw_name = ada_type_name (desc_base_type (type));
-@@ -2331,7 +2332,8 @@ decode_constrained_packed_array (struct
- array with no wrapper. In order to interpret the value through
- the (left-justified) packed array type we just built, we must
- first left-justify it. */
-- int bit_size, bit_pos;
-+ int bit_size;
-+ LONGEST bit_pos;
- ULONGEST mod;
-
- mod = ada_modulus (value_type (arr)) - 1;
-@@ -2559,7 +2561,7 @@ ada_unpack_from_contents (const gdb_byte
-
- struct value *
- ada_value_primitive_packed_val (struct value *obj, const gdb_byte *valaddr,
-- long offset, int bit_offset, int bit_size,
-+ LONGEST offset, int bit_offset, int bit_size,
- struct type *type)
- {
- struct value *v;
-@@ -2630,7 +2632,7 @@ ada_value_primitive_packed_val (struct v
-
- if (obj != NULL)
- {
-- long new_offset = offset;
-+ LONGEST new_offset = offset;
-
- set_value_component_location (v, obj);
- set_value_bitpos (v, bit_offset + value_bitpos (obj));
-@@ -2676,7 +2678,7 @@ ada_value_primitive_packed_val (struct v
- not overlap. */
- static void
- move_bits (gdb_byte *target, int targ_offset, const gdb_byte *source,
-- int src_offset, int n, int bits_big_endian_p)
-+ LONGEST src_offset, LONGEST n, int bits_big_endian_p)
- {
- unsigned int accum, mask;
- int accum_bits, chunk_size;
-@@ -2766,7 +2768,7 @@ ada_value_assign (struct value *toval, s
- {
- int len = (value_bitpos (toval)
- + bits + HOST_CHAR_BIT - 1) / HOST_CHAR_BIT;
-- int from_size;
-+ LONGEST from_size;
- gdb_byte *buffer = (gdb_byte *) alloca (len);
- struct value *val;
- CORE_ADDR to_addr = value_address (toval);
-@@ -2817,7 +2819,7 @@ value_assign_to_component (struct value
- (LONGEST) (value_address (component) - value_address (container));
- int bit_offset_in_container =
- value_bitpos (component) - value_bitpos (container);
-- int bits;
-+ LONGEST bits;
-
- val = value_cast (value_type (component), val);
-
-@@ -4468,7 +4470,7 @@ ensure_lval (struct value *val)
- if (VALUE_LVAL (val) == not_lval
- || VALUE_LVAL (val) == lval_internalvar)
- {
-- int len = TYPE_LENGTH (ada_check_typedef (value_type (val)));
-+ LONGEST len = TYPE_LENGTH (ada_check_typedef (value_type (val)));
- const CORE_ADDR addr =
- value_as_long (value_allocate_space_in_inferior (len));
-
-@@ -4552,7 +4554,7 @@ static CORE_ADDR
- value_pointer (struct value *value, struct type *type)
- {
- struct gdbarch *gdbarch = get_type_arch (type);
-- unsigned len = TYPE_LENGTH (type);
-+ ULONGEST len = TYPE_LENGTH (type);
- gdb_byte *buf = (gdb_byte *) alloca (len);
- CORE_ADDR addr;
-
-@@ -6752,7 +6754,7 @@ value_tag_from_contents_and_address (str
- const gdb_byte *valaddr,
- CORE_ADDR address)
- {
-- int tag_byte_offset;
-+ LONGEST tag_byte_offset;
- struct type *tag_type;
-
- if (find_struct_field ("_tag", type, 0, &tag_type, &tag_byte_offset,
-@@ -7233,7 +7235,7 @@ ada_in_variant (LONGEST val, struct type
- only in that it can handle packed values of arbitrary type. */
-
- static struct value *
--ada_value_primitive_field (struct value *arg1, int offset, int fieldno,
-+ada_value_primitive_field (struct value *arg1, LONGEST offset, int fieldno,
- struct type *arg_type)
- {
- struct type *type;
-@@ -7245,7 +7247,7 @@ ada_value_primitive_field (struct value
-
- if (TYPE_FIELD_BITSIZE (arg_type, fieldno) != 0)
- {
-- int bit_pos = TYPE_FIELD_BITPOS (arg_type, fieldno);
-+ LONGEST bit_pos = TYPE_FIELD_BITPOS (arg_type, fieldno);
- int bit_size = TYPE_FIELD_BITSIZE (arg_type, fieldno);
-
- return ada_value_primitive_packed_val (arg1, value_contents (arg1),
-@@ -7272,9 +7274,9 @@ ada_value_primitive_field (struct value
- Returns 1 if found, 0 otherwise. */
-
- static int
--find_struct_field (const char *name, struct type *type, int offset,
-+find_struct_field (const char *name, struct type *type, LONGEST offset,
- struct type **field_type_p,
-- int *byte_offset_p, int *bit_offset_p, int *bit_size_p,
-+ LONGEST *byte_offset_p, int *bit_offset_p, int *bit_size_p,
- int *index_p)
- {
- int i;
-@@ -7292,8 +7294,8 @@ find_struct_field (const char *name, str
-
- for (i = 0; i < TYPE_NFIELDS (type); i += 1)
- {
-- int bit_pos = TYPE_FIELD_BITPOS (type, i);
-- int fld_offset = offset + bit_pos / 8;
-+ LONGEST bit_pos = TYPE_FIELD_BITPOS (type, i);
-+ LONGEST fld_offset = offset + bit_pos / 8;
- const char *t_field_name = TYPE_FIELD_NAME (type, i);
-
- if (t_field_name == NULL)
-@@ -7363,7 +7365,7 @@ num_visible_fields (struct type *type)
- Searches recursively through wrapper fields (e.g., '_parent'). */
-
- static struct value *
--ada_search_struct_field (const char *name, struct value *arg, int offset,
-+ada_search_struct_field (const char *name, struct value *arg, LONGEST offset,
- struct type *type)
- {
- int i;
-@@ -7396,7 +7398,7 @@ ada_search_struct_field (const char *nam
- int j;
- struct type *field_type = ada_check_typedef (TYPE_FIELD_TYPE (type,
- i));
-- int var_offset = offset + TYPE_FIELD_BITPOS (type, i) / 8;
-+ LONGEST var_offset = offset + TYPE_FIELD_BITPOS (type, i) / 8;
-
- for (j = 0; j < TYPE_NFIELDS (field_type); j += 1)
- {
-@@ -7414,8 +7416,8 @@ ada_search_struct_field (const char *nam
- return NULL;
- }
-
--static struct value *ada_index_struct_field_1 (int *, struct value *,
-- int, struct type *);
-+static struct value *ada_index_struct_field_1 (LONGEST *, struct value *,
-+ LONGEST, struct type *);
-
-
- /* Return field #INDEX in ARG, where the index is that returned by
-@@ -7424,7 +7426,7 @@ static struct value *ada_index_struct_fi
- * If found, return value, else return NULL. */
-
- static struct value *
--ada_index_struct_field (int index, struct value *arg, int offset,
-+ada_index_struct_field (LONGEST index, struct value *arg, LONGEST offset,
- struct type *type)
- {
- return ada_index_struct_field_1 (&index, arg, offset, type);
-@@ -7436,7 +7438,7 @@ ada_index_struct_field (int index, struc
- * *INDEX_P. */
-
- static struct value *
--ada_index_struct_field_1 (int *index_p, struct value *arg, int offset,
-+ada_index_struct_field_1 (LONGEST *index_p, struct value *arg, LONGEST offset,
- struct type *type)
- {
- int i;
-@@ -7526,7 +7528,8 @@ ada_value_struct_elt (struct value *arg,
- v = ada_search_struct_field (name, arg, 0, t);
- else
- {
-- int bit_offset, bit_size, byte_offset;
-+ int bit_offset, bit_size;
-+ LONGEST byte_offset;
- struct type *field_type;
- CORE_ADDR address;
-
-@@ -7832,8 +7835,8 @@ ada_coerce_ref (struct value *val0)
- /* Return OFF rounded upward if necessary to a multiple of
- ALIGNMENT (a power of 2). */
-
--static unsigned int
--align_value (unsigned int off, unsigned int alignment)
-+static ULONGEST
-+align_value (ULONGEST off, ULONGEST alignment)
- {
- return (off + alignment - 1) & ~(alignment - 1);
- }
-@@ -8227,10 +8230,9 @@ ada_template_to_fixed_record_type_1 (str
- struct value *mark = value_mark ();
- struct value *dval;
- struct type *rtype;
-- int nfields, bit_len;
-+ int nfields;
- int variant_field;
-- long off;
-- int fld_bit_len;
-+ LONGEST off, bit_len, fld_bit_len;
- int f;
-
- /* Compute the number of fields in this record type that are going
-@@ -8308,7 +8310,7 @@ ada_template_to_fixed_record_type_1 (str
- that follow this one. */
- if (ada_is_aligner_type (field_type))
- {
-- long field_offset = TYPE_FIELD_BITPOS (field_type, f);
-+ LONGEST field_offset = TYPE_FIELD_BITPOS (field_type, f);
-
- field_valaddr = cond_offset_host (field_valaddr, field_offset);
- field_address = cond_offset_target (field_address, field_offset);
-@@ -8444,11 +8446,11 @@ ada_template_to_fixed_record_type_1 (str
- if (TYPE_LENGTH (type) <= 0)
- {
- if (TYPE_NAME (rtype))
-- warning (_("Invalid type size for `%s' detected: %d."),
-- TYPE_NAME (rtype), TYPE_LENGTH (type));
-+ warning (_("Invalid type size for `%s' detected: %s."),
-+ TYPE_NAME (rtype), pulongest (TYPE_LENGTH (type)));
- else
-- warning (_("Invalid type size for <unnamed> detected: %d."),
-- TYPE_LENGTH (type));
-+ warning (_("Invalid type size for <unnamed> detected: %s."),
-+ pulongest (TYPE_LENGTH (type)));
- }
- else
- {
-@@ -8915,7 +8917,8 @@ to_fixed_array_type (struct type *type0,
- type was a regular (non-packed) array type. As a result, the
- bitsize of the array elements needs to be set again, and the array
- length needs to be recomputed based on that bitsize. */
-- int len = TYPE_LENGTH (result) / TYPE_LENGTH (TYPE_TARGET_TYPE (result));
-+ LONGEST len = (TYPE_LENGTH (result)
-+ / TYPE_LENGTH (TYPE_TARGET_TYPE (result)));
- int elt_bitsize = TYPE_FIELD_BITSIZE (type0, 0);
-
- TYPE_FIELD_BITSIZE (result, 0) = TYPE_FIELD_BITSIZE (type0, 0);
-diff -Naurp insight-7.12.50.20170416.orig/gdb/ada-lang.h insight-7.12.50.20170416.new/gdb/ada-lang.h
---- insight-7.12.50.20170416.orig/gdb/ada-lang.h 2017-04-09 01:11:01.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/ada-lang.h 2017-04-16 12:29:51.436070187 +0100
-@@ -168,7 +168,7 @@ extern void ada_print_type (struct type
- extern void ada_print_typedef (struct type *type, struct symbol *new_symbol,
- struct ui_file *stream);
-
--extern void ada_val_print (struct type *, int, CORE_ADDR,
-+extern void ada_val_print (struct type *, LONGEST, CORE_ADDR,
- struct ui_file *, int,
- struct value *,
- const struct value_print_options *);
-@@ -183,7 +183,7 @@ extern void ada_emit_char (int, struct t
- extern void ada_printchar (int, struct type *, struct ui_file *);
-
- extern void ada_printstr (struct ui_file *, struct type *, const gdb_byte *,
-- unsigned int, const char *, int,
-+ ULONGEST, const char *, int,
- const struct value_print_options *);
-
- struct value *ada_convert_actual (struct value *actual,
-@@ -255,7 +255,7 @@ extern int ada_is_constrained_packed_arr
-
- extern struct value *ada_value_primitive_packed_val (struct value *,
- const gdb_byte *,
-- long, int, int,
-+ LONGEST, int, int,
- struct type *);
-
- extern struct type *ada_coerce_to_simple_array_type (struct type *);
-diff -Naurp insight-7.12.50.20170416.orig/gdb/ada-typeprint.c insight-7.12.50.20170416.new/gdb/ada-typeprint.c
---- insight-7.12.50.20170416.orig/gdb/ada-typeprint.c 2017-01-03 17:36:55.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/ada-typeprint.c 2017-04-16 12:29:51.436070187 +0100
-@@ -891,8 +891,8 @@ ada_print_type (struct type *type0, cons
- const char *name = ada_type_name (type);
-
- if (!ada_is_range_type_name (name))
-- fprintf_filtered (stream, _("<%d-byte integer>"),
-- TYPE_LENGTH (type));
-+ fprintf_filtered (stream, _("<%s-byte integer>"),
-+ pulongest (TYPE_LENGTH (type)));
- else
- {
- fprintf_filtered (stream, "range ");
-@@ -913,7 +913,8 @@ ada_print_type (struct type *type0, cons
- }
- break;
- case TYPE_CODE_FLT:
-- fprintf_filtered (stream, _("<%d-byte float>"), TYPE_LENGTH (type));
-+ fprintf_filtered (stream, _("<%s-byte float>"),
-+ pulongest (TYPE_LENGTH (type)));
- break;
- case TYPE_CODE_ENUM:
- if (show < 0)
-diff -Naurp insight-7.12.50.20170416.orig/gdb/ada-valprint.c insight-7.12.50.20170416.new/gdb/ada-valprint.c
---- insight-7.12.50.20170416.orig/gdb/ada-valprint.c 2017-03-04 04:09:18.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/ada-valprint.c 2017-04-16 12:29:51.436070187 +0100
-@@ -33,11 +33,11 @@
- #include "objfiles.h"
-
- static int print_field_values (struct type *, const gdb_byte *,
-- int,
-+ LONGEST,
- struct ui_file *, int,
- struct value *,
- const struct value_print_options *,
-- int, struct type *, int,
-+ int, struct type *, LONGEST,
- const struct language_defn *);
-
-
-@@ -279,7 +279,7 @@ ada_emit_char (int c, struct type *type,
- of a character. */
-
- static int
--char_at (const gdb_byte *string, int i, int type_len,
-+char_at (const gdb_byte *string, LONGEST i, int type_len,
- enum bfd_endian byte_order)
- {
- if (type_len == 1)
-@@ -439,11 +439,11 @@ ada_print_scalar (struct type *type, LON
-
- static void
- printstr (struct ui_file *stream, struct type *elttype, const gdb_byte *string,
-- unsigned int length, int force_ellipses, int type_len,
-+ ULONGEST length, int force_ellipses, int type_len,
- const struct value_print_options *options)
- {
- enum bfd_endian byte_order = gdbarch_byte_order (get_type_arch (elttype));
-- unsigned int i;
-+ ULONGEST i;
- unsigned int things_printed = 0;
- int in_quotes = 0;
- int need_comma = 0;
-@@ -458,9 +458,9 @@ printstr (struct ui_file *stream, struct
- {
- /* Position of the character we are examining
- to see whether it is repeated. */
-- unsigned int rep1;
-+ ULONGEST rep1;
- /* Number of repetitions we have detected so far. */
-- unsigned int reps;
-+ ULONGEST reps;
-
- QUIT;
-
-@@ -491,7 +491,8 @@ printstr (struct ui_file *stream, struct
- ada_emit_char (char_at (string, i, type_len, byte_order),
- elttype, stream, '\'', type_len);
- fputs_filtered ("'", stream);
-- fprintf_filtered (stream, _(" <repeats %u times>"), reps);
-+ fprintf_filtered (stream, _(" <repeats %s times>"),
-+ pulongest (reps));
- i = rep1 - 1;
- things_printed += options->repeat_count_threshold;
- need_comma = 1;
-@@ -519,7 +520,7 @@ printstr (struct ui_file *stream, struct
-
- void
- ada_printstr (struct ui_file *stream, struct type *type,
-- const gdb_byte *string, unsigned int length,
-+ const gdb_byte *string, ULONGEST length,
- const char *encoding, int force_ellipses,
- const struct value_print_options *options)
- {
-@@ -529,12 +530,12 @@ ada_printstr (struct ui_file *stream, st
-
- static int
- print_variant_part (struct type *type, int field_num,
-- const gdb_byte *valaddr, int offset,
-+ const gdb_byte *valaddr, LONGEST offset,
- struct ui_file *stream, int recurse,
- struct value *val,
- const struct value_print_options *options,
- int comma_needed,
-- struct type *outer_type, int outer_offset,
-+ struct type *outer_type, LONGEST outer_offset,
- const struct language_defn *language)
- {
- struct type *var_type = TYPE_FIELD_TYPE (type, field_num);
-@@ -570,11 +571,11 @@ print_variant_part (struct type *type, i
-
- static int
- print_field_values (struct type *type, const gdb_byte *valaddr,
-- int offset, struct ui_file *stream, int recurse,
-+ LONGEST offset, struct ui_file *stream, int recurse,
- struct value *val,
- const struct value_print_options *options,
- int comma_needed,
-- struct type *outer_type, int outer_offset,
-+ struct type *outer_type, LONGEST outer_offset,
- const struct language_defn *language)
- {
- int i, len;
-@@ -640,7 +641,7 @@ print_field_values (struct type *type, c
- else
- {
- struct value *v;
-- int bit_pos = TYPE_FIELD_BITPOS (type, i);
-+ LONGEST bit_pos = TYPE_FIELD_BITPOS (type, i);
- int bit_size = TYPE_FIELD_BITSIZE (type, i);
- struct value_print_options opts;
-
-@@ -685,8 +686,8 @@ ada_val_print_string (struct type *type,
- {
- enum bfd_endian byte_order = gdbarch_byte_order (get_type_arch (type));
- struct type *elttype = TYPE_TARGET_TYPE (type);
-- unsigned int eltlen;
-- unsigned int len;
-+ ULONGEST eltlen;
-+ ULONGEST len;
-
- /* We know that ELTTYPE cannot possibly be null, because we assume
- that we're called only when TYPE is a string-like type.
-@@ -705,7 +706,7 @@ ada_val_print_string (struct type *type,
- elements up to it. */
- if (options->stop_print_at_null)
- {
-- int temp_len;
-+ LONGEST temp_len;
-
- /* Look for a NULL char. */
- for (temp_len = 0;
-@@ -1072,7 +1073,7 @@ ada_val_print_ref (struct type *type, co
-
- static void
- ada_val_print_1 (struct type *type,
-- int offset, CORE_ADDR address,
-+ LONGEST offset, CORE_ADDR address,
- struct ui_file *stream, int recurse,
- struct value *original_value,
- const struct value_print_options *options,
-@@ -1156,7 +1157,7 @@ ada_val_print_1 (struct type *type,
-
- void
- ada_val_print (struct type *type,
-- int embedded_offset, CORE_ADDR address,
-+ LONGEST embedded_offset, CORE_ADDR address,
- struct ui_file *stream, int recurse,
- struct value *val,
- const struct value_print_options *options)
-diff -Naurp insight-7.12.50.20170416.orig/gdb/annotate.c insight-7.12.50.20170416.new/gdb/annotate.c
---- insight-7.12.50.20170416.orig/gdb/annotate.c 2017-01-03 17:36:55.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/annotate.c 2017-04-16 12:29:51.437070196 +0100
-@@ -533,21 +533,21 @@ annotate_frame_end (void)
- }
-
- void
--annotate_array_section_begin (int idx, struct type *elttype)
-+annotate_array_section_begin (LONGEST idx, struct type *elttype)
- {
- if (annotation_level == 2)
- {
-- printf_filtered (("\n\032\032array-section-begin %d "), idx);
-+ printf_filtered (("\n\032\032array-section-begin %s "), plongest (idx));
- print_value_flags (elttype);
- printf_filtered (("\n"));
- }
- }
-
- void
--annotate_elt_rep (unsigned int repcount)
-+annotate_elt_rep (ULONGEST repcount)
- {
- if (annotation_level == 2)
-- printf_filtered (("\n\032\032elt-rep %u\n"), repcount);
-+ printf_filtered (("\n\032\032elt-rep %s\n"), pulongest (repcount));
- }
-
- void
-diff -Naurp insight-7.12.50.20170416.orig/gdb/annotate.h insight-7.12.50.20170416.new/gdb/annotate.h
---- insight-7.12.50.20170416.orig/gdb/annotate.h 2017-01-03 17:36:55.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/annotate.h 2017-04-16 12:29:51.437070196 +0100
-@@ -92,8 +92,8 @@ extern void annotate_frame_source_end (v
- extern void annotate_frame_where (void);
- extern void annotate_frame_end (void);
-
--extern void annotate_array_section_begin (int, struct type *);
--extern void annotate_elt_rep (unsigned int);
-+extern void annotate_array_section_begin (LONGEST, struct type *);
-+extern void annotate_elt_rep (ULONGEST);
- extern void annotate_elt_rep_end (void);
- extern void annotate_elt (void);
- extern void annotate_array_section_end (void);
-diff -Naurp insight-7.12.50.20170416.orig/gdb/arch-utils.c insight-7.12.50.20170416.new/gdb/arch-utils.c
---- insight-7.12.50.20170416.orig/gdb/arch-utils.c 2017-01-03 17:36:55.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/arch-utils.c 2017-04-16 12:29:51.474070540 +0100
-@@ -247,7 +247,7 @@ legacy_virtual_frame_pointer (struct gdb
-
- const struct floatformat **
- default_floatformat_for_type (struct gdbarch *gdbarch,
-- const char *name, int len)
-+ const char *name, LONGEST len)
- {
- const struct floatformat **format = NULL;
-
-diff -Naurp insight-7.12.50.20170416.orig/gdb/arch-utils.h insight-7.12.50.20170416.new/gdb/arch-utils.h
---- insight-7.12.50.20170416.orig/gdb/arch-utils.h 2017-01-03 17:36:55.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/arch-utils.h 2017-04-16 12:29:51.474070540 +0100
-@@ -144,7 +144,7 @@ extern gdbarch_virtual_frame_pointer_fty
- /* Default implementation of gdbarch_floatformat_for_type. */
- extern const struct floatformat **
- default_floatformat_for_type (struct gdbarch *gdbarch,
-- const char *name, int len);
-+ const char *name, LONGEST len);
-
- extern CORE_ADDR generic_skip_trampoline_code (struct frame_info *frame,
- CORE_ADDR pc);
-diff -Naurp insight-7.12.50.20170416.orig/gdb/arm-linux-nat.c insight-7.12.50.20170416.new/gdb/arm-linux-nat.c
---- insight-7.12.50.20170416.orig/gdb/arm-linux-nat.c 2017-03-18 01:22:31.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/arm-linux-nat.c 2017-04-16 12:29:51.437070196 +0100
-@@ -1065,7 +1065,7 @@ arm_linux_remove_hw_breakpoint (struct t
- ADDR? */
- static int
- arm_linux_region_ok_for_hw_watchpoint (struct target_ops *self,
-- CORE_ADDR addr, int len)
-+ CORE_ADDR addr, LONGEST len)
- {
- const struct arm_linux_hwbp_cap *cap = arm_linux_get_hwbp_cap ();
- CORE_ADDR max_wp_length, aligned_addr;
-diff -Naurp insight-7.12.50.20170416.orig/gdb/ax-gdb.c insight-7.12.50.20170416.new/gdb/ax-gdb.c
---- insight-7.12.50.20170416.orig/gdb/ax-gdb.c 2017-04-15 01:21:12.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/ax-gdb.c 2017-04-16 12:34:26.988633385 +0100
-@@ -83,12 +83,12 @@ static void gen_traced_pop (struct gdbar
- static void gen_sign_extend (struct agent_expr *, struct type *);
- static void gen_extend (struct agent_expr *, struct type *);
- static void gen_fetch (struct agent_expr *, struct type *);
--static void gen_left_shift (struct agent_expr *, int);
-+static void gen_left_shift (struct agent_expr *, LONGEST);
-
-
- static void gen_frame_args_address (struct gdbarch *, struct agent_expr *);
- static void gen_frame_locals_address (struct gdbarch *, struct agent_expr *);
--static void gen_offset (struct agent_expr *ax, int offset);
-+static void gen_offset (struct agent_expr *ax, LONGEST offset);
- static void gen_sym_offset (struct agent_expr *, struct symbol *);
- static void gen_var_ref (struct gdbarch *, struct agent_expr *ax,
- struct axs_value *value, struct symbol *var);
-@@ -137,15 +137,16 @@ static void gen_deref (struct agent_expr
- static void gen_address_of (struct agent_expr *, struct axs_value *);
- static void gen_bitfield_ref (struct expression *exp, struct agent_expr *ax,
- struct axs_value *value,
-- struct type *type, int start, int end);
-+ struct type *type, LONGEST start, LONGEST end);
- static void gen_primitive_field (struct expression *exp,
- struct agent_expr *ax,
- struct axs_value *value,
-- int offset, int fieldno, struct type *type);
-+ LONGEST offset, int fieldno,
-+ struct type *type);
- static int gen_struct_ref_recursive (struct expression *exp,
- struct agent_expr *ax,
- struct axs_value *value,
-- const char *field, int offset,
-+ const char *field, LONGEST offset,
- struct type *type);
- static void gen_struct_ref (struct expression *exp, struct agent_expr *ax,
- struct axs_value *value,
-@@ -541,7 +542,7 @@ gen_fetch (struct agent_expr *ax, struct
- right shift it by -DISTANCE bits if DISTANCE < 0. This generates
- unsigned (logical) right shifts. */
- static void
--gen_left_shift (struct agent_expr *ax, int distance)
-+gen_left_shift (struct agent_expr *ax, LONGEST distance)
- {
- if (distance > 0)
- {
-@@ -595,7 +596,7 @@ gen_frame_locals_address (struct gdbarch
- programming in ML, it would be clearer why these are the same
- thing. */
- static void
--gen_offset (struct agent_expr *ax, int offset)
-+gen_offset (struct agent_expr *ax, LONGEST offset)
- {
- /* It would suffice to simply push the offset and add it, but this
- makes it easier to read positive and negative offsets in the
-@@ -1251,7 +1252,7 @@ gen_address_of (struct agent_expr *ax, s
- static void
- gen_bitfield_ref (struct expression *exp, struct agent_expr *ax,
- struct axs_value *value, struct type *type,
-- int start, int end)
-+ LONGEST start, LONGEST end)
- {
- /* Note that ops[i] fetches 8 << i bits. */
- static enum agent_op ops[]
-@@ -1286,13 +1287,13 @@ gen_bitfield_ref (struct expression *exp
-
- /* The first and one-after-last bits in the field, but rounded down
- and up to byte boundaries. */
-- int bound_start = (start / TARGET_CHAR_BIT) * TARGET_CHAR_BIT;
-- int bound_end = (((end + TARGET_CHAR_BIT - 1)
-- / TARGET_CHAR_BIT)
-- * TARGET_CHAR_BIT);
-+ LONGEST bound_start = (start / TARGET_CHAR_BIT) * TARGET_CHAR_BIT;
-+ LONGEST bound_end = (((end + TARGET_CHAR_BIT - 1)
-+ / TARGET_CHAR_BIT)
-+ * TARGET_CHAR_BIT);
-
- /* current bit offset within the structure */
-- int offset;
-+ LONGEST offset;
-
- /* The index in ops of the opcode we're considering. */
- int op;
-@@ -1411,7 +1412,7 @@ gen_bitfield_ref (struct expression *exp
- static void
- gen_primitive_field (struct expression *exp,
- struct agent_expr *ax, struct axs_value *value,
-- int offset, int fieldno, struct type *type)
-+ LONGEST offset, int fieldno, struct type *type)
- {
- /* Is this a bitfield? */
- if (TYPE_FIELD_PACKED (type, fieldno))
-@@ -1436,7 +1437,7 @@ gen_primitive_field (struct expression *
- static int
- gen_struct_ref_recursive (struct expression *exp, struct agent_expr *ax,
- struct axs_value *value,
-- const char *field, int offset, struct type *type)
-+ const char *field, LONGEST offset, struct type *type)
- {
- int i, rslt;
- int nbases = TYPE_N_BASECLASSES (type);
-diff -Naurp insight-7.12.50.20170416.orig/gdb/ax-general.c insight-7.12.50.20170416.new/gdb/ax-general.c
---- insight-7.12.50.20170416.orig/gdb/ax-general.c 2017-01-03 17:36:55.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/ax-general.c 2017-04-16 12:29:51.439070215 +0100
-@@ -177,7 +177,7 @@ ax_zero_ext (struct agent_expr *x, int n
-
- /* Append a trace_quick instruction to EXPR, to record N bytes. */
- void
--ax_trace_quick (struct agent_expr *x, int n)
-+ax_trace_quick (struct agent_expr *x, LONGEST n)
- {
- /* N must fit in a byte. */
- if (n < 0 || n > 255)
-diff -Naurp insight-7.12.50.20170416.orig/gdb/ax.h insight-7.12.50.20170416.new/gdb/ax.h
---- insight-7.12.50.20170416.orig/gdb/ax.h 2017-01-03 17:36:55.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/ax.h 2017-04-16 12:29:51.439070215 +0100
-@@ -205,7 +205,7 @@ extern void ax_ext (struct agent_expr *E
- extern void ax_zero_ext (struct agent_expr *EXPR, int N);
-
- /* Append a trace_quick instruction to EXPR, to record N bytes. */
--extern void ax_trace_quick (struct agent_expr *EXPR, int N);
-+extern void ax_trace_quick (struct agent_expr *EXPR, LONGEST N);
-
- /* Append a goto op to EXPR. OP is the actual op (must be aop_goto or
- aop_if_goto). We assume we don't know the target offset yet,
-diff -Naurp insight-7.12.50.20170416.orig/gdb/breakpoint.c insight-7.12.50.20170416.new/gdb/breakpoint.c
---- insight-7.12.50.20170416.orig/gdb/breakpoint.c 2017-04-16 12:29:02.788617666 +0100
-+++ insight-7.12.50.20170416.new/gdb/breakpoint.c 2017-04-16 12:29:51.442070242 +0100
-@@ -2225,9 +2225,9 @@ should_be_inserted (struct bp_location *
- {
- fprintf_unfiltered (gdb_stdlog,
- "infrun: stepping past non-steppable watchpoint. "
-- "skipping watchpoint at %s:%d\n",
-+ "skipping watchpoint at %s:%s\n",
- paddress (bl->gdbarch, bl->address),
-- bl->length);
-+ plongest (bl->length));
- }
- return 0;
- }
-@@ -7151,7 +7151,7 @@ breakpoint_address_match (struct address
-
- static int
- breakpoint_address_match_range (struct address_space *aspace1, CORE_ADDR addr1,
-- int len1, struct address_space *aspace2,
-+ LONGEST len1, struct address_space *aspace2,
- CORE_ADDR addr2)
- {
- return ((gdbarch_has_global_breakpoints (target_gdbarch ())
-@@ -11444,7 +11444,7 @@ can_use_hardware_watchpoint (struct valu
- && TYPE_CODE (vtype) != TYPE_CODE_ARRAY))
- {
- CORE_ADDR vaddr = value_address (v);
-- int len;
-+ LONGEST len;
- int num_regs;
-
- len = (target_exact_watchpoints
-diff -Naurp insight-7.12.50.20170416.orig/gdb/breakpoint.h insight-7.12.50.20170416.new/gdb/breakpoint.h
---- insight-7.12.50.20170416.orig/gdb/breakpoint.h 2017-04-16 12:29:02.694616792 +0100
-+++ insight-7.12.50.20170416.new/gdb/breakpoint.h 2017-04-16 12:29:51.443070252 +0100
-@@ -250,7 +250,7 @@ struct bp_target_info
-
- /* If this is a ranged breakpoint, then this field contains the
- length of the range that will be watched for execution. */
-- int length;
-+ LONGEST length;
-
- /* If the breakpoint lives in memory and reading that memory would
- give back the breakpoint, instead of the original contents, then
-@@ -422,7 +422,7 @@ struct bp_location
- /* For hardware watchpoints, the size of the memory region being
- watched. For hardware ranged breakpoints, the size of the
- breakpoint range. */
-- int length;
-+ LONGEST length;
-
- /* Type of hardware watchpoint. */
- enum target_hw_bp_type watchpoint_type;
-diff -Naurp insight-7.12.50.20170416.orig/gdb/c-lang.c insight-7.12.50.20170416.new/gdb/c-lang.c
---- insight-7.12.50.20170416.orig/gdb/c-lang.c 2017-04-15 01:21:12.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/c-lang.c 2017-04-16 12:29:51.443070252 +0100
-@@ -186,7 +186,7 @@ c_printchar (int c, struct type *type, s
-
- void
- c_printstr (struct ui_file *stream, struct type *type,
-- const gdb_byte *string, unsigned int length,
-+ const gdb_byte *string, ULONGEST length,
- const char *user_encoding, int force_ellipses,
- const struct value_print_options *options)
- {
-@@ -672,7 +672,7 @@ evaluate_subexp_c (struct type *expect_t
- }
- else
- {
-- int i;
-+ LONGEST i;
-
- /* Write the terminating character. */
- for (i = 0; i < TYPE_LENGTH (type); ++i)
-@@ -681,7 +681,7 @@ evaluate_subexp_c (struct type *expect_t
- if (satisfy_expected)
- {
- LONGEST low_bound, high_bound;
-- int element_size = TYPE_LENGTH (type);
-+ LONGEST element_size = TYPE_LENGTH (type);
-
- if (get_discrete_bounds (TYPE_INDEX_TYPE (expect_type),
- &low_bound, &high_bound) < 0)
-diff -Naurp insight-7.12.50.20170416.orig/gdb/c-lang.h insight-7.12.50.20170416.new/gdb/c-lang.h
---- insight-7.12.50.20170416.orig/gdb/c-lang.h 2017-04-09 01:11:01.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/c-lang.h 2017-04-16 12:29:51.443070252 +0100
-@@ -77,7 +77,7 @@ extern void c_print_typedef (struct type
- struct ui_file *);
-
- extern void c_val_print (struct type *,
-- int, CORE_ADDR,
-+ LONGEST, CORE_ADDR,
- struct ui_file *, int,
- struct value *,
- const struct value_print_options *);
-@@ -97,7 +97,7 @@ extern void c_printchar (int, struct typ
- extern void c_printstr (struct ui_file * stream,
- struct type *elttype,
- const gdb_byte *string,
-- unsigned int length,
-+ ULONGEST length,
- const char *user_encoding,
- int force_ellipses,
- const struct value_print_options *options);
-diff -Naurp insight-7.12.50.20170416.orig/gdb/compile/compile-c-support.c insight-7.12.50.20170416.new/gdb/compile/compile-c-support.c
---- insight-7.12.50.20170416.orig/gdb/compile/compile-c-support.c 2017-04-15 01:21:12.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/compile/compile-c-support.c 2017-04-16 12:29:51.473070531 +0100
-@@ -309,11 +309,11 @@ generate_register_struct (struct ui_file
-
- default:
- fprintf_unfiltered (stream,
-- " unsigned char %s[%d]"
-+ " unsigned char %s[%s]"
- " __attribute__((__aligned__("
- "__BIGGEST_ALIGNMENT__)))",
- regname,
-- TYPE_LENGTH (regtype));
-+ pulongest (TYPE_LENGTH (regtype)));
- }
- fputs_unfiltered (";\n", stream);
-
-diff -Naurp insight-7.12.50.20170416.orig/gdb/cp-abi.c insight-7.12.50.20170416.new/gdb/cp-abi.c
---- insight-7.12.50.20170416.orig/gdb/cp-abi.c 2017-01-03 17:36:55.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/cp-abi.c 2017-04-16 12:29:51.444070261 +0100
-@@ -64,12 +64,12 @@ is_operator_name (const char *name)
- return (*current_cp_abi.is_operator_name) (name);
- }
-
--int
-+LONGEST
- baseclass_offset (struct type *type, int index, const gdb_byte *valaddr,
- LONGEST embedded_offset, CORE_ADDR address,
- const struct value *val)
- {
-- int res = 0;
-+ LONGEST res = 0;
-
- gdb_assert (current_cp_abi.baseclass_offset != NULL);
-
-@@ -96,7 +96,7 @@ baseclass_offset (struct type *type, int
- struct value *
- value_virtual_fn_field (struct value **arg1p,
- struct fn_field *f, int j,
-- struct type *type, int offset)
-+ struct type *type, LONGEST offset)
- {
- if ((current_cp_abi.virtual_fn_field) == NULL)
- return NULL;
-diff -Naurp insight-7.12.50.20170416.orig/gdb/cp-abi.h insight-7.12.50.20170416.new/gdb/cp-abi.h
---- insight-7.12.50.20170416.orig/gdb/cp-abi.h 2017-01-03 17:36:55.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/cp-abi.h 2017-04-16 12:29:51.444070261 +0100
-@@ -108,7 +108,7 @@ extern struct value *value_virtual_fn_fi
- struct fn_field *f,
- int j,
- struct type *type,
-- int offset);
-+ LONGEST offset);
-
-
- /* Try to find the run-time type of VALUE, using C++ run-time type
-@@ -144,11 +144,11 @@ extern struct type *value_rtti_type (str
- contents of VAL. The result is the offset of the baseclass value
- relative to (the address of)(ARG) + OFFSET. */
-
--extern int baseclass_offset (struct type *type,
-- int index, const gdb_byte *valaddr,
-- LONGEST embedded_offset,
-- CORE_ADDR address,
-- const struct value *val);
-+extern LONGEST baseclass_offset (struct type *type,
-+ int index, const gdb_byte *valaddr,
-+ LONGEST embedded_offset,
-+ CORE_ADDR address,
-+ const struct value *val);
-
- /* Describe the target of a pointer to method. CONTENTS is the byte
- pattern representing the pointer to method. TYPE is the pointer to
-@@ -226,12 +226,12 @@ struct cp_abi_ops
- struct value *(*virtual_fn_field) (struct value **arg1p,
- struct fn_field * f,
- int j, struct type * type,
-- int offset);
-+ LONGEST offset);
- struct type *(*rtti_type) (struct value *v, int *full,
- LONGEST *top, int *using_enc);
-- int (*baseclass_offset) (struct type *type, int index,
-- const bfd_byte *valaddr, LONGEST embedded_offset,
-- CORE_ADDR address, const struct value *val);
-+ LONGEST (*baseclass_offset) (struct type *type, int index,
-+ const bfd_byte *valaddr, LONGEST embedded_offset,
-+ CORE_ADDR address, const struct value *val);
- void (*print_method_ptr) (const gdb_byte *contents,
- struct type *type,
- struct ui_file *stream);
-diff -Naurp insight-7.12.50.20170416.orig/gdb/cp-valprint.c insight-7.12.50.20170416.new/gdb/cp-valprint.c
---- insight-7.12.50.20170416.orig/gdb/cp-valprint.c 2017-04-09 01:11:01.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/cp-valprint.c 2017-04-16 12:29:51.444070261 +0100
-@@ -336,7 +336,7 @@ cp_print_value_fields (struct type *type
- }
- else if (i == vptr_fieldno && type == vptr_basetype)
- {
-- int i_offset = offset + TYPE_FIELD_BITPOS (type, i) / 8;
-+ LONGEST i_offset = offset + TYPE_FIELD_BITPOS (type, i) / 8;
- struct type *i_type = TYPE_FIELD_TYPE (type, i);
-
- if (valprint_check_validity (stream, i_type, i_offset, val))
-diff -Naurp insight-7.12.50.20170416.orig/gdb/c-valprint.c insight-7.12.50.20170416.new/gdb/c-valprint.c
---- insight-7.12.50.20170416.orig/gdb/c-valprint.c 2017-03-25 10:42:37.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/c-valprint.c 2017-04-16 12:29:51.443070252 +0100
-@@ -244,7 +244,7 @@ c_val_print_array (struct type *type, co
- if (TYPE_LENGTH (type) > 0 && TYPE_LENGTH (unresolved_elttype) > 0)
- {
- LONGEST low_bound, high_bound;
-- int eltlen, len;
-+ LONGEST eltlen, len;
- struct gdbarch *gdbarch = get_type_arch (type);
- enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
- unsigned int i = 0; /* Number of characters printed. */
-@@ -318,8 +318,8 @@ c_val_print_array (struct type *type, co
- if (cp_is_vtbl_ptr_type (elttype))
- {
- i = 1;
-- fprintf_filtered (stream, _("%d vtable entries"),
-- len - 1);
-+ fprintf_filtered (stream, _("%s vtable entries"),
-+ plongest (len - 1));
- }
- else
- {
-@@ -396,7 +396,7 @@ c_val_print_struct (struct type *type, c
- -fvtable_thunks. (Otherwise, look under
- TYPE_CODE_PTR.) */
- struct gdbarch *gdbarch = get_type_arch (type);
-- int offset = (embedded_offset
-+ LONGEST offset = (embedded_offset
- + TYPE_FIELD_BITPOS (type,
- VTBL_FNADDR_OFFSET) / 8);
- struct type *field_type = TYPE_FIELD_TYPE (type, VTBL_FNADDR_OFFSET);
-@@ -495,7 +495,7 @@ c_val_print_memberptr (struct type *type
-
- void
- c_val_print (struct type *type,
-- int embedded_offset, CORE_ADDR address,
-+ LONGEST embedded_offset, CORE_ADDR address,
- struct ui_file *stream, int recurse,
- struct value *original_value,
- const struct value_print_options *options)
-diff -Naurp insight-7.12.50.20170416.orig/gdb/d-lang.h insight-7.12.50.20170416.new/gdb/d-lang.h
---- insight-7.12.50.20170416.orig/gdb/d-lang.h 2017-04-09 01:11:01.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/d-lang.h 2017-04-16 12:29:51.444070261 +0100
-@@ -81,7 +81,7 @@ extern struct block_symbol d_lookup_nest
- /* Defined in d-valprint.c */
-
- extern void d_val_print (struct type *type,
-- int embedded_offset, CORE_ADDR address,
-+ LONGEST embedded_offset, CORE_ADDR address,
- struct ui_file *stream, int recurse,
- struct value *val,
- const struct value_print_options *options);
-diff -Naurp insight-7.12.50.20170416.orig/gdb/d-valprint.c insight-7.12.50.20170416.new/gdb/d-valprint.c
---- insight-7.12.50.20170416.orig/gdb/d-valprint.c 2017-01-03 17:36:55.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/d-valprint.c 2017-04-16 12:29:51.444070261 +0100
-@@ -73,7 +73,7 @@ dynamic_array_type (struct type *type,
-
- /* Implements the la_val_print routine for language D. */
- void
--d_val_print (struct type *type, int embedded_offset,
-+d_val_print (struct type *type, LONGEST embedded_offset,
- CORE_ADDR address, struct ui_file *stream, int recurse,
- struct value *val,
- const struct value_print_options *options)
-diff -Naurp insight-7.12.50.20170416.orig/gdb/dwarf2loc.c insight-7.12.50.20170416.new/gdb/dwarf2loc.c
---- insight-7.12.50.20170416.orig/gdb/dwarf2loc.c 2017-04-09 01:11:01.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/dwarf2loc.c 2017-04-16 12:41:35.762621853 +0100
-@@ -1760,12 +1760,12 @@ static void
- read_pieced_value (struct value *v)
- {
- int i;
-- long offset = 0;
-+ LONGEST offset = 0;
- ULONGEST bits_to_skip;
- gdb_byte *contents;
- struct piece_closure *c
- = (struct piece_closure *) value_computed_closure (v);
-- size_t type_len;
-+ ULONGEST type_len;
- size_t buffer_size = 0;
- std::vector<gdb_byte> buffer;
- int bits_big_endian
-@@ -1789,8 +1789,8 @@ read_pieced_value (struct value *v)
- for (i = 0; i < c->n_pieces && offset < type_len; i++)
- {
- struct dwarf_expr_piece *p = &c->pieces[i];
-- size_t this_size, this_size_bits;
-- long dest_offset_bits, source_offset_bits, source_offset;
-+ ULONGEST this_size, this_size_bits;
-+ LONGEST dest_offset_bits, source_offset_bits, source_offset;
- const gdb_byte *intermediate_buffer;
-
- /* Compute size, source, and destination offsets for copying, in
-@@ -1929,12 +1929,12 @@ static void
- write_pieced_value (struct value *to, struct value *from)
- {
- int i;
-- long offset = 0;
-+ LONGEST offset = 0;
- ULONGEST bits_to_skip;
- const gdb_byte *contents;
- struct piece_closure *c
- = (struct piece_closure *) value_computed_closure (to);
-- size_t type_len;
-+ ULONGEST type_len;
- size_t buffer_size = 0;
- std::vector<gdb_byte> buffer;
- int bits_big_endian
-@@ -1953,8 +1953,8 @@ write_pieced_value (struct value *to, st
- for (i = 0; i < c->n_pieces && offset < type_len; i++)
- {
- struct dwarf_expr_piece *p = &c->pieces[i];
-- size_t this_size_bits, this_size;
-- long dest_offset_bits, source_offset_bits, dest_offset, source_offset;
-+ ULONGEST this_size_bits, this_size;
-+ LONGEST dest_offset_bits, source_offset_bits, dest_offset, source_offset;
- int need_bitwise;
- const gdb_byte *source_buffer;
-
-@@ -2073,7 +2073,7 @@ write_pieced_value (struct value *to, st
-
- static int
- check_pieced_synthetic_pointer (const struct value *value, LONGEST bit_offset,
-- int bit_length)
-+ LONGEST bit_length)
- {
- struct piece_closure *c
- = (struct piece_closure *) value_computed_closure (value);
-@@ -2086,7 +2086,7 @@ check_pieced_synthetic_pointer (const st
- for (i = 0; i < c->n_pieces && bit_length > 0; i++)
- {
- struct dwarf_expr_piece *p = &c->pieces[i];
-- size_t this_size_bits = p->size;
-+ ULONGEST this_size_bits = p->size;
-
- if (bit_offset > 0)
- {
-@@ -2194,8 +2194,8 @@ indirect_pieced_value (struct value *val
- struct type *type;
- struct frame_info *frame;
- struct dwarf2_locexpr_baton baton;
-- int i, bit_length;
-- LONGEST bit_offset;
-+ int i;
-+ LONGEST bit_length, bit_offset;
- struct dwarf_expr_piece *piece = NULL;
- LONGEST byte_offset;
- enum bfd_endian byte_order;
-@@ -2212,7 +2212,7 @@ indirect_pieced_value (struct value *val
- for (i = 0; i < c->n_pieces && bit_length > 0; i++)
- {
- struct dwarf_expr_piece *p = &c->pieces[i];
-- size_t this_size_bits = p->size;
-+ ULONGEST this_size_bits = p->size;
-
- if (bit_offset > 0)
- {
-@@ -2489,9 +2489,9 @@ dwarf2_evaluate_loc_desc_full (struct ty
- case DWARF_VALUE_STACK:
- {
- struct value *value = ctx.fetch (0);
-- size_t n = TYPE_LENGTH (value_type (value));
-- size_t len = TYPE_LENGTH (subobj_type);
-- size_t max = TYPE_LENGTH (type);
-+ ULONGEST n = TYPE_LENGTH (value_type (value));
-+ ULONGEST len = TYPE_LENGTH (subobj_type);
-+ ULONGEST max = TYPE_LENGTH (type);
- struct gdbarch *objfile_gdbarch = get_objfile_arch (objfile);
- struct cleanup *cleanup;
-
-diff -Naurp insight-7.12.50.20170416.orig/gdb/dwarf2read.c insight-7.12.50.20170416.new/gdb/dwarf2read.c
---- insight-7.12.50.20170416.orig/gdb/dwarf2read.c 2017-04-16 12:29:02.815617918 +0100
-+++ insight-7.12.50.20170416.new/gdb/dwarf2read.c 2017-04-16 12:29:51.449070307 +0100
-@@ -2063,12 +2063,12 @@ dwarf2_complex_location_expr_complaint (
- }
-
- static void
--dwarf2_const_value_length_mismatch_complaint (const char *arg1, int arg2,
-- int arg3)
-+dwarf2_const_value_length_mismatch_complaint (const char *arg1, LONGEST arg2,
-+ LONGEST arg3)
- {
- complaint (&symfile_complaints,
-- _("const value length mismatch for '%s', got %d, expected %d"),
-- arg1, arg2, arg3);
-+ _("const value length mismatch for '%s', got %s, expected %s"),
-+ arg1, plongest (arg2), plongest (arg3));
- }
-
- static void
-@@ -12876,8 +12876,8 @@ dwarf2_add_field (struct field_info *fip
- object, and then subtract off the number of bits of
- the field itself. The result is the bit offset of
- the LSB of the field. */
-- int anonymous_size;
-- int bit_offset = DW_UNSND (attr);
-+ LONGEST anonymous_size;
-+ LONGEST bit_offset = DW_UNSND (attr);
-
- attr = dwarf2_attr (die, DW_AT_byte_size, cu);
- if (attr)
-diff -Naurp insight-7.12.50.20170416.orig/gdb/eval.c insight-7.12.50.20170416.new/gdb/eval.c
---- insight-7.12.50.20170416.orig/gdb/eval.c 2017-03-25 10:42:37.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/eval.c 2017-04-16 12:29:51.450070317 +0100
-@@ -297,7 +297,8 @@ evaluate_struct_tuple (struct value *str
- while (--nargs >= 0)
- {
- struct value *val = NULL;
-- int bitpos, bitsize;
-+ LONGEST bitpos;
-+ int bitsize;
- bfd_byte *addr;
-
- fieldno++;
-@@ -358,7 +359,7 @@ init_array_element (struct value *array,
- enum noside noside, LONGEST low_bound, LONGEST high_bound)
- {
- LONGEST index;
-- int element_size = TYPE_LENGTH (value_type (element));
-+ LONGEST element_size = TYPE_LENGTH (value_type (element));
-
- if (exp->elts[*pos].opcode == BINOP_COMMA)
- {
-@@ -506,11 +507,11 @@ binop_promote (const struct language_def
- /* FIXME: Also mixed integral/booleans, with result an integer. */
- {
- const struct builtin_type *builtin = builtin_type (gdbarch);
-- unsigned int promoted_len1 = TYPE_LENGTH (type1);
-- unsigned int promoted_len2 = TYPE_LENGTH (type2);
-+ ULONGEST promoted_len1 = TYPE_LENGTH (type1);
-+ ULONGEST promoted_len2 = TYPE_LENGTH (type2);
- int is_unsigned1 = TYPE_UNSIGNED (type1);
- int is_unsigned2 = TYPE_UNSIGNED (type2);
-- unsigned int result_len;
-+ ULONGEST result_len;
- int unsigned_operation;
-
- /* Determine type length and signedness after promotion for
-@@ -692,7 +693,7 @@ evaluate_subexp_standard (struct type *e
- struct value **argvec;
- int code;
- int ix;
-- long mem_offset;
-+ LONGEST mem_offset;
- struct type **arg_types;
- int save_pos1;
- struct symbol *function = NULL;
-@@ -871,7 +872,7 @@ evaluate_subexp_standard (struct type *e
- struct type *range_type = TYPE_INDEX_TYPE (type);
- struct type *element_type = TYPE_TARGET_TYPE (type);
- struct value *array = allocate_value (expect_type);
-- int element_size = TYPE_LENGTH (check_typedef (element_type));
-+ LONGEST element_size = TYPE_LENGTH (check_typedef (element_type));
- LONGEST low_bound, high_bound, index;
-
- if (get_discrete_bounds (range_type, &low_bound, &high_bound) < 0)
-diff -Naurp insight-7.12.50.20170416.orig/gdb/findcmd.c insight-7.12.50.20170416.new/gdb/findcmd.c
---- insight-7.12.50.20170416.orig/gdb/findcmd.c 2017-01-03 17:36:55.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/findcmd.c 2017-04-16 12:29:51.474070540 +0100
-@@ -180,7 +180,7 @@ parse_find_args (char *args, ULONGEST *m
- need to grow the pattern buf. */
- pattern_buf_size_need = (pattern_buf_end - pattern_buf
- + std::max (TYPE_LENGTH (t),
-- (unsigned) sizeof (int64_t)));
-+ (ULONGEST) sizeof (int64_t)));
- if (pattern_buf_size_need > pattern_buf_size)
- {
- size_t current_offset = pattern_buf_end - pattern_buf;
-diff -Naurp insight-7.12.50.20170416.orig/gdb/findvar.c insight-7.12.50.20170416.new/gdb/findvar.c
---- insight-7.12.50.20170416.orig/gdb/findvar.c 2017-03-25 10:42:37.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/findvar.c 2017-04-16 12:29:51.451070326 +0100
-@@ -817,7 +817,7 @@ struct value *
- default_value_from_register (struct gdbarch *gdbarch, struct type *type,
- int regnum, struct frame_id frame_id)
- {
-- int len = TYPE_LENGTH (type);
-+ LONGEST len = TYPE_LENGTH (type);
- struct value *value = allocate_value (type);
- struct frame_info *frame;
-
-@@ -861,7 +861,7 @@ read_frame_register_value (struct value
- LONGEST offset = 0;
- LONGEST reg_offset = value_offset (value);
- int regnum = VALUE_REGNUM (value);
-- int len = type_length_units (check_typedef (value_type (value)));
-+ LONGEST len = type_length_units (check_typedef (value_type (value)));
-
- gdb_assert (VALUE_LVAL (value) == lval_register);
-
-@@ -876,7 +876,7 @@ read_frame_register_value (struct value
- while (len > 0)
- {
- struct value *regval = get_frame_register_value (frame, regnum);
-- int reg_len = type_length_units (value_type (regval)) - reg_offset;
-+ LONGEST reg_len = type_length_units (value_type (regval)) - reg_offset;
-
- /* If the register length is larger than the number of bytes
- remaining to copy, then only copy the appropriate bytes. */
-diff -Naurp insight-7.12.50.20170416.orig/gdb/f-lang.c insight-7.12.50.20170416.new/gdb/f-lang.c
---- insight-7.12.50.20170416.orig/gdb/f-lang.c 2017-04-09 01:11:01.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/f-lang.c 2017-04-16 12:29:51.450070317 +0100
-@@ -103,7 +103,7 @@ f_printchar (int c, struct type *type, s
-
- static void
- f_printstr (struct ui_file *stream, struct type *type, const gdb_byte *string,
-- unsigned int length, const char *encoding, int force_ellipses,
-+ ULONGEST length, const char *encoding, int force_ellipses,
- const struct value_print_options *options)
- {
- const char *type_encoding = f_get_encoding (type);
-diff -Naurp insight-7.12.50.20170416.orig/gdb/f-lang.h insight-7.12.50.20170416.new/gdb/f-lang.h
---- insight-7.12.50.20170416.orig/gdb/f-lang.h 2017-04-09 01:11:01.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/f-lang.h 2017-04-16 12:29:51.450070317 +0100
-@@ -30,7 +30,7 @@ extern void f_yyerror (const char *); /*
- extern void f_print_type (struct type *, const char *, struct ui_file *, int,
- int, const struct type_print_options *);
-
--extern void f_val_print (struct type *, int, CORE_ADDR,
-+extern void f_val_print (struct type *, LONGEST, CORE_ADDR,
- struct ui_file *, int,
- struct value *,
- const struct value_print_options *);
-diff -Naurp insight-7.12.50.20170416.orig/gdb/frame.c insight-7.12.50.20170416.new/gdb/frame.c
---- insight-7.12.50.20170416.orig/gdb/frame.c 2017-04-09 01:11:01.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/frame.c 2017-04-16 12:29:51.452070335 +0100
-@@ -1375,7 +1375,7 @@ deprecated_frame_register_read (struct f
-
- int
- get_frame_register_bytes (struct frame_info *frame, int regnum,
-- CORE_ADDR offset, int len, gdb_byte *myaddr,
-+ CORE_ADDR offset, LONGEST len, gdb_byte *myaddr,
- int *optimizedp, int *unavailablep)
- {
- struct gdbarch *gdbarch = get_frame_arch (frame);
-@@ -1404,7 +1404,7 @@ get_frame_register_bytes (struct frame_i
- }
- if (len > maxsize)
- error (_("Bad debug information detected: "
-- "Attempt to read %d bytes from registers."), len);
-+ "Attempt to read %s bytes from registers."), plongest (len));
-
- /* Copy the data. */
- while (len > 0)
-diff -Naurp insight-7.12.50.20170416.orig/gdb/frame.h insight-7.12.50.20170416.new/gdb/frame.h
---- insight-7.12.50.20170416.orig/gdb/frame.h 2017-01-03 17:36:55.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/frame.h 2017-04-16 12:29:51.453070345 +0100
-@@ -600,7 +600,7 @@ extern void put_frame_register (struct f
- contents are optimized out or unavailable, set *OPTIMIZEDP,
- *UNAVAILABLEP accordingly. */
- extern int get_frame_register_bytes (struct frame_info *frame, int regnum,
-- CORE_ADDR offset, int len,
-+ CORE_ADDR offset, LONGEST len,
- gdb_byte *myaddr,
- int *optimizedp, int *unavailablep);
-
-diff -Naurp insight-7.12.50.20170416.orig/gdb/f-valprint.c insight-7.12.50.20170416.new/gdb/f-valprint.c
---- insight-7.12.50.20170416.orig/gdb/f-valprint.c 2017-01-03 17:36:55.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/f-valprint.c 2017-04-16 12:29:51.451070326 +0100
-@@ -38,7 +38,7 @@ extern void _initialize_f_valprint (void
- static void info_common_command (char *, int);
- static void f77_get_dynamic_length_of_aggregate (struct type *);
-
--int f77_array_offset_tbl[MAX_FORTRAN_DIMS + 1][2];
-+LONGEST f77_array_offset_tbl[MAX_FORTRAN_DIMS + 1][2];
-
- /* Array which holds offsets to be applied to get a row's elements
- for a given array. Array also holds the size of each subarray. */
-@@ -73,8 +73,8 @@ f77_get_upperbound (struct type *type)
- static void
- f77_get_dynamic_length_of_aggregate (struct type *type)
- {
-- int upper_bound = -1;
-- int lower_bound = 1;
-+ LONGEST upper_bound = -1;
-+ LONGEST lower_bound = 1;
-
- /* Recursively go all the way down into a possibly multi-dimensional
- F77 array and get the bounds. For simple arrays, this is pretty
-@@ -106,7 +106,7 @@ f77_get_dynamic_length_of_aggregate (str
- static void
- f77_print_array_1 (int nss, int ndimensions, struct type *type,
- const gdb_byte *valaddr,
-- int embedded_offset, CORE_ADDR address,
-+ LONGEST embedded_offset, CORE_ADDR address,
- struct ui_file *stream, int recurse,
- const struct value *val,
- const struct value_print_options *options,
-@@ -115,7 +115,7 @@ f77_print_array_1 (int nss, int ndimensi
- struct type *range_type = TYPE_INDEX_TYPE (check_typedef (type));
- CORE_ADDR addr = address + embedded_offset;
- LONGEST lowerbound, upperbound;
-- int i;
-+ LONGEST i;
-
- get_discrete_bounds (range_type, &lowerbound, &upperbound);
-
-@@ -171,7 +171,7 @@ f77_print_array_1 (int nss, int ndimensi
-
- static void
- f77_print_array (struct type *type, const gdb_byte *valaddr,
-- int embedded_offset,
-+ LONGEST embedded_offset,
- CORE_ADDR address, struct ui_file *stream,
- int recurse,
- const struct value *val,
-@@ -210,7 +210,7 @@ static const struct generic_val_print_de
- function; they are identical. */
-
- void
--f_val_print (struct type *type, int embedded_offset,
-+f_val_print (struct type *type, LONGEST embedded_offset,
- CORE_ADDR address, struct ui_file *stream, int recurse,
- struct value *original_value,
- const struct value_print_options *options)
-diff -Naurp insight-7.12.50.20170416.orig/gdb/gdbarch.c insight-7.12.50.20170416.new/gdb/gdbarch.c
---- insight-7.12.50.20170416.orig/gdb/gdbarch.c 2017-04-15 01:21:12.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/gdbarch.c 2017-04-16 12:29:51.475070549 +0100
-@@ -1806,7 +1806,7 @@ set_gdbarch_wchar_signed (struct gdbarch
- }
-
- const struct floatformat **
--gdbarch_floatformat_for_type (struct gdbarch *gdbarch, const char *name, int length)
-+gdbarch_floatformat_for_type (struct gdbarch *gdbarch, const char *name, LONGEST length)
- {
- gdb_assert (gdbarch != NULL);
- gdb_assert (gdbarch->floatformat_for_type != NULL);
-diff -Naurp insight-7.12.50.20170416.orig/gdb/gdbarch.h insight-7.12.50.20170416.new/gdb/gdbarch.h
---- insight-7.12.50.20170416.orig/gdb/gdbarch.h 2017-04-15 01:21:12.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/gdbarch.h 2017-04-16 12:29:51.475070549 +0100
-@@ -203,8 +203,8 @@ extern void set_gdbarch_wchar_signed (st
- NAME, if non-NULL, is the type name, which may be used to distinguish
- different target formats of the same length. */
-
--typedef const struct floatformat ** (gdbarch_floatformat_for_type_ftype) (struct gdbarch *gdbarch, const char *name, int length);
--extern const struct floatformat ** gdbarch_floatformat_for_type (struct gdbarch *gdbarch, const char *name, int length);
-+typedef const struct floatformat ** (gdbarch_floatformat_for_type_ftype) (struct gdbarch *gdbarch, const char *name, LONGEST length);
-+extern const struct floatformat ** gdbarch_floatformat_for_type (struct gdbarch *gdbarch, const char *name, LONGEST length);
- extern void set_gdbarch_floatformat_for_type (struct gdbarch *gdbarch, gdbarch_floatformat_for_type_ftype *floatformat_for_type);
-
- /* For most targets, a pointer on the target and its representation as an
-diff -Naurp insight-7.12.50.20170416.orig/gdb/gdbarch.sh insight-7.12.50.20170416.new/gdb/gdbarch.sh
---- insight-7.12.50.20170416.orig/gdb/gdbarch.sh 2017-04-15 01:21:12.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/gdbarch.sh 2017-04-16 12:29:51.476070559 +0100
-@@ -392,7 +392,7 @@ v:int:wchar_signed:::1:-1:1
- # Returns the floating-point format to be used for values of length LENGTH.
- # NAME, if non-NULL, is the type name, which may be used to distinguish
- # different target formats of the same length.
--m:const struct floatformat **:floatformat_for_type:const char *name, int length:name, length:0:default_floatformat_for_type::0
-+m:const struct floatformat **:floatformat_for_type:const char *name, LONGEST length:name, length:0:default_floatformat_for_type::0
-
- # For most targets, a pointer on the target and its representation as an
- # address in GDB have the same size and "look the same". For such a
-diff -Naurp insight-7.12.50.20170416.orig/gdb/gdbtypes.c insight-7.12.50.20170416.new/gdb/gdbtypes.c
---- insight-7.12.50.20170416.orig/gdb/gdbtypes.c 2017-04-15 01:21:12.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/gdbtypes.c 2017-04-16 12:29:51.453070345 +0100
-@@ -2756,7 +2756,7 @@ verify_floatformat (int bit, const struc
- least as long as OBJFILE. */
-
- struct type *
--init_type (struct objfile *objfile, enum type_code code, int length,
-+init_type (struct objfile *objfile, enum type_code code, LONGEST length,
- const char *name)
- {
- struct type *type;
-@@ -3065,8 +3065,8 @@ is_public_ancestor (struct type *base, s
-
- static int
- is_unique_ancestor_worker (struct type *base, struct type *dclass,
-- int *offset,
-- const gdb_byte *valaddr, int embedded_offset,
-+ LONGEST *offset,
-+ const gdb_byte *valaddr, LONGEST embedded_offset,
- CORE_ADDR address, struct value *val)
- {
- int i, count = 0;
-@@ -3077,7 +3077,7 @@ is_unique_ancestor_worker (struct type *
- for (i = 0; i < TYPE_N_BASECLASSES (dclass) && count < 2; ++i)
- {
- struct type *iter;
-- int this_offset;
-+ LONGEST this_offset;
-
- iter = check_typedef (TYPE_BASECLASS (dclass, i));
-
-@@ -3118,7 +3118,7 @@ is_unique_ancestor_worker (struct type *
- int
- is_unique_ancestor (struct type *base, struct value *val)
- {
-- int offset = -1;
-+ LONGEST offset = -1;
-
- return is_unique_ancestor_worker (base, value_type (val), &offset,
- value_contents_for_printing (val),
-@@ -4357,7 +4357,7 @@ recursive_dump_type (struct type *type,
- break;
- }
- puts_filtered ("\n");
-- printfi_filtered (spaces, "length %d\n", TYPE_LENGTH (type));
-+ printfi_filtered (spaces, "length %s\n", pulongest (TYPE_LENGTH (type)));
- if (TYPE_OBJFILE_OWNED (type))
- {
- printfi_filtered (spaces, "objfile ");
-@@ -4817,7 +4817,7 @@ copy_type (const struct type *type)
-
- struct type *
- arch_type (struct gdbarch *gdbarch,
-- enum type_code code, int length, const char *name)
-+ enum type_code code, LONGEST length, const char *name)
- {
- struct type *type;
-
-diff -Naurp insight-7.12.50.20170416.orig/gdb/gdbtypes.h insight-7.12.50.20170416.new/gdb/gdbtypes.h
---- insight-7.12.50.20170416.orig/gdb/gdbtypes.h 2017-04-16 12:29:02.689616746 +0100
-+++ insight-7.12.50.20170416.new/gdb/gdbtypes.h 2017-04-16 12:29:51.454070354 +0100
-@@ -784,7 +784,7 @@ struct type
- type_length_units function should be used in order to get the length
- expressed in target addressable memory units. */
-
-- unsigned int length;
-+ ULONGEST length;
-
- /* * Core type, shared by a group of qualified types. */
-
-@@ -1650,7 +1650,7 @@ extern unsigned int type_length_units (s
-
- /* * Helper function to construct objfile-owned types. */
-
--extern struct type *init_type (struct objfile *, enum type_code, int,
-+extern struct type *init_type (struct objfile *, enum type_code, LONGEST,
- const char *);
- extern struct type *init_integer_type (struct objfile *, int, int,
- const char *);
-@@ -1667,7 +1667,7 @@ extern struct type *init_pointer_type (s
- struct type *);
-
- /* Helper functions to construct architecture-owned types. */
--extern struct type *arch_type (struct gdbarch *, enum type_code, int,
-+extern struct type *arch_type (struct gdbarch *, enum type_code, LONGEST,
- const char *);
- extern struct type *arch_integer_type (struct gdbarch *, int, int,
- const char *);
-diff -Naurp insight-7.12.50.20170416.orig/gdb/gnu-v2-abi.c insight-7.12.50.20170416.new/gdb/gnu-v2-abi.c
---- insight-7.12.50.20170416.orig/gdb/gnu-v2-abi.c 2017-01-03 17:36:55.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/gnu-v2-abi.c 2017-04-16 12:29:51.455070363 +0100
-@@ -82,7 +82,7 @@ gnuv2_is_operator_name (const char *name
- TYPE is the type in which F is located. */
- static struct value *
- gnuv2_virtual_fn_field (struct value **arg1p, struct fn_field * f, int j,
-- struct type * type, int offset)
-+ struct type *type, LONGEST offset)
- {
- struct value *arg1 = *arg1p;
- struct type *type1 = check_typedef (value_type (arg1));
-@@ -338,7 +338,7 @@ vb_match (struct type *type, int index,
- target). The result is the offset of the baseclass value relative
- to (the address of)(ARG) + OFFSET. */
-
--static int
-+static LONGEST
- gnuv2_baseclass_offset (struct type *type, int index,
- const bfd_byte *valaddr, LONGEST embedded_offset,
- CORE_ADDR address, const struct value *val)
-@@ -358,8 +358,7 @@ gnuv2_baseclass_offset (struct type *typ
- if (vb_match (type, i, basetype))
- {
- struct type *field_type;
-- LONGEST field_offset;
-- int field_length;
-+ LONGEST field_offset, field_length;
- CORE_ADDR addr;
-
- field_type = check_typedef (TYPE_FIELD_TYPE (type, i));
-@@ -383,7 +382,7 @@ gnuv2_baseclass_offset (struct type *typ
- /* Don't go through baseclass_offset, as that wraps
- exceptions, thus, inner exceptions would be wrapped more
- than once. */
-- int boffset =
-+ LONGEST boffset =
- gnuv2_baseclass_offset (type, i, valaddr,
- embedded_offset, address, val);
-
-diff -Naurp insight-7.12.50.20170416.orig/gdb/gnu-v3-abi.c insight-7.12.50.20170416.new/gdb/gnu-v3-abi.c
---- insight-7.12.50.20170416.orig/gdb/gnu-v3-abi.c 2017-04-15 01:21:12.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/gnu-v3-abi.c 2017-04-16 12:29:51.455070363 +0100
-@@ -109,7 +109,7 @@ build_gdb_vtable_type (struct gdbarch *a
- {
- struct type *t;
- struct field *field_list, *field;
-- int offset;
-+ LONGEST offset;
-
- struct type *void_ptr_type
- = builtin_type (arch)->builtin_data_ptr;
-@@ -185,7 +185,7 @@ vtable_ptrdiff_type (struct gdbarch *gdb
- /* Return the offset from the start of the imaginary `struct
- gdb_gnu_v3_abi_vtable' object to the vtable's "address point"
- (i.e., where objects' virtual table pointers point). */
--static int
-+static LONGEST
- vtable_address_point_offset (struct gdbarch *gdbarch)
- {
- struct type *vtable_type
-@@ -408,7 +408,7 @@ gnuv3_get_virtual_fn (struct gdbarch *gd
- static struct value *
- gnuv3_virtual_fn_field (struct value **value_p,
- struct fn_field *f, int j,
-- struct type *vfn_base, int offset)
-+ struct type *vfn_base, LONGEST offset)
- {
- struct type *values_type = check_typedef (value_type (*value_p));
- struct gdbarch *gdbarch;
-@@ -438,7 +438,7 @@ gnuv3_virtual_fn_field (struct value **v
-
- -1 is returned on error. */
-
--static int
-+static LONGEST
- gnuv3_baseclass_offset (struct type *type, int index,
- const bfd_byte *valaddr, LONGEST embedded_offset,
- CORE_ADDR address, const struct value *val)
-@@ -447,7 +447,7 @@ gnuv3_baseclass_offset (struct type *typ
- struct type *ptr_type;
- struct value *vtable;
- struct value *vbase_array;
-- long int cur_base_offset, base_offset;
-+ LONGEST cur_base_offset, base_offset;
-
- /* Determine architecture. */
- gdbarch = get_type_arch (type);
-@@ -470,7 +470,7 @@ gnuv3_baseclass_offset (struct type *typ
- cur_base_offset = cur_base_offset + vtable_address_point_offset (gdbarch);
- if ((- cur_base_offset) % TYPE_LENGTH (ptr_type) != 0)
- error (_("Misaligned vbase offset."));
-- cur_base_offset = cur_base_offset / ((int) TYPE_LENGTH (ptr_type));
-+ cur_base_offset = cur_base_offset / ((LONGEST) TYPE_LENGTH (ptr_type));
-
- vtable = gnuv3_get_vtable (gdbarch, type, address + embedded_offset);
- gdb_assert (vtable != NULL);
-@@ -514,7 +514,7 @@ gnuv3_find_method_in (struct type *domai
- we're out of luck. */
- for (i = 0; i < TYPE_N_BASECLASSES (domain); i++)
- {
-- int pos;
-+ LONGEST pos;
- struct type *basetype;
-
- if (BASETYPE_VIA_VIRTUAL (domain, i))
-diff -Naurp insight-7.12.50.20170416.orig/gdb/go-lang.h insight-7.12.50.20170416.new/gdb/go-lang.h
---- insight-7.12.50.20170416.orig/gdb/go-lang.h 2017-04-09 01:11:01.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/go-lang.h 2017-04-16 12:29:51.456070373 +0100
-@@ -85,7 +85,7 @@ extern void go_print_type (struct type *
- /* Defined in go-valprint.c. */
-
- extern void go_val_print (struct type *type,
-- int embedded_offset, CORE_ADDR address,
-+ LONGEST embedded_offset, CORE_ADDR address,
- struct ui_file *stream, int recurse,
- struct value *val,
- const struct value_print_options *options);
-diff -Naurp insight-7.12.50.20170416.orig/gdb/go-valprint.c insight-7.12.50.20170416.new/gdb/go-valprint.c
---- insight-7.12.50.20170416.orig/gdb/go-valprint.c 2017-01-03 17:36:55.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/go-valprint.c 2017-04-16 12:29:51.456070373 +0100
-@@ -86,7 +86,7 @@ print_go_string (struct type *type,
- /* Implements the la_val_print routine for language Go. */
-
- void
--go_val_print (struct type *type, int embedded_offset,
-+go_val_print (struct type *type, LONGEST embedded_offset,
- CORE_ADDR address, struct ui_file *stream, int recurse,
- struct value *val,
- const struct value_print_options *options)
-diff -Naurp insight-7.12.50.20170416.orig/gdb/i386-tdep.c insight-7.12.50.20170416.new/gdb/i386-tdep.c
---- insight-7.12.50.20170416.orig/gdb/i386-tdep.c 2017-04-16 12:29:02.714616978 +0100
-+++ insight-7.12.50.20170416.new/gdb/i386-tdep.c 2017-04-16 12:29:51.477070568 +0100
-@@ -8180,7 +8180,7 @@ i386_fast_tracepoint_valid_at (struct gd
-
- const struct floatformat **
- i386_floatformat_for_type (struct gdbarch *gdbarch,
-- const char *name, int len)
-+ const char *name, LONGEST len)
- {
- if (len == 128 && name)
- if (strcmp (name, "__float128") == 0
-diff -Naurp insight-7.12.50.20170416.orig/gdb/language.c insight-7.12.50.20170416.new/gdb/language.c
---- insight-7.12.50.20170416.orig/gdb/language.c 2017-04-09 01:11:01.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/language.c 2017-04-16 12:29:51.456070373 +0100
-@@ -753,7 +753,7 @@ unk_lang_printchar (int c, struct type *
-
- static void
- unk_lang_printstr (struct ui_file *stream, struct type *type,
-- const gdb_byte *string, unsigned int length,
-+ const gdb_byte *string, ULONGEST length,
- const char *encoding, int force_ellipses,
- const struct value_print_options *options)
- {
-@@ -772,7 +772,7 @@ unk_lang_print_type (struct type *type,
-
- static void
- unk_lang_val_print (struct type *type,
-- int embedded_offset, CORE_ADDR address,
-+ LONGEST embedded_offset, CORE_ADDR address,
- struct ui_file *stream, int recurse,
- struct value *val,
- const struct value_print_options *options)
-diff -Naurp insight-7.12.50.20170416.orig/gdb/language.h insight-7.12.50.20170416.new/gdb/language.h
---- insight-7.12.50.20170416.orig/gdb/language.h 2017-04-09 01:11:01.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/language.h 2017-04-16 12:29:51.457070382 +0100
-@@ -197,7 +197,7 @@ struct language_defn
- struct ui_file * stream);
-
- void (*la_printstr) (struct ui_file * stream, struct type *elttype,
-- const gdb_byte *string, unsigned int length,
-+ const gdb_byte *string, ULONGEST length,
- const char *encoding, int force_ellipses,
- const struct value_print_options *);
-
-@@ -235,7 +235,7 @@ struct language_defn
- printing. */
-
- void (*la_val_print) (struct type *type,
-- int embedded_offset, CORE_ADDR address,
-+ LONGEST embedded_offset, CORE_ADDR address,
- struct ui_file *stream, int recurse,
- struct value *val,
- const struct value_print_options *options);
-diff -Naurp insight-7.12.50.20170416.orig/gdb/m2-lang.c insight-7.12.50.20170416.new/gdb/m2-lang.c
---- insight-7.12.50.20170416.orig/gdb/m2-lang.c 2017-01-03 17:36:55.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/m2-lang.c 2017-04-16 12:29:51.457070382 +0100
-@@ -104,10 +104,10 @@ m2_printchar (int c, struct type *type,
-
- static void
- m2_printstr (struct ui_file *stream, struct type *type, const gdb_byte *string,
-- unsigned int length, const char *encoding, int force_ellipses,
-+ ULONGEST length, const char *encoding, int force_ellipses,
- const struct value_print_options *options)
- {
-- unsigned int i;
-+ ULONGEST i;
- unsigned int things_printed = 0;
- int in_quotes = 0;
- int need_comma = 0;
-@@ -122,9 +122,9 @@ m2_printstr (struct ui_file *stream, str
- {
- /* Position of the character we are examining
- to see whether it is repeated. */
-- unsigned int rep1;
-+ ULONGEST rep1;
- /* Number of repetitions we have detected so far. */
-- unsigned int reps;
-+ ULONGEST reps;
-
- QUIT;
-
-@@ -150,7 +150,7 @@ m2_printstr (struct ui_file *stream, str
- in_quotes = 0;
- }
- m2_printchar (string[i], type, stream);
-- fprintf_filtered (stream, " <repeats %u times>", reps);
-+ fprintf_filtered (stream, " <repeats %s times>", pulongest (reps));
- i = rep1 - 1;
- things_printed += options->repeat_count_threshold;
- need_comma = 1;
-diff -Naurp insight-7.12.50.20170416.orig/gdb/m2-lang.h insight-7.12.50.20170416.new/gdb/m2-lang.h
---- insight-7.12.50.20170416.orig/gdb/m2-lang.h 2017-04-09 01:11:01.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/m2-lang.h 2017-04-16 12:29:51.457070382 +0100
-@@ -34,7 +34,7 @@ extern void m2_print_typedef (struct typ
- extern int m2_is_long_set (struct type *type);
- extern int m2_is_unbounded_array (struct type *type);
-
--extern void m2_val_print (struct type *, int, CORE_ADDR,
-+extern void m2_val_print (struct type *, LONGEST, CORE_ADDR,
- struct ui_file *, int,
- struct value *,
- const struct value_print_options *);
-diff -Naurp insight-7.12.50.20170416.orig/gdb/m2-typeprint.c insight-7.12.50.20170416.new/gdb/m2-typeprint.c
---- insight-7.12.50.20170416.orig/gdb/m2-typeprint.c 2017-01-03 17:36:55.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/m2-typeprint.c 2017-04-16 12:29:51.457070382 +0100
-@@ -234,9 +234,12 @@ static void m2_array (struct type *type,
- m2_print_bounds (TYPE_INDEX_TYPE (type), stream, show, -1, 1);
- }
- else
-- fprintf_filtered (stream, "%d",
-- (TYPE_LENGTH (type)
-- / TYPE_LENGTH (TYPE_TARGET_TYPE (type))));
-+ {
-+ ULONGEST val = (TYPE_LENGTH (type)
-+ / TYPE_LENGTH (TYPE_TARGET_TYPE (type)));
-+
-+ fprintf_filtered (stream, "%s", pulongest (val));
-+ }
- }
- fprintf_filtered (stream, "] OF ");
- m2_print_type (TYPE_TARGET_TYPE (type), "", stream, show, level, flags);
-diff -Naurp insight-7.12.50.20170416.orig/gdb/m2-valprint.c insight-7.12.50.20170416.new/gdb/m2-valprint.c
---- insight-7.12.50.20170416.orig/gdb/m2-valprint.c 2017-01-03 17:36:55.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/m2-valprint.c 2017-04-16 12:29:51.457070382 +0100
-@@ -35,7 +35,7 @@ static int print_unpacked_pointer (struc
- struct ui_file *stream);
- static void
- m2_print_array_contents (struct type *type, const gdb_byte *valaddr,
-- int embedded_offset, CORE_ADDR address,
-+ LONGEST embedded_offset, CORE_ADDR address,
- struct ui_file *stream, int recurse,
- struct value *val,
- const struct value_print_options *options,
-@@ -67,7 +67,7 @@ get_long_set_bounds (struct type *type,
-
- static void
- m2_print_long_set (struct type *type, const gdb_byte *valaddr,
-- int embedded_offset, CORE_ADDR address,
-+ LONGEST embedded_offset, CORE_ADDR address,
- struct ui_file *stream)
- {
- int empty_set = 1;
-@@ -158,7 +158,7 @@ m2_print_long_set (struct type *type, co
-
- static void
- m2_print_unbounded_array (struct type *type, const gdb_byte *valaddr,
-- int embedded_offset, CORE_ADDR address,
-+ LONGEST embedded_offset, CORE_ADDR address,
- struct ui_file *stream, int recurse,
- const struct value_print_options *options)
- {
-@@ -260,7 +260,7 @@ print_variable_at_address (struct type *
-
- static void
- m2_print_array_contents (struct type *type, const gdb_byte *valaddr,
-- int embedded_offset, CORE_ADDR address,
-+ LONGEST embedded_offset, CORE_ADDR address,
- struct ui_file *stream, int recurse,
- struct value *val,
- const struct value_print_options *options,
-@@ -308,13 +308,13 @@ static const struct generic_val_print_de
- function; they are identical. */
-
- void
--m2_val_print (struct type *type, int embedded_offset,
-+m2_val_print (struct type *type, LONGEST embedded_offset,
- CORE_ADDR address, struct ui_file *stream, int recurse,
- struct value *original_value,
- const struct value_print_options *options)
- {
- struct gdbarch *gdbarch = get_type_arch (type);
-- unsigned len;
-+ ULONGEST len;
- struct type *elttype;
- CORE_ADDR addr;
- const gdb_byte *valaddr = value_contents_for_printing (original_value);
-@@ -340,7 +340,7 @@ m2_val_print (struct type *type, int emb
- elements up to it. */
- if (options->stop_print_at_null)
- {
-- unsigned int temp_len;
-+ ULONGEST temp_len;
-
- /* Look for a NULL char. */
- for (temp_len = 0;
-@@ -416,7 +416,7 @@ m2_val_print (struct type *type, int emb
- {
- struct type *range = elttype;
- LONGEST low_bound, high_bound;
-- int i;
-+ LONGEST i;
- int need_comma = 0;
-
- fputs_filtered ("{", stream);
-diff -Naurp insight-7.12.50.20170416.orig/gdb/memrange.c insight-7.12.50.20170416.new/gdb/memrange.c
---- insight-7.12.50.20170416.orig/gdb/memrange.c 2017-01-03 17:36:55.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/memrange.c 2017-04-16 12:29:51.457070382 +0100
-@@ -22,8 +22,8 @@
- #include <algorithm>
-
- int
--mem_ranges_overlap (CORE_ADDR start1, int len1,
-- CORE_ADDR start2, int len2)
-+mem_ranges_overlap (CORE_ADDR start1, LONGEST len1,
-+ CORE_ADDR start2, LONGEST len2)
- {
- ULONGEST h, l;
-
-diff -Naurp insight-7.12.50.20170416.orig/gdb/memrange.h insight-7.12.50.20170416.new/gdb/memrange.h
---- insight-7.12.50.20170416.orig/gdb/memrange.h 2017-01-03 17:36:55.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/memrange.h 2017-04-16 12:29:51.458070391 +0100
-@@ -30,7 +30,7 @@ struct mem_range
- CORE_ADDR start;
-
- /* Length of the range. */
-- int length;
-+ LONGEST length;
- };
-
- typedef struct mem_range mem_range_s;
-@@ -40,8 +40,8 @@ DEF_VEC_O(mem_range_s);
- /* Returns true if the ranges defined by [start1, start1+len1) and
- [start2, start2+len2) overlap. */
-
--extern int mem_ranges_overlap (CORE_ADDR start1, int len1,
-- CORE_ADDR start2, int len2);
-+extern int mem_ranges_overlap (CORE_ADDR start1, LONGEST len1,
-+ CORE_ADDR start2, LONGEST len2);
-
- /* Returns true if ADDR is in RANGE. */
-
-diff -Naurp insight-7.12.50.20170416.orig/gdb/mips-linux-nat.c insight-7.12.50.20170416.new/gdb/mips-linux-nat.c
---- insight-7.12.50.20170416.orig/gdb/mips-linux-nat.c 2017-03-25 10:42:37.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/mips-linux-nat.c 2017-04-16 12:29:51.458070391 +0100
-@@ -584,7 +584,7 @@ mips_linux_stopped_data_address (struct
-
- static int
- mips_linux_region_ok_for_hw_watchpoint (struct target_ops *self,
-- CORE_ADDR addr, int len)
-+ CORE_ADDR addr, LONGEST len)
- {
- struct pt_watch_regs dummy_regs;
- int i;
-diff -Naurp insight-7.12.50.20170416.orig/gdb/nat/x86-dregs.c insight-7.12.50.20170416.new/gdb/nat/x86-dregs.c
---- insight-7.12.50.20170416.orig/gdb/nat/x86-dregs.c 2017-01-03 17:36:55.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/nat/x86-dregs.c 2017-04-16 12:29:51.473070531 +0100
-@@ -384,7 +384,7 @@ x86_remove_aligned_watchpoint (struct x8
-
- static int
- x86_handle_nonaligned_watchpoint (struct x86_debug_reg_state *state,
-- x86_wp_op_t what, CORE_ADDR addr, int len,
-+ x86_wp_op_t what, CORE_ADDR addr, LONGEST len,
- enum target_hw_bp_type type)
- {
- int retval = 0;
-@@ -552,7 +552,7 @@ x86_dr_remove_watchpoint (struct x86_deb
-
- int
- x86_dr_region_ok_for_watchpoint (struct x86_debug_reg_state *state,
-- CORE_ADDR addr, int len)
-+ CORE_ADDR addr, LONGEST len)
- {
- int nregs;
-
-diff -Naurp insight-7.12.50.20170416.orig/gdb/nat/x86-dregs.h insight-7.12.50.20170416.new/gdb/nat/x86-dregs.h
---- insight-7.12.50.20170416.orig/gdb/nat/x86-dregs.h 2017-01-03 17:36:55.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/nat/x86-dregs.h 2017-04-16 12:29:51.473070531 +0100
-@@ -116,7 +116,7 @@ extern int x86_dr_remove_watchpoint (str
- /* Return non-zero if we can watch a memory region that starts at
- address ADDR and whose length is LEN bytes. */
- extern int x86_dr_region_ok_for_watchpoint (struct x86_debug_reg_state *state,
-- CORE_ADDR addr, int len);
-+ CORE_ADDR addr, LONGEST len);
-
- /* If the inferior has some break/watchpoint that triggered, set the
- address associated with that break/watchpoint and return true.
-diff -Naurp insight-7.12.50.20170416.orig/gdb/opencl-lang.c insight-7.12.50.20170416.new/gdb/opencl-lang.c
---- insight-7.12.50.20170416.orig/gdb/opencl-lang.c 2017-01-03 17:36:55.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/opencl-lang.c 2017-04-16 12:29:51.458070391 +0100
-@@ -78,11 +78,11 @@ builtin_opencl_type (struct gdbarch *gdb
-
- static struct type *
- lookup_opencl_vector_type (struct gdbarch *gdbarch, enum type_code code,
-- unsigned int el_length, unsigned int flag_unsigned,
-+ ULONGEST el_length, unsigned int flag_unsigned,
- int n)
- {
- int i;
-- unsigned int length;
-+ ULONGEST length;
- struct type *type = NULL;
- struct type **types = builtin_opencl_type (gdbarch);
-
-@@ -174,7 +174,7 @@ lval_func_read (struct value *v)
- struct type *eltype = TYPE_TARGET_TYPE (check_typedef (value_type (c->val)));
- LONGEST offset = value_offset (v);
- LONGEST elsize = TYPE_LENGTH (eltype);
-- int n, i, j = 0;
-+ LONGEST n, i, j = 0;
- LONGEST lowb = 0;
- LONGEST highb = 0;
-
-@@ -203,7 +203,7 @@ lval_func_write (struct value *v, struct
- struct type *eltype = TYPE_TARGET_TYPE (check_typedef (value_type (c->val)));
- LONGEST offset = value_offset (v);
- LONGEST elsize = TYPE_LENGTH (eltype);
-- int n, i, j = 0;
-+ LONGEST n, i, j = 0;
- LONGEST lowb = 0;
- LONGEST highb = 0;
-
-@@ -243,17 +243,17 @@ lval_func_write (struct value *v, struct
-
- static int
- lval_func_check_synthetic_pointer (const struct value *v,
-- LONGEST offset, int length)
-+ LONGEST offset, LONGEST length)
- {
- struct lval_closure *c = (struct lval_closure *) value_computed_closure (v);
- /* Size of the target type in bits. */
-- int elsize =
-+ LONGEST elsize =
- TYPE_LENGTH (TYPE_TARGET_TYPE (check_typedef (value_type (c->val)))) * 8;
-- int startrest = offset % elsize;
-- int start = offset / elsize;
-- int endrest = (offset + length) % elsize;
-- int end = (offset + length) / elsize;
-- int i;
-+ LONGEST startrest = offset % elsize;
-+ LONGEST start = offset / elsize;
-+ LONGEST endrest = (offset + length) % elsize;
-+ LONGEST end = (offset + length) / elsize;
-+ LONGEST i;
-
- if (endrest)
- end++;
-@@ -263,8 +263,8 @@ lval_func_check_synthetic_pointer (const
-
- for (i = start; i < end; i++)
- {
-- int comp_offset = (i == start) ? startrest : 0;
-- int comp_length = (i == end) ? endrest : elsize;
-+ LONGEST comp_offset = (i == start) ? startrest : 0;
-+ LONGEST comp_length = (i == end) ? endrest : elsize;
-
- if (!value_bits_synthetic_pointer (c->val,
- c->indices[i] * elsize + comp_offset,
-diff -Naurp insight-7.12.50.20170416.orig/gdb/p-lang.c insight-7.12.50.20170416.new/gdb/p-lang.c
---- insight-7.12.50.20170416.orig/gdb/p-lang.c 2017-01-03 17:36:55.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/p-lang.c 2017-04-16 12:29:51.458070391 +0100
-@@ -95,8 +95,8 @@ pascal_main_name (void)
- are not multiple of TARGET_CHAR_BIT then the results are wrong
- but this does not happen for Free Pascal nor for GPC. */
- int
--is_pascal_string_type (struct type *type,int *length_pos,
-- int *length_size, int *string_pos,
-+is_pascal_string_type (struct type *type, LONGEST *length_pos,
-+ LONGEST *length_size, LONGEST *string_pos,
- struct type **char_type,
- const char **arrayname)
- {
-@@ -216,12 +216,12 @@ pascal_printchar (int c, struct type *ty
-
- void
- pascal_printstr (struct ui_file *stream, struct type *type,
-- const gdb_byte *string, unsigned int length,
-+ const gdb_byte *string, ULONGEST length,
- const char *encoding, int force_ellipses,
- const struct value_print_options *options)
- {
- enum bfd_endian byte_order = gdbarch_byte_order (get_type_arch (type));
-- unsigned int i;
-+ ULONGEST i;
- unsigned int things_printed = 0;
- int in_quotes = 0;
- int need_comma = 0;
-@@ -249,9 +249,9 @@ pascal_printstr (struct ui_file *stream,
- {
- /* Position of the character we are examining
- to see whether it is repeated. */
-- unsigned int rep1;
-+ ULONGEST rep1;
- /* Number of repetitions we have detected so far. */
-- unsigned int reps;
-+ ULONGEST reps;
- unsigned long int current_char;
-
- QUIT;
-@@ -283,7 +283,7 @@ pascal_printstr (struct ui_file *stream,
- in_quotes = 0;
- }
- pascal_printchar (current_char, type, stream);
-- fprintf_filtered (stream, " <repeats %u times>", reps);
-+ fprintf_filtered (stream, " <repeats %s times>", pulongest (reps));
- i = rep1 - 1;
- things_printed += options->repeat_count_threshold;
- need_comma = 1;
-diff -Naurp insight-7.12.50.20170416.orig/gdb/p-lang.h insight-7.12.50.20170416.new/gdb/p-lang.h
---- insight-7.12.50.20170416.orig/gdb/p-lang.h 2017-04-09 01:11:01.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/p-lang.h 2017-04-16 12:29:51.458070391 +0100
-@@ -36,7 +36,7 @@ extern void pascal_print_type (struct ty
- extern void pascal_print_typedef (struct type *, struct symbol *,
- struct ui_file *);
-
--extern void pascal_val_print (struct type *, int,
-+extern void pascal_val_print (struct type *, LONGEST,
- CORE_ADDR, struct ui_file *, int,
- struct value *,
- const struct value_print_options *);
-@@ -50,13 +50,13 @@ extern void pascal_type_print_method_arg
- /* These are in p-lang.c: */
-
- extern int
-- is_pascal_string_type (struct type *, int *, int *, int *,
-+ is_pascal_string_type (struct type *, LONGEST *, LONGEST *, LONGEST *,
- struct type **, const char **);
-
- extern void pascal_printchar (int, struct type *, struct ui_file *);
-
- extern void pascal_printstr (struct ui_file *, struct type *, const gdb_byte *,
-- unsigned int, const char *, int,
-+ ULONGEST, const char *, int,
- const struct value_print_options *);
-
- extern struct type **const (pascal_builtin_types[]);
-diff -Naurp insight-7.12.50.20170416.orig/gdb/ppc-linux-nat.c insight-7.12.50.20170416.new/gdb/ppc-linux-nat.c
---- insight-7.12.50.20170416.orig/gdb/ppc-linux-nat.c 2017-03-25 10:42:37.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/ppc-linux-nat.c 2017-04-16 12:29:51.459070401 +0100
-@@ -1445,7 +1445,7 @@ ppc_linux_can_use_hw_breakpoint (struct
-
- static int
- ppc_linux_region_ok_for_hw_watchpoint (struct target_ops *self,
-- CORE_ADDR addr, int len)
-+ CORE_ADDR addr, LONGEST len)
- {
- /* Handle sub-8-byte quantities. */
- if (len <= 0)
-diff -Naurp insight-7.12.50.20170416.orig/gdb/ppc-linux-tdep.c insight-7.12.50.20170416.new/gdb/ppc-linux-tdep.c
---- insight-7.12.50.20170416.orig/gdb/ppc-linux-tdep.c 2017-01-03 17:36:55.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/ppc-linux-tdep.c 2017-04-16 12:29:51.478070577 +0100
-@@ -1632,7 +1632,7 @@ ppc_init_linux_record_tdep (struct linux
-
- const struct floatformat **
- ppc_floatformat_for_type (struct gdbarch *gdbarch,
-- const char *name, int len)
-+ const char *name, LONGEST len)
- {
- if (len == 128 && name)
- if (strcmp (name, "__float128") == 0
-diff -Naurp insight-7.12.50.20170416.orig/gdb/printcmd.c insight-7.12.50.20170416.new/gdb/printcmd.c
---- insight-7.12.50.20170416.orig/gdb/printcmd.c 2017-04-16 12:29:02.709616932 +0100
-+++ insight-7.12.50.20170416.new/gdb/printcmd.c 2017-04-16 12:29:51.460070410 +0100
-@@ -280,7 +280,7 @@ print_formatted (struct value *val, int
- struct ui_file *stream)
- {
- struct type *type = check_typedef (value_type (val));
-- int len = TYPE_LENGTH (type);
-+ LONGEST len = TYPE_LENGTH (type);
-
- if (VALUE_LVAL (val) == lval_memory)
- next_address = value_address (val) + len;
-@@ -357,7 +357,7 @@ print_scalar_formatted (const gdb_byte *
- {
- struct gdbarch *gdbarch = get_type_arch (type);
- LONGEST val_long = 0;
-- unsigned int len = TYPE_LENGTH (type);
-+ ULONGEST len = TYPE_LENGTH (type);
- enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
-
- /* String printing should go through val_print_scalar_formatted. */
-diff -Naurp insight-7.12.50.20170416.orig/gdb/procfs.c insight-7.12.50.20170416.new/gdb/procfs.c
---- insight-7.12.50.20170416.orig/gdb/procfs.c 2017-04-15 01:21:12.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/procfs.c 2017-04-16 12:29:51.461070419 +0100
-@@ -4864,7 +4864,7 @@ procfs_remove_watchpoint (struct target_
-
- static int
- procfs_region_ok_for_hw_watchpoint (struct target_ops *self,
-- CORE_ADDR addr, int len)
-+ CORE_ADDR addr, LONGEST len)
- {
- /* The man page for proc(4) on Solaris 2.6 and up says that the
- system can support "thousands" of hardware watchpoints, but gives
-diff -Naurp insight-7.12.50.20170416.orig/gdb/p-valprint.c insight-7.12.50.20170416.new/gdb/p-valprint.c
---- insight-7.12.50.20170416.orig/gdb/p-valprint.c 2017-01-03 17:36:55.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/p-valprint.c 2017-04-16 12:29:51.459070401 +0100
-@@ -59,7 +59,7 @@ static const struct generic_val_print_de
-
- void
- pascal_val_print (struct type *type,
-- int embedded_offset, CORE_ADDR address,
-+ LONGEST embedded_offset, CORE_ADDR address,
- struct ui_file *stream, int recurse,
- struct value *original_value,
- const struct value_print_options *options)
-@@ -70,8 +70,8 @@ pascal_val_print (struct type *type,
- unsigned len;
- LONGEST low_bound, high_bound;
- struct type *elttype;
-- unsigned eltlen;
-- int length_pos, length_size, string_pos;
-+ ULONGEST eltlen;
-+ LONGEST length_pos, length_size, string_pos;
- struct type *char_type;
- CORE_ADDR addr;
- int want_space = 0;
-diff -Naurp insight-7.12.50.20170416.orig/gdb/regcache.c insight-7.12.50.20170416.new/gdb/regcache.c
---- insight-7.12.50.20170416.orig/gdb/regcache.c 2017-03-25 10:42:37.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/regcache.c 2017-04-16 12:29:51.461070419 +0100
-@@ -988,7 +988,7 @@ typedef void (regcache_write_ftype) (str
-
- static enum register_status
- regcache_xfer_part (struct regcache *regcache, int regnum,
-- int offset, int len, void *in, const void *out,
-+ LONGEST offset, LONGEST len, void *in, const void *out,
- enum register_status (*read) (struct regcache *regcache,
- int regnum,
- gdb_byte *buf),
-@@ -1033,7 +1033,7 @@ regcache_xfer_part (struct regcache *reg
-
- enum register_status
- regcache_raw_read_part (struct regcache *regcache, int regnum,
-- int offset, int len, gdb_byte *buf)
-+ int offset, LONGEST len, gdb_byte *buf)
- {
- struct regcache_descr *descr = regcache->descr;
-
-@@ -1044,7 +1044,7 @@ regcache_raw_read_part (struct regcache
-
- void
- regcache_raw_write_part (struct regcache *regcache, int regnum,
-- int offset, int len, const gdb_byte *buf)
-+ int offset, LONGEST len, const gdb_byte *buf)
- {
- struct regcache_descr *descr = regcache->descr;
-
-@@ -1055,7 +1055,7 @@ regcache_raw_write_part (struct regcache
-
- enum register_status
- regcache_cooked_read_part (struct regcache *regcache, int regnum,
-- int offset, int len, gdb_byte *buf)
-+ LONGEST offset, LONGEST len, gdb_byte *buf)
- {
- struct regcache_descr *descr = regcache->descr;
-
-@@ -1066,7 +1066,7 @@ regcache_cooked_read_part (struct regcac
-
- void
- regcache_cooked_write_part (struct regcache *regcache, int regnum,
-- int offset, int len, const gdb_byte *buf)
-+ LONGEST offset, LONGEST len, const gdb_byte *buf)
- {
- struct regcache_descr *descr = regcache->descr;
-
-diff -Naurp insight-7.12.50.20170416.orig/gdb/regcache.h insight-7.12.50.20170416.new/gdb/regcache.h
---- insight-7.12.50.20170416.orig/gdb/regcache.h 2017-03-25 10:42:37.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/regcache.h 2017-04-16 12:29:51.462070429 +0100
-@@ -94,9 +94,9 @@ extern void regcache_raw_set_cached_valu
-
- extern enum register_status
- regcache_raw_read_part (struct regcache *regcache, int regnum,
-- int offset, int len, gdb_byte *buf);
-+ int offset, LONGEST len, gdb_byte *buf);
- void regcache_raw_write_part (struct regcache *regcache, int regnum,
-- int offset, int len, const gdb_byte *buf);
-+ int offset, LONGEST len, const gdb_byte *buf);
-
- void regcache_invalidate (struct regcache *regcache, int regnum);
-
-@@ -133,10 +133,11 @@ extern void regcache_cooked_write_unsign
- write style operations. */
-
- enum register_status regcache_cooked_read_part (struct regcache *regcache,
-- int regnum, int offset,
-- int len, gdb_byte *buf);
-+ int regnum, LONGEST offset,
-+ LONGEST len, gdb_byte *buf);
- void regcache_cooked_write_part (struct regcache *regcache, int regnum,
-- int offset, int len, const gdb_byte *buf);
-+ LONGEST offset, LONGEST len,
-+ const gdb_byte *buf);
-
- /* Special routines to read/write the PC. */
-
-diff -Naurp insight-7.12.50.20170416.orig/gdb/remote.c insight-7.12.50.20170416.new/gdb/remote.c
---- insight-7.12.50.20170416.orig/gdb/remote.c 2017-04-15 01:21:12.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/remote.c 2017-04-16 12:29:51.464070447 +0100
-@@ -9915,7 +9915,7 @@ int remote_hw_breakpoint_limit = -1;
-
- static int
- remote_region_ok_for_hw_watchpoint (struct target_ops *self,
-- CORE_ADDR addr, int len)
-+ CORE_ADDR addr, LONGEST len)
- {
- if (remote_hw_watchpoint_length_limit == 0)
- return 0;
-diff -Naurp insight-7.12.50.20170416.orig/gdb/rust-lang.c insight-7.12.50.20170416.new/gdb/rust-lang.c
---- insight-7.12.50.20170416.orig/gdb/rust-lang.c 2017-04-09 01:11:01.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/rust-lang.c 2017-04-16 12:29:51.473070531 +0100
-@@ -439,7 +439,7 @@ rust_printchar (int c, struct type *type
-
- static void
- rust_printstr (struct ui_file *stream, struct type *type,
-- const gdb_byte *string, unsigned int length,
-+ const gdb_byte *string, ULONGEST length,
- const char *user_encoding, int force_ellipses,
- const struct value_print_options *options)
- {
-@@ -563,7 +563,7 @@ static const struct generic_val_print_de
- /* la_val_print implementation for Rust. */
-
- static void
--rust_val_print (struct type *type, int embedded_offset,
-+rust_val_print (struct type *type, LONGEST embedded_offset,
- CORE_ADDR address, struct ui_file *stream, int recurse,
- struct value *val,
- const struct value_print_options *options)
-diff -Naurp insight-7.12.50.20170416.orig/gdb/s390-linux-nat.c insight-7.12.50.20170416.new/gdb/s390-linux-nat.c
---- insight-7.12.50.20170416.orig/gdb/s390-linux-nat.c 2017-03-25 10:42:37.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/s390-linux-nat.c 2017-04-16 12:29:51.471070512 +0100
-@@ -900,7 +900,7 @@ s390_remove_hw_breakpoint (struct target
-
- static int
- s390_region_ok_for_hw_watchpoint (struct target_ops *self,
-- CORE_ADDR addr, int cnt)
-+ CORE_ADDR addr, LONGEST cnt)
- {
- return 1;
- }
-diff -Naurp insight-7.12.50.20170416.orig/gdb/spu-multiarch.c insight-7.12.50.20170416.new/gdb/spu-multiarch.c
---- insight-7.12.50.20170416.orig/gdb/spu-multiarch.c 2017-03-25 10:42:37.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/spu-multiarch.c 2017-04-16 12:29:51.464070447 +0100
-@@ -127,7 +127,7 @@ spu_thread_architecture (struct target_o
- /* Override the to_region_ok_for_hw_watchpoint routine. */
- static int
- spu_region_ok_for_hw_watchpoint (struct target_ops *self,
-- CORE_ADDR addr, int len)
-+ CORE_ADDR addr, LONGEST len)
- {
- struct target_ops *ops_beneath = find_target_beneath (self);
-
-diff -Naurp insight-7.12.50.20170416.orig/gdb/stack.c insight-7.12.50.20170416.new/gdb/stack.c
---- insight-7.12.50.20170416.orig/gdb/stack.c 2017-03-04 04:09:18.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/stack.c 2017-04-16 12:29:51.465070457 +0100
-@@ -189,7 +189,7 @@ print_stack_frame (struct frame_info *fr
- argument (not just the first nameless argument). */
-
- static void
--print_frame_nameless_args (struct frame_info *frame, long start, int num,
-+print_frame_nameless_args (struct frame_info *frame, LONGEST start, int num,
- int first, struct ui_file *stream)
- {
- struct gdbarch *gdbarch = get_frame_arch (frame);
-@@ -546,7 +546,7 @@ print_frame_args (struct symbol *func, s
- /* Offset of next stack argument beyond the one we have seen that is
- at the highest offset, or -1 if we haven't come to a stack
- argument yet. */
-- long highest_offset = -1;
-+ LONGEST highest_offset = -1;
- /* Number of ints of arguments that we have printed so far. */
- int args_printed = 0;
- /* True if we should print arguments, false otherwise. */
-@@ -575,8 +575,8 @@ print_frame_args (struct symbol *func, s
- case LOC_ARG:
- case LOC_REF_ARG:
- {
-- long current_offset = SYMBOL_VALUE (sym);
-- int arg_size = TYPE_LENGTH (SYMBOL_TYPE (sym));
-+ LONGEST current_offset = SYMBOL_VALUE (sym);
-+ LONGEST arg_size = TYPE_LENGTH (SYMBOL_TYPE (sym));
-
- /* Compute address of next argument by adding the size of
- this argument and rounding to an int boundary. */
-@@ -711,7 +711,7 @@ print_frame_args (struct symbol *func, s
- enough about the stack to find them. */
- if (num != -1)
- {
-- long start;
-+ LONGEST start;
-
- if (highest_offset == -1)
- start = gdbarch_frame_args_skip (get_frame_arch (frame));
-diff -Naurp insight-7.12.50.20170416.orig/gdb/symmisc.c insight-7.12.50.20170416.new/gdb/symmisc.c
---- insight-7.12.50.20170416.orig/gdb/symmisc.c 2017-03-04 04:09:18.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/symmisc.c 2017-04-16 12:29:51.465070457 +0100
-@@ -604,11 +604,11 @@ print_symbol (void *args)
-
- case LOC_CONST_BYTES:
- {
-- unsigned i;
-+ ULONGEST i;
- struct type *type = check_typedef (SYMBOL_TYPE (symbol));
-
-- fprintf_filtered (outfile, "const %u hex bytes:",
-- TYPE_LENGTH (type));
-+ fprintf_filtered (outfile, "const %s hex bytes:",
-+ pulongest (TYPE_LENGTH (type)));
- for (i = 0; i < TYPE_LENGTH (type); i++)
- fprintf_filtered (outfile, " %02x",
- (unsigned) SYMBOL_VALUE_BYTES (symbol)[i]);
-diff -Naurp insight-7.12.50.20170416.orig/gdb/target.c insight-7.12.50.20170416.new/gdb/target.c
---- insight-7.12.50.20170416.orig/gdb/target.c 2017-04-09 01:11:01.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/target.c 2017-04-16 12:29:51.465070457 +0100
-@@ -57,7 +57,7 @@ static int default_watchpoint_addr_withi
- CORE_ADDR, CORE_ADDR, int);
-
- static int default_region_ok_for_hw_watchpoint (struct target_ops *,
-- CORE_ADDR, int);
-+ CORE_ADDR, LONGEST);
-
- static void default_rcmd (struct target_ops *, const char *, struct ui_file *);
-
-@@ -3228,7 +3228,7 @@ target_fileio_read_stralloc (struct infe
-
- static int
- default_region_ok_for_hw_watchpoint (struct target_ops *self,
-- CORE_ADDR addr, int len)
-+ CORE_ADDR addr, LONGEST len)
- {
- return (len <= gdbarch_ptr_bit (target_gdbarch ()) / TARGET_CHAR_BIT);
- }
-diff -Naurp insight-7.12.50.20170416.orig/gdb/target-delegates.c insight-7.12.50.20170416.new/gdb/target-delegates.c
---- insight-7.12.50.20170416.orig/gdb/target-delegates.c 2017-04-09 01:11:01.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/target-delegates.c 2017-04-16 12:29:51.472070521 +0100
-@@ -760,14 +760,14 @@ debug_watchpoint_addr_within_range (stru
- }
-
- static int
--delegate_region_ok_for_hw_watchpoint (struct target_ops *self, CORE_ADDR arg1, int arg2)
-+delegate_region_ok_for_hw_watchpoint (struct target_ops *self, CORE_ADDR arg1, LONGEST arg2)
- {
- self = self->beneath;
- return self->to_region_ok_for_hw_watchpoint (self, arg1, arg2);
- }
-
- static int
--debug_region_ok_for_hw_watchpoint (struct target_ops *self, CORE_ADDR arg1, int arg2)
-+debug_region_ok_for_hw_watchpoint (struct target_ops *self, CORE_ADDR arg1, LONGEST arg2)
- {
- int result;
- fprintf_unfiltered (gdb_stdlog, "-> %s->to_region_ok_for_hw_watchpoint (...)\n", debug_target.to_shortname);
-@@ -777,7 +777,7 @@ debug_region_ok_for_hw_watchpoint (struc
- fputs_unfiltered (", ", gdb_stdlog);
- target_debug_print_CORE_ADDR (arg1);
- fputs_unfiltered (", ", gdb_stdlog);
-- target_debug_print_int (arg2);
-+ target_debug_print_LONGEST (arg2);
- fputs_unfiltered (") = ", gdb_stdlog);
- target_debug_print_int (result);
- fputs_unfiltered ("\n", gdb_stdlog);
-diff -Naurp insight-7.12.50.20170416.orig/gdb/target.h insight-7.12.50.20170416.new/gdb/target.h
---- insight-7.12.50.20170416.orig/gdb/target.h 2017-04-16 12:29:02.782617611 +0100
-+++ insight-7.12.50.20170416.new/gdb/target.h 2017-04-16 12:29:51.466070466 +0100
-@@ -555,7 +555,7 @@ struct target_ops
- /* Documentation of this routine is provided with the corresponding
- target_* macro. */
- int (*to_region_ok_for_hw_watchpoint) (struct target_ops *,
-- CORE_ADDR, int)
-+ CORE_ADDR, LONGEST)
- TARGET_DEFAULT_FUNC (default_region_ok_for_hw_watchpoint);
-
- int (*to_can_accel_watchpoint_condition) (struct target_ops *,
-diff -Naurp insight-7.12.50.20170416.orig/gdb/tracepoint.c insight-7.12.50.20170416.new/gdb/tracepoint.c
---- insight-7.12.50.20170416.orig/gdb/tracepoint.c 2017-04-15 01:21:12.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/tracepoint.c 2017-04-16 12:29:51.467070475 +0100
-@@ -904,10 +904,10 @@ collection_list::add_register (unsigned
- void
- collection_list::add_memrange (struct gdbarch *gdbarch,
- int type, bfd_signed_vma base,
-- unsigned long len)
-+ ULONGEST len)
- {
- if (info_verbose)
-- printf_filtered ("(%d,%s,%ld)\n", type, paddress (gdbarch, base), len);
-+ printf_filtered ("(%d,%s,%s)\n", type, paddress (gdbarch, base), pulongest (len));
-
- /* type: memrange_absolute == memory, other n == basereg */
- /* base: addr if memory, offset if reg relative. */
-@@ -927,7 +927,7 @@ collection_list::collect_symbol (struct
- CORE_ADDR scope,
- int trace_string)
- {
-- unsigned long len;
-+ ULONGEST len;
- unsigned int reg;
- bfd_signed_vma offset;
- int treat_as_expr = 0;
-@@ -948,8 +948,8 @@ collection_list::collect_symbol (struct
- offset = SYMBOL_VALUE_ADDRESS (sym);
- if (info_verbose)
- {
-- printf_filtered ("LOC_STATIC %s: collect %ld bytes at %s.\n",
-- SYMBOL_PRINT_NAME (sym), len,
-+ printf_filtered ("LOC_STATIC %s: collect %s bytes at %s.\n",
-+ SYMBOL_PRINT_NAME (sym), pulongest (len),
- paddress (gdbarch, offset));
- }
- /* A struct may be a C++ class with static fields, go to general
-@@ -981,9 +981,9 @@ collection_list::collect_symbol (struct
- offset = frame_offset + SYMBOL_VALUE (sym);
- if (info_verbose)
- {
-- printf_filtered ("LOC_LOCAL %s: Collect %ld bytes at offset %s"
-+ printf_filtered ("LOC_LOCAL %s: Collect %s bytes at offset %s"
- " from frame ptr reg %d\n",
-- SYMBOL_PRINT_NAME (sym), len,
-+ SYMBOL_PRINT_NAME (sym), pulongest (len),
- paddress (gdbarch, offset), reg);
- }
- add_memrange (gdbarch, reg, offset, len);
-@@ -993,9 +993,9 @@ collection_list::collect_symbol (struct
- offset = 0;
- if (info_verbose)
- {
-- printf_filtered ("LOC_REGPARM_ADDR %s: Collect %ld bytes at offset %s"
-+ printf_filtered ("LOC_REGPARM_ADDR %s: Collect %s bytes at offset %s"
- " from reg %d\n",
-- SYMBOL_PRINT_NAME (sym), len,
-+ SYMBOL_PRINT_NAME (sym), pulongest (len),
- paddress (gdbarch, offset), reg);
- }
- add_memrange (gdbarch, reg, offset, len);
-@@ -1005,9 +1005,9 @@ collection_list::collect_symbol (struct
- offset = frame_offset + SYMBOL_VALUE (sym);
- if (info_verbose)
- {
-- printf_filtered ("LOC_LOCAL %s: Collect %ld bytes at offset %s"
-+ printf_filtered ("LOC_LOCAL %s: Collect %s bytes at offset %s"
- " from frame ptr reg %d\n",
-- SYMBOL_PRINT_NAME (sym), len,
-+ SYMBOL_PRINT_NAME (sym), pulongest (len),
- paddress (gdbarch, offset), reg);
- }
- add_memrange (gdbarch, reg, offset, len);
-@@ -2585,7 +2585,8 @@ scope_info (char *args, int from_tty)
- const char *symname;
- char *save_args = args;
- struct block_iterator iter;
-- int j, count = 0;
-+ int count = 0;
-+ LONGEST j;
- struct gdbarch *gdbarch;
- int regno;
-
-@@ -2727,8 +2728,11 @@ scope_info (char *args, int from_tty)
- }
- }
- if (SYMBOL_TYPE (sym))
-- printf_filtered (", length %d.\n",
-- TYPE_LENGTH (check_typedef (SYMBOL_TYPE (sym))));
-+ {
-+ ULONGEST len = TYPE_LENGTH (check_typedef (SYMBOL_TYPE (sym)));
-+
-+ printf_filtered (", length %s.\n", pulongest (len));
-+ }
- }
- if (BLOCK_FUNCTION (block))
- break;
-diff -Naurp insight-7.12.50.20170416.orig/gdb/tracepoint.h insight-7.12.50.20170416.new/gdb/tracepoint.h
---- insight-7.12.50.20170416.orig/gdb/tracepoint.h 2017-04-09 01:11:01.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/tracepoint.h 2017-04-16 12:29:51.478070577 +0100
-@@ -254,7 +254,7 @@ public:
- void add_register (unsigned int regno);
- void add_memrange (struct gdbarch *gdbarch,
- int type, bfd_signed_vma base,
-- unsigned long len);
-+ ULONGEST len);
- void collect_symbol (struct symbol *sym,
- struct gdbarch *gdbarch,
- long frame_regno, long frame_offset,
-diff -Naurp insight-7.12.50.20170416.orig/gdb/valarith.c insight-7.12.50.20170416.new/gdb/valarith.c
---- insight-7.12.50.20170416.orig/gdb/valarith.c 2017-03-25 10:42:37.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/valarith.c 2017-04-16 12:29:51.467070475 +0100
-@@ -188,7 +188,7 @@ value_subscript (struct value *array, LO
- to doubles, but no longer does. */
-
- struct value *
--value_subscripted_rvalue (struct value *array, LONGEST index, int lowerbound)
-+value_subscripted_rvalue (struct value *array, LONGEST index, LONGEST lowerbound)
- {
- struct type *array_type = check_typedef (value_type (array));
- struct type *elt_type = check_typedef (TYPE_TARGET_TYPE (array_type));
-@@ -659,7 +659,7 @@ value_concat (struct value *arg1, struct
- struct value *inval1;
- struct value *inval2;
- struct value *outval = NULL;
-- int inval1len, inval2len;
-+ ssize_t inval1len, inval2len;
- int count, idx;
- char *ptr;
- char inchar;
-@@ -1512,7 +1512,7 @@ value_binop (struct value *arg1, struct
- int
- value_logical_not (struct value *arg1)
- {
-- int len;
-+ LONGEST len;
- const gdb_byte *p;
- struct type *type1;
-
-@@ -1543,11 +1543,11 @@ value_logical_not (struct value *arg1)
- static int
- value_strcmp (struct value *arg1, struct value *arg2)
- {
-- int len1 = TYPE_LENGTH (value_type (arg1));
-- int len2 = TYPE_LENGTH (value_type (arg2));
-+ LONGEST len1 = TYPE_LENGTH (value_type (arg1));
-+ LONGEST len2 = TYPE_LENGTH (value_type (arg2));
- const gdb_byte *s1 = value_contents (arg1);
- const gdb_byte *s2 = value_contents (arg2);
-- int i, len = len1 < len2 ? len1 : len2;
-+ LONGEST i, len = len1 < len2 ? len1 : len2;
-
- for (i = 0; i < len; i++)
- {
-diff -Naurp insight-7.12.50.20170416.orig/gdb/valops.c insight-7.12.50.20170416.new/gdb/valops.c
---- insight-7.12.50.20170416.orig/gdb/valops.c 2017-03-25 10:42:37.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/valops.c 2017-04-16 12:29:51.468070484 +0100
-@@ -79,7 +79,7 @@ oload_classification classify_oload_matc
- int, int);
-
- static struct value *value_struct_elt_for_reference (struct type *,
-- int, struct type *,
-+ LONGEST, struct type *,
- const char *,
- struct type *,
- int, enum noside);
-@@ -183,7 +183,7 @@ find_function_in_inferior (const char *n
- space. */
-
- struct value *
--value_allocate_space_in_inferior (int len)
-+value_allocate_space_in_inferior (LONGEST len)
- {
- struct objfile *objf;
- struct value *val = find_function_in_inferior ("malloc", &objf);
-@@ -393,12 +393,12 @@ value_cast (struct type *type, struct va
- if (code1 == TYPE_CODE_ARRAY)
- {
- struct type *element_type = TYPE_TARGET_TYPE (type);
-- unsigned element_length = TYPE_LENGTH (check_typedef (element_type));
-+ ULONGEST element_length = TYPE_LENGTH (check_typedef (element_type));
-
- if (element_length > 0 && TYPE_ARRAY_UPPER_BOUND_IS_UNDEFINED (type))
- {
- struct type *range_type = TYPE_INDEX_TYPE (type);
-- int val_length = TYPE_LENGTH (type2);
-+ LONGEST val_length = TYPE_LENGTH (type2);
- LONGEST low_bound, high_bound, new_length;
-
- if (get_discrete_bounds (range_type, &low_bound, &high_bound) < 0)
-@@ -1064,7 +1064,7 @@ value_assign (struct value *toval, struc
- {
- const gdb_byte *dest_buffer;
- CORE_ADDR changed_addr;
-- int changed_len;
-+ LONGEST changed_len;
- gdb_byte buffer[sizeof (LONGEST)];
-
- if (value_bitsize (toval))
-@@ -3319,7 +3319,7 @@ compare_parameters (struct type *t1, str
- the form "DOMAIN::NAME". */
-
- static struct value *
--value_struct_elt_for_reference (struct type *domain, int offset,
-+value_struct_elt_for_reference (struct type *domain, LONGEST offset,
- struct type *curtype, const char *name,
- struct type *intype,
- int want_address,
-@@ -3353,7 +3353,7 @@ value_struct_elt_for_reference (struct t
- if (want_address)
- return value_from_longest
- (lookup_memberptr_type (TYPE_FIELD_TYPE (t, i), domain),
-- offset + (LONGEST) (TYPE_FIELD_BITPOS (t, i) >> 3));
-+ offset + (TYPE_FIELD_BITPOS (t, i) >> 3));
- else if (noside != EVAL_NORMAL)
- return allocate_value (TYPE_FIELD_TYPE (t, i));
- else
-@@ -3521,7 +3521,7 @@ value_struct_elt_for_reference (struct t
- for (i = TYPE_N_BASECLASSES (t) - 1; i >= 0; i--)
- {
- struct value *v;
-- int base_offset;
-+ LONGEST base_offset;
-
- if (BASETYPE_VIA_VIRTUAL (t, i))
- base_offset = 0;
-@@ -3670,7 +3670,7 @@ value_rtti_indirect_type (struct value *
- struct value *
- value_full_object (struct value *argp,
- struct type *rtype,
-- int xfull, int xtop,
-+ int xfull, LONGEST xtop,
- int xusing_enc)
- {
- struct type *real_type;
-diff -Naurp insight-7.12.50.20170416.orig/gdb/valprint.c insight-7.12.50.20170416.new/gdb/valprint.c
---- insight-7.12.50.20170416.orig/gdb/valprint.c 2017-03-25 10:42:37.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/valprint.c 2017-04-16 12:29:51.469070494 +0100
-@@ -933,7 +933,7 @@ generic_val_print_complex (struct type *
-
- void
- generic_val_print (struct type *type,
-- int embedded_offset, CORE_ADDR address,
-+ LONGEST embedded_offset, CORE_ADDR address,
- struct ui_file *stream, int recurse,
- struct value *original_value,
- const struct value_print_options *options,
-@@ -1879,7 +1879,7 @@ print_decimal_chars (struct ui_file *str
-
- void
- print_hex_chars (struct ui_file *stream, const gdb_byte *valaddr,
-- unsigned len, enum bfd_endian byte_order)
-+ ULONGEST len, enum bfd_endian byte_order)
- {
- const gdb_byte *p;
-
-@@ -2001,17 +2001,17 @@ val_print_array_elements (struct type *t
- int recurse,
- struct value *val,
- const struct value_print_options *options,
-- unsigned int i)
-+ ULONGEST i)
- {
- unsigned int things_printed = 0;
-- unsigned len;
-+ ULONGEST len;
- struct type *elttype, *index_type, *base_index_type;
-- unsigned eltlen;
-+ ULONGEST eltlen;
- /* Position of the array element we are examining to see
- whether it is repeated. */
-- unsigned int rep1;
-+ ULONGEST rep1;
- /* Number of repetitions we have detected so far. */
-- unsigned int reps;
-+ ULONGEST reps;
- LONGEST low_bound, high_bound;
- LONGEST low_pos, high_pos;
-
-@@ -2101,7 +2101,7 @@ val_print_array_elements (struct type *t
- address, stream, recurse + 1, val, options,
- current_language);
- annotate_elt_rep (reps);
-- fprintf_filtered (stream, " <repeats %u times>", reps);
-+ fprintf_filtered (stream, " <repeats %s times>", pulongest (reps));
- annotate_elt_rep_end ();
-
- i = rep1 - 1;
-@@ -2753,7 +2753,7 @@ print_converted_chars_to_obstack (struct
-
- void
- generic_printstr (struct ui_file *stream, struct type *type,
-- const gdb_byte *string, unsigned int length,
-+ const gdb_byte *string, ULONGEST length,
- const char *encoding, int force_ellipses,
- int quote_char, int c_style_terminator,
- const struct value_print_options *options)
-diff -Naurp insight-7.12.50.20170416.orig/gdb/valprint.h insight-7.12.50.20170416.new/gdb/valprint.h
---- insight-7.12.50.20170416.orig/gdb/valprint.h 2017-01-03 17:36:55.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/valprint.h 2017-04-16 12:29:51.469070494 +0100
-@@ -119,7 +119,7 @@ extern void val_print_array_elements (st
- CORE_ADDR, struct ui_file *, int,
- struct value *,
- const struct value_print_options *,
-- unsigned int);
-+ ULONGEST);
-
- extern void val_print_type_code_int (struct type *, const gdb_byte *,
- struct ui_file *);
-@@ -141,7 +141,7 @@ extern void print_decimal_chars (struct
- unsigned int, enum bfd_endian);
-
- extern void print_hex_chars (struct ui_file *, const gdb_byte *,
-- unsigned int, enum bfd_endian);
-+ ULONGEST, enum bfd_endian);
-
- extern void print_char_chars (struct ui_file *, struct type *,
- const gdb_byte *, unsigned int, enum bfd_endian);
-@@ -194,7 +194,7 @@ struct generic_val_print_decorations
-
-
- extern void generic_val_print (struct type *type,
-- int embedded_offset, CORE_ADDR address,
-+ LONGEST embedded_offset, CORE_ADDR address,
- struct ui_file *stream, int recurse,
- struct value *original_value,
- const struct value_print_options *options,
-@@ -204,7 +204,7 @@ extern void generic_emit_char (int c, st
- int quoter, const char *encoding);
-
- extern void generic_printstr (struct ui_file *stream, struct type *type,
-- const gdb_byte *string, unsigned int length,
-+ const gdb_byte *string, ULONGEST length,
- const char *encoding, int force_ellipses,
- int quote_char, int c_style_terminator,
- const struct value_print_options *options);
-diff -Naurp insight-7.12.50.20170416.orig/gdb/value.c insight-7.12.50.20170416.new/gdb/value.c
---- insight-7.12.50.20170416.orig/gdb/value.c 2017-04-16 12:29:02.690616755 +0100
-+++ insight-7.12.50.20170416.new/gdb/value.c 2017-04-16 12:29:51.470070503 +0100
-@@ -367,7 +367,8 @@ value_bytes_available (const struct valu
- }
-
- int
--value_bits_any_optimized_out (const struct value *value, int bit_offset, int bit_length)
-+value_bits_any_optimized_out (const struct value *value, LONGEST bit_offset,
-+ LONGEST bit_length)
- {
- gdb_assert (!value->lazy);
-
-@@ -813,9 +814,9 @@ find_first_range_overlap_and_match (stru
- Return true if the available bits match. */
-
- static int
--value_contents_bits_eq (const struct value *val1, int offset1,
-- const struct value *val2, int offset2,
-- int length)
-+value_contents_bits_eq (const struct value *val1, LONGEST offset1,
-+ const struct value *val2, LONGEST offset2,
-+ LONGEST length)
- {
- /* Each array element corresponds to a ranges source (unavailable,
- optimized out). '1' is for VAL1, '2' for VAL2. */
-@@ -1455,7 +1456,8 @@ value_optimized_out (struct value *value
- the following LENGTH bytes. */
-
- void
--mark_value_bytes_optimized_out (struct value *value, int offset, int length)
-+mark_value_bytes_optimized_out (struct value *value, LONGEST offset,
-+ LONGEST length)
- {
- mark_value_bits_optimized_out (value,
- offset * TARGET_CHAR_BIT,
-diff -Naurp insight-7.12.50.20170416.orig/gdb/value.h insight-7.12.50.20170416.new/gdb/value.h
---- insight-7.12.50.20170416.orig/gdb/value.h 2017-03-25 10:42:37.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/value.h 2017-04-16 12:29:51.471070512 +0100
-@@ -246,7 +246,7 @@ struct lval_funcs
- /* If non-NULL, this is used to determine whether the indicated bits
- of VALUE are a synthetic pointer. */
- int (*check_synthetic_pointer) (const struct value *value,
-- LONGEST offset, int length);
-+ LONGEST offset, LONGEST length);
-
- /* Return a duplicate of VALUE's closure, for use in a new value.
- This may simply return the same closure, if VALUE's is
-@@ -377,7 +377,8 @@ extern int value_optimized_out (struct v
- otherwise. */
-
- extern int value_bits_any_optimized_out (const struct value *value,
-- int bit_offset, int bit_length);
-+ LONGEST bit_offset,
-+ LONGEST bit_length);
-
- /* Like value_optimized_out, but return true iff the whole value is
- optimized out. */
-@@ -387,7 +388,7 @@ extern int value_entirely_optimized_out
- LENGTH bytes as optimized out. */
-
- extern void mark_value_bytes_optimized_out (struct value *value,
-- int offset, int length);
-+ LONGEST offset, LONGEST length);
-
- /* Mark VALUE's content bits starting at OFFSET and extending for
- LENGTH bits as optimized out. */
-@@ -820,12 +821,11 @@ extern struct value *value_primitive_fie
- int fieldno,
- struct type *arg_type);
-
--
- extern struct type *value_rtti_indirect_type (struct value *, int *, LONGEST *,
- int *);
-
- extern struct value *value_full_object (struct value *, struct type *, int,
-- int, int);
-+ LONGEST, int);
-
- extern struct value *value_cast_pointers (struct type *, struct value *, int);
-
-@@ -1112,10 +1112,11 @@ extern struct value *value_literal_compl
- extern struct value *find_function_in_inferior (const char *,
- struct objfile **);
-
--extern struct value *value_allocate_space_in_inferior (int);
-+extern struct value *value_allocate_space_in_inferior (LONGEST);
-
- extern struct value *value_subscripted_rvalue (struct value *array,
-- LONGEST index, int lowerbound);
-+ LONGEST index,
-+ LONGEST lowerbound);
-
- /* User function handler. */
-
-diff -Naurp insight-7.12.50.20170416.orig/gdb/x86-nat.c insight-7.12.50.20170416.new/gdb/x86-nat.c
---- insight-7.12.50.20170416.orig/gdb/x86-nat.c 2017-01-03 17:36:55.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/x86-nat.c 2017-04-16 12:29:51.473070531 +0100
-@@ -174,7 +174,7 @@ x86_remove_watchpoint (struct target_ops
-
- static int
- x86_region_ok_for_watchpoint (struct target_ops *self,
-- CORE_ADDR addr, int len)
-+ CORE_ADDR addr, LONGEST len)
- {
- struct x86_debug_reg_state *state
- = x86_debug_reg_state (ptid_get_pid (inferior_ptid));
diff --git a/insight-7.12-gdb-rhbz795424-bitpos-23of25.patch b/insight-7.12-gdb-rhbz795424-bitpos-23of25.patch
deleted file mode 100644
index 9f75cad..0000000
--- a/insight-7.12-gdb-rhbz795424-bitpos-23of25.patch
+++ /dev/null
@@ -1,1137 +0,0 @@
-diff -Naurp insight-7.12.50.20170416.orig/gdb/alpha-tdep.c insight-7.12.50.20170416.new/gdb/alpha-tdep.c
---- insight-7.12.50.20170416.orig/gdb/alpha-tdep.c 2017-04-16 12:45:38.999884453 +0100
-+++ insight-7.12.50.20170416.new/gdb/alpha-tdep.c 2017-04-16 12:46:32.449381642 +0100
-@@ -300,17 +300,17 @@ alpha_push_dummy_call (struct gdbarch *g
- {
- enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
- int i;
-- int accumulate_size = struct_return ? 8 : 0;
-+ ssize_t accumulate_size = struct_return ? 8 : 0;
- struct alpha_arg
- {
- const gdb_byte *contents;
-- int len;
-- int offset;
-+ ssize_t len;
-+ ssize_t offset;
- };
- struct alpha_arg *alpha_args = XALLOCAVEC (struct alpha_arg, nargs);
- struct alpha_arg *m_arg;
- gdb_byte arg_reg_buffer[ALPHA_REGISTER_SIZE * ALPHA_NUM_ARG_REGS];
-- int required_arg_regs;
-+ ssize_t required_arg_regs;
- CORE_ADDR func_addr = find_function_addr (function, NULL);
-
- /* The ABI places the address of the called function in T12. */
-@@ -430,8 +430,8 @@ alpha_push_dummy_call (struct gdbarch *g
- for (i = nargs; m_arg--, --i >= 0;)
- {
- const gdb_byte *contents = m_arg->contents;
-- int offset = m_arg->offset;
-- int len = m_arg->len;
-+ ssize_t offset = m_arg->offset;
-+ ssize_t len = m_arg->len;
-
- /* Copy the bytes destined for registers into arg_reg_buffer. */
- if (offset < sizeof(arg_reg_buffer))
-@@ -443,7 +443,7 @@ alpha_push_dummy_call (struct gdbarch *g
- }
- else
- {
-- int tlen = sizeof(arg_reg_buffer) - offset;
-+ ssize_t tlen = sizeof(arg_reg_buffer) - offset;
- memcpy (arg_reg_buffer + offset, contents, tlen);
- offset += tlen;
- contents += tlen;
-diff -Naurp insight-7.12.50.20170416.orig/gdb/amd64-tdep.c insight-7.12.50.20170416.new/gdb/amd64-tdep.c
---- insight-7.12.50.20170416.orig/gdb/amd64-tdep.c 2017-04-16 12:45:38.685881532 +0100
-+++ insight-7.12.50.20170416.new/gdb/amd64-tdep.c 2017-04-16 12:46:32.450381651 +0100
-@@ -735,7 +735,7 @@ amd64_return_value (struct gdbarch *gdba
- gdb_byte *readbuf, const gdb_byte *writebuf)
- {
- enum amd64_reg_class theclass[2];
-- int len = TYPE_LENGTH (type);
-+ LONGEST len = TYPE_LENGTH (type);
- static int integer_regnum[] = { AMD64_RAX_REGNUM, AMD64_RDX_REGNUM };
- static int sse_regnum[] = { AMD64_XMM0_REGNUM, AMD64_XMM1_REGNUM };
- int integer_reg = 0;
-@@ -852,10 +852,10 @@ amd64_return_value (struct gdbarch *gdba
- gdb_assert (regnum != -1);
-
- if (readbuf)
-- regcache_raw_read_part (regcache, regnum, offset, std::min (len, 8),
-+ regcache_raw_read_part (regcache, regnum, offset, std::min (len, (LONGEST) 8),
- readbuf + i * 8);
- if (writebuf)
-- regcache_raw_write_part (regcache, regnum, offset, std::min (len, 8),
-+ regcache_raw_write_part (regcache, regnum, offset, std::min (len, (LONGEST) 8),
- writebuf + i * 8);
- }
-
-@@ -886,8 +886,8 @@ amd64_push_arguments (struct regcache *r
- };
- struct value **stack_args = XALLOCAVEC (struct value *, nargs);
- int num_stack_args = 0;
-- int num_elements = 0;
-- int element = 0;
-+ LONGEST num_elements = 0;
-+ LONGEST element = 0;
- int integer_reg = 0;
- int sse_reg = 0;
- int i;
-@@ -899,7 +899,7 @@ amd64_push_arguments (struct regcache *r
- for (i = 0; i < nargs; i++)
- {
- struct type *type = value_type (args[i]);
-- int len = TYPE_LENGTH (type);
-+ LONGEST len = TYPE_LENGTH (type);
- enum amd64_reg_class theclass[2];
- int needed_integer_regs = 0;
- int needed_sse_regs = 0;
-@@ -963,7 +963,7 @@ amd64_push_arguments (struct regcache *r
-
- gdb_assert (regnum != -1);
- memset (buf, 0, sizeof buf);
-- memcpy (buf, valbuf + j * 8, std::min (len, 8));
-+ memcpy (buf, valbuf + j * 8, std::min (len, (LONGEST) 8));
- regcache_raw_write_part (regcache, regnum, offset, 8, buf);
- }
- }
-diff -Naurp insight-7.12.50.20170416.orig/gdb/amd64-windows-tdep.c insight-7.12.50.20170416.new/gdb/amd64-windows-tdep.c
---- insight-7.12.50.20170416.orig/gdb/amd64-windows-tdep.c 2017-03-25 10:42:37.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/amd64-windows-tdep.c 2017-04-16 12:46:32.450381651 +0100
-@@ -290,7 +290,7 @@ amd64_windows_return_value (struct gdbar
- struct type *type, struct regcache *regcache,
- gdb_byte *readbuf, const gdb_byte *writebuf)
- {
-- int len = TYPE_LENGTH (type);
-+ LONGEST len = TYPE_LENGTH (type);
- int regnum = -1;
-
- /* See if our value is returned through a register. If it is, then
-diff -Naurp insight-7.12.50.20170416.orig/gdb/arm-tdep.c insight-7.12.50.20170416.new/gdb/arm-tdep.c
---- insight-7.12.50.20170416.orig/gdb/arm-tdep.c 2017-04-15 01:21:12.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/arm-tdep.c 2017-04-16 12:46:32.453381679 +0100
-@@ -3492,7 +3492,7 @@ arm_vfp_cprc_reg_char (enum arm_vfp_cprc
- array). Vector types are not currently supported, matching the
- generic AAPCS support. */
-
--static int
-+static LONGEST
- arm_vfp_cprc_sub_candidate (struct type *t,
- enum arm_vfp_cprc_base_type *base_type)
- {
-@@ -3575,7 +3575,7 @@ arm_vfp_cprc_sub_candidate (struct type
- }
- else
- {
-- int count;
-+ LONGEST count;
- unsigned unitlen;
-
- count = arm_vfp_cprc_sub_candidate (TYPE_TARGET_TYPE (t),
-@@ -3598,12 +3598,12 @@ arm_vfp_cprc_sub_candidate (struct type
-
- case TYPE_CODE_STRUCT:
- {
-- int count = 0;
-+ LONGEST count = 0;
- unsigned unitlen;
- int i;
- for (i = 0; i < TYPE_NFIELDS (t); i++)
- {
-- int sub_count = 0;
-+ LONGEST sub_count = 0;
-
- if (!field_is_static (&TYPE_FIELD (t, i)))
- sub_count = arm_vfp_cprc_sub_candidate (TYPE_FIELD_TYPE (t, i),
-@@ -3627,13 +3627,15 @@ arm_vfp_cprc_sub_candidate (struct type
-
- case TYPE_CODE_UNION:
- {
-- int count = 0;
-+ LONGEST count = 0;
- unsigned unitlen;
- int i;
- for (i = 0; i < TYPE_NFIELDS (t); i++)
- {
-- int sub_count = arm_vfp_cprc_sub_candidate (TYPE_FIELD_TYPE (t, i),
-- base_type);
-+ LONGEST sub_count;
-+
-+ sub_count = arm_vfp_cprc_sub_candidate (TYPE_FIELD_TYPE (t, i),
-+ base_type);
- if (sub_count == -1)
- return -1;
- count = (count > sub_count ? count : sub_count);
-@@ -3669,7 +3671,7 @@ arm_vfp_call_candidate (struct type *t,
- int *count)
- {
- enum arm_vfp_cprc_base_type b = VFP_CPRC_UNKNOWN;
-- int c = arm_vfp_cprc_sub_candidate (t, &b);
-+ LONGEST c = arm_vfp_cprc_sub_candidate (t, &b);
- if (c <= 0 || c > 4)
- return 0;
- *base_type = b;
-@@ -3750,7 +3752,7 @@ arm_push_dummy_call (struct gdbarch *gdb
-
- for (argnum = 0; argnum < nargs; argnum++)
- {
-- int len;
-+ LONGEST len;
- struct type *arg_type;
- struct type *target_type;
- enum type_code typecode;
-diff -Naurp insight-7.12.50.20170416.orig/gdb/avr-tdep.c insight-7.12.50.20170416.new/gdb/avr-tdep.c
---- insight-7.12.50.20170416.orig/gdb/avr-tdep.c 2017-04-15 01:21:12.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/avr-tdep.c 2017-04-16 12:46:32.454381689 +0100
-@@ -1191,13 +1191,13 @@ avr_dummy_id (struct gdbarch *gdbarch, s
-
- struct stack_item
- {
-- int len;
-+ ssize_t len;
- struct stack_item *prev;
- gdb_byte *data;
- };
-
- static struct stack_item *
--push_stack_item (struct stack_item *prev, const bfd_byte *contents, int len)
-+push_stack_item (struct stack_item *prev, const bfd_byte *contents, ssize_t len)
- {
- struct stack_item *si;
- si = XNEW (struct stack_item);
-@@ -1285,12 +1285,12 @@ avr_push_dummy_call (struct gdbarch *gdb
-
- for (i = 0; i < nargs; i++)
- {
-- int last_regnum;
-- int j;
-+ ssize_t last_regnum;
-+ ssize_t j;
- struct value *arg = args[i];
- struct type *type = check_typedef (value_type (arg));
- const bfd_byte *contents = value_contents (arg);
-- int len = TYPE_LENGTH (type);
-+ ssize_t len = TYPE_LENGTH (type);
-
- /* Calculate the potential last register needed.
- E.g. For length 2, registers regnum and regnum-1 (say 25 and 24)
-diff -Naurp insight-7.12.50.20170416.orig/gdb/bfin-tdep.c insight-7.12.50.20170416.new/gdb/bfin-tdep.c
---- insight-7.12.50.20170416.orig/gdb/bfin-tdep.c 2017-04-09 01:11:01.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/bfin-tdep.c 2017-04-16 12:46:32.455381698 +0100
-@@ -504,7 +504,7 @@ bfin_push_dummy_call (struct gdbarch *gd
- enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
- int i;
- long reg_r0, reg_r1, reg_r2;
-- int total_len = 0;
-+ ssize_t total_len = 0;
-
- for (i = nargs - 1; i >= 0; i--)
- {
-@@ -526,7 +526,7 @@ bfin_push_dummy_call (struct gdbarch *gd
- {
- struct type *value_type = value_enclosing_type (args[i]);
- struct type *arg_type = check_typedef (value_type);
-- int container_len = (TYPE_LENGTH (value_type) + 3) & ~3;
-+ ssize_t container_len = (TYPE_LENGTH (value_type) + 3) & ~3;
-
- sp -= container_len;
- write_memory (sp, value_contents (args[i]), container_len);
-diff -Naurp insight-7.12.50.20170416.orig/gdb/cris-tdep.c insight-7.12.50.20170416.new/gdb/cris-tdep.c
---- insight-7.12.50.20170416.orig/gdb/cris-tdep.c 2017-04-09 01:11:01.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/cris-tdep.c 2017-04-16 12:46:32.457381717 +0100
-@@ -663,13 +663,13 @@ static CORE_ADDR cris_unwind_sp (struct
-
- struct stack_item
- {
-- int len;
-+ ssize_t len;
- struct stack_item *prev;
- gdb_byte *data;
- };
-
- static struct stack_item *
--push_stack_item (struct stack_item *prev, const gdb_byte *contents, int len)
-+push_stack_item (struct stack_item *prev, const gdb_byte *contents, ssize_t len)
- {
- struct stack_item *si = XNEW (struct stack_item);
- si->data = (gdb_byte *) xmalloc (len);
-@@ -833,13 +833,13 @@ cris_push_dummy_call (struct gdbarch *gd
-
- for (argnum = 0; argnum < nargs; argnum++)
- {
-- int len;
-+ ssize_t len;
- const gdb_byte *val;
-- int reg_demand;
-- int i;
-+ ssize_t reg_demand;
-+ ssize_t i;
-
-- len = TYPE_LENGTH (value_type (args[argnum]));
- val = value_contents (args[argnum]);
-+ len = TYPE_LENGTH (value_type (args[argnum]));
-
- /* How may registers worth of storage do we need for this argument? */
- reg_demand = (len / 4) + (len % 4 != 0 ? 1 : 0);
-diff -Naurp insight-7.12.50.20170416.orig/gdb/h8300-tdep.c insight-7.12.50.20170416.new/gdb/h8300-tdep.c
---- insight-7.12.50.20170416.orig/gdb/h8300-tdep.c 2017-04-15 01:21:12.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/h8300-tdep.c 2017-04-16 12:46:32.457381717 +0100
-@@ -637,7 +637,7 @@ h8300_push_dummy_call (struct gdbarch *g
- int struct_return, CORE_ADDR struct_addr)
- {
- enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
-- int stack_alloc = 0, stack_offset = 0;
-+ LONGEST stack_alloc = 0, stack_offset = 0;
- int wordsize = BINWORD (gdbarch);
- int reg = E_ARG0_REGNUM;
- int argument;
-@@ -664,11 +664,11 @@ h8300_push_dummy_call (struct gdbarch *g
- {
- struct cleanup *back_to;
- struct type *type = value_type (args[argument]);
-- int len = TYPE_LENGTH (type);
-+ ssize_t len = TYPE_LENGTH (type);
- char *contents = (char *) value_contents (args[argument]);
-
- /* Pad the argument appropriately. */
-- int padded_len = align_up (len, wordsize);
-+ ssize_t padded_len = align_up (len, wordsize);
- gdb_byte *padded = (gdb_byte *) xmalloc (padded_len);
- back_to = make_cleanup (xfree, padded);
-
-@@ -697,7 +697,7 @@ h8300_push_dummy_call (struct gdbarch *g
- /* Heavens to Betsy --- it's really going in registers!
- Note that on the h8/300s, there are gaps between the
- registers in the register file. */
-- int offset;
-+ ssize_t offset;
-
- for (offset = 0; offset < padded_len; offset += wordsize)
- {
-diff -Naurp insight-7.12.50.20170416.orig/gdb/hppa-tdep.c insight-7.12.50.20170416.new/gdb/hppa-tdep.c
---- insight-7.12.50.20170416.orig/gdb/hppa-tdep.c 2017-04-09 01:11:01.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/hppa-tdep.c 2017-04-16 12:46:32.458381726 +0100
-@@ -989,7 +989,7 @@ hppa64_push_dummy_call (struct gdbarch *
- {
- struct value *arg = args[i];
- struct type *type = value_type (arg);
-- int len = TYPE_LENGTH (type);
-+ LONGEST len = TYPE_LENGTH (type);
- const bfd_byte *valbuf;
- bfd_byte fptrbuf[8];
- int regnum;
-@@ -1184,7 +1184,7 @@ hppa64_return_value (struct gdbarch *gdb
- struct type *type, struct regcache *regcache,
- gdb_byte *readbuf, const gdb_byte *writebuf)
- {
-- int len = TYPE_LENGTH (type);
-+ LONGEST len = TYPE_LENGTH (type);
- int regnum, offset;
-
- if (len > 16)
-diff -Naurp insight-7.12.50.20170416.orig/gdb/i386-darwin-tdep.c insight-7.12.50.20170416.new/gdb/i386-darwin-tdep.c
---- insight-7.12.50.20170416.orig/gdb/i386-darwin-tdep.c 2017-01-03 17:36:55.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/i386-darwin-tdep.c 2017-04-16 12:46:32.459381735 +0100
-@@ -167,7 +167,7 @@ i386_darwin_push_dummy_call (struct gdba
-
- for (write_pass = 0; write_pass < 2; write_pass++)
- {
-- int args_space = 0;
-+ LONGEST args_space = 0;
- int num_m128 = 0;
-
- if (struct_return)
-diff -Naurp insight-7.12.50.20170416.orig/gdb/i386-tdep.c insight-7.12.50.20170416.new/gdb/i386-tdep.c
---- insight-7.12.50.20170416.orig/gdb/i386-tdep.c 2017-04-16 12:45:38.982884295 +0100
-+++ insight-7.12.50.20170416.new/gdb/i386-tdep.c 2017-04-16 12:46:32.461381754 +0100
-@@ -2682,7 +2682,7 @@ i386_push_dummy_call (struct gdbarch *gd
- gdb_byte buf[4];
- int i;
- int write_pass;
-- int args_space = 0;
-+ LONGEST args_space = 0;
-
- /* BND registers can be in arbitrary values at the moment of the
- inferior call. This can cause boundary violations that are not
-@@ -2697,7 +2697,7 @@ i386_push_dummy_call (struct gdbarch *gd
-
- for (write_pass = 0; write_pass < 2; write_pass++)
- {
-- int args_space_used = 0;
-+ LONGEST args_space_used = 0;
-
- if (struct_return)
- {
-@@ -2714,7 +2714,7 @@ i386_push_dummy_call (struct gdbarch *gd
-
- for (i = 0; i < nargs; i++)
- {
-- int len = TYPE_LENGTH (value_enclosing_type (args[i]));
-+ LONGEST len = TYPE_LENGTH (value_enclosing_type (args[i]));
-
- if (write_pass)
- {
-@@ -2921,7 +2921,7 @@ i386_reg_struct_return_p (struct gdbarch
- {
- struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
- enum type_code code = TYPE_CODE (type);
-- int len = TYPE_LENGTH (type);
-+ LONGEST len = TYPE_LENGTH (type);
-
- gdb_assert (code == TYPE_CODE_STRUCT
- || code == TYPE_CODE_UNION
-@@ -3743,7 +3743,7 @@ static int
- i386_convert_register_p (struct gdbarch *gdbarch,
- int regnum, struct type *type)
- {
-- int len = TYPE_LENGTH (type);
-+ LONGEST len = TYPE_LENGTH (type);
-
- /* Values may be spread across multiple registers. Most debugging
- formats aren't expressive enough to specify the locations, so
-@@ -3776,7 +3776,7 @@ i386_register_to_value (struct frame_inf
- int *optimizedp, int *unavailablep)
- {
- struct gdbarch *gdbarch = get_frame_arch (frame);
-- int len = TYPE_LENGTH (type);
-+ LONGEST len = TYPE_LENGTH (type);
-
- if (i386_fp_regnum_p (gdbarch, regnum))
- return i387_register_to_value (frame, regnum, type, to,
-@@ -3812,7 +3812,7 @@ static void
- i386_value_to_register (struct frame_info *frame, int regnum,
- struct type *type, const gdb_byte *from)
- {
-- int len = TYPE_LENGTH (type);
-+ LONGEST len = TYPE_LENGTH (type);
-
- if (i386_fp_regnum_p (get_frame_arch (frame), regnum))
- {
-diff -Naurp insight-7.12.50.20170416.orig/gdb/iq2000-tdep.c insight-7.12.50.20170416.new/gdb/iq2000-tdep.c
---- insight-7.12.50.20170416.orig/gdb/iq2000-tdep.c 2017-01-03 17:36:55.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/iq2000-tdep.c 2017-04-16 12:46:32.461381754 +0100
-@@ -651,8 +651,9 @@ iq2000_push_dummy_call (struct gdbarch *
- const bfd_byte *val;
- bfd_byte buf[4];
- struct type *type;
-- int i, argreg, typelen, slacklen;
-- int stackspace = 0;
-+ int i, argreg, slacklen;
-+ LONGEST typelen;
-+ LONGEST stackspace = 0;
- /* Used to copy struct arguments into the stack. */
- CORE_ADDR struct_ptr;
-
-diff -Naurp insight-7.12.50.20170416.orig/gdb/m32r-tdep.c insight-7.12.50.20170416.new/gdb/m32r-tdep.c
---- insight-7.12.50.20170416.orig/gdb/m32r-tdep.c 2017-04-15 01:21:12.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/m32r-tdep.c 2017-04-16 12:48:29.791473162 +0100
-@@ -681,7 +681,7 @@ m32r_push_dummy_call (struct gdbarch *gd
- CORE_ADDR regval;
- gdb_byte *val;
- gdb_byte valbuf[M32R_ARG_REGISTER_SIZE];
-- int len;
-+ LONGEST len;
-
- /* First force sp to a 4-byte alignment. */
- sp = sp & ~3;
-diff -Naurp insight-7.12.50.20170416.orig/gdb/m68k-tdep.c insight-7.12.50.20170416.new/gdb/m68k-tdep.c
---- insight-7.12.50.20170416.orig/gdb/m68k-tdep.c 2017-01-03 17:36:55.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/m68k-tdep.c 2017-04-16 12:46:32.463381773 +0100
-@@ -377,7 +377,7 @@ m68k_reg_struct_return_p (struct gdbarch
- {
- struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
- enum type_code code = TYPE_CODE (type);
-- int len = TYPE_LENGTH (type);
-+ LONGEST len = TYPE_LENGTH (type);
-
- gdb_assert (code == TYPE_CODE_STRUCT || code == TYPE_CODE_UNION
- || code == TYPE_CODE_COMPLEX);
-@@ -509,9 +509,9 @@ m68k_push_dummy_call (struct gdbarch *gd
- for (i = nargs - 1; i >= 0; i--)
- {
- struct type *value_type = value_enclosing_type (args[i]);
-- int len = TYPE_LENGTH (value_type);
-- int container_len = (len + 3) & ~3;
-- int offset;
-+ LONGEST len = TYPE_LENGTH (value_type);
-+ LONGEST container_len = (len + 3) & ~3;
-+ LONGEST offset;
-
- /* Non-scalars bigger than 4 bytes are left aligned, others are
- right aligned. */
-diff -Naurp insight-7.12.50.20170416.orig/gdb/m88k-tdep.c insight-7.12.50.20170416.new/gdb/m88k-tdep.c
---- insight-7.12.50.20170416.orig/gdb/m88k-tdep.c 2017-04-09 01:11:01.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/m88k-tdep.c 2017-04-16 12:46:32.464381782 +0100
-@@ -254,13 +254,13 @@ m88k_store_arguments (struct regcache *r
- {
- struct gdbarch *gdbarch = get_regcache_arch (regcache);
- int num_register_words = 0;
-- int num_stack_words = 0;
-+ LONGEST num_stack_words = 0;
- int i;
-
- for (i = 0; i < nargs; i++)
- {
- struct type *type = value_type (args[i]);
-- int len = TYPE_LENGTH (type);
-+ LONGEST len = TYPE_LENGTH (type);
-
- if (m88k_integral_or_pointer_p (type) && len < 4)
- {
-@@ -302,8 +302,8 @@ m88k_store_arguments (struct regcache *r
- {
- const bfd_byte *valbuf = value_contents (args[i]);
- struct type *type = value_type (args[i]);
-- int len = TYPE_LENGTH (type);
-- int stack_word = num_stack_words;
-+ LONGEST len = TYPE_LENGTH (type);
-+ LONGEST stack_word = num_stack_words;
-
- if (m88k_in_register_p (type))
- {
-diff -Naurp insight-7.12.50.20170416.orig/gdb/mep-tdep.c insight-7.12.50.20170416.new/gdb/mep-tdep.c
---- insight-7.12.50.20170416.orig/gdb/mep-tdep.c 2017-04-09 01:11:01.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/mep-tdep.c 2017-04-16 12:46:32.465381791 +0100
-@@ -2262,7 +2262,7 @@ push_large_arguments (CORE_ADDR sp, int
-
- for (i = 0; i < argc; i++)
- {
-- unsigned arg_len = TYPE_LENGTH (value_type (argv[i]));
-+ ULONGEST arg_len = TYPE_LENGTH (value_type (argv[i]));
-
- if (arg_len > MEP_GPR_SIZE)
- {
-diff -Naurp insight-7.12.50.20170416.orig/gdb/mips-tdep.c insight-7.12.50.20170416.new/gdb/mips-tdep.c
---- insight-7.12.50.20170416.orig/gdb/mips-tdep.c 2017-04-09 01:11:01.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/mips-tdep.c 2017-04-16 12:46:32.468381819 +0100
-@@ -474,7 +474,7 @@ static void
- mips_xfer_register (struct gdbarch *gdbarch, struct regcache *regcache,
- int reg_num, int length,
- enum bfd_endian endian, gdb_byte *in,
-- const gdb_byte *out, int buf_offset)
-+ const gdb_byte *out, LONGEST buf_offset)
- {
- int reg_offset = 0;
-
-@@ -497,8 +497,8 @@ mips_xfer_register (struct gdbarch *gdba
- }
- if (mips_debug)
- fprintf_unfiltered (gdb_stderr,
-- "xfer $%d, reg offset %d, buf offset %d, length %d, ",
-- reg_num, reg_offset, buf_offset, length);
-+ "xfer $%d, reg offset %d, buf offset %s, length %d, ",
-+ reg_num, reg_offset, plongest (buf_offset), length);
- if (mips_debug && out != NULL)
- {
- int i;
-@@ -4530,13 +4530,13 @@ mips_eabi_push_dummy_call (struct gdbarc
- gdb_byte valbuf[MAX_REGISTER_SIZE];
- struct value *arg = args[argnum];
- struct type *arg_type = check_typedef (value_type (arg));
-- int len = TYPE_LENGTH (arg_type);
-+ LONGEST len = TYPE_LENGTH (arg_type);
- enum type_code typecode = TYPE_CODE (arg_type);
-
- if (mips_debug)
- fprintf_unfiltered (gdb_stdlog,
-- "mips_eabi_push_dummy_call: %d len=%d type=%d",
-- argnum + 1, len, (int) typecode);
-+ "mips_eabi_push_dummy_call: %d len=%s type=%d",
-+ argnum + 1, plongest (len), (int) typecode);
-
- /* The EABI passes structures that do not fit in a register by
- reference. */
-@@ -4805,7 +4805,7 @@ mips_eabi_return_value (struct gdbarch *
-
- static int
- mips_n32n64_fp_arg_chunk_p (struct gdbarch *gdbarch, struct type *arg_type,
-- int offset)
-+ LONGEST offset)
- {
- int i;
-
-@@ -4820,7 +4820,7 @@ mips_n32n64_fp_arg_chunk_p (struct gdbar
-
- for (i = 0; i < TYPE_NFIELDS (arg_type); i++)
- {
-- int pos;
-+ LONGEST pos;
- struct type *field_type;
-
- /* We're only looking at normal fields. */
-@@ -4862,7 +4862,7 @@ mips_n32n64_push_dummy_call (struct gdba
- int argreg;
- int float_argreg;
- int argnum;
-- int len = 0;
-+ LONGEST len = 0;
- int stack_offset = 0;
- enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
- CORE_ADDR func_addr = find_function_addr (function, NULL);
-@@ -5213,11 +5213,11 @@ mips_n32n64_return_value (struct gdbarch
- : MIPS_V0_REGNUM);
- field < TYPE_NFIELDS (type); field++, regnum += 2)
- {
-- int offset = (FIELD_BITPOS (TYPE_FIELDS (type)[field])
-- / TARGET_CHAR_BIT);
-+ LONGEST offset = (FIELD_BITPOS (TYPE_FIELDS (type)[field])
-+ / TARGET_CHAR_BIT);
- if (mips_debug)
-- fprintf_unfiltered (gdb_stderr, "Return float struct+%d\n",
-- offset);
-+ fprintf_unfiltered (gdb_stderr, "Return float struct+%s\n",
-+ plongest (offset));
- if (TYPE_LENGTH (TYPE_FIELD_TYPE (type, field)) == 16)
- {
- /* A 16-byte long double field goes in two consecutive
-@@ -5259,8 +5259,8 @@ mips_n32n64_return_value (struct gdbarch
- if (offset + xfer > TYPE_LENGTH (type))
- xfer = TYPE_LENGTH (type) - offset;
- if (mips_debug)
-- fprintf_unfiltered (gdb_stderr, "Return struct+%d:%d in $%d\n",
-- offset, xfer, regnum);
-+ fprintf_unfiltered (gdb_stderr, "Return struct+%s:%d in $%d\n",
-+ plongest (offset), xfer, regnum);
- mips_xfer_register (gdbarch, regcache,
- gdbarch_num_regs (gdbarch) + regnum,
- xfer, BFD_ENDIAN_UNKNOWN, readbuf, writebuf,
-@@ -5318,7 +5318,7 @@ mips_o32_push_dummy_call (struct gdbarch
- int argreg;
- int float_argreg;
- int argnum;
-- int len = 0;
-+ LONGEST len = 0;
- int stack_offset = 0;
- enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
- CORE_ADDR func_addr = find_function_addr (function, NULL);
-@@ -5382,13 +5382,13 @@ mips_o32_push_dummy_call (struct gdbarch
- const gdb_byte *val;
- struct value *arg = args[argnum];
- struct type *arg_type = check_typedef (value_type (arg));
-- int len = TYPE_LENGTH (arg_type);
-+ LONGEST len = TYPE_LENGTH (arg_type);
- enum type_code typecode = TYPE_CODE (arg_type);
-
- if (mips_debug)
- fprintf_unfiltered (gdb_stdlog,
-- "mips_o32_push_dummy_call: %d len=%d type=%d",
-- argnum + 1, len, (int) typecode);
-+ "mips_o32_push_dummy_call: %d len=%s type=%d",
-+ argnum + 1, plongest (len), (int) typecode);
-
- val = value_contents (arg);
-
-@@ -5843,8 +5843,8 @@ mips_o64_push_dummy_call (struct gdbarch
- int argreg;
- int float_argreg;
- int argnum;
-- int len = 0;
-- int stack_offset = 0;
-+ LONGEST len = 0;
-+ LONGEST stack_offset = 0;
- enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
- CORE_ADDR func_addr = find_function_addr (function, NULL);
-
-@@ -5904,13 +5904,13 @@ mips_o64_push_dummy_call (struct gdbarch
- const gdb_byte *val;
- struct value *arg = args[argnum];
- struct type *arg_type = check_typedef (value_type (arg));
-- int len = TYPE_LENGTH (arg_type);
-+ LONGEST len = TYPE_LENGTH (arg_type);
- enum type_code typecode = TYPE_CODE (arg_type);
-
- if (mips_debug)
- fprintf_unfiltered (gdb_stdlog,
-- "mips_o64_push_dummy_call: %d len=%d type=%d",
-- argnum + 1, len, (int) typecode);
-+ "mips_o64_push_dummy_call: %d len=%s type=%d",
-+ argnum + 1, plongest (len), (int) typecode);
-
- val = value_contents (arg);
-
-diff -Naurp insight-7.12.50.20170416.orig/gdb/mn10300-tdep.c insight-7.12.50.20170416.new/gdb/mn10300-tdep.c
---- insight-7.12.50.20170416.orig/gdb/mn10300-tdep.c 2017-04-09 01:11:01.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/mn10300-tdep.c 2017-04-16 12:46:32.469381828 +0100
-@@ -1220,7 +1220,7 @@ mn10300_push_dummy_call (struct gdbarch
- enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
- const int push_size = register_size (gdbarch, E_PC_REGNUM);
- int regs_used;
-- int len, arg_len;
-+ LONGEST len, arg_len;
- int stack_offset = 0;
- int argnum;
- const gdb_byte *val;
-diff -Naurp insight-7.12.50.20170416.orig/gdb/mt-tdep.c insight-7.12.50.20170416.new/gdb/mt-tdep.c
---- insight-7.12.50.20170416.orig/gdb/mt-tdep.c 2017-01-03 17:36:55.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/mt-tdep.c 2017-04-16 12:46:32.470381838 +0100
-@@ -788,9 +788,9 @@ mt_push_dummy_call (struct gdbarch *gdba
- gdb_byte buf[MT_MAX_STRUCT_SIZE];
- int argreg = MT_1ST_ARGREG;
- int split_param_len = 0;
-- int stack_dest = sp;
-+ LONGEST stack_dest = sp;
- int slacklen;
-- int typelen;
-+ LONGEST typelen;
- int i, j;
-
- /* First handle however many args we can fit into MT_1ST_ARGREG thru
-diff -Naurp insight-7.12.50.20170416.orig/gdb/ppc-sysv-tdep.c insight-7.12.50.20170416.new/gdb/ppc-sysv-tdep.c
---- insight-7.12.50.20170416.orig/gdb/ppc-sysv-tdep.c 2017-03-25 10:42:37.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/ppc-sysv-tdep.c 2017-04-16 12:46:32.471381847 +0100
-@@ -67,7 +67,7 @@ ppc_sysv_abi_push_dummy_call (struct gdb
- enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
- int opencl_abi = ppc_sysv_use_opencl_abi (value_type (function));
- ULONGEST saved_sp;
-- int argspace = 0; /* 0 is an initial wrong guess. */
-+ LONGEST argspace = 0; /* 0 is an initial wrong guess. */
- int write_pass;
-
- gdb_assert (tdep->wordsize == 4);
-@@ -98,9 +98,9 @@ ppc_sysv_abi_push_dummy_call (struct gdb
- /* Next available vector register for vector arguments. */
- int vreg = 2;
- /* Arguments start above the "LR save word" and "Back chain". */
-- int argoffset = 2 * tdep->wordsize;
-+ LONGEST argoffset = 2 * tdep->wordsize;
- /* Structures start after the arguments. */
-- int structoffset = argoffset + argspace;
-+ LONGEST structoffset = argoffset + argspace;
-
- /* If the function is returning a `struct', then the first word
- (which will be passed in r3) is used for struct return
-@@ -119,7 +119,7 @@ ppc_sysv_abi_push_dummy_call (struct gdb
- {
- struct value *arg = args[argno];
- struct type *type = check_typedef (value_type (arg));
-- int len = TYPE_LENGTH (type);
-+ ssize_t len = TYPE_LENGTH (type);
- const bfd_byte *val = value_contents (arg);
-
- if (TYPE_CODE (type) == TYPE_CODE_FLT && len <= 8
-@@ -1284,11 +1284,11 @@ struct ppc64_sysv_argpos
-
- static void
- ppc64_sysv_abi_push_val (struct gdbarch *gdbarch,
-- const bfd_byte *val, int len, int align,
-+ const bfd_byte *val, ssize_t len, int align,
- struct ppc64_sysv_argpos *argpos)
- {
- struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
-- int offset = 0;
-+ ssize_t offset = 0;
-
- /* Enforce alignment of stack location, if requested. */
- if (align > tdep->wordsize)
-diff -Naurp insight-7.12.50.20170416.orig/gdb/rl78-tdep.c insight-7.12.50.20170416.new/gdb/rl78-tdep.c
---- insight-7.12.50.20170416.orig/gdb/rl78-tdep.c 2017-04-15 01:21:12.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/rl78-tdep.c 2017-04-16 12:46:32.471381847 +0100
-@@ -1352,8 +1352,8 @@ rl78_push_dummy_call (struct gdbarch *gd
- for (i = nargs - 1; i >= 0; i--)
- {
- struct type *value_type = value_enclosing_type (args[i]);
-- int len = TYPE_LENGTH (value_type);
-- int container_len = (len + 1) & ~1;
-+ LONGEST len = TYPE_LENGTH (value_type);
-+ LONGEST container_len = (len + 1) & ~1;
-
- sp -= container_len;
- write_memory (rl78_make_data_address (sp),
-diff -Naurp insight-7.12.50.20170416.orig/gdb/rs6000-aix-tdep.c insight-7.12.50.20170416.new/gdb/rs6000-aix-tdep.c
---- insight-7.12.50.20170416.orig/gdb/rs6000-aix-tdep.c 2017-04-15 01:21:12.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/rs6000-aix-tdep.c 2017-04-16 12:46:32.471381847 +0100
-@@ -186,9 +186,9 @@ rs6000_push_dummy_call (struct gdbarch *
- struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
- enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
- int ii;
-- int len = 0;
-+ LONGEST len = 0;
- int argno; /* current argument number */
-- int argbytes; /* current argument byte */
-+ LONGEST argbytes; /* current argument byte */
- gdb_byte tmp_buffer[50];
- int f_argno = 0; /* current floating point argno */
- int wordsize = gdbarch_tdep (gdbarch)->wordsize;
-@@ -319,7 +319,7 @@ ran_out_of_registers_for_arguments:
-
- if ((argno < nargs) || argbytes)
- {
-- int space = 0, jj;
-+ LONGEST space = 0, jj;
-
- if (argbytes)
- {
-diff -Naurp insight-7.12.50.20170416.orig/gdb/s390-linux-tdep.c insight-7.12.50.20170416.new/gdb/s390-linux-tdep.c
---- insight-7.12.50.20170416.orig/gdb/s390-linux-tdep.c 2017-03-25 10:42:37.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/s390-linux-tdep.c 2017-04-16 12:46:32.473381865 +0100
-@@ -3081,7 +3081,7 @@ s390_function_arg_vector (struct type *t
- /* Determine whether N is a power of two. */
-
- static int
--is_power_of_two (unsigned int n)
-+is_power_of_two (ULONGEST n)
- {
- return n && ((n & (n - 1)) == 0);
- }
-@@ -3138,7 +3138,7 @@ s390_handle_arg (struct s390_arg_state *
- enum bfd_endian byte_order, int is_unnamed)
- {
- struct type *type = check_typedef (value_type (arg));
-- unsigned int length = TYPE_LENGTH (type);
-+ ULONGEST length = TYPE_LENGTH (type);
- int write_mode = as->regcache != NULL;
-
- if (s390_function_arg_float (type))
-diff -Naurp insight-7.12.50.20170416.orig/gdb/score-tdep.c insight-7.12.50.20170416.new/gdb/score-tdep.c
---- insight-7.12.50.20170416.orig/gdb/score-tdep.c 2017-01-03 17:36:55.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/score-tdep.c 2017-04-16 12:46:32.474381875 +0100
-@@ -525,7 +525,7 @@ score_push_dummy_call (struct gdbarch *g
- enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
- int argnum;
- int argreg;
-- int arglen = 0;
-+ LONGEST arglen = 0;
- CORE_ADDR stack_offset = 0;
- CORE_ADDR addr = 0;
-
-diff -Naurp insight-7.12.50.20170416.orig/gdb/sh64-tdep.c insight-7.12.50.20170416.new/gdb/sh64-tdep.c
---- insight-7.12.50.20170416.orig/gdb/sh64-tdep.c 2017-04-09 01:11:01.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/sh64-tdep.c 2017-04-16 12:46:32.475381884 +0100
-@@ -1062,7 +1062,7 @@ sh64_push_dummy_call (struct gdbarch *gd
- CORE_ADDR struct_addr)
- {
- enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
-- int stack_offset, stack_alloc;
-+ LONGEST stack_offset, stack_alloc;
- int int_argreg;
- int float_arg_index = 0;
- int double_arg_index = 0;
-@@ -1071,7 +1071,7 @@ sh64_push_dummy_call (struct gdbarch *gd
- CORE_ADDR regval;
- const gdb_byte *val;
- gdb_byte valbuf[8];
-- int len;
-+ LONGEST len;
- int argreg_size;
- int fp_args[12];
-
-diff -Naurp insight-7.12.50.20170416.orig/gdb/sh-tdep.c insight-7.12.50.20170416.new/gdb/sh-tdep.c
---- insight-7.12.50.20170416.orig/gdb/sh-tdep.c 2017-04-15 01:21:12.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/sh-tdep.c 2017-04-16 12:46:32.474381875 +0100
-@@ -814,7 +814,7 @@ sh_skip_prologue (struct gdbarch *gdbarc
- static int
- sh_use_struct_convention (int renesas_abi, struct type *type)
- {
-- int len = TYPE_LENGTH (type);
-+ LONGEST len = TYPE_LENGTH (type);
- int nelem = TYPE_NFIELDS (type);
-
- /* The Renesas ABI returns aggregate types always on stack. */
-@@ -916,7 +916,7 @@ sh_frame_align (struct gdbarch *ignore,
-
- /* Helper function to justify value in register according to endianess. */
- static const gdb_byte *
--sh_justify_value_in_reg (struct gdbarch *gdbarch, struct value *val, int len)
-+sh_justify_value_in_reg (struct gdbarch *gdbarch, struct value *val, LONGEST len)
- {
- static gdb_byte valbuf[4];
-
-@@ -1076,7 +1076,8 @@ sh_push_dummy_call_fpu (struct gdbarch *
- struct type *type;
- CORE_ADDR regval;
- const gdb_byte *val;
-- int len, reg_size = 0;
-+ LONGEST len;
-+ int reg_size = 0;
- int pass_on_stack = 0;
- int treat_as_flt;
- int last_reg_arg = INT_MAX;
-@@ -1217,7 +1218,8 @@ sh_push_dummy_call_nofpu (struct gdbarch
- struct type *type;
- CORE_ADDR regval;
- const gdb_byte *val;
-- int len, reg_size = 0;
-+ LONGEST len;
-+ int reg_size = 0;
- int pass_on_stack = 0;
- int last_reg_arg = INT_MAX;
-
-diff -Naurp insight-7.12.50.20170416.orig/gdb/sparc64-tdep.c insight-7.12.50.20170416.new/gdb/sparc64-tdep.c
---- insight-7.12.50.20170416.orig/gdb/sparc64-tdep.c 2017-04-15 01:21:12.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/sparc64-tdep.c 2017-04-16 12:46:32.476381893 +0100
-@@ -696,7 +696,8 @@ sparc64_16_byte_align_p (struct type *ty
-
- static void
- sparc64_store_floating_fields (struct regcache *regcache, struct type *type,
-- const gdb_byte *valbuf, int element, int bitpos)
-+ const gdb_byte *valbuf, int element,
-+ LONGEST bitpos)
- {
- struct gdbarch *gdbarch = get_regcache_arch (regcache);
- int len = TYPE_LENGTH (type);
-@@ -740,7 +741,7 @@ sparc64_store_floating_fields (struct re
- for (i = 0; i < TYPE_NFIELDS (type); i++)
- {
- struct type *subtype = check_typedef (TYPE_FIELD_TYPE (type, i));
-- int subpos = bitpos + TYPE_FIELD_BITPOS (type, i);
-+ LONGEST subpos = bitpos + TYPE_FIELD_BITPOS (type, i);
-
- sparc64_store_floating_fields (regcache, subtype, valbuf,
- element, subpos);
-@@ -772,7 +773,7 @@ sparc64_store_floating_fields (struct re
-
- static void
- sparc64_extract_floating_fields (struct regcache *regcache, struct type *type,
-- gdb_byte *valbuf, int bitpos)
-+ gdb_byte *valbuf, LONGEST bitpos)
- {
- struct gdbarch *gdbarch = get_regcache_arch (regcache);
-
-@@ -812,7 +813,7 @@ sparc64_extract_floating_fields (struct
- for (i = 0; i < TYPE_NFIELDS (type); i++)
- {
- struct type *subtype = check_typedef (TYPE_FIELD_TYPE (type, i));
-- int subpos = bitpos + TYPE_FIELD_BITPOS (type, i);
-+ LONGEST subpos = bitpos + TYPE_FIELD_BITPOS (type, i);
-
- sparc64_extract_floating_fields (regcache, subtype, valbuf, subpos);
- }
-@@ -845,7 +846,7 @@ sparc64_store_arguments (struct regcache
- for (i = 0; i < nargs; i++)
- {
- struct type *type = value_type (args[i]);
-- int len = TYPE_LENGTH (type);
-+ LONGEST len = TYPE_LENGTH (type);
-
- if (sparc64_structure_or_union_p (type)
- || (sparc64_complex_floating_p (type) && len == 32))
-@@ -945,7 +946,7 @@ sparc64_store_arguments (struct regcache
- {
- const gdb_byte *valbuf = value_contents (args[i]);
- struct type *type = value_type (args[i]);
-- int len = TYPE_LENGTH (type);
-+ LONGEST len = TYPE_LENGTH (type);
- int regnum = -1;
- gdb_byte buf[16];
-
-diff -Naurp insight-7.12.50.20170416.orig/gdb/sparc-tdep.c insight-7.12.50.20170416.new/gdb/sparc-tdep.c
---- insight-7.12.50.20170416.orig/gdb/sparc-tdep.c 2017-04-16 12:45:38.764882267 +0100
-+++ insight-7.12.50.20170416.new/gdb/sparc-tdep.c 2017-04-16 12:46:32.475381884 +0100
-@@ -567,7 +567,7 @@ sparc32_store_arguments (struct regcache
- for (i = 0; i < nargs; i++)
- {
- struct type *type = value_type (args[i]);
-- int len = TYPE_LENGTH (type);
-+ LONGEST len = TYPE_LENGTH (type);
-
- if (sparc_structure_or_union_p (type)
- || (sparc_floating_p (type) && len == 16)
-diff -Naurp insight-7.12.50.20170416.orig/gdb/spu-tdep.c insight-7.12.50.20170416.new/gdb/spu-tdep.c
---- insight-7.12.50.20170416.orig/gdb/spu-tdep.c 2017-04-15 01:21:12.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/spu-tdep.c 2017-04-16 12:46:32.477381903 +0100
-@@ -1431,7 +1431,7 @@ spu_push_dummy_call (struct gdbarch *gdb
- struct value *arg = args[i];
- struct type *type = check_typedef (value_type (arg));
- const gdb_byte *contents = value_contents (arg);
-- int n_regs = align_up (TYPE_LENGTH (type), 16) / 16;
-+ LONGEST n_regs = align_up (TYPE_LENGTH (type), 16) / 16;
-
- /* If the argument doesn't wholly fit into registers, it and
- all subsequent arguments go to the stack. */
-@@ -1463,7 +1463,7 @@ spu_push_dummy_call (struct gdbarch *gdb
- {
- struct value *arg = args[i];
- struct type *type = check_typedef (value_type (arg));
-- int len = TYPE_LENGTH (type);
-+ LONGEST len = TYPE_LENGTH (type);
- int preferred_slot;
-
- if (spu_scalar_value_p (type))
-diff -Naurp insight-7.12.50.20170416.orig/gdb/tic6x-tdep.c insight-7.12.50.20170416.new/gdb/tic6x-tdep.c
---- insight-7.12.50.20170416.orig/gdb/tic6x-tdep.c 2017-01-03 17:36:55.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/tic6x-tdep.c 2017-04-16 12:46:32.478381912 +0100
-@@ -899,7 +899,7 @@ tic6x_push_dummy_call (struct gdbarch *g
- int argreg = 0;
- int argnum;
- int stack_offset = 4;
-- int references_offset = 4;
-+ LONGEST references_offset = 4;
- CORE_ADDR func_addr = find_function_addr (function, NULL);
- enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
- struct type *func_type = value_type (function);
-@@ -933,7 +933,7 @@ tic6x_push_dummy_call (struct gdbarch *g
- /* Now make space on the stack for the args. */
- for (argnum = 0; argnum < nargs; argnum++)
- {
-- int len = align_up (TYPE_LENGTH (value_type (args[argnum])), 4);
-+ LONGEST len = align_up (TYPE_LENGTH (value_type (args[argnum])), 4);
- if (argnum >= 10 - argreg)
- references_offset += len;
- stack_offset += len;
-@@ -952,7 +952,7 @@ tic6x_push_dummy_call (struct gdbarch *g
- const gdb_byte *val;
- struct value *arg = args[argnum];
- struct type *arg_type = check_typedef (value_type (arg));
-- int len = TYPE_LENGTH (arg_type);
-+ ssize_t len = TYPE_LENGTH (arg_type);
- enum type_code typecode = TYPE_CODE (arg_type);
-
- val = value_contents (arg);
-@@ -1112,7 +1112,8 @@ tic6x_push_dummy_call (struct gdbarch *g
- }
- else
- internal_error (__FILE__, __LINE__,
-- _("unexpected length %d of arg %d"), len, argnum);
-+ _("unexpected length %s of arg %d"),
-+ plongest (len), argnum);
-
- addr = sp + stack_offset;
- write_memory (addr, val, len);
-diff -Naurp insight-7.12.50.20170416.orig/gdb/tilegx-tdep.c insight-7.12.50.20170416.new/gdb/tilegx-tdep.c
---- insight-7.12.50.20170416.orig/gdb/tilegx-tdep.c 2017-01-03 17:36:55.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/tilegx-tdep.c 2017-04-16 12:46:32.478381912 +0100
-@@ -289,7 +289,7 @@ tilegx_push_dummy_call (struct gdbarch *
- CORE_ADDR stack_dest = sp;
- int argreg = TILEGX_R0_REGNUM;
- int i, j;
-- int typelen, slacklen;
-+ LONGEST typelen, slacklen;
- static const gdb_byte four_zero_words[16] = { 0 };
-
- /* If struct_return is 1, then the struct return address will
-diff -Naurp insight-7.12.50.20170416.orig/gdb/v850-tdep.c insight-7.12.50.20170416.new/gdb/v850-tdep.c
---- insight-7.12.50.20170416.orig/gdb/v850-tdep.c 2017-01-03 17:36:55.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/v850-tdep.c 2017-04-16 12:46:32.478381912 +0100
-@@ -1019,7 +1019,7 @@ v850_push_dummy_call (struct gdbarch *gd
- enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
- int argreg;
- int argnum;
-- int len = 0;
-+ LONGEST len = 0;
- int stack_offset;
-
- if (gdbarch_tdep (gdbarch)->abi == V850_ABI_RH850)
-@@ -1047,7 +1047,7 @@ v850_push_dummy_call (struct gdbarch *gd
- in four registers available. Loop thru args from first to last. */
- for (argnum = 0; argnum < nargs; argnum++)
- {
-- int len;
-+ LONGEST len;
- gdb_byte *val;
- gdb_byte valbuf[v850_reg_size];
-
-diff -Naurp insight-7.12.50.20170416.orig/gdb/vax-tdep.c insight-7.12.50.20170416.new/gdb/vax-tdep.c
---- insight-7.12.50.20170416.orig/gdb/vax-tdep.c 2017-04-16 12:45:39.005884509 +0100
-+++ insight-7.12.50.20170416.new/gdb/vax-tdep.c 2017-04-16 12:46:32.479381921 +0100
-@@ -111,7 +111,7 @@ vax_store_arguments (struct regcache *re
- struct gdbarch *gdbarch = get_regcache_arch (regcache);
- enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
- gdb_byte buf[4];
-- int count = 0;
-+ LONGEST count = 0;
- int i;
-
- /* We create an argument list on the stack, and make the argument
-@@ -120,7 +120,7 @@ vax_store_arguments (struct regcache *re
- /* Push arguments in reverse order. */
- for (i = nargs - 1; i >= 0; i--)
- {
-- int len = TYPE_LENGTH (value_enclosing_type (args[i]));
-+ LONGEST len = TYPE_LENGTH (value_enclosing_type (args[i]));
-
- sp -= (len + 3) & ~3;
- count += (len + 3) / 4;
-diff -Naurp insight-7.12.50.20170416.orig/gdb/xstormy16-tdep.c insight-7.12.50.20170416.new/gdb/xstormy16-tdep.c
---- insight-7.12.50.20170416.orig/gdb/xstormy16-tdep.c 2017-04-15 01:21:12.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/xstormy16-tdep.c 2017-04-16 12:46:32.479381921 +0100
-@@ -233,8 +233,9 @@ xstormy16_push_dummy_call (struct gdbarc
- enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
- CORE_ADDR stack_dest = sp;
- int argreg = E_1ST_ARG_REGNUM;
-- int i, j;
-- int typelen, slacklen;
-+ int i, slacklen;
-+ LONGEST j;
-+ LONGEST typelen;
- const gdb_byte *val;
- gdb_byte buf[xstormy16_pc_size];
-
-diff -Naurp insight-7.12.50.20170416.orig/gdb/xtensa-tdep.c insight-7.12.50.20170416.new/gdb/xtensa-tdep.c
---- insight-7.12.50.20170416.orig/gdb/xtensa-tdep.c 2017-04-15 01:21:12.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/xtensa-tdep.c 2017-04-16 12:46:32.480381930 +0100
-@@ -1637,8 +1637,7 @@ xtensa_store_return_value (struct type *
-
- if (len > (callsize > 8 ? 8 : 16))
- internal_error (__FILE__, __LINE__,
-- _("unimplemented for this length: %d"),
-- TYPE_LENGTH (type));
-+ _("unimplemented for this length: %d"), len);
- areg = arreg_number (gdbarch,
- gdbarch_tdep (gdbarch)->a0_base + 2 + callsize, wb);
-
-@@ -1712,18 +1711,18 @@ xtensa_push_dummy_call (struct gdbarch *
- {
- enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
- int i;
-- int size, onstack_size;
-+ LONGEST size, onstack_size;
- gdb_byte *buf = (gdb_byte *) alloca (16);
- CORE_ADDR ra, ps;
- struct argument_info
- {
- const bfd_byte *contents;
-- int length;
-+ ssize_t length;
- int onstack; /* onstack == 0 => in reg */
- int align; /* alignment */
- union
- {
-- int offset; /* stack offset if on stack. */
-+ ssize_t offset; /* stack offset if on stack. */
- int regno; /* regno if in register. */
- } u;
- };
-@@ -1747,9 +1746,10 @@ xtensa_push_dummy_call (struct gdbarch *
- {
- struct value *arg = args[i];
- struct type *arg_type = check_typedef (value_type (arg));
-- fprintf_unfiltered (gdb_stdlog, "%2d: %s %3d ", i,
-- host_address_to_string (arg),
-- TYPE_LENGTH (arg_type));
-+ const char *arg_type_len_s = pulongest (TYPE_LENGTH (arg_type));
-+
-+ fprintf_unfiltered (gdb_stdlog, "%2d: %s %s ", i,
-+ host_address_to_string (arg), arg_type_len_s);
- switch (TYPE_CODE (arg_type))
- {
- case TYPE_CODE_INT:
-@@ -1819,8 +1819,8 @@ xtensa_push_dummy_call (struct gdbarch *
- info->align = TYPE_LENGTH (builtin_type (gdbarch)->builtin_long);
- break;
- }
-- info->length = TYPE_LENGTH (arg_type);
- info->contents = value_contents (arg);
-+ info->length = TYPE_LENGTH (arg_type);
-
- /* Align size and onstack_size. */
- size = (size + info->align - 1) & ~(info->align - 1);
-@@ -1865,7 +1865,7 @@ xtensa_push_dummy_call (struct gdbarch *
-
- if (info->onstack)
- {
-- int n = info->length;
-+ ssize_t n = info->length;
- CORE_ADDR offset = sp + info->u.offset;
-
- /* Odd-sized structs are aligned to the lower side of a memory
-@@ -1881,7 +1881,7 @@ xtensa_push_dummy_call (struct gdbarch *
- }
- else
- {
-- int n = info->length;
-+ ssize_t n = info->length;
- const bfd_byte *cp = info->contents;
- int r = info->u.regno;
-
diff --git a/insight-7.12-gdb-rhbz795424-bitpos-25of25.patch b/insight-7.12-gdb-rhbz795424-bitpos-25of25.patch
deleted file mode 100644
index 8092552..0000000
--- a/insight-7.12-gdb-rhbz795424-bitpos-25of25.patch
+++ /dev/null
@@ -1,84 +0,0 @@
-diff -Naurp insight-7.12.50.20170416.orig/gdb/f-lang.h insight-7.12.50.20170416.new/gdb/f-lang.h
---- insight-7.12.50.20170416.orig/gdb/f-lang.h 2017-04-16 12:50:42.704709525 +0100
-+++ insight-7.12.50.20170416.new/gdb/f-lang.h 2017-04-16 12:51:39.948242006 +0100
-@@ -49,9 +49,9 @@ struct common_block
- struct symbol *contents[1];
- };
-
--extern int f77_get_upperbound (struct type *);
-+extern LONGEST f77_get_upperbound (struct type *);
-
--extern int f77_get_lowerbound (struct type *);
-+extern LONGEST f77_get_lowerbound (struct type *);
-
- extern void f77_get_dynamic_array_length (struct type *);
-
-diff -Naurp insight-7.12.50.20170416.orig/gdb/f-typeprint.c insight-7.12.50.20170416.new/gdb/f-typeprint.c
---- insight-7.12.50.20170416.orig/gdb/f-typeprint.c 2017-03-04 04:09:18.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/f-typeprint.c 2017-04-16 12:53:44.404399699 +0100
-@@ -161,7 +161,7 @@ f_type_print_varspec_suffix (struct type
- int show, int passed_a_ptr, int demangled_args,
- int arrayprint_recurse_level)
- {
-- int upper_bound, lower_bound;
-+ LONGEST upper_bound, lower_bound;
-
- /* No static variables are permitted as an error call may occur during
- execution of this function. */
-@@ -194,7 +194,7 @@ f_type_print_varspec_suffix (struct type
-
- lower_bound = f77_get_lowerbound (type);
- if (lower_bound != 1) /* Not the default. */
-- fprintf_filtered (stream, "%d:", lower_bound);
-+ fprintf_filtered (stream, "%s:", plongest (lower_bound));
-
- /* Make sure that, if we have an assumed size array, we
- print out a warning and print the upperbound as '*'. */
-@@ -204,7 +204,7 @@ f_type_print_varspec_suffix (struct type
- else
- {
- upper_bound = f77_get_upperbound (type);
-- fprintf_filtered (stream, "%d", upper_bound);
-+ fprintf_filtered (stream, "%s", plongest (upper_bound));
- }
-
- if (TYPE_CODE (TYPE_TARGET_TYPE (type)) != TYPE_CODE_ARRAY)
-@@ -273,7 +273,7 @@ void
- f_type_print_base (struct type *type, struct ui_file *stream, int show,
- int level)
- {
-- int upper_bound;
-+ LONGEST upper_bound;
- int index;
-
- QUIT;
-@@ -355,7 +355,7 @@ f_type_print_base (struct type *type, st
- else
- {
- upper_bound = f77_get_upperbound (type);
-- fprintf_filtered (stream, "character*%d", upper_bound);
-+ fprintf_filtered (stream, "character*%s", plongest (upper_bound));
- }
- break;
-
-diff -Naurp insight-7.12.50.20170416.orig/gdb/f-valprint.c insight-7.12.50.20170416.new/gdb/f-valprint.c
---- insight-7.12.50.20170416.orig/gdb/f-valprint.c 2017-04-16 12:50:42.705709534 +0100
-+++ insight-7.12.50.20170416.new/gdb/f-valprint.c 2017-04-16 12:51:39.950242024 +0100
-@@ -43,7 +43,7 @@ LONGEST f77_array_offset_tbl[MAX_FORTRAN
- /* Array which holds offsets to be applied to get a row's elements
- for a given array. Array also holds the size of each subarray. */
-
--int
-+LONGEST
- f77_get_lowerbound (struct type *type)
- {
- if (TYPE_ARRAY_LOWER_BOUND_IS_UNDEFINED (type))
-@@ -52,7 +52,7 @@ f77_get_lowerbound (struct type *type)
- return TYPE_ARRAY_LOWER_BOUND_VALUE (type);
- }
-
--int
-+LONGEST
- f77_get_upperbound (struct type *type)
- {
- if (TYPE_ARRAY_UPPER_BOUND_IS_UNDEFINED (type))
diff --git a/insight-7.12-gdb-vla-intel-fortran-strides.patch b/insight-7.12-gdb-vla-intel-fortran-strides.patch
deleted file mode 100644
index 3b0e685..0000000
--- a/insight-7.12-gdb-vla-intel-fortran-strides.patch
+++ /dev/null
@@ -1,1942 +0,0 @@
-diff -Naurp insight-7.12.50.20170416.orig/gdb/dwarf2loc.c insight-7.12.50.20170416.new/gdb/dwarf2loc.c
---- insight-7.12.50.20170416.orig/gdb/dwarf2loc.c 2017-04-16 14:23:22.918275412 +0100
-+++ insight-7.12.50.20170416.new/gdb/dwarf2loc.c 2017-04-16 14:24:24.088833984 +0100
-@@ -2625,11 +2625,14 @@ dwarf2_locexpr_baton_eval (const struct
- /* 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;
-
-@@ -2653,7 +2656,7 @@ dwarf2_evaluate_property (const struct d
-
- *value = value_as_address (val);
- }
-- return 1;
-+ rc = 1;
- }
- }
- break;
-@@ -2675,7 +2678,7 @@ dwarf2_evaluate_property (const struct d
- if (!value_optimized_out (val))
- {
- *value = value_as_address (val);
-- return 1;
-+ rc = 1;
- }
- }
- }
-@@ -2683,8 +2686,8 @@ dwarf2_evaluate_property (const struct d
-
- case PROP_CONST:
- *value = prop->data.const_val;
-- return 1;
--
-+ rc = 1;
-+ break;
- case PROP_ADDR_OFFSET:
- {
- struct dwarf2_property_baton *baton
-@@ -2705,11 +2708,38 @@ dwarf2_evaluate_property (const struct d
- val = value_at (baton->offset_info.type,
- pinfo->addr + baton->offset_info.offset);
- *value = value_as_address (val);
-- return 1;
-+ rc = 1;
- }
-+ break;
-+ }
-+
-+ 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;
-+}
-
-- return 0;
-+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 -Naurp insight-7.12.50.20170416.orig/gdb/dwarf2loc.h insight-7.12.50.20170416.new/gdb/dwarf2loc.h
---- insight-7.12.50.20170416.orig/gdb/dwarf2loc.h 2017-03-18 01:22:31.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/dwarf2loc.h 2017-04-16 14:24:24.088833984 +0100
-@@ -143,6 +143,12 @@ int dwarf2_evaluate_property (const stru
- 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 -Naurp insight-7.12.50.20170416.orig/gdb/dwarf2read.c insight-7.12.50.20170416.new/gdb/dwarf2read.c
---- insight-7.12.50.20170416.orig/gdb/dwarf2read.c 2017-04-16 14:23:22.973275917 +0100
-+++ insight-7.12.50.20170416.new/gdb/dwarf2read.c 2017-04-16 15:14:21.011106705 +0100
-@@ -505,7 +505,7 @@ struct dwarf2_cu
- int last_used;
-
- /* A hash table of DIE cu_offset for following references with
-- die_info->offset.sect_off as hash. */
-+ die_info->sect_off as hash. */
- htab_t die_hash;
-
- /* Full DIEs if read in. */
-@@ -8443,7 +8443,7 @@ process_die (struct die_info *die, struc
- {
- complaint (&symfile_complaints,
- _("DIE at 0x%x attempted to be processed twice"),
-- die->offset.sect_off);
-+ to_underlying (die->sect_off));
- return;
- }
-
-@@ -15290,7 +15290,7 @@ read_subrange_type (struct die_info *die
- 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;
-@@ -15310,7 +15310,9 @@ read_subrange_type (struct die_info *die
-
- 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. */
-@@ -15343,6 +15345,13 @@ read_subrange_type (struct die_info *die
- break;
- }
-
-+ attr = dwarf2_attr (die, DW_AT_byte_stride, cu);
-+ if (attr)
-+ if (!attr_to_dynamic_prop (attr, die, cu, &stride))
-+ complaint (&symfile_complaints, _("Missing DW_AT_byte_stride "
-+ "- DIE at 0x%x [in module %s]"),
-+ to_underlying (die->sect_off), objfile_name (cu->objfile));
-+
- attr = dwarf2_attr (die, DW_AT_lower_bound, cu);
- if (attr)
- attr_to_dynamic_prop (attr, die, cu, &low);
-@@ -15419,7 +15428,7 @@ read_subrange_type (struct die_info *die
- && !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 -Naurp insight-7.12.50.20170416.orig/gdb/eval.c insight-7.12.50.20170416.new/gdb/eval.c
---- insight-7.12.50.20170416.orig/gdb/eval.c 2017-04-16 14:23:22.888275136 +0100
-+++ insight-7.12.50.20170416.new/gdb/eval.c 2017-04-16 14:24:24.094834039 +0100
-@@ -380,29 +380,325 @@ init_array_element (struct value *array,
- return index;
- }
-
-+/* Evaluates any operation on Fortran arrays or strings with at least
-+ one user provided parameter. Expects the input ARRAY to be either
-+ an array, or a string. Evaluates EXP by incrementing POS, and
-+ writes the content from the elt stack into a local struct. NARGS
-+ specifies number of literal or range arguments the user provided.
-+ NARGS must be the same number as ARRAY has dimensions. */
-+
- static struct value *
--value_f90_subarray (struct value *array,
-- struct expression *exp, int *pos, enum noside noside)
-+value_f90_subarray (struct value *array, struct expression *exp,
-+ int *pos, int nargs, enum noside noside)
- {
-- int pc = (*pos) + 1;
-+ int i, dim_count = 0;
- LONGEST low_bound, high_bound;
-- struct type *range = check_typedef (TYPE_INDEX_TYPE (value_type (array)));
-- enum range_type range_type
-- = (enum range_type) longest_to_int (exp->elts[pc].longconst);
--
-- *pos += 3;
-+ struct value *new_array = array;
-+ struct type *array_type = check_typedef (value_type (new_array));
-+ struct type *elt_type;
-+
-+ typedef struct subscript_range
-+ {
-+ enum range_type f90_range_type;
-+ LONGEST low, high, stride;
-+ } subscript_range;
-+
-+ typedef enum subscript_kind
-+ {
-+ SUBSCRIPT_RANGE, /* e.g. "(lowbound:highbound)" */
-+ SUBSCRIPT_INDEX /* e.g. "(literal)" */
-+ } kind;
-+
-+ /* Local struct to hold user data for Fortran subarray dimensions. */
-+ struct subscript_store
-+ {
-+ /* For every dimension, we are either working on a range or an index
-+ expression, so we store this info separately for later. */
-+ enum subscript_kind kind;
-+
-+ /* We also store either the lower and upper bound info, or the index
-+ number. Before evaluation of the input values, we do not know if we are
-+ actually working on a range of ranges, or an index in a range. So as a
-+ first step we store all input in a union. The array calculation itself
-+ deals with this later on. */
-+ union element_range
-+ {
-+ subscript_range range;
-+ LONGEST number;
-+ } U;
-+ } *subscript_array;
-+
-+ /* Check if the number of arguments provided by the user matches
-+ the number of dimension of the array. A string has only one
-+ dimension. */
-+ if (nargs != calc_f77_array_dims (value_type (new_array)))
-+ error (_("Wrong number of subscripts"));
-+
-+ subscript_array = (struct subscript_store*) alloca (sizeof (*subscript_array) * nargs);
-+
-+ /* Parse the user input into the SUBSCRIPT_ARRAY to store it. We need
-+ to evaluate it first, as the input is from left-to-right. The
-+ array is stored from right-to-left. So we have to use the user
-+ input in reverse order. Later on, we need the input information to
-+ re-calculate the output array. For multi-dimensional arrays, we
-+ can be dealing with any possible combination of ranges and indices
-+ for every dimension. */
-+ for (i = 0; i < nargs; i++)
-+ {
-+ struct subscript_store *index = &subscript_array[i];
-
-- if (range_type == LOW_BOUND_DEFAULT || range_type == BOTH_BOUND_DEFAULT)
-- low_bound = TYPE_LOW_BOUND (range);
-- else
-- low_bound = value_as_long (evaluate_subexp (NULL_TYPE, exp, pos, noside));
-+ /* The user input is a range, with or without lower and upper bound.
-+ E.g.: "p arry(2:5)", "p arry( :5)", "p arry( : )", etc. */
-+ if (exp->elts[*pos].opcode == OP_RANGE)
-+ {
-+ int pc = (*pos) + 1;
-+ subscript_range *range;
-
-- if (range_type == HIGH_BOUND_DEFAULT || range_type == BOTH_BOUND_DEFAULT)
-- high_bound = TYPE_HIGH_BOUND (range);
-- else
-- high_bound = value_as_long (evaluate_subexp (NULL_TYPE, exp, pos, noside));
-+ index->kind = SUBSCRIPT_RANGE;
-+ range = &index->U.range;
-+
-+ *pos += 3;
-+ range->f90_range_type = (enum range_type) exp->elts[pc].longconst;
-+
-+ /* If a lower bound was provided by the user, the bit has been
-+ set and we can assign the value from the elt stack. Same for
-+ upper bound. */
-+ if ((range->f90_range_type & SUBARRAY_LOW_BOUND)
-+ == SUBARRAY_LOW_BOUND)
-+ range->low = value_as_long (evaluate_subexp (NULL_TYPE, exp,
-+ pos, noside));
-+ if ((range->f90_range_type & SUBARRAY_HIGH_BOUND)
-+ == SUBARRAY_HIGH_BOUND)
-+ range->high = value_as_long (evaluate_subexp (NULL_TYPE, exp,
-+ pos, noside));
-+
-+ /* Assign the user's stride value if provided. */
-+ if ((range->f90_range_type & SUBARRAY_STRIDE) == SUBARRAY_STRIDE)
-+ range->stride = value_as_long (evaluate_subexp (NULL_TYPE, exp,
-+ pos, noside));
-+
-+ /* Assign the default stride value '1'. */
-+ else
-+ range->stride = 1;
-+
-+ /* Check the provided stride value is illegal, aka '0'. */
-+ if (range->stride == 0)
-+ error (_("Stride must not be 0"));
-+ }
-+ /* User input is an index. E.g.: "p arry(5)". */
-+ else
-+ {
-+ struct value *val;
-+
-+ index->kind = SUBSCRIPT_INDEX;
-+
-+ /* Evaluate each subscript; it must be a legal integer in F77. This
-+ ensures the validity of the provided index. */
-+ val = evaluate_subexp_with_coercion (exp, pos, noside);
-+ index->U.number = value_as_long (val);
-+ }
-+
-+ }
-+
-+ /* Traverse the array from right to left and set the high and low bounds
-+ for later use. */
-+ for (i = nargs - 1; i >= 0; i--)
-+ {
-+ struct subscript_store *index = &subscript_array[i];
-+ struct type *index_type = TYPE_INDEX_TYPE (array_type);
-+
-+ switch (index->kind)
-+ {
-+ case SUBSCRIPT_RANGE:
-+ {
-+
-+ /* When we hit the first range specified by the user, we must
-+ treat any subsequent user entry as a range. We simply
-+ increment DIM_COUNT which tells us how many times we are
-+ calling VALUE_SLICE_1. */
-+ subscript_range *range = &index->U.range;
-+
-+ /* If no lower bound was provided by the user, we take the
-+ default boundary. Same for the high bound. */
-+ if ((range->f90_range_type & SUBARRAY_LOW_BOUND) == 0)
-+ range->low = TYPE_LOW_BOUND (index_type);
-+
-+ if ((range->f90_range_type & SUBARRAY_HIGH_BOUND) == 0)
-+ range->high = TYPE_HIGH_BOUND (index_type);
-+
-+ /* Both user provided low and high bound have to be inside the
-+ array bounds. Throw an error if not. */
-+ if (range->low < TYPE_LOW_BOUND (index_type)
-+ || range->low > TYPE_HIGH_BOUND (index_type)
-+ || range->high < TYPE_LOW_BOUND (index_type)
-+ || range->high > TYPE_HIGH_BOUND (index_type))
-+ error (_("provided bound(s) outside array bound(s)"));
-+
-+ /* For a negative stride the lower boundary must be larger than the
-+ upper boundary.
-+ For a positive stride the lower boundary must be smaller than the
-+ upper boundary. */
-+ if ((range->stride < 0 && range->low < range->high)
-+ || (range->stride > 0 && range->low > range->high))
-+ error (_("Wrong value provided for stride and boundaries"));
-+
-+ }
-+ break;
-+
-+ case SUBSCRIPT_INDEX:
-+ break;
-
-- return value_slice (array, low_bound, high_bound - low_bound + 1);
-+ }
-+
-+ array_type = TYPE_TARGET_TYPE (array_type);
-+ }
-+
-+ /* Reset ARRAY_TYPE before slicing.*/
-+ array_type = check_typedef (value_type (new_array));
-+
-+ /* Traverse the array from right to left and evaluate each corresponding
-+ user input. VALUE_SUBSCRIPT is called for every index, until a range
-+ expression is evaluated. After a range expression has been evaluated,
-+ every subsequent expression is also treated as a range. */
-+ for (i = nargs - 1; i >= 0; i--)
-+ {
-+ struct subscript_store *index = &subscript_array[i];
-+ struct type *index_type = TYPE_INDEX_TYPE (array_type);
-+
-+ switch (index->kind)
-+ {
-+ case SUBSCRIPT_RANGE:
-+ {
-+
-+ /* When we hit the first range specified by the user, we must
-+ treat any subsequent user entry as a range. We simply
-+ increment DIM_COUNT which tells us how many times we are
-+ calling VALUE_SLICE_1. */
-+ subscript_range *range = &index->U.range;
-+
-+ /* DIM_COUNT counts every user argument that is treated as a range.
-+ This is necessary for expressions like 'print array(7, 8:9).
-+ Here the first argument is a literal, but must be treated as a
-+ range argument to allow the correct output representation. */
-+ dim_count++;
-+
-+ new_array
-+ = value_slice_1 (new_array, range->low,
-+ range->high - range->low + 1,
-+ range->stride, dim_count);
-+ }
-+ break;
-+
-+ case SUBSCRIPT_INDEX:
-+ {
-+ /* DIM_COUNT only stays '0' when no range argument was processed
-+ before, starting from the last dimension. This way we can
-+ reduce the number of dimensions from the result array.
-+ However, if a range has been processed before an index, we
-+ treat the index like a range with equal low- and high bounds
-+ to get the value offset right. */
-+ if (dim_count == 0)
-+ new_array
-+ = value_subscripted_rvalue (new_array, index->U.number,
-+ f77_get_lowerbound (value_type
-+ (new_array)));
-+ else
-+ {
-+ dim_count++;
-+
-+ /* We might end up here, because we have to treat the provided
-+ index like a range. But now VALUE_SUBSCRIPTED_RVALUE
-+ cannot do the range checks for us. So we have to make sure
-+ ourselves that the user provided index is inside the
-+ array bounds. Throw an error if not. */
-+ if (index->U.number < TYPE_LOW_BOUND (index_type)
-+ && index->U.number > TYPE_HIGH_BOUND (index_type))
-+ error (_("provided bound(s) outside array bound(s)"));
-+
-+ if (index->U.number > TYPE_LOW_BOUND (index_type)
-+ && index->U.number > TYPE_HIGH_BOUND (index_type))
-+ error (_("provided bound(s) outside array bound(s)"));
-+
-+ new_array = value_slice_1 (new_array,
-+ index->U.number,
-+ 1, /* COUNT is '1' element */
-+ 1, /* STRIDE set to '1' */
-+ dim_count);
-+ }
-+
-+ }
-+ break;
-+ }
-+ array_type = TYPE_TARGET_TYPE (array_type);
-+ }
-+
-+ /* With DIM_COUNT > 1 we currently have a one dimensional array, but expect
-+ an array of arrays, depending on how many ranges have been provided by
-+ the user. So we need to rebuild the array dimensions for printing it
-+ correctly.
-+ Starting from right to left in the user input, after we hit the first
-+ range argument every subsequent argument is also treated as a range.
-+ E.g.:
-+ "p ary(3, 7, 2:15)" in Fortran has only 1 dimension, but we calculated 3
-+ ranges.
-+ "p ary(3, 7:12, 4)" in Fortran has only 1 dimension, but we calculated 2
-+ ranges.
-+ "p ary(2:4, 5, 7)" in Fortran has only 1 dimension, and we calculated 1
-+ range. */
-+ if (dim_count > 1)
-+ {
-+ struct value *v = NULL;
-+
-+ elt_type = TYPE_TARGET_TYPE (value_type (new_array));
-+
-+ /* Every SUBSCRIPT_RANGE in the user input signifies an actual range in
-+ the output array. So we traverse the SUBSCRIPT_ARRAY again, looking
-+ for a range entry. When we find one, we use the range info to create
-+ an additional range_type to set the correct bounds and dimensions for
-+ the output array. In addition, we may have a stride value that is not
-+ '1', forcing us to adjust the number of elements in a range, according
-+ to the stride value. */
-+ for (i = 0; i < nargs; i++)
-+ {
-+ struct subscript_store *index = &subscript_array[i];
-+
-+ if (index->kind == SUBSCRIPT_RANGE)
-+ {
-+ struct type *range_type, *interim_array_type;
-+
-+ int new_length;
-+
-+ /* The length of a sub-dimension with all elements between the
-+ bounds plus the start element itself. It may be modified by
-+ a user provided stride value. */
-+ new_length = index->U.range.high - index->U.range.low;
-+
-+ new_length /= index->U.range.stride;
-+
-+ range_type
-+ = create_static_range_type (NULL,
-+ elt_type,
-+ index->U.range.low,
-+ index->U.range.low + new_length);
-+
-+ interim_array_type = create_array_type (NULL,
-+ elt_type,
-+ range_type);
-+
-+ TYPE_CODE (interim_array_type)
-+ = TYPE_CODE (value_type (new_array));
-+
-+ v = allocate_value (interim_array_type);
-+
-+ elt_type = value_type (v);
-+ }
-+
-+ }
-+ value_contents_copy (v, 0, new_array, 0, TYPE_LENGTH (elt_type));
-+ return v;
-+ }
-+
-+ return new_array;
- }
-
-
-@@ -1791,19 +2087,8 @@ evaluate_subexp_standard (struct type *e
- switch (code)
- {
- case TYPE_CODE_ARRAY:
-- if (exp->elts[*pos].opcode == OP_RANGE)
-- return value_f90_subarray (arg1, exp, pos, noside);
-- else
-- goto multi_f77_subscript;
--
- case TYPE_CODE_STRING:
-- if (exp->elts[*pos].opcode == OP_RANGE)
-- return value_f90_subarray (arg1, exp, pos, noside);
-- else
-- {
-- arg2 = evaluate_subexp_with_coercion (exp, pos, noside);
-- return value_subscript (arg1, value_as_long (arg2));
-- }
-+ return value_f90_subarray (arg1, exp, pos, nargs, noside);
-
- case TYPE_CODE_PTR:
- case TYPE_CODE_FUNC:
-@@ -2204,49 +2489,6 @@ evaluate_subexp_standard (struct type *e
- }
- return (arg1);
-
-- multi_f77_subscript:
-- {
-- LONGEST subscript_array[MAX_FORTRAN_DIMS];
-- int ndimensions = 1, i;
-- struct value *array = arg1;
--
-- if (nargs > MAX_FORTRAN_DIMS)
-- error (_("Too many subscripts for F77 (%d Max)"), MAX_FORTRAN_DIMS);
--
-- ndimensions = calc_f77_array_dims (type);
--
-- if (nargs != ndimensions)
-- error (_("Wrong number of subscripts"));
--
-- gdb_assert (nargs > 0);
--
-- /* Now that we know we have a legal array subscript expression
-- let us actually find out where this element exists in the array. */
--
-- /* Take array indices left to right. */
-- for (i = 0; i < nargs; i++)
-- {
-- /* Evaluate each subscript; it must be a legal integer in F77. */
-- arg2 = evaluate_subexp_with_coercion (exp, pos, noside);
--
-- /* Fill in the subscript array. */
--
-- subscript_array[i] = value_as_long (arg2);
-- }
--
-- /* Internal type of array is arranged right to left. */
-- for (i = nargs; i > 0; i--)
-- {
-- struct type *array_type = check_typedef (value_type (array));
-- LONGEST index = subscript_array[i - 1];
--
-- array = value_subscripted_rvalue (array, index,
-- f77_get_lowerbound (array_type));
-- }
--
-- return array;
-- }
--
- case BINOP_LOGICAL_AND:
- arg1 = evaluate_subexp (NULL_TYPE, exp, pos, noside);
- if (noside == EVAL_SKIP)
-@@ -3103,6 +3345,9 @@ calc_f77_array_dims (struct type *array_
- int ndimen = 1;
- struct type *tmp_type;
-
-+ if (TYPE_CODE (array_type) == TYPE_CODE_STRING)
-+ return 1;
-+
- if ((TYPE_CODE (array_type) != TYPE_CODE_ARRAY))
- error (_("Can't get dimensions for a non-array type"));
-
-diff -Naurp insight-7.12.50.20170416.orig/gdb/expprint.c insight-7.12.50.20170416.new/gdb/expprint.c
---- insight-7.12.50.20170416.orig/gdb/expprint.c 2017-04-09 01:11:01.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/expprint.c 2017-04-16 14:24:24.095834048 +0100
-@@ -568,12 +568,10 @@ print_subexp_standard (struct expression
- *pos += 2;
-
- fputs_filtered ("RANGE(", stream);
-- if (range_type == HIGH_BOUND_DEFAULT
-- || range_type == NONE_BOUND_DEFAULT)
-+ if ((range_type & SUBARRAY_LOW_BOUND) == SUBARRAY_LOW_BOUND)
- print_subexp (exp, pos, stream, PREC_ABOVE_COMMA);
- fputs_filtered ("..", stream);
-- if (range_type == LOW_BOUND_DEFAULT
-- || range_type == NONE_BOUND_DEFAULT)
-+ if ((range_type & SUBARRAY_HIGH_BOUND) == SUBARRAY_HIGH_BOUND)
- print_subexp (exp, pos, stream, PREC_ABOVE_COMMA);
- fputs_filtered (")", stream);
- return;
-@@ -1055,16 +1053,16 @@ dump_subexp_body_standard (struct expres
-
- switch (range_type)
- {
-- case BOTH_BOUND_DEFAULT:
-+ case SUBARRAY_NONE_BOUND:
- fputs_filtered ("Range '..'", stream);
- break;
-- case LOW_BOUND_DEFAULT:
-+ case SUBARRAY_HIGH_BOUND:
- fputs_filtered ("Range '..EXP'", stream);
- break;
-- case HIGH_BOUND_DEFAULT:
-+ case SUBARRAY_LOW_BOUND:
- fputs_filtered ("Range 'EXP..'", stream);
- break;
-- case NONE_BOUND_DEFAULT:
-+ case (SUBARRAY_LOW_BOUND | SUBARRAY_HIGH_BOUND):
- fputs_filtered ("Range 'EXP..EXP'", stream);
- break;
- default:
-@@ -1072,11 +1070,9 @@ dump_subexp_body_standard (struct expres
- break;
- }
-
-- if (range_type == HIGH_BOUND_DEFAULT
-- || range_type == NONE_BOUND_DEFAULT)
-+ if ((range_type & SUBARRAY_LOW_BOUND) == SUBARRAY_LOW_BOUND)
- elt = dump_subexp (exp, stream, elt);
-- if (range_type == LOW_BOUND_DEFAULT
-- || range_type == NONE_BOUND_DEFAULT)
-+ if ((range_type & SUBARRAY_HIGH_BOUND) == SUBARRAY_HIGH_BOUND)
- elt = dump_subexp (exp, stream, elt);
- }
- break;
-diff -Naurp insight-7.12.50.20170416.orig/gdb/expression.h insight-7.12.50.20170416.new/gdb/expression.h
---- insight-7.12.50.20170416.orig/gdb/expression.h 2017-04-09 01:11:01.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/expression.h 2017-04-16 14:24:24.095834048 +0100
-@@ -154,17 +154,17 @@ extern void dump_raw_expression (struct
- struct ui_file *, const char *);
- extern void dump_prefix_expression (struct expression *, struct ui_file *);
-
--/* In an OP_RANGE expression, either bound could be empty, indicating
-- that its value is by default that of the corresponding bound of the
-- array or string. So we have four sorts of subrange. This
-- enumeration type is to identify this. */
--
-+/* In an OP_RANGE expression, either bound can be provided by the user, or not.
-+ In addition to this, the user can also specify a stride value to indicated
-+ only certain elements of the array. This enumeration type is to identify
-+ this. */
-+
- enum range_type
- {
-- BOTH_BOUND_DEFAULT, /* "(:)" */
-- LOW_BOUND_DEFAULT, /* "(:high)" */
-- HIGH_BOUND_DEFAULT, /* "(low:)" */
-- NONE_BOUND_DEFAULT /* "(low:high)" */
-+ SUBARRAY_NONE_BOUND = 0x0, /* "( : )" */
-+ SUBARRAY_LOW_BOUND = 0x1, /* "(low:)" */
-+ SUBARRAY_HIGH_BOUND = 0x2, /* "(:high)" */
-+ SUBARRAY_STRIDE = 0x4 /* "(::stride)" */
- };
-
- #endif /* !defined (EXPRESSION_H) */
-diff -Naurp insight-7.12.50.20170416.orig/gdb/f-exp.y insight-7.12.50.20170416.new/gdb/f-exp.y
---- insight-7.12.50.20170416.orig/gdb/f-exp.y 2017-04-09 01:11:01.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/f-exp.y 2017-04-16 14:24:24.095834048 +0100
-@@ -254,31 +254,63 @@ arglist : subrange
-
- arglist : arglist ',' exp %prec ABOVE_COMMA
- { arglist_len++; }
-+ | arglist ',' subrange %prec ABOVE_COMMA
-+ { arglist_len++; }
- ;
-
- /* There are four sorts of subrange types in F90. */
-
- subrange: exp ':' exp %prec ABOVE_COMMA
-- { write_exp_elt_opcode (pstate, OP_RANGE);
-- write_exp_elt_longcst (pstate, NONE_BOUND_DEFAULT);
-+ { write_exp_elt_opcode (pstate, OP_RANGE);
-+ write_exp_elt_longcst (pstate,
-+ SUBARRAY_LOW_BOUND | SUBARRAY_HIGH_BOUND);
- write_exp_elt_opcode (pstate, OP_RANGE); }
- ;
-
- subrange: exp ':' %prec ABOVE_COMMA
- { write_exp_elt_opcode (pstate, OP_RANGE);
-- write_exp_elt_longcst (pstate, HIGH_BOUND_DEFAULT);
-+ write_exp_elt_longcst (pstate, SUBARRAY_LOW_BOUND);
- write_exp_elt_opcode (pstate, OP_RANGE); }
- ;
-
- subrange: ':' exp %prec ABOVE_COMMA
- { write_exp_elt_opcode (pstate, OP_RANGE);
-- write_exp_elt_longcst (pstate, LOW_BOUND_DEFAULT);
-+ write_exp_elt_longcst (pstate, SUBARRAY_HIGH_BOUND);
- write_exp_elt_opcode (pstate, OP_RANGE); }
- ;
-
- subrange: ':' %prec ABOVE_COMMA
- { write_exp_elt_opcode (pstate, OP_RANGE);
-- write_exp_elt_longcst (pstate, BOTH_BOUND_DEFAULT);
-+ write_exp_elt_longcst (pstate, SUBARRAY_NONE_BOUND);
-+ write_exp_elt_opcode (pstate, OP_RANGE); }
-+ ;
-+
-+/* Each subrange type can have a stride argument. */
-+subrange: exp ':' exp ':' exp %prec ABOVE_COMMA
-+ { write_exp_elt_opcode (pstate, OP_RANGE);
-+ write_exp_elt_longcst (pstate, SUBARRAY_LOW_BOUND
-+ | SUBARRAY_HIGH_BOUND
-+ | SUBARRAY_STRIDE);
-+ write_exp_elt_opcode (pstate, OP_RANGE); }
-+ ;
-+
-+subrange: exp ':' ':' exp %prec ABOVE_COMMA
-+ { write_exp_elt_opcode (pstate, OP_RANGE);
-+ write_exp_elt_longcst (pstate, SUBARRAY_LOW_BOUND
-+ | SUBARRAY_STRIDE);
-+ write_exp_elt_opcode (pstate, OP_RANGE); }
-+ ;
-+
-+subrange: ':' exp ':' exp %prec ABOVE_COMMA
-+ { write_exp_elt_opcode (pstate, OP_RANGE);
-+ write_exp_elt_longcst (pstate, SUBARRAY_HIGH_BOUND
-+ | SUBARRAY_STRIDE);
-+ write_exp_elt_opcode (pstate, OP_RANGE); }
-+ ;
-+
-+subrange: ':' ':' exp %prec ABOVE_COMMA
-+ { write_exp_elt_opcode (pstate, OP_RANGE);
-+ write_exp_elt_longcst (pstate, SUBARRAY_STRIDE);
- write_exp_elt_opcode (pstate, OP_RANGE); }
- ;
-
-diff -Naurp insight-7.12.50.20170416.orig/gdb/f-valprint.c insight-7.12.50.20170416.new/gdb/f-valprint.c
---- insight-7.12.50.20170416.orig/gdb/f-valprint.c 2017-04-16 14:23:22.963275825 +0100
-+++ insight-7.12.50.20170416.new/gdb/f-valprint.c 2017-04-16 14:24:24.096834057 +0100
-@@ -121,8 +121,14 @@ f77_print_array_1 (int nss, int ndimensi
-
- if (nss != ndimensions)
- {
-- size_t dim_size = TYPE_LENGTH (TYPE_TARGET_TYPE (type));
-+ size_t dim_size;
- size_t offs = 0;
-+ LONGEST byte_stride = abs (TYPE_BYTE_STRIDE (range_type));
-+
-+ if (byte_stride)
-+ dim_size = byte_stride;
-+ else
-+ dim_size = TYPE_LENGTH (TYPE_TARGET_TYPE (type));
-
- for (i = lowerbound;
- (i < upperbound + 1 && (*elts) < options->print_max);
-diff -Naurp insight-7.12.50.20170416.orig/gdb/gdbtypes.c insight-7.12.50.20170416.new/gdb/gdbtypes.c
---- insight-7.12.50.20170416.orig/gdb/gdbtypes.c 2017-04-16 14:23:22.893275182 +0100
-+++ insight-7.12.50.20170416.new/gdb/gdbtypes.c 2017-04-16 14:24:24.097834067 +0100
-@@ -862,7 +862,8 @@ allocate_stub_method (struct type *type)
- struct type *
- create_range_type (struct type *result_type, struct type *index_type,
- const struct dynamic_prop *low_bound,
-- const struct dynamic_prop *high_bound)
-+ const struct dynamic_prop *high_bound,
-+ const struct dynamic_prop *stride)
- {
- if (result_type == NULL)
- result_type = alloc_type_copy (index_type);
-@@ -877,6 +878,7 @@ create_range_type (struct type *result_t
- TYPE_ZALLOC (result_type, sizeof (struct range_bounds));
- TYPE_RANGE_DATA (result_type)->low = *low_bound;
- TYPE_RANGE_DATA (result_type)->high = *high_bound;
-+ TYPE_RANGE_DATA (result_type)->stride = *stride;
-
- if (low_bound->kind == PROP_CONST && low_bound->data.const_val >= 0)
- TYPE_UNSIGNED (result_type) = 1;
-@@ -905,7 +907,7 @@ struct type *
- create_static_range_type (struct type *result_type, struct type *index_type,
- LONGEST low_bound, LONGEST high_bound)
- {
-- struct dynamic_prop low, high;
-+ struct dynamic_prop low, high, stride;
-
- low.kind = PROP_CONST;
- low.data.const_val = low_bound;
-@@ -913,7 +915,11 @@ create_static_range_type (struct type *r
- high.kind = PROP_CONST;
- high.data.const_val = high_bound;
-
-- result_type = create_range_type (result_type, index_type, &low, &high);
-+ stride.kind = PROP_CONST;
-+ stride.data.const_val = 0;
-+
-+ result_type = create_range_type (result_type, index_type,
-+ &low, &high, &stride);
-
- return result_type;
- }
-@@ -1110,16 +1116,20 @@ create_array_type_with_stride (struct ty
- && (!type_not_associated (result_type)
- && !type_not_allocated (result_type)))
- {
-- LONGEST low_bound, high_bound;
-+ LONGEST low_bound, high_bound, byte_stride;
-
- if (get_discrete_bounds (range_type, &low_bound, &high_bound) < 0)
- low_bound = high_bound = 0;
- element_type = check_typedef (element_type);
-+ byte_stride = abs (TYPE_BYTE_STRIDE (range_type));
-+
- /* Be careful when setting the array length. Ada arrays can be
- empty arrays with the high_bound being smaller than the low_bound.
- In such cases, the array length should be zero. */
- if (high_bound < low_bound)
- TYPE_LENGTH (result_type) = 0;
-+ else if (byte_stride > 0)
-+ TYPE_LENGTH (result_type) = byte_stride * (high_bound - low_bound + 1);
- else if (bit_stride > 0)
- TYPE_LENGTH (result_type) =
- (bit_stride * (high_bound - low_bound + 1) + 7) / 8;
-@@ -1912,12 +1922,12 @@ resolve_dynamic_range (struct type *dyn_
- 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;
-@@ -1929,7 +1939,7 @@ resolve_dynamic_range (struct type *dyn_
- }
-
- 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;
-@@ -1944,12 +1954,20 @@ resolve_dynamic_range (struct type *dyn_
- 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 -Naurp insight-7.12.50.20170416.orig/gdb/gdbtypes.h insight-7.12.50.20170416.new/gdb/gdbtypes.h
---- insight-7.12.50.20170416.orig/gdb/gdbtypes.h 2017-04-16 14:23:22.894275191 +0100
-+++ insight-7.12.50.20170416.new/gdb/gdbtypes.h 2017-04-16 14:24:24.098834076 +0100
-@@ -553,6 +553,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. */
-
-@@ -715,7 +719,6 @@ struct main_type
- /* * Union member used for range types. */
-
- struct range_bounds *bounds;
--
- } flds_bnds;
-
- /* * Slot to point to additional language-specific fields of this
-@@ -1230,6 +1233,15 @@ extern void allocate_gnat_aux_type (stru
- TYPE_RANGE_DATA(range_type)->high.kind
- #define TYPE_LOW_BOUND_KIND(range_type) \
- TYPE_RANGE_DATA(range_type)->low.kind
-+#define TYPE_BYTE_STRIDE(range_type) \
-+ TYPE_RANGE_DATA(range_type)->stride.data.const_val
-+#define TYPE_BYTE_STRIDE_BLOCK(range_type) \
-+ TYPE_RANGE_DATA(range_type)->stride.data.locexpr
-+#define TYPE_BYTE_STRIDE_LOCLIST(range_type) \
-+ TYPE_RANGE_DATA(range_type)->stride.data.loclist
-+#define TYPE_BYTE_STRIDE_KIND(range_type) \
-+ TYPE_RANGE_DATA(range_type)->stride.kind
-+
-
- /* Property accessors for the type data location. */
- #define TYPE_DATA_LOCATION(thistype) \
-@@ -1264,6 +1276,9 @@ extern void allocate_gnat_aux_type (stru
- TYPE_HIGH_BOUND_UNDEFINED(TYPE_INDEX_TYPE(arraytype))
- #define TYPE_ARRAY_LOWER_BOUND_IS_UNDEFINED(arraytype) \
- TYPE_LOW_BOUND_UNDEFINED(TYPE_INDEX_TYPE(arraytype))
-+#define TYPE_ARRAY_STRIDE_IS_UNDEFINED(arraytype) \
-+ (TYPE_BYTE_STRIDE(TYPE_INDEX_TYPE(arraytype)) == 0)
-+
-
- #define TYPE_ARRAY_UPPER_BOUND_VALUE(arraytype) \
- (TYPE_HIGH_BOUND(TYPE_INDEX_TYPE((arraytype))))
-@@ -1781,6 +1796,7 @@ extern struct type *create_array_type_wi
-
- extern struct type *create_range_type (struct type *, struct type *,
- const struct dynamic_prop *,
-+ const struct dynamic_prop *,
- const struct dynamic_prop *);
-
- extern struct type *create_array_type (struct type *, struct type *,
-diff -Naurp insight-7.12.50.20170416.orig/gdb/parse.c insight-7.12.50.20170416.new/gdb/parse.c
---- insight-7.12.50.20170416.orig/gdb/parse.c 2017-03-25 10:42:37.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/parse.c 2017-04-16 14:24:24.098834076 +0100
-@@ -1007,22 +1007,20 @@ operator_length_standard (const struct e
-
- case OP_RANGE:
- oplen = 3;
-+ args = 0;
- range_type = (enum range_type)
- longest_to_int (expr->elts[endpos - 2].longconst);
-
-- switch (range_type)
-- {
-- case LOW_BOUND_DEFAULT:
-- case HIGH_BOUND_DEFAULT:
-- args = 1;
-- break;
-- case BOTH_BOUND_DEFAULT:
-- args = 0;
-- break;
-- case NONE_BOUND_DEFAULT:
-- args = 2;
-- break;
-- }
-+ /* Increment the argument counter for each argument
-+ provided by the user. */
-+ if ((range_type & SUBARRAY_LOW_BOUND) == SUBARRAY_LOW_BOUND)
-+ args++;
-+
-+ if ((range_type & SUBARRAY_HIGH_BOUND) == SUBARRAY_HIGH_BOUND)
-+ args++;
-+
-+ if ((range_type & SUBARRAY_STRIDE) == SUBARRAY_STRIDE)
-+ args++;
-
- break;
-
-diff -Naurp insight-7.12.50.20170416.orig/gdb/rust-exp.y insight-7.12.50.20170416.new/gdb/rust-exp.y
---- insight-7.12.50.20170416.orig/gdb/rust-exp.y 2017-04-09 01:11:01.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/rust-exp.y 2017-04-16 14:24:24.099834085 +0100
-@@ -2409,23 +2409,17 @@ convert_ast_to_expression (struct parser
-
- case OP_RANGE:
- {
-- enum range_type kind = BOTH_BOUND_DEFAULT;
-+ enum range_type kind = SUBARRAY_NONE_BOUND;
-
- if (operation->left.op != NULL)
- {
- convert_ast_to_expression (state, operation->left.op, top);
-- kind = HIGH_BOUND_DEFAULT;
-+ kind = SUBARRAY_LOW_BOUND;
- }
- if (operation->right.op != NULL)
- {
- convert_ast_to_expression (state, operation->right.op, top);
-- if (kind == BOTH_BOUND_DEFAULT)
-- kind = LOW_BOUND_DEFAULT;
-- else
-- {
-- gdb_assert (kind == HIGH_BOUND_DEFAULT);
-- kind = NONE_BOUND_DEFAULT;
-- }
-+ kind = (range_type) (kind | SUBARRAY_HIGH_BOUND);
- }
- write_exp_elt_opcode (state, OP_RANGE);
- write_exp_elt_longcst (state, kind);
-diff -Naurp insight-7.12.50.20170416.orig/gdb/rust-lang.c insight-7.12.50.20170416.new/gdb/rust-lang.c
---- insight-7.12.50.20170416.orig/gdb/rust-lang.c 2017-04-16 14:23:22.906275302 +0100
-+++ insight-7.12.50.20170416.new/gdb/rust-lang.c 2017-04-16 14:24:24.099834085 +0100
-@@ -1314,9 +1314,9 @@ rust_range (struct expression *exp, int
- kind = (enum range_type) longest_to_int (exp->elts[*pos + 1].longconst);
- *pos += 3;
-
-- if (kind == HIGH_BOUND_DEFAULT || kind == NONE_BOUND_DEFAULT)
-+ if ((kind & SUBARRAY_LOW_BOUND) == SUBARRAY_LOW_BOUND)
- low = evaluate_subexp (NULL_TYPE, exp, pos, noside);
-- if (kind == LOW_BOUND_DEFAULT || kind == NONE_BOUND_DEFAULT)
-+ if ((kind & SUBARRAY_HIGH_BOUND) == SUBARRAY_HIGH_BOUND)
- high = evaluate_subexp (NULL_TYPE, exp, pos, noside);
-
- if (noside == EVAL_SKIP)
-@@ -1405,7 +1405,7 @@ rust_compute_range (struct type *type, s
-
- *low = 0;
- *high = 0;
-- *kind = BOTH_BOUND_DEFAULT;
-+ *kind = SUBARRAY_NONE_BOUND;
-
- if (TYPE_NFIELDS (type) == 0)
- return;
-@@ -1413,15 +1413,14 @@ rust_compute_range (struct type *type, s
- i = 0;
- if (strcmp (TYPE_FIELD_NAME (type, 0), "start") == 0)
- {
-- *kind = HIGH_BOUND_DEFAULT;
-+ *kind = SUBARRAY_LOW_BOUND;
- *low = value_as_long (value_field (range, 0));
- ++i;
- }
- if (TYPE_NFIELDS (type) > i
- && strcmp (TYPE_FIELD_NAME (type, i), "end") == 0)
- {
-- *kind = (*kind == BOTH_BOUND_DEFAULT
-- ? LOW_BOUND_DEFAULT : NONE_BOUND_DEFAULT);
-+ *kind = (range_type) (*kind | SUBARRAY_HIGH_BOUND);
- *high = value_as_long (value_field (range, i));
- }
- }
-@@ -1436,7 +1435,7 @@ rust_subscript (struct expression *exp,
- struct type *rhstype;
- LONGEST low, high_bound;
- /* Initialized to appease the compiler. */
-- enum range_type kind = BOTH_BOUND_DEFAULT;
-+ enum range_type kind = SUBARRAY_NONE_BOUND;
- LONGEST high = 0;
- int want_slice = 0;
-
-@@ -1498,7 +1497,7 @@ rust_subscript (struct expression *exp,
- error (_("Cannot subscript non-array type"));
-
- if (want_slice
-- && (kind == BOTH_BOUND_DEFAULT || kind == LOW_BOUND_DEFAULT))
-+ && ((kind & SUBARRAY_LOW_BOUND) != SUBARRAY_LOW_BOUND))
- low = low_bound;
- if (low < 0)
- error (_("Index less than zero"));
-@@ -1516,7 +1515,7 @@ rust_subscript (struct expression *exp,
- CORE_ADDR addr;
- struct value *addrval, *tem;
-
-- if (kind == BOTH_BOUND_DEFAULT || kind == HIGH_BOUND_DEFAULT)
-+ if ((kind & SUBARRAY_HIGH_BOUND) != SUBARRAY_HIGH_BOUND)
- high = high_bound;
- if (high < 0)
- error (_("High index less than zero"));
-diff -Naurp insight-7.12.50.20170416.orig/gdb/testsuite/gdb.fortran/static-arrays.exp insight-7.12.50.20170416.new/gdb/testsuite/gdb.fortran/static-arrays.exp
---- insight-7.12.50.20170416.orig/gdb/testsuite/gdb.fortran/static-arrays.exp 1970-01-01 01:00:00.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/testsuite/gdb.fortran/static-arrays.exp 2017-04-16 14:24:24.100834094 +0100
-@@ -0,0 +1,421 @@
-+# Copyright 2015 Free Software Foundation, Inc.
-+#
-+# Contributed by Intel Corp. <christoph.t.weinmann(a)intel.com>
-+#
-+# 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 static-arrays.f90
-+
-+if { [prepare_for_testing $testfile.exp $testfile $srcfile {debug f90}] } {
-+ return -1
-+}
-+
-+if ![runto MAIN__] then {
-+ perror "couldn't run to breakpoint MAIN__"
-+ continue
-+}
-+
-+gdb_breakpoint [gdb_get_line_number "BP1"]
-+gdb_continue_to_breakpoint "BP1" ".*BP1.*"
-+
-+# Tests subarrays of one dimensional arrays with subrange variations
-+gdb_test "print ar1" "\\$\[0-9\]+ = \\(1, 2, 3, 4, 5, 6, 7, 8, 9\\)" \
-+ "print ar1."
-+gdb_test "print ar1\(4:7\)" "\\$\[0-9\]+ = \\(4, 5, 6, 7\\)" \
-+ "print ar1\(4:7\)"
-+gdb_test "print ar1\(8:\)" "\\$\[0-9\]+ = \\(8, 9\\).*" \
-+ "print ar1\(8:\)"
-+gdb_test "print ar1\(:3\)" "\\$\[0-9\]+ = \\(1, 2, 3\\).*" \
-+ "print ar1\(:3\)"
-+gdb_test "print ar1\(:\)" "\\$\[0-9\]+ = \\(1, 2, 3, 4, 5, 6, 7, 8, 9\\)" \
-+ "print ar1\(:\)"
-+
-+# Check assignment
-+gdb_test_no_output "set \$my_ary = ar1\(3:8\)"
-+gdb_test "print \$my_ary" \
-+ "\\$\[0-9\]+ = \\(3, 4, 5, 6, 7, 8\\)" \
-+ "Assignment of subarray to variable"
-+gdb_test_no_output "set ar1\(5\) = 42"
-+ gdb_test "print ar1\(3:8\)" \
-+ "\\$\[0-9\]+ = \\(3, 4, 42, 6, 7, 8\\)" \
-+ "print ar1\(3:8\) after assignment"
-+gdb_test "print \$my_ary" \
-+ "\\$\[0-9\]+ = \\(3, 4, 5, 6, 7, 8\\)" \
-+ "Assignment of subarray to variable after original array changed"
-+
-+# Test for subarrays of one dimensional arrays with literals
-+ gdb_test "print ar1\(3\)" "\\$\[0-9\]+ = 3" \
-+ "print ar1\(3\)"
-+
-+# Tests for subranges of 2 dimensional arrays with subrange variations
-+gdb_test "print ar2\(2:3, 3:4\)" \
-+ "\\$\[0-9\]+ = \\(\\( 23, 33\\) \\( 24, 34\\) \\)" \
-+ "print ar2\(2:3, 3:4\)."
-+gdb_test "print ar2\(8:9,8:\)" \
-+ "\\$\[0-9\]+ = \\(\\( 88, 98\\) \\( 89, 99\\) \\)" \
-+ "print ar2\(8:9,8:\)"
-+gdb_test "print ar2\(8:9,:2\)" \
-+ "\\$\[0-9\]+ = \\(\\( 81, 91\\) \\( 82, 92\\) \\)" \
-+ "print ar2\(8:9,:2\)"
-+
-+gdb_test "print ar2\(8:,8:9\)" \
-+ "\\$\[0-9\]+ = \\(\\( 88, 98\\) \\( 89, 99\\) \\)" \
-+ "print ar2\(8:,8:9\)"
-+gdb_test "print ar2\(8:,8:\)" \
-+ "\\$\[0-9\]+ = \\(\\( 88, 98\\) \\( 89, 99\\) \\)" \
-+ "print ar2\(8:,8:\)"
-+gdb_test "print ar2\(8:,:2\)" \
-+ "\\$\[0-9\]+ = \\(\\( 81, 91\\) \\( 82, 92\\) \\)" \
-+ "print ar2\(8:,:2\)"
-+
-+gdb_test "print ar2\(:2,2:3\)" \
-+ "\\$\[0-9\]+ = \\(\\( 12, 22\\) \\( 13, 23\\) \\)" \
-+ "print ar2\(:2,2:3\)"
-+gdb_test "print ar2\(:2,8:\)" \
-+ "\\$\[0-9\]+ = \\(\\( 18, 28\\) \\( 19, 29\\) \\)" \
-+ "print ar2\(:2,8:\)"
-+gdb_test "print ar2\(:2,:2\)" \
-+ "\\$\[0-9\]+ = \\(\\( 11, 21\\) \\( 12, 22\\) \\)" \
-+ "print ar2\(:2,:2\)"
-+
-+# Test subranges of 2 dimensional arrays with literals and subrange variations
-+gdb_test "print ar2\(7, 3:6\)" \
-+ "\\$\[0-9\]+ = \\(73, 74, 75, 76\\)" \
-+ "print ar2\(7, 3:6\)"
-+gdb_test "print ar2\(7,8:\)" \
-+ "\\$\[0-9\]+ = \\(78, 79\\)" \
-+ "print ar2\(7,8:\)"
-+gdb_test "print ar2\(7,:2\)" \
-+ "\\$\[0-9\]+ = \\(71, 72\\)" \
-+ "print ar2\(7,:2\)"
-+
-+gdb_test "print ar2\(7:8,4\)" \
-+ "\\$\[0-9\]+ = \\(74, 84\\)" \
-+ "print ar2(7:8,4\)"
-+gdb_test "print ar2\(8:,4\)" \
-+ "\\$\[0-9\]+ = \\(84, 94\\)" \
-+ "print ar2\(8:,4\)"
-+gdb_test "print ar2\(:2,4\)" \
-+ "\\$\[0-9\]+ = \\(14, 24\\)" \
-+ "print ar2\(:2,4\)"
-+gdb_test "print ar2\(3,4\)" \
-+ "\\$\[0-9\]+ = 34" \
-+ "print ar2\(3,4\)"
-+
-+# Test subarrays of 3 dimensional arrays with literals and subrange variations
-+gdb_test "print ar3\(2:4,3:4,7:8\)" \
-+ "\\$\[0-9\]+ = \\(\\( \\( 237, 337, 437\\) \\( 247, 347, 447\\)\
-+ \\) \\( \\( 238, 338, 438\\) \\( 248, 348, 448\\) \\) \\)" \
-+ "print ar3\(2:4,3:4,7:8\)"
-+gdb_test "print ar3\(2:3,4:5,8:\)" \
-+ "\\$\[0-9\]+ = \\(\\( \\( 248, 348\\) \\( 258, 358\\) \\) \\(\
-+ \\( 249, 349\\) \\( 259, 359\\) \\) \\)" \
-+ "print ar3\(2:3,4:5,8:\)"
-+gdb_test "print ar3\(2:3,4:5,:2\)" \
-+ "\\$\[0-9\]+ = \\(\\( \\( 241, 341\\) \\( 251, 351\\) \\) \\(\
-+ \\( 242, 342\\) \\( 252, 352\\) \\) \\)" \
-+ "print ar3\(2:3,4:5,:2\)"
-+
-+gdb_test "print ar3\(2:3,8:,7:8\)" \
-+ "\\$\[0-9\]+ = \\(\\( \\( 287, 387\\) \\( 297, 397\\) \\) \\(\
-+ \\( 288, 388\\) \\( 298, 398\\) \\) \\)" \
-+ "print ar3\(2:3,8:,7:8\)"
-+gdb_test "print ar3\(2:3,8:,8:\)" \
-+ "\\$\[0-9\]+ = \\(\\( \\( 288, 388\\) \\( 298, 398\\) \\) \\(\
-+ \\( 289, 389\\) \\( 299, 399\\) \\) \\)" \
-+ "print ar3\(2:3,8:,8:\)"
-+gdb_test "print ar3\(2:3,8:,:2\)" \
-+ "\\$\[0-9\]+ = \\(\\( \\( 281, 381\\) \\( 291, 391\\) \\) \\(\
-+ \\( 282, 382\\) \\( 292, 392\\) \\) \\)" \
-+ "print ar3\(2:3,8:,:2\)"
-+
-+gdb_test "print ar3\(2:3,:2,7:8\)" \
-+ "\\$\[0-9\]+ = \\(\\( \\( 217, 317\\) \\( 227, 327\\) \\) \\(\
-+ \\( 218, 318\\) \\( 228, 328\\) \\) \\)" \
-+ "print ar3\(2:3,:2,7:8\)"
-+gdb_test "print ar3\(2:3,:2,8:\)" \
-+ "\\$\[0-9\]+ = \\(\\( \\( 218, 318\\) \\( 228, 328\\) \\) \\(\
-+ \\( 219, 319\\) \\( 229, 329\\) \\) \\)" \
-+ "print ar3\(2:3,:2,8:\)"
-+gdb_test "print ar3\(2:3,:2,:2\)" \
-+ "\\$\[0-9\]+ = \\(\\( \\( 211, 311\\) \\( 221, 321\\) \\) \\(\
-+ \\( 212, 312\\) \\( 222, 322\\) \\) \\)" \
-+ "print ar3\(2:3,:2,:2\)"
-+
-+gdb_test "print ar3\(8:,3:4,7:8\)" \
-+ "\\$\[0-9\]+ = \\(\\( \\( 837, 937\\) \\( 847, 947\\) \\) \\(\
-+ \\( 838, 938\\) \\( 848, 948\\) \\) \\)" \
-+ "print ar3\(8:,3:4,7:8\)"
-+gdb_test "print ar3\(8:,4:5,8:\)" \
-+ "\\$\[0-9\]+ = \\(\\( \\( 848, 948\\) \\( 858, 958\\) \\) \\(\
-+ \\( 849, 949\\) \\( 859, 959\\) \\) \\)" \
-+ "print ar3\(8:,4:5,8:\)"
-+gdb_test "print ar3\(8:,4:5,:2\)" \
-+ "\\$\[0-9\]+ = \\(\\( \\( 841, 941\\) \\( 851, 951\\) \\) \\(\
-+ \\( 842, 942\\) \\( 852, 952\\) \\) \\)" \
-+ "print ar3\(8:,4:5,:2\)"
-+
-+gdb_test "print ar3\(8:,8:,7:8\)" \
-+ "\\$\[0-9\]+ = \\(\\( \\( 887, 987\\) \\( 897, 997\\) \\) \\(\
-+ \\( 888, 988\\) \\( 898, 998\\) \\) \\)" \
-+ "print ar3\(8:,8:,7:8\)"
-+gdb_test "print ar3\(8:,8:,8:\)" \
-+ "\\$\[0-9\]+ = \\(\\( \\( 888, 988\\) \\( 898, 998\\) \\) \\(\
-+ \\( 889, 989\\) \\( 899, 999\\) \\) \\)" \
-+ "print ar3\(8:,8:,8:\)"
-+gdb_test "print ar3\(8:,8:,:2\)" \
-+ "\\$\[0-9\]+ = \\(\\( \\( 881, 981\\) \\( 891, 991\\) \\) \\(\
-+ \\( 882, 982\\) \\( 892, 992\\) \\) \\)" \
-+ "print ar3\(8:,8:,:2\)"
-+
-+gdb_test "print ar3\(8:,:2,7:8\)" \
-+ "\\$\[0-9\]+ = \\(\\( \\( 817, 917\\) \\( 827, 927\\) \\) \\(\
-+ \\( 818, 918\\) \\( 828, 928\\) \\) \\)" \
-+ "print ar3\(8:,:2,7:8\)"
-+gdb_test "print ar3\(8:,:2,8:\)" \
-+ "\\$\[0-9\]+ = \\(\\( \\( 818, 918\\) \\( 828, 928\\) \\) \\(\
-+ \\( 819, 919\\) \\( 829, 929\\) \\) \\)" \
-+ "print ar3\(8:,:2,8:\)"
-+gdb_test "print ar3\(8:,:2,:2\)" \
-+ "\\$\[0-9\]+ = \\(\\( \\( 811, 911\\) \\( 821, 921\\) \\) \\(\
-+ \\( 812, 912\\) \\( 822, 922\\) \\) \\)" \
-+ "print ar3\(8:,:2,:2\)"
-+
-+
-+gdb_test "print ar3\(:2,3:4,7:8\)" \
-+ "\\$\[0-9\]+ = \\(\\( \\( 137, 237\\) \\( 147, 247\\) \\) \\(\
-+ \\( 138, 238\\) \\( 148, 248\\) \\) \\)" \
-+ "print ar3 \(:2,3:4,7:8\)."
-+gdb_test "print ar3\(:2,3:4,8:\)" \
-+ "\\$\[0-9\]+ = \\(\\( \\( 138, 238\\) \\( 148, 248\\) \\) \\(\
-+ \\( 139, 239\\) \\( 149, 249\\) \\) \\)" \
-+ "print ar3\(:2,3:4,8:\)"
-+gdb_test "print ar3\(:2,3:4,:2\)" \
-+ "\\$\[0-9\]+ = \\(\\( \\( 131, 231\\) \\( 141, 241\\) \\) \\(\
-+ \\( 132, 232\\) \\( 142, 242\\) \\) \\)" \
-+ "print ar3\(:2,3:4,:2\)"
-+
-+gdb_test "print ar3\(:2,8:,7:8\)" "\\$\[0-9\]+ = \\(\\( \\( 187, 287\\) \\(\
-+ 197, 297\\) \\) \\( \\( 188, 288\\) \\( 198, 298\\) \\) \\)" \
-+ "print ar3\(:2,8:,7:8\)"
-+gdb_test "print ar3\(:2,8:,8:\)" "\\$\[0-9\]+ = \\(\\( \\( 188, 288\\) \\( 198,\
-+ 298\\) \\) \\( \\( 189, 289\\) \\( 199, 299\\) \\) \\)" \
-+ "print ar3\(:2,8:,8:\)"
-+gdb_test "print ar3\(:2,8:,:2\)" "\\$\[0-9\]+ = \\(\\( \\( 181, 281\\) \\( 191,\
-+ 291\\) \\) \\( \\( 182, 282\\) \\( 192, 292\\) \\) \\)" \
-+ "print ar3\(:2,8:,:2\)"
-+
-+gdb_test "print ar3\(:2,:2,7:8\)" \
-+ "\\$\[0-9\]+ = \\(\\( \\( 117, 217\\) \\( 127, 227\\) \\) \\(\
-+ \\( 118, 218\\) \\( 128, 228\\) \\) \\)" \
-+ "print ar3\(:2,:2,7:8\)"
-+gdb_test "print ar3\(:2,:2,8:\)" \
-+ "\\$\[0-9\]+ = \\(\\( \\( 118, 218\\) \\( 128, 228\\) \\) \\(\
-+ \\( 119, 219\\) \\( 129, 229\\) \\) \\)" \
-+ "print ar3\(:2,:2,8:\)"
-+gdb_test "print ar3\(:2,:2,:2\)" \
-+ "\\$\[0-9\]+ = \\(\\( \\( 111, 211\\) \\( 121, 221\\) \\) \\(\
-+ \\( 112, 212\\) \\( 122, 222\\) \\) \\)" \
-+ "print ar3\(:2,:2,:2\)"
-+
-+#Tests for subarrays of 3 dimensional arrays with literals and subranges
-+gdb_test "print ar3\(3,3:4,7:8\)" \
-+ "\\$\[0-9\]+ = \\(\\( 337, 347\\) \\( 338, 348\\) \\)" \
-+ "print ar3\(3,3:4,7:8\)"
-+gdb_test "print ar3\(3,4:5,8:\)" \
-+ "\\$\[0-9\]+ = \\(\\( 348, 358\\) \\( 349, 359\\) \\)" \
-+ "print ar3\(3,4:5,8:\)"
-+gdb_test "print ar3\(3,4:5,:2\)" \
-+ "\\$\[0-9\]+ = \\(\\( 341, 351\\) \\( 342, 352\\) \\)" \
-+ "print ar3\(3,4:5,:2\)"
-+gdb_test "print ar3\(3,4:5,3\)" \
-+ "\\$\[0-9\]+ = \\(343, 353\\)" \
-+ "print ar3\(3,4:5,3\)"
-+
-+gdb_test "print ar3\(2,8:,7:8\)" \
-+ "\\$\[0-9\]+ = \\(\\( 287, 297\\) \\( 288, 298\\) \\)" \
-+ "print ar3\(2,8:,7:8\)"
-+gdb_test "print ar3\(2,8:,8:\)" \
-+ "\\$\[0-9\]+ = \\(\\( 288, 298\\) \\( 289, 299\\) \\)" \
-+ "print ar3\(2,8:,8:\)"
-+gdb_test "print ar3\(2,8:,:2\)"\
-+ "\\$\[0-9\]+ = \\(\\( 281, 291\\) \\( 282, 292\\) \\)" \
-+ "print ar3\(2,8:,:2\)"
-+gdb_test "print ar3\(2,8:,3\)" \
-+ "\\$\[0-9\]+ = \\(283, 293\\)" \
-+ "print ar3\(2,8:,3\)"
-+
-+gdb_test "print ar3\(2,:2,7:8\)" \
-+ "\\$\[0-9\]+ = \\(\\( 217, 227\\) \\( 218, 228\\) \\)" \
-+ "print ar3\(2,:2,7:8\)"
-+gdb_test "print ar3\(2,:2,8:\)" \
-+ "\\$\[0-9\]+ = \\(\\( 218, 228\\) \\( 219, 229\\) \\)" \
-+ "print ar3\(2,:2,8:\)"
-+gdb_test "print ar3\(2,:2,:2\)" \
-+ "\\$\[0-9\]+ = \\(\\( 211, 221\\) \\( 212, 222\\) \\)" \
-+ "print ar3\(2,:2,:2\)"
-+gdb_test "print ar3\(2,:2,3\)" \
-+ "\\$\[0-9\]+ = \\(213, 223\\)" \
-+ "print ar3\(2,:2,3\)"
-+
-+gdb_test "print ar3\(3,4,7:8\)" \
-+ "\\$\[0-9\]+ = \\(347, 348\\)" \
-+ "print ar3\(3,4,7:8\)"
-+gdb_test "print ar3\(3,4,8:\)" \
-+ "\\$\[0-9\]+ = \\(348, 349\\)" \
-+i "print ar3\(3,4,8:\)"
-+gdb_test "print ar3\(3,4,:2\)" \
-+ "\\$\[0-9\]+ = \\(341, 342\\)" \
-+ "print ar3\(3,4,:2\)"
-+gdb_test "print ar3\(5,6,7\)" \
-+ "\\$\[0-9\]+ = 567" \
-+ "print ar3\(5,6,7\)"
-+
-+gdb_test "print ar3\(3:4,6,7:8\)" \
-+ "\\$\[0-9\]+ = \\(\\( 367, 467\\) \\( 368, 468\\) \\)" \
-+ "print ar3\(3:4,6,7:8\)"
-+gdb_test "print ar3\(3:4,6,8:\)" \
-+ "\\$\[0-9\]+ = \\(\\( 368, 468\\) \\( 369, 469\\) \\)" \
-+ "print ar3\(3:4,6,8:\)"
-+gdb_test "print ar3\(3:4,6,:2\)" \
-+ "\\$\[0-9\]+ = \\(\\( 361, 461\\) \\( 362, 462\\) \\)" \
-+ "print ar3\(3:4,6,:2\)"
-+gdb_test "print ar3\(3:4,6,5\)" \
-+ "\\$\[0-9\]+ = \\(365, 465\\)" \
-+ "print ar3\(3:4,6,5\)"
-+
-+gdb_test "print ar3\(8:,6,7:8\)" \
-+ "\\$\[0-9\]+ = \\(\\( 867, 967\\) \\( 868, 968\\) \\)" \
-+ "print ar3\(8:,6,7:8\)"
-+gdb_test "print ar3\(8:,6,8:\)" \
-+ "\\$\[0-9\]+ = \\(\\( 868, 968\\) \\( 869, 969\\) \\)" \
-+ "print ar3\(8:,6,8:\)"
-+gdb_test "print ar3\(8:,6,:2\)" \
-+ "\\$\[0-9\]+ = \\(\\( 861, 961\\) \\( 862, 962\\) \\)" \
-+ "print ar3\(8:,6,:2\)"
-+gdb_test "print ar3\(8:,6,5\)" \
-+ "\\$\[0-9\]+ = \\(865, 965\\)" \
-+ "print ar3\(8:,6,5\)"
-+
-+gdb_test "print ar3\(:2,6,7:8\)" \
-+ "\\$\[0-9\]+ = \\(\\( 167, 267\\) \\( 168, 268\\) \\)" \
-+ "print ar3\(:2,6,7:8\)"
-+gdb_test "print ar3\(:2,6,8:\)" \
-+ "\\$\[0-9\]+ = \\(\\( 168, 268\\) \\( 169, 269\\) \\)" \
-+ "print ar3\(:2,6,8:\)"
-+gdb_test "print ar3\(:2,6,:2\)" \
-+ "\\$\[0-9\]+ = \\(\\( 161, 261\\) \\( 162, 262\\) \\)" \
-+ "print ar3\(:2,6,:2\)"
-+gdb_test "print ar3\(:2,6,5\)" \
-+ "\\$\[0-9\]+ = \\(165, 265\\)" \
-+ "print ar3\(:2,6,5\)"
-+
-+gdb_test "print ar3\(3:4,5:6,4\)" \
-+ "\\$\[0-9\]+ = \\(\\( 354, 454\\) \\( 364, 464\\) \\)" \
-+ "print ar2\(3:4,5:6,4\)"
-+gdb_test "print ar3\(8:,5:6,4\)" \
-+ "\\$\[0-9\]+ = \\(\\( 854, 954\\) \\( 864, 964\\) \\)" \
-+ "print ar2\(8:,5:6,4\)"
-+gdb_test "print ar3\(:2,5:6,4\)" \
-+ "\\$\[0-9\]+ = \\(\\( 154, 254\\) \\( 164, 264\\) \\)" \
-+ "print ar2\(:2,5:6,4\)"
-+
-+# Stride > 1
-+gdb_test "print ar1\(2:6:2\)" \
-+ "\\$\[0-9\]+ = \\(2, 4, 6\\)" \
-+ "print ar1\(2:6:2\)"
-+gdb_test "print ar2\(2:6:2,3:4\)" \
-+ "\\$\[0-9\]+ = \\(\\( 23, 43, 63\\) \\( 24, 44, 64\\) \\)" \
-+ "print ar2\(2:6:2,3:4\)"
-+gdb_test "print ar2\(2:6:2,3\)" \
-+ "\\$\[0-9\]+ = \\(23, 43, 63\\)" \
-+ "print ar2\(2:6:2,3\)"
-+gdb_test "print ar3\(2:6:2,3:5:2,4:7:3\)" \
-+ "\\$\[0-9\]+ = \\(\\( \\( 234, 434, 634\\) \\( 254, 454, 654\\)\
-+ \\) \\( \\( 237, 437, 637\\) \\( 257, 457, 657\\) \\) \\)" \
-+ "print ar3\(2:6:2,3:5:2,4:7:3\)"
-+gdb_test "print ar3\(2:6:2,5,4:7:3\)" \
-+ "\\$\[0-9\]+ = \\(\\( 254, 454, 654\\) \\( 257, 457, 657\\)\
-+ \\)" \
-+ "print ar3\(2:6:2,5,4:7:3\)"
-+
-+# Stride < 0
-+gdb_test "print ar1\(8:2:-2\)" \
-+ "\\$\[0-9\]+ = \\(8, 6, 4, 2\\)" \
-+ "print ar1\(8:2:-2\)"
-+gdb_test "print ar2\(8:2:-2,3:4\)" \
-+ "\\$\[0-9\]+ = \\(\\( 83, 63, 43, 23\\) \\( 84, 64, 44, 24\\)\
-+ \\)" \
-+ "print ar2\(8:2:-2,3:4\)"
-+gdb_test "print ar2\(2:6:2,3\)" \
-+ "\\$\[0-9\]+ = \\(23, 43, 63\\)" \
-+ "print ar2\(2:6:2,3\)"
-+gdb_test "print ar3\(2:3,7:3:-4,4:7:3\)" \
-+ "\\$\[0-9\]+ = \\(\\( \\( 274, 374\\) \\( 234, 334\\) \\) \\(\
-+ \\( 277, 377\\) \\( 237, 337\\) \\) \\)" \
-+ "print ar3\(2:3,7:3:-4,4:7:3\)"
-+gdb_test "print ar3\(2:6:2,5,7:4:-3\)" \
-+ "\\$\[0-9\]+ = \\(\\( 257, 457, 657\\) \\( 254, 454, 654\\)\
-+ \\)" \
-+ "print ar3\(2:6:2,5,7:4:-3\)"
-+
-+# Tests with negative and mixed indices
-+gdb_test "p ar4\(2:4, -2:1, -15:-14\)" \
-+ "\\$\[0-9\]+ = \\(\\( \\( 261, 361, 461\\) \\( 271, 371, 471\\)\
-+ \\( 281, 381, 481\\) \\( 291, 391, 491\\) \\) \\( \\( 262,\
-+ 362, 462\\) \\( 272, 372, 472\\) \\( 282, 382, 482\\) \\( 292,\
-+ 392, 492\\) \\) \\)" \
-+ "print ar4(2:4, -2:1, -15:-14)"
-+
-+gdb_test "p ar4\(7,-6:2:3,-7\)" \
-+ "\\$\[0-9\]+ = \\(729, 759, 789\\)" \
-+ "print ar4(7,-6:2:3,-7)"
-+
-+gdb_test "p ar4\(9:2:-2, -6:2:3, -6:-15:-3\)" \
-+ "\\$\[0-9\]+ = \\(\\( \\( 930, 730, 530, 330\\) \\( 960, 760,\
-+ 560, 360\\) \\( 990, 790, 590, 390\\) \\) \\( \\( 927, 727,\
-+ 527, 327\\) \\( 957, 757, 557, 357\\) \\( 987, 787, 587,\
-+ 387\\) \\) \\( \\( 924, 724, 524, 324\\) \\( 954, 754, 554,\
-+ 354\\) \\( 984, 784, 584, 384\\) \\) \\( \\( 921, 721, 521,\
-+ 321\\) \\( 951, 751, 551, 351\\) \\( 981, 781, 581, 381\\) \\)\
-+ \\)" \
-+ "print ar4(9:2:-2, -6:2:3, -6:-15:-3)"
-+
-+gdb_test "p ar4\(:,:,:\)" \
-+ "\\$\[0-9\]+ = \\(\\( \\( 111, 211, 311, 411, 511, 611, 711,\
-+ 811, .*" \
-+ "print ar4(:,:,:)"
-+
-+# Provoke error messages for bad user input
-+gdb_test "print ar1\(0:4\)" \
-+ "provided bound\\(s\\) outside array bound\\(s\\)" \
-+ "print ar1\(0:4\)"
-+gdb_test "print ar1\(8:12\)" \
-+ "provided bound\\(s\\) outside array bound\\(s\\)" \
-+ "print ar1\(8:12\)"
-+gdb_test "print ar1\(8:2:\)" \
-+ "A syntax error in expression, near `\\)'." \
-+ "print ar1\(8:2:\)"
-+gdb_test "print ar1\(8:2:2\)" \
-+ "Wrong value provided for stride and boundaries" \
-+ "print ar1\(8:2:2\)"
-+gdb_test "print ar1\(2:8:-2\)" \
-+ "Wrong value provided for stride and boundaries" \
-+ "print ar1\(2:8:-2\)"
-+gdb_test "print ar1\(2:7:0\)" \
-+ "Stride must not be 0" \
-+ "print ar1\(2:7:0\)"
-+gdb_test "print ar1\(3:7\) = 42" \
-+ "Invalid cast." \
-+ "Assignment of value to subarray"
-diff -Naurp insight-7.12.50.20170416.orig/gdb/testsuite/gdb.fortran/static-arrays.f90 insight-7.12.50.20170416.new/gdb/testsuite/gdb.fortran/static-arrays.f90
---- insight-7.12.50.20170416.orig/gdb/testsuite/gdb.fortran/static-arrays.f90 1970-01-01 01:00:00.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/testsuite/gdb.fortran/static-arrays.f90 2017-04-16 14:24:24.100834094 +0100
-@@ -0,0 +1,55 @@
-+! Copyright 2015 Free Software Foundation, Inc.
-+!
-+! Contributed by Intel Corp. <christoph.t.weinmann(a)intel.com>
-+!
-+! 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/>.
-+
-+subroutine sub
-+ integer, dimension(9) :: ar1
-+ integer, dimension(9,9) :: ar2
-+ integer, dimension(9,9,9) :: ar3
-+ integer, dimension(10,-7:3, -15:-5) :: ar4
-+ integer :: i,j,k
-+
-+ ar1 = 1
-+ ar2 = 1
-+ ar3 = 1
-+ ar4 = 4
-+
-+ ! Resulting array ar3 looks like ((( 111, 112, 113, 114,...)))
-+ do i = 1, 9, 1
-+ ar1(i) = i
-+ do j = 1, 9, 1
-+ ar2(i,j) = i*10 + j
-+ do k = 1, 9, 1
-+ ar3(i,j,k) = i*100 + j*10 + k
-+ end do
-+ end do
-+ end do
-+
-+ do i = 1, 10, 1
-+ do j = -7, 3, 1
-+ do k = -15, -5, 1
-+ ar4(i,j,k) = i*100 + (j+8)*10 + (k+16)
-+ end do
-+ end do
-+ end do
-+
-+ ar1(1) = 11 !BP1
-+ return
-+end
-+
-+program testprog
-+ call sub
-+end
-diff -Naurp insight-7.12.50.20170416.orig/gdb/testsuite/gdb.fortran/vla.f90 insight-7.12.50.20170416.new/gdb/testsuite/gdb.fortran/vla.f90
---- insight-7.12.50.20170416.orig/gdb/testsuite/gdb.fortran/vla.f90 2017-01-03 17:36:55.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/testsuite/gdb.fortran/vla.f90 2017-04-16 14:24:24.100834094 +0100
-@@ -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 -Naurp insight-7.12.50.20170416.orig/gdb/testsuite/gdb.fortran/vla-ptype.exp insight-7.12.50.20170416.new/gdb/testsuite/gdb.fortran/vla-ptype.exp
---- insight-7.12.50.20170416.orig/gdb/testsuite/gdb.fortran/vla-ptype.exp 2017-01-03 17:36:55.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/testsuite/gdb.fortran/vla-ptype.exp 2017-04-16 14:24:24.100834094 +0100
-@@ -98,3 +98,7 @@ gdb_test "ptype vla2" "type = <not alloc
- 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 -Naurp insight-7.12.50.20170416.orig/gdb/testsuite/gdb.fortran/vla-sizeof.exp insight-7.12.50.20170416.new/gdb/testsuite/gdb.fortran/vla-sizeof.exp
---- insight-7.12.50.20170416.orig/gdb/testsuite/gdb.fortran/vla-sizeof.exp 2017-01-03 17:36:55.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/testsuite/gdb.fortran/vla-sizeof.exp 2017-04-16 14:24:24.101834103 +0100
-@@ -44,3 +44,7 @@ gdb_test "print sizeof(pvla)" " = 0" "pr
- gdb_breakpoint [gdb_get_line_number "pvla-associated"]
- gdb_continue_to_breakpoint "pvla-associated"
- gdb_test "print sizeof(pvla)" " = 4000" "print sizeof associated pvla"
-+
-+gdb_breakpoint [gdb_get_line_number "vla1-neg-bounds"]
-+gdb_continue_to_breakpoint "vla1-neg-bounds"
-+gdb_test "print sizeof(vla1)" " = 480" "print sizeof vla1 negative bounds"
-diff -Naurp insight-7.12.50.20170416.orig/gdb/testsuite/gdb.fortran/vla-stride.exp insight-7.12.50.20170416.new/gdb/testsuite/gdb.fortran/vla-stride.exp
---- insight-7.12.50.20170416.orig/gdb/testsuite/gdb.fortran/vla-stride.exp 1970-01-01 01:00:00.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/testsuite/gdb.fortran/vla-stride.exp 2017-04-16 14:24:24.101834103 +0100
-@@ -0,0 +1,44 @@
-+# Copyright 2016 Free Software Foundation, Inc.
-+
-+# This program is free software; you can redistribute it and/or modify
-+# it under the terms of the GNU General Public License as published by
-+# the Free Software Foundation; either version 3 of the License, or
-+# (at your option) any later version.
-+#
-+# This program is distributed in the hope that it will be useful,
-+# but WITHOUT ANY WARRANTY; without even the implied warranty of
-+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+# GNU General Public License for more details.
-+#
-+# You should have received a copy of the GNU General Public License
-+# along with this program. If not, see <http://www.gnu.org/licenses/>.
-+
-+standard_testfile ".f90"
-+
-+if { [prepare_for_testing ${testfile}.exp ${testfile} ${srcfile} \
-+ {debug f90 quiet}] } {
-+ return -1
-+}
-+
-+if ![runto MAIN__] then {
-+ perror "couldn't run to breakpoint MAIN__"
-+ continue
-+}
-+
-+gdb_breakpoint [gdb_get_line_number "re-reverse-elements"]
-+gdb_continue_to_breakpoint "re-reverse-elements"
-+gdb_test "print pvla" " = \\\(1, 2, 3, 4, 5, 6, 7, 8, 9, 10\\\)" \
-+ "print re-reverse-elements"
-+gdb_test "print pvla(1)" " = 1" "print first re-reverse-element"
-+gdb_test "print pvla(10)" " = 10" "print last re-reverse-element"
-+
-+gdb_breakpoint [gdb_get_line_number "odd-elements"]
-+gdb_continue_to_breakpoint "odd-elements"
-+gdb_test "print pvla" " = \\\(1, 3, 5, 7, 9\\\)" "print odd-elements"
-+gdb_test "print pvla(1)" " = 1" "print first odd-element"
-+gdb_test "print pvla(5)" " = 9" "print last odd-element"
-+
-+gdb_breakpoint [gdb_get_line_number "single-element"]
-+gdb_continue_to_breakpoint "single-element"
-+gdb_test "print pvla" " = \\\(5\\\)" "print single-element"
-+gdb_test "print pvla(1)" " = 5" "print one single-element"
-diff -Naurp insight-7.12.50.20170416.orig/gdb/testsuite/gdb.fortran/vla-stride.f90 insight-7.12.50.20170416.new/gdb/testsuite/gdb.fortran/vla-stride.f90
---- insight-7.12.50.20170416.orig/gdb/testsuite/gdb.fortran/vla-stride.f90 1970-01-01 01:00:00.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/testsuite/gdb.fortran/vla-stride.f90 2017-04-16 14:24:24.101834103 +0100
-@@ -0,0 +1,29 @@
-+! Copyright 2016 Free Software Foundation, Inc.
-+!
-+! This program is free software; you can redistribute it and/or modify
-+! it under the terms of the GNU General Public License as published by
-+! the Free Software Foundation; either version 3 of the License, or
-+! (at your option) any later version.
-+!
-+! This program is distributed in the hope that it will be useful,
-+! but WITHOUT ANY WARRANTY; without even the implied warranty of
-+! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+! GNU General Public License for more details.
-+!
-+! You should have received a copy of the GNU General Public License
-+! along with this program. If not, see <http://www.gnu.org/licenses/>.
-+
-+program vla_stride
-+ integer, target, allocatable :: vla (:)
-+ integer, pointer :: pvla (:)
-+
-+ allocate(vla(10))
-+ vla = (/ (I, I = 1,10) /)
-+
-+ pvla => vla(10:1:-1)
-+ pvla => pvla(10:1:-1)
-+ pvla => vla(1:10:2) ! re-reverse-elements
-+ pvla => vla(5:4:-2) ! odd-elements
-+
-+ pvla => null() ! single-element
-+end program vla_stride
-diff -Naurp insight-7.12.50.20170416.orig/gdb/valarith.c insight-7.12.50.20170416.new/gdb/valarith.c
---- insight-7.12.50.20170416.orig/gdb/valarith.c 2017-04-16 14:23:22.911275347 +0100
-+++ insight-7.12.50.20170416.new/gdb/valarith.c 2017-04-16 14:24:24.101834103 +0100
-@@ -193,10 +193,16 @@ value_subscripted_rvalue (struct value *
- 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)))
- {
- if (type_not_associated (array_type))
- error (_("no such vector element (vector not associated)"));
-diff -Naurp insight-7.12.50.20170416.orig/gdb/valops.c insight-7.12.50.20170416.new/gdb/valops.c
---- insight-7.12.50.20170416.orig/gdb/valops.c 2017-04-16 14:23:22.923275458 +0100
-+++ insight-7.12.50.20170416.new/gdb/valops.c 2017-04-16 14:24:24.102834112 +0100
-@@ -3787,55 +3787,194 @@ value_of_this_silent (const struct langu
- struct value *
- value_slice (struct value *array, int lowbound, int length)
- {
-+ /* Pass unaltered arguments to VALUE_SLICE_1, plus a default stride
-+ value of '1', which returns every element between LOWBOUND and
-+ (LOWBOUND + LENGTH). We also provide a default CALL_COUNT of '1'
-+ as we are only considering the highest dimension, or we are
-+ working on a one dimensional array. So we call VALUE_SLICE_1
-+ exactly once. */
-+ return value_slice_1 (array, lowbound, length, 1, 1);
-+}
-+
-+/* VALUE_SLICE_1 is called for each array dimension to calculate the number
-+ of elements as defined by the subscript expression.
-+ CALL_COUNT is used to determine if we are calling the function once, e.g.
-+ we are working on the current dimension of ARRAY, or if we are calling
-+ the function repeatedly. In the later case we need to take elements
-+ from the TARGET_TYPE of ARRAY.
-+ With a CALL_COUNT greater than 1 we calculate the offsets for every element
-+ that should be in the result array. Then we fetch the contents and then
-+ copy them into the result array. The result array will have one dimension
-+ less than the input array, so later on we need to recreate the indices and
-+ ranges in the calling function. */
-+
-+struct value *
-+value_slice_1 (struct value *array, int lowbound, int length,
-+ int stride_length, int call_count)
-+{
- struct type *slice_range_type, *slice_type, *range_type;
-- LONGEST lowerbound, upperbound;
-- struct value *slice;
-- struct type *array_type;
-+ struct type *array_type = check_typedef (value_type (array));
-+ struct type *elt_type = check_typedef (TYPE_TARGET_TYPE (array_type));
-+ unsigned int elt_size, elt_offs;
-+ LONGEST ary_high_bound, ary_low_bound;
-+ struct value *v;
-+ int slice_range_size, i = 0, row_count = 1, elem_count = 1;
-
-- array_type = check_typedef (value_type (array));
-+ /* Check for legacy code if we are actually dealing with an array or
-+ string. */
- if (TYPE_CODE (array_type) != TYPE_CODE_ARRAY
- && TYPE_CODE (array_type) != TYPE_CODE_STRING)
- error (_("cannot take slice of non-array"));
-
-- range_type = TYPE_INDEX_TYPE (array_type);
-- if (get_discrete_bounds (range_type, &lowerbound, &upperbound) < 0)
-- error (_("slice from bad array or bitstring"));
--
-- if (lowbound < lowerbound || length < 0
-- || lowbound + length - 1 > upperbound)
-- error (_("slice out of range"));
-+ ary_low_bound = TYPE_LOW_BOUND (TYPE_INDEX_TYPE (array_type));
-+ ary_high_bound = TYPE_HIGH_BOUND (TYPE_INDEX_TYPE (array_type));
-+
-+ /* When we are working on a multi-dimensional array, we need to get the
-+ attributes of the underlying type. */
-+ if (call_count > 1)
-+ {
-+ ary_low_bound = TYPE_LOW_BOUND (TYPE_INDEX_TYPE (elt_type));
-+ ary_high_bound = TYPE_HIGH_BOUND (TYPE_INDEX_TYPE (elt_type));
-+ elt_type = check_typedef (TYPE_TARGET_TYPE (elt_type));
-+ row_count = TYPE_LENGTH (array_type)
-+ / TYPE_LENGTH (TYPE_TARGET_TYPE (array_type));
-+ }
-+
-+ /* With a stride of '1', the number of elements per result row is equal to
-+ the LENGTH of the subarray. With non-default stride values, we skip
-+ elements, but have to add the start element to the total number of
-+ elements per row. */
-+ if (stride_length == 1)
-+ elem_count = length;
-+ else
-+ elem_count = ((length - 1) / stride_length) + 1;
-+
-+ elt_size = TYPE_LENGTH (elt_type);
-+ elt_offs = lowbound - ary_low_bound;
-+
-+ elt_offs *= elt_size;
-+
-+ /* Check for valid user input. In case of Fortran this was already done
-+ in the calling function. */
-+ if (call_count == 1
-+ && (!TYPE_ARRAY_UPPER_BOUND_IS_UNDEFINED (array_type)
-+ && elt_offs >= TYPE_LENGTH (array_type)))
-+ error (_("no such vector element"));
-+
-+ /* CALL_COUNT is 1 when we are dealing either with the highest dimension
-+ of the array, or a one dimensional array. Set RANGE_TYPE accordingly.
-+ In both cases we calculate how many rows/elements will be in the output
-+ array by setting slice_range_size. */
-+ if (call_count == 1)
-+ {
-+ range_type = TYPE_INDEX_TYPE (array_type);
-+ slice_range_size = ary_low_bound + elem_count - 1;
-+
-+ /* Check if the array bounds are valid. */
-+ if (get_discrete_bounds (range_type, &ary_low_bound, &ary_high_bound) < 0)
-+ error (_("slice from bad array or bitstring"));
-+ }
-+ /* When CALL_COUNT is greater than 1, we are dealing with an array of arrays.
-+ So we need to get the type below the current one and set the RANGE_TYPE
-+ accordingly. */
-+ else
-+ {
-+ range_type = TYPE_INDEX_TYPE (TYPE_TARGET_TYPE (array_type));
-+ slice_range_size = ary_low_bound + (row_count * elem_count) - 1;
-+ ary_low_bound = TYPE_LOW_BOUND (range_type);
-+ }
-
- /* FIXME-type-allocation: need a way to free this type when we are
-- done with it. */
-- slice_range_type = create_static_range_type ((struct type *) NULL,
-- TYPE_TARGET_TYPE (range_type),
-- lowbound,
-- lowbound + length - 1);
-+ done with it. */
-
-+ slice_range_type = create_static_range_type (NULL, TYPE_TARGET_TYPE (range_type),
-+ ary_low_bound, slice_range_size);
- {
-- struct type *element_type = TYPE_TARGET_TYPE (array_type);
-- LONGEST offset
-- = (lowbound - lowerbound) * TYPE_LENGTH (check_typedef (element_type));
--
-- slice_type = create_array_type ((struct type *) NULL,
-- element_type,
-- slice_range_type);
-- TYPE_CODE (slice_type) = TYPE_CODE (array_type);
-+ struct type *element_type;
-+
-+ /* When both CALL_COUNT and STRIDE_LENGTH equal 1, we can use the legacy
-+ code for subarrays. */
-+ if (call_count == 1 && stride_length == 1)
-+ {
-+ element_type = TYPE_TARGET_TYPE (array_type);
-+
-+ slice_type = create_array_type (NULL, element_type, slice_range_type);
-+
-+ TYPE_CODE (slice_type) = TYPE_CODE (array_type);
-+
-+ if (VALUE_LVAL (array) == lval_memory && value_lazy (array))
-+ v = allocate_value_lazy (slice_type);
-+ else
-+ {
-+ v = allocate_value (slice_type);
-+ value_contents_copy (v,
-+ value_embedded_offset (v),
-+ array,
-+ value_embedded_offset (array) + elt_offs,
-+ elt_size * longest_to_int (length));
-+ }
-
-- if (VALUE_LVAL (array) == lval_memory && value_lazy (array))
-- slice = allocate_value_lazy (slice_type);
-+ }
-+ /* With a CALL_COUNT or STRIDE_LENGTH are greater than 1 we are working
-+ on a range of ranges. So we copy the relevant elements into the
-+ new array we return. */
- else
- {
-- slice = allocate_value (slice_type);
-- value_contents_copy (slice, 0, array, offset,
-- type_length_units (slice_type));
-+ int j, offs_store = elt_offs;
-+ LONGEST dst_offset = 0;
-+ LONGEST src_row_length = TYPE_LENGTH (TYPE_TARGET_TYPE (array_type));
-+
-+ if (call_count == 1)
-+ {
-+ /* When CALL_COUNT is equal to 1 we are working on the current range
-+ and use these elements directly. */
-+ element_type = TYPE_TARGET_TYPE (array_type);
-+ }
-+ else
-+ {
-+ /* Working on an array of arrays, the type of the elements is the type
-+ of the subarrays' type. */
-+ element_type = TYPE_TARGET_TYPE (TYPE_TARGET_TYPE (array_type));
-+ }
-+
-+ slice_type = create_array_type (NULL, element_type, slice_range_type);
-+
-+ /* If we have a one dimensional array, we copy its TYPE_CODE. For a
-+ multi dimensional array we copy the embedded type's TYPE_CODE. */
-+ if (call_count == 1)
-+ TYPE_CODE (slice_type) = TYPE_CODE (array_type);
-+ else
-+ TYPE_CODE (slice_type) = TYPE_CODE (TYPE_TARGET_TYPE (array_type));
-+
-+ v = allocate_value (slice_type);
-+
-+ /* Iterate through the rows of the outer array and set the new offset
-+ for each row. */
-+ for (i = 0; i < row_count; i++)
-+ {
-+ elt_offs = offs_store + i * src_row_length;
-+
-+ /* Iterate through the elements in each row to copy only those. */
-+ for (j = 1; j <= elem_count; j++)
-+ {
-+ /* Fetches the contents of ARRAY and copies them into V. */
-+ value_contents_copy (v, dst_offset, array, elt_offs, elt_size);
-+ elt_offs += elt_size * stride_length;
-+ dst_offset += elt_size;
-+ }
-+ }
- }
-
-- set_value_component_location (slice, array);
-- set_value_offset (slice, value_offset (array) + offset);
-+ set_value_component_location (v, array);
-+ if (VALUE_LVAL (v) == lval_register)
-+ {
-+ VALUE_REGNUM (v) = VALUE_REGNUM (array);
-+ VALUE_NEXT_FRAME_ID (v) = VALUE_NEXT_FRAME_ID (array);
-+ }
-+ set_value_offset (v, value_offset (array) + elt_offs);
- }
-
-- return slice;
-+ return v;
- }
-
- /* Create a value for a FORTRAN complex number. Currently most of the
-diff -Naurp insight-7.12.50.20170416.orig/gdb/value.h insight-7.12.50.20170416.new/gdb/value.h
---- insight-7.12.50.20170416.orig/gdb/value.h 2017-04-16 14:23:22.913275366 +0100
-+++ insight-7.12.50.20170416.new/gdb/value.h 2017-04-16 14:24:24.103834122 +0100
-@@ -1106,6 +1106,8 @@ extern struct value *varying_to_slice (s
-
- extern struct value *value_slice (struct value *, int, int);
-
-+extern struct value *value_slice_1 (struct value *, int, int, int, int);
-+
- extern struct value *value_literal_complex (struct value *, struct value *,
- struct type *);
-
diff --git a/insight-7.12-gdb-vla-intel-fortran-vla-strings.patch b/insight-7.12-gdb-vla-intel-fortran-vla-strings.patch
deleted file mode 100644
index 05ee56f..0000000
--- a/insight-7.12-gdb-vla-intel-fortran-vla-strings.patch
+++ /dev/null
@@ -1,1443 +0,0 @@
-diff -Naurp insight-7.12.50.20170416.orig/gdb/c-valprint.c insight-7.12.50.20170416.new/gdb/c-valprint.c
---- insight-7.12.50.20170416.orig/gdb/c-valprint.c 2017-04-16 15:15:34.729718519 +0100
-+++ insight-7.12.50.20170416.new/gdb/c-valprint.c 2017-04-16 15:16:27.465186960 +0100
-@@ -650,6 +650,28 @@ c_value_print (struct value *val, struct
- else
- {
- /* normal case */
-+ if (TYPE_CODE (type) == TYPE_CODE_PTR
-+ && 1 == is_dynamic_type (type))
-+ {
-+ CORE_ADDR addr;
-+ if (NULL != TYPE_DATA_LOCATION (TYPE_TARGET_TYPE (type)))
-+ addr = value_address (val);
-+ else
-+ addr = value_as_address (val);
-+
-+ /* We resolve the target-type only when the
-+ pointer is associated. */
-+ if ((addr != 0)
-+ && (0 == type_not_associated (type)))
-+ TYPE_TARGET_TYPE (type) =
-+ resolve_dynamic_type (TYPE_TARGET_TYPE (type),
-+ NULL, addr);
-+ }
-+ else
-+ {
-+ /* Do nothing. References are already resolved from the beginning,
-+ only pointers are resolved when we actual need the target. */
-+ }
- fprintf_filtered (stream, "(");
- type_print (value_type (val), "", stream, -1);
- fprintf_filtered (stream, ") ");
-diff -Naurp insight-7.12.50.20170416.orig/gdb/dwarf2read.c insight-7.12.50.20170416.new/gdb/dwarf2read.c
---- insight-7.12.50.20170416.orig/gdb/dwarf2read.c 2017-04-16 15:15:34.798719132 +0100
-+++ insight-7.12.50.20170416.new/gdb/dwarf2read.c 2017-04-16 15:18:18.202170620 +0100
-@@ -1873,7 +1873,8 @@ static void read_signatured_type (struct
-
- static int attr_to_dynamic_prop (const struct attribute *attr,
- struct die_info *die, struct dwarf2_cu *cu,
-- struct dynamic_prop *prop);
-+ struct dynamic_prop *prop, const gdb_byte *additional_data,
-+ int additional_data_size);
-
- /* memory allocation interface */
-
-@@ -11579,7 +11580,7 @@ read_func_scope (struct die_info *die, s
- {
- newobj->static_link
- = XOBNEW (&objfile->objfile_obstack, struct dynamic_prop);
-- attr_to_dynamic_prop (attr, die, cu, newobj->static_link);
-+ attr_to_dynamic_prop (attr, die, cu, newobj->static_link, NULL, 0);
- }
-
- cu->list_in_scope = &local_symbols;
-@@ -14813,29 +14814,94 @@ read_tag_string_type (struct die_info *d
- struct gdbarch *gdbarch = get_objfile_arch (objfile);
- struct type *type, *range_type, *index_type, *char_type;
- struct attribute *attr;
-- unsigned int length;
-+ unsigned int length = UINT_MAX;
-
-+ index_type = objfile_type (objfile)->builtin_int;
-+ range_type = create_static_range_type (NULL, index_type, 1, length);
-+
-+ /* If DW_AT_string_length is defined, the length is stored in memory. */
- attr = dwarf2_attr (die, DW_AT_string_length, cu);
- if (attr)
- {
-- length = DW_UNSND (attr);
-+ if (attr_form_is_block (attr))
-+ {
-+ struct attribute *byte_size, *bit_size;
-+ struct dynamic_prop high;
-+
-+ byte_size = dwarf2_attr (die, DW_AT_byte_size, cu);
-+ bit_size = dwarf2_attr (die, DW_AT_bit_size, cu);
-+
-+ /* DW_AT_byte_size should never occur in combination with
-+ DW_AT_bit_size. */
-+ if (byte_size != NULL && bit_size != NULL)
-+ complaint (&symfile_complaints,
-+ _("DW_AT_byte_size AND "
-+ "DW_AT_bit_size found together at the same time."));
-+
-+ /* If DW_AT_string_length AND DW_AT_byte_size exist together,
-+ DW_AT_byte_size describes the number of bytes that should be read
-+ from the length memory location. */
-+ if (byte_size != NULL)
-+ {
-+ /* Build new dwarf2_locexpr_baton structure with additions to the
-+ data attribute, to reflect DWARF specialities to get address
-+ sizes. */
-+ const gdb_byte append_ops[] =
-+ {
-+ /* DW_OP_deref_size: size of an address on the target machine
-+ (bytes), where the size will be specified by the next
-+ operand. */
-+ DW_OP_deref_size,
-+ /* Operand for DW_OP_deref_size. */
-+ DW_UNSND(byte_size) };
-+
-+ if (!attr_to_dynamic_prop (attr, die, cu, &high, append_ops,
-+ ARRAY_SIZE(append_ops)))
-+ complaint (&symfile_complaints,
-+ _("Could not parse DW_AT_byte_size"));
-+ }
-+ else if (bit_size != NULL)
-+ complaint (&symfile_complaints,
-+ _("DW_AT_string_length AND "
-+ "DW_AT_bit_size found but not supported yet."));
-+ /* If DW_AT_string_length WITHOUT DW_AT_byte_size exist, the default
-+ is the address size of the target machine. */
-+ else
-+ {
-+ const gdb_byte append_ops[] =
-+ { DW_OP_deref };
-+
-+ if (!attr_to_dynamic_prop (attr, die, cu, &high, append_ops,
-+ ARRAY_SIZE(append_ops)))
-+ complaint (&symfile_complaints,
-+ _("Could not parse DW_AT_string_length"));
-+ }
-+
-+ TYPE_RANGE_DATA (range_type)->high = high;
-+ }
-+ else
-+ {
-+ TYPE_HIGH_BOUND (range_type) = DW_UNSND(attr);
-+ TYPE_HIGH_BOUND_KIND (range_type) = PROP_CONST;
-+ }
- }
- else
- {
-- /* Check for the DW_AT_byte_size attribute. */
-+ /* Check for the DW_AT_byte_size attribute, which represents the length
-+ in this case. */
- attr = dwarf2_attr (die, DW_AT_byte_size, cu);
- if (attr)
-- {
-- length = DW_UNSND (attr);
-- }
-+ {
-+ TYPE_HIGH_BOUND (range_type) = DW_UNSND(attr);
-+ TYPE_HIGH_BOUND_KIND (range_type) = PROP_CONST;
-+ }
- else
-- {
-- length = 1;
-- }
-+ {
-+ TYPE_HIGH_BOUND (range_type) = 1;
-+ TYPE_HIGH_BOUND_KIND (range_type) = PROP_CONST;
-+ }
- }
-
-- index_type = objfile_type (objfile)->builtin_int;
-- range_type = create_static_range_type (NULL, index_type, 1, length);
- char_type = language_string_char_type (cu->language_defn, gdbarch);
- type = create_string_type (NULL, char_type, range_type);
-
-@@ -15185,7 +15251,8 @@ read_base_type (struct die_info *die, st
-
- static int
- attr_to_dynamic_prop (const struct attribute *attr, struct die_info *die,
-- struct dwarf2_cu *cu, struct dynamic_prop *prop)
-+ struct dwarf2_cu *cu, struct dynamic_prop *prop,
-+ const gdb_byte *additional_data, int additional_data_size)
- {
- struct dwarf2_property_baton *baton;
- struct obstack *obstack = &cu->objfile->objfile_obstack;
-@@ -15195,14 +15262,33 @@ attr_to_dynamic_prop (const struct attri
-
- if (attr_form_is_block (attr))
- {
-- baton = XOBNEW (obstack, struct dwarf2_property_baton);
-+ baton = XOBNEW(obstack, struct dwarf2_property_baton);
- baton->referenced_type = NULL;
- baton->locexpr.per_cu = cu->per_cu;
-- baton->locexpr.size = DW_BLOCK (attr)->size;
-- baton->locexpr.data = DW_BLOCK (attr)->data;
-+
-+ if (additional_data != NULL && additional_data_size > 0)
-+ {
-+ gdb_byte *data;
-+
-+ data = (gdb_byte *) obstack_alloc(
-+ &cu->objfile->objfile_obstack,
-+ DW_BLOCK (attr)->size + additional_data_size);
-+ memcpy (data, DW_BLOCK (attr)->data, DW_BLOCK (attr)->size);
-+ memcpy (data + DW_BLOCK (attr)->size, additional_data,
-+ additional_data_size);
-+
-+ baton->locexpr.data = data;
-+ baton->locexpr.size = DW_BLOCK (attr)->size + additional_data_size;
-+ }
-+ else
-+ {
-+ baton->locexpr.data = DW_BLOCK (attr)->data;
-+ baton->locexpr.size = DW_BLOCK (attr)->size;
-+ }
-+
- prop->data.baton = baton;
- prop->kind = PROP_LOCEXPR;
-- gdb_assert (prop->data.baton != NULL);
-+ gdb_assert(prop->data.baton != NULL);
- }
- else if (attr_form_is_ref (attr))
- {
-@@ -15235,8 +15321,28 @@ attr_to_dynamic_prop (const struct attri
- baton = XOBNEW (obstack, struct dwarf2_property_baton);
- baton->referenced_type = die_type (target_die, target_cu);
- baton->locexpr.per_cu = cu->per_cu;
-- baton->locexpr.size = DW_BLOCK (target_attr)->size;
-- baton->locexpr.data = DW_BLOCK (target_attr)->data;
-+
-+ if (additional_data != NULL && additional_data_size > 0)
-+ {
-+ gdb_byte *data;
-+
-+ data = (gdb_byte *) obstack_alloc (&cu->objfile->objfile_obstack,
-+ DW_BLOCK (target_attr)->size + additional_data_size);
-+ memcpy (data, DW_BLOCK (target_attr)->data,
-+ DW_BLOCK (target_attr)->size);
-+ memcpy (data + DW_BLOCK (target_attr)->size,
-+ additional_data, additional_data_size);
-+
-+ baton->locexpr.data = data;
-+ baton->locexpr.size = (DW_BLOCK (target_attr)->size
-+ + additional_data_size);
-+ }
-+ else
-+ {
-+ baton->locexpr.data = DW_BLOCK (target_attr)->data;
-+ baton->locexpr.size = DW_BLOCK (target_attr)->size;
-+ }
-+
- prop->data.baton = baton;
- prop->kind = PROP_LOCEXPR;
- gdb_assert (prop->data.baton != NULL);
-@@ -15347,24 +15453,24 @@ read_subrange_type (struct die_info *die
-
- attr = dwarf2_attr (die, DW_AT_byte_stride, cu);
- if (attr)
-- if (!attr_to_dynamic_prop (attr, die, cu, &stride))
-+ if (!attr_to_dynamic_prop (attr, die, cu, &stride, NULL, 0))
- complaint (&symfile_complaints, _("Missing DW_AT_byte_stride "
- "- DIE at 0x%x [in module %s]"),
- to_underlying (die->sect_off), objfile_name (cu->objfile));
-
- attr = dwarf2_attr (die, DW_AT_lower_bound, cu);
- if (attr)
-- attr_to_dynamic_prop (attr, die, cu, &low);
-+ attr_to_dynamic_prop (attr, die, cu, &low, NULL, 0);
- else if (!low_default_is_valid)
- complaint (&symfile_complaints, _("Missing DW_AT_lower_bound "
- "- DIE at 0x%x [in module %s]"),
- to_underlying (die->sect_off), objfile_name (cu->objfile));
-
- attr = dwarf2_attr (die, DW_AT_upper_bound, cu);
-- if (!attr_to_dynamic_prop (attr, die, cu, &high))
-+ if (!attr_to_dynamic_prop (attr, die, cu, &high, NULL, 0))
- {
- attr = dwarf2_attr (die, DW_AT_count, cu);
-- if (attr_to_dynamic_prop (attr, die, cu, &high))
-+ if (attr_to_dynamic_prop (attr, die, cu, &high, NULL, 0))
- {
- /* If bounds are constant do the final calculation here. */
- if (low.kind == PROP_CONST && high.kind == PROP_CONST)
-@@ -23009,7 +23115,7 @@ set_die_type (struct die_info *die, stru
- attr = dwarf2_attr (die, DW_AT_allocated, cu);
- if (attr_form_is_block (attr))
- {
-- if (attr_to_dynamic_prop (attr, die, cu, &prop))
-+ if (attr_to_dynamic_prop (attr, die, cu, &prop, NULL, 0))
- add_dyn_prop (DYN_PROP_ALLOCATED, prop, type, objfile);
- }
- else if (attr != NULL)
-@@ -23024,7 +23130,7 @@ set_die_type (struct die_info *die, stru
- attr = dwarf2_attr (die, DW_AT_associated, cu);
- if (attr_form_is_block (attr))
- {
-- if (attr_to_dynamic_prop (attr, die, cu, &prop))
-+ if (attr_to_dynamic_prop (attr, die, cu, &prop, NULL, 0))
- add_dyn_prop (DYN_PROP_ASSOCIATED, prop, type, objfile);
- }
- else if (attr != NULL)
-@@ -23037,7 +23143,7 @@ set_die_type (struct die_info *die, stru
-
- /* Read DW_AT_data_location and set in type. */
- attr = dwarf2_attr (die, DW_AT_data_location, cu);
-- if (attr_to_dynamic_prop (attr, die, cu, &prop))
-+ if (attr_to_dynamic_prop (attr, die, cu, &prop, NULL, 0))
- add_dyn_prop (DYN_PROP_DATA_LOCATION, prop, type, objfile);
-
- if (dwarf2_per_objfile->die_type_hash == NULL)
-diff -Naurp insight-7.12.50.20170416.orig/gdb/f-typeprint.c insight-7.12.50.20170416.new/gdb/f-typeprint.c
---- insight-7.12.50.20170416.orig/gdb/f-typeprint.c 2017-04-16 15:15:34.786719025 +0100
-+++ insight-7.12.50.20170416.new/gdb/f-typeprint.c 2017-04-16 15:31:51.465394712 +0100
-@@ -37,7 +37,7 @@ static void f_type_print_args (struct ty
- #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 c
- {
- 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 c
-
- 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
- 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)
- {
- LONGEST upper_bound, lower_bound;
-
-@@ -183,34 +171,50 @@ f_type_print_varspec_suffix (struct type
- fprintf_filtered (stream, "(");
-
- if (type_not_associated (type))
-- val_print_not_associated (stream);
-+ print_rank_only = 1;
- else if (type_not_allocated (type))
-- val_print_not_allocated (stream);
-+ print_rank_only = 1;
-+ else if ((TYPE_ASSOCIATED_PROP (type)
-+ && PROP_CONST != TYPE_DYN_PROP_KIND (TYPE_ASSOCIATED_PROP (type)))
-+ || (TYPE_ALLOCATED_PROP (type)
-+ && PROP_CONST != TYPE_DYN_PROP_KIND (TYPE_ALLOCATED_PROP (type)))
-+ || (TYPE_DATA_LOCATION (type)
-+ && PROP_CONST != TYPE_DYN_PROP_KIND (TYPE_DATA_LOCATION (type))))
-+ /* This case exist when we ptype a typename which has the
-+ dynamic properties but cannot be resolved as there is
-+ no object. */
-+ print_rank_only = 1;
-+
-+ if (TYPE_CODE (TYPE_TARGET_TYPE (type)) == TYPE_CODE_ARRAY)
-+ f_type_print_varspec_suffix (TYPE_TARGET_TYPE (type), stream, 0,
-+ 0, 0, arrayprint_recurse_level,
-+ print_rank_only);
-+
-+ if (print_rank_only == 1)
-+ fprintf_filtered (stream, ":");
- else
-- {
-- if (TYPE_CODE (TYPE_TARGET_TYPE (type)) == TYPE_CODE_ARRAY)
-- f_type_print_varspec_suffix (TYPE_TARGET_TYPE (type), stream, 0,
-- 0, 0, arrayprint_recurse_level);
--
-- lower_bound = f77_get_lowerbound (type);
-- if (lower_bound != 1) /* Not the default. */
-- fprintf_filtered (stream, "%s:", plongest (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, "%s", plongest (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, "%s:", plongest (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, "%s", plongest (upper_bound));
-+ }
-+ }
-+
-+ if (TYPE_CODE (TYPE_TARGET_TYPE (type)) != TYPE_CODE_ARRAY)
-+ f_type_print_varspec_suffix (TYPE_TARGET_TYPE (type), stream, 0,
-+ 0, 0, arrayprint_recurse_level,
-+ print_rank_only);
-+
- if (arrayprint_recurse_level == 1)
- fprintf_filtered (stream, ")");
- else
-@@ -221,13 +225,14 @@ f_type_print_varspec_suffix (struct type
- case TYPE_CODE_PTR:
- case TYPE_CODE_REF:
- f_type_print_varspec_suffix (TYPE_TARGET_TYPE (type), stream, 0, 1, 0,
-- arrayprint_recurse_level);
-+ arrayprint_recurse_level, 0);
- fprintf_filtered (stream, ")");
- break;
-
- case TYPE_CODE_FUNC:
- f_type_print_varspec_suffix (TYPE_TARGET_TYPE (type), stream, 0,
-- passed_a_ptr, 0, arrayprint_recurse_level);
-+ passed_a_ptr, 0, arrayprint_recurse_level,
-+ 0);
- if (passed_a_ptr)
- fprintf_filtered (stream, ")");
-
-@@ -378,7 +383,7 @@ f_type_print_base (struct type *type, st
- 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 -Naurp insight-7.12.50.20170416.orig/gdb/gdbtypes.c insight-7.12.50.20170416.new/gdb/gdbtypes.c
---- insight-7.12.50.20170416.orig/gdb/gdbtypes.c 2017-04-16 15:15:34.806719203 +0100
-+++ insight-7.12.50.20170416.new/gdb/gdbtypes.c 2017-04-16 15:16:27.473187031 +0100
-@@ -1840,7 +1840,8 @@ is_dynamic_type_internal (struct type *t
- type = check_typedef (type);
-
- /* We only want to recognize references at the outermost level. */
-- if (top_level && TYPE_CODE (type) == TYPE_CODE_REF)
-+ if (top_level &&
-+ (TYPE_CODE (type) == TYPE_CODE_REF || TYPE_CODE (type) == TYPE_CODE_PTR))
- type = check_typedef (TYPE_TARGET_TYPE (type));
-
- /* Types that have a dynamic TYPE_DATA_LOCATION are considered
-@@ -1874,6 +1875,7 @@ is_dynamic_type_internal (struct type *t
- }
-
- case TYPE_CODE_ARRAY:
-+ case TYPE_CODE_STRING:
- {
- gdb_assert (TYPE_NFIELDS (type) == 1);
-
-@@ -1986,7 +1988,8 @@ resolve_dynamic_array (struct type *type
- struct type *ary_dim;
- struct dynamic_prop *prop;
-
-- gdb_assert (TYPE_CODE (type) == TYPE_CODE_ARRAY);
-+ gdb_assert (TYPE_CODE (type) == TYPE_CODE_ARRAY
-+ || TYPE_CODE (type) == TYPE_CODE_STRING);
-
- type = copy_type (type);
-
-@@ -2011,13 +2014,17 @@ resolve_dynamic_array (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);
- else
- elt_type = TYPE_TARGET_TYPE (type);
-
-- return create_array_type_with_stride (type, elt_type, range_type,
-- TYPE_FIELD_BITSIZE (type, 0));
-+ if (TYPE_CODE (type) == TYPE_CODE_STRING)
-+ return create_string_type (type, elt_type, range_type);
-+ else
-+ return create_array_type_with_stride (type, elt_type, range_type,
-+ TYPE_FIELD_BITSIZE (type, 0));
- }
-
- /* Resolve dynamic bounds of members of the union TYPE to static
-@@ -2147,6 +2154,28 @@ resolve_dynamic_struct (struct type *typ
- return resolved_type;
- }
-
-+/* Worker for pointer types. */
-+
-+static struct type *
-+resolve_dynamic_pointer (struct type *type,
-+ struct property_addr_info *addr_stack)
-+{
-+ struct dynamic_prop *prop;
-+ CORE_ADDR value;
-+
-+ type = copy_type (type);
-+
-+ /* Resolve associated property. */
-+ prop = TYPE_ASSOCIATED_PROP (type);
-+ if (prop != NULL && dwarf2_evaluate_property (prop, NULL, addr_stack, &value))
-+ {
-+ TYPE_DYN_PROP_ADDR (prop) = value;
-+ TYPE_DYN_PROP_KIND (prop) = PROP_CONST;
-+ }
-+
-+ return type;
-+}
-+
- /* Worker for resolved_dynamic_type. */
-
- static struct type *
-@@ -2195,7 +2224,12 @@ resolve_dynamic_type_internal (struct ty
- 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;
-
-diff -Naurp insight-7.12.50.20170416.orig/gdb/NEWS insight-7.12.50.20170416.new/gdb/NEWS
---- insight-7.12.50.20170416.orig/gdb/NEWS 2017-04-09 01:11:01.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/NEWS 2017-04-16 15:16:27.475187049 +0100
-@@ -109,6 +109,8 @@ maint print arc arc-instruction address
- Alpha running FreeBSD alpha*-*-freebsd*
- Alpha running GNU/kFreeBSD alpha*-*-kfreebsd*-gnu
-
-+* Fortran: Support pointers to dynamic types.
-+
- *** Changes in GDB 7.12
-
- * GDB and GDBserver now build with a C++ compiler by default.
-diff -Naurp insight-7.12.50.20170416.orig/gdb/testsuite/gdb.cp/vla-cxx.cc insight-7.12.50.20170416.new/gdb/testsuite/gdb.cp/vla-cxx.cc
---- insight-7.12.50.20170416.orig/gdb/testsuite/gdb.cp/vla-cxx.cc 2017-01-03 17:36:55.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/testsuite/gdb.cp/vla-cxx.cc 2017-04-16 15:16:27.475187049 +0100
-@@ -15,6 +15,10 @@
- You should have received a copy of the GNU General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>. */
-
-+extern "C" {
-+#include <stddef.h>
-+}
-+
- struct container;
-
- struct element
-@@ -40,11 +44,16 @@ int main(int argc, char **argv)
- typedef typeof (vla) &vlareftypedef;
- vlareftypedef vlaref2 (vla);
- container c;
-+ typeof (vla) *ptr = NULL;
-+
-+ // Before pointer assignment
-+ ptr = &vla;
-
- for (int i = 0; i < z; ++i)
- vla[i] = 5 + 2 * i;
-
- // vlas_filled
- vla[0] = 2 * vla[0];
-+
- return vla[2];
- }
-diff -Naurp insight-7.12.50.20170416.orig/gdb/testsuite/gdb.cp/vla-cxx.exp insight-7.12.50.20170416.new/gdb/testsuite/gdb.cp/vla-cxx.exp
---- insight-7.12.50.20170416.orig/gdb/testsuite/gdb.cp/vla-cxx.exp 2017-01-03 17:36:55.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/testsuite/gdb.cp/vla-cxx.exp 2017-04-16 15:16:27.476187058 +0100
-@@ -23,6 +23,12 @@ if ![runto_main] {
- return -1
- }
-
-+gdb_breakpoint [gdb_get_line_number "Before pointer assignment"]
-+gdb_continue_to_breakpoint "Before pointer assignment"
-+gdb_test "ptype ptr" "int \\(\\*\\)\\\[variable length\\\]" "ptype ptr, Before pointer assignment"
-+gdb_test "print ptr" "\\(int \\(\\*\\)\\\[variable length\\\]\\) 0x0" "print ptr, Before pointer assignment"
-+gdb_test "print *ptr" "Cannot access memory at address 0x0" "print *ptr, Before pointer assignment"
-+
- gdb_breakpoint [gdb_get_line_number "vlas_filled"]
- gdb_continue_to_breakpoint "vlas_filled"
-
-@@ -33,3 +39,6 @@ gdb_test "print vlaref" " = \\(int \\(&\
- # bug being tested, it's better not to depend on the exact spelling.
- gdb_test "print vlaref2" " = \\(.*\\) @$hex: \\{5, 7, 9\\}"
- gdb_test "print c" " = \\{e = \\{c = @$hex\\}\\}"
-+gdb_test "ptype ptr" "int \\(\\*\\)\\\[3\\\]"
-+gdb_test "print ptr" "\\(int \\(\\*\\)\\\[3\\\]\\) $hex"
-+gdb_test "print *ptr" " = \\{5, 7, 9\\}"
-diff -Naurp insight-7.12.50.20170416.orig/gdb/testsuite/gdb.fortran/pointers.exp insight-7.12.50.20170416.new/gdb/testsuite/gdb.fortran/pointers.exp
---- insight-7.12.50.20170416.orig/gdb/testsuite/gdb.fortran/pointers.exp 1970-01-01 01:00:00.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/testsuite/gdb.fortran/pointers.exp 2017-04-16 15:16:27.476187058 +0100
-@@ -0,0 +1,143 @@
-+# Copyright 2016 Free Software Foundation, Inc.
-+
-+# This program is free software; you can redistribute it and/or modify
-+# it under the terms of the GNU General Public License as published by
-+# the Free Software Foundation; either version 3 of the License, or
-+# (at your option) any later version.
-+#
-+# This program is distributed in the hope that it will be useful,
-+# but WITHOUT ANY WARRANTY; without even the implied warranty of
-+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+# GNU General Public License for more details.
-+#
-+# You should have received a copy of the GNU General Public License
-+# along with this program. If not, see <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 "print logp" "= \\(PTR TO -> \\( $logical \\)\\) 0x0" "print logp, not associated"
-+gdb_test "print *logp" "Cannot access memory at address 0x0" "print *logp, not associated"
-+gdb_test "print comp" "= \\(PTR TO -> \\( $complex \\)\\) 0x0" "print comp, not associated"
-+gdb_test "print *comp" "Cannot access memory at address 0x0" "print *comp, not associated"
-+gdb_test "print charp" "= \\(PTR TO -> \\( character\\*1 \\)\\) 0x0" "print charp, not associated"
-+gdb_test "print *charp" "Cannot access memory at address 0x0" "print *charp, not associated"
-+gdb_test "print charap" "= \\(PTR TO -> \\( character\\*3 \\)\\) 0x0" "print charap, not associated"
-+gdb_test "print *charap" "Cannot access memory at address 0x0" "print *charap, not associated"
-+gdb_test "print intp" "= \\(PTR TO -> \\( $int \\)\\) 0x0" "print intp, not associated"
-+gdb_test "print *intp" "Cannot access memory at address 0x0" "print *intp, not associated"
-+set test "print intap, not associated"
-+gdb_test_multiple "print intap" $test {
-+ -re " = \\(PTR TO -> \\( $int \\(:,:\\)\\)\\) <not associated>\r\n$gdb_prompt $" {
-+ pass $test
-+ }
-+ -re " = <not associated>\r\n$gdb_prompt $" {
-+ pass $test
-+ }
-+}
-+gdb_test "print realp" "= \\(PTR TO -> \\( $real \\)\\) 0x0" "print realp, not associated"
-+gdb_test "print *realp" "Cannot access memory at address 0x0" "print *realp, not associated"
-+gdb_test "print \$my_var = intp" "= \\(PTR TO -> \\( $int \\)\\) 0x0"
-+set test "print cyclicp1, not associated"
-+gdb_test_multiple "print cyclicp1" $test {
-+ -re "= \\( i = -?\\d+, p = 0x0 \\)\r\n$gdb_prompt $" {
-+ pass $test
-+ }
-+ -re "= \\( i = -?\\d+, p = <not associated> \\)\r\n$gdb_prompt $" {
-+ pass $test
-+ }
-+}
-+set test "print cyclicp1%p, not associated"
-+gdb_test_multiple "print cyclicp1%p" $test {
-+ -re "= \\(PTR TO -> \\( Type typewithpointer \\)\\) 0x0\r\n$gdb_prompt $" {
-+ pass $test
-+ }
-+ -re "= \\(PTR TO -> \\( Type typewithpointer \\)\\) <not associated>\r\n$gdb_prompt $" {
-+ pass $test
-+ }
-+}
-+
-+
-+gdb_breakpoint [gdb_get_line_number "Before value assignment"]
-+gdb_continue_to_breakpoint "Before value assignment"
-+gdb_test "print *(twop)%ivla2" "= <not allocated>"
-+
-+
-+gdb_breakpoint [gdb_get_line_number "After value assignment"]
-+gdb_continue_to_breakpoint "After value assignment"
-+gdb_test "print logp" "= \\(PTR TO -> \\( $logical \\)\\) $hex\( <.*>\)?"
-+gdb_test "print *logp" "= \\.TRUE\\."
-+gdb_test "print comp" "= \\(PTR TO -> \\( $complex \\)\\) $hex\( <.*>\)?"
-+gdb_test "print *comp" "= \\(1,2\\)"
-+gdb_test "print charp" "= \\(PTR TO -> \\( character\\*1 \\)\\) $hex\( <.*>\)?"
-+gdb_test "print *charp" "= 'a'"
-+gdb_test "print charap" "= \\(PTR TO -> \\( character\\*3 \\)\\) $hex\( <.*>\)?"
-+gdb_test "print *charap" "= 'abc'"
-+gdb_test "print intp" "= \\(PTR TO -> \\( $int \\)\\) $hex\( <.*>\)?"
-+gdb_test "print *intp" "= 10"
-+set test_name "print intap, associated"
-+gdb_test_multiple "print intap" $test_name {
-+ -re "= \\(\\( 1, 1, 3(, 1){7}\\) \\( 1(, 1){9}\\) \\)\r\n$gdb_prompt $" {
-+ pass $test_name
-+ }
-+ -re "= \\(PTR TO -> \\( $int \\(10,2\\)\\)\\) $hex\( <.*>\)?\r\n$gdb_prompt $" {
-+ gdb_test "print *intap" "= \\(\\( 1, 1, 3(, 1){7}\\) \\( 1(, 1){9}\\) \\)"
-+ pass $test_name
-+ }
-+}
-+set test_name "print intvlap, associated"
-+gdb_test_multiple "print intvlap" $test_name {
-+ -re "= \\(2, 2, 2, 4(, 2){6}\\)\r\n$gdb_prompt $" {
-+ pass $test_name
-+ }
-+ -re "= \\(PTR TO -> \\( $int \\(10\\)\\)\\) $hex\( <.*>\)?\r\n$gdb_prompt $" {
-+ gdb_test "print *intvlap" "= \\(2, 2, 2, 4(, 2){6}\\)"
-+ pass $test_name
-+ }
-+}
-+gdb_test "print realp" "= \\(PTR TO -> \\( $real \\)\\) $hex\( <.*>\)?"
-+gdb_test "print *realp" "= 3\\.14000\\d+"
-+gdb_test "print arrayOfPtr(2)%p" "= \\(PTR TO -> \\( Type two \\)\\) $hex\( <.*>\)?"
-+gdb_test "print *(arrayOfPtr(2)%p)" "= \\( ivla1 = \\(11, 12, 13\\), ivla2 = \\(\\( 211, 221\\) \\( 212, 222\\) \\) \\)"
-+set test_name "print arrayOfPtr(3)%p"
-+gdb_test_multiple $test_name $test_name {
-+ -re "= \\(PTR TO -> \\( Type two \\)\\) <not associated>\r\n$gdb_prompt $" {
-+ pass $test_name
-+ }
-+ -re "= \\(PTR TO -> \\( Type two \\)\\) 0x0\r\n$gdb_prompt $" {
-+ pass $test_name
-+ }
-+}
-+set test_name "print *(arrayOfPtr(3)%p), associated"
-+gdb_test_multiple "print *(arrayOfPtr(3)%p)" $test_name {
-+ -re "Cannot access memory at address 0x0\r\n$gdb_prompt $" {
-+ pass $test_name
-+ }
-+ -re "Attempt to take contents of a not associated pointer.\r\n$gdb_prompt $" {
-+ pass $test_name
-+ }
-+}
-+gdb_test "print cyclicp1" "= \\( i = 1, p = $hex\( <.*>\)? \\)"
-+gdb_test "print cyclicp1%p" "= \\(PTR TO -> \\( Type typewithpointer \\)\\) $hex\( <.*>\)?"
-+gdb_test "print *((integer*) &inta + 2)" "= 3" "print temporary pointer, array"
-+gdb_test "print *((integer*) &intvla + 3)" "= 4" "print temporary pointer, allocated vla"
-+gdb_test "print \$pc" "= \\(PTR TO -> \\( void \\(\\)\\(\\)\\)\\) $hex <pointers\\+\\d+>" "Print program counter"
-diff -Naurp insight-7.12.50.20170416.orig/gdb/testsuite/gdb.fortran/pointers.f90 insight-7.12.50.20170416.new/gdb/testsuite/gdb.fortran/pointers.f90
---- insight-7.12.50.20170416.orig/gdb/testsuite/gdb.fortran/pointers.f90 1970-01-01 01:00:00.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/testsuite/gdb.fortran/pointers.f90 2017-04-16 15:16:27.476187058 +0100
-@@ -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
-+
-+ type :: typeWithPointer
-+ integer i
-+ type(typeWithPointer), pointer:: p
-+ end type typeWithPointer
-+
-+ type :: twoPtr
-+ type (two), pointer :: p
-+ end type twoPtr
-+
-+ logical, target :: logv
-+ complex, target :: comv
-+ character, target :: charv
-+ character (len=3), target :: chara
-+ integer, target :: intv
-+ integer, target, dimension (10,2) :: inta
-+ integer, target, allocatable, dimension (:) :: intvla
-+ real, target :: realv
-+ type(two), target :: twov
-+ type(twoPtr) :: arrayOfPtr (3)
-+ type(typeWithPointer), target:: cyclicp1,cyclicp2
-+
-+ logical, pointer :: logp
-+ complex, pointer :: comp
-+ character, pointer:: charp
-+ character (len=3), pointer:: charap
-+ integer, pointer :: intp
-+ integer, pointer, dimension (:,:) :: intap
-+ integer, pointer, dimension (:) :: intvlap
-+ real, pointer :: realp
-+ type(two), pointer :: twop
-+
-+ nullify (logp)
-+ nullify (comp)
-+ nullify (charp)
-+ nullify (charap)
-+ nullify (intp)
-+ nullify (intap)
-+ nullify (intvlap)
-+ nullify (realp)
-+ nullify (twop)
-+ nullify (arrayOfPtr(1)%p)
-+ nullify (arrayOfPtr(2)%p)
-+ nullify (arrayOfPtr(3)%p)
-+ nullify (cyclicp1%p)
-+ nullify (cyclicp2%p)
-+
-+ logp => logv ! Before pointer assignment
-+ comp => comv
-+ charp => charv
-+ charap => chara
-+ intp => intv
-+ intap => inta
-+ intvlap => intvla
-+ realp => realv
-+ twop => twov
-+ arrayOfPtr(2)%p => twov
-+ cyclicp1%i = 1
-+ cyclicp1%p => cyclicp2
-+ cyclicp2%i = 2
-+ cyclicp2%p => cyclicp1
-+
-+ logv = associated(logp) ! Before value assignment
-+ comv = cmplx(1,2)
-+ charv = "a"
-+ chara = "abc"
-+ intv = 10
-+ inta(:,:) = 1
-+ inta(3,1) = 3
-+ allocate (intvla(10))
-+ intvla(:) = 2
-+ intvla(4) = 4
-+ intvlap => intvla
-+ realv = 3.14
-+
-+ allocate (twov%ivla1(3))
-+ allocate (twov%ivla2(2,2))
-+ twov%ivla1(1) = 11
-+ twov%ivla1(2) = 12
-+ twov%ivla1(3) = 13
-+ twov%ivla2(1,1) = 211
-+ twov%ivla2(2,1) = 221
-+ twov%ivla2(1,2) = 212
-+ twov%ivla2(2,2) = 222
-+
-+ intv = intv + 1 ! After value assignment
-+
-+end program pointers
-diff -Naurp insight-7.12.50.20170416.orig/gdb/testsuite/gdb.fortran/print_type.exp insight-7.12.50.20170416.new/gdb/testsuite/gdb.fortran/print_type.exp
---- insight-7.12.50.20170416.orig/gdb/testsuite/gdb.fortran/print_type.exp 1970-01-01 01:00:00.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/testsuite/gdb.fortran/print_type.exp 2017-04-16 15:16:27.476187058 +0100
-@@ -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 -Naurp insight-7.12.50.20170416.orig/gdb/testsuite/gdb.fortran/vla-ptype.exp insight-7.12.50.20170416.new/gdb/testsuite/gdb.fortran/vla-ptype.exp
---- insight-7.12.50.20170416.orig/gdb/testsuite/gdb.fortran/vla-ptype.exp 2017-04-16 15:15:34.808719221 +0100
-+++ insight-7.12.50.20170416.new/gdb/testsuite/gdb.fortran/vla-ptype.exp 2017-04-16 15:16:27.477187066 +0100
-@@ -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 =
-
- 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 "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 "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"
-diff -Naurp insight-7.12.50.20170416.orig/gdb/testsuite/gdb.fortran/vla-strings.exp insight-7.12.50.20170416.new/gdb/testsuite/gdb.fortran/vla-strings.exp
---- insight-7.12.50.20170416.orig/gdb/testsuite/gdb.fortran/vla-strings.exp 1970-01-01 01:00:00.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/testsuite/gdb.fortran/vla-strings.exp 2017-04-16 15:16:27.477187066 +0100
-@@ -0,0 +1,103 @@
-+# Copyright 2016 Free Software Foundation, Inc.
-+
-+# This program is free software; you can redistribute it and/or modify
-+# it under the terms of the GNU General Public License as published by
-+# the Free Software Foundation; either version 3 of the License, or
-+# (at your option) any later version.
-+#
-+# This program is distributed in the hope that it will be useful,
-+# but WITHOUT ANY WARRANTY; without even the implied warranty of
-+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+# GNU General Public License for more details.
-+#
-+# You should have received a copy of the GNU General Public License
-+# along with this program. If not, see <http://www.gnu.org/licenses/>.
-+
-+standard_testfile ".f90"
-+
-+if { [prepare_for_testing ${testfile}.exp ${testfile} ${srcfile} \
-+ {debug f90 quiet}] } {
-+ return -1
-+}
-+
-+# check that all fortran standard datatypes will be
-+# handled correctly when using as VLA's
-+
-+if ![runto_main] {
-+ untested "could not run to main"
-+ return -1
-+}
-+
-+gdb_breakpoint [gdb_get_line_number "var_char-allocated-1"]
-+gdb_continue_to_breakpoint "var_char-allocated-1"
-+set test "whatis var_char first time"
-+gdb_test_multiple "whatis var_char" $test {
-+ -re "type = PTR TO -> \\( character\\*10 \\)\r\n$gdb_prompt $" {
-+ pass $test
-+ }
-+ -re "type = character\\*10\r\n$gdb_prompt $" {
-+ pass $test
-+ }
-+}
-+set test "ptype var_char first time"
-+gdb_test_multiple "ptype var_char" $test {
-+ -re "type = PTR TO -> \\( character\\*10 \\)\r\n$gdb_prompt $" {
-+ pass $test
-+ }
-+ -re "type = character\\*10\r\n$gdb_prompt $" {
-+ pass $test
-+ }
-+}
-+
-+
-+gdb_test "next" "\\d+.*var_char = 'foo'.*" \
-+ "next to allocation status of var_char"
-+gdb_test "print l" " = \\.TRUE\\." "print allocation status first time"
-+
-+
-+gdb_breakpoint [gdb_get_line_number "var_char-filled-1"]
-+gdb_continue_to_breakpoint "var_char-filled-1"
-+set test "print var_char, var_char-filled-1"
-+gdb_test_multiple "print var_char" $test {
-+ -re "= \\(PTR TO -> \\( character\\*3 \\)\\) $hex\r\n$gdb_prompt $" {
-+ gdb_test "print *var_char" "= 'foo'" "print *var_char, var_char-filled-1"
-+ pass $test
-+ }
-+ -re "= 'foo'\r\n$gdb_prompt $" {
-+ pass $test
-+ }
-+}
-+set test "ptype var_char, var_char-filled-1"
-+gdb_test_multiple "ptype var_char" $test {
-+ -re "type = PTR TO -> \\( character\\*3 \\)\r\n$gdb_prompt $" {
-+ pass $test
-+ }
-+ -re "type = character\\*3\r\n$gdb_prompt $" {
-+ pass $test
-+ }
-+}
-+gdb_test "print var_char(1)" " = 102 'f'" "print var_char(1)"
-+gdb_test "print var_char(3)" " = 111 'o'" "print var_char(3)"
-+
-+
-+gdb_breakpoint [gdb_get_line_number "var_char-filled-2"]
-+gdb_continue_to_breakpoint "var_char-filled-2"
-+set test "print var_char, var_char-filled-2"
-+gdb_test_multiple "print var_char" $test {
-+ -re "= \\(PTR TO -> \\( character\\*6 \\)\\) $hex\r\n$gdb_prompt $" {
-+ gdb_test "print *var_char" "= 'foobar'" "print *var_char, var_char-filled-2"
-+ pass $test
-+ }
-+ -re "= 'foobar'\r\n$gdb_prompt $" {
-+ pass $test
-+ }
-+}
-+set test "ptype var_char, var_char-filled-2"
-+gdb_test_multiple "ptype var_char" $test {
-+ -re "type = PTR TO -> \\( character\\*6 \\)\r\n$gdb_prompt $" {
-+ pass $test
-+ }
-+ -re "type = character\\*6\r\n$gdb_prompt $" {
-+ pass $test
-+ }
-+}
-diff -Naurp insight-7.12.50.20170416.orig/gdb/testsuite/gdb.fortran/vla-strings.f90 insight-7.12.50.20170416.new/gdb/testsuite/gdb.fortran/vla-strings.f90
---- insight-7.12.50.20170416.orig/gdb/testsuite/gdb.fortran/vla-strings.f90 1970-01-01 01:00:00.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/testsuite/gdb.fortran/vla-strings.f90 2017-04-16 15:16:27.477187066 +0100
-@@ -0,0 +1,39 @@
-+! Copyright 2016 Free Software Foundation, Inc.
-+!
-+! This program is free software; you can redistribute it and/or modify
-+! it under the terms of the GNU General Public License as published by
-+! the Free Software Foundation; either version 3 of the License, or
-+! (at your option) any later version.
-+!
-+! This program is distributed in the hope that it will be useful,
-+! but WITHOUT ANY WARRANTY; without even the implied warranty of
-+! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+! GNU General Public License for more details.
-+!
-+! You should have received a copy of the GNU General Public License
-+! along with this program. If not, see <http://www.gnu.org/licenses/>.
-+
-+program vla_strings
-+ character(len=:), target, allocatable :: var_char
-+ character(len=:), pointer :: var_char_p
-+ logical :: l
-+
-+ allocate(character(len=10) :: var_char)
-+ l = allocated(var_char) ! var_char-allocated-1
-+ var_char = 'foo'
-+ deallocate(var_char) ! var_char-filled-1
-+ l = allocated(var_char) ! var_char-deallocated
-+ allocate(character(len=42) :: var_char)
-+ l = allocated(var_char)
-+ var_char = 'foobar'
-+ var_char = '' ! var_char-filled-2
-+ var_char = 'bar' ! var_char-empty
-+ deallocate(var_char)
-+ allocate(character(len=21) :: var_char)
-+ l = allocated(var_char) ! var_char-allocated-3
-+ var_char = 'johndoe'
-+ var_char_p => var_char
-+ l = associated(var_char_p) ! var_char_p-associated
-+ var_char_p => null()
-+ l = associated(var_char_p) ! var_char_p-not-associated
-+end program vla_strings
-diff -Naurp insight-7.12.50.20170416.orig/gdb/testsuite/gdb.fortran/vla-type.exp insight-7.12.50.20170416.new/gdb/testsuite/gdb.fortran/vla-type.exp
---- insight-7.12.50.20170416.orig/gdb/testsuite/gdb.fortran/vla-type.exp 2017-01-03 17:36:55.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/testsuite/gdb.fortran/vla-type.exp 2017-04-16 15:16:27.477187066 +0100
-@@ -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 -Naurp insight-7.12.50.20170416.orig/gdb/testsuite/gdb.fortran/vla-value.exp insight-7.12.50.20170416.new/gdb/testsuite/gdb.fortran/vla-value.exp
---- insight-7.12.50.20170416.orig/gdb/testsuite/gdb.fortran/vla-value.exp 2017-01-03 17:36:55.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/testsuite/gdb.fortran/vla-value.exp 2017-04-16 15:16:27.477187066 +0100
-@@ -14,6 +14,7 @@
- # along with this program. If not, see <http://www.gnu.org/licenses/>.
-
- standard_testfile "vla.f90"
-+load_lib "fortran.exp"
-
- if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile} \
- {debug f90 quiet}] } {
-@@ -25,12 +26,15 @@ if ![runto_main] {
- return -1
- }
-
-+# Depending on the compiler being used, the type names can be printed differently.
-+set real [fortran_real4]
-+
- # Try to access values in non allocated VLA
- gdb_breakpoint [gdb_get_line_number "vla1-init"]
- gdb_continue_to_breakpoint "vla1-init"
- gdb_test "print vla1" " = <not allocated>" "print non-allocated vla1"
- gdb_test "print &vla1" \
-- " = \\\(PTR TO -> \\\( real\\\(kind=4\\\) \\\(<not allocated>\\\)\\\)\\\) $hex" \
-+ " = \\\(PTR TO -> \\\( $real \\\(:,:,:\\\)\\\)\\\) $hex" \
- "print non-allocated &vla1"
- gdb_test "print vla1(1,1,1)" "no such vector element \\\(vector not allocated\\\)" \
- "print member in non-allocated vla1 (1)"
-@@ -51,7 +55,7 @@ with_timeout_factor 15 {
- "step over value assignment of vla1"
- }
- gdb_test "print &vla1" \
-- " = \\\(PTR TO -> \\\( real\\\(kind=4\\\) \\\(10,10,10\\\)\\\)\\\) $hex" \
-+ " = \\\(PTR TO -> \\\( $real \\\(10,10,10\\\)\\\)\\\) $hex" \
- "print allocated &vla1"
- gdb_test "print vla1(3, 6, 9)" " = 1311" "print allocated vla1(3,6,9)"
- gdb_test "print vla1(1, 3, 8)" " = 1311" "print allocated vla1(1,3,8)"
-@@ -71,7 +75,7 @@ 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\\\(kind=4\\\) \\\(<not associated>\\\)\\\)\\\) $hex" \
-+ " = \\\(PTR TO -> \\\( $real \\\(:,:,:\\\)\\\)\\\) $hex" \
- "print non-associated &pvla"
- gdb_test "print pvla(1, 3, 8)" "no such vector element \\\(vector not associated\\\)" \
- "print undefined pvla(1,3,8)"
-@@ -80,7 +84,7 @@ gdb_test "print pvla(1, 3, 8)" "no such
- gdb_breakpoint [gdb_get_line_number "pvla-associated"]
- gdb_continue_to_breakpoint "pvla-associated"
- gdb_test "print &pvla" \
-- " = \\\(PTR TO -> \\\( real\\\(kind=4\\\) \\\(10,10,10\\\)\\\)\\\) $hex" \
-+ " = \\\(PTR TO -> \\\( $real \\\(10,10,10\\\)\\\)\\\) $hex" \
- "print associated &pvla"
- gdb_test "print pvla(3, 6, 9)" " = 42" "print associated pvla(3,6,9)"
- gdb_test "print pvla(1, 3, 8)" " = 1001" "print associated pvla(1,3,8)"
-diff -Naurp insight-7.12.50.20170416.orig/gdb/testsuite/gdb.mi/mi-var-child-f.exp insight-7.12.50.20170416.new/gdb/testsuite/gdb.mi/mi-var-child-f.exp
---- insight-7.12.50.20170416.orig/gdb/testsuite/gdb.mi/mi-var-child-f.exp 2017-01-03 17:36:55.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/testsuite/gdb.mi/mi-var-child-f.exp 2017-04-16 15:16:27.478187075 +0100
-@@ -17,6 +17,7 @@
-
- load_lib mi-support.exp
- set MIFLAGS "-i=mi"
-+load_lib "fortran.exp"
-
- if { [skip_fortran_tests] } { return -1 }
-
-@@ -40,10 +41,8 @@ mi_runto MAIN__
- mi_create_varobj "array" "array" "create local variable array"
-
-
--# Depending on the compiler version being used, the name of the 4-byte integer
--# and real types can be printed differently. For instance, gfortran-4.1 uses
--# "int4" whereas gfortran-4.3 uses "integer(kind=4)".
--set int4 "(int4|integer\\(kind=4\\))"
-+# Depending on the compiler being used, the type names can be printed differently.
-+set int4 [fortran_int4]
-
- set children [list [list "array.-1" "-1" 2 "$int4 \\(2\\)"] \
- [list "array.0" "0" 2 "$int4 \\(2\\)"] \
-diff -Naurp insight-7.12.50.20170416.orig/gdb/testsuite/gdb.mi/mi-vla-fortran.exp insight-7.12.50.20170416.new/gdb/testsuite/gdb.mi/mi-vla-fortran.exp
---- insight-7.12.50.20170416.orig/gdb/testsuite/gdb.mi/mi-vla-fortran.exp 2017-01-03 17:36:55.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/testsuite/gdb.mi/mi-vla-fortran.exp 2017-04-16 15:16:27.478187075 +0100
-@@ -17,7 +17,9 @@
- # Array (VLA).
-
- load_lib mi-support.exp
-+load_lib fortran.exp
- set MIFLAGS "-i=mi"
-+load_lib "fortran.exp"
-
- gdb_exit
- if [mi_gdb_start] {
-@@ -32,6 +34,9 @@ if { [gdb_compile "${srcdir}/${subdir}/$
- return -1
- }
-
-+# Depending on the compiler being used, the type names can be printed differently.
-+set real [fortran_real4]
-+
- mi_delete_breakpoints
- mi_gdb_reinitialize_dir $srcdir/$subdir
- mi_gdb_load ${binfile}
-@@ -46,10 +51,10 @@ mi_expect_stop "breakpoint-hit" "vla" ""
- mi_gdb_test "500-data-evaluate-expression vla1" \
- "500\\^done,value=\"<not allocated>\"" "evaluate not allocated vla"
-
--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\"" \
-@@ -58,7 +63,7 @@ mi_gdb_test "503-var-evaluate-expression
- "503\\^done,value=\"\\\[0\\\]\"" \
- "eval variable vla1_not_allocated"
- mi_list_array_varobj_children_with_index "vla1_not_allocated" "0" "1" \
-- "real\\\(kind=4\\\)" "get children of vla1_not_allocated"
-+ "$real" "get children of vla1_not_allocated"
-
-
-
-@@ -71,10 +76,10 @@ mi_expect_stop "breakpoint-hit" "vla" ""
- mi_gdb_test "510-data-evaluate-expression vla1" \
- "510\\^done,value=\"\\(.*\\)\"" "evaluate allocated vla"
-
--mi_create_varobj_checked vla1_allocated vla1 "real\\\(kind=4\\\) \\\(5\\\)" \
-+mi_create_varobj_checked vla1_allocated vla1 "$real \\\(5\\\)" \
- "create local variable vla1_allocated"
- mi_gdb_test "511-var-info-type vla1_allocated" \
-- "511\\^done,type=\"real\\\(kind=4\\\) \\\(5\\\)\"" \
-+ "511\\^done,type=\"$real \\\(5\\\)\"" \
- "info type variable vla1_allocated"
- mi_gdb_test "512-var-show-format vla1_allocated" \
- "512\\^done,format=\"natural\"" \
-@@ -83,7 +88,7 @@ mi_gdb_test "513-var-evaluate-expression
- "513\\^done,value=\"\\\[5\\\]\"" \
- "eval variable vla1_allocated"
- mi_list_array_varobj_children_with_index "vla1_allocated" "5" "1" \
-- "real\\\(kind=4\\\)" "get children of vla1_allocated"
-+ "$real" "get children of vla1_allocated"
-
-
- set bp_lineno [gdb_get_line_number "vla1-filled"]
-@@ -136,10 +141,10 @@ 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\"" \
-@@ -148,7 +153,7 @@ gdb_expect {
- "583\\^done,value=\"\\\[0\\\]\"" \
- "eval variable pvla2_not_associated"
- mi_list_array_varobj_children_with_index "pvla2_not_associated" "0" "1" \
-- "real\\\(kind=4\\\)" "get children of pvla2_not_associated"
-+ "$real" "get children of pvla2_not_associated"
- }
- -re "580\\^error,msg=\"value contents too large \\(\[0-9\]+ bytes\\).*${mi_gdb_prompt}$" {
- # Undefined behaviour in gfortran.
-@@ -173,9 +178,9 @@ mi_gdb_test "590-data-evaluate-expressio
- "evaluate associated vla"
-
- mi_create_varobj_checked pvla2_associated pvla2 \
-- "real\\\(kind=4\\\) \\\(5,2\\\)" "create local variable pvla2_associated"
-+ "$real \\\(5,2\\\)" "create local variable pvla2_associated"
- mi_gdb_test "591-var-info-type pvla2_associated" \
-- "591\\^done,type=\"real\\\(kind=4\\\) \\\(5,2\\\)\"" \
-+ "591\\^done,type=\"$real \\\(5,2\\\)\"" \
- "info type variable pvla2_associated"
- mi_gdb_test "592-var-show-format pvla2_associated" \
- "592\\^done,format=\"natural\"" \
-diff -Naurp insight-7.12.50.20170416.orig/gdb/typeprint.c insight-7.12.50.20170416.new/gdb/typeprint.c
---- insight-7.12.50.20170416.orig/gdb/typeprint.c 2017-03-25 10:42:37.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/typeprint.c 2017-04-16 15:16:27.478187075 +0100
-@@ -474,6 +474,25 @@ whatis_exp (char *exp, int show)
- printf_filtered (" */\n");
- }
-
-+ /* Resolve any dynamic target type, as we might print
-+ additional information about the target.
-+ For example, in Fortran and C we are printing the dimension of the
-+ dynamic array the pointer is pointing to. */
-+ if (TYPE_CODE (type) == TYPE_CODE_PTR
-+ && is_dynamic_type (type) == 1)
-+ {
-+ CORE_ADDR addr;
-+ if (NULL != TYPE_DATA_LOCATION (TYPE_TARGET_TYPE(type)))
-+ addr = value_address (val);
-+ else
-+ addr = value_as_address (val);
-+
-+ if (addr != 0
-+ && type_not_associated (type) == 0)
-+ TYPE_TARGET_TYPE (type) = resolve_dynamic_type (TYPE_TARGET_TYPE (type),
-+ NULL, addr);
-+ }
-+
- LA_PRINT_TYPE (type, "", gdb_stdout, show, 0, &flags);
- printf_filtered ("\n");
-
-diff -Naurp insight-7.12.50.20170416.orig/gdb/valops.c insight-7.12.50.20170416.new/gdb/valops.c
---- insight-7.12.50.20170416.orig/gdb/valops.c 2017-04-16 15:15:34.809719230 +0100
-+++ insight-7.12.50.20170416.new/gdb/valops.c 2017-04-16 15:16:27.479187084 +0100
-@@ -1574,6 +1574,19 @@ value_ind (struct value *arg1)
- if (TYPE_CODE (base_type) == TYPE_CODE_PTR)
- {
- struct type *enc_type;
-+ CORE_ADDR addr;
-+
-+ if (type_not_associated (base_type))
-+ error (_("Attempt to take contents of a not associated pointer."));
-+
-+ if (NULL != TYPE_DATA_LOCATION (TYPE_TARGET_TYPE (base_type)))
-+ addr = value_address (arg1);
-+ else
-+ addr = value_as_address (arg1);
-+
-+ if (addr != 0)
-+ TYPE_TARGET_TYPE (base_type) =
-+ resolve_dynamic_type (TYPE_TARGET_TYPE (base_type), NULL, addr);
-
- /* We may be pointing to something embedded in a larger object.
- Get the real type of the enclosing object. */
-@@ -1589,8 +1602,7 @@ value_ind (struct value *arg1)
- else
- /* Retrieve the enclosing object pointed to. */
- arg2 = value_at_lazy (enc_type,
-- (value_as_address (arg1)
-- - value_pointed_to_offset (arg1)));
-+ (addr - value_pointed_to_offset (arg1)));
-
- enc_type = value_type (arg2);
- return readjust_indirect_value_type (arg2, enc_type, base_type, arg1);
-diff -Naurp insight-7.12.50.20170416.orig/gdb/valprint.c insight-7.12.50.20170416.new/gdb/valprint.c
---- insight-7.12.50.20170416.orig/gdb/valprint.c 2017-04-16 15:15:34.746718670 +0100
-+++ insight-7.12.50.20170416.new/gdb/valprint.c 2017-04-16 15:16:27.480187093 +0100
-@@ -1166,12 +1166,6 @@ value_check_printable (struct value *val
- return 0;
- }
-
-- if (type_not_associated (value_type (val)))
-- {
-- val_print_not_associated (stream);
-- return 0;
-- }
--
- if (type_not_allocated (value_type (val)))
- {
- val_print_not_allocated (stream);
diff --git a/insight-7.12-gdb-vla-intel-stringbt-fix.patch b/insight-7.12-gdb-vla-intel-stringbt-fix.patch
deleted file mode 100644
index 4a907b2..0000000
--- a/insight-7.12-gdb-vla-intel-stringbt-fix.patch
+++ /dev/null
@@ -1,141 +0,0 @@
-diff -Naurp insight-7.12.50.20170416.orig/gdb/dwarf2loc.c insight-7.12.50.20170416.new/gdb/dwarf2loc.c
---- insight-7.12.50.20170416.orig/gdb/dwarf2loc.c 2017-04-16 13:23:04.683298600 +0100
-+++ insight-7.12.50.20170416.new/gdb/dwarf2loc.c 2017-04-16 13:24:55.140258427 +0100
-@@ -42,6 +42,7 @@
- #include <algorithm>
- #include <vector>
- #include <unordered_set>
-+#include <functional>
- #include "common/underlying.h"
-
- extern int dwarf_always_disassemble;
-@@ -2369,6 +2370,18 @@ dwarf2_evaluate_loc_desc_full (struct ty
- ctx.per_cu = per_cu;
- ctx.obj_address = 0;
-
-+struct frame_info *old_frame (deprecated_safe_get_selected_frame ());
-+class RestoreCall {
-+private:
-+ const std::function<void ()> func;
-+public:
-+ RestoreCall(std::function<void ()> func_):func(func_) {}
-+ ~RestoreCall() { func(); }
-+} restore_frame([&]() {
-+ select_frame (old_frame);
-+});
-+if (frame != NULL) select_frame (frame);
-+
- scoped_value_mark free_values;
-
- ctx.gdbarch = get_objfile_arch (objfile);
-diff -Naurp insight-7.12.50.20170416.orig/gdb/testsuite/gdb.fortran/dynamic-other-frame.exp insight-7.12.50.20170416.new/gdb/testsuite/gdb.fortran/dynamic-other-frame.exp
---- insight-7.12.50.20170416.orig/gdb/testsuite/gdb.fortran/dynamic-other-frame.exp 1970-01-01 01:00:00.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/testsuite/gdb.fortran/dynamic-other-frame.exp 2017-04-16 13:23:54.445731016 +0100
-@@ -0,0 +1,39 @@
-+# Copyright 2010 Free Software Foundation, Inc.
-+
-+# This program is free software; you can redistribute it and/or modify
-+# it under the terms of the GNU General Public License as published by
-+# the Free Software Foundation; either version 2 of the License, or
-+# (at your option) any later version.
-+#
-+# This program is distributed in the hope that it will be useful,
-+# but WITHOUT ANY WARRANTY; without even the implied warranty of
-+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+# GNU General Public License for more details.
-+#
-+# You should have received a copy of the GNU General Public License
-+# along with this program; if not, write to the Free Software
-+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-+
-+set testfile "dynamic-other-frame"
-+set srcfile1 ${testfile}.f90
-+set srcfile2 ${testfile}-stub.f90
-+set objfile2 [standard_output_file ${testfile}-stub.o]
-+set executable ${testfile}
-+set binfile [standard_output_file ${executable}]
-+
-+if { [gdb_compile "${srcdir}/${subdir}/${srcfile2}" "${objfile2}" object {f90}] != ""
-+ || [gdb_compile "${srcdir}/${subdir}/${srcfile1} ${objfile2}" "${binfile}" executable {debug f90}] != "" } {
-+ untested "Couldn't compile ${srcfile1} or ${srcfile2}"
-+ return -1
-+}
-+
-+clean_restart ${executable}
-+
-+gdb_test_no_output "set print frame-arguments all"
-+
-+if ![runto bar_] then {
-+ perror "couldn't run to bar_"
-+ continue
-+}
-+
-+gdb_test "bt" {foo \(string='hello'.*}
-diff -Naurp insight-7.12.50.20170416.orig/gdb/testsuite/gdb.fortran/dynamic-other-frame.f90 insight-7.12.50.20170416.new/gdb/testsuite/gdb.fortran/dynamic-other-frame.f90
---- insight-7.12.50.20170416.orig/gdb/testsuite/gdb.fortran/dynamic-other-frame.f90 1970-01-01 01:00:00.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/testsuite/gdb.fortran/dynamic-other-frame.f90 2017-04-16 13:23:54.445731016 +0100
-@@ -0,0 +1,36 @@
-+! Copyright 2010 Free Software Foundation, Inc.
-+!
-+! This program is free software; you can redistribute it and/or modify
-+! it under the terms of the GNU General Public License as published by
-+! the Free Software Foundation; either version 2 of the License, or
-+! (at your option) any later version.
-+!
-+! This program is distributed in the hope that it will be useful,
-+! but WITHOUT ANY WARRANTY; without even the implied warranty of
-+! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+! GNU General Public License for more details.
-+!
-+! You should have received a copy of the GNU General Public License
-+! along with this program; if not, write to the Free Software
-+! Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-+!
-+! Ihis file is the Fortran source file for dynamic.exp.
-+! Original file written by Jakub Jelinek <jakub(a)redhat.com>.
-+! Modified for the GDB testcase by Jan Kratochvil <jan.kratochvil(a)redhat.com>.
-+
-+subroutine foo (string)
-+ interface
-+ subroutine bar
-+ end subroutine
-+ end interface
-+ character string*(*)
-+ call bar ! stop-here
-+end subroutine foo
-+program test
-+ interface
-+ subroutine foo (string)
-+ character string*(*)
-+ end subroutine
-+ end interface
-+ call foo ('hello')
-+end
-diff -Naurp insight-7.12.50.20170416.orig/gdb/testsuite/gdb.fortran/dynamic-other-frame-stub.f90 insight-7.12.50.20170416.new/gdb/testsuite/gdb.fortran/dynamic-other-frame-stub.f90
---- insight-7.12.50.20170416.orig/gdb/testsuite/gdb.fortran/dynamic-other-frame-stub.f90 1970-01-01 01:00:00.000000000 +0100
-+++ insight-7.12.50.20170416.new/gdb/testsuite/gdb.fortran/dynamic-other-frame-stub.f90 2017-04-16 13:23:54.444731007 +0100
-@@ -0,0 +1,24 @@
-+! Copyright 2010 Free Software Foundation, Inc.
-+!
-+! This program is free software; you can redistribute it and/or modify
-+! it under the terms of the GNU General Public License as published by
-+! the Free Software Foundation; either version 2 of the License, or
-+! (at your option) any later version.
-+!
-+! This program is distributed in the hope that it will be useful,
-+! but WITHOUT ANY WARRANTY; without even the implied warranty of
-+! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+! GNU General Public License for more details.
-+!
-+! You should have received a copy of the GNU General Public License
-+! along with this program; if not, write to the Free Software
-+! Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-+!
-+! Ihis file is the Fortran source file for dynamic.exp.
-+! Original file written by Jakub Jelinek <jakub(a)redhat.com>.
-+! Modified for the GDB testcase by Jan Kratochvil <jan.kratochvil(a)redhat.com>.
-+
-+subroutine bar
-+ real :: dummy
-+ dummy = 1
-+end subroutine bar
diff --git a/insight-8.1-buildid-locate-solib-missing-ids.patch b/insight-8.1-buildid-locate-solib-missing-ids.patch
new file mode 100644
index 0000000..11e5fc1
--- /dev/null
+++ b/insight-8.1-buildid-locate-solib-missing-ids.patch
@@ -0,0 +1,221 @@
+diff -Naurp insight-8.1.50.20180216.orig/gdb/solib-svr4.c insight-8.1.50.20180216.new/gdb/solib-svr4.c
+--- insight-8.1.50.20180216.orig/gdb/solib-svr4.c 2018-02-17 19:03:36.184146855 +0100
++++ insight-8.1.50.20180216.new/gdb/solib-svr4.c 2018-02-17 19:08:52.181273047 +0100
+@@ -1389,14 +1389,27 @@ svr4_read_so_list (CORE_ADDR lm, CORE_AD
+ }
+
+ {
+- struct bfd_build_id *build_id;
++ struct bfd_build_id *build_id = NULL;
+
+ strncpy (newobj->so_original_name, buffer, SO_NAME_MAX_PATH_SIZE - 1);
+ newobj->so_original_name[SO_NAME_MAX_PATH_SIZE - 1] = '\0';
+ /* May get overwritten below. */
+ strcpy (newobj->so_name, newobj->so_original_name);
+
+- build_id = build_id_addr_get (li->l_ld);
++ /* In the case the main executable was found according to its build-id
++ (from a core file) prevent loading a different build of a library
++ with accidentally the same SO_NAME.
++
++ It suppresses bogus backtraces (and prints "??" there instead) if
++ the on-disk files no longer match the running program version.
++
++ If the main executable was not loaded according to its build-id do
++ not do any build-id checking of the libraries. There may be missing
++ build-ids dumped in the core file and we would map all the libraries
++ to the only existing file loaded that time - the executable. */
++ if (symfile_objfile != NULL
++ && (symfile_objfile->flags & OBJF_BUILD_ID_CORE_LOADED) != 0)
++ build_id = build_id_addr_get (li->l_ld);
+ if (build_id != NULL)
+ {
+ char *name, *build_id_filename;
+@@ -1411,23 +1424,7 @@ svr4_read_so_list (CORE_ADDR lm, CORE_AD
+ xfree (name);
+ }
+ else
+- {
+- debug_print_missing (newobj->so_name, build_id_filename);
+-
+- /* In the case the main executable was found according to
+- its build-id (from a core file) prevent loading
+- a different build of a library with accidentally the
+- same SO_NAME.
+-
+- It suppresses bogus backtraces (and prints "??" there
+- instead) if the on-disk files no longer match the
+- running program version. */
+-
+- if (symfile_objfile != NULL
+- && (symfile_objfile->flags
+- & OBJF_BUILD_ID_CORE_LOADED) != 0)
+- newobj->so_name[0] = 0;
+- }
++ debug_print_missing (newobj->so_name, build_id_filename);
+
+ xfree (build_id_filename);
+ xfree (build_id);
+diff -Naurp insight-8.1.50.20180216.orig/gdb/testsuite/gdb.base/gcore-buildid-exec-but-not-solib.exp insight-8.1.50.20180216.new/gdb/testsuite/gdb.base/gcore-buildid-exec-but-not-solib.exp
+--- insight-8.1.50.20180216.orig/gdb/testsuite/gdb.base/gcore-buildid-exec-but-not-solib.exp 1970-01-01 01:00:00.000000000 +0100
++++ insight-8.1.50.20180216.new/gdb/testsuite/gdb.base/gcore-buildid-exec-but-not-solib.exp 2018-02-17 19:04:46.864844170 +0100
+@@ -0,0 +1,105 @@
++# Copyright 2016 Free Software Foundation, Inc.
++
++# This program is free software; you can redistribute it and/or modify
++# it under the terms of the GNU General Public License as published by
++# the Free Software Foundation; either version 3 of the License, or
++# (at your option) any later version.
++#
++# This program is distributed in the hope that it will be useful,
++# but WITHOUT ANY WARRANTY; without even the implied warranty of
++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++# GNU General Public License for more details.
++#
++# You should have received a copy of the GNU General Public License
++# along with this program. If not, see <http://www.gnu.org/licenses/>.
++
++if {[skip_shlib_tests]} {
++ return 0
++}
++
++set testfile "gcore-buildid-exec-but-not-solib"
++set srcmainfile ${testfile}-main.c
++set srclibfile ${testfile}-lib.c
++set libfile [standard_output_file ${testfile}-lib.so]
++set objfile [standard_output_file ${testfile}-main.o]
++set executable ${testfile}-main
++set binfile [standard_output_file ${executable}]
++set gcorefile [standard_output_file ${executable}.gcore]
++set outdir [file dirname $binfile]
++
++if { [gdb_compile_shlib ${srcdir}/${subdir}/${srclibfile} ${libfile} "debug additional_flags=-Wl,--build-id"] != ""
++ || [gdb_compile ${srcdir}/${subdir}/${srcmainfile} ${objfile} object {debug}] != "" } {
++ unsupported "-Wl,--build-id compilation failed"
++ return -1
++}
++set opts [list debug shlib=${libfile} "additional_flags=-Wl,--build-id"]
++if { [gdb_compile ${objfile} ${binfile} executable $opts] != "" } {
++ unsupported "-Wl,--build-id compilation failed"
++ return -1
++}
++
++clean_restart $executable
++gdb_load_shlib $libfile
++
++# Does this gdb support gcore?
++set test "help gcore"
++gdb_test_multiple $test $test {
++ -re "Undefined command: .gcore.*\r\n$gdb_prompt $" {
++ # gcore command not supported -- nothing to test here.
++ unsupported "gdb does not support gcore on this target"
++ return -1;
++ }
++ -re "Save a core file .*\r\n$gdb_prompt $" {
++ pass $test
++ }
++}
++
++if { ![runto lib] } then {
++ return -1
++}
++
++set escapedfilename [string_to_regexp ${gcorefile}]
++
++set test "save a corefile"
++gdb_test_multiple "gcore ${gcorefile}" $test {
++ -re "Saved corefile ${escapedfilename}\r\n$gdb_prompt $" {
++ pass $test
++ }
++ -re "Can't create a corefile\r\n$gdb_prompt $" {
++ unsupported $test
++ return -1
++ }
++}
++
++# Now restart gdb and load the corefile.
++
++clean_restart $executable
++gdb_load_shlib $libfile
++
++set buildid [build_id_debug_filename_get $libfile]
++
++regsub {\.debug$} $buildid {} buildid
++
++set debugdir [standard_output_file ${testfile}-debugdir]
++file delete -force -- $debugdir
++
++file mkdir $debugdir/[file dirname $libfile]
++file copy $libfile $debugdir/${libfile}
++
++file mkdir $debugdir/[file dirname $buildid]
++file copy $libfile $debugdir/${buildid}
++
++remote_exec build "ln -s /lib ${debugdir}/"
++remote_exec build "ln -s /lib64 ${debugdir}/"
++# /usr is not needed, all the libs are in /lib64: libm.so.6 libc.so.6 ld-linux-x86-64.so.2
++
++gdb_test "set solib-absolute-prefix $debugdir"
++
++gdb_test_no_output "set debug-file-directory $debugdir" "set debug-file-directory"
++
++gdb_test "core ${gcorefile}" "Core was generated by .*" "re-load generated corefile"
++
++gdb_test "frame" "#0 \[^\r\n\]* lib .*" "library got loaded"
++
++gdb_test "bt"
++gdb_test "info shared"
+diff -Naurp insight-8.1.50.20180216.orig/gdb/testsuite/gdb.base/gcore-buildid-exec-but-not-solib-lib.c insight-8.1.50.20180216.new/gdb/testsuite/gdb.base/gcore-buildid-exec-but-not-solib-lib.c
+--- insight-8.1.50.20180216.orig/gdb/testsuite/gdb.base/gcore-buildid-exec-but-not-solib-lib.c 1970-01-01 01:00:00.000000000 +0100
++++ insight-8.1.50.20180216.new/gdb/testsuite/gdb.base/gcore-buildid-exec-but-not-solib-lib.c 2018-02-17 19:04:46.864844170 +0100
+@@ -0,0 +1,21 @@
++/* Copyright 2010 Free Software Foundation, Inc.
++
++ This file is part of GDB.
++
++ This program is free software; you can redistribute it and/or modify
++ it under the terms of the GNU General Public License as published by
++ the Free Software Foundation; either version 3 of the License, or
++ (at your option) any later version.
++
++ This program is distributed in the hope that it will be useful,
++ but WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++ GNU General Public License for more details.
++
++ You should have received a copy of the GNU General Public License
++ along with this program. If not, see <http://www.gnu.org/licenses/>. */
++
++void
++lib (void)
++{
++}
+diff -Naurp insight-8.1.50.20180216.orig/gdb/testsuite/gdb.base/gcore-buildid-exec-but-not-solib-main.c insight-8.1.50.20180216.new/gdb/testsuite/gdb.base/gcore-buildid-exec-but-not-solib-main.c
+--- insight-8.1.50.20180216.orig/gdb/testsuite/gdb.base/gcore-buildid-exec-but-not-solib-main.c 1970-01-01 01:00:00.000000000 +0100
++++ insight-8.1.50.20180216.new/gdb/testsuite/gdb.base/gcore-buildid-exec-but-not-solib-main.c 2018-02-17 19:04:46.864844170 +0100
+@@ -0,0 +1,25 @@
++/* Copyright 2010 Free Software Foundation, Inc.
++
++ This file is part of GDB.
++
++ This program is free software; you can redistribute it and/or modify
++ it under the terms of the GNU General Public License as published by
++ the Free Software Foundation; either version 3 of the License, or
++ (at your option) any later version.
++
++ This program is distributed in the hope that it will be useful,
++ but WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++ GNU General Public License for more details.
++
++ You should have received a copy of the GNU General Public License
++ along with this program. If not, see <http://www.gnu.org/licenses/>. */
++
++extern void lib (void);
++
++int
++main (void)
++{
++ lib ();
++ return 0;
++}
diff --git a/insight-8.1-buildid-locate.patch b/insight-8.1-buildid-locate.patch
new file mode 100644
index 0000000..0636b84
--- /dev/null
+++ b/insight-8.1-buildid-locate.patch
@@ -0,0 +1,1234 @@
+diff -Naurp insight-8.1.50.20180216.orig/gdb/build-id.c insight-8.1.50.20180216.new/gdb/build-id.c
+--- insight-8.1.50.20180216.orig/gdb/build-id.c 2018-02-09 15:06:40.000000000 +0100
++++ insight-8.1.50.20180216.new/gdb/build-id.c 2018-02-17 03:47:58.535668540 +0100
+@@ -26,11 +26,67 @@
+ #include "objfiles.h"
+ #include "filenames.h"
+ #include "gdbcore.h"
++#include "libbfd.h"
++#include "gdbcore.h"
++#include "gdbcmd.h"
++#include "observer.h"
++#include "elf/external.h"
++#include "elf/internal.h"
++#include "elf/common.h"
++#include "elf-bfd.h"
++#include <sys/stat.h>
++
++#define BUILD_ID_VERBOSE_NONE 0
++#define BUILD_ID_VERBOSE_FILENAMES 1
++#define BUILD_ID_VERBOSE_BINARY_PARSE 2
++static int build_id_verbose = BUILD_ID_VERBOSE_FILENAMES;
++static void
++show_build_id_verbose (struct ui_file *file, int from_tty,
++ struct cmd_list_element *c, const char *value)
++{
++ fprintf_filtered (file, _("Verbosity level of the build-id locator is %s.\n"),
++ value);
++}
++/* Locate NT_GNU_BUILD_ID and return its matching debug filename.
++ FIXME: NOTE decoding should be unified with the BFD core notes decoding. */
++
++static struct bfd_build_id *
++build_id_buf_get (bfd *templ, gdb_byte *buf, bfd_size_type size)
++{
++ bfd_byte *p;
++
++ p = buf;
++ while (p < buf + size)
++ {
++ /* FIXME: bad alignment assumption. */
++ Elf_External_Note *xnp = (Elf_External_Note *) p;
++ size_t namesz = H_GET_32 (templ, xnp->namesz);
++ size_t descsz = H_GET_32 (templ, xnp->descsz);
++ bfd_byte *descdata = (gdb_byte *) xnp->name + BFD_ALIGN (namesz, 4);
++
++ if (H_GET_32 (templ, xnp->type) == NT_GNU_BUILD_ID
++ && namesz == sizeof "GNU"
++ && memcmp (xnp->name, "GNU", sizeof "GNU") == 0)
++ {
++ size_t size = descsz;
++ gdb_byte *data = (gdb_byte *) descdata;
++ struct bfd_build_id *retval;
++
++ retval = (struct bfd_build_id *) xmalloc (sizeof *retval - 1 + size);
++ retval->size = size;
++ memcpy (retval->data, data, size);
++
++ return retval;
++ }
++ p = descdata + BFD_ALIGN (descsz, 4);
++ }
++ return NULL;
++}
+
+ /* See build-id.h. */
+
+ const struct bfd_build_id *
+-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)
+ return NULL;
+ }
+
++/* Core files may have missing (corrupt) SHDR but PDHR is correct there.
++ bfd_elf_bfd_from_remote_memory () has too much overhead by
++ allocating/reading all the available ELF PT_LOADs. */
++
++static struct bfd_build_id *
++build_id_phdr_get (bfd *templ, bfd_vma loadbase, unsigned e_phnum,
++ Elf_Internal_Phdr *i_phdr)
++{
++ int i;
++ struct bfd_build_id *retval = NULL;
++
++ for (i = 0; i < e_phnum; i++)
++ if (i_phdr[i].p_type == PT_NOTE && i_phdr[i].p_filesz > 0)
++ {
++ Elf_Internal_Phdr *hdr = &i_phdr[i];
++ gdb_byte *buf;
++ int err;
++
++ buf = (gdb_byte *) xmalloc (hdr->p_filesz);
++ err = target_read_memory (loadbase + i_phdr[i].p_vaddr, buf,
++ hdr->p_filesz);
++ if (err == 0)
++ retval = build_id_buf_get (templ, buf, hdr->p_filesz);
++ else
++ retval = NULL;
++ xfree (buf);
++ if (retval != NULL)
++ break;
++ }
++ return retval;
++}
++
++/* First we validate the file by reading in the ELF header and checking
++ the magic number. */
++
++static inline bfd_boolean
++elf_file_p (Elf64_External_Ehdr *x_ehdrp64)
++{
++ gdb_assert (sizeof (Elf64_External_Ehdr) >= sizeof (Elf32_External_Ehdr));
++ gdb_assert (offsetof (Elf64_External_Ehdr, e_ident)
++ == offsetof (Elf32_External_Ehdr, e_ident));
++ gdb_assert (sizeof (((Elf64_External_Ehdr *) 0)->e_ident)
++ == sizeof (((Elf32_External_Ehdr *) 0)->e_ident));
++
++ return ((x_ehdrp64->e_ident[EI_MAG0] == ELFMAG0)
++ && (x_ehdrp64->e_ident[EI_MAG1] == ELFMAG1)
++ && (x_ehdrp64->e_ident[EI_MAG2] == ELFMAG2)
++ && (x_ehdrp64->e_ident[EI_MAG3] == ELFMAG3));
++}
++
++/* Translate an ELF file header in external format into an ELF file header in
++ internal format. */
++
++#define H_GET_WORD(bfd, ptr) (is64 ? H_GET_64 (bfd, (ptr)) \
++ : H_GET_32 (bfd, (ptr)))
++#define H_GET_SIGNED_WORD(bfd, ptr) (is64 ? H_GET_S64 (bfd, (ptr)) \
++ : H_GET_S32 (bfd, (ptr)))
++
++static void
++elf_swap_ehdr_in (bfd *abfd,
++ const Elf64_External_Ehdr *src64,
++ Elf_Internal_Ehdr *dst)
++{
++ int is64 = bfd_get_arch_size (abfd) == 64;
++#define SRC(field) (is64 ? src64->field \
++ : ((const Elf32_External_Ehdr *) src64)->field)
++
++ int signed_vma = get_elf_backend_data (abfd)->sign_extend_vma;
++ memcpy (dst->e_ident, SRC (e_ident), EI_NIDENT);
++ dst->e_type = H_GET_16 (abfd, SRC (e_type));
++ dst->e_machine = H_GET_16 (abfd, SRC (e_machine));
++ dst->e_version = H_GET_32 (abfd, SRC (e_version));
++ if (signed_vma)
++ dst->e_entry = H_GET_SIGNED_WORD (abfd, SRC (e_entry));
++ else
++ dst->e_entry = H_GET_WORD (abfd, SRC (e_entry));
++ dst->e_phoff = H_GET_WORD (abfd, SRC (e_phoff));
++ dst->e_shoff = H_GET_WORD (abfd, SRC (e_shoff));
++ dst->e_flags = H_GET_32 (abfd, SRC (e_flags));
++ dst->e_ehsize = H_GET_16 (abfd, SRC (e_ehsize));
++ dst->e_phentsize = H_GET_16 (abfd, SRC (e_phentsize));
++ dst->e_phnum = H_GET_16 (abfd, SRC (e_phnum));
++ dst->e_shentsize = H_GET_16 (abfd, SRC (e_shentsize));
++ dst->e_shnum = H_GET_16 (abfd, SRC (e_shnum));
++ dst->e_shstrndx = H_GET_16 (abfd, SRC (e_shstrndx));
++
++#undef SRC
++}
++
++/* Translate an ELF program header table entry in external format into an
++ ELF program header table entry in internal format. */
++
++static void
++elf_swap_phdr_in (bfd *abfd,
++ const Elf64_External_Phdr *src64,
++ Elf_Internal_Phdr *dst)
++{
++ int is64 = bfd_get_arch_size (abfd) == 64;
++#define SRC(field) (is64 ? src64->field \
++ : ((const Elf32_External_Phdr *) src64)->field)
++
++ int signed_vma = get_elf_backend_data (abfd)->sign_extend_vma;
++
++ dst->p_type = H_GET_32 (abfd, SRC (p_type));
++ dst->p_flags = H_GET_32 (abfd, SRC (p_flags));
++ dst->p_offset = H_GET_WORD (abfd, SRC (p_offset));
++ if (signed_vma)
++ {
++ dst->p_vaddr = H_GET_SIGNED_WORD (abfd, SRC (p_vaddr));
++ dst->p_paddr = H_GET_SIGNED_WORD (abfd, SRC (p_paddr));
++ }
++ else
++ {
++ dst->p_vaddr = H_GET_WORD (abfd, SRC (p_vaddr));
++ dst->p_paddr = H_GET_WORD (abfd, SRC (p_paddr));
++ }
++ dst->p_filesz = H_GET_WORD (abfd, SRC (p_filesz));
++ dst->p_memsz = H_GET_WORD (abfd, SRC (p_memsz));
++ dst->p_align = H_GET_WORD (abfd, SRC (p_align));
++
++#undef SRC
++}
++
++#undef H_GET_SIGNED_WORD
++#undef H_GET_WORD
++
++static Elf_Internal_Phdr *
++elf_get_phdr (bfd *templ, bfd_vma ehdr_vma, unsigned *e_phnum_pointer,
++ bfd_vma *loadbase_pointer)
++{
++ /* sizeof (Elf64_External_Ehdr) >= sizeof (Elf32_External_Ehdr) */
++ Elf64_External_Ehdr x_ehdr64; /* Elf file header, external form */
++ Elf_Internal_Ehdr i_ehdr; /* Elf file header, internal form */
++ bfd_size_type x_phdrs_size;
++ gdb_byte *x_phdrs_ptr;
++ Elf_Internal_Phdr *i_phdrs;
++ int err;
++ unsigned int i;
++ bfd_vma loadbase;
++ int loadbase_set;
++
++ gdb_assert (templ != NULL);
++ gdb_assert (sizeof (Elf64_External_Ehdr) >= sizeof (Elf32_External_Ehdr));
++
++ /* Read in the ELF header in external format. */
++ err = target_read_memory (ehdr_vma, (bfd_byte *) &x_ehdr64, sizeof x_ehdr64);
++ if (err)
++ {
++ if (build_id_verbose >= BUILD_ID_VERBOSE_BINARY_PARSE)
++ warning (_("build-id: Error reading ELF header at address 0x%lx"),
++ (unsigned long) ehdr_vma);
++ return NULL;
++ }
++
++ /* Now check to see if we have a valid ELF file, and one that BFD can
++ make use of. The magic number must match, the address size ('class')
++ and byte-swapping must match our XVEC entry. */
++
++ if (! elf_file_p (&x_ehdr64)
++ || x_ehdr64.e_ident[EI_VERSION] != EV_CURRENT
++ || !((bfd_get_arch_size (templ) == 64
++ && x_ehdr64.e_ident[EI_CLASS] == ELFCLASS64)
++ || (bfd_get_arch_size (templ) == 32
++ && x_ehdr64.e_ident[EI_CLASS] == ELFCLASS32)))
++ {
++ if (build_id_verbose >= BUILD_ID_VERBOSE_BINARY_PARSE)
++ warning (_("build-id: Unrecognized ELF header at address 0x%lx"),
++ (unsigned long) ehdr_vma);
++ return NULL;
++ }
++
++ /* Check that file's byte order matches xvec's */
++ switch (x_ehdr64.e_ident[EI_DATA])
++ {
++ case ELFDATA2MSB: /* Big-endian */
++ if (! bfd_header_big_endian (templ))
++ {
++ if (build_id_verbose >= BUILD_ID_VERBOSE_BINARY_PARSE)
++ warning (_("build-id: Unrecognized "
++ "big-endian ELF header at address 0x%lx"),
++ (unsigned long) ehdr_vma);
++ return NULL;
++ }
++ break;
++ case ELFDATA2LSB: /* Little-endian */
++ if (! bfd_header_little_endian (templ))
++ {
++ if (build_id_verbose >= BUILD_ID_VERBOSE_BINARY_PARSE)
++ warning (_("build-id: Unrecognized "
++ "little-endian ELF header at address 0x%lx"),
++ (unsigned long) ehdr_vma);
++ return NULL;
++ }
++ break;
++ case ELFDATANONE: /* No data encoding specified */
++ default: /* Unknown data encoding specified */
++ if (build_id_verbose >= BUILD_ID_VERBOSE_BINARY_PARSE)
++ warning (_("build-id: Unrecognized "
++ "ELF header endianity at address 0x%lx"),
++ (unsigned long) ehdr_vma);
++ return NULL;
++ }
++
++ elf_swap_ehdr_in (templ, &x_ehdr64, &i_ehdr);
++
++ /* The file header tells where to find the program headers.
++ These are what we use to actually choose what to read. */
++
++ if (i_ehdr.e_phentsize != (bfd_get_arch_size (templ) == 64
++ ? sizeof (Elf64_External_Phdr)
++ : sizeof (Elf32_External_Phdr))
++ || i_ehdr.e_phnum == 0)
++ {
++ if (build_id_verbose >= BUILD_ID_VERBOSE_BINARY_PARSE)
++ warning (_("build-id: Invalid ELF program headers from the ELF header "
++ "at address 0x%lx"), (unsigned long) ehdr_vma);
++ return NULL;
++ }
++
++ x_phdrs_size = (bfd_get_arch_size (templ) == 64 ? sizeof (Elf64_External_Phdr)
++ : sizeof (Elf32_External_Phdr));
++
++ i_phdrs = (Elf_Internal_Phdr *) xmalloc (i_ehdr.e_phnum * (sizeof *i_phdrs + x_phdrs_size));
++ x_phdrs_ptr = (gdb_byte *) &i_phdrs[i_ehdr.e_phnum];
++ err = target_read_memory (ehdr_vma + i_ehdr.e_phoff, (bfd_byte *) x_phdrs_ptr,
++ i_ehdr.e_phnum * x_phdrs_size);
++ if (err)
++ {
++ free (i_phdrs);
++ if (build_id_verbose >= BUILD_ID_VERBOSE_BINARY_PARSE)
++ warning (_("build-id: Error reading "
++ "ELF program headers at address 0x%lx"),
++ (unsigned long) (ehdr_vma + i_ehdr.e_phoff));
++ return NULL;
++ }
++
++ loadbase = ehdr_vma;
++ loadbase_set = 0;
++ for (i = 0; i < i_ehdr.e_phnum; ++i)
++ {
++ elf_swap_phdr_in (templ, (Elf64_External_Phdr *)
++ (x_phdrs_ptr + i * x_phdrs_size), &i_phdrs[i]);
++ /* IA-64 vDSO may have two mappings for one segment, where one mapping
++ is executable only, and one is read only. We must not use the
++ executable one (PF_R is the first one, PF_X the second one). */
++ if (i_phdrs[i].p_type == PT_LOAD && (i_phdrs[i].p_flags & PF_R))
++ {
++ /* Only the first PT_LOAD segment indicates the file bias.
++ Next segments may have P_VADDR arbitrarily higher.
++ If the first segment has P_VADDR zero any next segment must not
++ confuse us, the first one sets LOADBASE certainly enough. */
++ if (!loadbase_set && i_phdrs[i].p_offset == 0)
++ {
++ loadbase = ehdr_vma - i_phdrs[i].p_vaddr;
++ loadbase_set = 1;
++ }
++ }
++ }
++
++ if (build_id_verbose >= BUILD_ID_VERBOSE_BINARY_PARSE)
++ warning (_("build-id: Found ELF header at address 0x%lx, loadbase 0x%lx"),
++ (unsigned long) ehdr_vma, (unsigned long) loadbase);
++
++ *e_phnum_pointer = i_ehdr.e_phnum;
++ *loadbase_pointer = loadbase;
++ return i_phdrs;
++}
++
++/* BUILD_ID_ADDR_GET gets ADDR located somewhere in the object.
++ Find the first section before ADDR containing an ELF header.
++ We rely on the fact the sections from multiple files do not mix.
++ FIXME: We should check ADDR is contained _inside_ the section with possibly
++ missing content (P_FILESZ < P_MEMSZ). These omitted sections are currently
++ hidden by _BFD_ELF_MAKE_SECTION_FROM_PHDR. */
++
++static CORE_ADDR build_id_addr;
++struct build_id_addr_sect
++ {
++ struct build_id_addr_sect *next;
++ asection *sect;
++ };
++static struct build_id_addr_sect *build_id_addr_sect;
++
++static void build_id_addr_candidate (bfd *abfd, asection *sect, void *obj)
++{
++ if (build_id_addr >= bfd_section_vma (abfd, sect))
++ {
++ struct build_id_addr_sect *candidate;
++
++ candidate = (struct build_id_addr_sect *) xmalloc (sizeof *candidate);
++ candidate->next = build_id_addr_sect;
++ build_id_addr_sect = candidate;
++ candidate->sect = sect;
++ }
++}
++
++struct bfd_build_id *
++build_id_addr_get (CORE_ADDR addr)
++{
++ struct build_id_addr_sect *candidate;
++ struct bfd_build_id *retval = NULL;
++ Elf_Internal_Phdr *i_phdr = NULL;
++ bfd_vma loadbase = 0;
++ unsigned e_phnum = 0;
++
++ if (core_bfd == NULL)
++ return NULL;
++
++ build_id_addr = addr;
++ gdb_assert (build_id_addr_sect == NULL);
++ bfd_map_over_sections (core_bfd, build_id_addr_candidate, NULL);
++
++ /* Sections are sorted in the high-to-low VMAs order.
++ Stop the search on the first ELF header we find.
++ Do not continue the search even if it does not contain NT_GNU_BUILD_ID. */
++
++ for (candidate = build_id_addr_sect; candidate != NULL;
++ candidate = candidate->next)
++ {
++ i_phdr = elf_get_phdr (core_bfd,
++ bfd_section_vma (core_bfd, candidate->sect),
++ &e_phnum, &loadbase);
++ if (i_phdr != NULL)
++ break;
++ }
++
++ if (i_phdr != NULL)
++ {
++ retval = build_id_phdr_get (core_bfd, loadbase, e_phnum, i_phdr);
++ xfree (i_phdr);
++ }
++
++ while (build_id_addr_sect != NULL)
++ {
++ candidate = build_id_addr_sect;
++ build_id_addr_sect = candidate->next;
++ xfree (candidate);
++ }
++
++ return retval;
++}
++
+ /* See build-id.h. */
+
+ int
+@@ -50,7 +448,7 @@ build_id_verify (bfd *abfd, size_t check
+ const struct bfd_build_id *found;
+ int retval = 0;
+
+- found = build_id_bfd_get (abfd);
++ found = build_id_bfd_shdr_get (abfd);
+
+ if (found == NULL)
+ warning (_("File \"%s\" has no build-id, file skipped"),
+@@ -65,23 +463,57 @@ build_id_verify (bfd *abfd, size_t check
+ return retval;
+ }
+
++static char *
++link_resolve (const char *symlink, int level)
++{
++ char buf[PATH_MAX + 1], *target, *retval;
++ ssize_t got;
++
++ if (level > 10)
++ return xstrdup (symlink);
++
++ got = readlink (symlink, buf, sizeof (buf));
++ if (got < 0 || got >= sizeof (buf))
++ return xstrdup (symlink);
++ buf[got] = '\0';
++
++ if (IS_ABSOLUTE_PATH (buf))
++ target = xstrdup (buf);
++ else
++ {
++ const std::string dir (ldirname (symlink));
++
++ target = xstrprintf ("%s"
++#ifndef HAVE_DOS_BASED_FILE_SYSTEM
++ "/"
++#else /* HAVE_DOS_BASED_FILE_SYSTEM */
++ "\\"
++#endif /* HAVE_DOS_BASED_FILE_SYSTEM */
++ "%s", dir.c_str(), buf);
++ }
++
++ retval = link_resolve (target, level + 1);
++ xfree (target);
++ return retval;
++}
++
+ /* 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, int add_debug_suffix)
+ {
++ gdb::unique_xmalloc_ptr<char> ulink;
++ std::string link_all;
+ char *link, *debugdir;
+ VEC (char_ptr) *debugdir_vec;
+ struct cleanup *back_to;
+ int ix;
+ gdb_bfd_ref_ptr abfd;
+- int alloc_len;
+
+ /* DEBUG_FILE_DIRECTORY/.build-id/ab/cdef */
+- alloc_len = (strlen (debug_file_directory)
+- + (sizeof "/.build-id/" - 1) + 1
+- + 2 * build_id_len + (sizeof ".debug" - 1) + 1);
+- link = (char *) alloca (alloc_len);
++ link = ((char *) xmalloc (strlen (debug_file_directory) + 2 * build_id_len + 50));
++ ulink.reset (link);
+
+ /* Keep backward compatibility so that DEBUG_FILE_DIRECTORY being "" will
+ cause "/.build-id/..." lookups. */
+@@ -94,7 +526,11 @@ build_id_to_debug_bfd (size_t build_id_l
+ size_t debugdir_len = strlen (debugdir);
+ const gdb_byte *data = build_id;
+ size_t size = build_id_len;
++ unsigned int seqno;
++ struct stat statbuf_trash;
+ char *s;
++ gdb::unique_xmalloc_ptr<char> link0;
++ gdb::unique_xmalloc_ptr<char> link0_resolved;
+
+ memcpy (link, debugdir, debugdir_len);
+ s = &link[debugdir_len];
+@@ -108,51 +544,270 @@ build_id_to_debug_bfd (size_t build_id_l
+ *s++ = '/';
+ while (size-- > 0)
+ s += sprintf (s, "%02x", (unsigned) *data++);
+- strcpy (s, ".debug");
+
+ if (separate_debug_file_debug)
+ printf_unfiltered (_(" Trying %s\n"), link);
+
+- /* lrealpath() is expensive even for the usually non-existent files. */
+- gdb::unique_xmalloc_ptr<char> filename;
+- if (access (link, F_OK) == 0)
+- filename.reset (lrealpath (link));
++ for (seqno = 0;; seqno++)
++ {
++ gdb::unique_xmalloc_ptr<char> filename;
++ char *s2;
+
+- if (filename == NULL)
+- continue;
++ if (seqno)
++ {
++ /* There can be multiple build-id symlinks pointing to real files
++ with the same build-id (such as hard links). Some of the real
++ files may not be installed. */
++
++ s2 = s + sprintf (s, ".%u", seqno);
++ }
++ else
++ s2 = s;
++
++ if (add_debug_suffix)
++ strcpy (s2, ".debug");
++ else
++ *s2 = 0;
++
++ if (!seqno)
++ {
++ /* If none of the real files is found report as missing file
++ always the non-.%u-suffixed file. */
++ link0.reset (xstrdup (link));
++ }
++
++ /* `access' automatically dereferences LINK. */
++ if (lstat (link, &statbuf_trash) != 0)
++ {
++ /* Stop increasing SEQNO. */
++ break;
++ }
++
++ /* lrealpath() is expensive even for the non-existent files. */
++ filename.reset (lrealpath (link));
++ if (filename == NULL)
++ continue;
++
++ abfd = gdb_bfd_open (filename.get (), gnutarget, -1);
+
+- /* We expect to be silent on the non-existing files. */
+- abfd = gdb_bfd_open (filename.get (), gnutarget, -1);
++ if (abfd == NULL)
++ continue;
+
+- if (abfd == NULL)
+- continue;
++ if (build_id_verify (abfd.get (), build_id_len, build_id))
++ break;
+
+- if (build_id_verify (abfd.get(), build_id_len, build_id))
+- break;
++ abfd.release ();
++ }
+
+- abfd.release ();
++ /* If the symlink has target request to install the target.
++ BASE-debuginfo.rpm contains the symlink but BASE.rpm may be missing.
++ https://bugzilla.redhat.com/show_bug.cgi?id=981154 */
++ link0_resolved.reset (link_resolve (link0.get (), 0));
++
++ /* Use whitespace instead of DIRNAME_SEPARATOR to be compatible with
++ its possible use as an argument for installation command. */
++ if (link_all.length () != 0)
++ link_all += ' ';
++ link_all += link0_resolved.get ();
++ }
++
++ if (link_return != NULL)
++ {
++ if (abfd != NULL)
++ *link_return = ulink.release ();
++ else
++ *link_return = xstrdup (link_all.c_str ());
+ }
+
+ do_cleanups (back_to);
+ return abfd;
+ }
+
++char *
++build_id_to_filename (const struct bfd_build_id *build_id, char **link_return)
++{
++ gdb_bfd_ref_ptr abfd;
++ char *result;
++
++ abfd = build_id_to_debug_bfd (build_id->size, build_id->data, link_return, 0);
++ if (abfd == NULL)
++ return NULL;
++
++ result = xstrdup (bfd_get_filename (abfd));
++ abfd.release ();
++ return result;
++}
++
++/* This MISSING_FILEPAIR_HASH tracker is used only for the duplicite messages
++ Try to install the hash file ...
++ avoidance. */
++
++struct missing_filepair
++ {
++ char *binary;
++ char *debug;
++ char data[1];
++ };
++
++static struct htab *missing_filepair_hash;
++static struct obstack missing_filepair_obstack;
++
++static void *
++missing_filepair_xcalloc (size_t nmemb, size_t nmemb_size)
++{
++ void *retval;
++ size_t size = nmemb * nmemb_size;
++
++ retval = obstack_alloc (&missing_filepair_obstack, size);
++ memset (retval, 0, size);
++ return retval;
++}
++
++static hashval_t
++missing_filepair_hash_func (const struct missing_filepair *elem)
++{
++ hashval_t retval = 0;
++
++ retval ^= htab_hash_string (elem->binary);
++ if (elem->debug != NULL)
++ retval ^= htab_hash_string (elem->debug);
++
++ return retval;
++}
++
++static int
++missing_filepair_eq (const struct missing_filepair *elem1,
++ const struct missing_filepair *elem2)
++{
++ return strcmp (elem1->binary, elem2->binary) == 0
++ && ((elem1->debug == NULL) == (elem2->debug == NULL))
++ && (elem1->debug == NULL || strcmp (elem1->debug, elem2->debug) == 0);
++}
++
++static void
++missing_filepair_change (void)
++{
++ if (missing_filepair_hash != NULL)
++ {
++ obstack_free (&missing_filepair_obstack, NULL);
++ /* All their memory came just from missing_filepair_OBSTACK. */
++ missing_filepair_hash = NULL;
++ }
++}
++
++static void
++debug_print_executable_changed (void)
++{
++ missing_filepair_change ();
++}
++
++/* Notify user the file BINARY with (possibly NULL) associated separate debug
++ information file DEBUG is missing. DEBUG may or may not be the build-id
++ file such as would be:
++ /usr/lib/debug/.build-id/dd/b1d2ce632721c47bb9e8679f369e2295ce71be.debug
++ */
++
++void
++debug_print_missing (const char *binary, const char *debug)
++{
++ size_t binary_len0 = strlen (binary) + 1;
++ size_t debug_len0 = debug ? strlen (debug) + 1 : 0;
++ struct missing_filepair missing_filepair_find;
++ struct missing_filepair *missing_filepair;
++ struct missing_filepair **slot;
++
++ if (build_id_verbose < BUILD_ID_VERBOSE_FILENAMES)
++ return;
++
++ if (missing_filepair_hash == NULL)
++ {
++ obstack_init (&missing_filepair_obstack);
++ missing_filepair_hash = htab_create_alloc (64,
++ (hashval_t (*) (const void *)) missing_filepair_hash_func,
++ (int (*) (const void *, const void *)) missing_filepair_eq, NULL,
++ missing_filepair_xcalloc, NULL);
++ }
++
++ /* Use MISSING_FILEPAIR_FIND first instead of calling obstack_alloc with
++ obstack_free in the case of a (rare) match. The problem is ALLOC_F for
++ MISSING_FILEPAIR_HASH allocates from MISSING_FILEPAIR_OBSTACK maintenance
++ structures for MISSING_FILEPAIR_HASH. Calling obstack_free would possibly
++ not to free only MISSING_FILEPAIR but also some such structures (allocated
++ during the htab_find_slot call). */
++
++ missing_filepair_find.binary = (char *) binary;
++ missing_filepair_find.debug = (char *) debug;
++ slot = (struct missing_filepair **) htab_find_slot (missing_filepair_hash,
++ &missing_filepair_find,
++ INSERT);
++
++ /* While it may be still printed duplicitely with the missing debuginfo file
++ * it is due to once printing about the binary file build-id link and once
++ * about the .debug file build-id link as both the build-id symlinks are
++ * located in the debuginfo package. */
++
++ if (*slot != NULL)
++ return;
++
++ missing_filepair = (struct missing_filepair *) obstack_alloc (&missing_filepair_obstack,
++ sizeof (*missing_filepair) - 1
++ + binary_len0 + debug_len0);
++ missing_filepair->binary = missing_filepair->data;
++ memcpy (missing_filepair->binary, binary, binary_len0);
++ if (debug != NULL)
++ {
++ missing_filepair->debug = missing_filepair->binary + binary_len0;
++ memcpy (missing_filepair->debug, debug, debug_len0);
++ }
++ else
++ missing_filepair->debug = NULL;
++
++ *slot = missing_filepair;
++
++ /* We do not collect and flush these messages as each such message
++ already requires its own separate lines. */
++
++ 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);
++}
++
++
+ /* See build-id.h. */
+
+ char *
+-find_separate_debug_file_by_buildid (struct objfile *objfile)
++find_separate_debug_file_by_buildid (struct objfile *objfile,
++ gdb::unique_xmalloc_ptr<char> *build_id_filename_return)
+ {
+ const struct bfd_build_id *build_id;
+
+- build_id = build_id_bfd_get (objfile->obfd);
++ if (build_id_filename_return)
++ *build_id_filename_return = NULL;
++
++ build_id = build_id_bfd_shdr_get (objfile->obfd);
+ if (build_id != NULL)
+ {
+ if (separate_debug_file_debug)
+ printf_unfiltered (_("\nLooking for separate debug info (build-id) for "
+ "%s\n"), objfile_name (objfile));
+
++ char *build_id_filename_cstr = NULL;
+ 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));
++ if (build_id_filename_return)
++ {
++ if (!build_id_filename_cstr)
++ gdb_assert (!*build_id_filename_return);
++ else
++ {
++ *build_id_filename_return = gdb::unique_xmalloc_ptr<char> (build_id_filename_cstr);
++ build_id_filename_cstr = NULL;
++ }
++ }
++
+ /* Prevent looping on a stripped .debug file. */
+ if (abfd != NULL
+ && filename_cmp (bfd_get_filename (abfd.get ()),
+@@ -164,3 +819,21 @@ find_separate_debug_file_by_buildid (str
+ }
+ return NULL;
+ }
++
++extern void _initialize_build_id (void);
++
++void
++_initialize_build_id (void)
++{
++ add_setshow_zinteger_cmd ("build-id-verbose", no_class, &build_id_verbose,
++ _("\
++Set debugging level of the build-id locator."), _("\
++Show debugging level of the build-id locator."), _("\
++Level 1 (default) enables printing the missing debug filenames,\n\
++level 2 also prints the parsing of binaries to find the identificators."),
++ NULL,
++ show_build_id_verbose,
++ &setlist, &showlist);
++
++ observer_attach_executable_changed (debug_print_executable_changed);
++}
+diff -Naurp insight-8.1.50.20180216.orig/gdb/build-id.h insight-8.1.50.20180216.new/gdb/build-id.h
+--- insight-8.1.50.20180216.orig/gdb/build-id.h 2018-01-04 17:43:15.000000000 +0100
++++ insight-8.1.50.20180216.new/gdb/build-id.h 2018-02-16 18:22:10.082959421 +0100
+@@ -22,9 +22,10 @@
+
+ #include "gdb_bfd.h"
+
+-/* Locate NT_GNU_BUILD_ID from ABFD and return its content. */
++/* Separate debuginfo files have corrupted PHDR but SHDR is correct there.
++ Locate NT_GNU_BUILD_ID from ABFD and return its content. */
+
+-extern const struct bfd_build_id *build_id_bfd_get (bfd *abfd);
++extern const struct bfd_build_id *build_id_bfd_shdr_get (bfd *abfd);
+
+ /* Return true if ABFD has NT_GNU_BUILD_ID matching the CHECK value.
+ Otherwise, issue a warning and return false. */
+@@ -38,13 +39,19 @@ extern int build_id_verify (bfd *abfd,
+ the caller. */
+
+ 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);
++
++extern char *build_id_to_filename (const struct bfd_build_id *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 a malloc'd
+ file name for the separate debug file. The caller must free this.
+ Otherwise, returns NULL. */
+
+-extern char *find_separate_debug_file_by_buildid (struct objfile *objfile);
++extern char *find_separate_debug_file_by_buildid (struct objfile *objfile,
++ gdb::unique_xmalloc_ptr<char> *build_id_filename_return);
+
+ #endif /* BUILD_ID_H */
+diff -Naurp insight-8.1.50.20180216.orig/gdb/coffread.c insight-8.1.50.20180216.new/gdb/coffread.c
+--- insight-8.1.50.20180216.orig/gdb/coffread.c 2018-01-04 17:43:15.000000000 +0100
++++ insight-8.1.50.20180216.new/gdb/coffread.c 2018-02-16 18:22:10.082959421 +0100
+@@ -735,7 +735,7 @@ coff_symfile_read (struct objfile *objfi
+ {
+ char *debugfile;
+
+- debugfile = find_separate_debug_file_by_buildid (objfile);
++ debugfile = find_separate_debug_file_by_buildid (objfile, NULL);
+
+ if (debugfile == NULL)
+ debugfile = find_separate_debug_file_by_debuglink (objfile);
+diff -Naurp insight-8.1.50.20180216.orig/gdb/corelow.c insight-8.1.50.20180216.new/gdb/corelow.c
+--- insight-8.1.50.20180216.orig/gdb/corelow.c 2018-01-26 13:46:47.000000000 +0100
++++ insight-8.1.50.20180216.new/gdb/corelow.c 2018-02-16 18:22:10.082959421 +0100
+@@ -45,6 +45,10 @@
+ #include "gdb_bfd.h"
+ #include "completer.h"
+ #include "filestuff.h"
++#include "auxv.h"
++#include "elf/common.h"
++#include "gdbcmd.h"
++#include "build-id.h"
+
+ #ifndef O_LARGEFILE
+ #define O_LARGEFILE 0
+@@ -264,6 +268,54 @@ add_to_thread_list (bfd *abfd, asection
+ 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, *debug_filename;
++ char *build_id_filename;
++ struct cleanup *back_to;
++
++ if (exec_bfd != NULL || symfile_objfile != NULL)
++ return;
++
++ if (target_auxv_search (¤t_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. */
++}
++
+ /* This routine opens and sets up the core file bfd. */
+
+ static void
+@@ -391,6 +443,14 @@ core_open (const char *arg, int from_tty
+ switch_to_thread (thread->ptid);
+ }
+
++ /* 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 (&core_ops, from_tty);
+
+ /* Now go through the target stack looking for threads since there
+@@ -1038,4 +1098,11 @@ _initialize_corelow (void)
+ init_core_ops ();
+
+ add_target_with_completer (&core_ops, filename_completer);
++
++ add_setshow_boolean_cmd ("build-id-core-loads", class_files,
++ &build_id_core_loads, _("\
++Set whether CORE-FILE loads the build-id associated files automatically."), _("\
++Show whether CORE-FILE loads the build-id associated files automatically."),
++ NULL, NULL, NULL,
++ &setlist, &showlist);
+ }
+diff -Naurp insight-8.1.50.20180216.orig/gdb/doc/gdb.texinfo insight-8.1.50.20180216.new/gdb/doc/gdb.texinfo
+--- insight-8.1.50.20180216.orig/gdb/doc/gdb.texinfo 2018-02-16 18:21:13.557408356 +0100
++++ insight-8.1.50.20180216.new/gdb/doc/gdb.texinfo 2018-02-16 18:22:10.090959499 +0100
+@@ -19447,6 +19447,27 @@ information files.
+
+ @end table
+
++You can also adjust the current verbosity of the @dfn{build id} locating.
++
++@table @code
++
++@kindex set build-id-verbose
++@item set build-id-verbose 0
++No additional messages are printed.
++
++@item set build-id-verbose 1
++Missing separate debug filenames are printed.
++
++@item set build-id-verbose 2
++Missing separate debug filenames are printed and also all the parsing of the
++binaries to find their @dfn{build id} content is printed.
++
++@kindex show build-id-verbose
++@item show build-id-verbose
++Show the current verbosity value for the @dfn{build id} content locating.
++
++@end table
++
+ @cindex @code{.gnu_debuglink} sections
+ @cindex debug link sections
+ A debug link is a special section of the executable file named
+diff -Naurp insight-8.1.50.20180216.orig/gdb/dwarf2read.c insight-8.1.50.20180216.new/gdb/dwarf2read.c
+--- insight-8.1.50.20180216.orig/gdb/dwarf2read.c 2018-02-16 18:21:13.577408551 +0100
++++ insight-8.1.50.20180216.new/gdb/dwarf2read.c 2018-02-16 18:22:10.095959548 +0100
+@@ -3000,7 +3000,7 @@ dwarf2_get_dwz_file (struct dwarf2_per_o
+ }
+
+ 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);
+
+ if (dwz_bfd == NULL)
+ error (_("could not find '.gnu_debugaltlink' file for %s"),
+diff -Naurp insight-8.1.50.20180216.orig/gdb/elfread.c insight-8.1.50.20180216.new/gdb/elfread.c
+--- insight-8.1.50.20180216.orig/gdb/elfread.c 2018-01-04 17:43:15.000000000 +0100
++++ insight-8.1.50.20180216.new/gdb/elfread.c 2018-02-16 18:22:10.095959548 +0100
+@@ -1259,8 +1259,9 @@ elf_symfile_read (struct objfile *objfil
+ && objfile->separate_debug_objfile == NULL
+ && objfile->separate_debug_objfile_backlink == NULL)
+ {
++ gdb::unique_xmalloc_ptr<char> build_id_filename;
+ gdb::unique_xmalloc_ptr<char> debugfile
+- (find_separate_debug_file_by_buildid (objfile));
++ (find_separate_debug_file_by_buildid (objfile, &build_id_filename));
+
+ if (debugfile == NULL)
+ debugfile.reset (find_separate_debug_file_by_debuglink (objfile));
+@@ -1272,6 +1273,10 @@ elf_symfile_read (struct objfile *objfil
+ symbol_file_add_separate (abfd.get (), debugfile.get (),
+ symfile_flags, objfile);
+ }
++ /* 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 ());
+ }
+ }
+
+diff -Naurp insight-8.1.50.20180216.orig/gdb/objfiles.h insight-8.1.50.20180216.new/gdb/objfiles.h
+--- insight-8.1.50.20180216.orig/gdb/objfiles.h 2018-01-04 17:43:15.000000000 +0100
++++ insight-8.1.50.20180216.new/gdb/objfiles.h 2018-02-16 18:22:10.095959548 +0100
+@@ -470,6 +470,10 @@ struct objfile
+ htab_t static_links {};
+ };
+
++/* This file was loaded according to the BUILD_ID_CORE_LOADS rules. */
++
++#define OBJF_BUILD_ID_CORE_LOADED static_cast<enum objfile_flag>(1 << 12)
++
+ /* Declarations for functions defined in objfiles.c */
+
+ extern struct gdbarch *get_objfile_arch (const struct objfile *);
+diff -Naurp insight-8.1.50.20180216.orig/gdb/python/py-objfile.c insight-8.1.50.20180216.new/gdb/python/py-objfile.c
+--- insight-8.1.50.20180216.orig/gdb/python/py-objfile.c 2018-01-04 17:43:15.000000000 +0100
++++ insight-8.1.50.20180216.new/gdb/python/py-objfile.c 2018-02-16 18:22:10.096959557 +0100
+@@ -137,7 +137,7 @@ objfpy_get_build_id (PyObject *self, voi
+
+ TRY
+ {
+- build_id = build_id_bfd_get (objfile->obfd);
++ build_id = build_id_bfd_shdr_get (objfile->obfd);
+ }
+ CATCH (except, RETURN_MASK_ALL)
+ {
+@@ -544,7 +544,7 @@ objfpy_lookup_objfile_by_build_id (const
+ /* Don't return separate debug files. */
+ if (objfile->separate_debug_objfile_backlink != NULL)
+ continue;
+- obfd_build_id = build_id_bfd_get (objfile->obfd);
++ obfd_build_id = build_id_bfd_shdr_get (objfile->obfd);
+ if (obfd_build_id == NULL)
+ continue;
+ if (objfpy_build_id_matches (obfd_build_id, build_id))
+diff -Naurp insight-8.1.50.20180216.orig/gdb/solib-svr4.c insight-8.1.50.20180216.new/gdb/solib-svr4.c
+--- insight-8.1.50.20180216.orig/gdb/solib-svr4.c 2018-01-12 03:18:43.000000000 +0100
++++ insight-8.1.50.20180216.new/gdb/solib-svr4.c 2018-02-17 03:30:39.527371372 +0100
+@@ -45,6 +45,7 @@
+ #include "auxv.h"
+ #include "gdb_bfd.h"
+ #include "probe.h"
++#include "build-id.h"
+
+ static struct link_map_offsets *svr4_fetch_link_map_offsets (void);
+ static int svr4_have_link_map_offsets (void);
+@@ -1387,9 +1388,52 @@ svr4_read_so_list (CORE_ADDR lm, CORE_AD
+ continue;
+ }
+
+- strncpy (newobj->so_name, buffer, SO_NAME_MAX_PATH_SIZE - 1);
+- newobj->so_name[SO_NAME_MAX_PATH_SIZE - 1] = '\0';
+- strcpy (newobj->so_original_name, newobj->so_name);
++ {
++ struct bfd_build_id *build_id;
++
++ strncpy (newobj->so_original_name, buffer, SO_NAME_MAX_PATH_SIZE - 1);
++ newobj->so_original_name[SO_NAME_MAX_PATH_SIZE - 1] = '\0';
++ /* May get overwritten below. */
++ strcpy (newobj->so_name, newobj->so_original_name);
++
++ build_id = build_id_addr_get (li->l_ld);
++ if (build_id != NULL)
++ {
++ char *name, *build_id_filename;
++
++ /* Missing the build-id matching separate debug info file
++ would be handled while SO_NAME gets loaded. */
++ name = build_id_to_filename (build_id, &build_id_filename);
++ if (name != NULL)
++ {
++ strncpy (newobj->so_name, name, SO_NAME_MAX_PATH_SIZE - 1);
++ newobj->so_name[SO_NAME_MAX_PATH_SIZE - 1] = '\0';
++ xfree (name);
++ }
++ else
++ {
++ debug_print_missing (newobj->so_name, build_id_filename);
++
++ /* In the case the main executable was found according to
++ its build-id (from a core file) prevent loading
++ a different build of a library with accidentally the
++ same SO_NAME.
++
++ It suppresses bogus backtraces (and prints "??" there
++ instead) if the on-disk files no longer match the
++ running program version. */
++
++ if (symfile_objfile != NULL
++ && (symfile_objfile->flags
++ & OBJF_BUILD_ID_CORE_LOADED) != 0)
++ newobj->so_name[0] = 0;
++ }
++
++ xfree (build_id_filename);
++ xfree (build_id);
++ }
++ }
++
+ xfree (buffer);
+
+ /* If this entry has no name, or its name matches the name
+diff -Naurp insight-8.1.50.20180216.orig/gdb/symfile.h insight-8.1.50.20180216.new/gdb/symfile.h
+--- insight-8.1.50.20180216.orig/gdb/symfile.h 2018-01-04 17:43:15.000000000 +0100
++++ insight-8.1.50.20180216.new/gdb/symfile.h 2018-02-16 18:22:10.097959567 +0100
+@@ -543,6 +543,10 @@ void expand_symtabs_matching
+ void map_symbol_filenames (symbol_filename_ftype *fun, void *data,
+ int need_fullname);
+
++/* 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);
++
+ /* From dwarf2read.c */
+
+ /* Names for a dwarf2 debugging section. The field NORMAL is the normal
+diff -Naurp insight-8.1.50.20180216.orig/gdb/testsuite/gdb.base/corefile.exp insight-8.1.50.20180216.new/gdb/testsuite/gdb.base/corefile.exp
+--- insight-8.1.50.20180216.orig/gdb/testsuite/gdb.base/corefile.exp 2018-01-04 17:43:15.000000000 +0100
++++ insight-8.1.50.20180216.new/gdb/testsuite/gdb.base/corefile.exp 2018-02-16 18:22:10.097959567 +0100
+@@ -311,3 +311,33 @@ gdb_test_multiple "core-file $corefile"
+ pass $test
+ }
+ }
++
++
++# Test auto-loading of binary files through build-id from the core file.
++set buildid [build_id_debug_filename_get $binfile]
++set wholetest "binfile found by build-id"
++if {$buildid == ""} {
++ untested "$wholetest (binary has no build-id)"
++} else {
++ gdb_exit
++ gdb_start
++
++ regsub {\.debug$} $buildid {} buildid
++ set debugdir [standard_output_file ${testfile}-debugdir]
++ file delete -force -- $debugdir
++ file mkdir $debugdir/[file dirname $buildid]
++ file copy $binfile $debugdir/$buildid
++
++ set test "show debug-file-directory"
++ gdb_test_multiple $test $test {
++ -re "The directory where separate debug symbols are searched for is \"(.*)\"\\.\r\n$gdb_prompt $" {
++ set debugdir_orig $expect_out(1,string)
++ pass $test
++ }
++ }
++ gdb_test_no_output "set debug-file-directory $debugdir:$debugdir_orig" "set debug-file-directory"
++ gdb_test "show build-id-core-loads" {Whether CORE-FILE loads the build-id associated files automatically is on\.}
++ gdb_test "core-file $corefile" "\r\nProgram terminated with .*" "core-file without executable"
++ gdb_test "info files" "Local exec file:\r\n\[ \t\]*`[string_to_regexp $debugdir/$buildid]', file type .*"
++ pass $wholetest
++}
+diff -Naurp insight-8.1.50.20180216.orig/gdb/testsuite/gdb.base/new-ui-pending-input.exp insight-8.1.50.20180216.new/gdb/testsuite/gdb.base/new-ui-pending-input.exp
+--- insight-8.1.50.20180216.orig/gdb/testsuite/gdb.base/new-ui-pending-input.exp 2018-01-04 17:43:15.000000000 +0100
++++ insight-8.1.50.20180216.new/gdb/testsuite/gdb.base/new-ui-pending-input.exp 2018-02-16 18:22:10.097959567 +0100
+@@ -62,6 +62,7 @@ proc test_command_line_new_ui_pending_in
+ set options ""
+ append options " -iex \"set height 0\""
+ append options " -iex \"set width 0\""
++ append options " -iex \"set build-id-verbose 0\""
+ append options " -iex \"new-ui console $extra_tty_name\""
+ append options " -ex \"b $bpline\""
+ append options " -ex \"run\""
+diff -Naurp insight-8.1.50.20180216.orig/gdb/testsuite/lib/gdb.exp insight-8.1.50.20180216.new/gdb/testsuite/lib/gdb.exp
+--- insight-8.1.50.20180216.orig/gdb/testsuite/lib/gdb.exp 2018-02-09 15:06:40.000000000 +0100
++++ insight-8.1.50.20180216.new/gdb/testsuite/lib/gdb.exp 2018-02-16 18:22:10.098959577 +0100
+@@ -1694,6 +1694,16 @@ proc default_gdb_start { } {
+ warning "Couldn't set the width to 0."
+ }
+ }
++ # Turn off the missing warnings as the testsuite does not expect it.
++ send_gdb "set build-id-verbose 0\n"
++ gdb_expect 10 {
++ -re "$gdb_prompt $" {
++ verbose "Disabled the missing debug infos warnings." 2
++ }
++ timeout {
++ warning "Could not disable the missing debug infos warnings.."
++ }
++ }
+ return 0
+ }
+
+diff -Naurp insight-8.1.50.20180216.orig/gdb/testsuite/lib/mi-support.exp insight-8.1.50.20180216.new/gdb/testsuite/lib/mi-support.exp
+--- insight-8.1.50.20180216.orig/gdb/testsuite/lib/mi-support.exp 2018-01-04 17:43:15.000000000 +0100
++++ insight-8.1.50.20180216.new/gdb/testsuite/lib/mi-support.exp 2018-02-16 18:22:10.098959577 +0100
+@@ -309,6 +309,16 @@ proc default_mi_gdb_start { args } {
+ warning "Couldn't set the width to 0."
+ }
+ }
++ # Turn off the missing warnings as the testsuite does not expect it.
++ send_gdb "190-gdb-set build-id-verbose 0\n"
++ gdb_expect 10 {
++ -re ".*190-gdb-set build-id-verbose 0\r\n190\\\^done\r\n$mi_gdb_prompt$" {
++ verbose "Disabled the missing debug infos warnings." 2
++ }
++ timeout {
++ warning "Could not disable the missing debug infos warnings.."
++ }
++ }
+
+ if { $separate_inferior_pty } {
+ mi_create_inferior_pty
diff --git a/insight-8.1-gdb-6.6-buildid-locate-core-as-arg.patch b/insight-8.1-gdb-6.6-buildid-locate-core-as-arg.patch
new file mode 100644
index 0000000..b8d0bf5
--- /dev/null
+++ b/insight-8.1-gdb-6.6-buildid-locate-core-as-arg.patch
@@ -0,0 +1,134 @@
+diff -Naurp insight-8.1.50.20180216.orig/gdb/common/common-exceptions.h insight-8.1.50.20180216.new/gdb/common/common-exceptions.h
+--- insight-8.1.50.20180216.orig/gdb/common/common-exceptions.h 2018-01-04 17:43:15.000000000 +0100
++++ insight-8.1.50.20180216.new/gdb/common/common-exceptions.h 2018-02-17 19:58:58.465929548 +0100
+@@ -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 -Naurp insight-8.1.50.20180216.orig/gdb/exec.c insight-8.1.50.20180216.new/gdb/exec.c
+--- insight-8.1.50.20180216.orig/gdb/exec.c 2018-02-16 15:19:06.000000000 +0100
++++ insight-8.1.50.20180216.new/gdb/exec.c 2018-02-17 20:00:04.064572871 +0100
+@@ -36,6 +36,7 @@
+ #include "gdb_bfd.h"
+ #include "gcore.h"
+ #include "source.h"
++#include "exceptions.h"
+
+ #include <fcntl.h>
+ #include "readline/readline.h"
+@@ -342,12 +343,27 @@ exec_file_attach (const char *filename,
+
+ if (!bfd_check_format_matches (exec_bfd, bfd_object, &matching))
+ {
++ int is_core;
++
++ /* If the user accidentally did "gdb core", print a useful
++ error message. Check it only after bfd_object has been checked as
++ a valid executable may get recognized for example also as
++ "trad-core". */
++ is_core = bfd_check_format (exec_bfd, bfd_core);
++
+ /* Make sure to close exec_bfd, or else "run" might try to use
+ it. */
+ exec_close ();
+- error (_("\"%s\": not in executable format: %s"),
+- scratch_pathname,
+- gdb_bfd_errmsg (bfd_get_error (), matching));
++
++ if (is_core != 0)
++ throw_error (IS_CORE_ERROR,
++ _("\"%s\" is a core file.\n"
++ "Please specify an executable to debug."),
++ scratch_pathname);
++ else
++ error (_("\"%s\": not in executable format: %s"),
++ scratch_pathname,
++ gdb_bfd_errmsg (bfd_get_error (), matching));
+ }
+
+ if (build_section_table (exec_bfd, §ions, §ions_end))
+diff -Naurp insight-8.1.50.20180216.orig/gdb/main.c insight-8.1.50.20180216.new/gdb/main.c
+--- insight-8.1.50.20180216.orig/gdb/main.c 2018-01-12 03:18:43.000000000 +0100
++++ insight-8.1.50.20180216.new/gdb/main.c 2018-02-17 19:58:58.466929557 +0100
+@@ -446,6 +446,37 @@ struct cmdarg
+ char *string;
+ };
+
++/* Call exec_file_attach. If it detected FILENAME is a core file call
++ core_file_command. Print the original exec_file_attach error only if
++ core_file_command failed to find a matching executable. */
++
++static void
++exec_or_core_file_attach (const char *filename, int from_tty)
++{
++ volatile struct gdb_exception e;
++
++ gdb_assert (exec_bfd == NULL);
++
++ TRY
++ {
++ exec_file_attach (filename, from_tty);
++ }
++ CATCH (e, RETURN_MASK_ALL)
++ {
++ if (e.error == IS_CORE_ERROR)
++ {
++ core_file_command ((char *) filename, from_tty);
++
++ /* Iff the core file found its executable suppress the error message
++ from exec_file_attach. */
++ if (exec_bfd != NULL)
++ return;
++ }
++ throw_exception (e);
++ }
++ END_CATCH
++}
++
+ static void
+ captured_main_1 (struct captured_main_args *context)
+ {
+@@ -882,6 +913,8 @@ captured_main_1 (struct captured_main_ar
+ {
+ symarg = argv[optind];
+ execarg = argv[optind];
++ if (optind + 1 == argc && corearg == NULL)
++ corearg = argv[optind];
+ optind++;
+ }
+
+@@ -1032,11 +1065,25 @@ captured_main_1 (struct captured_main_ar
+ && symarg != NULL
+ && strcmp (execarg, symarg) == 0)
+ {
++ catch_command_errors_const_ftype *func;
++
++ /* Call exec_or_core_file_attach only if the file was specified as
++ a command line argument (and not an a command line option). */
++ if (corearg != NULL && strcmp (corearg, execarg) == 0)
++ {
++ func = exec_or_core_file_attach;
++ corearg = NULL;
++ }
++ else
++ func = exec_file_attach;
++
+ /* The exec file and the symbol-file are the same. If we can't
+ open it, better only print one error message.
+- catch_command_errors returns non-zero on success! */
+- if (catch_command_errors (exec_file_attach, execarg,
+- !batch_flag))
++ catch_command_errors returns non-zero on success!
++ Do not load EXECARG as a symbol file if it has been already processed
++ as a core file. */
++ if (catch_command_errors (func, execarg, !batch_flag)
++ && core_bfd == NULL)
+ catch_command_errors (symbol_file_add_main_adapter, symarg,
+ !batch_flag);
+ }
diff --git a/insight-8.1-gdb-6.6-buildid-locate-rpm.patch b/insight-8.1-gdb-6.6-buildid-locate-rpm.patch
new file mode 100644
index 0000000..0d78ed7
--- /dev/null
+++ b/insight-8.1-gdb-6.6-buildid-locate-rpm.patch
@@ -0,0 +1,1505 @@
+diff -Naurp insight-8.1.50.20180216.orig/gdb/aclocal.m4 insight-8.1.50.20180216.new/gdb/aclocal.m4
+--- insight-8.1.50.20180216.orig/gdb/aclocal.m4 2018-02-16 15:40:17.000000000 +0100
++++ insight-8.1.50.20180216.new/gdb/aclocal.m4 2018-02-17 19:20:52.946384325 +0100
+@@ -12,6 +12,221 @@
+ # PARTICULAR PURPOSE.
+
+ m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])])
++# pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*-
++# serial 1 (pkg-config-0.24)
++#
++# Copyright © 2004 Scott James Remnant <scott(a)netsplit.com>.
++#
++# This program is free software; you can redistribute it and/or modify
++# it under the terms of the GNU General Public License as published by
++# the Free Software Foundation; either version 2 of the License, or
++# (at your option) any later version.
++#
++# This program is distributed in the hope that it will be useful, but
++# WITHOUT ANY WARRANTY; without even the implied warranty of
++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++# General Public License for more details.
++#
++# You should have received a copy of the GNU General Public License
++# along with this program; if not, write to the Free Software
++# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
++#
++# As a special exception to the GNU General Public License, if you
++# distribute this file as part of a program that contains a
++# configuration script generated by Autoconf, you may include it under
++# the same distribution terms that you use for the rest of that program.
++
++# PKG_PROG_PKG_CONFIG([MIN-VERSION])
++# ----------------------------------
++AC_DEFUN([PKG_PROG_PKG_CONFIG],
++[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
++m4_pattern_allow([^PKG_CONFIG(_(PATH|LIBDIR|SYSROOT_DIR|ALLOW_SYSTEM_(CFLAGS|LIBS)))?$])
++m4_pattern_allow([^PKG_CONFIG_(DISABLE_UNINSTALLED|TOP_BUILD_DIR|DEBUG_SPEW)$])
++AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])
++AC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path])
++AC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path])
++
++if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
++ AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
++fi
++if test -n "$PKG_CONFIG"; then
++ _pkg_min_version=m4_default([$1], [0.9.0])
++ AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
++ if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
++ AC_MSG_RESULT([yes])
++ else
++ AC_MSG_RESULT([no])
++ PKG_CONFIG=""
++ fi
++fi[]dnl
++])# PKG_PROG_PKG_CONFIG
++
++# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
++#
++# Check to see whether a particular set of modules exists. Similar
++# to PKG_CHECK_MODULES(), but does not set variables or print errors.
++#
++# Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG])
++# only at the first occurence in configure.ac, so if the first place
++# it's called might be skipped (such as if it is within an "if", you
++# have to call PKG_CHECK_EXISTS manually
++# --------------------------------------------------------------
++AC_DEFUN([PKG_CHECK_EXISTS],
++[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
++if test -n "$PKG_CONFIG" && \
++ AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
++ m4_default([$2], [:])
++m4_ifvaln([$3], [else
++ $3])dnl
++fi])
++
++# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
++# ---------------------------------------------
++m4_define([_PKG_CONFIG],
++[if test -n "$$1"; then
++ pkg_cv_[]$1="$$1"
++ elif test -n "$PKG_CONFIG"; then
++ PKG_CHECK_EXISTS([$3],
++ [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`
++ test "x$?" != "x0" && pkg_failed=yes ],
++ [pkg_failed=yes])
++ else
++ pkg_failed=untried
++fi[]dnl
++])# _PKG_CONFIG
++
++# _PKG_SHORT_ERRORS_SUPPORTED
++# -----------------------------
++AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
++[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
++if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
++ _pkg_short_errors_supported=yes
++else
++ _pkg_short_errors_supported=no
++fi[]dnl
++])# _PKG_SHORT_ERRORS_SUPPORTED
++
++
++# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
++# [ACTION-IF-NOT-FOUND])
++#
++#
++# Note that if there is a possibility the first call to
++# PKG_CHECK_MODULES might not happen, you should be sure to include an
++# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
++#
++#
++# --------------------------------------------------------------
++AC_DEFUN([PKG_CHECK_MODULES],
++[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
++AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
++AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
++
++pkg_failed=no
++AC_MSG_CHECKING([for $1])
++
++_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
++_PKG_CONFIG([$1][_LIBS], [libs], [$2])
++
++m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
++and $1[]_LIBS to avoid the need to call pkg-config.
++See the pkg-config man page for more details.])
++
++if test $pkg_failed = yes; then
++ AC_MSG_RESULT([no])
++ _PKG_SHORT_ERRORS_SUPPORTED
++ if test $_pkg_short_errors_supported = yes; then
++ $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1`
++ else
++ $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1`
++ fi
++ # Put the nasty error message in config.log where it belongs
++ echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
++
++ m4_default([$4], [AC_MSG_ERROR(
++[Package requirements ($2) were not met:
++
++$$1_PKG_ERRORS
++
++Consider adjusting the PKG_CONFIG_PATH environment variable if you
++installed software in a non-standard prefix.
++
++_PKG_TEXT])[]dnl
++ ])
++elif test $pkg_failed = untried; then
++ AC_MSG_RESULT([no])
++ m4_default([$4], [AC_MSG_FAILURE(
++[The pkg-config script could not be found or is too old. Make sure it
++is in your PATH or set the PKG_CONFIG environment variable to the full
++path to pkg-config.
++
++_PKG_TEXT
++
++To get pkg-config, see <http://pkg-config.freedesktop.org/>.])[]dnl
++ ])
++else
++ $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
++ $1[]_LIBS=$pkg_cv_[]$1[]_LIBS
++ AC_MSG_RESULT([yes])
++ $3
++fi[]dnl
++])# PKG_CHECK_MODULES
++
++
++# PKG_INSTALLDIR(DIRECTORY)
++# -------------------------
++# Substitutes the variable pkgconfigdir as the location where a module
++# should install pkg-config .pc files. By default the directory is
++# $libdir/pkgconfig, but the default can be changed by passing
++# DIRECTORY. The user can override through the --with-pkgconfigdir
++# parameter.
++AC_DEFUN([PKG_INSTALLDIR],
++[m4_pushdef([pkg_default], [m4_default([$1], ['${libdir}/pkgconfig'])])
++m4_pushdef([pkg_description],
++ [pkg-config installation directory @<:@]pkg_default[@:>@])
++AC_ARG_WITH([pkgconfigdir],
++ [AS_HELP_STRING([--with-pkgconfigdir], pkg_description)],,
++ [with_pkgconfigdir=]pkg_default)
++AC_SUBST([pkgconfigdir], [$with_pkgconfigdir])
++m4_popdef([pkg_default])
++m4_popdef([pkg_description])
++]) dnl PKG_INSTALLDIR
++
++
++# PKG_NOARCH_INSTALLDIR(DIRECTORY)
++# -------------------------
++# Substitutes the variable noarch_pkgconfigdir as the location where a
++# module should install arch-independent pkg-config .pc files. By
++# default the directory is $datadir/pkgconfig, but the default can be
++# changed by passing DIRECTORY. The user can override through the
++# --with-noarch-pkgconfigdir parameter.
++AC_DEFUN([PKG_NOARCH_INSTALLDIR],
++[m4_pushdef([pkg_default], [m4_default([$1], ['${datadir}/pkgconfig'])])
++m4_pushdef([pkg_description],
++ [pkg-config arch-independent installation directory @<:@]pkg_default[@:>@])
++AC_ARG_WITH([noarch-pkgconfigdir],
++ [AS_HELP_STRING([--with-noarch-pkgconfigdir], pkg_description)],,
++ [with_noarch_pkgconfigdir=]pkg_default)
++AC_SUBST([noarch_pkgconfigdir], [$with_noarch_pkgconfigdir])
++m4_popdef([pkg_default])
++m4_popdef([pkg_description])
++]) dnl PKG_NOARCH_INSTALLDIR
++
++
++# PKG_CHECK_VAR(VARIABLE, MODULE, CONFIG-VARIABLE,
++# [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
++# -------------------------------------------
++# Retrieves the value of the pkg-config variable for the given module.
++AC_DEFUN([PKG_CHECK_VAR],
++[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
++AC_ARG_VAR([$1], [value of $3 for $2, overriding pkg-config])dnl
++
++_PKG_CONFIG([$1], [variable="][$3]["], [$2])
++AS_VAR_COPY([$1], [pkg_cv_][$1])
++
++AS_VAR_IF([$1], [""], [$5], [$4])dnl
++])# PKG_CHECK_VAR
++
+ # AM_AUX_DIR_EXPAND -*- Autoconf -*-
+
+ # Copyright (C) 2001-2017 Free Software Foundation, Inc.
+diff -Naurp insight-8.1.50.20180216.orig/gdb/build-id.c insight-8.1.50.20180216.new/gdb/build-id.c
+--- insight-8.1.50.20180216.orig/gdb/build-id.c 2018-02-17 19:16:18.244670409 +0100
++++ insight-8.1.50.20180216.new/gdb/build-id.c 2018-02-17 19:17:08.714168368 +0100
+@@ -35,6 +35,8 @@
+ #include "elf/common.h"
+ #include "elf-bfd.h"
+ #include <sys/stat.h>
++#include "elf/external.h"
++#include "inferior.h"
+
+ #define BUILD_ID_VERBOSE_NONE 0
+ #define BUILD_ID_VERBOSE_FILENAMES 1
+@@ -638,8 +640,366 @@ build_id_to_filename (const struct bfd_b
+ return result;
+ }
+
++#ifdef HAVE_LIBRPM
++
++#include <rpm/rpmlib.h>
++#include <rpm/rpmts.h>
++#include <rpm/rpmdb.h>
++#include <rpm/header.h>
++#ifdef DLOPEN_LIBRPM
++#include <dlfcn.h>
++#endif
++
++/* This MISSING_RPM_HASH tracker is used to collect all the missing rpm files
++ and avoid their duplicities during a single inferior run. */
++
++static struct htab *missing_rpm_hash;
++
++/* This MISSING_RPM_LIST tracker is used to collect and print as a single line
++ all the rpms right before the nearest GDB prompt. It gets cleared after
++ each such print (it is questionable if we should clear it after the print).
++ */
++
++struct missing_rpm
++ {
++ struct missing_rpm *next;
++ char rpm[1];
++ };
++static struct missing_rpm *missing_rpm_list;
++static int missing_rpm_list_entries;
++
++/* Returns the count of newly added rpms. */
++
++static int
++missing_rpm_enlist (const char *filename)
++{
++ static int rpm_init_done = 0;
++ rpmts ts;
++ rpmdbMatchIterator mi;
++ int count = 0;
++
++#ifdef DLOPEN_LIBRPM
++ /* Duplicate here the declarations to verify they match. The same sanity
++ check is present also in `configure.ac'. */
++ extern char * headerFormat(Header h, const char * fmt, errmsg_t * errmsg);
++ static char *(*headerFormat_p) (Header h, const char * fmt, errmsg_t *errmsg);
++ extern int rpmReadConfigFiles(const char * file, const char * target);
++ static int (*rpmReadConfigFiles_p) (const char * file, const char * target);
++ extern rpmdbMatchIterator rpmdbFreeIterator(rpmdbMatchIterator mi);
++ static rpmdbMatchIterator (*rpmdbFreeIterator_p) (rpmdbMatchIterator mi);
++ extern Header rpmdbNextIterator(rpmdbMatchIterator mi);
++ static Header (*rpmdbNextIterator_p) (rpmdbMatchIterator mi);
++ extern rpmts rpmtsCreate(void);
++ static rpmts (*rpmtsCreate_p) (void);
++ extern rpmts rpmtsFree(rpmts ts);
++ static rpmts (*rpmtsFree_p) (rpmts ts);
++ extern rpmdbMatchIterator rpmtsInitIterator(const rpmts ts, rpmTag rpmtag,
++ const void * keyp, size_t keylen);
++ static rpmdbMatchIterator (*rpmtsInitIterator_p) (const rpmts ts,
++ rpmTag rpmtag,
++ const void *keyp,
++ size_t keylen);
++#else /* !DLOPEN_LIBRPM */
++# define headerFormat_p headerFormat
++# define rpmReadConfigFiles_p rpmReadConfigFiles
++# define rpmdbFreeIterator_p rpmdbFreeIterator
++# define rpmdbNextIterator_p rpmdbNextIterator
++# define rpmtsCreate_p rpmtsCreate
++# define rpmtsFree_p rpmtsFree
++# define rpmtsInitIterator_p rpmtsInitIterator
++#endif /* !DLOPEN_LIBRPM */
++
++ gdb_assert (filename != NULL);
++
++ if (strcmp (filename, BUILD_ID_MAIN_EXECUTABLE_FILENAME) == 0)
++ return 0;
++
++ if (is_target_filename (filename))
++ return 0;
++
++ if (filename[0] != '/')
++ {
++ warning (_("Ignoring non-absolute filename: <%s>"), filename);
++ return 0;
++ }
++
++ if (!rpm_init_done)
++ {
++ static int init_tried;
++
++ /* Already failed the initialization before? */
++ if (init_tried)
++ return 0;
++ init_tried = 1;
++
++#ifdef DLOPEN_LIBRPM
++ {
++ void *h;
++
++ h = dlopen (DLOPEN_LIBRPM, RTLD_LAZY);
++ if (!h)
++ {
++ warning (_("Unable to open \"%s\" (%s), "
++ "missing debuginfos notifications will not be displayed"),
++ DLOPEN_LIBRPM, dlerror ());
++ return 0;
++ }
++
++ if (!((headerFormat_p = (char *(*) (Header h, const char * fmt, errmsg_t *errmsg)) dlsym (h, "headerFormat"))
++ && (rpmReadConfigFiles_p = (int (*) (const char * file, const char * target)) dlsym (h, "rpmReadConfigFiles"))
++ && (rpmdbFreeIterator_p = (rpmdbMatchIterator (*) (rpmdbMatchIterator mi)) dlsym (h, "rpmdbFreeIterator"))
++ && (rpmdbNextIterator_p = (Header (*) (rpmdbMatchIterator mi)) dlsym (h, "rpmdbNextIterator"))
++ && (rpmtsCreate_p = (rpmts (*) (void)) dlsym (h, "rpmtsCreate"))
++ && (rpmtsFree_p = (rpmts (*) (rpmts ts)) dlsym (h, "rpmtsFree"))
++ && (rpmtsInitIterator_p = (rpmdbMatchIterator (*) (const rpmts ts, rpmTag rpmtag, const void *keyp, size_t keylen)) dlsym (h, "rpmtsInitIterator"))))
++ {
++ warning (_("Opened library \"%s\" is incompatible (%s), "
++ "missing debuginfos notifications will not be displayed"),
++ DLOPEN_LIBRPM, dlerror ());
++ if (dlclose (h))
++ warning (_("Error closing library \"%s\": %s\n"), DLOPEN_LIBRPM,
++ dlerror ());
++ return 0;
++ }
++ }
++#endif /* DLOPEN_LIBRPM */
++
++ if (rpmReadConfigFiles_p (NULL, NULL) != 0)
++ {
++ warning (_("Error reading the rpm configuration files"));
++ return 0;
++ }
++
++ rpm_init_done = 1;
++ }
++
++ ts = rpmtsCreate_p ();
++
++ mi = rpmtsInitIterator_p (ts, RPMTAG_BASENAMES, filename, 0);
++ if (mi != NULL)
++ {
++ for (;;)
++ {
++ Header h;
++ char *debuginfo, **slot, *s, *s2;
++ errmsg_t err;
++ size_t srcrpmlen = sizeof (".src.rpm") - 1;
++ size_t debuginfolen = sizeof ("-debuginfo") - 1;
++ rpmdbMatchIterator mi_debuginfo;
++
++ h = rpmdbNextIterator_p (mi);
++ if (h == NULL)
++ break;
++
++ /* Verify the debuginfo file is not already installed. */
++
++ debuginfo = headerFormat_p (h, "%{sourcerpm}-debuginfo.%{arch}",
++ &err);
++ if (!debuginfo)
++ {
++ warning (_("Error querying the rpm file `%s': %s"), filename,
++ err);
++ continue;
++ }
++ /* s = `.src.rpm-debuginfo.%{arch}' */
++ s = strrchr (debuginfo, '-') - srcrpmlen;
++ s2 = NULL;
++ if (s > debuginfo && memcmp (s, ".src.rpm", srcrpmlen) == 0)
++ {
++ /* s2 = `-%{release}.src.rpm-debuginfo.%{arch}' */
++ s2 = (char *) memrchr (debuginfo, '-', s - debuginfo);
++ }
++ if (s2)
++ {
++ /* s2 = `-%{version}-%{release}.src.rpm-debuginfo.%{arch}' */
++ s2 = (char *) memrchr (debuginfo, '-', s2 - debuginfo);
++ }
++ if (!s2)
++ {
++ warning (_("Error querying the rpm file `%s': %s"), filename,
++ debuginfo);
++ xfree (debuginfo);
++ continue;
++ }
++ /* s = `.src.rpm-debuginfo.%{arch}' */
++ /* s2 = `-%{version}-%{release}.src.rpm-debuginfo.%{arch}' */
++ memmove (s2 + debuginfolen, s2, s - s2);
++ memcpy (s2, "-debuginfo", debuginfolen);
++ /* s = `XXXX.%{arch}' */
++ /* strlen ("XXXX") == srcrpmlen + debuginfolen */
++ /* s2 = `-debuginfo-%{version}-%{release}XX.%{arch}' */
++ /* strlen ("XX") == srcrpmlen */
++ memmove (s + debuginfolen, s + srcrpmlen + debuginfolen,
++ strlen (s + srcrpmlen + debuginfolen) + 1);
++ /* s = `-debuginfo-%{version}-%{release}.%{arch}' */
++
++ /* RPMDBI_PACKAGES requires keylen == sizeof (int). */
++ /* RPMDBI_LABEL is an interface for NVR-based dbiFindByLabel(). */
++ mi_debuginfo = rpmtsInitIterator_p (ts, (rpmTag) RPMDBI_LABEL, debuginfo, 0);
++ xfree (debuginfo);
++ if (mi_debuginfo)
++ {
++ rpmdbFreeIterator_p (mi_debuginfo);
++ count = 0;
++ break;
++ }
++
++ /* The allocated memory gets utilized below for MISSING_RPM_HASH. */
++ debuginfo = headerFormat_p (h,
++ "%{name}-%{version}-%{release}.%{arch}",
++ &err);
++ if (!debuginfo)
++ {
++ warning (_("Error querying the rpm file `%s': %s"), filename,
++ err);
++ continue;
++ }
++
++ /* Base package name for `debuginfo-install'. We do not use the
++ `yum' command directly as the line
++ yum --enablerepo='*debug*' install NAME-debuginfo.ARCH
++ would be more complicated than just:
++ debuginfo-install NAME-VERSION-RELEASE.ARCH
++ Do not supply the rpm base name (derived from .src.rpm name) as
++ debuginfo-install is unable to install the debuginfo package if
++ the base name PKG binary rpm is not installed while for example
++ PKG-libs would be installed (RH Bug 467901).
++ FUTURE: After multiple debuginfo versions simultaneously installed
++ get supported the support for the VERSION-RELEASE tags handling
++ may need an update. */
++
++ if (missing_rpm_hash == NULL)
++ {
++ /* DEL_F is passed NULL as MISSING_RPM_LIST's HTAB_DELETE
++ should not deallocate the entries. */
++
++ missing_rpm_hash = htab_create_alloc (64, htab_hash_string,
++ (int (*) (const void *, const void *)) streq,
++ NULL, xcalloc, xfree);
++ }
++ slot = (char **) htab_find_slot (missing_rpm_hash, debuginfo, INSERT);
++ /* XCALLOC never returns NULL. */
++ gdb_assert (slot != NULL);
++ if (*slot == NULL)
++ {
++ struct missing_rpm *missing_rpm;
++
++ *slot = debuginfo;
++
++ missing_rpm = (struct missing_rpm *) xmalloc (sizeof (*missing_rpm) + strlen (debuginfo));
++ strcpy (missing_rpm->rpm, debuginfo);
++ missing_rpm->next = missing_rpm_list;
++ missing_rpm_list = missing_rpm;
++ missing_rpm_list_entries++;
++ }
++ else
++ xfree (debuginfo);
++ count++;
++ }
++
++ rpmdbFreeIterator_p (mi);
++ }
++
++ rpmtsFree_p (ts);
++
++ return count;
++}
++
++static int
++missing_rpm_list_compar (const char *const *ap, const char *const *bp)
++{
++ return strcoll (*ap, *bp);
++}
++
++/* It returns a NULL-terminated array of strings needing to be FREEd. It may
++ also return only NULL. */
++
++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);
++
++ array_iter = array;
++ for (list_iter = missing_rpm_list; list_iter != NULL;
++ list_iter = list_iter->next)
++ {
++ *array_iter++ = list_iter->rpm;
++ }
++ gdb_assert (array_iter == array + missing_rpm_list_entries);
++
++ qsort (array, missing_rpm_list_entries, sizeof (*array),
++ (int (*) (const void *, const void *)) 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++)
++ {
++ putchar_unfiltered (' ');
++ puts_unfiltered (*array_iter);
++ }
++ putchar_unfiltered ('\n');
++
++ while (missing_rpm_list != NULL)
++ {
++ list_iter = missing_rpm_list;
++ missing_rpm_list = list_iter->next;
++ xfree (list_iter);
++ }
++ missing_rpm_list_entries = 0;
++
++ do_cleanups (cleanups);
++}
++
++static void
++missing_rpm_change (void)
++{
++ debug_flush_missing ();
++
++ gdb_assert (missing_rpm_list == NULL);
++ if (missing_rpm_hash != NULL)
++ {
++ htab_delete (missing_rpm_hash);
++ missing_rpm_hash = NULL;
++ }
++}
++
++enum missing_exec
++ {
++ /* Init state. EXEC_BFD also still could be NULL. */
++ MISSING_EXEC_NOT_TRIED,
++ /* We saw a non-NULL EXEC_BFD but RPM has no info about it. */
++ MISSING_EXEC_NOT_FOUND,
++ /* We found EXEC_BFD by RPM and we either have its symbols (either embedded
++ or separate) or the main executable's RPM is now contained in
++ MISSING_RPM_HASH. */
++ MISSING_EXEC_ENLISTED
++ };
++static enum missing_exec missing_exec = MISSING_EXEC_NOT_TRIED;
++
++#endif /* HAVE_LIBRPM */
++
++void
++debug_flush_missing (void)
++{
++#ifdef HAVE_LIBRPM
++ missing_rpm_list_print ();
++#endif
++}
++
+ /* This MISSING_FILEPAIR_HASH tracker is used only for the duplicite messages
+- Try to install the hash file ...
++ yum --enablerepo='*debug*' install ...
+ avoidance. */
+
+ struct missing_filepair
+@@ -693,11 +1053,17 @@ missing_filepair_change (void)
+ /* All their memory came just from missing_filepair_OBSTACK. */
+ missing_filepair_hash = NULL;
+ }
++#ifdef HAVE_LIBRPM
++ missing_exec = MISSING_EXEC_NOT_TRIED;
++#endif
+ }
+
+ static void
+ debug_print_executable_changed (void)
+ {
++#ifdef HAVE_LIBRPM
++ missing_rpm_change ();
++#endif
+ missing_filepair_change ();
+ }
+
+@@ -764,14 +1130,39 @@ debug_print_missing (const char *binary,
+
+ *slot = missing_filepair;
+
+- /* We do not collect and flush these messages as each such message
+- already requires its own separate lines. */
++#ifdef HAVE_LIBRPM
++ if (missing_exec == MISSING_EXEC_NOT_TRIED)
++ {
++ char *execfilename;
+
+- 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)
++ missing_exec = MISSING_EXEC_NOT_FOUND;
++ else
++ missing_exec = MISSING_EXEC_ENLISTED;
++ }
++ }
++ if (missing_exec != MISSING_EXEC_ENLISTED)
++ if ((binary[0] == 0 || missing_rpm_enlist (binary) == 0)
++ && (debug == NULL || missing_rpm_enlist (debug) == 0))
++#endif /* HAVE_LIBRPM */
++ {
++ /* We do not collect and flush these messages as each such message
++ already requires its own separate lines. */
++
++ fprintf_unfiltered (gdb_stdlog,
++ _("Missing separate debuginfo for %s\n"), binary);
++ if (debug != NULL)
++ fprintf_unfiltered (gdb_stdlog, _("Try: %s %s\n"),
++#ifdef DNF_DEBUGINFO_INSTALL
++ "dnf"
++#else
++ "yum"
++#endif
++ " --enablerepo='*debug*' install", debug);
++ }
+ }
+
+
+diff -Naurp insight-8.1.50.20180216.orig/gdb/config.in insight-8.1.50.20180216.new/gdb/config.in
+--- insight-8.1.50.20180216.orig/gdb/config.in 2018-02-02 13:28:13.000000000 +0100
++++ insight-8.1.50.20180216.new/gdb/config.in 2018-02-17 19:17:08.714168368 +0100
+@@ -33,6 +33,9 @@
+ /* Define to BFD's default target vector. */
+ #undef DEFAULT_BFD_VEC
+
++/* librpm version specific library name to dlopen. */
++#undef DLOPEN_LIBRPM
++
+ /* Define to 1 if translation of program messages to the user's native
+ language is requested. */
+ #undef ENABLE_NLS
+@@ -270,6 +273,9 @@
+ /* Define if Python 2.7 is being used. */
+ #undef HAVE_LIBPYTHON2_7
+
++/* Define if librpm library is being used. */
++#undef HAVE_LIBRPM
++
+ /* Define to 1 if you have the <libunwind-ia64.h> header file. */
+ #undef HAVE_LIBUNWIND_IA64_H
+
+diff -Naurp insight-8.1.50.20180216.orig/gdb/configure insight-8.1.50.20180216.new/gdb/configure
+--- insight-8.1.50.20180216.orig/gdb/configure 2018-02-16 15:40:18.000000000 +0100
++++ insight-8.1.50.20180216.new/gdb/configure 2018-02-17 19:22:44.756497106 +0100
+@@ -750,6 +750,11 @@ PKGVERSION
+ HAVE_NATIVE_GCORE_TARGET
+ TARGET_OBS
+ subdirs
++RPM_LIBS
++RPM_CFLAGS
++PKG_CONFIG_LIBDIR
++PKG_CONFIG_PATH
++PKG_CONFIG
+ GDB_DATADIR
+ DEBUGDIR
+ MAKEINFO_EXTRA_FLAGS
+@@ -854,6 +859,7 @@ with_gdb_datadir
+ with_relocated_sources
+ with_auto_load_dir
+ with_auto_load_safe_path
++with_rpm
+ enable_targets
+ enable_64_bit_bfd
+ enable_gdbcli
+@@ -912,6 +918,11 @@ CCC
+ CPP
+ MAKEINFO
+ MAKEINFOFLAGS
++PKG_CONFIG
++PKG_CONFIG_PATH
++PKG_CONFIG_LIBDIR
++RPM_CFLAGS
++RPM_LIBS
+ YACC
+ YFLAGS
+ XMKMF'
+@@ -1582,6 +1593,8 @@ Optional Packages:
+ [--with-auto-load-dir]
+ --without-auto-load-safe-path
+ do not restrict auto-loaded files locations
++ --with-rpm query rpm database for missing debuginfos (yes/no,
++ def. auto=librpm.so)
+ --with-libunwind-ia64 use libunwind frame unwinding for ia64 targets
+ --with-curses use the curses library instead of the termcap
+ library
+@@ -1639,6 +1652,13 @@ Some influential environment variables:
+ MAKEINFO Parent configure detects if it is of sufficient version.
+ MAKEINFOFLAGS
+ Parameters for MAKEINFO.
++ PKG_CONFIG path to pkg-config utility
++ PKG_CONFIG_PATH
++ directories to add to pkg-config's search path
++ PKG_CONFIG_LIBDIR
++ path overriding pkg-config's built-in search path
++ RPM_CFLAGS C compiler flags for RPM, overriding pkg-config
++ RPM_LIBS linker flags for RPM, overriding pkg-config
+ YACC The `Yet Another Compiler Compiler' implementation to use.
+ Defaults to the first program found out of: `bison -y', `byacc',
+ `yacc'.
+@@ -6568,6 +6588,494 @@ _ACEOF
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_auto_load_safe_path" >&5
+ $as_echo "$with_auto_load_safe_path" >&6; }
+
++# Integration with rpm library to support missing debuginfo suggestions.
++# --without-rpm: Disable any rpm support.
++# --with-rpm=libname.so: Try to dynamically open `libname.so' during runtime.
++# Even with runtime missing `libname.so' GDB will still other run correctly.
++# Missing `libname.so' during ./configure will abort the configuration.
++# --with-rpm=librpm.so: Like `--with-rpm=libname.so' but try to find specific
++# minor version first such as `librpm-4.6.so' as minor version differences
++# mean API+ABI incompatibility. If the specific match versioned library name
++# could not be found still open dynamically at least `librpm.so'.
++# --with-rpm: Like `--with-rpm=librpm.so' but if any of its detection fails try
++# to find librpm for compilation-time linking by pkg-config. GDB binary will
++# be probably linked with the version specific library (as `librpm-4.6.so').
++# Failure to find librpm by pkg-config will abort the configuration.
++# (default) --with-rpm=auto: Like `--with-rpm=librpm.so' but if even pkg-config
++# cannot find librpm use to the rpmless compilation (like `--without-rpm').
++
++
++# Check whether --with-rpm was given.
++if test "${with_rpm+set}" = set; then :
++ withval=$with_rpm;
++else
++ with_rpm="auto"
++fi
++
++
++
++
++if test "x$with_rpm" != "xno"; then
++ if test "x$with_rpm" = "xyes"; then
++ LIBRPM="librpm.so"
++ RPM_REQUIRE=true
++ DLOPEN_REQUIRE=false
++ elif test "x$with_rpm" = "xauto"; then
++ LIBRPM="librpm.so"
++ RPM_REQUIRE=false
++ DLOPEN_REQUIRE=false
++ else
++ LIBRPM="$with_rpm"
++ RPM_REQUIRE=true
++ DLOPEN_REQUIRE=true
++ fi
++ LIBRPM_STRING='"'"$LIBRPM"'"'
++
++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking specific librpm version" >&5
++$as_echo_n "checking specific librpm version... " >&6; }
++ HAVE_DLOPEN_LIBRPM=false
++ save_LIBS="$LIBS"
++ LIBS="$LIBS -ldl"
++ if test "$cross_compiling" = yes; then :
++ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
++$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
++as_fn_error "cannot run test program while cross compiling
++See \`config.log' for more details." "$LINENO" 5; }
++else
++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
++/* end confdefs.h. */
++
++#include <rpm/rpmlib.h>
++#include <dlfcn.h>
++#include <errno.h>
++
++int
++main ()
++{
++
++ void *h;
++ const char *const *rpmverp;
++ FILE *f;
++
++ f = fopen ("conftest.out", "w");
++ if (!f)
++ {
++ fprintf (stderr, "Cannot write \"%s\": %s\n", "conftest.out",
++ strerror (errno));
++ return 1;
++ }
++ h = dlopen ($LIBRPM_STRING, RTLD_LAZY);
++ if (!h)
++ {
++ fprintf (stderr, "dlopen (\"%s\"): %s\n", $LIBRPM_STRING, dlerror ());
++ return 1;
++ }
++ rpmverp = dlsym (h, "RPMVERSION");
++ if (!rpmverp)
++ {
++ fprintf (stderr, "dlsym (\"RPMVERSION\"): %s\n", dlerror ());
++ return 1;
++ }
++ fprintf (stderr, "RPMVERSION is: \"");
++ fprintf (stderr, "%s\"\n", *rpmverp);
++
++ /* Try to find the specific librpm version only for "librpm.so" as we do
++ not know how to assemble the version string otherwise. */
++
++ if (strcmp ("librpm.so", $LIBRPM_STRING) != 0)
++ {
++ fprintf (f, "%s\n", $LIBRPM_STRING);
++ return 0;
++ }
++ else
++ {
++ char *h2_name;
++ void *h2;
++ int major, minor;
++
++ if (sscanf (*rpmverp, "%d.%d", &major, &minor) != 2)
++ {
++ fprintf (stderr, "Unable to parse RPMVERSION.\n");
++ fprintf (f, "%s\n", $LIBRPM_STRING);
++ return 0;
++ }
++ /* Avoid the square brackets by malloc. */
++ h2_name = malloc (64);
++ sprintf (h2_name, "librpm-%d.%d.so", major, minor);
++ h2 = dlopen (h2_name, RTLD_LAZY);
++ if (!h2)
++ {
++ fprintf (stderr, "dlopen (\"%s\"): %s\n", h2_name, dlerror ());
++ fprintf (f, "%s\n", $LIBRPM_STRING);
++ return 0;
++ }
++ if (h2 != h)
++ {
++ fprintf (stderr, "dlopen of \"%s\" and \"%s\" are different.\n",
++ $LIBRPM_STRING, h2_name);
++ fprintf (f, "%s\n", $LIBRPM_STRING);
++ return 0;
++ }
++ /* Found the valid .so name with a specific version. */
++ fprintf (f, "%s\n", h2_name);
++ return 0;
++ }
++
++ ;
++ return 0;
++}
++_ACEOF
++if ac_fn_c_try_run "$LINENO"; then :
++
++ DLOPEN_LIBRPM="`cat conftest.out`"
++ if test "x$DLOPEN_LIBRPM" != "x"; then
++ HAVE_DLOPEN_LIBRPM=true
++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DLOPEN_LIBRPM" >&5
++$as_echo "$DLOPEN_LIBRPM" >&6; }
++ fi
++
++fi
++rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
++ conftest.$ac_objext conftest.beam conftest.$ac_ext
++fi
++
++ rm -f conftest.out
++
++
++
++ if $HAVE_DLOPEN_LIBRPM; then
++
++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking rpm library API compatibility" >&5
++$as_echo_n "checking rpm library API compatibility... " >&6; }
++ # The compilation requires -Werror to verify anything.
++ save_CFLAGS="$CFLAGS"
++ CFLAGS="$CFLAGS -Werror"
++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
++/* end confdefs.h. */
++
++/* Duplicate here the declarations to verify they match "elfread.c". */
++#include <rpm/rpmlib.h>
++#include <rpm/rpmts.h>
++#include <rpm/rpmdb.h>
++#include <rpm/header.h>
++extern char * headerFormat(Header h, const char * fmt, errmsg_t * errmsg);
++extern int rpmReadConfigFiles(const char * file, const char * target);
++extern rpmdbMatchIterator rpmdbFreeIterator(rpmdbMatchIterator mi);
++extern Header rpmdbNextIterator(rpmdbMatchIterator mi);
++extern rpmts rpmtsCreate(void);
++extern rpmts rpmtsFree(rpmts ts);
++extern rpmdbMatchIterator rpmtsInitIterator(const rpmts ts, rpmTag rpmtag,
++ const void * keyp, size_t keylen);
++
++int
++main ()
++{
++
++ ;
++ return 0;
++}
++_ACEOF
++if ac_fn_c_try_compile "$LINENO"; then :
++
++ LIBRPM_COMPAT=true
++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
++$as_echo "yes" >&6; }
++
++else
++
++ LIBRPM_COMPAT=false
++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
++$as_echo "no" >&6; }
++
++fi
++rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
++ CFLAGS="$save_CFLAGS"
++
++ if ! $LIBRPM_COMPAT; then
++ HAVE_DLOPEN_LIBRPM=false
++ fi
++ fi
++
++ if $HAVE_DLOPEN_LIBRPM; then
++ DLOPEN_LIBRPM_STRING='"'"$DLOPEN_LIBRPM"'"'
++
++cat >>confdefs.h <<_ACEOF
++#define DLOPEN_LIBRPM $DLOPEN_LIBRPM_STRING
++_ACEOF
++
++
++$as_echo "#define HAVE_LIBRPM 1" >>confdefs.h
++
++ else
++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
++$as_echo "no" >&6; }
++ LIBS="$save_LIBS"
++ if $DLOPEN_REQUIRE; then
++ as_fn_error "Specific name $LIBRPM was requested but it could not be opened." "$LINENO" 5
++ fi
++
++
++
++
++
++
++
++if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
++ if test -n "$ac_tool_prefix"; then
++ # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args.
++set dummy ${ac_tool_prefix}pkg-config; ac_word=$2
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
++$as_echo_n "checking for $ac_word... " >&6; }
++if test "${ac_cv_path_PKG_CONFIG+set}" = set; then :
++ $as_echo_n "(cached) " >&6
++else
++ case $PKG_CONFIG in
++ [\\/]* | ?:[\\/]*)
++ ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
++ ;;
++ *)
++ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
++for as_dir in $PATH
++do
++ IFS=$as_save_IFS
++ test -z "$as_dir" && as_dir=.
++ for ac_exec_ext in '' $ac_executable_extensions; do
++ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
++ ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
++ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
++ break 2
++ fi
++done
++ done
++IFS=$as_save_IFS
++
++ ;;
++esac
++fi
++PKG_CONFIG=$ac_cv_path_PKG_CONFIG
++if test -n "$PKG_CONFIG"; then
++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5
++$as_echo "$PKG_CONFIG" >&6; }
++else
++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
++$as_echo "no" >&6; }
++fi
++
++
++fi
++if test -z "$ac_cv_path_PKG_CONFIG"; then
++ ac_pt_PKG_CONFIG=$PKG_CONFIG
++ # Extract the first word of "pkg-config", so it can be a program name with args.
++set dummy pkg-config; ac_word=$2
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
++$as_echo_n "checking for $ac_word... " >&6; }
++if test "${ac_cv_path_ac_pt_PKG_CONFIG+set}" = set; then :
++ $as_echo_n "(cached) " >&6
++else
++ case $ac_pt_PKG_CONFIG in
++ [\\/]* | ?:[\\/]*)
++ ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path.
++ ;;
++ *)
++ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
++for as_dir in $PATH
++do
++ IFS=$as_save_IFS
++ test -z "$as_dir" && as_dir=.
++ for ac_exec_ext in '' $ac_executable_extensions; do
++ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
++ ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
++ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
++ break 2
++ fi
++done
++ done
++IFS=$as_save_IFS
++
++ ;;
++esac
++fi
++ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG
++if test -n "$ac_pt_PKG_CONFIG"; then
++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKG_CONFIG" >&5
++$as_echo "$ac_pt_PKG_CONFIG" >&6; }
++else
++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
++$as_echo "no" >&6; }
++fi
++
++ if test "x$ac_pt_PKG_CONFIG" = x; then
++ PKG_CONFIG=""
++ else
++ case $cross_compiling:$ac_tool_warned in
++yes:)
++{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
++$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
++ac_tool_warned=yes ;;
++esac
++ PKG_CONFIG=$ac_pt_PKG_CONFIG
++ fi
++else
++ PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
++fi
++
++fi
++if test -n "$PKG_CONFIG"; then
++ _pkg_min_version=0.9.0
++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking pkg-config is at least version $_pkg_min_version" >&5
++$as_echo_n "checking pkg-config is at least version $_pkg_min_version... " >&6; }
++ if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
++$as_echo "yes" >&6; }
++ else
++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
++$as_echo "no" >&6; }
++ PKG_CONFIG=""
++ fi
++fi
++
++pkg_failed=no
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for RPM" >&5
++$as_echo_n "checking for RPM... " >&6; }
++
++if test -n "$RPM_CFLAGS"; then
++ pkg_cv_RPM_CFLAGS="$RPM_CFLAGS"
++ elif test -n "$PKG_CONFIG"; then
++ if test -n "$PKG_CONFIG" && \
++ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"rpm\""; } >&5
++ ($PKG_CONFIG --exists --print-errors "rpm") 2>&5
++ ac_status=$?
++ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
++ test $ac_status = 0; }; then
++ pkg_cv_RPM_CFLAGS=`$PKG_CONFIG --cflags "rpm" 2>/dev/null`
++ test "x$?" != "x0" && pkg_failed=yes
++else
++ pkg_failed=yes
++fi
++ else
++ pkg_failed=untried
++fi
++if test -n "$RPM_LIBS"; then
++ pkg_cv_RPM_LIBS="$RPM_LIBS"
++ elif test -n "$PKG_CONFIG"; then
++ if test -n "$PKG_CONFIG" && \
++ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"rpm\""; } >&5
++ ($PKG_CONFIG --exists --print-errors "rpm") 2>&5
++ ac_status=$?
++ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
++ test $ac_status = 0; }; then
++ pkg_cv_RPM_LIBS=`$PKG_CONFIG --libs "rpm" 2>/dev/null`
++ test "x$?" != "x0" && pkg_failed=yes
++else
++ pkg_failed=yes
++fi
++ else
++ pkg_failed=untried
++fi
++
++
++
++if test $pkg_failed = yes; then
++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
++$as_echo "no" >&6; }
++
++if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
++ _pkg_short_errors_supported=yes
++else
++ _pkg_short_errors_supported=no
++fi
++ if test $_pkg_short_errors_supported = yes; then
++ RPM_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "rpm" 2>&1`
++ else
++ RPM_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "rpm" 2>&1`
++ fi
++ # Put the nasty error message in config.log where it belongs
++ echo "$RPM_PKG_ERRORS" >&5
++
++ HAVE_LIBRPM=false
++elif test $pkg_failed = untried; then
++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
++$as_echo "no" >&6; }
++ HAVE_LIBRPM=false
++else
++ RPM_CFLAGS=$pkg_cv_RPM_CFLAGS
++ RPM_LIBS=$pkg_cv_RPM_LIBS
++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
++$as_echo "yes" >&6; }
++ HAVE_LIBRPM=true
++fi
++
++ if $HAVE_LIBRPM; then
++
++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking rpm library API compatibility" >&5
++$as_echo_n "checking rpm library API compatibility... " >&6; }
++ # The compilation requires -Werror to verify anything.
++ save_CFLAGS="$CFLAGS"
++ CFLAGS="$CFLAGS -Werror"
++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
++/* end confdefs.h. */
++
++/* Duplicate here the declarations to verify they match "elfread.c". */
++#include <rpm/rpmlib.h>
++#include <rpm/rpmts.h>
++#include <rpm/rpmdb.h>
++#include <rpm/header.h>
++extern char * headerFormat(Header h, const char * fmt, errmsg_t * errmsg);
++extern int rpmReadConfigFiles(const char * file, const char * target);
++extern rpmdbMatchIterator rpmdbFreeIterator(rpmdbMatchIterator mi);
++extern Header rpmdbNextIterator(rpmdbMatchIterator mi);
++extern rpmts rpmtsCreate(void);
++extern rpmts rpmtsFree(rpmts ts);
++extern rpmdbMatchIterator rpmtsInitIterator(const rpmts ts, rpmTag rpmtag,
++ const void * keyp, size_t keylen);
++
++int
++main ()
++{
++
++ ;
++ return 0;
++}
++_ACEOF
++if ac_fn_c_try_compile "$LINENO"; then :
++
++ LIBRPM_COMPAT=true
++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
++$as_echo "yes" >&6; }
++
++else
++
++ LIBRPM_COMPAT=false
++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
++$as_echo "no" >&6; }
++
++fi
++rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
++ CFLAGS="$save_CFLAGS"
++
++ if ! $LIBRPM_COMPAT; then
++ HAVE_LIBRPM=false
++ RPM_PKG_ERRORS="Found $LIBRPM API is incompatibile with this GDB"
++ fi
++ fi
++
++ if $HAVE_LIBRPM; then
++
++$as_echo "#define HAVE_LIBRPM 1" >>confdefs.h
++
++ CFLAGS="$CFLAGS $RPM_CFLAGS"
++ LIBS="$LIBS $RPM_LIBS"
++ else
++ if $RPM_REQUIRE; then
++ as_fn_error "$RPM_PKG_ERRORS" "$LINENO" 5
++ else
++ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $RPM_PKG_ERRORS" >&5
++$as_echo "$as_me: WARNING: $RPM_PKG_ERRORS" >&2;}
++ fi
++ fi
++ fi
++fi
++
+
+
+ subdirs="$subdirs testsuite"
+diff -Naurp insight-8.1.50.20180216.orig/gdb/configure.ac insight-8.1.50.20180216.new/gdb/configure.ac
+--- insight-8.1.50.20180216.orig/gdb/configure.ac 2018-02-17 19:16:18.193669906 +0100
++++ insight-8.1.50.20180216.new/gdb/configure.ac 2018-02-17 19:17:08.720168427 +0100
+@@ -167,6 +167,199 @@ AC_DEFINE_DIR(AUTO_LOAD_SAFE_PATH, escap
+ [Directories safe to hold auto-loaded files.])
+ AC_MSG_RESULT([$with_auto_load_safe_path])
+
++# Integration with rpm library to support missing debuginfo suggestions.
++# --without-rpm: Disable any rpm support.
++# --with-rpm=libname.so: Try to dynamically open `libname.so' during runtime.
++# Even with runtime missing `libname.so' GDB will still other run correctly.
++# Missing `libname.so' during ./configure will abort the configuration.
++# --with-rpm=librpm.so: Like `--with-rpm=libname.so' but try to find specific
++# minor version first such as `librpm-4.6.so' as minor version differences
++# mean API+ABI incompatibility. If the specific match versioned library name
++# could not be found still open dynamically at least `librpm.so'.
++# --with-rpm: Like `--with-rpm=librpm.so' but if any of its detection fails try
++# to find librpm for compilation-time linking by pkg-config. GDB binary will
++# be probably linked with the version specific library (as `librpm-4.6.so').
++# Failure to find librpm by pkg-config will abort the configuration.
++# (default) --with-rpm=auto: Like `--with-rpm=librpm.so' but if even pkg-config
++# cannot find librpm use to the rpmless compilation (like `--without-rpm').
++
++AC_ARG_WITH([rpm],
++ [AS_HELP_STRING([--with-rpm],
++ [query rpm database for missing debuginfos (yes/no, def. auto=librpm.so)])], [], [with_rpm="auto"])
++
++m4_pattern_allow([^AC_MSG_ERROR$])
++m4_pattern_allow([^AC_MSG_WARN$])
++if test "x$with_rpm" != "xno"; then
++ if test "x$with_rpm" = "xyes"; then
++ LIBRPM="librpm.so"
++ RPM_REQUIRE=true
++ DLOPEN_REQUIRE=false
++ elif test "x$with_rpm" = "xauto"; then
++ LIBRPM="librpm.so"
++ RPM_REQUIRE=false
++ DLOPEN_REQUIRE=false
++ else
++ LIBRPM="$with_rpm"
++ RPM_REQUIRE=true
++ DLOPEN_REQUIRE=true
++ fi
++ LIBRPM_STRING='"'"$LIBRPM"'"'
++
++ AC_MSG_CHECKING([specific librpm version])
++ HAVE_DLOPEN_LIBRPM=false
++ save_LIBS="$LIBS"
++ LIBS="$LIBS -ldl"
++ AC_RUN_IFELSE(AC_LANG_PROGRAM([[
++#include <rpm/rpmlib.h>
++#include <dlfcn.h>
++#include <errno.h>
++ ]], [[
++ void *h;
++ const char *const *rpmverp;
++ FILE *f;
++
++ f = fopen ("conftest.out", "w");
++ if (!f)
++ {
++ fprintf (stderr, "Cannot write \"%s\": %s\n", "conftest.out",
++ strerror (errno));
++ return 1;
++ }
++ h = dlopen ($LIBRPM_STRING, RTLD_LAZY);
++ if (!h)
++ {
++ fprintf (stderr, "dlopen (\"%s\"): %s\n", $LIBRPM_STRING, dlerror ());
++ return 1;
++ }
++ rpmverp = dlsym (h, "RPMVERSION");
++ if (!rpmverp)
++ {
++ fprintf (stderr, "dlsym (\"RPMVERSION\"): %s\n", dlerror ());
++ return 1;
++ }
++ fprintf (stderr, "RPMVERSION is: \"");
++ fprintf (stderr, "%s\"\n", *rpmverp);
++
++ /* Try to find the specific librpm version only for "librpm.so" as we do
++ not know how to assemble the version string otherwise. */
++
++ if (strcmp ("librpm.so", $LIBRPM_STRING) != 0)
++ {
++ fprintf (f, "%s\n", $LIBRPM_STRING);
++ return 0;
++ }
++ else
++ {
++ char *h2_name;
++ void *h2;
++ int major, minor;
++
++ if (sscanf (*rpmverp, "%d.%d", &major, &minor) != 2)
++ {
++ fprintf (stderr, "Unable to parse RPMVERSION.\n");
++ fprintf (f, "%s\n", $LIBRPM_STRING);
++ return 0;
++ }
++ /* Avoid the square brackets by malloc. */
++ h2_name = malloc (64);
++ sprintf (h2_name, "librpm-%d.%d.so", major, minor);
++ h2 = dlopen (h2_name, RTLD_LAZY);
++ if (!h2)
++ {
++ fprintf (stderr, "dlopen (\"%s\"): %s\n", h2_name, dlerror ());
++ fprintf (f, "%s\n", $LIBRPM_STRING);
++ return 0;
++ }
++ if (h2 != h)
++ {
++ fprintf (stderr, "dlopen of \"%s\" and \"%s\" are different.\n",
++ $LIBRPM_STRING, h2_name);
++ fprintf (f, "%s\n", $LIBRPM_STRING);
++ return 0;
++ }
++ /* Found the valid .so name with a specific version. */
++ fprintf (f, "%s\n", h2_name);
++ return 0;
++ }
++ ]]), [
++ DLOPEN_LIBRPM="`cat conftest.out`"
++ if test "x$DLOPEN_LIBRPM" != "x"; then
++ HAVE_DLOPEN_LIBRPM=true
++ AC_MSG_RESULT($DLOPEN_LIBRPM)
++ fi
++ ])
++ rm -f conftest.out
++
++ m4_define([CHECK_LIBRPM_COMPAT], [
++ AC_MSG_CHECKING([rpm library API compatibility])
++ # The compilation requires -Werror to verify anything.
++ save_CFLAGS="$CFLAGS"
++ CFLAGS="$CFLAGS -Werror"
++ AC_COMPILE_IFELSE(AC_LANG_PROGRAM([[
++/* Duplicate here the declarations to verify they match "elfread.c". */
++#include <rpm/rpmlib.h>
++#include <rpm/rpmts.h>
++#include <rpm/rpmdb.h>
++#include <rpm/header.h>
++extern char * headerFormat(Header h, const char * fmt, errmsg_t * errmsg);
++extern int rpmReadConfigFiles(const char * file, const char * target);
++extern rpmdbMatchIterator rpmdbFreeIterator(rpmdbMatchIterator mi);
++extern Header rpmdbNextIterator(rpmdbMatchIterator mi);
++extern rpmts rpmtsCreate(void);
++extern rpmts rpmtsFree(rpmts ts);
++extern rpmdbMatchIterator rpmtsInitIterator(const rpmts ts, rpmTag rpmtag,
++ const void * keyp, size_t keylen);
++ ]]), [
++ LIBRPM_COMPAT=true
++ AC_MSG_RESULT(yes)
++ ], [
++ LIBRPM_COMPAT=false
++ AC_MSG_RESULT(no)
++ ])
++ CFLAGS="$save_CFLAGS"
++ ])
++
++ if $HAVE_DLOPEN_LIBRPM; then
++ CHECK_LIBRPM_COMPAT
++ if ! $LIBRPM_COMPAT; then
++ HAVE_DLOPEN_LIBRPM=false
++ fi
++ fi
++
++ if $HAVE_DLOPEN_LIBRPM; then
++ DLOPEN_LIBRPM_STRING='"'"$DLOPEN_LIBRPM"'"'
++ AC_DEFINE_UNQUOTED(DLOPEN_LIBRPM, $DLOPEN_LIBRPM_STRING, [librpm version specific library name to dlopen.])
++ AC_DEFINE(HAVE_LIBRPM, 1, [Define if librpm library is being used.])
++ else
++ AC_MSG_RESULT(no)
++ LIBS="$save_LIBS"
++ if $DLOPEN_REQUIRE; then
++ AC_MSG_ERROR([Specific name $LIBRPM was requested but it could not be opened.])
++ fi
++ PKG_CHECK_MODULES(RPM, rpm, [HAVE_LIBRPM=true], [HAVE_LIBRPM=false])
++
++ if $HAVE_LIBRPM; then
++ CHECK_LIBRPM_COMPAT
++ if ! $LIBRPM_COMPAT; then
++ HAVE_LIBRPM=false
++ RPM_PKG_ERRORS="Found $LIBRPM API is incompatibile with this GDB"
++ fi
++ fi
++
++ if $HAVE_LIBRPM; then
++ AC_DEFINE(HAVE_LIBRPM, 1, [Define if librpm library is being used.])
++ CFLAGS="$CFLAGS $RPM_CFLAGS"
++ LIBS="$LIBS $RPM_LIBS"
++ else
++ if $RPM_REQUIRE; then
++ AC_MSG_ERROR($RPM_PKG_ERRORS)
++ else
++ AC_MSG_WARN($RPM_PKG_ERRORS)
++ fi
++ fi
++ fi
++fi
++
+ AC_CONFIG_SUBDIRS(testsuite)
+
+ # Check whether to support alternative target configurations
+diff -Naurp insight-8.1.50.20180216.orig/gdb/corelow.c insight-8.1.50.20180216.new/gdb/corelow.c
+--- insight-8.1.50.20180216.orig/gdb/corelow.c 2018-02-17 19:16:18.245670419 +0100
++++ insight-8.1.50.20180216.new/gdb/corelow.c 2018-02-17 19:17:08.720168427 +0100
+@@ -309,7 +309,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 -Naurp insight-8.1.50.20180216.orig/gdb/event-top.c insight-8.1.50.20180216.new/gdb/event-top.c
+--- insight-8.1.50.20180216.orig/gdb/event-top.c 2018-02-16 15:40:15.000000000 +0100
++++ insight-8.1.50.20180216.new/gdb/event-top.c 2018-02-17 19:17:08.720168427 +0100
+@@ -40,6 +40,7 @@
+ #include "buffer.h"
+ #include "ser-event.h"
+ #include "gdb_select.h"
++#include "symfile.h"
+
+ /* readline include files. */
+ #include "readline/readline.h"
+@@ -359,6 +360,8 @@ display_gdb_prompt (const char *new_prom
+ /* Reset the nesting depth used when trace-commands is set. */
+ reset_command_nest_depth ();
+
++ debug_flush_missing ();
++
+ /* 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. */
+@@ -774,7 +777,10 @@ command_line_handler (char *rl)
+ command_handler (cmd);
+
+ if (ui->prompt_state != PROMPTED)
+- display_gdb_prompt (0);
++ {
++ debug_flush_missing ();
++ display_gdb_prompt (0);
++ }
+ }
+ }
+
+diff -Naurp insight-8.1.50.20180216.orig/gdb/symfile.h insight-8.1.50.20180216.new/gdb/symfile.h
+--- insight-8.1.50.20180216.orig/gdb/symfile.h 2018-02-17 19:16:18.253670497 +0100
++++ insight-8.1.50.20180216.new/gdb/symfile.h 2018-02-17 19:17:08.720168427 +0100
+@@ -546,6 +546,8 @@ void map_symbol_filenames (symbol_filena
+ /* 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);
++extern void debug_flush_missing (void);
++#define BUILD_ID_MAIN_EXECUTABLE_FILENAME _("the main executable file")
+
+ /* From dwarf2read.c */
+
diff --git a/insight-8.1-gdb-6.8-attach-signalled-detach-stopped.patch b/insight-8.1-gdb-6.8-attach-signalled-detach-stopped.patch
new file mode 100644
index 0000000..59f4ab6
--- /dev/null
+++ b/insight-8.1-gdb-6.8-attach-signalled-detach-stopped.patch
@@ -0,0 +1,177 @@
+diff -Naurp insight-8.1.50.20180216.orig/gdb/infrun.c insight-8.1.50.20180216.new/gdb/infrun.c
+--- insight-8.1.50.20180216.orig/gdb/infrun.c 2018-02-18 02:36:22.786760016 +0100
++++ insight-8.1.50.20180216.new/gdb/infrun.c 2018-02-18 02:43:48.225007181 +0100
+@@ -606,6 +606,13 @@ holding the child stopped. Try \"set de
+ target_pid_to_str (process_ptid));
+ }
+
++#ifdef NEED_DETACH_SIGSTOP
++ /* We should check PID_WAS_STOPPED and detach it stopped accordingly.
++ In this point of code it cannot be 1 as we would not get FORK
++ executed without CONTINUE first which resets PID_WAS_STOPPED.
++ We would have to first TARGET_STOP and WAITPID it as with running
++ inferior PTRACE_DETACH, SIGSTOP will ignore the signal. */
++#endif
+ target_detach (parent_inf, 0);
+ }
+
+diff -Naurp insight-8.1.50.20180216.orig/gdb/linux-nat.c insight-8.1.50.20180216.new/gdb/linux-nat.c
+--- insight-8.1.50.20180216.orig/gdb/linux-nat.c 2018-02-18 02:36:22.806760208 +0100
++++ insight-8.1.50.20180216.new/gdb/linux-nat.c 2018-02-18 02:38:47.013127523 +0100
+@@ -194,6 +194,11 @@ enum tribool have_ptrace_getregset = TRI
+ static struct target_ops *linux_ops;
+ static struct target_ops linux_ops_saved;
+
++#ifdef NEED_DETACH_SIGSTOP
++/* PID of the inferior stopped by SIGSTOP before attaching (or zero). */
++static pid_t pid_was_stopped;
++
++#endif
+ /* The method to call, if any, when a new thread is attached. */
+ static void (*linux_nat_new_thread) (struct lwp_info *);
+
+@@ -1065,6 +1070,9 @@ linux_nat_post_attach_wait (ptid_t ptid,
+ if (debug_linux_nat)
+ fprintf_unfiltered (gdb_stdlog,
+ "LNPAW: Attaching to a stopped process\n");
++#ifdef NEED_DETACH_SIGSTOP
++ pid_was_stopped = ptid_get_pid (ptid);
++#endif
+
+ /* The process is definitely stopped. It is in a job control
+ stop, unless the kernel predates the TASK_STOPPED /
+@@ -1405,6 +1413,25 @@ get_detach_signal (struct lwp_info *lp)
+ return gdb_signal_to_host (signo);
+ }
+
++#ifdef NEED_DETACH_SIGSTOP
++ /* Workaround RHEL-5 kernel which has unreliable PTRACE_DETACH, SIGSTOP (that
++ many TIDs are left unstopped). See RH Bug 496732. */
++ if (ptid_get_pid (lp->ptid) == pid_was_stopped)
++ {
++ int err;
++
++ errno = 0;
++ err = kill_lwp (ptid_get_lwp (lp->ptid), SIGSTOP);
++ if (debug_linux_nat)
++ {
++ fprintf_unfiltered (gdb_stdlog,
++ "SC: lwp kill %d %s\n",
++ err,
++ errno ? safe_strerror (errno) : "ERRNO-OK");
++ }
++ }
++
++#endif
+ return 0;
+ }
+
+@@ -1554,6 +1581,10 @@ linux_nat_detach (struct target_ops *ops
+ detach_one_lwp (main_lwp, &signo);
+
+ inf_ptrace_detach_success (ops, inf);
++
++#ifdef NEED_DETACH_SIGSTOP
++ pid_was_stopped = 0;
++#endif
+ }
+ }
+
+@@ -1814,6 +1845,16 @@ linux_nat_resume (struct target_ops *ops
+ return;
+ }
+
++#ifdef NEED_DETACH_SIGSTOP
++ /* At this point, we are going to resume the inferior and if we
++ have attached to a stopped process, we no longer should leave
++ it as stopped if the user detaches. PTID variable has PID set to LWP
++ while we need to check the real PID here. */
++
++ if (!step && lp && pid_was_stopped == ptid_get_pid (lp->ptid))
++ pid_was_stopped = 0;
++
++#endif
+ if (resume_many)
+ iterate_over_lwps (ptid, linux_nat_resume_callback, lp);
+
+@@ -3825,6 +3866,10 @@ linux_nat_mourn_inferior (struct target_
+
+ /* Let the arch-specific native code know this process is gone. */
+ linux_nat_forget_process (pid);
++#ifdef NEED_DETACH_SIGSTOP
++
++ pid_was_stopped = 0;
++#endif
+ }
+
+ /* Convert a native/host siginfo object, into/from the siginfo in the
+diff -Naurp insight-8.1.50.20180216.orig/gdb/testsuite/gdb.threads/attach-stopped.exp insight-8.1.50.20180216.new/gdb/testsuite/gdb.threads/attach-stopped.exp
+--- insight-8.1.50.20180216.orig/gdb/testsuite/gdb.threads/attach-stopped.exp 2018-01-04 17:43:15.000000000 +0100
++++ insight-8.1.50.20180216.new/gdb/testsuite/gdb.threads/attach-stopped.exp 2018-02-18 02:36:48.179004208 +0100
+@@ -56,7 +56,65 @@ proc corefunc { threadtype } {
+ gdb_reinitialize_dir $srcdir/$subdir
+ gdb_load ${binfile}
+
+- # Verify that we can attach to the stopped process.
++ # Verify that we can attach to the process by first giving its
++ # executable name via the file command, and using attach with the
++ # process ID.
++
++ set test "$threadtype: set file, before attach1 to stopped process"
++ gdb_test_multiple "file $binfile" "$test" {
++ -re "Load new symbol table from.*y or n. $" {
++ gdb_test "y" "Reading symbols from $escapedbinfile\.\.\.*done." \
++ "$test (re-read)"
++ }
++ -re "Reading symbols from $escapedbinfile\.\.\.*done.*$gdb_prompt $" {
++ pass "$test"
++ }
++ }
++
++ set test "$threadtype: attach1 to stopped, after setting file"
++ gdb_test_multiple "attach $testpid" "$test" {
++ -re "Attaching to program.*`?$escapedbinfile'?, process $testpid.*$gdb_prompt $" {
++ pass "$test"
++ }
++ }
++
++ # ".*sleep.*clone.*" would fail on s390x as bt stops at START_THREAD there.
++ if {[string equal $threadtype threaded]} {
++ gdb_test "thread apply all bt" ".*sleep.*start_thread.*" "$threadtype: attach1 to stopped bt"
++ } else {
++ gdb_test "bt" ".*sleep.*main.*" "$threadtype: attach1 to stopped bt"
++ }
++
++ # Exit and detach the process.
++
++ gdb_exit
++
++ # Avoid some race:
++ sleep 2
++
++ if [catch {open /proc/${testpid}/status r} fileid] {
++ set line2 "NOTFOUND"
++ } else {
++ gets $fileid line1;
++ gets $fileid line2;
++ close $fileid;
++ }
++
++ set test "$threadtype: attach1, exit leaves process stopped"
++ if {[string match "*(stopped)*" $line2]} {
++ pass $test
++ } else {
++ fail $test
++ }
++
++ # At this point, the process should still be stopped
++
++ gdb_start
++ gdb_reinitialize_dir $srcdir/$subdir
++ gdb_load ${binfile}
++
++ # Verify that we can attach to the process just by giving the
++ # process ID.
+
+ set test "$threadtype: attach2 to stopped, after setting file"
+ gdb_test_multiple "attach $testpid" "$test" {
diff --git a/insight-8.1-gdb-6.8-quit-never-aborts.patch b/insight-8.1-gdb-6.8-quit-never-aborts.patch
new file mode 100644
index 0000000..353e145
--- /dev/null
+++ b/insight-8.1-gdb-6.8-quit-never-aborts.patch
@@ -0,0 +1,63 @@
+diff -Naurp insight-8.1.50.20180216.orig/gdb/defs.h insight-8.1.50.20180216.new/gdb/defs.h
+--- insight-8.1.50.20180216.orig/gdb/defs.h 2018-02-18 02:50:17.453737880 +0100
++++ insight-8.1.50.20180216.new/gdb/defs.h 2018-02-18 02:50:40.712961274 +0100
+@@ -168,6 +168,10 @@ extern void default_quit_handler (void);
+ /* Flag that function quit should call quit_force. */
+ extern volatile int sync_quit_force_run;
+
++#ifdef NEED_DETACH_SIGSTOP
++extern int quit_flag_cleanup;
++#endif
++
+ extern void quit (void);
+
+ /* Helper for the QUIT macro. */
+diff -Naurp insight-8.1.50.20180216.orig/gdb/extension.c insight-8.1.50.20180216.new/gdb/extension.c
+--- insight-8.1.50.20180216.orig/gdb/extension.c 2018-01-12 03:18:43.000000000 +0100
++++ insight-8.1.50.20180216.new/gdb/extension.c 2018-02-18 02:50:40.712961274 +0100
+@@ -830,6 +830,11 @@ check_quit_flag (void)
+ int i, result = 0;
+ const struct extension_language_defn *extlang;
+
++#ifdef NEED_DETACH_SIGSTOP
++ if (quit_flag_cleanup)
++ return 0;
++#endif
++
+ ALL_ENABLED_EXTENSION_LANGUAGES (i, extlang)
+ {
+ if (extlang->ops->check_quit_flag != NULL)
+diff -Naurp insight-8.1.50.20180216.orig/gdb/top.c insight-8.1.50.20180216.new/gdb/top.c
+--- insight-8.1.50.20180216.orig/gdb/top.c 2018-02-16 15:40:15.000000000 +0100
++++ insight-8.1.50.20180216.new/gdb/top.c 2018-02-18 02:50:40.713961283 +0100
+@@ -1578,7 +1578,13 @@ quit_force (int *exit_arg, int from_tty)
+
+ qt.from_tty = from_tty;
+
++#ifndef NEED_DETACH_SIGSTOP
+ /* We want to handle any quit errors and exit regardless. */
++#else
++ /* We want to handle any quit errors and exit regardless but we should never
++ get user-interrupted to properly detach the inferior. */
++ quit_flag_cleanup = 1;
++#endif
+
+ /* Get out of tfind mode, and kill or detach all inferiors. */
+ TRY
+diff -Naurp insight-8.1.50.20180216.orig/gdb/utils.c insight-8.1.50.20180216.new/gdb/utils.c
+--- insight-8.1.50.20180216.orig/gdb/utils.c 2018-02-18 02:50:17.453737880 +0100
++++ insight-8.1.50.20180216.new/gdb/utils.c 2018-02-18 02:50:40.714961293 +0100
+@@ -107,6 +107,13 @@ static std::chrono::steady_clock::durati
+
+ static int debug_timestamp = 0;
+
++#ifdef NEED_DETACH_SIGSTOP
++/* Nonzero means we are already processing the quitting cleanups and we should
++ no longer get aborted. */
++
++int quit_flag_cleanup;
++#endif
++
+ /* Nonzero means that strings with character values >0x7F should be printed
+ as octal escapes. Zero means just print the value (e.g. it's an
+ international character, and the terminal or window can cope.) */
diff --git a/insight-8.1-gdb-attach-fail-reasons-5of5.patch b/insight-8.1-gdb-attach-fail-reasons-5of5.patch
new file mode 100644
index 0000000..d9f0395
--- /dev/null
+++ b/insight-8.1-gdb-attach-fail-reasons-5of5.patch
@@ -0,0 +1,317 @@
+diff -Naurp insight-8.1.50.20180216.orig/gdb/config.in insight-8.1.50.20180216.new/gdb/config.in
+--- insight-8.1.50.20180216.orig/gdb/config.in 2018-02-18 00:23:36.501301300 +0100
++++ insight-8.1.50.20180216.new/gdb/config.in 2018-02-18 00:24:24.300777804 +0100
+@@ -276,6 +276,9 @@
+ /* Define if librpm library is being used. */
+ #undef HAVE_LIBRPM
+
++/* Define to 1 if you have the `selinux' library (-lselinux). */
++#undef HAVE_LIBSELINUX
++
+ /* Define to 1 if you have the <libunwind-ia64.h> header file. */
+ #undef HAVE_LIBUNWIND_IA64_H
+
+@@ -399,6 +402,9 @@
+ /* Define to 1 if you have the `scm_new_smob' function. */
+ #undef HAVE_SCM_NEW_SMOB
+
++/* Define to 1 if you have the <selinux/selinux.h> header file. */
++#undef HAVE_SELINUX_SELINUX_H
++
+ /* Define to 1 if you have the `setlocale' function. */
+ #undef HAVE_SETLOCALE
+
+diff -Naurp insight-8.1.50.20180216.orig/gdb/configure insight-8.1.50.20180216.new/gdb/configure
+--- insight-8.1.50.20180216.orig/gdb/configure 2018-02-18 00:23:36.502301310 +0100
++++ insight-8.1.50.20180216.new/gdb/configure 2018-02-18 00:24:24.301777814 +0100
+@@ -15839,6 +15839,64 @@ cat >>confdefs.h <<_ACEOF
+ _ACEOF
+
+
++for ac_header in selinux/selinux.h
++do :
++ ac_fn_c_check_header_mongrel "$LINENO" "selinux/selinux.h" "ac_cv_header_selinux_selinux_h" "$ac_includes_default"
++if test "x$ac_cv_header_selinux_selinux_h" = x""yes; then :
++ cat >>confdefs.h <<_ACEOF
++#define HAVE_SELINUX_SELINUX_H 1
++_ACEOF
++
++fi
++
++done
++
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for security_get_boolean_active in -lselinux" >&5
++$as_echo_n "checking for security_get_boolean_active in -lselinux... " >&6; }
++if test "${ac_cv_lib_selinux_security_get_boolean_active+set}" = set; then :
++ $as_echo_n "(cached) " >&6
++else
++ ac_check_lib_save_LIBS=$LIBS
++LIBS="-lselinux $LIBS"
++cat confdefs.h - <<_ACEOF >conftest.$ac_ext
++/* end confdefs.h. */
++
++/* Override any GCC internal prototype to avoid an error.
++ Use char because int might match the return type of a GCC
++ builtin and then its argument prototype would still apply. */
++#ifdef __cplusplus
++extern "C"
++#endif
++char security_get_boolean_active ();
++int
++main ()
++{
++return security_get_boolean_active ();
++ ;
++ return 0;
++}
++_ACEOF
++if ac_fn_c_try_link "$LINENO"; then :
++ ac_cv_lib_selinux_security_get_boolean_active=yes
++else
++ ac_cv_lib_selinux_security_get_boolean_active=no
++fi
++rm -f core conftest.err conftest.$ac_objext \
++ conftest$ac_exeext conftest.$ac_ext
++LIBS=$ac_check_lib_save_LIBS
++fi
++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_selinux_security_get_boolean_active" >&5
++$as_echo "$ac_cv_lib_selinux_security_get_boolean_active" >&6; }
++if test "x$ac_cv_lib_selinux_security_get_boolean_active" = x""yes; then :
++ cat >>confdefs.h <<_ACEOF
++#define HAVE_LIBSELINUX 1
++_ACEOF
++
++ LIBS="-lselinux $LIBS"
++
++fi
++
++
+
+ # Support for --with-sysroot is a copy of GDB_AC_WITH_DIR,
+ # except that the argument to --with-sysroot is optional.
+diff -Naurp insight-8.1.50.20180216.orig/gdb/configure.ac insight-8.1.50.20180216.new/gdb/configure.ac
+--- insight-8.1.50.20180216.orig/gdb/configure.ac 2018-02-18 00:23:36.503301320 +0100
++++ insight-8.1.50.20180216.new/gdb/configure.ac 2018-02-18 00:24:24.301777814 +0100
+@@ -2051,6 +2051,10 @@ case $host_os in
+ esac
+ AC_DEFINE_UNQUOTED(GDBINIT,"$gdbinit",[The .gdbinit filename.])
+
++dnl Check security_get_boolean_active availability.
++AC_CHECK_HEADERS(selinux/selinux.h)
++AC_CHECK_LIB(selinux, security_get_boolean_active)
++
+ dnl Handle optional features that can be enabled.
+
+ # Support for --with-sysroot is a copy of GDB_AC_WITH_DIR,
+diff -Naurp insight-8.1.50.20180216.orig/gdb/gdbserver/config.in insight-8.1.50.20180216.new/gdb/gdbserver/config.in
+--- insight-8.1.50.20180216.orig/gdb/gdbserver/config.in 2017-12-01 03:42:32.000000000 +0100
++++ insight-8.1.50.20180216.new/gdb/gdbserver/config.in 2018-02-18 00:24:24.301777814 +0100
+@@ -126,6 +126,9 @@
+ /* Define to 1 if you have the `mcheck' library (-lmcheck). */
+ #undef HAVE_LIBMCHECK
+
++/* Define to 1 if you have the `selinux' library (-lselinux). */
++#undef HAVE_LIBSELINUX
++
+ /* Define if the target supports branch tracing. */
+ #undef HAVE_LINUX_BTRACE
+
+@@ -202,6 +205,9 @@
+ /* Define to 1 if you have the `pwrite' function. */
+ #undef HAVE_PWRITE
+
++/* Define to 1 if you have the <selinux/selinux.h> header file. */
++#undef HAVE_SELINUX_SELINUX_H
++
+ /* Define to 1 if you have the `setns' function. */
+ #undef HAVE_SETNS
+
+diff -Naurp insight-8.1.50.20180216.orig/gdb/gdbserver/configure insight-8.1.50.20180216.new/gdb/gdbserver/configure
+--- insight-8.1.50.20180216.orig/gdb/gdbserver/configure 2018-01-18 19:51:21.000000000 +0100
++++ insight-8.1.50.20180216.new/gdb/gdbserver/configure 2018-02-18 00:24:24.302777824 +0100
+@@ -8455,6 +8455,64 @@ if $want_ipa ; then
+ fi
+ fi
+
++for ac_header in selinux/selinux.h
++do :
++ ac_fn_c_check_header_mongrel "$LINENO" "selinux/selinux.h" "ac_cv_header_selinux_selinux_h" "$ac_includes_default"
++if test "x$ac_cv_header_selinux_selinux_h" = x""yes; then :
++ cat >>confdefs.h <<_ACEOF
++#define HAVE_SELINUX_SELINUX_H 1
++_ACEOF
++
++fi
++
++done
++
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for security_get_boolean_active in -lselinux" >&5
++$as_echo_n "checking for security_get_boolean_active in -lselinux... " >&6; }
++if test "${ac_cv_lib_selinux_security_get_boolean_active+set}" = set; then :
++ $as_echo_n "(cached) " >&6
++else
++ ac_check_lib_save_LIBS=$LIBS
++LIBS="-lselinux $LIBS"
++cat confdefs.h - <<_ACEOF >conftest.$ac_ext
++/* end confdefs.h. */
++
++/* Override any GCC internal prototype to avoid an error.
++ Use char because int might match the return type of a GCC
++ builtin and then its argument prototype would still apply. */
++#ifdef __cplusplus
++extern "C"
++#endif
++char security_get_boolean_active ();
++int
++main ()
++{
++return security_get_boolean_active ();
++ ;
++ return 0;
++}
++_ACEOF
++if ac_fn_c_try_link "$LINENO"; then :
++ ac_cv_lib_selinux_security_get_boolean_active=yes
++else
++ ac_cv_lib_selinux_security_get_boolean_active=no
++fi
++rm -f core conftest.err conftest.$ac_objext \
++ conftest$ac_exeext conftest.$ac_ext
++LIBS=$ac_check_lib_save_LIBS
++fi
++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_selinux_security_get_boolean_active" >&5
++$as_echo "$ac_cv_lib_selinux_security_get_boolean_active" >&6; }
++if test "x$ac_cv_lib_selinux_security_get_boolean_active" = x""yes; then :
++ cat >>confdefs.h <<_ACEOF
++#define HAVE_LIBSELINUX 1
++_ACEOF
++
++ LIBS="-lselinux $LIBS"
++
++fi
++
++
+
+
+
+diff -Naurp insight-8.1.50.20180216.orig/gdb/gdbserver/configure.ac insight-8.1.50.20180216.new/gdb/gdbserver/configure.ac
+--- insight-8.1.50.20180216.orig/gdb/gdbserver/configure.ac 2018-01-18 19:51:21.000000000 +0100
++++ insight-8.1.50.20180216.new/gdb/gdbserver/configure.ac 2018-02-18 00:24:24.302777824 +0100
+@@ -488,6 +488,10 @@ if $want_ipa ; then
+ fi
+ fi
+
++dnl Check security_get_boolean_active availability.
++AC_CHECK_HEADERS(selinux/selinux.h)
++AC_CHECK_LIB(selinux, security_get_boolean_active)
++
+ AC_SUBST(GDBSERVER_DEPFILES)
+ AC_SUBST(GDBSERVER_LIBS)
+ AC_SUBST(srv_xmlbuiltin)
+diff -Naurp insight-8.1.50.20180216.orig/gdb/gdbserver/linux-low.c insight-8.1.50.20180216.new/gdb/gdbserver/linux-low.c
+--- insight-8.1.50.20180216.orig/gdb/gdbserver/linux-low.c 2018-02-09 15:06:40.000000000 +0100
++++ insight-8.1.50.20180216.new/gdb/gdbserver/linux-low.c 2018-02-18 00:48:47.812203733 +0100
+@@ -966,7 +966,16 @@ linux_ptrace_fun ()
+ {
+ if (ptrace (PTRACE_TRACEME, 0, (PTRACE_TYPE_ARG3) 0,
+ (PTRACE_TYPE_ARG4) 0) < 0)
+- trace_start_error_with_name ("ptrace");
++ {
++ int save_errno = errno;
++ std::string msg;
++
++ linux_ptrace_create_warnings (msg);
++ string_appendf (msg, _("Cannot trace created process"));
++
++ errno = save_errno;
++ trace_start_error_with_name (msg.c_str ());
++ }
+
+ if (setpgid (0, 0) < 0)
+ trace_start_error_with_name ("setpgid");
+diff -Naurp insight-8.1.50.20180216.orig/gdb/linux-nat.c insight-8.1.50.20180216.new/gdb/linux-nat.c
+--- insight-8.1.50.20180216.orig/gdb/linux-nat.c 2018-02-16 15:40:15.000000000 +0100
++++ insight-8.1.50.20180216.new/gdb/linux-nat.c 2018-02-18 00:44:21.230638846 +0100
+@@ -1127,7 +1127,24 @@ linux_nat_create_inferior (struct target
+ /* Make sure we report all signals during startup. */
+ linux_nat_pass_signals (ops, 0, NULL);
+
+- linux_ops->to_create_inferior (ops, exec_file, allargs, env, from_tty);
++ volatile struct gdb_exception ex;
++ TRY
++ {
++ linux_ops->to_create_inferior (ops, exec_file, allargs, env, from_tty);
++ }
++ CATCH (ex, RETURN_MASK_ERROR)
++ {
++ std::string buffer;
++ char *message;
++
++ message = xstrdup (ex.message);
++ make_cleanup (xfree, message);
++
++ linux_ptrace_create_warnings (buffer);
++
++ throw_error (ex.error, "%s%s", buffer.c_str (), message);
++ }
++ END_CATCH
+ }
+
+ /* Callback for linux_proc_attach_tgid_threads. Attach to PTID if not
+diff -Naurp insight-8.1.50.20180216.orig/gdb/nat/linux-ptrace.c insight-8.1.50.20180216.new/gdb/nat/linux-ptrace.c
+--- insight-8.1.50.20180216.orig/gdb/nat/linux-ptrace.c 2018-01-26 13:46:47.000000000 +0100
++++ insight-8.1.50.20180216.new/gdb/nat/linux-ptrace.c 2018-02-18 00:53:26.676891379 +0100
+@@ -25,6 +25,10 @@
+ #include <sys/procfs.h>
+ #endif
+
++#ifdef HAVE_SELINUX_SELINUX_H
++# include <selinux/selinux.h>
++#endif /* HAVE_SELINUX_SELINUX_H */
++
+ /* Stores the ptrace options supported by the running kernel.
+ A value of -1 means we did not check for features yet. A value
+ of 0 means there are no supported features. */
+@@ -50,6 +54,8 @@ linux_ptrace_attach_fail_reason (pid_t p
+ "terminated"),
+ (int) pid);
+
++ linux_ptrace_create_warnings (result);
++
+ return result;
+ }
+
+@@ -583,6 +589,22 @@ linux_ptrace_init_warnings (void)
+ linux_ptrace_test_ret_to_nx ();
+ }
+
++/* Print all possible reasons we could fail to create a traced process. */
++
++void
++linux_ptrace_create_warnings (std::string& buffer)
++{
++#ifdef HAVE_LIBSELINUX
++ /* -1 is returned for errors, 0 if it has no effect, 1 if PTRACE_ATTACH is
++ forbidden. */
++ if (security_get_boolean_active ("deny_ptrace") == 1)
++ string_appendf (buffer,
++ _("the SELinux boolean 'deny_ptrace' is enabled, "
++ "you can disable this process attach protection by: "
++ "(gdb) shell sudo setsebool deny_ptrace=0"));
++#endif /* HAVE_LIBSELINUX */
++}
++
+ /* Extract extended ptrace event from wait status. */
+
+ int
+diff -Naurp insight-8.1.50.20180216.orig/gdb/nat/linux-ptrace.h insight-8.1.50.20180216.new/gdb/nat/linux-ptrace.h
+--- insight-8.1.50.20180216.orig/gdb/nat/linux-ptrace.h 2018-01-26 13:46:47.000000000 +0100
++++ insight-8.1.50.20180216.new/gdb/nat/linux-ptrace.h 2018-02-18 00:39:10.140655746 +0100
+@@ -189,6 +189,7 @@ extern std::string linux_ptrace_attach_f
+ extern std::string linux_ptrace_attach_fail_reason_string (ptid_t ptid, int err);
+
+ extern void linux_ptrace_init_warnings (void);
++extern void linux_ptrace_create_warnings (std::string& buffer);
+ extern void linux_check_ptrace_features (void);
+ extern void linux_enable_event_reporting (pid_t pid, int attached);
+ extern void linux_disable_event_reporting (pid_t pid);
diff --git a/insight-8.1-gdb-fedora-libncursesw.patch b/insight-8.1-gdb-fedora-libncursesw.patch
new file mode 100644
index 0000000..79a971f
--- /dev/null
+++ b/insight-8.1-gdb-fedora-libncursesw.patch
@@ -0,0 +1,60 @@
+diff -Naurp insight-8.1.50.20180216.orig/gdb/configure insight-8.1.50.20180216.new/gdb/configure
+--- insight-8.1.50.20180216.orig/gdb/configure 2018-02-18 02:22:43.104874363 +0100
++++ insight-8.1.50.20180216.new/gdb/configure 2018-02-18 02:23:03.691069707 +0100
+@@ -9378,6 +9378,7 @@ if test x"$prefer_curses" = xyes; then
+ # search /usr/local/include, if ncurses is installed in /usr/local. A
+ # default installation of ncurses on alpha*-dec-osf* will lead to such
+ # a situation.
++ # Fedora: Force libncursesw over libncurses to match the includes.
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing waddstr" >&5
+ $as_echo_n "checking for library containing waddstr... " >&6; }
+ if ${ac_cv_search_waddstr+:} false; then :
+@@ -9402,7 +9403,7 @@ return waddstr ();
+ return 0;
+ }
+ _ACEOF
+-for ac_lib in '' ncursesw ncurses cursesX curses; do
++for ac_lib in '' ncursesw; do
+ if test -z "$ac_lib"; then
+ ac_res="none required"
+ else
+@@ -9476,6 +9477,7 @@ case $host_os in
+ esac
+
+ # These are the libraries checked by Readline.
++# Fedora: Force libncursesw over libncurses to match the includes.
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing tgetent" >&5
+ $as_echo_n "checking for library containing tgetent... " >&6; }
+ if ${ac_cv_search_tgetent+:} false; then :
+@@ -9500,7 +9502,7 @@ return tgetent ();
+ return 0;
+ }
+ _ACEOF
+-for ac_lib in '' termcap tinfo curses ncursesw ncurses; do
++for ac_lib in '' termcap tinfo ncursesw; do
+ if test -z "$ac_lib"; then
+ ac_res="none required"
+ else
+diff -Naurp insight-8.1.50.20180216.orig/gdb/configure.ac insight-8.1.50.20180216.new/gdb/configure.ac
+--- insight-8.1.50.20180216.orig/gdb/configure.ac 2018-02-18 02:22:43.104874363 +0100
++++ insight-8.1.50.20180216.new/gdb/configure.ac 2018-02-18 02:23:03.692069716 +0100
+@@ -760,7 +760,8 @@ if test x"$prefer_curses" = xyes; then
+ # search /usr/local/include, if ncurses is installed in /usr/local. A
+ # default installation of ncurses on alpha*-dec-osf* will lead to such
+ # a situation.
+- AC_SEARCH_LIBS(waddstr, [ncursesw ncurses cursesX curses])
++ # Fedora: Force libncursesw over libncurses to match the includes.
++ AC_SEARCH_LIBS(waddstr, [ncursesw])
+
+ if test "$ac_cv_search_waddstr" != no; then
+ curses_found=yes
+@@ -802,7 +803,8 @@ case $host_os in
+ esac
+
+ # These are the libraries checked by Readline.
+-AC_SEARCH_LIBS(tgetent, [termcap tinfo curses ncursesw ncurses])
++# Fedora: Force libncursesw over libncurses to match the includes.
++AC_SEARCH_LIBS(tgetent, [termcap tinfo ncursesw])
+
+ if test "$ac_cv_search_tgetent" = no; then
+ CONFIG_OBS="$CONFIG_OBS stub-termcap.o"
diff --git a/insight-8.1-gdb-rhbz795424-bitpos-20of25.patch b/insight-8.1-gdb-rhbz795424-bitpos-20of25.patch
new file mode 100644
index 0000000..a824597
--- /dev/null
+++ b/insight-8.1-gdb-rhbz795424-bitpos-20of25.patch
@@ -0,0 +1,2946 @@
+diff -Naurp insight-8.1.50.20180216.orig/gdb/aarch64-linux-nat.c insight-8.1.50.20180216.new/gdb/aarch64-linux-nat.c
+--- insight-8.1.50.20180216.orig/gdb/aarch64-linux-nat.c 2018-01-04 17:43:15.000000000 +0100
++++ insight-8.1.50.20180216.new/gdb/aarch64-linux-nat.c 2018-02-18 01:09:36.787116781 +0100
+@@ -708,7 +708,7 @@ aarch64_linux_remove_watchpoint (struct
+
+ static int
+ aarch64_linux_region_ok_for_hw_watchpoint (struct target_ops *self,
+- CORE_ADDR addr, int len)
++ CORE_ADDR addr, LONGEST len)
+ {
+ return aarch64_linux_region_ok_for_watchpoint (addr, len);
+ }
+diff -Naurp insight-8.1.50.20180216.orig/gdb/ada-lang.c insight-8.1.50.20180216.new/gdb/ada-lang.c
+--- insight-8.1.50.20180216.orig/gdb/ada-lang.c 2018-02-16 15:19:06.000000000 +0100
++++ insight-8.1.50.20180216.new/gdb/ada-lang.c 2018-02-18 01:09:36.791116819 +0100
+@@ -78,7 +78,7 @@ static struct type *desc_bounds_type (st
+
+ static struct value *desc_bounds (struct value *);
+
+-static int fat_pntr_bounds_bitpos (struct type *);
++static LONGEST fat_pntr_bounds_bitpos (struct type *);
+
+ static int fat_pntr_bounds_bitsize (struct type *);
+
+@@ -86,13 +86,13 @@ static struct type *desc_data_target_typ
+
+ static struct value *desc_data (struct value *);
+
+-static int fat_pntr_data_bitpos (struct type *);
++static LONGEST fat_pntr_data_bitpos (struct type *);
+
+ static int fat_pntr_data_bitsize (struct type *);
+
+ static struct value *desc_one_bound (struct value *, int, int);
+
+-static int desc_bound_bitpos (struct type *, int, int);
++static LONGEST desc_bound_bitpos (struct type *, int, int);
+
+ static int desc_bound_bitsize (struct type *, int, int);
+
+@@ -175,7 +175,7 @@ static struct type *static_unwrap_type (
+
+ static struct value *unwrap_value (struct value *);
+
+-static struct type *constrained_packed_array_type (struct type *, long *);
++static struct type *constrained_packed_array_type (struct type *, LONGEST *);
+
+ static struct type *decode_constrained_packed_array_type (struct type *);
+
+@@ -190,7 +190,8 @@ static int ada_is_unconstrained_packed_a
+ static struct value *value_subscript_packed (struct value *, int,
+ struct value **);
+
+-static void move_bits (gdb_byte *, int, const gdb_byte *, int, int, int);
++static void move_bits (gdb_byte *, int, const gdb_byte *, LONGEST, LONGEST,
++ int);
+
+ static struct value *coerce_unspec_val_to_type (struct value *,
+ struct type *);
+@@ -216,14 +217,14 @@ static struct value *value_val_atr (stru
+ static struct symbol *standard_lookup (const char *, const struct block *,
+ domain_enum);
+
+-static struct value *ada_search_struct_field (const char *, struct value *, int,
++static struct value *ada_search_struct_field (const char *, struct value *, LONGEST,
+ struct type *);
+
+-static struct value *ada_value_primitive_field (struct value *, int, int,
++static struct value *ada_value_primitive_field (struct value *, LONGEST, int,
+ struct type *);
+
+-static int find_struct_field (const char *, struct type *, int,
+- struct type **, int *, int *, int *, int *);
++static int find_struct_field (const char *, struct type *, LONGEST,
++ struct type **, LONGEST *, int *, int *, int *);
+
+ static int ada_resolve_function (struct block_symbol *, int,
+ struct value **, int, const char *,
+@@ -234,7 +235,7 @@ static int ada_is_direct_array_type (str
+ static void ada_language_arch_info (struct gdbarch *,
+ struct language_arch_info *);
+
+-static struct value *ada_index_struct_field (int, struct value *, int,
++static struct value *ada_index_struct_field (LONGEST, struct value *, LONGEST,
+ struct type *);
+
+ static struct value *assign_aggregate (struct value *, struct value *,
+@@ -697,7 +698,7 @@ coerce_unspec_val_to_type (struct value
+ }
+
+ static const gdb_byte *
+-cond_offset_host (const gdb_byte *valaddr, long offset)
++cond_offset_host (const gdb_byte *valaddr, LONGEST offset)
+ {
+ if (valaddr == NULL)
+ return NULL;
+@@ -706,7 +707,7 @@ cond_offset_host (const gdb_byte *valadd
+ }
+
+ static CORE_ADDR
+-cond_offset_target (CORE_ADDR address, long offset)
++cond_offset_target (CORE_ADDR address, LONGEST offset)
+ {
+ if (address == 0)
+ return 0;
+@@ -1744,7 +1745,7 @@ desc_bounds (struct value *arr)
+ /* If TYPE is the type of an array-descriptor (fat pointer), the bit
+ position of the field containing the address of the bounds data. */
+
+-static int
++static LONGEST
+ fat_pntr_bounds_bitpos (struct type *type)
+ {
+ return TYPE_FIELD_BITPOS (desc_base_type (type), 1);
+@@ -1810,7 +1811,7 @@ desc_data (struct value *arr)
+ /* If TYPE is the type of an array-descriptor (fat pointer), the bit
+ position of the field containing the address of the data. */
+
+-static int
++static LONGEST
+ fat_pntr_data_bitpos (struct type *type)
+ {
+ return TYPE_FIELD_BITPOS (desc_base_type (type), 0);
+@@ -1845,7 +1846,7 @@ desc_one_bound (struct value *bounds, in
+ of the Ith lower bound stored in it, if WHICH is 0, and the Ith upper
+ bound, if WHICH is 1. The first bound is I=1. */
+
+-static int
++static LONGEST
+ desc_bound_bitpos (struct type *type, int i, int which)
+ {
+ return TYPE_FIELD_BITPOS (desc_base_type (type), 2 * i + which - 2);
+@@ -2035,7 +2036,7 @@ ada_type_of_array (struct value *arr, in
+ zero, and does not need to be recomputed. */
+ if (lo < hi)
+ {
+- int array_bitsize =
++ LONGEST array_bitsize =
+ (hi - lo + 1) * TYPE_FIELD_BITSIZE (elt_type, 0);
+
+ TYPE_LENGTH (array_type) = (array_bitsize + 7) / 8;
+@@ -2195,7 +2196,7 @@ decode_packed_array_bitsize (struct type
+ the length is arbitrary. */
+
+ static struct type *
+-constrained_packed_array_type (struct type *type, long *elt_bits)
++constrained_packed_array_type (struct type *type, LONGEST *elt_bits)
+ {
+ struct type *new_elt_type;
+ struct type *new_type;
+@@ -2249,7 +2250,7 @@ decode_constrained_packed_array_type (st
+ char *name;
+ const char *tail;
+ struct type *shadow_type;
+- long bits;
++ LONGEST bits;
+
+ if (!raw_name)
+ raw_name = ada_type_name (desc_base_type (type));
+@@ -2320,7 +2321,8 @@ decode_constrained_packed_array (struct
+ array with no wrapper. In order to interpret the value through
+ the (left-justified) packed array type we just built, we must
+ first left-justify it. */
+- int bit_size, bit_pos;
++ int bit_size;
++ LONGEST bit_pos;
+ ULONGEST mod;
+
+ mod = ada_modulus (value_type (arr)) - 1;
+@@ -2548,7 +2550,7 @@ ada_unpack_from_contents (const gdb_byte
+
+ struct value *
+ ada_value_primitive_packed_val (struct value *obj, const gdb_byte *valaddr,
+- long offset, int bit_offset, int bit_size,
++ LONGEST offset, int bit_offset, int bit_size,
+ struct type *type)
+ {
+ struct value *v;
+@@ -2618,7 +2620,7 @@ ada_value_primitive_packed_val (struct v
+
+ if (obj != NULL)
+ {
+- long new_offset = offset;
++ LONGEST new_offset = offset;
+
+ set_value_component_location (v, obj);
+ set_value_bitpos (v, bit_offset + value_bitpos (obj));
+@@ -2664,7 +2666,7 @@ ada_value_primitive_packed_val (struct v
+ not overlap. */
+ static void
+ move_bits (gdb_byte *target, int targ_offset, const gdb_byte *source,
+- int src_offset, int n, int bits_big_endian_p)
++ LONGEST src_offset, LONGEST n, int bits_big_endian_p)
+ {
+ unsigned int accum, mask;
+ int accum_bits, chunk_size;
+@@ -2754,7 +2756,7 @@ ada_value_assign (struct value *toval, s
+ {
+ int len = (value_bitpos (toval)
+ + bits + HOST_CHAR_BIT - 1) / HOST_CHAR_BIT;
+- int from_size;
++ LONGEST from_size;
+ gdb_byte *buffer = (gdb_byte *) alloca (len);
+ struct value *val;
+ CORE_ADDR to_addr = value_address (toval);
+@@ -2805,7 +2807,7 @@ value_assign_to_component (struct value
+ (LONGEST) (value_address (component) - value_address (container));
+ int bit_offset_in_container =
+ value_bitpos (component) - value_bitpos (container);
+- int bits;
++ LONGEST bits;
+
+ val = value_cast (value_type (component), val);
+
+@@ -4469,7 +4471,7 @@ ensure_lval (struct value *val)
+ if (VALUE_LVAL (val) == not_lval
+ || VALUE_LVAL (val) == lval_internalvar)
+ {
+- int len = TYPE_LENGTH (ada_check_typedef (value_type (val)));
++ LONGEST len = TYPE_LENGTH (ada_check_typedef (value_type (val)));
+ const CORE_ADDR addr =
+ value_as_long (value_allocate_space_in_inferior (len));
+
+@@ -4553,7 +4555,7 @@ static CORE_ADDR
+ value_pointer (struct value *value, struct type *type)
+ {
+ struct gdbarch *gdbarch = get_type_arch (type);
+- unsigned len = TYPE_LENGTH (type);
++ ULONGEST len = TYPE_LENGTH (type);
+ gdb_byte *buf = (gdb_byte *) alloca (len);
+ CORE_ADDR addr;
+
+@@ -6711,7 +6713,7 @@ value_tag_from_contents_and_address (str
+ const gdb_byte *valaddr,
+ CORE_ADDR address)
+ {
+- int tag_byte_offset;
++ LONGEST tag_byte_offset;
+ struct type *tag_type;
+
+ if (find_struct_field ("_tag", type, 0, &tag_type, &tag_byte_offset,
+@@ -7204,7 +7206,7 @@ ada_in_variant (LONGEST val, struct type
+ only in that it can handle packed values of arbitrary type. */
+
+ static struct value *
+-ada_value_primitive_field (struct value *arg1, int offset, int fieldno,
++ada_value_primitive_field (struct value *arg1, LONGEST offset, int fieldno,
+ struct type *arg_type)
+ {
+ struct type *type;
+@@ -7216,7 +7218,7 @@ ada_value_primitive_field (struct value
+
+ if (TYPE_FIELD_BITSIZE (arg_type, fieldno) != 0)
+ {
+- int bit_pos = TYPE_FIELD_BITPOS (arg_type, fieldno);
++ LONGEST bit_pos = TYPE_FIELD_BITPOS (arg_type, fieldno);
+ int bit_size = TYPE_FIELD_BITSIZE (arg_type, fieldno);
+
+ return ada_value_primitive_packed_val (arg1, value_contents (arg1),
+@@ -7293,9 +7295,9 @@ ada_value_primitive_field (struct value
+ Returns 1 if found, 0 otherwise. */
+
+ static int
+-find_struct_field (const char *name, struct type *type, int offset,
++find_struct_field (const char *name, struct type *type, LONGEST offset,
+ struct type **field_type_p,
+- int *byte_offset_p, int *bit_offset_p, int *bit_size_p,
++ LONGEST *byte_offset_p, int *bit_offset_p, int *bit_size_p,
+ int *index_p)
+ {
+ int i;
+@@ -7314,8 +7316,8 @@ find_struct_field (const char *name, str
+
+ for (i = 0; i < TYPE_NFIELDS (type); i += 1)
+ {
+- int bit_pos = TYPE_FIELD_BITPOS (type, i);
+- int fld_offset = offset + bit_pos / 8;
++ LONGEST bit_pos = TYPE_FIELD_BITPOS (type, i);
++ LONGEST fld_offset = offset + bit_pos / 8;
+ const char *t_field_name = TYPE_FIELD_NAME (type, i);
+
+ if (t_field_name == NULL)
+@@ -7417,7 +7419,7 @@ num_visible_fields (struct type *type)
+ long explanation in find_struct_field's function documentation. */
+
+ static struct value *
+-ada_search_struct_field (const char *name, struct value *arg, int offset,
++ada_search_struct_field (const char *name, struct value *arg, LONGEST offset,
+ struct type *type)
+ {
+ int i;
+@@ -7465,7 +7467,7 @@ ada_search_struct_field (const char *nam
+ int j;
+ struct type *field_type = ada_check_typedef (TYPE_FIELD_TYPE (type,
+ i));
+- int var_offset = offset + TYPE_FIELD_BITPOS (type, i) / 8;
++ LONGEST var_offset = offset + TYPE_FIELD_BITPOS (type, i) / 8;
+
+ for (j = 0; j < TYPE_NFIELDS (field_type); j += 1)
+ {
+@@ -7497,8 +7499,8 @@ ada_search_struct_field (const char *nam
+ return NULL;
+ }
+
+-static struct value *ada_index_struct_field_1 (int *, struct value *,
+- int, struct type *);
++static struct value *ada_index_struct_field_1 (LONGEST *, struct value *,
++ LONGEST, struct type *);
+
+
+ /* Return field #INDEX in ARG, where the index is that returned by
+@@ -7507,7 +7509,7 @@ static struct value *ada_index_struct_fi
+ * If found, return value, else return NULL. */
+
+ static struct value *
+-ada_index_struct_field (int index, struct value *arg, int offset,
++ada_index_struct_field (LONGEST index, struct value *arg, LONGEST offset,
+ struct type *type)
+ {
+ return ada_index_struct_field_1 (&index, arg, offset, type);
+@@ -7519,7 +7521,7 @@ ada_index_struct_field (int index, struc
+ * *INDEX_P. */
+
+ static struct value *
+-ada_index_struct_field_1 (int *index_p, struct value *arg, int offset,
++ada_index_struct_field_1 (LONGEST *index_p, struct value *arg, LONGEST offset,
+ struct type *type)
+ {
+ int i;
+@@ -7609,7 +7611,8 @@ ada_value_struct_elt (struct value *arg,
+ v = ada_search_struct_field (name, arg, 0, t);
+ else
+ {
+- int bit_offset, bit_size, byte_offset;
++ int bit_offset, bit_size;
++ LONGEST byte_offset;
+ struct type *field_type;
+ CORE_ADDR address;
+
+@@ -7953,8 +7956,8 @@ ada_coerce_ref (struct value *val0)
+ /* Return OFF rounded upward if necessary to a multiple of
+ ALIGNMENT (a power of 2). */
+
+-static unsigned int
+-align_value (unsigned int off, unsigned int alignment)
++static ULONGEST
++align_value (ULONGEST off, ULONGEST alignment)
+ {
+ return (off + alignment - 1) & ~(alignment - 1);
+ }
+@@ -8348,10 +8351,9 @@ ada_template_to_fixed_record_type_1 (str
+ struct value *mark = value_mark ();
+ struct value *dval;
+ struct type *rtype;
+- int nfields, bit_len;
++ int nfields;
+ int variant_field;
+- long off;
+- int fld_bit_len;
++ LONGEST off, bit_len, fld_bit_len;
+ int f;
+
+ /* Compute the number of fields in this record type that are going
+@@ -8429,7 +8431,7 @@ ada_template_to_fixed_record_type_1 (str
+ that follow this one. */
+ if (ada_is_aligner_type (field_type))
+ {
+- long field_offset = TYPE_FIELD_BITPOS (field_type, f);
++ LONGEST field_offset = TYPE_FIELD_BITPOS (field_type, f);
+
+ field_valaddr = cond_offset_host (field_valaddr, field_offset);
+ field_address = cond_offset_target (field_address, field_offset);
+@@ -8565,11 +8567,11 @@ ada_template_to_fixed_record_type_1 (str
+ if (TYPE_LENGTH (type) <= 0)
+ {
+ if (TYPE_NAME (rtype))
+- warning (_("Invalid type size for `%s' detected: %d."),
+- TYPE_NAME (rtype), TYPE_LENGTH (type));
++ warning (_("Invalid type size for `%s' detected: %s."),
++ TYPE_NAME (rtype), pulongest (TYPE_LENGTH (type)));
+ else
+- warning (_("Invalid type size for <unnamed> detected: %d."),
+- TYPE_LENGTH (type));
++ warning (_("Invalid type size for <unnamed> detected: %s."),
++ pulongest (TYPE_LENGTH (type)));
+ }
+ else
+ {
+@@ -9035,7 +9037,8 @@ to_fixed_array_type (struct type *type0,
+ type was a regular (non-packed) array type. As a result, the
+ bitsize of the array elements needs to be set again, and the array
+ length needs to be recomputed based on that bitsize. */
+- int len = TYPE_LENGTH (result) / TYPE_LENGTH (TYPE_TARGET_TYPE (result));
++ LONGEST len = (TYPE_LENGTH (result)
++ / TYPE_LENGTH (TYPE_TARGET_TYPE (result)));
+ int elt_bitsize = TYPE_FIELD_BITSIZE (type0, 0);
+
+ TYPE_FIELD_BITSIZE (result, 0) = TYPE_FIELD_BITSIZE (type0, 0);
+diff -Naurp insight-8.1.50.20180216.orig/gdb/ada-lang.h insight-8.1.50.20180216.new/gdb/ada-lang.h
+--- insight-8.1.50.20180216.orig/gdb/ada-lang.h 2018-02-16 15:19:06.000000000 +0100
++++ insight-8.1.50.20180216.new/gdb/ada-lang.h 2018-02-18 01:09:36.791116819 +0100
+@@ -175,7 +175,7 @@ extern void ada_print_type (struct type
+ extern void ada_print_typedef (struct type *type, struct symbol *new_symbol,
+ struct ui_file *stream);
+
+-extern void ada_val_print (struct type *, int, CORE_ADDR,
++extern void ada_val_print (struct type *, LONGEST, CORE_ADDR,
+ struct ui_file *, int,
+ struct value *,
+ const struct value_print_options *);
+@@ -190,7 +190,7 @@ extern void ada_emit_char (int, struct t
+ extern void ada_printchar (int, struct type *, struct ui_file *);
+
+ extern void ada_printstr (struct ui_file *, struct type *, const gdb_byte *,
+- unsigned int, const char *, int,
++ ULONGEST, const char *, int,
+ const struct value_print_options *);
+
+ struct value *ada_convert_actual (struct value *actual,
+@@ -262,7 +262,7 @@ extern int ada_is_constrained_packed_arr
+
+ extern struct value *ada_value_primitive_packed_val (struct value *,
+ const gdb_byte *,
+- long, int, int,
++ LONGEST, int, int,
+ struct type *);
+
+ extern struct type *ada_coerce_to_simple_array_type (struct type *);
+diff -Naurp insight-8.1.50.20180216.orig/gdb/ada-typeprint.c insight-8.1.50.20180216.new/gdb/ada-typeprint.c
+--- insight-8.1.50.20180216.orig/gdb/ada-typeprint.c 2018-01-04 17:43:15.000000000 +0100
++++ insight-8.1.50.20180216.new/gdb/ada-typeprint.c 2018-02-18 01:09:36.791116819 +0100
+@@ -896,8 +896,8 @@ ada_print_type (struct type *type0, cons
+ const char *name = ada_type_name (type);
+
+ if (!ada_is_range_type_name (name))
+- fprintf_filtered (stream, _("<%d-byte integer>"),
+- TYPE_LENGTH (type));
++ fprintf_filtered (stream, _("<%s-byte integer>"),
++ pulongest (TYPE_LENGTH (type)));
+ else
+ {
+ fprintf_filtered (stream, "range ");
+@@ -918,7 +918,8 @@ ada_print_type (struct type *type0, cons
+ }
+ break;
+ case TYPE_CODE_FLT:
+- fprintf_filtered (stream, _("<%d-byte float>"), TYPE_LENGTH (type));
++ fprintf_filtered (stream, _("<%s-byte float>"),
++ pulongest (TYPE_LENGTH (type)));
+ break;
+ case TYPE_CODE_ENUM:
+ if (show < 0)
+diff -Naurp insight-8.1.50.20180216.orig/gdb/ada-valprint.c insight-8.1.50.20180216.new/gdb/ada-valprint.c
+--- insight-8.1.50.20180216.orig/gdb/ada-valprint.c 2018-01-12 03:18:43.000000000 +0100
++++ insight-8.1.50.20180216.new/gdb/ada-valprint.c 2018-02-18 01:09:36.792116829 +0100
+@@ -34,11 +34,11 @@
+ #include "target-float.h"
+
+ static int print_field_values (struct type *, const gdb_byte *,
+- int,
++ LONGEST,
+ struct ui_file *, int,
+ struct value *,
+ const struct value_print_options *,
+- int, struct type *, int,
++ int, struct type *, LONGEST,
+ const struct language_defn *);
+
+
+@@ -316,7 +316,7 @@ ada_emit_char (int c, struct type *type,
+ of a character. */
+
+ static int
+-char_at (const gdb_byte *string, int i, int type_len,
++char_at (const gdb_byte *string, LONGEST i, int type_len,
+ enum bfd_endian byte_order)
+ {
+ if (type_len == 1)
+@@ -476,11 +476,11 @@ ada_print_scalar (struct type *type, LON
+
+ static void
+ printstr (struct ui_file *stream, struct type *elttype, const gdb_byte *string,
+- unsigned int length, int force_ellipses, int type_len,
++ ULONGEST length, int force_ellipses, int type_len,
+ const struct value_print_options *options)
+ {
+ enum bfd_endian byte_order = gdbarch_byte_order (get_type_arch (elttype));
+- unsigned int i;
++ ULONGEST i;
+ unsigned int things_printed = 0;
+ int in_quotes = 0;
+ int need_comma = 0;
+@@ -495,9 +495,9 @@ printstr (struct ui_file *stream, struct
+ {
+ /* Position of the character we are examining
+ to see whether it is repeated. */
+- unsigned int rep1;
++ ULONGEST rep1;
+ /* Number of repetitions we have detected so far. */
+- unsigned int reps;
++ ULONGEST reps;
+
+ QUIT;
+
+@@ -528,7 +528,8 @@ printstr (struct ui_file *stream, struct
+ ada_emit_char (char_at (string, i, type_len, byte_order),
+ elttype, stream, '\'', type_len);
+ fputs_filtered ("'", stream);
+- fprintf_filtered (stream, _(" <repeats %u times>"), reps);
++ fprintf_filtered (stream, _(" <repeats %s times>"),
++ pulongest (reps));
+ i = rep1 - 1;
+ things_printed += options->repeat_count_threshold;
+ need_comma = 1;
+@@ -556,7 +557,7 @@ printstr (struct ui_file *stream, struct
+
+ void
+ ada_printstr (struct ui_file *stream, struct type *type,
+- const gdb_byte *string, unsigned int length,
++ const gdb_byte *string, ULONGEST length,
+ const char *encoding, int force_ellipses,
+ const struct value_print_options *options)
+ {
+@@ -566,12 +567,12 @@ ada_printstr (struct ui_file *stream, st
+
+ static int
+ print_variant_part (struct type *type, int field_num,
+- const gdb_byte *valaddr, int offset,
++ const gdb_byte *valaddr, LONGEST offset,
+ struct ui_file *stream, int recurse,
+ struct value *val,
+ const struct value_print_options *options,
+ int comma_needed,
+- struct type *outer_type, int outer_offset,
++ struct type *outer_type, LONGEST outer_offset,
+ const struct language_defn *language)
+ {
+ struct type *var_type = TYPE_FIELD_TYPE (type, field_num);
+@@ -607,11 +608,11 @@ print_variant_part (struct type *type, i
+
+ static int
+ print_field_values (struct type *type, const gdb_byte *valaddr,
+- int offset, struct ui_file *stream, int recurse,
++ LONGEST offset, struct ui_file *stream, int recurse,
+ struct value *val,
+ const struct value_print_options *options,
+ int comma_needed,
+- struct type *outer_type, int outer_offset,
++ struct type *outer_type, LONGEST outer_offset,
+ const struct language_defn *language)
+ {
+ int i, len;
+@@ -677,7 +678,7 @@ print_field_values (struct type *type, c
+ else
+ {
+ struct value *v;
+- int bit_pos = TYPE_FIELD_BITPOS (type, i);
++ LONGEST bit_pos = TYPE_FIELD_BITPOS (type, i);
+ int bit_size = TYPE_FIELD_BITSIZE (type, i);
+ struct value_print_options opts;
+
+@@ -722,8 +723,8 @@ ada_val_print_string (struct type *type,
+ {
+ enum bfd_endian byte_order = gdbarch_byte_order (get_type_arch (type));
+ struct type *elttype = TYPE_TARGET_TYPE (type);
+- unsigned int eltlen;
+- unsigned int len;
++ ULONGEST eltlen;
++ ULONGEST len;
+
+ /* We know that ELTTYPE cannot possibly be null, because we assume
+ that we're called only when TYPE is a string-like type.
+@@ -742,7 +743,7 @@ ada_val_print_string (struct type *type,
+ elements up to it. */
+ if (options->stop_print_at_null)
+ {
+- int temp_len;
++ LONGEST temp_len;
+
+ /* Look for a NULL char. */
+ for (temp_len = 0;
+@@ -1115,7 +1116,7 @@ ada_val_print_ref (struct type *type, co
+
+ static void
+ ada_val_print_1 (struct type *type,
+- int offset, CORE_ADDR address,
++ LONGEST offset, CORE_ADDR address,
+ struct ui_file *stream, int recurse,
+ struct value *original_value,
+ const struct value_print_options *options,
+@@ -1199,7 +1200,7 @@ ada_val_print_1 (struct type *type,
+
+ void
+ ada_val_print (struct type *type,
+- int embedded_offset, CORE_ADDR address,
++ LONGEST embedded_offset, CORE_ADDR address,
+ struct ui_file *stream, int recurse,
+ struct value *val,
+ const struct value_print_options *options)
+diff -Naurp insight-8.1.50.20180216.orig/gdb/amd64-tdep.c insight-8.1.50.20180216.new/gdb/amd64-tdep.c
+--- insight-8.1.50.20180216.orig/gdb/amd64-tdep.c 2018-02-18 01:05:32.134760156 +0100
++++ insight-8.1.50.20180216.new/gdb/amd64-tdep.c 2018-02-18 01:09:36.792116829 +0100
+@@ -726,7 +726,7 @@ amd64_return_value (struct gdbarch *gdba
+ gdb_byte *readbuf, const gdb_byte *writebuf)
+ {
+ enum amd64_reg_class theclass[2];
+- int len = TYPE_LENGTH (type);
++ LONGEST len = TYPE_LENGTH (type);
+ static int integer_regnum[] = { AMD64_RAX_REGNUM, AMD64_RDX_REGNUM };
+ static int sse_regnum[] = { AMD64_XMM0_REGNUM, AMD64_XMM1_REGNUM };
+ int integer_reg = 0;
+@@ -842,11 +842,13 @@ amd64_return_value (struct gdbarch *gdba
+
+ gdb_assert (regnum != -1);
+
++ LONGEST nlen = len < 8 ? len : 8;
++
+ if (readbuf)
+- regcache_raw_read_part (regcache, regnum, offset, std::min (len, 8),
++ regcache_raw_read_part (regcache, regnum, offset, nlen,
+ readbuf + i * 8);
+ if (writebuf)
+- regcache_raw_write_part (regcache, regnum, offset, std::min (len, 8),
++ regcache_raw_write_part (regcache, regnum, offset, nlen,
+ writebuf + i * 8);
+ }
+
+diff -Naurp insight-8.1.50.20180216.orig/gdb/annotate.c insight-8.1.50.20180216.new/gdb/annotate.c
+--- insight-8.1.50.20180216.orig/gdb/annotate.c 2018-01-04 17:43:15.000000000 +0100
++++ insight-8.1.50.20180216.new/gdb/annotate.c 2018-02-18 01:09:36.792116829 +0100
+@@ -531,21 +531,21 @@ annotate_frame_end (void)
+ }
+
+ void
+-annotate_array_section_begin (int idx, struct type *elttype)
++annotate_array_section_begin (LONGEST idx, struct type *elttype)
+ {
+ if (annotation_level == 2)
+ {
+- printf_filtered (("\n\032\032array-section-begin %d "), idx);
++ printf_filtered (("\n\032\032array-section-begin %s "), plongest (idx));
+ print_value_flags (elttype);
+ printf_filtered (("\n"));
+ }
+ }
+
+ void
+-annotate_elt_rep (unsigned int repcount)
++annotate_elt_rep (ULONGEST repcount)
+ {
+ if (annotation_level == 2)
+- printf_filtered (("\n\032\032elt-rep %u\n"), repcount);
++ printf_filtered (("\n\032\032elt-rep %s\n"), pulongest (repcount));
+ }
+
+ void
+diff -Naurp insight-8.1.50.20180216.orig/gdb/annotate.h insight-8.1.50.20180216.new/gdb/annotate.h
+--- insight-8.1.50.20180216.orig/gdb/annotate.h 2018-01-04 17:43:15.000000000 +0100
++++ insight-8.1.50.20180216.new/gdb/annotate.h 2018-02-18 01:09:36.792116829 +0100
+@@ -102,8 +102,8 @@ extern void annotate_frame_source_end (v
+ extern void annotate_frame_where (void);
+ extern void annotate_frame_end (void);
+
+-extern void annotate_array_section_begin (int, struct type *);
+-extern void annotate_elt_rep (unsigned int);
++extern void annotate_array_section_begin (LONGEST, struct type *);
++extern void annotate_elt_rep (ULONGEST);
+ extern void annotate_elt_rep_end (void);
+ extern void annotate_elt (void);
+ extern void annotate_array_section_end (void);
+diff -Naurp insight-8.1.50.20180216.orig/gdb/arch-utils.c insight-8.1.50.20180216.new/gdb/arch-utils.c
+--- insight-8.1.50.20180216.orig/gdb/arch-utils.c 2018-01-04 17:43:15.000000000 +0100
++++ insight-8.1.50.20180216.new/gdb/arch-utils.c 2018-02-18 01:09:36.793116838 +0100
+@@ -228,7 +228,7 @@ legacy_virtual_frame_pointer (struct gdb
+
+ const struct floatformat **
+ default_floatformat_for_type (struct gdbarch *gdbarch,
+- const char *name, int len)
++ const char *name, LONGEST len)
+ {
+ const struct floatformat **format = NULL;
+
+diff -Naurp insight-8.1.50.20180216.orig/gdb/arch-utils.h insight-8.1.50.20180216.new/gdb/arch-utils.h
+--- insight-8.1.50.20180216.orig/gdb/arch-utils.h 2018-01-04 17:43:15.000000000 +0100
++++ insight-8.1.50.20180216.new/gdb/arch-utils.h 2018-02-18 01:09:36.793116838 +0100
+@@ -131,7 +131,7 @@ extern gdbarch_virtual_frame_pointer_fty
+ /* Default implementation of gdbarch_floatformat_for_type. */
+ extern const struct floatformat **
+ default_floatformat_for_type (struct gdbarch *gdbarch,
+- const char *name, int len);
++ const char *name, LONGEST len);
+
+ extern CORE_ADDR generic_skip_trampoline_code (struct frame_info *frame,
+ CORE_ADDR pc);
+diff -Naurp insight-8.1.50.20180216.orig/gdb/arm-linux-nat.c insight-8.1.50.20180216.new/gdb/arm-linux-nat.c
+--- insight-8.1.50.20180216.orig/gdb/arm-linux-nat.c 2018-01-04 17:43:15.000000000 +0100
++++ insight-8.1.50.20180216.new/gdb/arm-linux-nat.c 2018-02-18 01:09:36.793116838 +0100
+@@ -1067,7 +1067,7 @@ arm_linux_remove_hw_breakpoint (struct t
+ ADDR? */
+ static int
+ arm_linux_region_ok_for_hw_watchpoint (struct target_ops *self,
+- CORE_ADDR addr, int len)
++ CORE_ADDR addr, LONGEST len)
+ {
+ const struct arm_linux_hwbp_cap *cap = arm_linux_get_hwbp_cap ();
+ CORE_ADDR max_wp_length, aligned_addr;
+diff -Naurp insight-8.1.50.20180216.orig/gdb/ax-gdb.c insight-8.1.50.20180216.new/gdb/ax-gdb.c
+--- insight-8.1.50.20180216.orig/gdb/ax-gdb.c 2018-01-04 17:43:15.000000000 +0100
++++ insight-8.1.50.20180216.new/gdb/ax-gdb.c 2018-02-18 01:09:36.794116848 +0100
+@@ -82,12 +82,12 @@ static void gen_traced_pop (struct agent
+ static void gen_sign_extend (struct agent_expr *, struct type *);
+ static void gen_extend (struct agent_expr *, struct type *);
+ static void gen_fetch (struct agent_expr *, struct type *);
+-static void gen_left_shift (struct agent_expr *, int);
++static void gen_left_shift (struct agent_expr *, LONGEST);
+
+
+ static void gen_frame_args_address (struct agent_expr *);
+ static void gen_frame_locals_address (struct agent_expr *);
+-static void gen_offset (struct agent_expr *ax, int offset);
++static void gen_offset (struct agent_expr *ax, LONGEST offset);
+ static void gen_sym_offset (struct agent_expr *, struct symbol *);
+ static void gen_var_ref (struct agent_expr *ax, struct axs_value *value,
+ struct symbol *var);
+@@ -132,13 +132,13 @@ static void gen_complement (struct agent
+ static void gen_deref (struct axs_value *);
+ static void gen_address_of (struct axs_value *);
+ static void gen_bitfield_ref (struct agent_expr *ax, struct axs_value *value,
+- struct type *type, int start, int end);
++ struct type *type, LONGEST start, LONGEST end);
+ static void gen_primitive_field (struct agent_expr *ax,
+ struct axs_value *value,
+- int offset, int fieldno, struct type *type);
++ LONGEST offset, int fieldno, struct type *type);
+ static int gen_struct_ref_recursive (struct agent_expr *ax,
+ struct axs_value *value,
+- const char *field, int offset,
++ const char *field, LONGEST offset,
+ struct type *type);
+ static void gen_struct_ref (struct agent_expr *ax,
+ struct axs_value *value,
+@@ -529,7 +529,7 @@ gen_fetch (struct agent_expr *ax, struct
+ right shift it by -DISTANCE bits if DISTANCE < 0. This generates
+ unsigned (logical) right shifts. */
+ static void
+-gen_left_shift (struct agent_expr *ax, int distance)
++gen_left_shift (struct agent_expr *ax, LONGEST distance)
+ {
+ if (distance > 0)
+ {
+@@ -583,7 +583,7 @@ gen_frame_locals_address (struct agent_e
+ programming in ML, it would be clearer why these are the same
+ thing. */
+ static void
+-gen_offset (struct agent_expr *ax, int offset)
++gen_offset (struct agent_expr *ax, LONGEST offset)
+ {
+ /* It would suffice to simply push the offset and add it, but this
+ makes it easier to read positive and negative offsets in the
+@@ -1254,7 +1254,7 @@ gen_address_of (struct axs_value *value)
+ structure. */
+ static void
+ gen_bitfield_ref (struct agent_expr *ax, struct axs_value *value,
+- struct type *type, int start, int end)
++ struct type *type, LONGEST start, LONGEST end)
+ {
+ /* Note that ops[i] fetches 8 << i bits. */
+ static enum agent_op ops[]
+@@ -1289,13 +1289,13 @@ gen_bitfield_ref (struct agent_expr *ax,
+
+ /* The first and one-after-last bits in the field, but rounded down
+ and up to byte boundaries. */
+- int bound_start = (start / TARGET_CHAR_BIT) * TARGET_CHAR_BIT;
+- int bound_end = (((end + TARGET_CHAR_BIT - 1)
+- / TARGET_CHAR_BIT)
+- * TARGET_CHAR_BIT);
++ LONGEST bound_start = (start / TARGET_CHAR_BIT) * TARGET_CHAR_BIT;
++ LONGEST bound_end = (((end + TARGET_CHAR_BIT - 1)
++ / TARGET_CHAR_BIT)
++ * TARGET_CHAR_BIT);
+
+ /* current bit offset within the structure */
+- int offset;
++ LONGEST offset;
+
+ /* The index in ops of the opcode we're considering. */
+ int op;
+@@ -1413,7 +1413,7 @@ gen_bitfield_ref (struct agent_expr *ax,
+
+ static void
+ gen_primitive_field (struct agent_expr *ax, struct axs_value *value,
+- int offset, int fieldno, struct type *type)
++ LONGEST offset, int fieldno, struct type *type)
+ {
+ /* Is this a bitfield? */
+ if (TYPE_FIELD_PACKED (type, fieldno))
+@@ -1437,7 +1437,7 @@ gen_primitive_field (struct agent_expr *
+
+ static int
+ gen_struct_ref_recursive (struct agent_expr *ax, struct axs_value *value,
+- const char *field, int offset, struct type *type)
++ const char *field, LONGEST offset, struct type *type)
+ {
+ int i, rslt;
+ int nbases = TYPE_N_BASECLASSES (type);
+diff -Naurp insight-8.1.50.20180216.orig/gdb/ax-general.c insight-8.1.50.20180216.new/gdb/ax-general.c
+--- insight-8.1.50.20180216.orig/gdb/ax-general.c 2018-01-04 17:43:15.000000000 +0100
++++ insight-8.1.50.20180216.new/gdb/ax-general.c 2018-02-18 01:09:36.794116848 +0100
+@@ -177,7 +177,7 @@ ax_zero_ext (struct agent_expr *x, int n
+
+ /* Append a trace_quick instruction to EXPR, to record N bytes. */
+ void
+-ax_trace_quick (struct agent_expr *x, int n)
++ax_trace_quick (struct agent_expr *x, LONGEST n)
+ {
+ /* N must fit in a byte. */
+ if (n < 0 || n > 255)
+diff -Naurp insight-8.1.50.20180216.orig/gdb/ax.h insight-8.1.50.20180216.new/gdb/ax.h
+--- insight-8.1.50.20180216.orig/gdb/ax.h 2018-01-04 17:43:15.000000000 +0100
++++ insight-8.1.50.20180216.new/gdb/ax.h 2018-02-18 01:09:36.794116848 +0100
+@@ -193,7 +193,7 @@ extern void ax_ext (struct agent_expr *E
+ extern void ax_zero_ext (struct agent_expr *EXPR, int N);
+
+ /* Append a trace_quick instruction to EXPR, to record N bytes. */
+-extern void ax_trace_quick (struct agent_expr *EXPR, int N);
++extern void ax_trace_quick (struct agent_expr *EXPR, LONGEST N);
+
+ /* Append a goto op to EXPR. OP is the actual op (must be aop_goto or
+ aop_if_goto). We assume we don't know the target offset yet,
+diff -Naurp insight-8.1.50.20180216.orig/gdb/breakpoint.c insight-8.1.50.20180216.new/gdb/breakpoint.c
+--- insight-8.1.50.20180216.orig/gdb/breakpoint.c 2018-02-18 01:05:32.195760744 +0100
++++ insight-8.1.50.20180216.new/gdb/breakpoint.c 2018-02-18 01:09:36.797116876 +0100
+@@ -2064,9 +2064,9 @@ should_be_inserted (struct bp_location *
+ {
+ fprintf_unfiltered (gdb_stdlog,
+ "infrun: stepping past non-steppable watchpoint. "
+- "skipping watchpoint at %s:%d\n",
++ "skipping watchpoint at %s:%s\n",
+ paddress (bl->gdbarch, bl->address),
+- bl->length);
++ plongest (bl->length));
+ }
+ return 0;
+ }
+@@ -6851,7 +6851,7 @@ breakpoint_address_match (const address_
+ static int
+ breakpoint_address_match_range (const address_space *aspace1,
+ CORE_ADDR addr1,
+- int len1, const address_space *aspace2,
++ LONGEST len1, const address_space *aspace2,
+ CORE_ADDR addr2)
+ {
+ return ((gdbarch_has_global_breakpoints (target_gdbarch ())
+@@ -10978,7 +10978,7 @@ can_use_hardware_watchpoint (struct valu
+ && TYPE_CODE (vtype) != TYPE_CODE_ARRAY))
+ {
+ CORE_ADDR vaddr = value_address (v);
+- int len;
++ LONGEST len;
+ int num_regs;
+
+ len = (target_exact_watchpoints
+diff -Naurp insight-8.1.50.20180216.orig/gdb/breakpoint.h insight-8.1.50.20180216.new/gdb/breakpoint.h
+--- insight-8.1.50.20180216.orig/gdb/breakpoint.h 2018-02-18 01:05:32.187760667 +0100
++++ insight-8.1.50.20180216.new/gdb/breakpoint.h 2018-02-18 01:09:36.797116876 +0100
+@@ -252,7 +252,7 @@ struct bp_target_info
+
+ /* If this is a ranged breakpoint, then this field contains the
+ length of the range that will be watched for execution. */
+- int length;
++ LONGEST length;
+
+ /* If the breakpoint lives in memory and reading that memory would
+ give back the breakpoint, instead of the original contents, then
+@@ -429,7 +429,7 @@ public:
+ /* For hardware watchpoints, the size of the memory region being
+ watched. For hardware ranged breakpoints, the size of the
+ breakpoint range. */
+- int length = 0;
++ LONGEST length = 0;
+
+ /* Type of hardware watchpoint. */
+ target_hw_bp_type watchpoint_type {};
+diff -Naurp insight-8.1.50.20180216.orig/gdb/c-lang.c insight-8.1.50.20180216.new/gdb/c-lang.c
+--- insight-8.1.50.20180216.orig/gdb/c-lang.c 2018-01-04 17:43:15.000000000 +0100
++++ insight-8.1.50.20180216.new/gdb/c-lang.c 2018-02-18 01:09:36.797116876 +0100
+@@ -184,7 +184,7 @@ c_printchar (int c, struct type *type, s
+
+ void
+ c_printstr (struct ui_file *stream, struct type *type,
+- const gdb_byte *string, unsigned int length,
++ const gdb_byte *string, ULONGEST length,
+ const char *user_encoding, int force_ellipses,
+ const struct value_print_options *options)
+ {
+@@ -666,7 +666,7 @@ evaluate_subexp_c (struct type *expect_t
+ }
+ else
+ {
+- int i;
++ LONGEST i;
+
+ /* Write the terminating character. */
+ for (i = 0; i < TYPE_LENGTH (type); ++i)
+@@ -675,7 +675,7 @@ evaluate_subexp_c (struct type *expect_t
+ if (satisfy_expected)
+ {
+ LONGEST low_bound, high_bound;
+- int element_size = TYPE_LENGTH (type);
++ LONGEST element_size = TYPE_LENGTH (type);
+
+ if (get_discrete_bounds (TYPE_INDEX_TYPE (expect_type),
+ &low_bound, &high_bound) < 0)
+diff -Naurp insight-8.1.50.20180216.orig/gdb/c-lang.h insight-8.1.50.20180216.new/gdb/c-lang.h
+--- insight-8.1.50.20180216.orig/gdb/c-lang.h 2018-01-04 17:43:15.000000000 +0100
++++ insight-8.1.50.20180216.new/gdb/c-lang.h 2018-02-18 01:09:36.797116876 +0100
+@@ -77,7 +77,7 @@ extern void c_print_typedef (struct type
+ struct ui_file *);
+
+ extern void c_val_print (struct type *,
+- int, CORE_ADDR,
++ LONGEST, CORE_ADDR,
+ struct ui_file *, int,
+ struct value *,
+ const struct value_print_options *);
+@@ -97,7 +97,7 @@ extern void c_printchar (int, struct typ
+ extern void c_printstr (struct ui_file * stream,
+ struct type *elttype,
+ const gdb_byte *string,
+- unsigned int length,
++ ULONGEST length,
+ const char *user_encoding,
+ int force_ellipses,
+ const struct value_print_options *options);
+diff -Naurp insight-8.1.50.20180216.orig/gdb/compile/compile-c-support.c insight-8.1.50.20180216.new/gdb/compile/compile-c-support.c
+--- insight-8.1.50.20180216.orig/gdb/compile/compile-c-support.c 2018-02-09 15:06:40.000000000 +0100
++++ insight-8.1.50.20180216.new/gdb/compile/compile-c-support.c 2018-02-18 01:09:36.797116876 +0100
+@@ -307,11 +307,11 @@ generate_register_struct (struct ui_file
+
+ default:
+ fprintf_unfiltered (stream,
+- " unsigned char %s[%d]"
++ " unsigned char %s[%s]"
+ " __attribute__((__aligned__("
+ "__BIGGEST_ALIGNMENT__)))",
+ regname.c_str (),
+- TYPE_LENGTH (regtype));
++ pulongest (TYPE_LENGTH (regtype)));
+ }
+ fputs_unfiltered (";\n", stream);
+ }
+diff -Naurp insight-8.1.50.20180216.orig/gdb/cp-abi.c insight-8.1.50.20180216.new/gdb/cp-abi.c
+--- insight-8.1.50.20180216.orig/gdb/cp-abi.c 2018-01-04 17:43:15.000000000 +0100
++++ insight-8.1.50.20180216.new/gdb/cp-abi.c 2018-02-18 01:09:36.798116886 +0100
+@@ -64,12 +64,12 @@ is_operator_name (const char *name)
+ return (*current_cp_abi.is_operator_name) (name);
+ }
+
+-int
++LONGEST
+ baseclass_offset (struct type *type, int index, const gdb_byte *valaddr,
+ LONGEST embedded_offset, CORE_ADDR address,
+ const struct value *val)
+ {
+- int res = 0;
++ LONGEST res = 0;
+
+ gdb_assert (current_cp_abi.baseclass_offset != NULL);
+
+@@ -96,7 +96,7 @@ baseclass_offset (struct type *type, int
+ struct value *
+ value_virtual_fn_field (struct value **arg1p,
+ struct fn_field *f, int j,
+- struct type *type, int offset)
++ struct type *type, LONGEST offset)
+ {
+ if ((current_cp_abi.virtual_fn_field) == NULL)
+ return NULL;
+diff -Naurp insight-8.1.50.20180216.orig/gdb/cp-abi.h insight-8.1.50.20180216.new/gdb/cp-abi.h
+--- insight-8.1.50.20180216.orig/gdb/cp-abi.h 2018-01-04 17:43:15.000000000 +0100
++++ insight-8.1.50.20180216.new/gdb/cp-abi.h 2018-02-18 01:09:36.798116886 +0100
+@@ -108,7 +108,7 @@ extern struct value *value_virtual_fn_fi
+ struct fn_field *f,
+ int j,
+ struct type *type,
+- int offset);
++ LONGEST offset);
+
+
+ /* Try to find the run-time type of VALUE, using C++ run-time type
+@@ -144,11 +144,11 @@ extern struct type *value_rtti_type (str
+ contents of VAL. The result is the offset of the baseclass value
+ relative to (the address of)(ARG) + OFFSET. */
+
+-extern int baseclass_offset (struct type *type,
+- int index, const gdb_byte *valaddr,
+- LONGEST embedded_offset,
+- CORE_ADDR address,
+- const struct value *val);
++extern LONGEST baseclass_offset (struct type *type,
++ int index, const gdb_byte *valaddr,
++ LONGEST embedded_offset,
++ CORE_ADDR address,
++ const struct value *val);
+
+ /* Describe the target of a pointer to method. CONTENTS is the byte
+ pattern representing the pointer to method. TYPE is the pointer to
+@@ -226,12 +226,12 @@ struct cp_abi_ops
+ struct value *(*virtual_fn_field) (struct value **arg1p,
+ struct fn_field * f,
+ int j, struct type * type,
+- int offset);
++ LONGEST offset);
+ struct type *(*rtti_type) (struct value *v, int *full,
+ LONGEST *top, int *using_enc);
+- int (*baseclass_offset) (struct type *type, int index,
+- const bfd_byte *valaddr, LONGEST embedded_offset,
+- CORE_ADDR address, const struct value *val);
++ LONGEST (*baseclass_offset) (struct type *type, int index,
++ const bfd_byte *valaddr, LONGEST embedded_offset,
++ CORE_ADDR address, const struct value *val);
+ void (*print_method_ptr) (const gdb_byte *contents,
+ struct type *type,
+ struct ui_file *stream);
+diff -Naurp insight-8.1.50.20180216.orig/gdb/cp-valprint.c insight-8.1.50.20180216.new/gdb/cp-valprint.c
+--- insight-8.1.50.20180216.orig/gdb/cp-valprint.c 2018-01-04 17:43:15.000000000 +0100
++++ insight-8.1.50.20180216.new/gdb/cp-valprint.c 2018-02-18 01:09:36.798116886 +0100
+@@ -335,7 +335,7 @@ cp_print_value_fields (struct type *type
+ }
+ else if (i == vptr_fieldno && type == vptr_basetype)
+ {
+- int i_offset = offset + TYPE_FIELD_BITPOS (type, i) / 8;
++ LONGEST i_offset = offset + TYPE_FIELD_BITPOS (type, i) / 8;
+ struct type *i_type = TYPE_FIELD_TYPE (type, i);
+
+ if (valprint_check_validity (stream, i_type, i_offset, val))
+diff -Naurp insight-8.1.50.20180216.orig/gdb/c-typeprint.c insight-8.1.50.20180216.new/gdb/c-typeprint.c
+--- insight-8.1.50.20180216.orig/gdb/c-typeprint.c 2018-01-04 17:43:15.000000000 +0100
++++ insight-8.1.50.20180216.new/gdb/c-typeprint.c 2018-02-18 01:09:36.797116876 +0100
+@@ -933,7 +933,8 @@ c_print_type_union_field_offset (struct
+ {
+ struct type *ftype = check_typedef (TYPE_FIELD_TYPE (type, field_idx));
+
+- fprintf_filtered (stream, "/* %4u */", TYPE_LENGTH (ftype));
++ fprintf_filtered (stream, "/* %4s */",
++ pulongest (TYPE_LENGTH (ftype)));
+ }
+
+ /* Print information about field at index FIELD_IDX of the struct type
+@@ -1507,8 +1508,8 @@ c_type_print_base_struct_union (struct t
+ print_spaces_filtered_with_print_options (level + 4,
+ stream,
+ flags);
+- fprintf_filtered (stream, "/* total size (bytes): %4u */\n",
+- TYPE_LENGTH (type));
++ fprintf_filtered (stream, "/* total size (bytes): %4s */\n",
++ pulongest (TYPE_LENGTH (type)));
+ }
+
+ print_spaces_filtered (OFFSET_SPC_LEN, stream);
+diff -Naurp insight-8.1.50.20180216.orig/gdb/c-valprint.c insight-8.1.50.20180216.new/gdb/c-valprint.c
+--- insight-8.1.50.20180216.orig/gdb/c-valprint.c 2018-02-18 01:05:32.114759963 +0100
++++ insight-8.1.50.20180216.new/gdb/c-valprint.c 2018-02-18 01:09:36.797116876 +0100
+@@ -247,7 +247,7 @@ c_val_print_array (struct type *type, co
+ if (TYPE_LENGTH (type) > 0 && TYPE_LENGTH (unresolved_elttype) > 0)
+ {
+ LONGEST low_bound, high_bound;
+- int eltlen, len;
++ LONGEST eltlen, len;
+ struct gdbarch *gdbarch = get_type_arch (type);
+ enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
+ unsigned int i = 0; /* Number of characters printed. */
+@@ -321,8 +321,8 @@ c_val_print_array (struct type *type, co
+ if (cp_is_vtbl_ptr_type (elttype))
+ {
+ i = 1;
+- fprintf_filtered (stream, _("%d vtable entries"),
+- len - 1);
++ fprintf_filtered (stream, _("%s vtable entries"),
++ plongest (len - 1));
+ }
+ else
+ {
+@@ -399,7 +399,7 @@ c_val_print_struct (struct type *type, c
+ -fvtable_thunks. (Otherwise, look under
+ TYPE_CODE_PTR.) */
+ struct gdbarch *gdbarch = get_type_arch (type);
+- int offset = (embedded_offset
++ LONGEST offset = (embedded_offset
+ + TYPE_FIELD_BITPOS (type,
+ VTBL_FNADDR_OFFSET) / 8);
+ struct type *field_type = TYPE_FIELD_TYPE (type, VTBL_FNADDR_OFFSET);
+@@ -498,7 +498,7 @@ c_val_print_memberptr (struct type *type
+
+ void
+ c_val_print (struct type *type,
+- int embedded_offset, CORE_ADDR address,
++ LONGEST embedded_offset, CORE_ADDR address,
+ struct ui_file *stream, int recurse,
+ struct value *original_value,
+ const struct value_print_options *options)
+diff -Naurp insight-8.1.50.20180216.orig/gdb/d-lang.h insight-8.1.50.20180216.new/gdb/d-lang.h
+--- insight-8.1.50.20180216.orig/gdb/d-lang.h 2018-01-04 17:43:15.000000000 +0100
++++ insight-8.1.50.20180216.new/gdb/d-lang.h 2018-02-18 01:09:36.798116886 +0100
+@@ -81,7 +81,7 @@ extern struct block_symbol d_lookup_nest
+ /* Defined in d-valprint.c */
+
+ extern void d_val_print (struct type *type,
+- int embedded_offset, CORE_ADDR address,
++ LONGEST embedded_offset, CORE_ADDR address,
+ struct ui_file *stream, int recurse,
+ struct value *val,
+ const struct value_print_options *options);
+diff -Naurp insight-8.1.50.20180216.orig/gdb/d-valprint.c insight-8.1.50.20180216.new/gdb/d-valprint.c
+--- insight-8.1.50.20180216.orig/gdb/d-valprint.c 2018-01-04 17:43:15.000000000 +0100
++++ insight-8.1.50.20180216.new/gdb/d-valprint.c 2018-02-18 01:09:36.798116886 +0100
+@@ -73,7 +73,7 @@ dynamic_array_type (struct type *type,
+
+ /* Implements the la_val_print routine for language D. */
+ void
+-d_val_print (struct type *type, int embedded_offset,
++d_val_print (struct type *type, LONGEST embedded_offset,
+ CORE_ADDR address, struct ui_file *stream, int recurse,
+ struct value *val,
+ const struct value_print_options *options)
+diff -Naurp insight-8.1.50.20180216.orig/gdb/dwarf2loc.c insight-8.1.50.20180216.new/gdb/dwarf2loc.c
+--- insight-8.1.50.20180216.orig/gdb/dwarf2loc.c 2018-02-18 01:05:32.125760069 +0100
++++ insight-8.1.50.20180216.new/gdb/dwarf2loc.c 2018-02-18 01:09:36.798116886 +0100
+@@ -1817,7 +1817,7 @@ rw_pieced_value (struct value *v, struct
+ for (; i < c->pieces.size () && offset < max_offset; i++)
+ {
+ struct dwarf_expr_piece *p = &c->pieces[i];
+- size_t this_size_bits, this_size;
++ ULONGEST this_size_bits, this_size;
+
+ this_size_bits = p->size - bits_to_skip;
+ if (this_size_bits > max_offset - offset)
+@@ -2064,7 +2064,7 @@ write_pieced_value (struct value *to, st
+
+ static int
+ check_pieced_synthetic_pointer (const struct value *value, LONGEST bit_offset,
+- int bit_length)
++ LONGEST bit_length)
+ {
+ struct piece_closure *c
+ = (struct piece_closure *) value_computed_closure (value);
+@@ -2077,7 +2077,7 @@ check_pieced_synthetic_pointer (const st
+ for (i = 0; i < c->pieces.size () && bit_length > 0; i++)
+ {
+ struct dwarf_expr_piece *p = &c->pieces[i];
+- size_t this_size_bits = p->size;
++ ULONGEST this_size_bits = p->size;
+
+ if (bit_offset > 0)
+ {
+@@ -2179,8 +2179,8 @@ indirect_pieced_value (struct value *val
+ = (struct piece_closure *) value_computed_closure (value);
+ struct type *type;
+ struct frame_info *frame;
+- int i, bit_length;
+- LONGEST bit_offset;
++ int i;
++ LONGEST bit_length, bit_offset;
+ struct dwarf_expr_piece *piece = NULL;
+ LONGEST byte_offset;
+ enum bfd_endian byte_order;
+@@ -2197,7 +2197,7 @@ indirect_pieced_value (struct value *val
+ for (i = 0; i < c->pieces.size () && bit_length > 0; i++)
+ {
+ struct dwarf_expr_piece *p = &c->pieces[i];
+- size_t this_size_bits = p->size;
++ ULONGEST this_size_bits = p->size;
+
+ if (bit_offset > 0)
+ {
+@@ -2486,9 +2486,9 @@ if (frame != NULL) select_frame (frame);
+ case DWARF_VALUE_STACK:
+ {
+ struct value *value = ctx.fetch (0);
+- size_t n = TYPE_LENGTH (value_type (value));
+- size_t len = TYPE_LENGTH (subobj_type);
+- size_t max = TYPE_LENGTH (type);
++ ULONGEST n = TYPE_LENGTH (value_type (value));
++ ULONGEST len = TYPE_LENGTH (subobj_type);
++ ULONGEST max = TYPE_LENGTH (type);
+ struct gdbarch *objfile_gdbarch = get_objfile_arch (objfile);
+
+ if (subobj_byte_offset + len > max)
+diff -Naurp insight-8.1.50.20180216.orig/gdb/dwarf2read.c insight-8.1.50.20180216.new/gdb/dwarf2read.c
+--- insight-8.1.50.20180216.orig/gdb/dwarf2read.c 2018-02-18 01:05:32.211760898 +0100
++++ insight-8.1.50.20180216.new/gdb/dwarf2read.c 2018-02-18 01:09:36.800116905 +0100
+@@ -2337,12 +2337,12 @@ dwarf2_complex_location_expr_complaint (
+ }
+
+ static void
+-dwarf2_const_value_length_mismatch_complaint (const char *arg1, int arg2,
+- int arg3)
++dwarf2_const_value_length_mismatch_complaint (const char *arg1, LONGEST arg2,
++ LONGEST arg3)
+ {
+ complaint (&symfile_complaints,
+- _("const value length mismatch for '%s', got %d, expected %d"),
+- arg1, arg2, arg3);
++ _("const value length mismatch for '%s', got %s, expected %s"),
++ arg1, plongest (arg2), plongest (arg3));
+ }
+
+ static void
+@@ -15191,8 +15191,8 @@ dwarf2_add_field (struct field_info *fip
+ object, and then subtract off the number of bits of
+ the field itself. The result is the bit offset of
+ the LSB of the field. */
+- int anonymous_size;
+- int bit_offset = DW_UNSND (attr);
++ LONGEST anonymous_size;
++ LONGEST bit_offset = DW_UNSND (attr);
+
+ attr = dwarf2_attr (die, DW_AT_byte_size, cu);
+ if (attr)
+diff -Naurp insight-8.1.50.20180216.orig/gdb/eval.c insight-8.1.50.20180216.new/gdb/eval.c
+--- insight-8.1.50.20180216.orig/gdb/eval.c 2018-02-18 01:05:32.108759905 +0100
++++ insight-8.1.50.20180216.new/gdb/eval.c 2018-02-18 01:09:36.801116914 +0100
+@@ -302,7 +302,8 @@ evaluate_struct_tuple (struct value *str
+ while (--nargs >= 0)
+ {
+ struct value *val = NULL;
+- int bitpos, bitsize;
++ LONGEST bitpos;
++ int bitsize;
+ bfd_byte *addr;
+
+ fieldno++;
+@@ -363,7 +364,7 @@ init_array_element (struct value *array,
+ enum noside noside, LONGEST low_bound, LONGEST high_bound)
+ {
+ LONGEST index;
+- int element_size = TYPE_LENGTH (value_type (element));
++ LONGEST element_size = TYPE_LENGTH (value_type (element));
+
+ if (exp->elts[*pos].opcode == BINOP_COMMA)
+ {
+@@ -807,11 +808,11 @@ binop_promote (const struct language_def
+ /* FIXME: Also mixed integral/booleans, with result an integer. */
+ {
+ const struct builtin_type *builtin = builtin_type (gdbarch);
+- unsigned int promoted_len1 = TYPE_LENGTH (type1);
+- unsigned int promoted_len2 = TYPE_LENGTH (type2);
++ ULONGEST promoted_len1 = TYPE_LENGTH (type1);
++ ULONGEST promoted_len2 = TYPE_LENGTH (type2);
+ int is_unsigned1 = TYPE_UNSIGNED (type1);
+ int is_unsigned2 = TYPE_UNSIGNED (type2);
+- unsigned int result_len;
++ ULONGEST result_len;
+ int unsigned_operation;
+
+ /* Determine type length and signedness after promotion for
+@@ -1548,7 +1549,7 @@ evaluate_subexp_standard (struct type *e
+ struct value **argvec;
+ int code;
+ int ix;
+- long mem_offset;
++ LONGEST mem_offset;
+ struct type **arg_types;
+
+ pc = (*pos)++;
+@@ -1731,7 +1732,7 @@ evaluate_subexp_standard (struct type *e
+ struct type *range_type = TYPE_INDEX_TYPE (type);
+ struct type *element_type = TYPE_TARGET_TYPE (type);
+ struct value *array = allocate_value (expect_type);
+- int element_size = TYPE_LENGTH (check_typedef (element_type));
++ LONGEST element_size = TYPE_LENGTH (check_typedef (element_type));
+ LONGEST low_bound, high_bound, index;
+
+ if (get_discrete_bounds (range_type, &low_bound, &high_bound) < 0)
+diff -Naurp insight-8.1.50.20180216.orig/gdb/findvar.c insight-8.1.50.20180216.new/gdb/findvar.c
+--- insight-8.1.50.20180216.orig/gdb/findvar.c 2018-01-04 17:43:15.000000000 +0100
++++ insight-8.1.50.20180216.new/gdb/findvar.c 2018-02-18 01:09:36.801116914 +0100
+@@ -821,7 +821,7 @@ struct value *
+ default_value_from_register (struct gdbarch *gdbarch, struct type *type,
+ int regnum, struct frame_id frame_id)
+ {
+- int len = TYPE_LENGTH (type);
++ LONGEST len = TYPE_LENGTH (type);
+ struct value *value = allocate_value (type);
+ struct frame_info *frame;
+
+@@ -865,7 +865,7 @@ read_frame_register_value (struct value
+ LONGEST offset = 0;
+ LONGEST reg_offset = value_offset (value);
+ int regnum = VALUE_REGNUM (value);
+- int len = type_length_units (check_typedef (value_type (value)));
++ LONGEST len = type_length_units (check_typedef (value_type (value)));
+
+ gdb_assert (VALUE_LVAL (value) == lval_register);
+
+@@ -880,7 +880,7 @@ read_frame_register_value (struct value
+ while (len > 0)
+ {
+ struct value *regval = get_frame_register_value (frame, regnum);
+- int reg_len = type_length_units (value_type (regval)) - reg_offset;
++ LONGEST reg_len = type_length_units (value_type (regval)) - reg_offset;
+
+ /* If the register length is larger than the number of bytes
+ remaining to copy, then only copy the appropriate bytes. */
+diff -Naurp insight-8.1.50.20180216.orig/gdb/f-lang.c insight-8.1.50.20180216.new/gdb/f-lang.c
+--- insight-8.1.50.20180216.orig/gdb/f-lang.c 2018-01-04 17:43:15.000000000 +0100
++++ insight-8.1.50.20180216.new/gdb/f-lang.c 2018-02-18 01:09:36.801116914 +0100
+@@ -101,7 +101,7 @@ f_printchar (int c, struct type *type, s
+
+ static void
+ f_printstr (struct ui_file *stream, struct type *type, const gdb_byte *string,
+- unsigned int length, const char *encoding, int force_ellipses,
++ ULONGEST length, const char *encoding, int force_ellipses,
+ const struct value_print_options *options)
+ {
+ const char *type_encoding = f_get_encoding (type);
+diff -Naurp insight-8.1.50.20180216.orig/gdb/f-lang.h insight-8.1.50.20180216.new/gdb/f-lang.h
+--- insight-8.1.50.20180216.orig/gdb/f-lang.h 2018-01-04 17:43:15.000000000 +0100
++++ insight-8.1.50.20180216.new/gdb/f-lang.h 2018-02-18 01:09:36.801116914 +0100
+@@ -30,7 +30,7 @@ extern void f_yyerror (const char *); /*
+ extern void f_print_type (struct type *, const char *, struct ui_file *, int,
+ int, const struct type_print_options *);
+
+-extern void f_val_print (struct type *, int, CORE_ADDR,
++extern void f_val_print (struct type *, LONGEST, CORE_ADDR,
+ struct ui_file *, int,
+ struct value *,
+ const struct value_print_options *);
+diff -Naurp insight-8.1.50.20180216.orig/gdb/frame.c insight-8.1.50.20180216.new/gdb/frame.c
+--- insight-8.1.50.20180216.orig/gdb/frame.c 2018-01-04 17:43:15.000000000 +0100
++++ insight-8.1.50.20180216.new/gdb/frame.c 2018-02-18 01:09:36.801116914 +0100
+@@ -1386,7 +1386,7 @@ deprecated_frame_register_read (struct f
+
+ int
+ get_frame_register_bytes (struct frame_info *frame, int regnum,
+- CORE_ADDR offset, int len, gdb_byte *myaddr,
++ CORE_ADDR offset, LONGEST len, gdb_byte *myaddr,
+ int *optimizedp, int *unavailablep)
+ {
+ struct gdbarch *gdbarch = get_frame_arch (frame);
+@@ -1415,7 +1415,7 @@ get_frame_register_bytes (struct frame_i
+ }
+ if (len > maxsize)
+ error (_("Bad debug information detected: "
+- "Attempt to read %d bytes from registers."), len);
++ "Attempt to read %s bytes from registers."), plongest (len));
+
+ /* Copy the data. */
+ while (len > 0)
+diff -Naurp insight-8.1.50.20180216.orig/gdb/frame.h insight-8.1.50.20180216.new/gdb/frame.h
+--- insight-8.1.50.20180216.orig/gdb/frame.h 2018-01-04 17:43:15.000000000 +0100
++++ insight-8.1.50.20180216.new/gdb/frame.h 2018-02-18 01:09:36.801116914 +0100
+@@ -601,7 +601,7 @@ extern void put_frame_register (struct f
+ contents are optimized out or unavailable, set *OPTIMIZEDP,
+ *UNAVAILABLEP accordingly. */
+ extern int get_frame_register_bytes (struct frame_info *frame, int regnum,
+- CORE_ADDR offset, int len,
++ CORE_ADDR offset, LONGEST len,
+ gdb_byte *myaddr,
+ int *optimizedp, int *unavailablep);
+
+diff -Naurp insight-8.1.50.20180216.orig/gdb/f-valprint.c insight-8.1.50.20180216.new/gdb/f-valprint.c
+--- insight-8.1.50.20180216.orig/gdb/f-valprint.c 2018-02-18 01:05:32.109759915 +0100
++++ insight-8.1.50.20180216.new/gdb/f-valprint.c 2018-02-18 01:09:36.801116914 +0100
+@@ -36,7 +36,7 @@
+
+ static void f77_get_dynamic_length_of_aggregate (struct type *);
+
+-int f77_array_offset_tbl[MAX_FORTRAN_DIMS + 1][2];
++LONGEST f77_array_offset_tbl[MAX_FORTRAN_DIMS + 1][2];
+
+ /* Array which holds offsets to be applied to get a row's elements
+ for a given array. Array also holds the size of each subarray. */
+@@ -71,8 +71,8 @@ f77_get_upperbound (struct type *type)
+ static void
+ f77_get_dynamic_length_of_aggregate (struct type *type)
+ {
+- int upper_bound = -1;
+- int lower_bound = 1;
++ LONGEST upper_bound = -1;
++ LONGEST lower_bound = 1;
+
+ /* Recursively go all the way down into a possibly multi-dimensional
+ F77 array and get the bounds. For simple arrays, this is pretty
+@@ -104,7 +104,7 @@ f77_get_dynamic_length_of_aggregate (str
+ static void
+ f77_print_array_1 (int nss, int ndimensions, struct type *type,
+ const gdb_byte *valaddr,
+- int embedded_offset, CORE_ADDR address,
++ LONGEST embedded_offset, CORE_ADDR address,
+ struct ui_file *stream, int recurse,
+ const struct value *val,
+ const struct value_print_options *options,
+@@ -113,7 +113,7 @@ f77_print_array_1 (int nss, int ndimensi
+ struct type *range_type = TYPE_INDEX_TYPE (check_typedef (type));
+ CORE_ADDR addr = address + embedded_offset;
+ LONGEST lowerbound, upperbound;
+- int i;
++ LONGEST i;
+
+ get_discrete_bounds (range_type, &lowerbound, &upperbound);
+
+@@ -175,7 +175,7 @@ f77_print_array_1 (int nss, int ndimensi
+
+ static void
+ f77_print_array (struct type *type, const gdb_byte *valaddr,
+- int embedded_offset,
++ LONGEST embedded_offset,
+ CORE_ADDR address, struct ui_file *stream,
+ int recurse,
+ const struct value *val,
+@@ -214,7 +214,7 @@ static const struct generic_val_print_de
+ function; they are identical. */
+
+ void
+-f_val_print (struct type *type, int embedded_offset,
++f_val_print (struct type *type, LONGEST embedded_offset,
+ CORE_ADDR address, struct ui_file *stream, int recurse,
+ struct value *original_value,
+ const struct value_print_options *options)
+diff -Naurp insight-8.1.50.20180216.orig/gdb/gdbarch.c insight-8.1.50.20180216.new/gdb/gdbarch.c
+--- insight-8.1.50.20180216.orig/gdb/gdbarch.c 2018-01-04 17:43:15.000000000 +0100
++++ insight-8.1.50.20180216.new/gdb/gdbarch.c 2018-02-18 01:09:36.802116924 +0100
+@@ -1811,7 +1811,7 @@ set_gdbarch_wchar_signed (struct gdbarch
+ }
+
+ const struct floatformat **
+-gdbarch_floatformat_for_type (struct gdbarch *gdbarch, const char *name, int length)
++gdbarch_floatformat_for_type (struct gdbarch *gdbarch, const char *name, LONGEST length)
+ {
+ gdb_assert (gdbarch != NULL);
+ gdb_assert (gdbarch->floatformat_for_type != NULL);
+diff -Naurp insight-8.1.50.20180216.orig/gdb/gdbarch.h insight-8.1.50.20180216.new/gdb/gdbarch.h
+--- insight-8.1.50.20180216.orig/gdb/gdbarch.h 2018-01-04 17:43:15.000000000 +0100
++++ insight-8.1.50.20180216.new/gdb/gdbarch.h 2018-02-18 01:09:36.802116924 +0100
+@@ -198,8 +198,8 @@ extern void set_gdbarch_wchar_signed (st
+ NAME, if non-NULL, is the type name, which may be used to distinguish
+ different target formats of the same length. */
+
+-typedef const struct floatformat ** (gdbarch_floatformat_for_type_ftype) (struct gdbarch *gdbarch, const char *name, int length);
+-extern const struct floatformat ** gdbarch_floatformat_for_type (struct gdbarch *gdbarch, const char *name, int length);
++typedef const struct floatformat ** (gdbarch_floatformat_for_type_ftype) (struct gdbarch *gdbarch, const char *name, LONGEST length);
++extern const struct floatformat ** gdbarch_floatformat_for_type (struct gdbarch *gdbarch, const char *name, LONGEST length);
+ extern void set_gdbarch_floatformat_for_type (struct gdbarch *gdbarch, gdbarch_floatformat_for_type_ftype *floatformat_for_type);
+
+ /* For most targets, a pointer on the target and its representation as an
+diff -Naurp insight-8.1.50.20180216.orig/gdb/gdbarch.sh insight-8.1.50.20180216.new/gdb/gdbarch.sh
+--- insight-8.1.50.20180216.orig/gdb/gdbarch.sh 2018-01-04 17:43:15.000000000 +0100
++++ insight-8.1.50.20180216.new/gdb/gdbarch.sh 2018-02-18 01:09:36.802116924 +0100
+@@ -388,7 +388,7 @@ v;int;wchar_signed;;;1;-1;1
+ # Returns the floating-point format to be used for values of length LENGTH.
+ # NAME, if non-NULL, is the type name, which may be used to distinguish
+ # different target formats of the same length.
+-m;const struct floatformat **;floatformat_for_type;const char *name, int length;name, length;0;default_floatformat_for_type;;0
++m;const struct floatformat **;floatformat_for_type;const char *name, LONGEST length;name, length;0;default_floatformat_for_type;;0
+
+ # For most targets, a pointer on the target and its representation as an
+ # address in GDB have the same size and "look the same". For such a
+diff -Naurp insight-8.1.50.20180216.orig/gdb/gdbtypes.c insight-8.1.50.20180216.new/gdb/gdbtypes.c
+--- insight-8.1.50.20180216.orig/gdb/gdbtypes.c 2018-02-18 01:05:32.120760021 +0100
++++ insight-8.1.50.20180216.new/gdb/gdbtypes.c 2018-02-18 01:09:36.803116933 +0100
+@@ -2925,7 +2925,7 @@ floatformat_from_type (const struct type
+ least as long as OBJFILE. */
+
+ struct type *
+-init_type (struct objfile *objfile, enum type_code code, int bit,
++init_type (struct objfile *objfile, enum type_code code, LONGEST bit,
+ const char *name)
+ {
+ struct type *type;
+@@ -3257,8 +3257,8 @@ is_public_ancestor (struct type *base, s
+
+ static int
+ is_unique_ancestor_worker (struct type *base, struct type *dclass,
+- int *offset,
+- const gdb_byte *valaddr, int embedded_offset,
++ LONGEST *offset,
++ const gdb_byte *valaddr, LONGEST embedded_offset,
+ CORE_ADDR address, struct value *val)
+ {
+ int i, count = 0;
+@@ -3269,7 +3269,7 @@ is_unique_ancestor_worker (struct type *
+ for (i = 0; i < TYPE_N_BASECLASSES (dclass) && count < 2; ++i)
+ {
+ struct type *iter;
+- int this_offset;
++ LONGEST this_offset;
+
+ iter = check_typedef (TYPE_BASECLASS (dclass, i));
+
+@@ -3310,7 +3310,7 @@ is_unique_ancestor_worker (struct type *
+ int
+ is_unique_ancestor (struct type *base, struct value *val)
+ {
+- int offset = -1;
++ LONGEST offset = -1;
+
+ return is_unique_ancestor_worker (base, value_type (val), &offset,
+ value_contents_for_printing (val),
+@@ -4555,7 +4555,7 @@ recursive_dump_type (struct type *type,
+ break;
+ }
+ puts_filtered ("\n");
+- printfi_filtered (spaces, "length %d\n", TYPE_LENGTH (type));
++ printfi_filtered (spaces, "length %s\n", pulongest (TYPE_LENGTH (type)));
+ if (TYPE_OBJFILE_OWNED (type))
+ {
+ printfi_filtered (spaces, "objfile ");
+@@ -4996,7 +4996,7 @@ copy_type (const struct type *type)
+
+ struct type *
+ arch_type (struct gdbarch *gdbarch,
+- enum type_code code, int bit, const char *name)
++ enum type_code code, LONGEST bit, const char *name)
+ {
+ struct type *type;
+
+diff -Naurp insight-8.1.50.20180216.orig/gdb/gdbtypes.h insight-8.1.50.20180216.new/gdb/gdbtypes.h
+--- insight-8.1.50.20180216.orig/gdb/gdbtypes.h 2018-02-18 01:05:32.183760628 +0100
++++ insight-8.1.50.20180216.new/gdb/gdbtypes.h 2018-02-18 01:09:36.803116933 +0100
+@@ -805,7 +805,7 @@ struct type
+ type_length_units function should be used in order to get the length
+ expressed in target addressable memory units. */
+
+- unsigned int length;
++ ULONGEST length;
+
+ /* * Core type, shared by a group of qualified types. */
+
+@@ -1707,7 +1707,7 @@ extern unsigned int type_length_units (s
+
+ /* * Helper function to construct objfile-owned types. */
+
+-extern struct type *init_type (struct objfile *, enum type_code, int,
++extern struct type *init_type (struct objfile *, enum type_code, LONGEST,
+ const char *);
+ extern struct type *init_integer_type (struct objfile *, int, int,
+ const char *);
+@@ -1724,7 +1724,7 @@ extern struct type *init_pointer_type (s
+ struct type *);
+
+ /* Helper functions to construct architecture-owned types. */
+-extern struct type *arch_type (struct gdbarch *, enum type_code, int,
++extern struct type *arch_type (struct gdbarch *, enum type_code, LONGEST,
+ const char *);
+ extern struct type *arch_integer_type (struct gdbarch *, int, int,
+ const char *);
+diff -Naurp insight-8.1.50.20180216.orig/gdb/gnu-v2-abi.c insight-8.1.50.20180216.new/gdb/gnu-v2-abi.c
+--- insight-8.1.50.20180216.orig/gdb/gnu-v2-abi.c 2018-01-04 17:43:15.000000000 +0100
++++ insight-8.1.50.20180216.new/gdb/gnu-v2-abi.c 2018-02-18 01:09:36.803116933 +0100
+@@ -82,7 +82,7 @@ gnuv2_is_operator_name (const char *name
+ TYPE is the type in which F is located. */
+ static struct value *
+ gnuv2_virtual_fn_field (struct value **arg1p, struct fn_field * f, int j,
+- struct type * type, int offset)
++ struct type *type, LONGEST offset)
+ {
+ struct value *arg1 = *arg1p;
+ struct type *type1 = check_typedef (value_type (arg1));
+@@ -338,7 +338,7 @@ vb_match (struct type *type, int index,
+ target). The result is the offset of the baseclass value relative
+ to (the address of)(ARG) + OFFSET. */
+
+-static int
++static LONGEST
+ gnuv2_baseclass_offset (struct type *type, int index,
+ const bfd_byte *valaddr, LONGEST embedded_offset,
+ CORE_ADDR address, const struct value *val)
+@@ -358,8 +358,7 @@ gnuv2_baseclass_offset (struct type *typ
+ if (vb_match (type, i, basetype))
+ {
+ struct type *field_type;
+- LONGEST field_offset;
+- int field_length;
++ LONGEST field_offset, field_length;
+ CORE_ADDR addr;
+
+ field_type = check_typedef (TYPE_FIELD_TYPE (type, i));
+@@ -383,7 +382,7 @@ gnuv2_baseclass_offset (struct type *typ
+ /* Don't go through baseclass_offset, as that wraps
+ exceptions, thus, inner exceptions would be wrapped more
+ than once. */
+- int boffset =
++ LONGEST boffset =
+ gnuv2_baseclass_offset (type, i, valaddr,
+ embedded_offset, address, val);
+
+diff -Naurp insight-8.1.50.20180216.orig/gdb/gnu-v3-abi.c insight-8.1.50.20180216.new/gdb/gnu-v3-abi.c
+--- insight-8.1.50.20180216.orig/gdb/gnu-v3-abi.c 2018-01-04 17:43:15.000000000 +0100
++++ insight-8.1.50.20180216.new/gdb/gnu-v3-abi.c 2018-02-18 01:09:36.803116933 +0100
+@@ -109,7 +109,7 @@ build_gdb_vtable_type (struct gdbarch *a
+ {
+ struct type *t;
+ struct field *field_list, *field;
+- int offset;
++ LONGEST offset;
+
+ struct type *void_ptr_type
+ = builtin_type (arch)->builtin_data_ptr;
+@@ -185,7 +185,7 @@ vtable_ptrdiff_type (struct gdbarch *gdb
+ /* Return the offset from the start of the imaginary `struct
+ gdb_gnu_v3_abi_vtable' object to the vtable's "address point"
+ (i.e., where objects' virtual table pointers point). */
+-static int
++static LONGEST
+ vtable_address_point_offset (struct gdbarch *gdbarch)
+ {
+ struct type *vtable_type
+@@ -408,7 +408,7 @@ gnuv3_get_virtual_fn (struct gdbarch *gd
+ static struct value *
+ gnuv3_virtual_fn_field (struct value **value_p,
+ struct fn_field *f, int j,
+- struct type *vfn_base, int offset)
++ struct type *vfn_base, LONGEST offset)
+ {
+ struct type *values_type = check_typedef (value_type (*value_p));
+ struct gdbarch *gdbarch;
+@@ -438,7 +438,7 @@ gnuv3_virtual_fn_field (struct value **v
+
+ -1 is returned on error. */
+
+-static int
++static LONGEST
+ gnuv3_baseclass_offset (struct type *type, int index,
+ const bfd_byte *valaddr, LONGEST embedded_offset,
+ CORE_ADDR address, const struct value *val)
+@@ -447,7 +447,7 @@ gnuv3_baseclass_offset (struct type *typ
+ struct type *ptr_type;
+ struct value *vtable;
+ struct value *vbase_array;
+- long int cur_base_offset, base_offset;
++ LONGEST cur_base_offset, base_offset;
+
+ /* Determine architecture. */
+ gdbarch = get_type_arch (type);
+@@ -470,7 +470,7 @@ gnuv3_baseclass_offset (struct type *typ
+ cur_base_offset = cur_base_offset + vtable_address_point_offset (gdbarch);
+ if ((- cur_base_offset) % TYPE_LENGTH (ptr_type) != 0)
+ error (_("Misaligned vbase offset."));
+- cur_base_offset = cur_base_offset / ((int) TYPE_LENGTH (ptr_type));
++ cur_base_offset = cur_base_offset / ((LONGEST) TYPE_LENGTH (ptr_type));
+
+ vtable = gnuv3_get_vtable (gdbarch, type, address + embedded_offset);
+ gdb_assert (vtable != NULL);
+@@ -514,7 +514,7 @@ gnuv3_find_method_in (struct type *domai
+ we're out of luck. */
+ for (i = 0; i < TYPE_N_BASECLASSES (domain); i++)
+ {
+- int pos;
++ LONGEST pos;
+ struct type *basetype;
+
+ if (BASETYPE_VIA_VIRTUAL (domain, i))
+diff -Naurp insight-8.1.50.20180216.orig/gdb/go-lang.h insight-8.1.50.20180216.new/gdb/go-lang.h
+--- insight-8.1.50.20180216.orig/gdb/go-lang.h 2018-01-04 17:43:15.000000000 +0100
++++ insight-8.1.50.20180216.new/gdb/go-lang.h 2018-02-18 01:09:36.803116933 +0100
+@@ -85,7 +85,7 @@ extern void go_print_type (struct type *
+ /* Defined in go-valprint.c. */
+
+ extern void go_val_print (struct type *type,
+- int embedded_offset, CORE_ADDR address,
++ LONGEST embedded_offset, CORE_ADDR address,
+ struct ui_file *stream, int recurse,
+ struct value *val,
+ const struct value_print_options *options);
+diff -Naurp insight-8.1.50.20180216.orig/gdb/go-valprint.c insight-8.1.50.20180216.new/gdb/go-valprint.c
+--- insight-8.1.50.20180216.orig/gdb/go-valprint.c 2018-01-04 17:43:15.000000000 +0100
++++ insight-8.1.50.20180216.new/gdb/go-valprint.c 2018-02-18 01:09:36.803116933 +0100
+@@ -86,7 +86,7 @@ print_go_string (struct type *type,
+ /* Implements the la_val_print routine for language Go. */
+
+ void
+-go_val_print (struct type *type, int embedded_offset,
++go_val_print (struct type *type, LONGEST embedded_offset,
+ CORE_ADDR address, struct ui_file *stream, int recurse,
+ struct value *val,
+ const struct value_print_options *options)
+diff -Naurp insight-8.1.50.20180216.orig/gdb/i386-tdep.c insight-8.1.50.20180216.new/gdb/i386-tdep.c
+--- insight-8.1.50.20180216.orig/gdb/i386-tdep.c 2018-02-18 01:05:32.134760156 +0100
++++ insight-8.1.50.20180216.new/gdb/i386-tdep.c 2018-02-18 01:09:36.804116943 +0100
+@@ -8163,7 +8163,7 @@ i386_fast_tracepoint_valid_at (struct gd
+
+ const struct floatformat **
+ i386_floatformat_for_type (struct gdbarch *gdbarch,
+- const char *name, int len)
++ const char *name, LONGEST len)
+ {
+ if (len == 128 && name)
+ if (strcmp (name, "__float128") == 0
+diff -Naurp insight-8.1.50.20180216.orig/gdb/language.c insight-8.1.50.20180216.new/gdb/language.c
+--- insight-8.1.50.20180216.orig/gdb/language.c 2018-01-12 03:18:43.000000000 +0100
++++ insight-8.1.50.20180216.new/gdb/language.c 2018-02-18 01:09:36.804116943 +0100
+@@ -773,7 +773,7 @@ unk_lang_printchar (int c, struct type *
+
+ static void
+ unk_lang_printstr (struct ui_file *stream, struct type *type,
+- const gdb_byte *string, unsigned int length,
++ const gdb_byte *string, ULONGEST length,
+ const char *encoding, int force_ellipses,
+ const struct value_print_options *options)
+ {
+@@ -792,7 +792,7 @@ unk_lang_print_type (struct type *type,
+
+ static void
+ unk_lang_val_print (struct type *type,
+- int embedded_offset, CORE_ADDR address,
++ LONGEST embedded_offset, CORE_ADDR address,
+ struct ui_file *stream, int recurse,
+ struct value *val,
+ const struct value_print_options *options)
+diff -Naurp insight-8.1.50.20180216.orig/gdb/language.h insight-8.1.50.20180216.new/gdb/language.h
+--- insight-8.1.50.20180216.orig/gdb/language.h 2018-01-12 03:18:43.000000000 +0100
++++ insight-8.1.50.20180216.new/gdb/language.h 2018-02-18 01:09:36.804116943 +0100
+@@ -188,7 +188,7 @@ struct language_defn
+ struct ui_file * stream);
+
+ void (*la_printstr) (struct ui_file * stream, struct type *elttype,
+- const gdb_byte *string, unsigned int length,
++ const gdb_byte *string, ULONGEST length,
+ const char *encoding, int force_ellipses,
+ const struct value_print_options *);
+
+@@ -226,7 +226,7 @@ struct language_defn
+ printing. */
+
+ void (*la_val_print) (struct type *type,
+- int embedded_offset, CORE_ADDR address,
++ LONGEST embedded_offset, CORE_ADDR address,
+ struct ui_file *stream, int recurse,
+ struct value *val,
+ const struct value_print_options *options);
+diff -Naurp insight-8.1.50.20180216.orig/gdb/m2-lang.c insight-8.1.50.20180216.new/gdb/m2-lang.c
+--- insight-8.1.50.20180216.orig/gdb/m2-lang.c 2018-01-04 17:43:15.000000000 +0100
++++ insight-8.1.50.20180216.new/gdb/m2-lang.c 2018-02-18 01:09:36.804116943 +0100
+@@ -103,10 +103,10 @@ m2_printchar (int c, struct type *type,
+
+ static void
+ m2_printstr (struct ui_file *stream, struct type *type, const gdb_byte *string,
+- unsigned int length, const char *encoding, int force_ellipses,
++ ULONGEST length, const char *encoding, int force_ellipses,
+ const struct value_print_options *options)
+ {
+- unsigned int i;
++ ULONGEST i;
+ unsigned int things_printed = 0;
+ int in_quotes = 0;
+ int need_comma = 0;
+@@ -121,9 +121,9 @@ m2_printstr (struct ui_file *stream, str
+ {
+ /* Position of the character we are examining
+ to see whether it is repeated. */
+- unsigned int rep1;
++ ULONGEST rep1;
+ /* Number of repetitions we have detected so far. */
+- unsigned int reps;
++ ULONGEST reps;
+
+ QUIT;
+
+@@ -149,7 +149,7 @@ m2_printstr (struct ui_file *stream, str
+ in_quotes = 0;
+ }
+ m2_printchar (string[i], type, stream);
+- fprintf_filtered (stream, " <repeats %u times>", reps);
++ fprintf_filtered (stream, " <repeats %s times>", pulongest (reps));
+ i = rep1 - 1;
+ things_printed += options->repeat_count_threshold;
+ need_comma = 1;
+diff -Naurp insight-8.1.50.20180216.orig/gdb/m2-lang.h insight-8.1.50.20180216.new/gdb/m2-lang.h
+--- insight-8.1.50.20180216.orig/gdb/m2-lang.h 2018-01-04 17:43:15.000000000 +0100
++++ insight-8.1.50.20180216.new/gdb/m2-lang.h 2018-02-18 01:09:36.804116943 +0100
+@@ -34,7 +34,7 @@ extern void m2_print_typedef (struct typ
+ extern int m2_is_long_set (struct type *type);
+ extern int m2_is_unbounded_array (struct type *type);
+
+-extern void m2_val_print (struct type *, int, CORE_ADDR,
++extern void m2_val_print (struct type *, LONGEST, CORE_ADDR,
+ struct ui_file *, int,
+ struct value *,
+ const struct value_print_options *);
+diff -Naurp insight-8.1.50.20180216.orig/gdb/m2-typeprint.c insight-8.1.50.20180216.new/gdb/m2-typeprint.c
+--- insight-8.1.50.20180216.orig/gdb/m2-typeprint.c 2018-01-04 17:43:15.000000000 +0100
++++ insight-8.1.50.20180216.new/gdb/m2-typeprint.c 2018-02-18 01:09:36.804116943 +0100
+@@ -234,9 +234,12 @@ static void m2_array (struct type *type,
+ m2_print_bounds (TYPE_INDEX_TYPE (type), stream, show, -1, 1);
+ }
+ else
+- fprintf_filtered (stream, "%d",
+- (TYPE_LENGTH (type)
+- / TYPE_LENGTH (TYPE_TARGET_TYPE (type))));
++ {
++ ULONGEST val = (TYPE_LENGTH (type)
++ / TYPE_LENGTH (TYPE_TARGET_TYPE (type)));
++
++ fprintf_filtered (stream, "%s", pulongest (val));
++ }
+ }
+ fprintf_filtered (stream, "] OF ");
+ m2_print_type (TYPE_TARGET_TYPE (type), "", stream, show, level, flags);
+diff -Naurp insight-8.1.50.20180216.orig/gdb/m2-valprint.c insight-8.1.50.20180216.new/gdb/m2-valprint.c
+--- insight-8.1.50.20180216.orig/gdb/m2-valprint.c 2018-01-04 17:43:15.000000000 +0100
++++ insight-8.1.50.20180216.new/gdb/m2-valprint.c 2018-02-18 01:09:36.804116943 +0100
+@@ -35,7 +35,7 @@ static int print_unpacked_pointer (struc
+ struct ui_file *stream);
+ static void
+ m2_print_array_contents (struct type *type, const gdb_byte *valaddr,
+- int embedded_offset, CORE_ADDR address,
++ LONGEST embedded_offset, CORE_ADDR address,
+ struct ui_file *stream, int recurse,
+ struct value *val,
+ const struct value_print_options *options,
+@@ -67,7 +67,7 @@ get_long_set_bounds (struct type *type,
+
+ static void
+ m2_print_long_set (struct type *type, const gdb_byte *valaddr,
+- int embedded_offset, CORE_ADDR address,
++ LONGEST embedded_offset, CORE_ADDR address,
+ struct ui_file *stream)
+ {
+ int empty_set = 1;
+@@ -158,7 +158,7 @@ m2_print_long_set (struct type *type, co
+
+ static void
+ m2_print_unbounded_array (struct type *type, const gdb_byte *valaddr,
+- int embedded_offset, CORE_ADDR address,
++ LONGEST embedded_offset, CORE_ADDR address,
+ struct ui_file *stream, int recurse,
+ const struct value_print_options *options)
+ {
+@@ -260,7 +260,7 @@ print_variable_at_address (struct type *
+
+ static void
+ m2_print_array_contents (struct type *type, const gdb_byte *valaddr,
+- int embedded_offset, CORE_ADDR address,
++ LONGEST embedded_offset, CORE_ADDR address,
+ struct ui_file *stream, int recurse,
+ struct value *val,
+ const struct value_print_options *options,
+@@ -308,12 +308,12 @@ static const struct generic_val_print_de
+ function; they are identical. */
+
+ void
+-m2_val_print (struct type *type, int embedded_offset,
++m2_val_print (struct type *type, LONGEST embedded_offset,
+ CORE_ADDR address, struct ui_file *stream, int recurse,
+ struct value *original_value,
+ const struct value_print_options *options)
+ {
+- unsigned len;
++ ULONGEST len;
+ struct type *elttype;
+ CORE_ADDR addr;
+ const gdb_byte *valaddr = value_contents_for_printing (original_value);
+@@ -339,7 +339,7 @@ m2_val_print (struct type *type, int emb
+ elements up to it. */
+ if (options->stop_print_at_null)
+ {
+- unsigned int temp_len;
++ ULONGEST temp_len;
+
+ /* Look for a NULL char. */
+ for (temp_len = 0;
+@@ -415,7 +415,7 @@ m2_val_print (struct type *type, int emb
+ {
+ struct type *range = elttype;
+ LONGEST low_bound, high_bound;
+- int i;
++ LONGEST i;
+ int need_comma = 0;
+
+ fputs_filtered ("{", stream);
+diff -Naurp insight-8.1.50.20180216.orig/gdb/memrange.c insight-8.1.50.20180216.new/gdb/memrange.c
+--- insight-8.1.50.20180216.orig/gdb/memrange.c 2018-01-04 17:43:15.000000000 +0100
++++ insight-8.1.50.20180216.new/gdb/memrange.c 2018-02-18 01:09:36.804116943 +0100
+@@ -22,8 +22,8 @@
+ #include <algorithm>
+
+ int
+-mem_ranges_overlap (CORE_ADDR start1, int len1,
+- CORE_ADDR start2, int len2)
++mem_ranges_overlap (CORE_ADDR start1, LONGEST len1,
++ CORE_ADDR start2, LONGEST len2)
+ {
+ ULONGEST h, l;
+
+diff -Naurp insight-8.1.50.20180216.orig/gdb/memrange.h insight-8.1.50.20180216.new/gdb/memrange.h
+--- insight-8.1.50.20180216.orig/gdb/memrange.h 2018-01-04 17:43:15.000000000 +0100
++++ insight-8.1.50.20180216.new/gdb/memrange.h 2018-02-18 01:09:36.804116943 +0100
+@@ -28,7 +28,7 @@ struct mem_range
+ {
+ mem_range () = default;
+
+- mem_range (CORE_ADDR start_, int length_)
++ mem_range (CORE_ADDR start_, LONGEST length_)
+ : start (start_), length (length_)
+ {}
+
+@@ -47,14 +47,14 @@ struct mem_range
+ CORE_ADDR start;
+
+ /* Length of the range. */
+- int length;
++ LONGEST length;
+ };
+
+ /* Returns true if the ranges defined by [start1, start1+len1) and
+ [start2, start2+len2) overlap. */
+
+-extern int mem_ranges_overlap (CORE_ADDR start1, int len1,
+- CORE_ADDR start2, int len2);
++extern int mem_ranges_overlap (CORE_ADDR start1, LONGEST len1,
++ CORE_ADDR start2, LONGEST len2);
+
+ /* Returns true if ADDR is in RANGE. */
+
+diff -Naurp insight-8.1.50.20180216.orig/gdb/mips-linux-nat.c insight-8.1.50.20180216.new/gdb/mips-linux-nat.c
+--- insight-8.1.50.20180216.orig/gdb/mips-linux-nat.c 2018-01-04 17:43:15.000000000 +0100
++++ insight-8.1.50.20180216.new/gdb/mips-linux-nat.c 2018-02-18 01:09:36.804116943 +0100
+@@ -579,7 +579,7 @@ mips_linux_stopped_data_address (struct
+
+ static int
+ mips_linux_region_ok_for_hw_watchpoint (struct target_ops *self,
+- CORE_ADDR addr, int len)
++ CORE_ADDR addr, LONGEST len)
+ {
+ struct pt_watch_regs dummy_regs;
+ int i;
+diff -Naurp insight-8.1.50.20180216.orig/gdb/nat/x86-dregs.c insight-8.1.50.20180216.new/gdb/nat/x86-dregs.c
+--- insight-8.1.50.20180216.orig/gdb/nat/x86-dregs.c 2018-01-04 17:43:15.000000000 +0100
++++ insight-8.1.50.20180216.new/gdb/nat/x86-dregs.c 2018-02-18 01:09:36.804116943 +0100
+@@ -380,7 +380,7 @@ x86_remove_aligned_watchpoint (struct x8
+
+ static int
+ x86_handle_nonaligned_watchpoint (struct x86_debug_reg_state *state,
+- x86_wp_op_t what, CORE_ADDR addr, int len,
++ x86_wp_op_t what, CORE_ADDR addr, LONGEST len,
+ enum target_hw_bp_type type)
+ {
+ int retval = 0;
+@@ -548,7 +548,7 @@ x86_dr_remove_watchpoint (struct x86_deb
+
+ int
+ x86_dr_region_ok_for_watchpoint (struct x86_debug_reg_state *state,
+- CORE_ADDR addr, int len)
++ CORE_ADDR addr, LONGEST len)
+ {
+ int nregs;
+
+diff -Naurp insight-8.1.50.20180216.orig/gdb/nat/x86-dregs.h insight-8.1.50.20180216.new/gdb/nat/x86-dregs.h
+--- insight-8.1.50.20180216.orig/gdb/nat/x86-dregs.h 2018-01-04 17:43:15.000000000 +0100
++++ insight-8.1.50.20180216.new/gdb/nat/x86-dregs.h 2018-02-18 01:09:36.805116952 +0100
+@@ -116,7 +116,7 @@ extern int x86_dr_remove_watchpoint (str
+ /* Return non-zero if we can watch a memory region that starts at
+ address ADDR and whose length is LEN bytes. */
+ extern int x86_dr_region_ok_for_watchpoint (struct x86_debug_reg_state *state,
+- CORE_ADDR addr, int len);
++ CORE_ADDR addr, LONGEST len);
+
+ /* If the inferior has some break/watchpoint that triggered, set the
+ address associated with that break/watchpoint and return true.
+diff -Naurp insight-8.1.50.20180216.orig/gdb/opencl-lang.c insight-8.1.50.20180216.new/gdb/opencl-lang.c
+--- insight-8.1.50.20180216.orig/gdb/opencl-lang.c 2018-01-04 17:43:15.000000000 +0100
++++ insight-8.1.50.20180216.new/gdb/opencl-lang.c 2018-02-18 01:09:36.805116952 +0100
+@@ -76,11 +76,11 @@ builtin_opencl_type (struct gdbarch *gdb
+
+ static struct type *
+ lookup_opencl_vector_type (struct gdbarch *gdbarch, enum type_code code,
+- unsigned int el_length, unsigned int flag_unsigned,
++ ULONGEST el_length, unsigned int flag_unsigned,
+ int n)
+ {
+ int i;
+- unsigned int length;
++ ULONGEST length;
+ struct type *type = NULL;
+ struct type **types = builtin_opencl_type (gdbarch);
+
+@@ -172,7 +172,7 @@ lval_func_read (struct value *v)
+ struct type *eltype = TYPE_TARGET_TYPE (check_typedef (value_type (c->val)));
+ LONGEST offset = value_offset (v);
+ LONGEST elsize = TYPE_LENGTH (eltype);
+- int n, i, j = 0;
++ LONGEST n, i, j = 0;
+ LONGEST lowb = 0;
+ LONGEST highb = 0;
+
+@@ -201,7 +201,7 @@ lval_func_write (struct value *v, struct
+ struct type *eltype = TYPE_TARGET_TYPE (check_typedef (value_type (c->val)));
+ LONGEST offset = value_offset (v);
+ LONGEST elsize = TYPE_LENGTH (eltype);
+- int n, i, j = 0;
++ LONGEST n, i, j = 0;
+ LONGEST lowb = 0;
+ LONGEST highb = 0;
+
+@@ -241,17 +241,17 @@ lval_func_write (struct value *v, struct
+
+ static int
+ lval_func_check_synthetic_pointer (const struct value *v,
+- LONGEST offset, int length)
++ LONGEST offset, LONGEST length)
+ {
+ struct lval_closure *c = (struct lval_closure *) value_computed_closure (v);
+ /* Size of the target type in bits. */
+- int elsize =
++ LONGEST elsize =
+ TYPE_LENGTH (TYPE_TARGET_TYPE (check_typedef (value_type (c->val)))) * 8;
+- int startrest = offset % elsize;
+- int start = offset / elsize;
+- int endrest = (offset + length) % elsize;
+- int end = (offset + length) / elsize;
+- int i;
++ LONGEST startrest = offset % elsize;
++ LONGEST start = offset / elsize;
++ LONGEST endrest = (offset + length) % elsize;
++ LONGEST end = (offset + length) / elsize;
++ LONGEST i;
+
+ if (endrest)
+ end++;
+@@ -261,8 +261,8 @@ lval_func_check_synthetic_pointer (const
+
+ for (i = start; i < end; i++)
+ {
+- int comp_offset = (i == start) ? startrest : 0;
+- int comp_length = (i == end) ? endrest : elsize;
++ LONGEST comp_offset = (i == start) ? startrest : 0;
++ LONGEST comp_length = (i == end) ? endrest : elsize;
+
+ if (!value_bits_synthetic_pointer (c->val,
+ c->indices[i] * elsize + comp_offset,
+diff -Naurp insight-8.1.50.20180216.orig/gdb/p-lang.c insight-8.1.50.20180216.new/gdb/p-lang.c
+--- insight-8.1.50.20180216.orig/gdb/p-lang.c 2018-01-04 17:43:15.000000000 +0100
++++ insight-8.1.50.20180216.new/gdb/p-lang.c 2018-02-18 01:09:36.805116952 +0100
+@@ -93,8 +93,8 @@ pascal_main_name (void)
+ are not multiple of TARGET_CHAR_BIT then the results are wrong
+ but this does not happen for Free Pascal nor for GPC. */
+ int
+-is_pascal_string_type (struct type *type,int *length_pos,
+- int *length_size, int *string_pos,
++is_pascal_string_type (struct type *type, LONGEST *length_pos,
++ LONGEST *length_size, LONGEST *string_pos,
+ struct type **char_type,
+ const char **arrayname)
+ {
+@@ -214,12 +214,12 @@ pascal_printchar (int c, struct type *ty
+
+ void
+ pascal_printstr (struct ui_file *stream, struct type *type,
+- const gdb_byte *string, unsigned int length,
++ const gdb_byte *string, ULONGEST length,
+ const char *encoding, int force_ellipses,
+ const struct value_print_options *options)
+ {
+ enum bfd_endian byte_order = gdbarch_byte_order (get_type_arch (type));
+- unsigned int i;
++ ULONGEST i;
+ unsigned int things_printed = 0;
+ int in_quotes = 0;
+ int need_comma = 0;
+@@ -247,9 +247,9 @@ pascal_printstr (struct ui_file *stream,
+ {
+ /* Position of the character we are examining
+ to see whether it is repeated. */
+- unsigned int rep1;
++ ULONGEST rep1;
+ /* Number of repetitions we have detected so far. */
+- unsigned int reps;
++ ULONGEST reps;
+ unsigned long int current_char;
+
+ QUIT;
+@@ -281,7 +281,7 @@ pascal_printstr (struct ui_file *stream,
+ in_quotes = 0;
+ }
+ pascal_printchar (current_char, type, stream);
+- fprintf_filtered (stream, " <repeats %u times>", reps);
++ fprintf_filtered (stream, " <repeats %s times>", pulongest (reps));
+ i = rep1 - 1;
+ things_printed += options->repeat_count_threshold;
+ need_comma = 1;
+diff -Naurp insight-8.1.50.20180216.orig/gdb/p-lang.h insight-8.1.50.20180216.new/gdb/p-lang.h
+--- insight-8.1.50.20180216.orig/gdb/p-lang.h 2018-01-04 17:43:15.000000000 +0100
++++ insight-8.1.50.20180216.new/gdb/p-lang.h 2018-02-18 01:09:36.805116952 +0100
+@@ -36,7 +36,7 @@ extern void pascal_print_type (struct ty
+ extern void pascal_print_typedef (struct type *, struct symbol *,
+ struct ui_file *);
+
+-extern void pascal_val_print (struct type *, int,
++extern void pascal_val_print (struct type *, LONGEST,
+ CORE_ADDR, struct ui_file *, int,
+ struct value *,
+ const struct value_print_options *);
+@@ -50,13 +50,13 @@ extern void pascal_type_print_method_arg
+ /* These are in p-lang.c: */
+
+ extern int
+- is_pascal_string_type (struct type *, int *, int *, int *,
++ is_pascal_string_type (struct type *, LONGEST *, LONGEST *, LONGEST *,
+ struct type **, const char **);
+
+ extern void pascal_printchar (int, struct type *, struct ui_file *);
+
+ extern void pascal_printstr (struct ui_file *, struct type *, const gdb_byte *,
+- unsigned int, const char *, int,
++ ULONGEST, const char *, int,
+ const struct value_print_options *);
+
+ extern struct type **const pascal_builtin_types[];
+diff -Naurp insight-8.1.50.20180216.orig/gdb/ppc-linux-nat.c insight-8.1.50.20180216.new/gdb/ppc-linux-nat.c
+--- insight-8.1.50.20180216.orig/gdb/ppc-linux-nat.c 2018-01-04 17:43:15.000000000 +0100
++++ insight-8.1.50.20180216.new/gdb/ppc-linux-nat.c 2018-02-18 01:09:36.805116952 +0100
+@@ -1445,7 +1445,7 @@ ppc_linux_can_use_hw_breakpoint (struct
+
+ static int
+ ppc_linux_region_ok_for_hw_watchpoint (struct target_ops *self,
+- CORE_ADDR addr, int len)
++ CORE_ADDR addr, LONGEST len)
+ {
+ /* Handle sub-8-byte quantities. */
+ if (len <= 0)
+diff -Naurp insight-8.1.50.20180216.orig/gdb/ppc-linux-tdep.c insight-8.1.50.20180216.new/gdb/ppc-linux-tdep.c
+--- insight-8.1.50.20180216.orig/gdb/ppc-linux-tdep.c 2018-01-26 13:46:47.000000000 +0100
++++ insight-8.1.50.20180216.new/gdb/ppc-linux-tdep.c 2018-02-18 01:09:36.805116952 +0100
+@@ -1637,7 +1637,7 @@ ppc_init_linux_record_tdep (struct linux
+
+ const struct floatformat **
+ ppc_floatformat_for_type (struct gdbarch *gdbarch,
+- const char *name, int len)
++ const char *name, LONGEST len)
+ {
+ if (len == 128 && name)
+ {
+diff -Naurp insight-8.1.50.20180216.orig/gdb/printcmd.c insight-8.1.50.20180216.new/gdb/printcmd.c
+--- insight-8.1.50.20180216.orig/gdb/printcmd.c 2018-02-18 01:05:32.132760137 +0100
++++ insight-8.1.50.20180216.new/gdb/printcmd.c 2018-02-18 01:09:36.805116952 +0100
+@@ -277,7 +277,7 @@ print_formatted (struct value *val, int
+ struct ui_file *stream)
+ {
+ struct type *type = check_typedef (value_type (val));
+- int len = TYPE_LENGTH (type);
++ LONGEST len = TYPE_LENGTH (type);
+
+ if (VALUE_LVAL (val) == lval_memory)
+ next_address = value_address (val) + len;
+@@ -353,7 +353,7 @@ print_scalar_formatted (const gdb_byte *
+ int size, struct ui_file *stream)
+ {
+ struct gdbarch *gdbarch = get_type_arch (type);
+- unsigned int len = TYPE_LENGTH (type);
++ ULONGEST len = TYPE_LENGTH (type);
+ enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
+
+ /* String printing should go through val_print_scalar_formatted. */
+diff -Naurp insight-8.1.50.20180216.orig/gdb/procfs.c insight-8.1.50.20180216.new/gdb/procfs.c
+--- insight-8.1.50.20180216.orig/gdb/procfs.c 2018-02-02 13:28:13.000000000 +0100
++++ insight-8.1.50.20180216.new/gdb/procfs.c 2018-02-18 01:09:36.806116962 +0100
+@@ -3380,7 +3380,7 @@ procfs_remove_watchpoint (struct target_
+
+ static int
+ procfs_region_ok_for_hw_watchpoint (struct target_ops *self,
+- CORE_ADDR addr, int len)
++ CORE_ADDR addr, LONGEST len)
+ {
+ /* The man page for proc(4) on Solaris 2.6 and up says that the
+ system can support "thousands" of hardware watchpoints, but gives
+diff -Naurp insight-8.1.50.20180216.orig/gdb/p-valprint.c insight-8.1.50.20180216.new/gdb/p-valprint.c
+--- insight-8.1.50.20180216.orig/gdb/p-valprint.c 2018-01-12 03:18:43.000000000 +0100
++++ insight-8.1.50.20180216.new/gdb/p-valprint.c 2018-02-18 01:09:36.805116952 +0100
+@@ -60,7 +60,7 @@ static const struct generic_val_print_de
+
+ void
+ pascal_val_print (struct type *type,
+- int embedded_offset, CORE_ADDR address,
++ LONGEST embedded_offset, CORE_ADDR address,
+ struct ui_file *stream, int recurse,
+ struct value *original_value,
+ const struct value_print_options *options)
+@@ -71,8 +71,8 @@ pascal_val_print (struct type *type,
+ unsigned len;
+ LONGEST low_bound, high_bound;
+ struct type *elttype;
+- unsigned eltlen;
+- int length_pos, length_size, string_pos;
++ ULONGEST eltlen;
++ LONGEST length_pos, length_size, string_pos;
+ struct type *char_type;
+ CORE_ADDR addr;
+ int want_space = 0;
+diff -Naurp insight-8.1.50.20180216.orig/gdb/regcache.c insight-8.1.50.20180216.new/gdb/regcache.c
+--- insight-8.1.50.20180216.orig/gdb/regcache.c 2018-01-26 13:46:47.000000000 +0100
++++ insight-8.1.50.20180216.new/gdb/regcache.c 2018-02-18 01:09:36.806116962 +0100
+@@ -897,7 +897,7 @@ typedef void (regcache_write_ftype) (str
+ const void *buf);
+
+ enum register_status
+-regcache::xfer_part (int regnum, int offset, int len, void *in,
++regcache::xfer_part (int regnum, LONGEST offset, LONGEST len, void *in,
+ const void *out, bool is_raw)
+ {
+ struct gdbarch *gdbarch = arch ();
+@@ -941,13 +941,13 @@ regcache::xfer_part (int regnum, int off
+
+ enum register_status
+ regcache_raw_read_part (struct regcache *regcache, int regnum,
+- int offset, int len, gdb_byte *buf)
++ int offset, LONGEST len, gdb_byte *buf)
+ {
+ return regcache->raw_read_part (regnum, offset, len, buf);
+ }
+
+ enum register_status
+-regcache::raw_read_part (int regnum, int offset, int len, gdb_byte *buf)
++regcache::raw_read_part (int regnum, int offset, LONGEST len, gdb_byte *buf)
+ {
+ assert_regnum (regnum);
+ return xfer_part (regnum, offset, len, buf, NULL, true);
+@@ -955,13 +955,13 @@ regcache::raw_read_part (int regnum, int
+
+ void
+ regcache_raw_write_part (struct regcache *regcache, int regnum,
+- int offset, int len, const gdb_byte *buf)
++ int offset, LONGEST len, const gdb_byte *buf)
+ {
+ regcache->raw_write_part (regnum, offset, len, buf);
+ }
+
+ void
+-regcache::raw_write_part (int regnum, int offset, int len,
++regcache::raw_write_part (int regnum, int offset, LONGEST len,
+ const gdb_byte *buf)
+ {
+ assert_regnum (regnum);
+@@ -970,14 +970,15 @@ regcache::raw_write_part (int regnum, in
+
+ enum register_status
+ regcache_cooked_read_part (struct regcache *regcache, int regnum,
+- int offset, int len, gdb_byte *buf)
++ LONGEST offset, LONGEST len, gdb_byte *buf)
+ {
+ return regcache->cooked_read_part (regnum, offset, len, buf);
+ }
+
+
+ enum register_status
+-regcache::cooked_read_part (int regnum, int offset, int len, gdb_byte *buf)
++regcache::cooked_read_part (int regnum, LONGEST offset, LONGEST len,
++ gdb_byte *buf)
+ {
+ gdb_assert (regnum >= 0 && regnum < m_descr->nr_cooked_registers);
+ return xfer_part (regnum, offset, len, buf, NULL, false);
+@@ -985,13 +986,13 @@ regcache::cooked_read_part (int regnum,
+
+ void
+ regcache_cooked_write_part (struct regcache *regcache, int regnum,
+- int offset, int len, const gdb_byte *buf)
++ LONGEST offset, LONGEST len, const gdb_byte *buf)
+ {
+ regcache->cooked_write_part (regnum, offset, len, buf);
+ }
+
+ void
+-regcache::cooked_write_part (int regnum, int offset, int len,
++regcache::cooked_write_part (int regnum, LONGEST offset, LONGEST len,
+ const gdb_byte *buf)
+ {
+ gdb_assert (regnum >= 0 && regnum < m_descr->nr_cooked_registers);
+diff -Naurp insight-8.1.50.20180216.orig/gdb/regcache.h insight-8.1.50.20180216.new/gdb/regcache.h
+--- insight-8.1.50.20180216.orig/gdb/regcache.h 2018-01-04 17:43:15.000000000 +0100
++++ insight-8.1.50.20180216.new/gdb/regcache.h 2018-02-18 01:09:36.806116962 +0100
+@@ -82,9 +82,9 @@ extern void regcache_raw_set_cached_valu
+
+ extern enum register_status
+ regcache_raw_read_part (struct regcache *regcache, int regnum,
+- int offset, int len, gdb_byte *buf);
++ int offset, LONGEST len, gdb_byte *buf);
+ void regcache_raw_write_part (struct regcache *regcache, int regnum,
+- int offset, int len, const gdb_byte *buf);
++ int offset, LONGEST len, const gdb_byte *buf);
+
+ void regcache_invalidate (struct regcache *regcache, int regnum);
+
+@@ -121,10 +121,11 @@ extern void regcache_cooked_write_unsign
+ write style operations. */
+
+ enum register_status regcache_cooked_read_part (struct regcache *regcache,
+- int regnum, int offset,
+- int len, gdb_byte *buf);
++ int regnum, LONGEST offset,
++ LONGEST len, gdb_byte *buf);
+ void regcache_cooked_write_part (struct regcache *regcache, int regnum,
+- int offset, int len, const gdb_byte *buf);
++ LONGEST offset, LONGEST len,
++ const gdb_byte *buf);
+
+ /* Special routines to read/write the PC. */
+
+@@ -302,15 +303,15 @@ public:
+
+ void invalidate (int regnum);
+
+- enum register_status raw_read_part (int regnum, int offset, int len,
++ enum register_status raw_read_part (int regnum, int offset, LONGEST len,
+ gdb_byte *buf);
+
+- void raw_write_part (int regnum, int offset, int len, const gdb_byte *buf);
++ void raw_write_part (int regnum, int offset, LONGEST len, const gdb_byte *buf);
+
+- enum register_status cooked_read_part (int regnum, int offset, int len,
++ enum register_status cooked_read_part (int regnum, LONGEST offset, LONGEST len,
+ gdb_byte *buf);
+
+- void cooked_write_part (int regnum, int offset, int len,
++ void cooked_write_part (int regnum, LONGEST offset, LONGEST len,
+ const gdb_byte *buf);
+
+ void supply_regset (const struct regset *regset,
+@@ -349,8 +350,8 @@ private:
+
+ void restore (struct regcache *src);
+
+- enum register_status xfer_part (int regnum, int offset, int len, void *in,
+- const void *out, bool is_raw);
++ enum register_status xfer_part (int regnum, LONGEST offset, LONGEST len,
++ void *in, const void *out, bool is_raw);
+
+ void transfer_regset (const struct regset *regset,
+ struct regcache *out_regcache,
+diff -Naurp insight-8.1.50.20180216.orig/gdb/remote.c insight-8.1.50.20180216.new/gdb/remote.c
+--- insight-8.1.50.20180216.orig/gdb/remote.c 2018-02-09 15:06:40.000000000 +0100
++++ insight-8.1.50.20180216.new/gdb/remote.c 2018-02-18 01:09:36.807116971 +0100
+@@ -9966,7 +9966,7 @@ int remote_hw_breakpoint_limit = -1;
+
+ static int
+ remote_region_ok_for_hw_watchpoint (struct target_ops *self,
+- CORE_ADDR addr, int len)
++ CORE_ADDR addr, LONGEST len)
+ {
+ if (remote_hw_watchpoint_length_limit == 0)
+ return 0;
+diff -Naurp insight-8.1.50.20180216.orig/gdb/rust-lang.c insight-8.1.50.20180216.new/gdb/rust-lang.c
+--- insight-8.1.50.20180216.orig/gdb/rust-lang.c 2018-02-18 01:05:32.110759925 +0100
++++ insight-8.1.50.20180216.new/gdb/rust-lang.c 2018-02-18 01:09:36.807116971 +0100
+@@ -472,7 +472,7 @@ rust_printchar (int c, struct type *type
+
+ static void
+ rust_printstr (struct ui_file *stream, struct type *type,
+- const gdb_byte *string, unsigned int length,
++ const gdb_byte *string, ULONGEST length,
+ const char *user_encoding, int force_ellipses,
+ const struct value_print_options *options)
+ {
+@@ -618,7 +618,7 @@ static const struct generic_val_print_de
+ /* la_val_print implementation for Rust. */
+
+ static void
+-rust_val_print (struct type *type, int embedded_offset,
++rust_val_print (struct type *type, LONGEST embedded_offset,
+ CORE_ADDR address, struct ui_file *stream, int recurse,
+ struct value *val,
+ const struct value_print_options *options)
+diff -Naurp insight-8.1.50.20180216.orig/gdb/s390-linux-nat.c insight-8.1.50.20180216.new/gdb/s390-linux-nat.c
+--- insight-8.1.50.20180216.orig/gdb/s390-linux-nat.c 2018-01-26 13:46:47.000000000 +0100
++++ insight-8.1.50.20180216.new/gdb/s390-linux-nat.c 2018-02-18 01:09:36.807116971 +0100
+@@ -922,7 +922,7 @@ s390_remove_hw_breakpoint (struct target
+
+ static int
+ s390_region_ok_for_hw_watchpoint (struct target_ops *self,
+- CORE_ADDR addr, int cnt)
++ CORE_ADDR addr, LONGEST cnt)
+ {
+ return 1;
+ }
+diff -Naurp insight-8.1.50.20180216.orig/gdb/spu-multiarch.c insight-8.1.50.20180216.new/gdb/spu-multiarch.c
+--- insight-8.1.50.20180216.orig/gdb/spu-multiarch.c 2018-01-04 17:43:15.000000000 +0100
++++ insight-8.1.50.20180216.new/gdb/spu-multiarch.c 2018-02-18 01:09:36.807116971 +0100
+@@ -128,7 +128,7 @@ spu_thread_architecture (struct target_o
+ /* Override the to_region_ok_for_hw_watchpoint routine. */
+ static int
+ spu_region_ok_for_hw_watchpoint (struct target_ops *self,
+- CORE_ADDR addr, int len)
++ CORE_ADDR addr, LONGEST len)
+ {
+ struct target_ops *ops_beneath = find_target_beneath (self);
+
+diff -Naurp insight-8.1.50.20180216.orig/gdb/stack.c insight-8.1.50.20180216.new/gdb/stack.c
+--- insight-8.1.50.20180216.orig/gdb/stack.c 2018-01-12 03:18:43.000000000 +0100
++++ insight-8.1.50.20180216.new/gdb/stack.c 2018-02-18 01:09:36.808116981 +0100
+@@ -190,7 +190,7 @@ print_stack_frame (struct frame_info *fr
+ argument (not just the first nameless argument). */
+
+ static void
+-print_frame_nameless_args (struct frame_info *frame, long start, int num,
++print_frame_nameless_args (struct frame_info *frame, LONGEST start, int num,
+ int first, struct ui_file *stream)
+ {
+ struct gdbarch *gdbarch = get_frame_arch (frame);
+@@ -540,7 +540,7 @@ print_frame_args (struct symbol *func, s
+ /* Offset of next stack argument beyond the one we have seen that is
+ at the highest offset, or -1 if we haven't come to a stack
+ argument yet. */
+- long highest_offset = -1;
++ LONGEST highest_offset = -1;
+ /* Number of ints of arguments that we have printed so far. */
+ int args_printed = 0;
+ /* True if we should print arguments, false otherwise. */
+@@ -569,8 +569,8 @@ print_frame_args (struct symbol *func, s
+ case LOC_ARG:
+ case LOC_REF_ARG:
+ {
+- long current_offset = SYMBOL_VALUE (sym);
+- int arg_size = TYPE_LENGTH (SYMBOL_TYPE (sym));
++ LONGEST current_offset = SYMBOL_VALUE (sym);
++ LONGEST arg_size = TYPE_LENGTH (SYMBOL_TYPE (sym));
+
+ /* Compute address of next argument by adding the size of
+ this argument and rounding to an int boundary. */
+@@ -705,7 +705,7 @@ print_frame_args (struct symbol *func, s
+ enough about the stack to find them. */
+ if (num != -1)
+ {
+- long start;
++ LONGEST start;
+
+ if (highest_offset == -1)
+ start = gdbarch_frame_args_skip (get_frame_arch (frame));
+diff -Naurp insight-8.1.50.20180216.orig/gdb/symmisc.c insight-8.1.50.20180216.new/gdb/symmisc.c
+--- insight-8.1.50.20180216.orig/gdb/symmisc.c 2018-01-04 17:43:15.000000000 +0100
++++ insight-8.1.50.20180216.new/gdb/symmisc.c 2018-02-18 01:09:36.808116981 +0100
+@@ -585,11 +585,11 @@ print_symbol (struct gdbarch *gdbarch, s
+
+ case LOC_CONST_BYTES:
+ {
+- unsigned i;
++ ULONGEST i;
+ struct type *type = check_typedef (SYMBOL_TYPE (symbol));
+
+- fprintf_filtered (outfile, "const %u hex bytes:",
+- TYPE_LENGTH (type));
++ fprintf_filtered (outfile, "const %s hex bytes:",
++ pulongest (TYPE_LENGTH (type)));
+ for (i = 0; i < TYPE_LENGTH (type); i++)
+ fprintf_filtered (outfile, " %02x",
+ (unsigned) SYMBOL_VALUE_BYTES (symbol)[i]);
+diff -Naurp insight-8.1.50.20180216.orig/gdb/target.c insight-8.1.50.20180216.new/gdb/target.c
+--- insight-8.1.50.20180216.orig/gdb/target.c 2018-02-09 15:06:40.000000000 +0100
++++ insight-8.1.50.20180216.new/gdb/target.c 2018-02-18 01:09:36.808116981 +0100
+@@ -57,7 +57,7 @@ static int default_watchpoint_addr_withi
+ CORE_ADDR, CORE_ADDR, int);
+
+ static int default_region_ok_for_hw_watchpoint (struct target_ops *,
+- CORE_ADDR, int);
++ CORE_ADDR, LONGEST);
+
+ static void default_rcmd (struct target_ops *, const char *, struct ui_file *);
+
+@@ -3208,7 +3208,7 @@ target_fileio_read_stralloc (struct infe
+
+ static int
+ default_region_ok_for_hw_watchpoint (struct target_ops *self,
+- CORE_ADDR addr, int len)
++ CORE_ADDR addr, LONGEST len)
+ {
+ return (len <= gdbarch_ptr_bit (target_gdbarch ()) / TARGET_CHAR_BIT);
+ }
+diff -Naurp insight-8.1.50.20180216.orig/gdb/target-delegates.c insight-8.1.50.20180216.new/gdb/target-delegates.c
+--- insight-8.1.50.20180216.orig/gdb/target-delegates.c 2018-02-09 15:06:40.000000000 +0100
++++ insight-8.1.50.20180216.new/gdb/target-delegates.c 2018-02-18 01:09:36.808116981 +0100
+@@ -760,14 +760,14 @@ debug_watchpoint_addr_within_range (stru
+ }
+
+ static int
+-delegate_region_ok_for_hw_watchpoint (struct target_ops *self, CORE_ADDR arg1, int arg2)
++delegate_region_ok_for_hw_watchpoint (struct target_ops *self, CORE_ADDR arg1, LONGEST arg2)
+ {
+ self = self->beneath;
+ return self->to_region_ok_for_hw_watchpoint (self, arg1, arg2);
+ }
+
+ static int
+-debug_region_ok_for_hw_watchpoint (struct target_ops *self, CORE_ADDR arg1, int arg2)
++debug_region_ok_for_hw_watchpoint (struct target_ops *self, CORE_ADDR arg1, LONGEST arg2)
+ {
+ int result;
+ fprintf_unfiltered (gdb_stdlog, "-> %s->to_region_ok_for_hw_watchpoint (...)\n", debug_target.to_shortname);
+@@ -777,7 +777,7 @@ debug_region_ok_for_hw_watchpoint (struc
+ fputs_unfiltered (", ", gdb_stdlog);
+ target_debug_print_CORE_ADDR (arg1);
+ fputs_unfiltered (", ", gdb_stdlog);
+- target_debug_print_int (arg2);
++ target_debug_print_LONGEST (arg2);
+ fputs_unfiltered (") = ", gdb_stdlog);
+ target_debug_print_int (result);
+ fputs_unfiltered ("\n", gdb_stdlog);
+diff -Naurp insight-8.1.50.20180216.orig/gdb/target.h insight-8.1.50.20180216.new/gdb/target.h
+--- insight-8.1.50.20180216.orig/gdb/target.h 2018-02-18 01:05:32.191760705 +0100
++++ insight-8.1.50.20180216.new/gdb/target.h 2018-02-18 01:09:36.809116990 +0100
+@@ -541,7 +541,7 @@ struct target_ops
+ /* Documentation of this routine is provided with the corresponding
+ target_* macro. */
+ int (*to_region_ok_for_hw_watchpoint) (struct target_ops *,
+- CORE_ADDR, int)
++ CORE_ADDR, LONGEST)
+ TARGET_DEFAULT_FUNC (default_region_ok_for_hw_watchpoint);
+
+ int (*to_can_accel_watchpoint_condition) (struct target_ops *,
+diff -Naurp insight-8.1.50.20180216.orig/gdb/tracepoint.c insight-8.1.50.20180216.new/gdb/tracepoint.c
+--- insight-8.1.50.20180216.orig/gdb/tracepoint.c 2018-01-12 03:18:43.000000000 +0100
++++ insight-8.1.50.20180216.new/gdb/tracepoint.c 2018-02-18 01:09:36.809116990 +0100
+@@ -852,10 +852,10 @@ collection_list::add_register (unsigned
+ void
+ collection_list::add_memrange (struct gdbarch *gdbarch,
+ int type, bfd_signed_vma base,
+- unsigned long len)
++ ULONGEST len)
+ {
+ if (info_verbose)
+- printf_filtered ("(%d,%s,%ld)\n", type, paddress (gdbarch, base), len);
++ printf_filtered ("(%d,%s,%s)\n", type, paddress (gdbarch, base), pulongest (len));
+
+ /* type: memrange_absolute == memory, other n == basereg */
+ /* base: addr if memory, offset if reg relative. */
+@@ -875,7 +875,7 @@ collection_list::collect_symbol (struct
+ CORE_ADDR scope,
+ int trace_string)
+ {
+- unsigned long len;
++ ULONGEST len;
+ unsigned int reg;
+ bfd_signed_vma offset;
+ int treat_as_expr = 0;
+@@ -896,8 +896,8 @@ collection_list::collect_symbol (struct
+ offset = SYMBOL_VALUE_ADDRESS (sym);
+ if (info_verbose)
+ {
+- printf_filtered ("LOC_STATIC %s: collect %ld bytes at %s.\n",
+- SYMBOL_PRINT_NAME (sym), len,
++ printf_filtered ("LOC_STATIC %s: collect %s bytes at %s.\n",
++ SYMBOL_PRINT_NAME (sym), pulongest (len),
+ paddress (gdbarch, offset));
+ }
+ /* A struct may be a C++ class with static fields, go to general
+@@ -929,9 +929,9 @@ collection_list::collect_symbol (struct
+ offset = frame_offset + SYMBOL_VALUE (sym);
+ if (info_verbose)
+ {
+- printf_filtered ("LOC_LOCAL %s: Collect %ld bytes at offset %s"
++ printf_filtered ("LOC_LOCAL %s: Collect %s bytes at offset %s"
+ " from frame ptr reg %d\n",
+- SYMBOL_PRINT_NAME (sym), len,
++ SYMBOL_PRINT_NAME (sym), pulongest (len),
+ paddress (gdbarch, offset), reg);
+ }
+ add_memrange (gdbarch, reg, offset, len);
+@@ -941,9 +941,9 @@ collection_list::collect_symbol (struct
+ offset = 0;
+ if (info_verbose)
+ {
+- printf_filtered ("LOC_REGPARM_ADDR %s: Collect %ld bytes at offset %s"
++ printf_filtered ("LOC_REGPARM_ADDR %s: Collect %s bytes at offset %s"
+ " from reg %d\n",
+- SYMBOL_PRINT_NAME (sym), len,
++ SYMBOL_PRINT_NAME (sym), pulongest (len),
+ paddress (gdbarch, offset), reg);
+ }
+ add_memrange (gdbarch, reg, offset, len);
+@@ -953,9 +953,9 @@ collection_list::collect_symbol (struct
+ offset = frame_offset + SYMBOL_VALUE (sym);
+ if (info_verbose)
+ {
+- printf_filtered ("LOC_LOCAL %s: Collect %ld bytes at offset %s"
++ printf_filtered ("LOC_LOCAL %s: Collect %s bytes at offset %s"
+ " from frame ptr reg %d\n",
+- SYMBOL_PRINT_NAME (sym), len,
++ SYMBOL_PRINT_NAME (sym), pulongest (len),
+ paddress (gdbarch, offset), reg);
+ }
+ add_memrange (gdbarch, reg, offset, len);
+@@ -2500,7 +2500,8 @@ info_scope_command (const char *args_in,
+ const char *symname;
+ const char *save_args = args_in;
+ struct block_iterator iter;
+- int j, count = 0;
++ int count = 0;
++ LONGEST j;
+ struct gdbarch *gdbarch;
+ int regno;
+ const char *args = args_in;
+@@ -2644,8 +2645,11 @@ info_scope_command (const char *args_in,
+ }
+ }
+ if (SYMBOL_TYPE (sym))
+- printf_filtered (", length %d.\n",
+- TYPE_LENGTH (check_typedef (SYMBOL_TYPE (sym))));
++ {
++ ULONGEST len = TYPE_LENGTH (check_typedef (SYMBOL_TYPE (sym)));
++
++ printf_filtered (", length %s.\n", pulongest (len));
++ }
+ }
+ if (BLOCK_FUNCTION (block))
+ break;
+diff -Naurp insight-8.1.50.20180216.orig/gdb/tracepoint.h insight-8.1.50.20180216.new/gdb/tracepoint.h
+--- insight-8.1.50.20180216.orig/gdb/tracepoint.h 2018-01-04 17:43:15.000000000 +0100
++++ insight-8.1.50.20180216.new/gdb/tracepoint.h 2018-02-18 01:09:36.809116990 +0100
+@@ -255,7 +255,7 @@ public:
+ void add_register (unsigned int regno);
+ void add_memrange (struct gdbarch *gdbarch,
+ int type, bfd_signed_vma base,
+- unsigned long len);
++ ULONGEST len);
+ void collect_symbol (struct symbol *sym,
+ struct gdbarch *gdbarch,
+ long frame_regno, long frame_offset,
+diff -Naurp insight-8.1.50.20180216.orig/gdb/valarith.c insight-8.1.50.20180216.new/gdb/valarith.c
+--- insight-8.1.50.20180216.orig/gdb/valarith.c 2018-02-18 01:05:32.111759934 +0100
++++ insight-8.1.50.20180216.new/gdb/valarith.c 2018-02-18 01:09:36.809116990 +0100
+@@ -184,7 +184,7 @@ value_subscript (struct value *array, LO
+ to doubles, but no longer does. */
+
+ struct value *
+-value_subscripted_rvalue (struct value *array, LONGEST index, int lowerbound)
++value_subscripted_rvalue (struct value *array, LONGEST index, LONGEST lowerbound)
+ {
+ struct type *array_type = check_typedef (value_type (array));
+ struct type *elt_type = check_typedef (TYPE_TARGET_TYPE (array_type));
+@@ -661,7 +661,7 @@ value_concat (struct value *arg1, struct
+ struct value *inval1;
+ struct value *inval2;
+ struct value *outval = NULL;
+- int inval1len, inval2len;
++ ssize_t inval1len, inval2len;
+ int count, idx;
+ char inchar;
+ struct type *type1 = check_typedef (value_type (arg1));
+@@ -1421,7 +1421,7 @@ value_binop (struct value *arg1, struct
+ int
+ value_logical_not (struct value *arg1)
+ {
+- int len;
++ LONGEST len;
+ const gdb_byte *p;
+ struct type *type1;
+
+@@ -1449,11 +1449,11 @@ value_logical_not (struct value *arg1)
+ static int
+ value_strcmp (struct value *arg1, struct value *arg2)
+ {
+- int len1 = TYPE_LENGTH (value_type (arg1));
+- int len2 = TYPE_LENGTH (value_type (arg2));
++ LONGEST len1 = TYPE_LENGTH (value_type (arg1));
++ LONGEST len2 = TYPE_LENGTH (value_type (arg2));
+ const gdb_byte *s1 = value_contents (arg1);
+ const gdb_byte *s2 = value_contents (arg2);
+- int i, len = len1 < len2 ? len1 : len2;
++ LONGEST i, len = len1 < len2 ? len1 : len2;
+
+ for (i = 0; i < len; i++)
+ {
+diff -Naurp insight-8.1.50.20180216.orig/gdb/valops.c insight-8.1.50.20180216.new/gdb/valops.c
+--- insight-8.1.50.20180216.orig/gdb/valops.c 2018-02-18 01:05:32.175760551 +0100
++++ insight-8.1.50.20180216.new/gdb/valops.c 2018-02-18 01:09:36.810117000 +0100
+@@ -81,7 +81,7 @@ oload_classification classify_oload_matc
+ int, int);
+
+ static struct value *value_struct_elt_for_reference (struct type *,
+- int, struct type *,
++ LONGEST, struct type *,
+ const char *,
+ struct type *,
+ int, enum noside);
+@@ -183,7 +183,7 @@ find_function_in_inferior (const char *n
+ space. */
+
+ struct value *
+-value_allocate_space_in_inferior (int len)
++value_allocate_space_in_inferior (LONGEST len)
+ {
+ struct objfile *objf;
+ struct value *val = find_function_in_inferior ("malloc", &objf);
+@@ -398,12 +398,12 @@ value_cast (struct type *type, struct va
+ if (code1 == TYPE_CODE_ARRAY)
+ {
+ struct type *element_type = TYPE_TARGET_TYPE (type);
+- unsigned element_length = TYPE_LENGTH (check_typedef (element_type));
++ ULONGEST element_length = TYPE_LENGTH (check_typedef (element_type));
+
+ if (element_length > 0 && TYPE_ARRAY_UPPER_BOUND_IS_UNDEFINED (type))
+ {
+ struct type *range_type = TYPE_INDEX_TYPE (type);
+- int val_length = TYPE_LENGTH (type2);
++ LONGEST val_length = TYPE_LENGTH (type2);
+ LONGEST low_bound, high_bound, new_length;
+
+ if (get_discrete_bounds (range_type, &low_bound, &high_bound) < 0)
+@@ -1055,7 +1055,7 @@ value_assign (struct value *toval, struc
+ {
+ const gdb_byte *dest_buffer;
+ CORE_ADDR changed_addr;
+- int changed_len;
++ LONGEST changed_len;
+ gdb_byte buffer[sizeof (LONGEST)];
+
+ if (value_bitsize (toval))
+@@ -3313,7 +3313,7 @@ compare_parameters (struct type *t1, str
+ the form "DOMAIN::NAME". */
+
+ static struct value *
+-value_struct_elt_for_reference (struct type *domain, int offset,
++value_struct_elt_for_reference (struct type *domain, LONGEST offset,
+ struct type *curtype, const char *name,
+ struct type *intype,
+ int want_address,
+@@ -3347,7 +3347,7 @@ value_struct_elt_for_reference (struct t
+ if (want_address)
+ return value_from_longest
+ (lookup_memberptr_type (TYPE_FIELD_TYPE (t, i), domain),
+- offset + (LONGEST) (TYPE_FIELD_BITPOS (t, i) >> 3));
++ offset + (TYPE_FIELD_BITPOS (t, i) >> 3));
+ else if (noside != EVAL_NORMAL)
+ return allocate_value (TYPE_FIELD_TYPE (t, i));
+ else
+@@ -3520,7 +3520,7 @@ value_struct_elt_for_reference (struct t
+ for (i = TYPE_N_BASECLASSES (t) - 1; i >= 0; i--)
+ {
+ struct value *v;
+- int base_offset;
++ LONGEST base_offset;
+
+ if (BASETYPE_VIA_VIRTUAL (t, i))
+ base_offset = 0;
+@@ -3669,7 +3669,7 @@ value_rtti_indirect_type (struct value *
+ struct value *
+ value_full_object (struct value *argp,
+ struct type *rtype,
+- int xfull, int xtop,
++ int xfull, LONGEST xtop,
+ int xusing_enc)
+ {
+ struct type *real_type;
+diff -Naurp insight-8.1.50.20180216.orig/gdb/valprint.c insight-8.1.50.20180216.new/gdb/valprint.c
+--- insight-8.1.50.20180216.orig/gdb/valprint.c 2018-02-18 01:05:32.123760050 +0100
++++ insight-8.1.50.20180216.new/gdb/valprint.c 2018-02-18 01:09:36.810117000 +0100
+@@ -879,7 +879,7 @@ generic_val_print_complex (struct type *
+
+ void
+ generic_val_print (struct type *type,
+- int embedded_offset, CORE_ADDR address,
++ LONGEST embedded_offset, CORE_ADDR address,
+ struct ui_file *stream, int recurse,
+ struct value *original_value,
+ const struct value_print_options *options,
+@@ -1773,7 +1773,7 @@ print_decimal_chars (struct ui_file *str
+
+ void
+ print_hex_chars (struct ui_file *stream, const gdb_byte *valaddr,
+- unsigned len, enum bfd_endian byte_order,
++ ULONGEST len, enum bfd_endian byte_order,
+ bool zero_pad)
+ {
+ const gdb_byte *p;
+@@ -1926,17 +1926,17 @@ val_print_array_elements (struct type *t
+ int recurse,
+ struct value *val,
+ const struct value_print_options *options,
+- unsigned int i)
++ ULONGEST i)
+ {
+ unsigned int things_printed = 0;
+- unsigned len;
++ ULONGEST len;
+ struct type *elttype, *index_type, *base_index_type;
+- unsigned eltlen;
++ ULONGEST eltlen;
+ /* Position of the array element we are examining to see
+ whether it is repeated. */
+- unsigned int rep1;
++ ULONGEST rep1;
+ /* Number of repetitions we have detected so far. */
+- unsigned int reps;
++ ULONGEST reps;
+ LONGEST low_bound, high_bound;
+ LONGEST low_pos, high_pos;
+
+@@ -2026,7 +2026,7 @@ val_print_array_elements (struct type *t
+ address, stream, recurse + 1, val, options,
+ current_language);
+ annotate_elt_rep (reps);
+- fprintf_filtered (stream, " <repeats %u times>", reps);
++ fprintf_filtered (stream, " <repeats %s times>", pulongest (reps));
+ annotate_elt_rep_end ();
+
+ i = rep1 - 1;
+@@ -2672,7 +2672,7 @@ print_converted_chars_to_obstack (struct
+
+ void
+ generic_printstr (struct ui_file *stream, struct type *type,
+- const gdb_byte *string, unsigned int length,
++ const gdb_byte *string, ULONGEST length,
+ const char *encoding, int force_ellipses,
+ int quote_char, int c_style_terminator,
+ const struct value_print_options *options)
+diff -Naurp insight-8.1.50.20180216.orig/gdb/valprint.h insight-8.1.50.20180216.new/gdb/valprint.h
+--- insight-8.1.50.20180216.orig/gdb/valprint.h 2018-01-04 17:43:15.000000000 +0100
++++ insight-8.1.50.20180216.new/gdb/valprint.h 2018-02-18 01:09:36.810117000 +0100
+@@ -119,7 +119,7 @@ extern void val_print_array_elements (st
+ CORE_ADDR, struct ui_file *, int,
+ struct value *,
+ const struct value_print_options *,
+- unsigned int);
++ ULONGEST);
+
+ extern void val_print_scalar_formatted (struct type *,
+ LONGEST,
+@@ -138,7 +138,7 @@ extern void print_decimal_chars (struct
+ unsigned int, bool, enum bfd_endian);
+
+ extern void print_hex_chars (struct ui_file *, const gdb_byte *,
+- unsigned int, enum bfd_endian, bool);
++ ULONGEST, enum bfd_endian, bool);
+
+ extern void print_char_chars (struct ui_file *, struct type *,
+ const gdb_byte *, unsigned int, enum bfd_endian);
+@@ -191,7 +191,7 @@ struct generic_val_print_decorations
+
+
+ extern void generic_val_print (struct type *type,
+- int embedded_offset, CORE_ADDR address,
++ LONGEST embedded_offset, CORE_ADDR address,
+ struct ui_file *stream, int recurse,
+ struct value *original_value,
+ const struct value_print_options *options,
+@@ -201,7 +201,7 @@ extern void generic_emit_char (int c, st
+ int quoter, const char *encoding);
+
+ extern void generic_printstr (struct ui_file *stream, struct type *type,
+- const gdb_byte *string, unsigned int length,
++ const gdb_byte *string, ULONGEST length,
+ const char *encoding, int force_ellipses,
+ int quote_char, int c_style_terminator,
+ const struct value_print_options *options);
+diff -Naurp insight-8.1.50.20180216.orig/gdb/value.c insight-8.1.50.20180216.new/gdb/value.c
+--- insight-8.1.50.20180216.orig/gdb/value.c 2018-02-18 01:05:32.183760628 +0100
++++ insight-8.1.50.20180216.new/gdb/value.c 2018-02-18 01:09:36.810117000 +0100
+@@ -363,7 +363,8 @@ value_bytes_available (const struct valu
+ }
+
+ int
+-value_bits_any_optimized_out (const struct value *value, int bit_offset, int bit_length)
++value_bits_any_optimized_out (const struct value *value, LONGEST bit_offset,
++ LONGEST bit_length)
+ {
+ gdb_assert (!value->lazy);
+
+@@ -809,8 +810,8 @@ find_first_range_overlap_and_match (stru
+ Return true if the available bits match. */
+
+ static bool
+-value_contents_bits_eq (const struct value *val1, int offset1,
+- const struct value *val2, int offset2,
++value_contents_bits_eq (const struct value *val1, LONGEST offset1,
++ const struct value *val2, LONGEST offset2,
+ int length)
+ {
+ /* Each array element corresponds to a ranges source (unavailable,
+@@ -1445,7 +1446,8 @@ value_optimized_out (struct value *value
+ the following LENGTH bytes. */
+
+ void
+-mark_value_bytes_optimized_out (struct value *value, int offset, int length)
++mark_value_bytes_optimized_out (struct value *value, LONGEST offset,
++ LONGEST length)
+ {
+ mark_value_bits_optimized_out (value,
+ offset * TARGET_CHAR_BIT,
+diff -Naurp insight-8.1.50.20180216.orig/gdb/value.h insight-8.1.50.20180216.new/gdb/value.h
+--- insight-8.1.50.20180216.orig/gdb/value.h 2018-02-18 01:05:32.111759934 +0100
++++ insight-8.1.50.20180216.new/gdb/value.h 2018-02-18 01:09:36.810117000 +0100
+@@ -245,7 +245,7 @@ struct lval_funcs
+ /* If non-NULL, this is used to determine whether the indicated bits
+ of VALUE are a synthetic pointer. */
+ int (*check_synthetic_pointer) (const struct value *value,
+- LONGEST offset, int length);
++ LONGEST offset, LONGEST length);
+
+ /* Return a duplicate of VALUE's closure, for use in a new value.
+ This may simply return the same closure, if VALUE's is
+@@ -376,7 +376,8 @@ extern int value_optimized_out (struct v
+ otherwise. */
+
+ extern int value_bits_any_optimized_out (const struct value *value,
+- int bit_offset, int bit_length);
++ LONGEST bit_offset,
++ LONGEST bit_length);
+
+ /* Like value_optimized_out, but return true iff the whole value is
+ optimized out. */
+@@ -386,7 +387,7 @@ extern int value_entirely_optimized_out
+ LENGTH bytes as optimized out. */
+
+ extern void mark_value_bytes_optimized_out (struct value *value,
+- int offset, int length);
++ LONGEST offset, LONGEST length);
+
+ /* Mark VALUE's content bits starting at OFFSET and extending for
+ LENGTH bits as optimized out. */
+@@ -820,12 +821,11 @@ extern struct value *value_primitive_fie
+ int fieldno,
+ struct type *arg_type);
+
+-
+ extern struct type *value_rtti_indirect_type (struct value *, int *, LONGEST *,
+ int *);
+
+ extern struct value *value_full_object (struct value *, struct type *, int,
+- int, int);
++ LONGEST, int);
+
+ extern struct value *value_cast_pointers (struct type *, struct value *, int);
+
+@@ -1136,10 +1136,11 @@ extern struct value *value_literal_compl
+ extern struct value *find_function_in_inferior (const char *,
+ struct objfile **);
+
+-extern struct value *value_allocate_space_in_inferior (int);
++extern struct value *value_allocate_space_in_inferior (LONGEST);
+
+ extern struct value *value_subscripted_rvalue (struct value *array,
+- LONGEST index, int lowerbound);
++ LONGEST index,
++ LONGEST lowerbound);
+
+ /* User function handler. */
+
+diff -Naurp insight-8.1.50.20180216.orig/gdb/x86-nat.c insight-8.1.50.20180216.new/gdb/x86-nat.c
+--- insight-8.1.50.20180216.orig/gdb/x86-nat.c 2018-01-04 17:43:15.000000000 +0100
++++ insight-8.1.50.20180216.new/gdb/x86-nat.c 2018-02-18 01:09:36.810117000 +0100
+@@ -174,7 +174,7 @@ x86_remove_watchpoint (struct target_ops
+
+ static int
+ x86_region_ok_for_watchpoint (struct target_ops *self,
+- CORE_ADDR addr, int len)
++ CORE_ADDR addr, LONGEST len)
+ {
+ struct x86_debug_reg_state *state
+ = x86_debug_reg_state (ptid_get_pid (inferior_ptid));
diff --git a/insight-8.1-gdb-rhbz795424-bitpos-23of25.patch b/insight-8.1-gdb-rhbz795424-bitpos-23of25.patch
new file mode 100644
index 0000000..c05a542
--- /dev/null
+++ b/insight-8.1-gdb-rhbz795424-bitpos-23of25.patch
@@ -0,0 +1,1142 @@
+diff -Naurp insight-8.1.50.20180216.orig/gdb/alpha-tdep.c insight-8.1.50.20180216.new/gdb/alpha-tdep.c
+--- insight-8.1.50.20180216.orig/gdb/alpha-tdep.c 2018-02-18 01:25:08.186666439 +0100
++++ insight-8.1.50.20180216.new/gdb/alpha-tdep.c 2018-02-18 01:25:55.083116306 +0100
+@@ -301,17 +301,17 @@ alpha_push_dummy_call (struct gdbarch *g
+ {
+ enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
+ int i;
+- int accumulate_size = struct_return ? 8 : 0;
++ ssize_t accumulate_size = struct_return ? 8 : 0;
+ struct alpha_arg
+ {
+ const gdb_byte *contents;
+- int len;
+- int offset;
++ ssize_t len;
++ ssize_t offset;
+ };
+ struct alpha_arg *alpha_args = XALLOCAVEC (struct alpha_arg, nargs);
+ struct alpha_arg *m_arg;
+ gdb_byte arg_reg_buffer[ALPHA_REGISTER_SIZE * ALPHA_NUM_ARG_REGS];
+- int required_arg_regs;
++ ssize_t required_arg_regs;
+ CORE_ADDR func_addr = find_function_addr (function, NULL);
+
+ /* The ABI places the address of the called function in T12. */
+@@ -431,8 +431,8 @@ alpha_push_dummy_call (struct gdbarch *g
+ for (i = nargs; m_arg--, --i >= 0;)
+ {
+ const gdb_byte *contents = m_arg->contents;
+- int offset = m_arg->offset;
+- int len = m_arg->len;
++ ssize_t offset = m_arg->offset;
++ ssize_t len = m_arg->len;
+
+ /* Copy the bytes destined for registers into arg_reg_buffer. */
+ if (offset < sizeof(arg_reg_buffer))
+@@ -444,7 +444,7 @@ alpha_push_dummy_call (struct gdbarch *g
+ }
+ else
+ {
+- int tlen = sizeof(arg_reg_buffer) - offset;
++ ssize_t tlen = sizeof(arg_reg_buffer) - offset;
+ memcpy (arg_reg_buffer + offset, contents, tlen);
+ offset += tlen;
+ contents += tlen;
+diff -Naurp insight-8.1.50.20180216.orig/gdb/amd64-tdep.c insight-8.1.50.20180216.new/gdb/amd64-tdep.c
+--- insight-8.1.50.20180216.orig/gdb/amd64-tdep.c 2018-02-18 01:25:08.138665978 +0100
++++ insight-8.1.50.20180216.new/gdb/amd64-tdep.c 2018-02-18 01:25:55.084116315 +0100
+@@ -879,8 +879,8 @@ amd64_push_arguments (struct regcache *r
+ };
+ struct value **stack_args = XALLOCAVEC (struct value *, nargs);
+ int num_stack_args = 0;
+- int num_elements = 0;
+- int element = 0;
++ LONGEST num_elements = 0;
++ LONGEST element = 0;
+ int integer_reg = 0;
+ int sse_reg = 0;
+ int i;
+@@ -892,7 +892,7 @@ amd64_push_arguments (struct regcache *r
+ for (i = 0; i < nargs; i++)
+ {
+ struct type *type = value_type (args[i]);
+- int len = TYPE_LENGTH (type);
++ LONGEST len = TYPE_LENGTH (type);
+ enum amd64_reg_class theclass[2];
+ int needed_integer_regs = 0;
+ int needed_sse_regs = 0;
+@@ -956,7 +956,7 @@ amd64_push_arguments (struct regcache *r
+
+ gdb_assert (regnum != -1);
+ memset (buf, 0, sizeof buf);
+- memcpy (buf, valbuf + j * 8, std::min (len, 8));
++ memcpy (buf, valbuf + j * 8, std::min (len, (LONGEST) 8));
+ regcache_raw_write_part (regcache, regnum, offset, 8, buf);
+ }
+ }
+diff -Naurp insight-8.1.50.20180216.orig/gdb/amd64-windows-tdep.c insight-8.1.50.20180216.new/gdb/amd64-windows-tdep.c
+--- insight-8.1.50.20180216.orig/gdb/amd64-windows-tdep.c 2018-01-04 17:43:15.000000000 +0100
++++ insight-8.1.50.20180216.new/gdb/amd64-windows-tdep.c 2018-02-18 01:25:55.084116315 +0100
+@@ -291,7 +291,7 @@ amd64_windows_return_value (struct gdbar
+ struct type *type, struct regcache *regcache,
+ gdb_byte *readbuf, const gdb_byte *writebuf)
+ {
+- int len = TYPE_LENGTH (type);
++ LONGEST len = TYPE_LENGTH (type);
+ int regnum = -1;
+
+ /* See if our value is returned through a register. If it is, then
+diff -Naurp insight-8.1.50.20180216.orig/gdb/arm-tdep.c insight-8.1.50.20180216.new/gdb/arm-tdep.c
+--- insight-8.1.50.20180216.orig/gdb/arm-tdep.c 2018-02-02 13:28:13.000000000 +0100
++++ insight-8.1.50.20180216.new/gdb/arm-tdep.c 2018-02-18 01:25:55.086116334 +0100
+@@ -3477,7 +3477,7 @@ arm_vfp_cprc_reg_char (enum arm_vfp_cprc
+ array). Vector types are not currently supported, matching the
+ generic AAPCS support. */
+
+-static int
++static LONGEST
+ arm_vfp_cprc_sub_candidate (struct type *t,
+ enum arm_vfp_cprc_base_type *base_type)
+ {
+@@ -3560,7 +3560,7 @@ arm_vfp_cprc_sub_candidate (struct type
+ }
+ else
+ {
+- int count;
++ LONGEST count;
+ unsigned unitlen;
+
+ count = arm_vfp_cprc_sub_candidate (TYPE_TARGET_TYPE (t),
+@@ -3583,12 +3583,12 @@ arm_vfp_cprc_sub_candidate (struct type
+
+ case TYPE_CODE_STRUCT:
+ {
+- int count = 0;
++ LONGEST count = 0;
+ unsigned unitlen;
+ int i;
+ for (i = 0; i < TYPE_NFIELDS (t); i++)
+ {
+- int sub_count = 0;
++ LONGEST sub_count = 0;
+
+ if (!field_is_static (&TYPE_FIELD (t, i)))
+ sub_count = arm_vfp_cprc_sub_candidate (TYPE_FIELD_TYPE (t, i),
+@@ -3612,13 +3612,15 @@ arm_vfp_cprc_sub_candidate (struct type
+
+ case TYPE_CODE_UNION:
+ {
+- int count = 0;
++ LONGEST count = 0;
+ unsigned unitlen;
+ int i;
+ for (i = 0; i < TYPE_NFIELDS (t); i++)
+ {
+- int sub_count = arm_vfp_cprc_sub_candidate (TYPE_FIELD_TYPE (t, i),
+- base_type);
++ LONGEST sub_count;
++
++ sub_count = arm_vfp_cprc_sub_candidate (TYPE_FIELD_TYPE (t, i),
++ base_type);
+ if (sub_count == -1)
+ return -1;
+ count = (count > sub_count ? count : sub_count);
+@@ -3654,7 +3656,7 @@ arm_vfp_call_candidate (struct type *t,
+ int *count)
+ {
+ enum arm_vfp_cprc_base_type b = VFP_CPRC_UNKNOWN;
+- int c = arm_vfp_cprc_sub_candidate (t, &b);
++ LONGEST c = arm_vfp_cprc_sub_candidate (t, &b);
+ if (c <= 0 || c > 4)
+ return 0;
+ *base_type = b;
+@@ -3735,7 +3737,7 @@ arm_push_dummy_call (struct gdbarch *gdb
+
+ for (argnum = 0; argnum < nargs; argnum++)
+ {
+- int len;
++ LONGEST len;
+ struct type *arg_type;
+ struct type *target_type;
+ enum type_code typecode;
+diff -Naurp insight-8.1.50.20180216.orig/gdb/avr-tdep.c insight-8.1.50.20180216.new/gdb/avr-tdep.c
+--- insight-8.1.50.20180216.orig/gdb/avr-tdep.c 2018-01-26 13:46:47.000000000 +0100
++++ insight-8.1.50.20180216.new/gdb/avr-tdep.c 2018-02-18 01:25:55.087116344 +0100
+@@ -1191,13 +1191,13 @@ avr_dummy_id (struct gdbarch *gdbarch, s
+
+ struct stack_item
+ {
+- int len;
++ ssize_t len;
+ struct stack_item *prev;
+ gdb_byte *data;
+ };
+
+ static struct stack_item *
+-push_stack_item (struct stack_item *prev, const bfd_byte *contents, int len)
++push_stack_item (struct stack_item *prev, const bfd_byte *contents, ssize_t len)
+ {
+ struct stack_item *si;
+ si = XNEW (struct stack_item);
+@@ -1285,12 +1285,12 @@ avr_push_dummy_call (struct gdbarch *gdb
+
+ for (i = 0; i < nargs; i++)
+ {
+- int last_regnum;
+- int j;
++ ssize_t last_regnum;
++ ssize_t j;
+ struct value *arg = args[i];
+ struct type *type = check_typedef (value_type (arg));
+ const bfd_byte *contents = value_contents (arg);
+- int len = TYPE_LENGTH (type);
++ ssize_t len = TYPE_LENGTH (type);
+
+ /* Calculate the potential last register needed.
+ E.g. For length 2, registers regnum and regnum-1 (say 25 and 24)
+diff -Naurp insight-8.1.50.20180216.orig/gdb/bfin-tdep.c insight-8.1.50.20180216.new/gdb/bfin-tdep.c
+--- insight-8.1.50.20180216.orig/gdb/bfin-tdep.c 2018-01-26 13:46:47.000000000 +0100
++++ insight-8.1.50.20180216.new/gdb/bfin-tdep.c 2018-02-18 01:25:55.087116344 +0100
+@@ -504,7 +504,7 @@ bfin_push_dummy_call (struct gdbarch *gd
+ enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
+ int i;
+ long reg_r0, reg_r1, reg_r2;
+- int total_len = 0;
++ ssize_t total_len = 0;
+
+ for (i = nargs - 1; i >= 0; i--)
+ {
+@@ -526,7 +526,7 @@ bfin_push_dummy_call (struct gdbarch *gd
+ {
+ struct type *value_type = value_enclosing_type (args[i]);
+ struct type *arg_type = check_typedef (value_type);
+- int container_len = (TYPE_LENGTH (value_type) + 3) & ~3;
++ ssize_t container_len = (TYPE_LENGTH (value_type) + 3) & ~3;
+
+ sp -= container_len;
+ write_memory (sp, value_contents (args[i]), container_len);
+diff -Naurp insight-8.1.50.20180216.orig/gdb/cris-tdep.c insight-8.1.50.20180216.new/gdb/cris-tdep.c
+--- insight-8.1.50.20180216.orig/gdb/cris-tdep.c 2018-01-04 17:43:15.000000000 +0100
++++ insight-8.1.50.20180216.new/gdb/cris-tdep.c 2018-02-18 01:25:55.088116353 +0100
+@@ -663,13 +663,13 @@ static CORE_ADDR cris_unwind_sp (struct
+
+ struct stack_item
+ {
+- int len;
++ ssize_t len;
+ struct stack_item *prev;
+ gdb_byte *data;
+ };
+
+ static struct stack_item *
+-push_stack_item (struct stack_item *prev, const gdb_byte *contents, int len)
++push_stack_item (struct stack_item *prev, const gdb_byte *contents, ssize_t len)
+ {
+ struct stack_item *si = XNEW (struct stack_item);
+ si->data = (gdb_byte *) xmalloc (len);
+@@ -833,13 +833,13 @@ cris_push_dummy_call (struct gdbarch *gd
+
+ for (argnum = 0; argnum < nargs; argnum++)
+ {
+- int len;
++ ssize_t len;
+ const gdb_byte *val;
+- int reg_demand;
+- int i;
++ ssize_t reg_demand;
++ ssize_t i;
+
+- len = TYPE_LENGTH (value_type (args[argnum]));
+ val = value_contents (args[argnum]);
++ len = TYPE_LENGTH (value_type (args[argnum]));
+
+ /* How may registers worth of storage do we need for this argument? */
+ reg_demand = (len / 4) + (len % 4 != 0 ? 1 : 0);
+diff -Naurp insight-8.1.50.20180216.orig/gdb/h8300-tdep.c insight-8.1.50.20180216.new/gdb/h8300-tdep.c
+--- insight-8.1.50.20180216.orig/gdb/h8300-tdep.c 2018-01-26 13:46:47.000000000 +0100
++++ insight-8.1.50.20180216.new/gdb/h8300-tdep.c 2018-02-18 01:25:55.088116353 +0100
+@@ -637,7 +637,7 @@ h8300_push_dummy_call (struct gdbarch *g
+ int struct_return, CORE_ADDR struct_addr)
+ {
+ enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
+- int stack_alloc = 0, stack_offset = 0;
++ LONGEST stack_alloc = 0, stack_offset = 0;
+ int wordsize = BINWORD (gdbarch);
+ int reg = E_ARG0_REGNUM;
+ int argument;
+@@ -663,11 +663,11 @@ h8300_push_dummy_call (struct gdbarch *g
+ for (argument = 0; argument < nargs; argument++)
+ {
+ struct type *type = value_type (args[argument]);
+- int len = TYPE_LENGTH (type);
++ ssize_t len = TYPE_LENGTH (type);
+ char *contents = (char *) value_contents (args[argument]);
+
+ /* Pad the argument appropriately. */
+- int padded_len = align_up (len, wordsize);
++ ssize_t padded_len = align_up (len, wordsize);
+ /* Use std::vector here to get zero initialization. */
+ std::vector<gdb_byte> padded (padded_len);
+
+@@ -696,7 +696,7 @@ h8300_push_dummy_call (struct gdbarch *g
+ /* Heavens to Betsy --- it's really going in registers!
+ Note that on the h8/300s, there are gaps between the
+ registers in the register file. */
+- int offset;
++ ssize_t offset;
+
+ for (offset = 0; offset < padded_len; offset += wordsize)
+ {
+diff -Naurp insight-8.1.50.20180216.orig/gdb/hppa-tdep.c insight-8.1.50.20180216.new/gdb/hppa-tdep.c
+--- insight-8.1.50.20180216.orig/gdb/hppa-tdep.c 2018-01-26 13:46:47.000000000 +0100
++++ insight-8.1.50.20180216.new/gdb/hppa-tdep.c 2018-02-18 01:25:55.089116363 +0100
+@@ -989,7 +989,7 @@ hppa64_push_dummy_call (struct gdbarch *
+ {
+ struct value *arg = args[i];
+ struct type *type = value_type (arg);
+- int len = TYPE_LENGTH (type);
++ LONGEST len = TYPE_LENGTH (type);
+ const bfd_byte *valbuf;
+ bfd_byte fptrbuf[8];
+ int regnum;
+@@ -1184,7 +1184,7 @@ hppa64_return_value (struct gdbarch *gdb
+ struct type *type, struct regcache *regcache,
+ gdb_byte *readbuf, const gdb_byte *writebuf)
+ {
+- int len = TYPE_LENGTH (type);
++ LONGEST len = TYPE_LENGTH (type);
+ int regnum, offset;
+
+ if (len > 16)
+diff -Naurp insight-8.1.50.20180216.orig/gdb/i386-darwin-tdep.c insight-8.1.50.20180216.new/gdb/i386-darwin-tdep.c
+--- insight-8.1.50.20180216.orig/gdb/i386-darwin-tdep.c 2018-01-04 17:43:15.000000000 +0100
++++ insight-8.1.50.20180216.new/gdb/i386-darwin-tdep.c 2018-02-18 01:25:55.089116363 +0100
+@@ -166,7 +166,7 @@ i386_darwin_push_dummy_call (struct gdba
+
+ for (write_pass = 0; write_pass < 2; write_pass++)
+ {
+- int args_space = 0;
++ LONGEST args_space = 0;
+ int num_m128 = 0;
+
+ if (struct_return)
+diff -Naurp insight-8.1.50.20180216.orig/gdb/i386-tdep.c insight-8.1.50.20180216.new/gdb/i386-tdep.c
+--- insight-8.1.50.20180216.orig/gdb/i386-tdep.c 2018-02-18 01:25:08.172666304 +0100
++++ insight-8.1.50.20180216.new/gdb/i386-tdep.c 2018-02-18 01:25:55.090116372 +0100
+@@ -2677,7 +2677,7 @@ i386_push_dummy_call (struct gdbarch *gd
+ gdb_byte buf[4];
+ int i;
+ int write_pass;
+- int args_space = 0;
++ LONGEST args_space = 0;
+
+ /* BND registers can be in arbitrary values at the moment of the
+ inferior call. This can cause boundary violations that are not
+@@ -2692,7 +2692,7 @@ i386_push_dummy_call (struct gdbarch *gd
+
+ for (write_pass = 0; write_pass < 2; write_pass++)
+ {
+- int args_space_used = 0;
++ LONGEST args_space_used = 0;
+
+ if (struct_return)
+ {
+@@ -2709,7 +2709,7 @@ i386_push_dummy_call (struct gdbarch *gd
+
+ for (i = 0; i < nargs; i++)
+ {
+- int len = TYPE_LENGTH (value_enclosing_type (args[i]));
++ LONGEST len = TYPE_LENGTH (value_enclosing_type (args[i]));
+
+ if (write_pass)
+ {
+@@ -2916,7 +2916,7 @@ i386_reg_struct_return_p (struct gdbarch
+ {
+ struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
+ enum type_code code = TYPE_CODE (type);
+- int len = TYPE_LENGTH (type);
++ LONGEST len = TYPE_LENGTH (type);
+
+ gdb_assert (code == TYPE_CODE_STRUCT
+ || code == TYPE_CODE_UNION
+@@ -3726,7 +3726,7 @@ static int
+ i386_convert_register_p (struct gdbarch *gdbarch,
+ int regnum, struct type *type)
+ {
+- int len = TYPE_LENGTH (type);
++ LONGEST len = TYPE_LENGTH (type);
+
+ /* Values may be spread across multiple registers. Most debugging
+ formats aren't expressive enough to specify the locations, so
+@@ -3759,7 +3759,7 @@ i386_register_to_value (struct frame_inf
+ int *optimizedp, int *unavailablep)
+ {
+ struct gdbarch *gdbarch = get_frame_arch (frame);
+- int len = TYPE_LENGTH (type);
++ LONGEST len = TYPE_LENGTH (type);
+
+ if (i386_fp_regnum_p (gdbarch, regnum))
+ return i387_register_to_value (frame, regnum, type, to,
+@@ -3795,7 +3795,7 @@ static void
+ i386_value_to_register (struct frame_info *frame, int regnum,
+ struct type *type, const gdb_byte *from)
+ {
+- int len = TYPE_LENGTH (type);
++ LONGEST len = TYPE_LENGTH (type);
+
+ if (i386_fp_regnum_p (get_frame_arch (frame), regnum))
+ {
+diff -Naurp insight-8.1.50.20180216.orig/gdb/iq2000-tdep.c insight-8.1.50.20180216.new/gdb/iq2000-tdep.c
+--- insight-8.1.50.20180216.orig/gdb/iq2000-tdep.c 2018-01-04 17:43:15.000000000 +0100
++++ insight-8.1.50.20180216.new/gdb/iq2000-tdep.c 2018-02-18 01:25:55.091116382 +0100
+@@ -651,8 +651,9 @@ iq2000_push_dummy_call (struct gdbarch *
+ const bfd_byte *val;
+ bfd_byte buf[4];
+ struct type *type;
+- int i, argreg, typelen, slacklen;
+- int stackspace = 0;
++ int i, argreg, slacklen;
++ LONGEST typelen;
++ LONGEST stackspace = 0;
+ /* Used to copy struct arguments into the stack. */
+ CORE_ADDR struct_ptr;
+
+diff -Naurp insight-8.1.50.20180216.orig/gdb/m32r-tdep.c insight-8.1.50.20180216.new/gdb/m32r-tdep.c
+--- insight-8.1.50.20180216.orig/gdb/m32r-tdep.c 2018-02-09 15:06:40.000000000 +0100
++++ insight-8.1.50.20180216.new/gdb/m32r-tdep.c 2018-02-18 01:25:55.091116382 +0100
+@@ -671,7 +671,7 @@ m32r_push_dummy_call (struct gdbarch *gd
+ CORE_ADDR regval;
+ gdb_byte *val;
+ gdb_byte valbuf[M32R_ARG_REGISTER_SIZE];
+- int len;
++ LONGEST len;
+
+ /* First force sp to a 4-byte alignment. */
+ sp = sp & ~3;
+diff -Naurp insight-8.1.50.20180216.orig/gdb/m68k-tdep.c insight-8.1.50.20180216.new/gdb/m68k-tdep.c
+--- insight-8.1.50.20180216.orig/gdb/m68k-tdep.c 2018-01-04 17:43:15.000000000 +0100
++++ insight-8.1.50.20180216.new/gdb/m68k-tdep.c 2018-02-18 01:25:55.091116382 +0100
+@@ -373,7 +373,7 @@ m68k_reg_struct_return_p (struct gdbarch
+ {
+ struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
+ enum type_code code = TYPE_CODE (type);
+- int len = TYPE_LENGTH (type);
++ LONGEST len = TYPE_LENGTH (type);
+
+ gdb_assert (code == TYPE_CODE_STRUCT || code == TYPE_CODE_UNION
+ || code == TYPE_CODE_COMPLEX);
+@@ -505,9 +505,9 @@ m68k_push_dummy_call (struct gdbarch *gd
+ for (i = nargs - 1; i >= 0; i--)
+ {
+ struct type *value_type = value_enclosing_type (args[i]);
+- int len = TYPE_LENGTH (value_type);
+- int container_len = (len + 3) & ~3;
+- int offset;
++ LONGEST len = TYPE_LENGTH (value_type);
++ LONGEST container_len = (len + 3) & ~3;
++ LONGEST offset;
+
+ /* Non-scalars bigger than 4 bytes are left aligned, others are
+ right aligned. */
+diff -Naurp insight-8.1.50.20180216.orig/gdb/m88k-tdep.c insight-8.1.50.20180216.new/gdb/m88k-tdep.c
+--- insight-8.1.50.20180216.orig/gdb/m88k-tdep.c 2018-01-04 17:43:15.000000000 +0100
++++ insight-8.1.50.20180216.new/gdb/m88k-tdep.c 2018-02-18 01:25:55.091116382 +0100
+@@ -254,13 +254,13 @@ m88k_store_arguments (struct regcache *r
+ {
+ struct gdbarch *gdbarch = regcache->arch ();
+ int num_register_words = 0;
+- int num_stack_words = 0;
++ LONGEST num_stack_words = 0;
+ int i;
+
+ for (i = 0; i < nargs; i++)
+ {
+ struct type *type = value_type (args[i]);
+- int len = TYPE_LENGTH (type);
++ LONGEST len = TYPE_LENGTH (type);
+
+ if (m88k_integral_or_pointer_p (type) && len < 4)
+ {
+@@ -302,8 +302,8 @@ m88k_store_arguments (struct regcache *r
+ {
+ const bfd_byte *valbuf = value_contents (args[i]);
+ struct type *type = value_type (args[i]);
+- int len = TYPE_LENGTH (type);
+- int stack_word = num_stack_words;
++ LONGEST len = TYPE_LENGTH (type);
++ LONGEST stack_word = num_stack_words;
+
+ if (m88k_in_register_p (type))
+ {
+diff -Naurp insight-8.1.50.20180216.orig/gdb/mep-tdep.c insight-8.1.50.20180216.new/gdb/mep-tdep.c
+--- insight-8.1.50.20180216.orig/gdb/mep-tdep.c 2018-02-09 15:06:40.000000000 +0100
++++ insight-8.1.50.20180216.new/gdb/mep-tdep.c 2018-02-18 01:25:55.091116382 +0100
+@@ -2244,7 +2244,7 @@ push_large_arguments (CORE_ADDR sp, int
+
+ for (i = 0; i < argc; i++)
+ {
+- unsigned arg_len = TYPE_LENGTH (value_type (argv[i]));
++ ULONGEST arg_len = TYPE_LENGTH (value_type (argv[i]));
+
+ if (arg_len > MEP_GPR_SIZE)
+ {
+diff -Naurp insight-8.1.50.20180216.orig/gdb/mips-tdep.c insight-8.1.50.20180216.new/gdb/mips-tdep.c
+--- insight-8.1.50.20180216.orig/gdb/mips-tdep.c 2018-01-26 13:46:47.000000000 +0100
++++ insight-8.1.50.20180216.new/gdb/mips-tdep.c 2018-02-18 01:25:55.092116391 +0100
+@@ -477,7 +477,7 @@ static void
+ mips_xfer_register (struct gdbarch *gdbarch, struct regcache *regcache,
+ int reg_num, int length,
+ enum bfd_endian endian, gdb_byte *in,
+- const gdb_byte *out, int buf_offset)
++ const gdb_byte *out, LONGEST buf_offset)
+ {
+ int reg_offset = 0;
+
+@@ -500,8 +500,8 @@ mips_xfer_register (struct gdbarch *gdba
+ }
+ if (mips_debug)
+ fprintf_unfiltered (gdb_stderr,
+- "xfer $%d, reg offset %d, buf offset %d, length %d, ",
+- reg_num, reg_offset, buf_offset, length);
++ "xfer $%d, reg offset %d, buf offset %s, length %d, ",
++ reg_num, reg_offset, plongest (buf_offset), length);
+ if (mips_debug && out != NULL)
+ {
+ int i;
+@@ -4533,13 +4533,13 @@ mips_eabi_push_dummy_call (struct gdbarc
+ gdb_byte ref_valbuf[MAX_MIPS_ABI_REGSIZE];
+ struct value *arg = args[argnum];
+ struct type *arg_type = check_typedef (value_type (arg));
+- int len = TYPE_LENGTH (arg_type);
++ LONGEST len = TYPE_LENGTH (arg_type);
+ enum type_code typecode = TYPE_CODE (arg_type);
+
+ if (mips_debug)
+ fprintf_unfiltered (gdb_stdlog,
+- "mips_eabi_push_dummy_call: %d len=%d type=%d",
+- argnum + 1, len, (int) typecode);
++ "mips_eabi_push_dummy_call: %d len=%s type=%d",
++ argnum + 1, plongest (len), (int) typecode);
+
+ /* The EABI passes structures that do not fit in a register by
+ reference. */
+@@ -4809,7 +4809,7 @@ mips_eabi_return_value (struct gdbarch *
+
+ static int
+ mips_n32n64_fp_arg_chunk_p (struct gdbarch *gdbarch, struct type *arg_type,
+- int offset)
++ LONGEST offset)
+ {
+ int i;
+
+@@ -4824,7 +4824,7 @@ mips_n32n64_fp_arg_chunk_p (struct gdbar
+
+ for (i = 0; i < TYPE_NFIELDS (arg_type); i++)
+ {
+- int pos;
++ LONGEST pos;
+ struct type *field_type;
+
+ /* We're only looking at normal fields. */
+@@ -4866,7 +4866,7 @@ mips_n32n64_push_dummy_call (struct gdba
+ int argreg;
+ int float_argreg;
+ int argnum;
+- int len = 0;
++ LONGEST len = 0;
+ int stack_offset = 0;
+ enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
+ CORE_ADDR func_addr = find_function_addr (function, NULL);
+@@ -5217,11 +5217,11 @@ mips_n32n64_return_value (struct gdbarch
+ : MIPS_V0_REGNUM);
+ field < TYPE_NFIELDS (type); field++, regnum += 2)
+ {
+- int offset = (FIELD_BITPOS (TYPE_FIELDS (type)[field])
+- / TARGET_CHAR_BIT);
++ LONGEST offset = (FIELD_BITPOS (TYPE_FIELDS (type)[field])
++ / TARGET_CHAR_BIT);
+ if (mips_debug)
+- fprintf_unfiltered (gdb_stderr, "Return float struct+%d\n",
+- offset);
++ fprintf_unfiltered (gdb_stderr, "Return float struct+%s\n",
++ plongest (offset));
+ if (TYPE_LENGTH (TYPE_FIELD_TYPE (type, field)) == 16)
+ {
+ /* A 16-byte long double field goes in two consecutive
+@@ -5263,8 +5263,8 @@ mips_n32n64_return_value (struct gdbarch
+ if (offset + xfer > TYPE_LENGTH (type))
+ xfer = TYPE_LENGTH (type) - offset;
+ if (mips_debug)
+- fprintf_unfiltered (gdb_stderr, "Return struct+%d:%d in $%d\n",
+- offset, xfer, regnum);
++ fprintf_unfiltered (gdb_stderr, "Return struct+%s:%d in $%d\n",
++ plongest (offset), xfer, regnum);
+ mips_xfer_register (gdbarch, regcache,
+ gdbarch_num_regs (gdbarch) + regnum,
+ xfer, BFD_ENDIAN_UNKNOWN, readbuf, writebuf,
+@@ -5322,7 +5322,7 @@ mips_o32_push_dummy_call (struct gdbarch
+ int argreg;
+ int float_argreg;
+ int argnum;
+- int len = 0;
++ LONGEST len = 0;
+ int stack_offset = 0;
+ enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
+ CORE_ADDR func_addr = find_function_addr (function, NULL);
+@@ -5386,13 +5386,13 @@ mips_o32_push_dummy_call (struct gdbarch
+ const gdb_byte *val;
+ struct value *arg = args[argnum];
+ struct type *arg_type = check_typedef (value_type (arg));
+- int len = TYPE_LENGTH (arg_type);
++ LONGEST len = TYPE_LENGTH (arg_type);
+ enum type_code typecode = TYPE_CODE (arg_type);
+
+ if (mips_debug)
+ fprintf_unfiltered (gdb_stdlog,
+- "mips_o32_push_dummy_call: %d len=%d type=%d",
+- argnum + 1, len, (int) typecode);
++ "mips_o32_push_dummy_call: %d len=%s type=%d",
++ argnum + 1, plongest (len), (int) typecode);
+
+ val = value_contents (arg);
+
+@@ -5846,8 +5846,8 @@ mips_o64_push_dummy_call (struct gdbarch
+ int argreg;
+ int float_argreg;
+ int argnum;
+- int len = 0;
+- int stack_offset = 0;
++ LONGEST len = 0;
++ LONGEST stack_offset = 0;
+ enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
+ CORE_ADDR func_addr = find_function_addr (function, NULL);
+
+@@ -5907,13 +5907,13 @@ mips_o64_push_dummy_call (struct gdbarch
+ const gdb_byte *val;
+ struct value *arg = args[argnum];
+ struct type *arg_type = check_typedef (value_type (arg));
+- int len = TYPE_LENGTH (arg_type);
++ LONGEST len = TYPE_LENGTH (arg_type);
+ enum type_code typecode = TYPE_CODE (arg_type);
+
+ if (mips_debug)
+ fprintf_unfiltered (gdb_stdlog,
+- "mips_o64_push_dummy_call: %d len=%d type=%d",
+- argnum + 1, len, (int) typecode);
++ "mips_o64_push_dummy_call: %d len=%s type=%d",
++ argnum + 1, plongest (len), (int) typecode);
+
+ val = value_contents (arg);
+
+diff -Naurp insight-8.1.50.20180216.orig/gdb/mn10300-tdep.c insight-8.1.50.20180216.new/gdb/mn10300-tdep.c
+--- insight-8.1.50.20180216.orig/gdb/mn10300-tdep.c 2018-02-09 15:06:40.000000000 +0100
++++ insight-8.1.50.20180216.new/gdb/mn10300-tdep.c 2018-02-18 01:25:55.092116391 +0100
+@@ -1198,7 +1198,7 @@ mn10300_push_dummy_call (struct gdbarch
+ enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
+ const int push_size = register_size (gdbarch, E_PC_REGNUM);
+ int regs_used;
+- int len, arg_len;
++ LONGEST len, arg_len;
+ int stack_offset = 0;
+ int argnum;
+ const gdb_byte *val;
+diff -Naurp insight-8.1.50.20180216.orig/gdb/ppc-sysv-tdep.c insight-8.1.50.20180216.new/gdb/ppc-sysv-tdep.c
+--- insight-8.1.50.20180216.orig/gdb/ppc-sysv-tdep.c 2018-01-04 17:43:15.000000000 +0100
++++ insight-8.1.50.20180216.new/gdb/ppc-sysv-tdep.c 2018-02-18 01:29:33.376144677 +0100
+@@ -68,7 +68,7 @@ ppc_sysv_abi_push_dummy_call (struct gdb
+ enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
+ int opencl_abi = ppc_sysv_use_opencl_abi (value_type (function));
+ ULONGEST saved_sp;
+- int argspace = 0; /* 0 is an initial wrong guess. */
++ LONGEST argspace = 0; /* 0 is an initial wrong guess. */
+ int write_pass;
+
+ gdb_assert (tdep->wordsize == 4);
+@@ -99,9 +99,9 @@ ppc_sysv_abi_push_dummy_call (struct gdb
+ /* Next available vector register for vector arguments. */
+ int vreg = 2;
+ /* Arguments start above the "LR save word" and "Back chain". */
+- int argoffset = 2 * tdep->wordsize;
++ LONGEST argoffset = 2 * tdep->wordsize;
+ /* Structures start after the arguments. */
+- int structoffset = argoffset + argspace;
++ LONGEST structoffset = argoffset + argspace;
+
+ /* If the function is returning a `struct', then the first word
+ (which will be passed in r3) is used for struct return
+@@ -120,7 +120,7 @@ ppc_sysv_abi_push_dummy_call (struct gdb
+ {
+ struct value *arg = args[argno];
+ struct type *type = check_typedef (value_type (arg));
+- int len = TYPE_LENGTH (type);
++ ssize_t len = TYPE_LENGTH (type);
+ const bfd_byte *val = value_contents (arg);
+
+ if (TYPE_CODE (type) == TYPE_CODE_FLT && len <= 8
+@@ -1285,11 +1285,11 @@ struct ppc64_sysv_argpos
+
+ static void
+ ppc64_sysv_abi_push_val (struct gdbarch *gdbarch,
+- const bfd_byte *val, int len, int align,
++ const bfd_byte *val, ssize_t len, int align,
+ struct ppc64_sysv_argpos *argpos)
+ {
+ struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
+- int offset = 0;
++ LONGEST offset = 0;
+
+ /* Enforce alignment of stack location, if requested. */
+ if (align > tdep->wordsize)
+@@ -1327,7 +1327,7 @@ ppc64_sysv_abi_push_val (struct gdbarch
+ if (argpos->regcache && argpos->greg <= 10)
+ regcache_cooked_write_part (argpos->regcache,
+ tdep->ppc_gp0_regnum + argpos->greg,
+- offset, len, val);
++ offset, (LONGEST) len, val);
+ argpos->greg++;
+ }
+ }
+@@ -1386,7 +1386,7 @@ ppc64_sysv_abi_push_freg (struct gdbarch
+ if (argpos->regcache && argpos->freg <= 13)
+ {
+ int regnum = tdep->ppc_fp0_regnum + argpos->freg;
+- int offset = 0;
++ LONGEST offset = 0;
+
+ if (gdbarch_byte_order (gdbarch) == BFD_ENDIAN_BIG)
+ offset = 8 - TYPE_LENGTH (type);
+@@ -1836,7 +1836,7 @@ ppc64_sysv_abi_return_value_base (struct
+ && TYPE_CODE (valtype) == TYPE_CODE_DECFLOAT)
+ {
+ int regnum = tdep->ppc_fp0_regnum + 1 + index;
+- int offset = 0;
++ LONGEST offset = 0;
+
+ if (gdbarch_byte_order (gdbarch) == BFD_ENDIAN_BIG)
+ offset = 8 - TYPE_LENGTH (valtype);
+@@ -1912,7 +1912,7 @@ ppc64_sysv_abi_return_value_base (struct
+ && TYPE_CODE (valtype) == TYPE_CODE_ARRAY && TYPE_VECTOR (valtype))
+ {
+ int regnum = tdep->ppc_gp0_regnum + 3 + index;
+- int offset = 0;
++ LONGEST offset = 0;
+
+ if (gdbarch_byte_order (gdbarch) == BFD_ENDIAN_BIG)
+ offset = 8 - TYPE_LENGTH (valtype);
+@@ -2020,7 +2020,8 @@ ppc64_sysv_abi_return_value (struct gdba
+ && TYPE_LENGTH (TYPE_TARGET_TYPE (valtype)) == 1)
+ {
+ int regnum = tdep->ppc_gp0_regnum + 3;
+- int offset = (register_size (gdbarch, regnum) - TYPE_LENGTH (valtype));
++ LONGEST offset
++ = (register_size (gdbarch, regnum) - TYPE_LENGTH (valtype));
+
+ if (writebuf != NULL)
+ regcache_cooked_write_part (regcache, regnum,
+diff -Naurp insight-8.1.50.20180216.orig/gdb/rl78-tdep.c insight-8.1.50.20180216.new/gdb/rl78-tdep.c
+--- insight-8.1.50.20180216.orig/gdb/rl78-tdep.c 2018-01-26 13:46:47.000000000 +0100
++++ insight-8.1.50.20180216.new/gdb/rl78-tdep.c 2018-02-18 01:29:33.377144686 +0100
+@@ -1346,8 +1346,8 @@ rl78_push_dummy_call (struct gdbarch *gd
+ for (i = nargs - 1; i >= 0; i--)
+ {
+ struct type *value_type = value_enclosing_type (args[i]);
+- int len = TYPE_LENGTH (value_type);
+- int container_len = (len + 1) & ~1;
++ LONGEST len = TYPE_LENGTH (value_type);
++ LONGEST container_len = (len + 1) & ~1;
+
+ sp -= container_len;
+ write_memory (rl78_make_data_address (sp),
+diff -Naurp insight-8.1.50.20180216.orig/gdb/rs6000-aix-tdep.c insight-8.1.50.20180216.new/gdb/rs6000-aix-tdep.c
+--- insight-8.1.50.20180216.orig/gdb/rs6000-aix-tdep.c 2018-01-04 17:43:15.000000000 +0100
++++ insight-8.1.50.20180216.new/gdb/rs6000-aix-tdep.c 2018-02-18 01:29:33.377144686 +0100
+@@ -187,9 +187,9 @@ rs6000_push_dummy_call (struct gdbarch *
+ struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
+ enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
+ int ii;
+- int len = 0;
++ LONGEST len = 0;
+ int argno; /* current argument number */
+- int argbytes; /* current argument byte */
++ LONGEST argbytes; /* current argument byte */
+ gdb_byte tmp_buffer[50];
+ int f_argno = 0; /* current floating point argno */
+ int wordsize = gdbarch_tdep (gdbarch)->wordsize;
+@@ -319,7 +319,7 @@ ran_out_of_registers_for_arguments:
+
+ if ((argno < nargs) || argbytes)
+ {
+- int space = 0, jj;
++ LONGEST space = 0, jj;
+
+ if (argbytes)
+ {
+diff -Naurp insight-8.1.50.20180216.orig/gdb/s390-tdep.c insight-8.1.50.20180216.new/gdb/s390-tdep.c
+--- insight-8.1.50.20180216.orig/gdb/s390-tdep.c 2018-02-02 13:28:13.000000000 +0100
++++ insight-8.1.50.20180216.new/gdb/s390-tdep.c 2018-02-18 01:47:13.589382630 +0100
+@@ -1653,7 +1653,7 @@ s390_function_arg_vector (struct type *t
+ /* Determine whether N is a power of two. */
+
+ static int
+-is_power_of_two (unsigned int n)
++is_power_of_two (ULONGEST n)
+ {
+ return n && ((n & (n - 1)) == 0);
+ }
+@@ -1710,7 +1710,7 @@ s390_handle_arg (struct s390_arg_state *
+ enum bfd_endian byte_order, int is_unnamed)
+ {
+ struct type *type = check_typedef (value_type (arg));
+- unsigned int length = TYPE_LENGTH (type);
++ LONGEST length = TYPE_LENGTH (type);
+ int write_mode = as->regcache != NULL;
+
+ if (s390_function_arg_float (type))
+@@ -1975,7 +1975,7 @@ s390_register_return_value (struct gdbar
+ {
+ enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
+ int word_size = gdbarch_ptr_bit (gdbarch) / 8;
+- int length = TYPE_LENGTH (type);
++ LONGEST length = TYPE_LENGTH (type);
+ int code = TYPE_CODE (type);
+
+ if (code == TYPE_CODE_FLT || code == TYPE_CODE_DECFLOAT)
+diff -Naurp insight-8.1.50.20180216.orig/gdb/score-tdep.c insight-8.1.50.20180216.new/gdb/score-tdep.c
+--- insight-8.1.50.20180216.orig/gdb/score-tdep.c 2018-01-04 17:43:15.000000000 +0100
++++ insight-8.1.50.20180216.new/gdb/score-tdep.c 2018-02-18 01:29:33.378144695 +0100
+@@ -516,7 +516,7 @@ score_push_dummy_call (struct gdbarch *g
+ enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
+ int argnum;
+ int argreg;
+- int arglen = 0;
++ LONGEST arglen = 0;
+ CORE_ADDR stack_offset = 0;
+ CORE_ADDR addr = 0;
+
+diff -Naurp insight-8.1.50.20180216.orig/gdb/sh64-tdep.c insight-8.1.50.20180216.new/gdb/sh64-tdep.c
+--- insight-8.1.50.20180216.orig/gdb/sh64-tdep.c 2018-01-26 13:46:47.000000000 +0100
++++ insight-8.1.50.20180216.new/gdb/sh64-tdep.c 2018-02-18 01:29:33.379144705 +0100
+@@ -1079,7 +1079,7 @@ sh64_push_dummy_call (struct gdbarch *gd
+ CORE_ADDR struct_addr)
+ {
+ enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
+- int stack_offset, stack_alloc;
++ LONGEST stack_offset, stack_alloc;
+ int int_argreg;
+ int float_arg_index = 0;
+ int double_arg_index = 0;
+@@ -1088,7 +1088,7 @@ sh64_push_dummy_call (struct gdbarch *gd
+ CORE_ADDR regval;
+ const gdb_byte *val;
+ gdb_byte valbuf[8];
+- int len;
++ LONGEST len;
+ int argreg_size;
+ int fp_args[12];
+
+diff -Naurp insight-8.1.50.20180216.orig/gdb/sh-tdep.c insight-8.1.50.20180216.new/gdb/sh-tdep.c
+--- insight-8.1.50.20180216.orig/gdb/sh-tdep.c 2018-01-26 13:46:47.000000000 +0100
++++ insight-8.1.50.20180216.new/gdb/sh-tdep.c 2018-02-18 01:29:33.379144705 +0100
+@@ -813,7 +813,7 @@ sh_skip_prologue (struct gdbarch *gdbarc
+ static int
+ sh_use_struct_convention (int renesas_abi, struct type *type)
+ {
+- int len = TYPE_LENGTH (type);
++ LONGEST len = TYPE_LENGTH (type);
+ int nelem = TYPE_NFIELDS (type);
+
+ /* The Renesas ABI returns aggregate types always on stack. */
+@@ -915,7 +915,7 @@ sh_frame_align (struct gdbarch *ignore,
+
+ /* Helper function to justify value in register according to endianess. */
+ static const gdb_byte *
+-sh_justify_value_in_reg (struct gdbarch *gdbarch, struct value *val, int len)
++sh_justify_value_in_reg (struct gdbarch *gdbarch, struct value *val, LONGEST len)
+ {
+ static gdb_byte valbuf[4];
+
+@@ -1075,7 +1075,8 @@ sh_push_dummy_call_fpu (struct gdbarch *
+ struct type *type;
+ CORE_ADDR regval;
+ const gdb_byte *val;
+- int len, reg_size = 0;
++ LONGEST len;
++ int reg_size = 0;
+ int pass_on_stack = 0;
+ int treat_as_flt;
+ int last_reg_arg = INT_MAX;
+@@ -1216,7 +1217,8 @@ sh_push_dummy_call_nofpu (struct gdbarch
+ struct type *type;
+ CORE_ADDR regval;
+ const gdb_byte *val;
+- int len, reg_size = 0;
++ LONGEST len;
++ int reg_size = 0;
+ int pass_on_stack = 0;
+ int last_reg_arg = INT_MAX;
+
+diff -Naurp insight-8.1.50.20180216.orig/gdb/sparc64-tdep.c insight-8.1.50.20180216.new/gdb/sparc64-tdep.c
+--- insight-8.1.50.20180216.orig/gdb/sparc64-tdep.c 2018-01-26 13:46:47.000000000 +0100
++++ insight-8.1.50.20180216.new/gdb/sparc64-tdep.c 2018-02-18 01:29:33.380144714 +0100
+@@ -1205,7 +1205,7 @@ sparc64_16_byte_align_p (struct type *ty
+
+ static void
+ sparc64_store_floating_fields (struct regcache *regcache, struct type *type,
+- const gdb_byte *valbuf, int element, int bitpos)
++ const gdb_byte *valbuf, int element, LONGEST bitpos)
+ {
+ struct gdbarch *gdbarch = regcache->arch ();
+ int len = TYPE_LENGTH (type);
+@@ -1265,7 +1265,7 @@ sparc64_store_floating_fields (struct re
+ for (i = 0; i < TYPE_NFIELDS (type); i++)
+ {
+ struct type *subtype = check_typedef (TYPE_FIELD_TYPE (type, i));
+- int subpos = bitpos + TYPE_FIELD_BITPOS (type, i);
++ LONGEST subpos = bitpos + TYPE_FIELD_BITPOS (type, i);
+
+ sparc64_store_floating_fields (regcache, subtype, valbuf,
+ element, subpos);
+@@ -1297,7 +1297,7 @@ sparc64_store_floating_fields (struct re
+
+ static void
+ sparc64_extract_floating_fields (struct regcache *regcache, struct type *type,
+- gdb_byte *valbuf, int bitpos)
++ gdb_byte *valbuf, LONGEST bitpos)
+ {
+ struct gdbarch *gdbarch = regcache->arch ();
+
+@@ -1353,7 +1353,7 @@ sparc64_extract_floating_fields (struct
+ for (i = 0; i < TYPE_NFIELDS (type); i++)
+ {
+ struct type *subtype = check_typedef (TYPE_FIELD_TYPE (type, i));
+- int subpos = bitpos + TYPE_FIELD_BITPOS (type, i);
++ LONGEST subpos = bitpos + TYPE_FIELD_BITPOS (type, i);
+
+ sparc64_extract_floating_fields (regcache, subtype, valbuf, subpos);
+ }
+@@ -1386,7 +1386,7 @@ sparc64_store_arguments (struct regcache
+ for (i = 0; i < nargs; i++)
+ {
+ struct type *type = value_type (args[i]);
+- int len = TYPE_LENGTH (type);
++ LONGEST len = TYPE_LENGTH (type);
+
+ if (sparc64_structure_or_union_p (type)
+ || (sparc64_complex_floating_p (type) && len == 32))
+@@ -1486,7 +1486,7 @@ sparc64_store_arguments (struct regcache
+ {
+ const gdb_byte *valbuf = value_contents (args[i]);
+ struct type *type = value_type (args[i]);
+- int len = TYPE_LENGTH (type);
++ LONGEST len = TYPE_LENGTH (type);
+ int regnum = -1;
+ gdb_byte buf[16];
+
+diff -Naurp insight-8.1.50.20180216.orig/gdb/spu-tdep.c insight-8.1.50.20180216.new/gdb/spu-tdep.c
+--- insight-8.1.50.20180216.orig/gdb/spu-tdep.c 2018-01-26 13:46:47.000000000 +0100
++++ insight-8.1.50.20180216.new/gdb/spu-tdep.c 2018-02-18 01:29:33.380144714 +0100
+@@ -1430,7 +1430,7 @@ spu_push_dummy_call (struct gdbarch *gdb
+ struct value *arg = args[i];
+ struct type *type = check_typedef (value_type (arg));
+ const gdb_byte *contents = value_contents (arg);
+- int n_regs = align_up (TYPE_LENGTH (type), 16) / 16;
++ LONGEST n_regs = align_up (TYPE_LENGTH (type), 16) / 16;
+
+ /* If the argument doesn't wholly fit into registers, it and
+ all subsequent arguments go to the stack. */
+@@ -1462,7 +1462,7 @@ spu_push_dummy_call (struct gdbarch *gdb
+ {
+ struct value *arg = args[i];
+ struct type *type = check_typedef (value_type (arg));
+- int len = TYPE_LENGTH (type);
++ LONGEST len = TYPE_LENGTH (type);
+ int preferred_slot;
+
+ if (spu_scalar_value_p (type))
+diff -Naurp insight-8.1.50.20180216.orig/gdb/tic6x-tdep.c insight-8.1.50.20180216.new/gdb/tic6x-tdep.c
+--- insight-8.1.50.20180216.orig/gdb/tic6x-tdep.c 2018-01-04 17:43:15.000000000 +0100
++++ insight-8.1.50.20180216.new/gdb/tic6x-tdep.c 2018-02-18 01:29:33.380144714 +0100
+@@ -883,7 +883,7 @@ tic6x_push_dummy_call (struct gdbarch *g
+ int argreg = 0;
+ int argnum;
+ int stack_offset = 4;
+- int references_offset = 4;
++ LONGEST references_offset = 4;
+ CORE_ADDR func_addr = find_function_addr (function, NULL);
+ enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
+ struct type *func_type = value_type (function);
+@@ -917,7 +917,7 @@ tic6x_push_dummy_call (struct gdbarch *g
+ /* Now make space on the stack for the args. */
+ for (argnum = 0; argnum < nargs; argnum++)
+ {
+- int len = align_up (TYPE_LENGTH (value_type (args[argnum])), 4);
++ LONGEST len = align_up (TYPE_LENGTH (value_type (args[argnum])), 4);
+ if (argnum >= 10 - argreg)
+ references_offset += len;
+ stack_offset += len;
+@@ -936,7 +936,7 @@ tic6x_push_dummy_call (struct gdbarch *g
+ const gdb_byte *val;
+ struct value *arg = args[argnum];
+ struct type *arg_type = check_typedef (value_type (arg));
+- int len = TYPE_LENGTH (arg_type);
++ ssize_t len = TYPE_LENGTH (arg_type);
+ enum type_code typecode = TYPE_CODE (arg_type);
+
+ val = value_contents (arg);
+@@ -1096,7 +1096,8 @@ tic6x_push_dummy_call (struct gdbarch *g
+ }
+ else
+ internal_error (__FILE__, __LINE__,
+- _("unexpected length %d of arg %d"), len, argnum);
++ _("unexpected length %s of arg %d"),
++ plongest (len), argnum);
+
+ addr = sp + stack_offset;
+ write_memory (addr, val, len);
+diff -Naurp insight-8.1.50.20180216.orig/gdb/tilegx-tdep.c insight-8.1.50.20180216.new/gdb/tilegx-tdep.c
+--- insight-8.1.50.20180216.orig/gdb/tilegx-tdep.c 2018-01-04 17:43:15.000000000 +0100
++++ insight-8.1.50.20180216.new/gdb/tilegx-tdep.c 2018-02-18 01:29:33.381144723 +0100
+@@ -288,7 +288,7 @@ tilegx_push_dummy_call (struct gdbarch *
+ CORE_ADDR stack_dest = sp;
+ int argreg = TILEGX_R0_REGNUM;
+ int i, j;
+- int typelen, slacklen;
++ LONGEST typelen, slacklen;
+ static const gdb_byte four_zero_words[16] = { 0 };
+
+ /* If struct_return is 1, then the struct return address will
+diff -Naurp insight-8.1.50.20180216.orig/gdb/v850-tdep.c insight-8.1.50.20180216.new/gdb/v850-tdep.c
+--- insight-8.1.50.20180216.orig/gdb/v850-tdep.c 2018-01-04 17:43:15.000000000 +0100
++++ insight-8.1.50.20180216.new/gdb/v850-tdep.c 2018-02-18 01:29:33.381144723 +0100
+@@ -1019,7 +1019,7 @@ v850_push_dummy_call (struct gdbarch *gd
+ enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
+ int argreg;
+ int argnum;
+- int len = 0;
++ LONGEST len = 0;
+ int stack_offset;
+
+ if (gdbarch_tdep (gdbarch)->abi == V850_ABI_RH850)
+@@ -1047,7 +1047,7 @@ v850_push_dummy_call (struct gdbarch *gd
+ in four registers available. Loop thru args from first to last. */
+ for (argnum = 0; argnum < nargs; argnum++)
+ {
+- int len;
++ LONGEST len;
+ gdb_byte *val;
+ gdb_byte valbuf[v850_reg_size];
+
+diff -Naurp insight-8.1.50.20180216.orig/gdb/vax-tdep.c insight-8.1.50.20180216.new/gdb/vax-tdep.c
+--- insight-8.1.50.20180216.orig/gdb/vax-tdep.c 2018-02-18 01:25:08.188666458 +0100
++++ insight-8.1.50.20180216.new/gdb/vax-tdep.c 2018-02-18 01:29:33.381144723 +0100
+@@ -110,7 +110,7 @@ vax_store_arguments (struct regcache *re
+ struct gdbarch *gdbarch = regcache->arch ();
+ enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
+ gdb_byte buf[4];
+- int count = 0;
++ LONGEST count = 0;
+ int i;
+
+ /* We create an argument list on the stack, and make the argument
+@@ -119,7 +119,7 @@ vax_store_arguments (struct regcache *re
+ /* Push arguments in reverse order. */
+ for (i = nargs - 1; i >= 0; i--)
+ {
+- int len = TYPE_LENGTH (value_enclosing_type (args[i]));
++ LONGEST len = TYPE_LENGTH (value_enclosing_type (args[i]));
+
+ sp -= (len + 3) & ~3;
+ count += (len + 3) / 4;
+diff -Naurp insight-8.1.50.20180216.orig/gdb/xstormy16-tdep.c insight-8.1.50.20180216.new/gdb/xstormy16-tdep.c
+--- insight-8.1.50.20180216.orig/gdb/xstormy16-tdep.c 2018-01-04 17:43:15.000000000 +0100
++++ insight-8.1.50.20180216.new/gdb/xstormy16-tdep.c 2018-02-18 01:29:33.381144723 +0100
+@@ -232,8 +232,9 @@ xstormy16_push_dummy_call (struct gdbarc
+ enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
+ CORE_ADDR stack_dest = sp;
+ int argreg = E_1ST_ARG_REGNUM;
+- int i, j;
+- int typelen, slacklen;
++ int i, slacklen;
++ LONGEST j;
++ LONGEST typelen;
+ const gdb_byte *val;
+ gdb_byte buf[xstormy16_pc_size];
+
+diff -Naurp insight-8.1.50.20180216.orig/gdb/xtensa-tdep.c insight-8.1.50.20180216.new/gdb/xtensa-tdep.c
+--- insight-8.1.50.20180216.orig/gdb/xtensa-tdep.c 2018-01-26 13:46:47.000000000 +0100
++++ insight-8.1.50.20180216.new/gdb/xtensa-tdep.c 2018-02-18 01:29:33.382144733 +0100
+@@ -1627,8 +1627,7 @@ xtensa_store_return_value (struct type *
+
+ if (len > (callsize > 8 ? 8 : 16))
+ internal_error (__FILE__, __LINE__,
+- _("unimplemented for this length: %d"),
+- TYPE_LENGTH (type));
++ _("unimplemented for this length: %d"), len);
+ areg = arreg_number (gdbarch,
+ gdbarch_tdep (gdbarch)->a0_base + 2 + callsize, wb);
+
+@@ -1702,18 +1701,18 @@ xtensa_push_dummy_call (struct gdbarch *
+ {
+ enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
+ int i;
+- int size, onstack_size;
++ LONGEST size, onstack_size;
+ gdb_byte *buf = (gdb_byte *) alloca (16);
+ CORE_ADDR ra, ps;
+ struct argument_info
+ {
+ const bfd_byte *contents;
+- int length;
++ ssize_t length;
+ int onstack; /* onstack == 0 => in reg */
+ int align; /* alignment */
+ union
+ {
+- int offset; /* stack offset if on stack. */
++ ssize_t offset; /* stack offset if on stack. */
+ int regno; /* regno if in register. */
+ } u;
+ };
+@@ -1737,9 +1736,10 @@ xtensa_push_dummy_call (struct gdbarch *
+ {
+ struct value *arg = args[i];
+ struct type *arg_type = check_typedef (value_type (arg));
+- fprintf_unfiltered (gdb_stdlog, "%2d: %s %3d ", i,
+- host_address_to_string (arg),
+- TYPE_LENGTH (arg_type));
++ const char *arg_type_len_s = pulongest (TYPE_LENGTH (arg_type));
++
++ fprintf_unfiltered (gdb_stdlog, "%2d: %s %s ", i,
++ host_address_to_string (arg), arg_type_len_s);
+ switch (TYPE_CODE (arg_type))
+ {
+ case TYPE_CODE_INT:
+@@ -1809,8 +1809,8 @@ xtensa_push_dummy_call (struct gdbarch *
+ info->align = TYPE_LENGTH (builtin_type (gdbarch)->builtin_long);
+ break;
+ }
+- info->length = TYPE_LENGTH (arg_type);
+ info->contents = value_contents (arg);
++ info->length = TYPE_LENGTH (arg_type);
+
+ /* Align size and onstack_size. */
+ size = (size + info->align - 1) & ~(info->align - 1);
+@@ -1855,7 +1855,7 @@ xtensa_push_dummy_call (struct gdbarch *
+
+ if (info->onstack)
+ {
+- int n = info->length;
++ ssize_t n = info->length;
+ CORE_ADDR offset = sp + info->u.offset;
+
+ /* Odd-sized structs are aligned to the lower side of a memory
+@@ -1871,7 +1871,7 @@ xtensa_push_dummy_call (struct gdbarch *
+ }
+ else
+ {
+- int n = info->length;
++ ssize_t n = info->length;
+ const bfd_byte *cp = info->contents;
+ int r = info->u.regno;
+
diff --git a/insight-8.1-gdb-vla-intel-fortran-vla-strings.patch b/insight-8.1-gdb-vla-intel-fortran-vla-strings.patch
new file mode 100644
index 0000000..4936a4f
--- /dev/null
+++ b/insight-8.1-gdb-vla-intel-fortran-vla-strings.patch
@@ -0,0 +1,1321 @@
+diff -Naurp insight-8.1.50.20180216.orig/gdb/c-valprint.c insight-8.1.50.20180216.new/gdb/c-valprint.c
+--- insight-8.1.50.20180216.orig/gdb/c-valprint.c 2018-01-12 03:18:43.000000000 +0100
++++ insight-8.1.50.20180216.new/gdb/c-valprint.c 2018-02-17 14:58:10.995392193 +0100
+@@ -653,6 +653,28 @@ c_value_print (struct value *val, struct
+ else
+ {
+ /* normal case */
++ if (TYPE_CODE (type) == TYPE_CODE_PTR
++ && 1 == is_dynamic_type (type))
++ {
++ CORE_ADDR addr;
++ if (NULL != TYPE_DATA_LOCATION (TYPE_TARGET_TYPE (type)))
++ addr = value_address (val);
++ else
++ addr = value_as_address (val);
++
++ /* We resolve the target-type only when the
++ pointer is associated. */
++ if ((addr != 0)
++ && (0 == type_not_associated (type)))
++ TYPE_TARGET_TYPE (type) =
++ resolve_dynamic_type (TYPE_TARGET_TYPE (type),
++ NULL, addr);
++ }
++ else
++ {
++ /* Do nothing. References are already resolved from the beginning,
++ only pointers are resolved when we actual need the target. */
++ }
+ fprintf_filtered (stream, "(");
+ type_print (value_type (val), "", stream, -1);
+ fprintf_filtered (stream, ") ");
+diff -Naurp insight-8.1.50.20180216.orig/gdb/dwarf2read.c insight-8.1.50.20180216.new/gdb/dwarf2read.c
+--- insight-8.1.50.20180216.orig/gdb/dwarf2read.c 2018-02-17 14:57:12.613814424 +0100
++++ insight-8.1.50.20180216.new/gdb/dwarf2read.c 2018-02-17 15:22:19.927537926 +0100
+@@ -2108,7 +2108,8 @@ static void read_signatured_type (struct
+
+ static int attr_to_dynamic_prop (const struct attribute *attr,
+ struct die_info *die, struct dwarf2_cu *cu,
+- struct dynamic_prop *prop);
++ struct dynamic_prop *prop, const gdb_byte *additional_data,
++ int additional_data_size);
+
+ /* memory allocation interface */
+
+@@ -13846,7 +13847,7 @@ read_func_scope (struct die_info *die, s
+ {
+ newobj->static_link
+ = XOBNEW (&objfile->objfile_obstack, struct dynamic_prop);
+- attr_to_dynamic_prop (attr, die, cu, newobj->static_link);
++ attr_to_dynamic_prop (attr, die, cu, newobj->static_link, NULL, 0);
+ }
+
+ cu->list_in_scope = &local_symbols;
+@@ -16434,7 +16435,8 @@ read_array_type (struct die_info *die, s
+
+ 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);
+ if (!stride_ok)
+ {
+ complaint (&symfile_complaints,
+@@ -17186,29 +17188,94 @@ read_tag_string_type (struct die_info *d
+ struct gdbarch *gdbarch = get_objfile_arch (objfile);
+ struct type *type, *range_type, *index_type, *char_type;
+ struct attribute *attr;
+- unsigned int length;
++ unsigned int length = UINT_MAX;
+
++ index_type = objfile_type (objfile)->builtin_int;
++ range_type = create_static_range_type (NULL, index_type, 1, length);
++
++ /* If DW_AT_string_length is defined, the length is stored in memory. */
+ attr = dwarf2_attr (die, DW_AT_string_length, cu);
+ if (attr)
+ {
+- length = DW_UNSND (attr);
++ if (attr_form_is_block (attr))
++ {
++ struct attribute *byte_size, *bit_size;
++ struct dynamic_prop high;
++
++ byte_size = dwarf2_attr (die, DW_AT_byte_size, cu);
++ bit_size = dwarf2_attr (die, DW_AT_bit_size, cu);
++
++ /* DW_AT_byte_size should never occur in combination with
++ DW_AT_bit_size. */
++ if (byte_size != NULL && bit_size != NULL)
++ complaint (&symfile_complaints,
++ _("DW_AT_byte_size AND "
++ "DW_AT_bit_size found together at the same time."));
++
++ /* If DW_AT_string_length AND DW_AT_byte_size exist together,
++ DW_AT_byte_size describes the number of bytes that should be read
++ from the length memory location. */
++ if (byte_size != NULL)
++ {
++ /* Build new dwarf2_locexpr_baton structure with additions to the
++ data attribute, to reflect DWARF specialities to get address
++ sizes. */
++ const gdb_byte append_ops[] =
++ {
++ /* DW_OP_deref_size: size of an address on the target machine
++ (bytes), where the size will be specified by the next
++ operand. */
++ DW_OP_deref_size,
++ /* Operand for DW_OP_deref_size. */
++ DW_UNSND(byte_size) };
++
++ if (!attr_to_dynamic_prop (attr, die, cu, &high, append_ops,
++ ARRAY_SIZE(append_ops)))
++ complaint (&symfile_complaints,
++ _("Could not parse DW_AT_byte_size"));
++ }
++ else if (bit_size != NULL)
++ complaint (&symfile_complaints,
++ _("DW_AT_string_length AND "
++ "DW_AT_bit_size found but not supported yet."));
++ /* If DW_AT_string_length WITHOUT DW_AT_byte_size exist, the default
++ is the address size of the target machine. */
++ else
++ {
++ const gdb_byte append_ops[] =
++ { DW_OP_deref };
++
++ if (!attr_to_dynamic_prop (attr, die, cu, &high, append_ops,
++ ARRAY_SIZE(append_ops)))
++ complaint (&symfile_complaints,
++ _("Could not parse DW_AT_string_length"));
++ }
++
++ TYPE_RANGE_DATA (range_type)->high = high;
++ }
++ else
++ {
++ TYPE_HIGH_BOUND (range_type) = DW_UNSND(attr);
++ TYPE_HIGH_BOUND_KIND (range_type) = PROP_CONST;
++ }
+ }
+ else
+ {
+- /* Check for the DW_AT_byte_size attribute. */
++ /* Check for the DW_AT_byte_size attribute, which represents the length
++ in this case. */
+ attr = dwarf2_attr (die, DW_AT_byte_size, cu);
+ if (attr)
+- {
+- length = DW_UNSND (attr);
+- }
++ {
++ TYPE_HIGH_BOUND (range_type) = DW_UNSND(attr);
++ TYPE_HIGH_BOUND_KIND (range_type) = PROP_CONST;
++ }
+ else
+- {
+- length = 1;
+- }
++ {
++ TYPE_HIGH_BOUND (range_type) = 1;
++ TYPE_HIGH_BOUND_KIND (range_type) = PROP_CONST;
++ }
+ }
+
+- index_type = objfile_type (objfile)->builtin_int;
+- range_type = create_static_range_type (NULL, index_type, 1, length);
+ char_type = language_string_char_type (cu->language_defn, gdbarch);
+ type = create_string_type (NULL, char_type, range_type);
+
+@@ -17557,7 +17624,8 @@ read_base_type (struct die_info *die, st
+
+ static int
+ attr_to_dynamic_prop (const struct attribute *attr, struct die_info *die,
+- struct dwarf2_cu *cu, struct dynamic_prop *prop)
++ struct dwarf2_cu *cu, struct dynamic_prop *prop,
++ const gdb_byte *additional_data, int additional_data_size)
+ {
+ struct dwarf2_property_baton *baton;
+ struct obstack *obstack
+@@ -17568,14 +17636,33 @@ attr_to_dynamic_prop (const struct attri
+
+ if (attr_form_is_block (attr))
+ {
+- baton = XOBNEW (obstack, struct dwarf2_property_baton);
++ baton = XOBNEW(obstack, struct dwarf2_property_baton);
+ baton->referenced_type = NULL;
+ baton->locexpr.per_cu = cu->per_cu;
+- baton->locexpr.size = DW_BLOCK (attr)->size;
+- baton->locexpr.data = DW_BLOCK (attr)->data;
++
++ if (additional_data != NULL && additional_data_size > 0)
++ {
++ gdb_byte *data;
++
++ data = (gdb_byte *) obstack_alloc(
++ &cu->per_cu->dwarf2_per_objfile->objfile->objfile_obstack,
++ DW_BLOCK (attr)->size + additional_data_size);
++ memcpy (data, DW_BLOCK (attr)->data, DW_BLOCK (attr)->size);
++ memcpy (data + DW_BLOCK (attr)->size, additional_data,
++ additional_data_size);
++
++ baton->locexpr.data = data;
++ baton->locexpr.size = DW_BLOCK (attr)->size + additional_data_size;
++ }
++ else
++ {
++ baton->locexpr.data = DW_BLOCK (attr)->data;
++ baton->locexpr.size = DW_BLOCK (attr)->size;
++ }
++
+ prop->data.baton = baton;
+ prop->kind = PROP_LOCEXPR;
+- gdb_assert (prop->data.baton != NULL);
++ gdb_assert(prop->data.baton != NULL);
+ }
+ else if (attr_form_is_ref (attr))
+ {
+@@ -17608,8 +17695,28 @@ attr_to_dynamic_prop (const struct attri
+ baton = XOBNEW (obstack, struct dwarf2_property_baton);
+ baton->referenced_type = die_type (target_die, target_cu);
+ baton->locexpr.per_cu = cu->per_cu;
+- baton->locexpr.size = DW_BLOCK (target_attr)->size;
+- baton->locexpr.data = DW_BLOCK (target_attr)->data;
++
++ if (additional_data != NULL && additional_data_size > 0)
++ {
++ gdb_byte *data;
++
++ data = (gdb_byte *) obstack_alloc (&cu->per_cu->dwarf2_per_objfile->objfile->objfile_obstack,
++ DW_BLOCK (target_attr)->size + additional_data_size);
++ memcpy (data, DW_BLOCK (target_attr)->data,
++ DW_BLOCK (target_attr)->size);
++ memcpy (data + DW_BLOCK (target_attr)->size,
++ additional_data, additional_data_size);
++
++ baton->locexpr.data = data;
++ baton->locexpr.size = (DW_BLOCK (target_attr)->size
++ + additional_data_size);
++ }
++ else
++ {
++ baton->locexpr.data = DW_BLOCK (target_attr)->data;
++ baton->locexpr.size = DW_BLOCK (target_attr)->size;
++ }
++
+ prop->data.baton = baton;
+ prop->kind = PROP_LOCEXPR;
+ gdb_assert (prop->data.baton != NULL);
+@@ -17720,14 +17827,14 @@ read_subrange_type (struct die_info *die
+
+ attr = dwarf2_attr (die, DW_AT_byte_stride, cu);
+ if (attr)
+- if (!attr_to_dynamic_prop (attr, die, cu, &stride))
++ if (!attr_to_dynamic_prop (attr, die, cu, &stride, NULL, 0))
+ complaint (&symfile_complaints, _("Missing DW_AT_byte_stride "
+ "- DIE at 0x%x [in module %s]"),
+- to_underlying (die->sect_off), objfile_name (cu->objfile));
++ to_underlying (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);
++ attr_to_dynamic_prop (attr, die, cu, &low, NULL, 0);
+ else if (!low_default_is_valid)
+ complaint (&symfile_complaints, _("Missing DW_AT_lower_bound "
+ "- DIE at 0x%x [in module %s]"),
+@@ -17735,10 +17842,10 @@ read_subrange_type (struct die_info *die
+ objfile_name (cu->per_cu->dwarf2_per_objfile->objfile));
+
+ attr = dwarf2_attr (die, DW_AT_upper_bound, cu);
+- if (!attr_to_dynamic_prop (attr, die, cu, &high))
++ if (!attr_to_dynamic_prop (attr, die, cu, &high, NULL, 0))
+ {
+ attr = dwarf2_attr (die, DW_AT_count, cu);
+- if (attr_to_dynamic_prop (attr, die, cu, &high))
++ if (attr_to_dynamic_prop (attr, die, cu, &high, NULL, 0))
+ {
+ /* If bounds are constant do the final calculation here. */
+ if (low.kind == PROP_CONST && high.kind == PROP_CONST)
+@@ -25311,7 +25418,7 @@ set_die_type (struct die_info *die, stru
+ attr = dwarf2_attr (die, DW_AT_allocated, cu);
+ if (attr_form_is_block (attr))
+ {
+- if (attr_to_dynamic_prop (attr, die, cu, &prop))
++ if (attr_to_dynamic_prop (attr, die, cu, &prop, NULL, 0))
+ add_dyn_prop (DYN_PROP_ALLOCATED, prop, type);
+ }
+ else if (attr != NULL)
+@@ -25326,7 +25433,7 @@ set_die_type (struct die_info *die, stru
+ attr = dwarf2_attr (die, DW_AT_associated, cu);
+ if (attr_form_is_block (attr))
+ {
+- if (attr_to_dynamic_prop (attr, die, cu, &prop))
++ if (attr_to_dynamic_prop (attr, die, cu, &prop, NULL, 0))
+ add_dyn_prop (DYN_PROP_ASSOCIATED, prop, type);
+ }
+ else if (attr != NULL)
+@@ -25339,7 +25446,7 @@ set_die_type (struct die_info *die, stru
+
+ /* Read DW_AT_data_location and set in type. */
+ attr = dwarf2_attr (die, DW_AT_data_location, cu);
+- if (attr_to_dynamic_prop (attr, die, cu, &prop))
++ if (attr_to_dynamic_prop (attr, die, cu, &prop, NULL, 0))
+ add_dyn_prop (DYN_PROP_DATA_LOCATION, prop, type);
+
+ if (dwarf2_per_objfile->die_type_hash == NULL)
+diff -Naurp insight-8.1.50.20180216.orig/gdb/f-typeprint.c insight-8.1.50.20180216.new/gdb/f-typeprint.c
+--- insight-8.1.50.20180216.orig/gdb/f-typeprint.c 2018-01-04 17:43:15.000000000 +0100
++++ insight-8.1.50.20180216.new/gdb/f-typeprint.c 2018-02-17 14:58:10.998392222 +0100
+@@ -37,7 +37,7 @@ static void f_type_print_args (struct ty
+ #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 c
+ {
+ 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 c
+
+ 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
+ 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
+ fprintf_filtered (stream, "(");
+
+ if (type_not_associated (type))
+- val_print_not_associated (stream);
++ print_rank_only = 1;
+ else if (type_not_allocated (type))
+- val_print_not_allocated (stream);
++ print_rank_only = 1;
++ else if ((TYPE_ASSOCIATED_PROP (type)
++ && PROP_CONST != TYPE_DYN_PROP_KIND (TYPE_ASSOCIATED_PROP (type)))
++ || (TYPE_ALLOCATED_PROP (type)
++ && PROP_CONST != TYPE_DYN_PROP_KIND (TYPE_ALLOCATED_PROP (type)))
++ || (TYPE_DATA_LOCATION (type)
++ && PROP_CONST != TYPE_DYN_PROP_KIND (TYPE_DATA_LOCATION (type))))
++ /* This case exist when we ptype a typename which has the
++ dynamic properties but cannot be resolved as there is
++ no object. */
++ print_rank_only = 1;
++
++ if (TYPE_CODE (TYPE_TARGET_TYPE (type)) == TYPE_CODE_ARRAY)
++ f_type_print_varspec_suffix (TYPE_TARGET_TYPE (type), stream, 0,
++ 0, 0, arrayprint_recurse_level,
++ print_rank_only);
++
++ if (print_rank_only == 1)
++ fprintf_filtered (stream, ":");
+ else
+- {
+- if (TYPE_CODE (TYPE_TARGET_TYPE (type)) == TYPE_CODE_ARRAY)
+- f_type_print_varspec_suffix (TYPE_TARGET_TYPE (type), stream, 0,
+- 0, 0, arrayprint_recurse_level);
+-
+- lower_bound = f77_get_lowerbound (type);
+- if (lower_bound != 1) /* Not the default. */
+- fprintf_filtered (stream, "%d:", lower_bound);
+-
+- /* Make sure that, if we have an assumed size array, we
+- print out a warning and print the upperbound as '*'. */
+-
+- if (TYPE_ARRAY_UPPER_BOUND_IS_UNDEFINED (type))
+- fprintf_filtered (stream, "*");
+- else
+- {
+- upper_bound = f77_get_upperbound (type);
+- fprintf_filtered (stream, "%d", upper_bound);
+- }
+-
+- if (TYPE_CODE (TYPE_TARGET_TYPE (type)) != TYPE_CODE_ARRAY)
+- f_type_print_varspec_suffix (TYPE_TARGET_TYPE (type), stream, 0,
+- 0, 0, arrayprint_recurse_level);
+- }
++ {
++ lower_bound = f77_get_lowerbound (type);
++ if (lower_bound != 1) /* Not the default. */
++ fprintf_filtered (stream, "%d:", lower_bound);
++
++ /* Make sure that, if we have an assumed size array, we
++ print out a warning and print the upperbound as '*'. */
++
++ if (TYPE_ARRAY_UPPER_BOUND_IS_UNDEFINED (type))
++ fprintf_filtered (stream, "*");
++ else
++ {
++ upper_bound = f77_get_upperbound (type);
++ fprintf_filtered (stream, "%d", upper_bound);
++ }
++ }
++
++ if (TYPE_CODE (TYPE_TARGET_TYPE (type)) != TYPE_CODE_ARRAY)
++ f_type_print_varspec_suffix (TYPE_TARGET_TYPE (type), stream, 0,
++ 0, 0, arrayprint_recurse_level,
++ print_rank_only);
++
+ if (arrayprint_recurse_level == 1)
+ fprintf_filtered (stream, ")");
+ else
+@@ -221,13 +225,14 @@ f_type_print_varspec_suffix (struct type
+ case TYPE_CODE_PTR:
+ case TYPE_CODE_REF:
+ f_type_print_varspec_suffix (TYPE_TARGET_TYPE (type), stream, 0, 1, 0,
+- arrayprint_recurse_level);
++ arrayprint_recurse_level, 0);
+ fprintf_filtered (stream, ")");
+ break;
+
+ case TYPE_CODE_FUNC:
+ f_type_print_varspec_suffix (TYPE_TARGET_TYPE (type), stream, 0,
+- passed_a_ptr, 0, arrayprint_recurse_level);
++ passed_a_ptr, 0, arrayprint_recurse_level,
++ 0);
+ if (passed_a_ptr)
+ fprintf_filtered (stream, ")");
+
+@@ -383,7 +388,7 @@ f_type_print_base (struct type *type, st
+ 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 -Naurp insight-8.1.50.20180216.orig/gdb/gdbtypes.c insight-8.1.50.20180216.new/gdb/gdbtypes.c
+--- insight-8.1.50.20180216.orig/gdb/gdbtypes.c 2018-02-17 14:57:12.614814435 +0100
++++ insight-8.1.50.20180216.new/gdb/gdbtypes.c 2018-02-17 14:58:10.998392222 +0100
+@@ -1919,7 +1919,8 @@ is_dynamic_type_internal (struct type *t
+ type = check_typedef (type);
+
+ /* We only want to recognize references at the outermost level. */
+- if (top_level && TYPE_CODE (type) == TYPE_CODE_REF)
++ if (top_level &&
++ (TYPE_CODE (type) == TYPE_CODE_REF || TYPE_CODE (type) == TYPE_CODE_PTR))
+ type = check_typedef (TYPE_TARGET_TYPE (type));
+
+ /* Types that have a dynamic TYPE_DATA_LOCATION are considered
+@@ -1953,6 +1954,7 @@ is_dynamic_type_internal (struct type *t
+ }
+
+ case TYPE_CODE_ARRAY:
++ case TYPE_CODE_STRING:
+ {
+ gdb_assert (TYPE_NFIELDS (type) == 1);
+
+@@ -2071,7 +2073,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);
+
+@@ -2096,11 +2099,15 @@ resolve_dynamic_array (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);
+ else
+ elt_type = TYPE_TARGET_TYPE (type);
+
++ if (TYPE_CODE (type) == TYPE_CODE_STRING)
++ return create_string_type (type, elt_type, range_type);
++
+ prop = get_dyn_prop (DYN_PROP_BYTE_STRIDE, type);
+ if (prop != NULL)
+ {
+@@ -2255,6 +2262,28 @@ resolve_dynamic_struct (struct type *typ
+ return resolved_type;
+ }
+
++/* Worker for pointer types. */
++
++static struct type *
++resolve_dynamic_pointer (struct type *type,
++ struct property_addr_info *addr_stack)
++{
++ struct dynamic_prop *prop;
++ CORE_ADDR value;
++
++ type = copy_type (type);
++
++ /* Resolve associated property. */
++ prop = TYPE_ASSOCIATED_PROP (type);
++ if (prop != NULL && dwarf2_evaluate_property (prop, NULL, addr_stack, &value))
++ {
++ TYPE_DYN_PROP_ADDR (prop) = value;
++ TYPE_DYN_PROP_KIND (prop) = PROP_CONST;
++ }
++
++ return type;
++}
++
+ /* Worker for resolved_dynamic_type. */
+
+ static struct type *
+@@ -2303,7 +2332,12 @@ resolve_dynamic_type_internal (struct ty
+ 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;
+
+diff -Naurp insight-8.1.50.20180216.orig/gdb/NEWS insight-8.1.50.20180216.new/gdb/NEWS
+--- insight-8.1.50.20180216.orig/gdb/NEWS 2018-02-09 15:06:40.000000000 +0100
++++ insight-8.1.50.20180216.new/gdb/NEWS 2018-02-17 14:58:10.999392233 +0100
+@@ -1,6 +1,8 @@
+ What has changed in GDB?
+ (Organized release by release)
+
++* Fortran: Support pointers to dynamic types.
++
+ *** Changes since GDB 8.1
+
+ * 'info proc' now works on running processes on FreeBSD systems and core
+diff -Naurp insight-8.1.50.20180216.orig/gdb/testsuite/gdb.cp/vla-cxx.cc insight-8.1.50.20180216.new/gdb/testsuite/gdb.cp/vla-cxx.cc
+--- insight-8.1.50.20180216.orig/gdb/testsuite/gdb.cp/vla-cxx.cc 2018-01-04 17:43:15.000000000 +0100
++++ insight-8.1.50.20180216.new/gdb/testsuite/gdb.cp/vla-cxx.cc 2018-02-17 14:58:10.999392233 +0100
+@@ -15,6 +15,10 @@
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
++extern "C" {
++#include <stddef.h>
++}
++
+ struct container;
+
+ struct element
+@@ -40,11 +44,16 @@ int main(int argc, char **argv)
+ typedef typeof (vla) &vlareftypedef;
+ vlareftypedef vlaref2 (vla);
+ container c;
++ typeof (vla) *ptr = NULL;
++
++ // Before pointer assignment
++ ptr = &vla;
+
+ for (int i = 0; i < z; ++i)
+ vla[i] = 5 + 2 * i;
+
+ // vlas_filled
+ vla[0] = 2 * vla[0];
++
+ return vla[2];
+ }
+diff -Naurp insight-8.1.50.20180216.orig/gdb/testsuite/gdb.cp/vla-cxx.exp insight-8.1.50.20180216.new/gdb/testsuite/gdb.cp/vla-cxx.exp
+--- insight-8.1.50.20180216.orig/gdb/testsuite/gdb.cp/vla-cxx.exp 2018-01-04 17:43:15.000000000 +0100
++++ insight-8.1.50.20180216.new/gdb/testsuite/gdb.cp/vla-cxx.exp 2018-02-17 14:58:10.999392233 +0100
+@@ -23,6 +23,12 @@ if ![runto_main] {
+ return -1
+ }
+
++gdb_breakpoint [gdb_get_line_number "Before pointer assignment"]
++gdb_continue_to_breakpoint "Before pointer assignment"
++gdb_test "ptype ptr" "int \\(\\*\\)\\\[variable length\\\]" "ptype ptr, Before pointer assignment"
++gdb_test "print ptr" "\\(int \\(\\*\\)\\\[variable length\\\]\\) 0x0" "print ptr, Before pointer assignment"
++gdb_test "print *ptr" "Cannot access memory at address 0x0" "print *ptr, Before pointer assignment"
++
+ gdb_breakpoint [gdb_get_line_number "vlas_filled"]
+ gdb_continue_to_breakpoint "vlas_filled"
+
+@@ -33,3 +39,6 @@ gdb_test "print vlaref" " = \\(int \\(&\
+ # bug being tested, it's better not to depend on the exact spelling.
+ gdb_test "print vlaref2" " = \\(.*\\) @$hex: \\{5, 7, 9\\}"
+ gdb_test "print c" " = \\{e = \\{c = @$hex\\}\\}"
++gdb_test "ptype ptr" "int \\(\\*\\)\\\[3\\\]"
++gdb_test "print ptr" "\\(int \\(\\*\\)\\\[3\\\]\\) $hex"
++gdb_test "print *ptr" " = \\{5, 7, 9\\}"
+diff -Naurp insight-8.1.50.20180216.orig/gdb/testsuite/gdb.fortran/pointers.exp insight-8.1.50.20180216.new/gdb/testsuite/gdb.fortran/pointers.exp
+--- insight-8.1.50.20180216.orig/gdb/testsuite/gdb.fortran/pointers.exp 1970-01-01 01:00:00.000000000 +0100
++++ insight-8.1.50.20180216.new/gdb/testsuite/gdb.fortran/pointers.exp 2018-02-17 14:58:10.999392233 +0100
+@@ -0,0 +1,143 @@
++# Copyright 2016 Free Software Foundation, Inc.
++
++# This program is free software; you can redistribute it and/or modify
++# it under the terms of the GNU General Public License as published by
++# the Free Software Foundation; either version 3 of the License, or
++# (at your option) any later version.
++#
++# This program is distributed in the hope that it will be useful,
++# but WITHOUT ANY WARRANTY; without even the implied warranty of
++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++# GNU General Public License for more details.
++#
++# You should have received a copy of the GNU General Public License
++# along with this program. If not, see <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 "print logp" "= \\(PTR TO -> \\( $logical \\)\\) 0x0" "print logp, not associated"
++gdb_test "print *logp" "Cannot access memory at address 0x0" "print *logp, not associated"
++gdb_test "print comp" "= \\(PTR TO -> \\( $complex \\)\\) 0x0" "print comp, not associated"
++gdb_test "print *comp" "Cannot access memory at address 0x0" "print *comp, not associated"
++gdb_test "print charp" "= \\(PTR TO -> \\( character\\*1 \\)\\) 0x0" "print charp, not associated"
++gdb_test "print *charp" "Cannot access memory at address 0x0" "print *charp, not associated"
++gdb_test "print charap" "= \\(PTR TO -> \\( character\\*3 \\)\\) 0x0" "print charap, not associated"
++gdb_test "print *charap" "Cannot access memory at address 0x0" "print *charap, not associated"
++gdb_test "print intp" "= \\(PTR TO -> \\( $int \\)\\) 0x0" "print intp, not associated"
++gdb_test "print *intp" "Cannot access memory at address 0x0" "print *intp, not associated"
++set test "print intap, not associated"
++gdb_test_multiple "print intap" $test {
++ -re " = \\(PTR TO -> \\( $int \\(:,:\\)\\)\\) <not associated>\r\n$gdb_prompt $" {
++ pass $test
++ }
++ -re " = <not associated>\r\n$gdb_prompt $" {
++ pass $test
++ }
++}
++gdb_test "print realp" "= \\(PTR TO -> \\( $real \\)\\) 0x0" "print realp, not associated"
++gdb_test "print *realp" "Cannot access memory at address 0x0" "print *realp, not associated"
++gdb_test "print \$my_var = intp" "= \\(PTR TO -> \\( $int \\)\\) 0x0"
++set test "print cyclicp1, not associated"
++gdb_test_multiple "print cyclicp1" $test {
++ -re "= \\( i = -?\\d+, p = 0x0 \\)\r\n$gdb_prompt $" {
++ pass $test
++ }
++ -re "= \\( i = -?\\d+, p = <not associated> \\)\r\n$gdb_prompt $" {
++ pass $test
++ }
++}
++set test "print cyclicp1%p, not associated"
++gdb_test_multiple "print cyclicp1%p" $test {
++ -re "= \\(PTR TO -> \\( Type typewithpointer \\)\\) 0x0\r\n$gdb_prompt $" {
++ pass $test
++ }
++ -re "= \\(PTR TO -> \\( Type typewithpointer \\)\\) <not associated>\r\n$gdb_prompt $" {
++ pass $test
++ }
++}
++
++
++gdb_breakpoint [gdb_get_line_number "Before value assignment"]
++gdb_continue_to_breakpoint "Before value assignment"
++gdb_test "print *(twop)%ivla2" "= <not allocated>"
++
++
++gdb_breakpoint [gdb_get_line_number "After value assignment"]
++gdb_continue_to_breakpoint "After value assignment"
++gdb_test "print logp" "= \\(PTR TO -> \\( $logical \\)\\) $hex\( <.*>\)?"
++gdb_test "print *logp" "= \\.TRUE\\."
++gdb_test "print comp" "= \\(PTR TO -> \\( $complex \\)\\) $hex\( <.*>\)?"
++gdb_test "print *comp" "= \\(1,2\\)"
++gdb_test "print charp" "= \\(PTR TO -> \\( character\\*1 \\)\\) $hex\( <.*>\)?"
++gdb_test "print *charp" "= 'a'"
++gdb_test "print charap" "= \\(PTR TO -> \\( character\\*3 \\)\\) $hex\( <.*>\)?"
++gdb_test "print *charap" "= 'abc'"
++gdb_test "print intp" "= \\(PTR TO -> \\( $int \\)\\) $hex\( <.*>\)?"
++gdb_test "print *intp" "= 10"
++set test_name "print intap, associated"
++gdb_test_multiple "print intap" $test_name {
++ -re "= \\(\\( 1, 1, 3(, 1){7}\\) \\( 1(, 1){9}\\) \\)\r\n$gdb_prompt $" {
++ pass $test_name
++ }
++ -re "= \\(PTR TO -> \\( $int \\(10,2\\)\\)\\) $hex\( <.*>\)?\r\n$gdb_prompt $" {
++ gdb_test "print *intap" "= \\(\\( 1, 1, 3(, 1){7}\\) \\( 1(, 1){9}\\) \\)"
++ pass $test_name
++ }
++}
++set test_name "print intvlap, associated"
++gdb_test_multiple "print intvlap" $test_name {
++ -re "= \\(2, 2, 2, 4(, 2){6}\\)\r\n$gdb_prompt $" {
++ pass $test_name
++ }
++ -re "= \\(PTR TO -> \\( $int \\(10\\)\\)\\) $hex\( <.*>\)?\r\n$gdb_prompt $" {
++ gdb_test "print *intvlap" "= \\(2, 2, 2, 4(, 2){6}\\)"
++ pass $test_name
++ }
++}
++gdb_test "print realp" "= \\(PTR TO -> \\( $real \\)\\) $hex\( <.*>\)?"
++gdb_test "print *realp" "= 3\\.14000\\d+"
++gdb_test "print arrayOfPtr(2)%p" "= \\(PTR TO -> \\( Type two \\)\\) $hex\( <.*>\)?"
++gdb_test "print *(arrayOfPtr(2)%p)" "= \\( ivla1 = \\(11, 12, 13\\), ivla2 = \\(\\( 211, 221\\) \\( 212, 222\\) \\) \\)"
++set test_name "print arrayOfPtr(3)%p"
++gdb_test_multiple $test_name $test_name {
++ -re "= \\(PTR TO -> \\( Type two \\)\\) <not associated>\r\n$gdb_prompt $" {
++ pass $test_name
++ }
++ -re "= \\(PTR TO -> \\( Type two \\)\\) 0x0\r\n$gdb_prompt $" {
++ pass $test_name
++ }
++}
++set test_name "print *(arrayOfPtr(3)%p), associated"
++gdb_test_multiple "print *(arrayOfPtr(3)%p)" $test_name {
++ -re "Cannot access memory at address 0x0\r\n$gdb_prompt $" {
++ pass $test_name
++ }
++ -re "Attempt to take contents of a not associated pointer.\r\n$gdb_prompt $" {
++ pass $test_name
++ }
++}
++gdb_test "print cyclicp1" "= \\( i = 1, p = $hex\( <.*>\)? \\)"
++gdb_test "print cyclicp1%p" "= \\(PTR TO -> \\( Type typewithpointer \\)\\) $hex\( <.*>\)?"
++gdb_test "print *((integer*) &inta + 2)" "= 3" "print temporary pointer, array"
++gdb_test "print *((integer*) &intvla + 3)" "= 4" "print temporary pointer, allocated vla"
++gdb_test "print \$pc" "= \\(PTR TO -> \\( void \\(\\)\\(\\)\\)\\) $hex <pointers\\+\\d+>" "Print program counter"
+diff -Naurp insight-8.1.50.20180216.orig/gdb/testsuite/gdb.fortran/pointers.f90 insight-8.1.50.20180216.new/gdb/testsuite/gdb.fortran/pointers.f90
+--- insight-8.1.50.20180216.orig/gdb/testsuite/gdb.fortran/pointers.f90 1970-01-01 01:00:00.000000000 +0100
++++ insight-8.1.50.20180216.new/gdb/testsuite/gdb.fortran/pointers.f90 2018-02-17 14:58:10.999392233 +0100
+@@ -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
++
++ type :: typeWithPointer
++ integer i
++ type(typeWithPointer), pointer:: p
++ end type typeWithPointer
++
++ type :: twoPtr
++ type (two), pointer :: p
++ end type twoPtr
++
++ logical, target :: logv
++ complex, target :: comv
++ character, target :: charv
++ character (len=3), target :: chara
++ integer, target :: intv
++ integer, target, dimension (10,2) :: inta
++ integer, target, allocatable, dimension (:) :: intvla
++ real, target :: realv
++ type(two), target :: twov
++ type(twoPtr) :: arrayOfPtr (3)
++ type(typeWithPointer), target:: cyclicp1,cyclicp2
++
++ logical, pointer :: logp
++ complex, pointer :: comp
++ character, pointer:: charp
++ character (len=3), pointer:: charap
++ integer, pointer :: intp
++ integer, pointer, dimension (:,:) :: intap
++ integer, pointer, dimension (:) :: intvlap
++ real, pointer :: realp
++ type(two), pointer :: twop
++
++ nullify (logp)
++ nullify (comp)
++ nullify (charp)
++ nullify (charap)
++ nullify (intp)
++ nullify (intap)
++ nullify (intvlap)
++ nullify (realp)
++ nullify (twop)
++ nullify (arrayOfPtr(1)%p)
++ nullify (arrayOfPtr(2)%p)
++ nullify (arrayOfPtr(3)%p)
++ nullify (cyclicp1%p)
++ nullify (cyclicp2%p)
++
++ logp => logv ! Before pointer assignment
++ comp => comv
++ charp => charv
++ charap => chara
++ intp => intv
++ intap => inta
++ intvlap => intvla
++ realp => realv
++ twop => twov
++ arrayOfPtr(2)%p => twov
++ cyclicp1%i = 1
++ cyclicp1%p => cyclicp2
++ cyclicp2%i = 2
++ cyclicp2%p => cyclicp1
++
++ logv = associated(logp) ! Before value assignment
++ comv = cmplx(1,2)
++ charv = "a"
++ chara = "abc"
++ intv = 10
++ inta(:,:) = 1
++ inta(3,1) = 3
++ allocate (intvla(10))
++ intvla(:) = 2
++ intvla(4) = 4
++ intvlap => intvla
++ realv = 3.14
++
++ allocate (twov%ivla1(3))
++ allocate (twov%ivla2(2,2))
++ twov%ivla1(1) = 11
++ twov%ivla1(2) = 12
++ twov%ivla1(3) = 13
++ twov%ivla2(1,1) = 211
++ twov%ivla2(2,1) = 221
++ twov%ivla2(1,2) = 212
++ twov%ivla2(2,2) = 222
++
++ intv = intv + 1 ! After value assignment
++
++end program pointers
+diff -Naurp insight-8.1.50.20180216.orig/gdb/testsuite/gdb.fortran/print_type.exp insight-8.1.50.20180216.new/gdb/testsuite/gdb.fortran/print_type.exp
+--- insight-8.1.50.20180216.orig/gdb/testsuite/gdb.fortran/print_type.exp 1970-01-01 01:00:00.000000000 +0100
++++ insight-8.1.50.20180216.new/gdb/testsuite/gdb.fortran/print_type.exp 2018-02-17 14:58:11.000392242 +0100
+@@ -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 -Naurp insight-8.1.50.20180216.orig/gdb/testsuite/gdb.fortran/vla-ptype.exp insight-8.1.50.20180216.new/gdb/testsuite/gdb.fortran/vla-ptype.exp
+--- insight-8.1.50.20180216.orig/gdb/testsuite/gdb.fortran/vla-ptype.exp 2018-02-17 14:57:12.616814455 +0100
++++ insight-8.1.50.20180216.new/gdb/testsuite/gdb.fortran/vla-ptype.exp 2018-02-17 14:58:11.000392242 +0100
+@@ -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 =
+
+ 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 "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 "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"
+diff -Naurp insight-8.1.50.20180216.orig/gdb/testsuite/gdb.fortran/vla-strings.exp insight-8.1.50.20180216.new/gdb/testsuite/gdb.fortran/vla-strings.exp
+--- insight-8.1.50.20180216.orig/gdb/testsuite/gdb.fortran/vla-strings.exp 1970-01-01 01:00:00.000000000 +0100
++++ insight-8.1.50.20180216.new/gdb/testsuite/gdb.fortran/vla-strings.exp 2018-02-17 14:58:11.000392242 +0100
+@@ -0,0 +1,103 @@
++# Copyright 2016 Free Software Foundation, Inc.
++
++# This program is free software; you can redistribute it and/or modify
++# it under the terms of the GNU General Public License as published by
++# the Free Software Foundation; either version 3 of the License, or
++# (at your option) any later version.
++#
++# This program is distributed in the hope that it will be useful,
++# but WITHOUT ANY WARRANTY; without even the implied warranty of
++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++# GNU General Public License for more details.
++#
++# You should have received a copy of the GNU General Public License
++# along with this program. If not, see <http://www.gnu.org/licenses/>.
++
++standard_testfile ".f90"
++
++if { [prepare_for_testing ${testfile}.exp ${testfile} ${srcfile} \
++ {debug f90 quiet}] } {
++ return -1
++}
++
++# check that all fortran standard datatypes will be
++# handled correctly when using as VLA's
++
++if ![runto_main] {
++ untested "could not run to main"
++ return -1
++}
++
++gdb_breakpoint [gdb_get_line_number "var_char-allocated-1"]
++gdb_continue_to_breakpoint "var_char-allocated-1"
++set test "whatis var_char first time"
++gdb_test_multiple "whatis var_char" $test {
++ -re "type = PTR TO -> \\( character\\*10 \\)\r\n$gdb_prompt $" {
++ pass $test
++ }
++ -re "type = character\\*10\r\n$gdb_prompt $" {
++ pass $test
++ }
++}
++set test "ptype var_char first time"
++gdb_test_multiple "ptype var_char" $test {
++ -re "type = PTR TO -> \\( character\\*10 \\)\r\n$gdb_prompt $" {
++ pass $test
++ }
++ -re "type = character\\*10\r\n$gdb_prompt $" {
++ pass $test
++ }
++}
++
++
++gdb_test "next" "\\d+.*var_char = 'foo'.*" \
++ "next to allocation status of var_char"
++gdb_test "print l" " = \\.TRUE\\." "print allocation status first time"
++
++
++gdb_breakpoint [gdb_get_line_number "var_char-filled-1"]
++gdb_continue_to_breakpoint "var_char-filled-1"
++set test "print var_char, var_char-filled-1"
++gdb_test_multiple "print var_char" $test {
++ -re "= \\(PTR TO -> \\( character\\*3 \\)\\) $hex\r\n$gdb_prompt $" {
++ gdb_test "print *var_char" "= 'foo'" "print *var_char, var_char-filled-1"
++ pass $test
++ }
++ -re "= 'foo'\r\n$gdb_prompt $" {
++ pass $test
++ }
++}
++set test "ptype var_char, var_char-filled-1"
++gdb_test_multiple "ptype var_char" $test {
++ -re "type = PTR TO -> \\( character\\*3 \\)\r\n$gdb_prompt $" {
++ pass $test
++ }
++ -re "type = character\\*3\r\n$gdb_prompt $" {
++ pass $test
++ }
++}
++gdb_test "print var_char(1)" " = 102 'f'" "print var_char(1)"
++gdb_test "print var_char(3)" " = 111 'o'" "print var_char(3)"
++
++
++gdb_breakpoint [gdb_get_line_number "var_char-filled-2"]
++gdb_continue_to_breakpoint "var_char-filled-2"
++set test "print var_char, var_char-filled-2"
++gdb_test_multiple "print var_char" $test {
++ -re "= \\(PTR TO -> \\( character\\*6 \\)\\) $hex\r\n$gdb_prompt $" {
++ gdb_test "print *var_char" "= 'foobar'" "print *var_char, var_char-filled-2"
++ pass $test
++ }
++ -re "= 'foobar'\r\n$gdb_prompt $" {
++ pass $test
++ }
++}
++set test "ptype var_char, var_char-filled-2"
++gdb_test_multiple "ptype var_char" $test {
++ -re "type = PTR TO -> \\( character\\*6 \\)\r\n$gdb_prompt $" {
++ pass $test
++ }
++ -re "type = character\\*6\r\n$gdb_prompt $" {
++ pass $test
++ }
++}
+diff -Naurp insight-8.1.50.20180216.orig/gdb/testsuite/gdb.fortran/vla-strings.f90 insight-8.1.50.20180216.new/gdb/testsuite/gdb.fortran/vla-strings.f90
+--- insight-8.1.50.20180216.orig/gdb/testsuite/gdb.fortran/vla-strings.f90 1970-01-01 01:00:00.000000000 +0100
++++ insight-8.1.50.20180216.new/gdb/testsuite/gdb.fortran/vla-strings.f90 2018-02-17 14:58:11.000392242 +0100
+@@ -0,0 +1,39 @@
++! Copyright 2016 Free Software Foundation, Inc.
++!
++! This program is free software; you can redistribute it and/or modify
++! it under the terms of the GNU General Public License as published by
++! the Free Software Foundation; either version 3 of the License, or
++! (at your option) any later version.
++!
++! This program is distributed in the hope that it will be useful,
++! but WITHOUT ANY WARRANTY; without even the implied warranty of
++! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++! GNU General Public License for more details.
++!
++! You should have received a copy of the GNU General Public License
++! along with this program. If not, see <http://www.gnu.org/licenses/>.
++
++program vla_strings
++ character(len=:), target, allocatable :: var_char
++ character(len=:), pointer :: var_char_p
++ logical :: l
++
++ allocate(character(len=10) :: var_char)
++ l = allocated(var_char) ! var_char-allocated-1
++ var_char = 'foo'
++ deallocate(var_char) ! var_char-filled-1
++ l = allocated(var_char) ! var_char-deallocated
++ allocate(character(len=42) :: var_char)
++ l = allocated(var_char)
++ var_char = 'foobar'
++ var_char = '' ! var_char-filled-2
++ var_char = 'bar' ! var_char-empty
++ deallocate(var_char)
++ allocate(character(len=21) :: var_char)
++ l = allocated(var_char) ! var_char-allocated-3
++ var_char = 'johndoe'
++ var_char_p => var_char
++ l = associated(var_char_p) ! var_char_p-associated
++ var_char_p => null()
++ l = associated(var_char_p) ! var_char_p-not-associated
++end program vla_strings
+diff -Naurp insight-8.1.50.20180216.orig/gdb/testsuite/gdb.fortran/vla-type.exp insight-8.1.50.20180216.new/gdb/testsuite/gdb.fortran/vla-type.exp
+--- insight-8.1.50.20180216.orig/gdb/testsuite/gdb.fortran/vla-type.exp 2018-01-04 17:43:15.000000000 +0100
++++ insight-8.1.50.20180216.new/gdb/testsuite/gdb.fortran/vla-type.exp 2018-02-17 14:58:11.000392242 +0100
+@@ -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 -Naurp insight-8.1.50.20180216.orig/gdb/testsuite/gdb.fortran/vla-value.exp insight-8.1.50.20180216.new/gdb/testsuite/gdb.fortran/vla-value.exp
+--- insight-8.1.50.20180216.orig/gdb/testsuite/gdb.fortran/vla-value.exp 2018-01-04 17:43:15.000000000 +0100
++++ insight-8.1.50.20180216.new/gdb/testsuite/gdb.fortran/vla-value.exp 2018-02-17 14:58:11.000392242 +0100
+@@ -35,7 +35,7 @@ gdb_breakpoint [gdb_get_line_number "vla
+ 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" \
+ "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)"
+@@ -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" \
+ "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 -Naurp insight-8.1.50.20180216.orig/gdb/testsuite/gdb.mi/mi-vla-fortran.exp insight-8.1.50.20180216.new/gdb/testsuite/gdb.mi/mi-vla-fortran.exp
+--- insight-8.1.50.20180216.orig/gdb/testsuite/gdb.mi/mi-vla-fortran.exp 2018-01-04 17:43:15.000000000 +0100
++++ insight-8.1.50.20180216.new/gdb/testsuite/gdb.mi/mi-vla-fortran.exp 2018-02-17 14:58:11.000392242 +0100
+@@ -51,10 +51,10 @@ mi_expect_stop "breakpoint-hit" "vla" ""
+ 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\"" \
+diff -Naurp insight-8.1.50.20180216.orig/gdb/typeprint.c insight-8.1.50.20180216.new/gdb/typeprint.c
+--- insight-8.1.50.20180216.orig/gdb/typeprint.c 2018-01-26 13:46:47.000000000 +0100
++++ insight-8.1.50.20180216.new/gdb/typeprint.c 2018-02-17 14:58:11.000392242 +0100
+@@ -538,6 +538,25 @@ whatis_exp (const char *exp, int show)
+ printf_filtered (" */\n");
+ }
+
++ /* Resolve any dynamic target type, as we might print
++ additional information about the target.
++ For example, in Fortran and C we are printing the dimension of the
++ dynamic array the pointer is pointing to. */
++ if (TYPE_CODE (type) == TYPE_CODE_PTR
++ && is_dynamic_type (type) == 1)
++ {
++ CORE_ADDR addr;
++ if (NULL != TYPE_DATA_LOCATION (TYPE_TARGET_TYPE(type)))
++ addr = value_address (val);
++ else
++ addr = value_as_address (val);
++
++ if (addr != 0
++ && type_not_associated (type) == 0)
++ TYPE_TARGET_TYPE (type) = resolve_dynamic_type (TYPE_TARGET_TYPE (type),
++ NULL, addr);
++ }
++
+ LA_PRINT_TYPE (type, "", gdb_stdout, show, 0, &flags);
+ printf_filtered ("\n");
+
+diff -Naurp insight-8.1.50.20180216.orig/gdb/valops.c insight-8.1.50.20180216.new/gdb/valops.c
+--- insight-8.1.50.20180216.orig/gdb/valops.c 2018-02-17 14:57:12.616814455 +0100
++++ insight-8.1.50.20180216.new/gdb/valops.c 2018-02-17 14:58:11.001392252 +0100
+@@ -1565,6 +1565,19 @@ value_ind (struct value *arg1)
+ if (TYPE_CODE (base_type) == TYPE_CODE_PTR)
+ {
+ struct type *enc_type;
++ CORE_ADDR addr;
++
++ if (type_not_associated (base_type))
++ error (_("Attempt to take contents of a not associated pointer."));
++
++ if (NULL != TYPE_DATA_LOCATION (TYPE_TARGET_TYPE (base_type)))
++ addr = value_address (arg1);
++ else
++ addr = value_as_address (arg1);
++
++ if (addr != 0)
++ TYPE_TARGET_TYPE (base_type) =
++ resolve_dynamic_type (TYPE_TARGET_TYPE (base_type), NULL, addr);
+
+ /* We may be pointing to something embedded in a larger object.
+ Get the real type of the enclosing object. */
+@@ -1580,8 +1593,7 @@ value_ind (struct value *arg1)
+ else
+ /* Retrieve the enclosing object pointed to. */
+ arg2 = value_at_lazy (enc_type,
+- (value_as_address (arg1)
+- - value_pointed_to_offset (arg1)));
++ (addr - value_pointed_to_offset (arg1)));
+
+ enc_type = value_type (arg2);
+ return readjust_indirect_value_type (arg2, enc_type, base_type, arg1);
+diff -Naurp insight-8.1.50.20180216.orig/gdb/valprint.c insight-8.1.50.20180216.new/gdb/valprint.c
+--- insight-8.1.50.20180216.orig/gdb/valprint.c 2018-01-12 03:18:43.000000000 +0100
++++ insight-8.1.50.20180216.new/gdb/valprint.c 2018-02-17 14:58:11.001392252 +0100
+@@ -1108,12 +1108,6 @@ value_check_printable (struct value *val
+ return 0;
+ }
+
+- if (type_not_associated (value_type (val)))
+- {
+- val_print_not_associated (stream);
+- return 0;
+- }
+-
+ if (type_not_allocated (value_type (val)))
+ {
+ val_print_not_allocated (stream);
diff --git a/insight.spec b/insight.spec
index baab772..8fd5f31 100644
--- a/insight.spec
+++ b/insight.spec
@@ -1,5 +1,5 @@
-%global ver 7.12.50
-%global snap 20170416
+%global ver 8.1.50
+%global snap 20180216
%global gnulibsnap 20160112
%global __python %{__python3}
@@ -10,22 +10,21 @@
# Git snapshots are produced as follows:
#
-# git clone --recursive https://github.com/monnerat/insight.git
+# git clone --recursive git://sourceware.org/git/insight.git
# cd insight.git
# autoconf
# configure
# (cd bundle; ./src-release.sh -x insight)
#
-# Tarball is then found at bundle/insight-%{ver}.%{snap}.tar.xz
+# Tarball is then found at bundle/insight-%<ver>.%<snap>.tar.xz
Name: insight
Version: %(echo %{ver} | tr - .)%{?snap:.%{snap}}
-Release: 5%{?dist}
+Release: 1%{?dist}
Summary: Graphical debugger based on GDB
License: GPLv3+ and GPLv3+ with exceptions and GPLv2+ and GPLv2+ with exceptions and GPL+ and LGPLv2+ and BSD and Public Domain and GFDL
-Group: Development/Debuggers
Url: https://www.sourceware.org/insight/
-# Source0: ftp://sourceware.org/pub/insight/releases/insight-%{ver}.tar.bz2
+# Source0: ftp://sourceware.org/pub/insight/releases/insight-%<ver>.tar.bz2
Source0: insight-%{version}.tar.xz
Source1: insight.1
Requires: iwidgets
@@ -34,16 +33,18 @@ Provides: bundled(binutils) = %{snap}
Provides: bundled(gnulib) = %{gnulibsnap}
Provides: bundled(libiberty) = %{snap}
Provides: bundled(md5-gcc) = %{snap}
-BuildRequires: tcl-devel%{?_isa}
-BuildRequires: tk-devel%{?_isa}
+BuildRequires: gcc
+BuildRequires: gcc-c++
+BuildRequires: tcl-devel
+BuildRequires: tk-devel
BuildRequires: iwidgets
-BuildRequires: ncurses-devel%{?_isa}
-BuildRequires: readline-devel%{?_isa} >= 6.0
-BuildRequires: expat-devel%{?_isa}
+BuildRequires: ncurses-devel
+BuildRequires: readline-devel >= 6.0
+BuildRequires: expat-devel
BuildRequires: python3-devel
-BuildRequires: xz-devel%{?_isa}
-BuildRequires: zlib-devel%{?_isa}
-BuildRequires: desktop-file-utils%{?_isa}
+BuildRequires: xz-devel
+BuildRequires: zlib-devel
+BuildRequires: desktop-file-utils
BuildRequires: autogen
BuildRequires: automake
BuildRequires: autoconf
@@ -52,17 +53,16 @@ BuildRequires: flex
BuildRequires: texinfo-tex
BuildRequires: perl-podlators
BuildRequires: libbabeltrace-devel
+BuildRequires: guile-devel
# For C++ pretty printers.
-BuildRequires: libstdc++%{?_isa}
+BuildRequires: libstdc++
-BuildRequires: itcl-devel%{?_isa} >= 3.3
-BuildRequires: itk-devel%{?_isa} >= 3.3
+BuildRequires: itcl-devel >= 3.3
+BuildRequires: itk-devel >= 3.3
-%if 0%{?fedora} >= 23
%ifarch %{ix86} x86_64
%global have_libipt 1
-BuildRequires: libipt-devel%{?_isa}
-%endif
+BuildRequires: libipt-devel
%endif
# Insight patches.
@@ -72,81 +72,68 @@ Patch2: insight-7.4.50-readline-system.patch
# Some patches from gdb. See gdb spec file for info.
-Patch101: gdb-6.3-rh-dummykfail-20041202.patch
-Patch102: gdb-6.3-rh-testversion-20041202.patch
-Patch103: gdb-6.3-ppc64syscall-20040622.patch
-Patch104: gdb-6.3-ppc64displaysymbol-20041124.patch
-Patch105: gdb-6.6-scheduler_locking-step-is-default.patch
-Patch106: gdb-6.3-gstack-20050411.patch
-Patch107: gdb-archer-pie-addons.patch
-Patch108: insight-7.12-gdb-archer-pie-addons-keep-disabled.patch
-Patch109: insight-7.12-gdb-6.3-readnever-20050907.patch
-Patch110: gdb-6.5-bz203661-emit-relocs.patch
-Patch111: gdb-6.5-bz185337-resolve-tls-without-debuginfo-v2.patch
-Patch112: gdb-6.5-bz216711-clone-is-outermost.patch
-Patch113: gdb-6.5-bz218379-solib-trampoline-lookup-lock-fix.patch
-Patch114: gdb-6.6-bz235197-fork-detach-info.patch
-Patch115: insight-7.12-gdb-6.6-buildid-locate.patch
-Patch116: gdb-6.6-buildid-locate-solib-missing-ids.patch
-Patch117: insight-7.12-gdb-6.6-buildid-locate-rpm.patch
-Patch118: insight-7.12-gdb-6.6-buildid-locate-core-as-arg.patch
-Patch119: gdb-6.6-buildid-locate-rpm-librpm-workaround.patch
-Patch120: gdb-6.6-buildid-locate-rpm-scl.patch
-Patch121: gdb-6.6-buildid-locate-misleading-warning-missing-debuginfo-rhbz981154.patch
-Patch122: gdb-6.8-sparc64-silence-memcpy-check.patch
-Patch123: gdb-6.8-quit-never-aborts.patch
-Patch124: insight-7.12-gdb-6.8-attach-signalled-detach-stopped.patch
-Patch125: insight-7.12-gdb-archer.patch
-Patch126: gdb-core-open-vdso-warning.patch
-Patch127: gdb-x86_64-i386-syscall-restart.patch
-Patch128: gdb-bz533176-fortran-omp-step.patch
-Patch129: gdb-follow-child-stale-parent.patch
-Patch130: gdb-bz541866-rwatch-before-run.patch
-Patch131: gdb-moribund-utrace-workaround.patch
-Patch132: gdb-gdb-add-index-script.patch
-Patch133: gdb-bz568248-oom-is-error.patch
-Patch134: gdb-7.2.50-sparc-add-workaround-to-broken-debug-files.patch
-Patch135: gdb-glibc-vdso-workaround.patch
-Patch136: gdb-readline62-ask-more-rh.patch
-Patch137: gdb-attach-fail-reasons-5of5.patch
-Patch138: gdb-stale-frame_info.patch
-Patch139: gdb-glibc-strstr-workaround.patch
-Patch140: insight-7.12-gdb-rhbz795424-bitpos-20of25.patch
-Patch141: gdb-rhbz795424-bitpos-21of25.patch
-Patch142: gdb-rhbz795424-bitpos-22of25.patch
-Patch143: insight-7.12-gdb-rhbz795424-bitpos-23of25.patch
-Patch144: insight-7.12-gdb-rhbz795424-bitpos-25of25.patch
-Patch145: gdb-rhbz795424-bitpos-lazyvalue.patch
+Patch101: gdb-6.3-rh-testversion-20041202.patch
+Patch102: gdb-vla-intel-fortran-strides.patch
+Patch103: insight-8.1-gdb-vla-intel-fortran-vla-strings.patch
+Patch104: gdb-vla-intel-stringbt-fix.patch
+Patch105: gdb-6.3-ppc64syscall-20040622.patch
+Patch106: gdb-6.3-ppc64displaysymbol-20041124.patch
+Patch107: gdb-6.3-gstack-20050411.patch
+Patch108: gdb-6.3-readnever-20050907.patch
+Patch109: gdb-6.5-bz203661-emit-relocs.patch
+Patch110: gdb-6.5-bz185337-resolve-tls-without-debuginfo-v2.patch
+Patch111: gdb-6.5-bz216711-clone-is-outermost.patch
+Patch112: gdb-6.5-bz218379-solib-trampoline-lookup-lock-fix.patch
+Patch113: gdb-6.6-bz235197-fork-detach-info.patch
+Patch114: gdb-6.6-scheduler_locking-step-is-default.patch
+Patch115: insight-8.1-buildid-locate.patch
+Patch116: insight-8.1-buildid-locate-solib-missing-ids.patch
+Patch117: insight-8.1-gdb-6.6-buildid-locate-rpm.patch
+Patch118: gdb-6.8-sparc64-silence-memcpy-check.patch
+Patch119: gdb-6.8-bz436037-reg-no-longer-active.patch
+Patch120: gdb-x86_64-i386-syscall-restart.patch
+Patch121: gdb-bz533176-fortran-omp-step.patch
+Patch122: gdb-follow-child-stale-parent.patch
+Patch123: gdb-archer-pie-addons.patch
+Patch124: gdb-archer-pie-addons-keep-disabled.patch
+Patch125: gdb-bz541866-rwatch-before-run.patch
+Patch126: gdb-moribund-utrace-workaround.patch
+Patch127: insight-8.1-gdb-6.6-buildid-locate-core-as-arg.patch
+Patch128: gdb-6.6-buildid-locate-rpm-librpm-workaround.patch
+Patch129: gdb-bz568248-oom-is-error.patch
+Patch130: gdb-7.2.50-sparc-add-workaround-to-broken-debug-files.patch
+Patch131: insight-8.1-gdb-attach-fail-reasons-5of5.patch
+Patch132: gdb-stale-frame_info.patch
+Patch133: gdb-glibc-strstr-workaround.patch
+Patch134: insight-8.1-gdb-rhbz795424-bitpos-20of25.patch
+Patch135: gdb-rhbz795424-bitpos-21of25.patch
+Patch136: gdb-rhbz795424-bitpos-22of25.patch
+Patch137: insight-8.1-gdb-rhbz795424-bitpos-23of25.patch
+Patch138: gdb-rhbz795424-bitpos-25of25.patch
+Patch139: gdb-rhbz795424-bitpos-lazyvalue.patch
+Patch140: gdb-gnat-dwarf-crash-3of3.patch
+Patch141: gdb-btrobust.patch
+Patch142: gdb-python-gil.patch
+Patch143: gdb-jit-reader-multilib.patch
+Patch144: gdb-bz1219747-attach-kills.patch
+Patch145: insight-8.1-gdb-fedora-libncursesw.patch
Patch146: gdb-dts-rhel6-python-compat.patch
-Patch147: gdb-gnat-dwarf-crash-3of3.patch
-Patch148: gdb-rhbz1007614-memleak-infpy_read_memory-test.patch
-Patch149: insight-7.12-gdb-vla-intel-fortran-strides.patch
-Patch150: insight-7.12-gdb-vla-intel-fortran-vla-strings.patch
-Patch151: insight-7.12-gdb-vla-intel-stringbt-fix.patch
-Patch152: gdb-archer-vla-tests.patch
-Patch153: gdb-vla-intel-tests.patch
-Patch154: gdb-btrobust.patch
-Patch155: gdb-fortran-frame-string.patch
-Patch156: insight-7.12-gdb-python-gil.patch
-Patch157: gdb-jit-reader-multilib.patch
-Patch158: gdb-rhbz1350436-type-printers-error.patch
-Patch159: gdb-rhbz1084404-ppc64-s390x-wrong-prologue-skip-O2-g-3of3.patch
-Patch160: gdb-bz1219747-attach-kills.patch
-Patch161: gdb-pahole-python2.patch
-Patch162: insight-7.12-gdb-fedora-libncursesw.patch
-Patch163: gdb-container-rh-pkg.patch
-Patch164: gdb-linux_perf-bundle.patch
-Patch165: gdb-tls-1of2.patch
-Patch166: gdb-tls-2of2.patch
-Patch167: gdb-libexec-add-index.patch
-Patch168: gdb-add-index-chmod.patch
+Patch147: gdb-6.6-buildid-locate-rpm-scl.patch
+Patch148: gdb-readline62-ask-more-rh.patch
+Patch149: insight-8.1-gdb-6.8-attach-signalled-detach-stopped.patch
+Patch150: insight-8.1-gdb-6.8-quit-never-aborts.patch
+Patch151: gdb-container-rh-pkg.patch
+Patch152: gdb-linux_perf-bundle.patch
+Patch153: gdb-libexec-add-index.patch
+Patch154: gdb-archer.patch
+Patch155: gdb-vla-intel-fix-print-char-array.patch
%description
Insight is a tight graphical user interface to GDB written in Tcl/Tk.
It provides a comprehensive interface that enables users to harness
most of GDB's power. It's also probably the only up-to-date UI for
-GDB version 7.x.
+GDB version 8.x.
#-------------------------------------------------------------------------------
@@ -213,19 +200,6 @@ GDB version 7.x.
%patch153 -p1
%patch154 -p1
%patch155 -p1
-%patch156 -p1
-%patch157 -p1
-%patch158 -p1
-%patch159 -p1
-%patch160 -p1
-%patch161 -p1
-%patch162 -p1
-%patch163 -p1
-%patch164 -p1
-%patch165 -p1
-%patch166 -p1
-%patch167 -p1
-%patch168 -p1
#-------------------------------------------------------------------------------
@@ -264,8 +238,9 @@ done
. "%{_libdir}/tclConfig.sh"
. "%{_libdir}/tkConfig.sh"
+CFLAGS="${RPM_OPT_FLAGS} -DDNF_DEBUGINFO_INSTALL"; export CFLAGS
+CXXFLAGS="${RPM_OPT_FLAGS} -DDNF_DEBUGINFO_INSTALL"; export CXXFLAGS
%configure --enable-gdbtk \
- --enable-sim \
--disable-binutils \
--disable-elfcpp \
--disable-gas \
@@ -286,22 +261,24 @@ done
--with-tkinclude="${TK_SRC_DIR}" \
--without-libunwind \
--enable-64-bit-bfd \
-%if 0%{!?rhel:1}
--with-babeltrace \
-%else
- --without-babeltrace \
-%endif
-%if 0%{!?rhel:1} || 0%{?rhel} > 6
+ --with-guile \
--with-lzma \
-%else
- --without-lzma \
-%endif
%if 0%{?have_libipt}
--with-intel-pt \
%else
--without-intel-pt \
%endif
+%ifarch sparc sparcv9 sparc64
+ --without-mmap \
+%endif
+%ifarch %{arm}
+ --disable-inprocess-agent \
+%else
+ --enable-inprocess-agent \
+%endif
--with-auto-load-dir='$debugdir:$datadir/auto-load' \
+ --with-auto-load-safe-path='$debugdir:$datadir/auto-load' \
--enable-targets=s390-linux-gnu,powerpc-linux-gnu,arm-linux-gnu,aarch64-linux-gnu \
%{_target_platform}
@@ -312,8 +289,6 @@ make %{?_smp_mflags}
%install
#-------------------------------------------------------------------------------
-rm -rf "${RPM_BUILD_ROOT}"
-
INSTALL="install -p"
make DESTDIR="${RPM_BUILD_ROOT}" INSTALL="${INSTALL}" install
@@ -343,7 +318,13 @@ make DESTDIR="${RPM_BUILD_ROOT}" INSTALL="${INSTALL}" install
rm -rf .%{_datadir}/info
rm -rf .%{_datadir}/locale
+ rm -rf .%{_datadir}/insight/guile
rm -rf .%{_datadir}/insight/system-gdbinit
+
+ # Patch: gdb-dts-rhel6-python-compat.patch
+ rm -rf .%{_datadir}/insight/python/gdb/FrameWrapper.py
+ rm -rf .%{_datadir}/insight/python/gdb/backtrace.py
+ rm -rf .%{_datadir}/insight/python/gdb/command/backtrace.py
)
# Regenerate the libgui pkgIndex.tcl file.
@@ -353,18 +334,24 @@ echo "pkg_mkIndex \"${RPM_BUILD_ROOT}%{_datadir}/insight/gui\"" | tclsh
# Populate the auto-load directory from the libstdc++ gdb-specific
# directory.
-for i in $(echo bin lib $(basename '%{_libdir}') sbin | tr ' ' '\n' | sort -u)
-do mkdir -p "${RPM_BUILD_ROOT}%{_datadir}/insight/auto-load%{_prefix}/$i"
- ln -s "$(echo %{_prefix} | sed 's#^/*##')/$i" \
- "${RPM_BUILD_ROOT}%{_datadir}/insight/auto-load/$i"
- if [ -d "%{_datadir}/gdb/auto-load%{_prefix}/${i}" ]
- then find "%{_datadir}/gdb/auto-load%{_prefix}/${i}" -mindepth 1
- fi
-done | while read FROM
-do TO=`echo "${FROM}" | sed 's#/gdb/#/insight/#'`
- if [ -d "${FROM}" ]
- then mkdir -p "${RPM_BUILD_ROOT}${TO}"
- else ln -s "${FROM}" "${RPM_BUILD_ROOT}${TO}"
+mkdir -p "${RPM_BUILD_ROOT}%{_datadir}/insight/auto-load"
+rpm -ql libstdc++ | grep "^%{_datadir}/gdb/auto-load" | while read T
+do F="${RPM_BUILD_ROOT}%{_datadir}/insight/${T#%{_datadir}/gdb/}"
+ if [[ "${F}/" =~ '/__pycache__/' ]]
+ then : # Do not copy cache.
+ elif [ -e "${F}" ]
+ then : # Already exists: ignore.
+ elif [ -d "${T}" ]
+ then mkdir -p "${F}"
+ else if [ -h "${T}" ]
+ then D=`dirname "${T}"`
+ LINK=`realpath --relative-base="${D}" "${T}"`
+ if [[ "${LINK}" =~ '^/' ]]
+ then T="${LINK}"
+ else T=`realpath --relative-base="${D}" "${T}"`
+ fi
+ fi
+ ln -s "${T}" "${F}"
fi
done
@@ -413,6 +400,12 @@ rm -rf "${RPM_BUILD_ROOT}"
#-------------------------------------------------------------------------------
%changelog
+#-------------------------------------------------------------------------------
+
+* Fri Feb 16 2018 Patrick Monnerat <patrick(a)monnerat.net> 8.1.50.20180216-1
+- New upstream release.
+- Modernize spec file (BZ #1545189).
+
* Wed Feb 07 2018 Fedora Release Engineering <releng(a)fedoraproject.org> - 7.12.50.20170416-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
@@ -425,8 +418,6 @@ rm -rf "${RPM_BUILD_ROOT}"
* Mon May 15 2017 Fedora Release Engineering <rel-eng(a)lists.fedoraproject.org> - 7.12.50.20170416-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_27_Mass_Rebuild
-#-------------------------------------------------------------------------------
-
* Sun Apr 16 2017 Patrick Monnerat <patrick(a)monnerat.net> 7.12.50.20170416-1
- New upstream release.
- Fixes BZ #1409768.
diff --git a/sources b/sources
index 9c4b82c..2c960c3 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-SHA512 (insight-7.12.50.20170416.tar.xz) = c8607823dedf4f02e7df540135723300e19c1f0cced8ac86d997bd019930213d4241f949eba6ac775c0cdfa2a0653b52e2e5cf71ac04c7130a34d9ea3f730a90
+SHA512 (insight-8.1.50.20180216.tar.xz) = a498fbd5ba66c5b5f30e3403a99378cd5c9668e77e7b7d58dc2087c73fdddf29c3e79ad076aa445bfa6d653679422941c4655c8b56c2750e6087882b8f7e684c
6 years, 4 months
Architecture specific change in rpms/gc.git
by githook-noreply@fedoraproject.org
The package rpms/gc.git has added or updated architecture specific content in its
spec file (ExclusiveArch/ExcludeArch or %ifarch/%ifnarch) in commit(s):
https://src.fedoraproject.org/cgit/rpms/gc.git/commit/?id=c784568f3ea8ce8....
Change:
+%ifarch %{ix86}
Thanks.
Full change:
============
commit c784568f3ea8ce82264ba0e9364dad5b078cf3f1
Author: Rex Dieter <rdieter(a)gmail.com>
Date: Tue Feb 20 11:44:08 2018 -0600
add (temporary) compat-gc
diff --git a/.gitignore b/.gitignore
index cdd3c0c..5eb2ff1 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,4 +1,2 @@
-/gc-7.4.2.tar.gz
-/gc-7.4.4.tar.gz
/gc-7.6.0.tar.gz
/gc-7.6.2.tar.gz
diff --git a/gc.spec b/gc.spec
index b934b63..6e089c8 100644
--- a/gc.spec
+++ b/gc.spec
@@ -1,4 +1,6 @@
+%global compat 1
+
Summary: A garbage collector for C and C++
Name: gc
Version: 7.6.2
@@ -7,6 +9,9 @@ Release: 4%{?dist}
License: BSD
Url: http://www.hboehm.info/gc/
Source0: http://www.hboehm.info/gc/gc_source/gc-%{version}%{?pre}.tar.gz
+%if 0%{?compat}
+Source1: http://www.hboehm.info/gc/gc_source/gc-7.6.0.tar.gz
+%endif
## upstreamable patches
@@ -33,6 +38,11 @@ Provides: libgc-devel = %{version}-%{release}
%description devel
%{summary}.
+%package -n compat-gc
+Summary: Compat gc-7.6.0 runtime library
+%description -n compat-gc
+%{summary} to ease transition to gc-7.6.2+.
+
%prep
%autosetup -n gc-%{version}%{?pre}
@@ -41,6 +51,14 @@ Provides: libgc-devel = %{version}-%{release}
rm -f libtool libtool.m4
autoreconf -i -f
+%if 0%{?compat}
+tar xzf %{SOURCE1}
+pushd gc-7.6.0
+rm -f libtool libtool.m4
+autoreconf -i -f
+popd
+%endif
+
%build
@@ -57,11 +75,35 @@ CPPFLAGS="-DUSE_GET_STACKBASE_FOR_MAIN"; export CPPFLAGS
%endif
--enable-threads=posix
-make %{?_smp_mflags}
+%{make_build}
+
+%if 0%{?compat}
+pushd gc-7.6.0
+%configure \
+ --disable-static \
+ --enable-cplusplus \
+ --enable-large-config \
+%ifarch %{ix86}
+ --enable-parallel-mark \
+%endif
+ --enable-threads=posix
+
+%{make_build}
+popd
+%endif
%install
-make install DESTDIR=%{buildroot}
+
+%if 0%{?compat}
+%{make_install} -C gc-7.6.0
+
+rm -rfv %{buildroot}{%{_includedir},%{_datadir}}
+rm -fv %{buildroot}%{_libdir}/lib{cord,gcccpp}*
+rm -fv %{buildroot}%{_libdir}/libgc.so
+%endif
+
+%{make_install}
install -p -D -m644 doc/gc.man %{buildroot}%{_mandir}/man3/gc.3
@@ -81,6 +123,7 @@ rm -fv %{buildroot}%{_libdir}/lib*.la
make check %{?arch_ignore}
%endif
+
%ldconfig_scriptlets
%files
@@ -100,10 +143,18 @@ make check %{?arch_ignore}
%{_libdir}/pkgconfig/bdw-gc.pc
%{_mandir}/man3/gc.3*
+%if 0%{?compat}
+%ldconfig_scriptlets -n compat-gc
+
+%files -n compat-gc
+%{_libdir}/libgc.so.1*
+%endif
+
%changelog
* Tue Feb 20 2018 Rex Dieter <rdieter(a)fedoraproject.org> - 7.6.2-4
- BR: gcc-c++
+- add (temporary) compat-gc
* Wed Feb 07 2018 Fedora Release Engineering <releng(a)fedoraproject.org> - 7.6.2-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
diff --git a/sources b/sources
index 5f29fdc..cb036ae 100644
--- a/sources
+++ b/sources
@@ -1 +1,2 @@
SHA512 (gc-7.6.2.tar.gz) = 7b54812903929b0d5d1d696beac54629a7667997b41ef45299373bc18b2153d5755286b25e11cc90ffc572239e52a02900927bc60b0ad3593162b8c8e259fd50
+SHA512 (gc-7.6.0.tar.gz) = 511e8c01287b1ee9dbec87f0573377de77038b7af053a3f33afed9b3ffa30e2402d6a9bb0ca4f4b81cd808209b47b5718d498cff3de6632a057fe03fad51fc43
6 years, 4 months
Architecture specific change in rpms/openvswitch.git
by githook-noreply@fedoraproject.org
The package rpms/openvswitch.git has added or updated architecture specific content in its
spec file (ExclusiveArch/ExcludeArch or %ifarch/%ifnarch) in commit(s):
https://src.fedoraproject.org/cgit/rpms/openvswitch.git/commit/?id=e00528....
Change:
+%ifarch %{dpdkarches}
Thanks.
Full change:
============
commit e00528424398a99481db0a6b5cebc80dd16b5483
Author: Timothy Redaelli <tredaelli(a)redhat.com>
Date: Tue Feb 20 18:07:53 2018 +0100
Align totally with RHEL Fast Datapath
diff --git a/.gitignore b/.gitignore
index f4bd986..75c2aff 100644
--- a/.gitignore
+++ b/.gitignore
@@ -29,4 +29,4 @@
/dpdk-17.05.2.tar.gz
/openvswitch-2.8.1.tar.gz
/openvswitch-2.9.0.tar.gz
-/dpdk-17.11.tar.gz
+/dpdk-17.11.tar.xz
diff --git a/openvswitch.spec b/openvswitch.spec
index 352d2d0..5b0ad37 100644
--- a/openvswitch.spec
+++ b/openvswitch.spec
@@ -9,46 +9,57 @@
# option. For example:
# rpmbuild -bb --with check openvswitch.spec
+# Enable PIE, bz#955181
+%global _hardened_build 1
+
+# RHEL-7 doesn't define _rundir macro yet
+# Fedora 15 onwards uses /run as _rundir
+%if 0%{!?_rundir:1}
+%define _rundir /run
+%endif
# To disable DPDK support, specify '--without dpdk' when building
%bcond_without dpdk
# test-suite is broken for big endians
# https://bugzilla.redhat.com/show_bug.cgi?id=1105458#c10
-# "ofproto-dpif - select group with dp_hash selection method" test is broken on arm
-%ifnarch ppc ppc64 ppc64p7 s390 s390x armv7hl
+# "ofproto-dpif - select group with dp_hash selection method" test is broken on armv7lh
+%ifarch x86_64 aarch64 ppc64le
%bcond_without check
%else
%bcond_with check
%endif
-
+# option to run kernel datapath tests, requires building as root!
+%bcond_with check_datapath_kernel
# option to build with libcap-ng, needed for running OVS as regular user
%bcond_without libcapng
-
-# Enable PIE, bz#955181
-%global _hardened_build 1
-
-%define dpdkver 17.11
-%define dpdkdir dpdk
-%define dpdksver %(echo %{dpdkver} | cut -d. -f-2)
+# option to build openvswitch-ovn-docker package
+%bcond_with ovn_docker
Name: openvswitch
+Summary: Open vSwitch
+Group: System Environment/Daemons daemon/database/utilities
+URL: http://www.openvswitch.org/
Version: 2.9.0
Release: 1%{?commit0:.%{date}git%{shortcommit0}}%{?dist}
-Summary: Open vSwitch daemon/database/utilities
# Nearly all of openvswitch is ASL 2.0. The bugtool is LGPLv2+, and the
# lib/sflow*.[ch] files are SISSL
# datapath/ is GPLv2 (although not built into any of the binary packages)
License: ASL 2.0 and LGPLv2+ and SISSL
-URL: http://openvswitch.org
+
+%define dpdkver 17.11
+%define dpdkdir dpdk
+%define dpdksver %(echo %{dpdkver} | cut -d. -f-2)
+# NOTE: DPDK does not currently build for s390x
+%define dpdkarches x86_64 aarch64 ppc64le
%if 0%{?commit0:1}
Source: https://github.com/openvswitch/ovs/archive/%{commit0}.tar.gz#/%{name}-%{s...
%else
Source: http://openvswitch.org/releases/%{name}-%{version}.tar.gz
%endif
-Source10: http://fast.dpdk.org/rel/dpdk-%{dpdkver}.tar.gz
+Source10: http://fast.dpdk.org/rel/dpdk-%{dpdkver}.tar.xz
Source500: configlib.sh
Source501: gen_config_group.sh
@@ -60,12 +71,39 @@ Source504: arm64-armv8a-linuxapp-gcc-config
Source505: ppc_64-power8-linuxapp-gcc-config
Source506: x86_64-native-linuxapp-gcc-config
+# The DPDK is designed to optimize througput of network traffic using, among
+# other techniques, carefully crafted assembly instructions. As such it
+# needs extensive work to port it to other architectures.
+ExclusiveArch: x86_64 aarch64 ppc64le s390x
+
+# dpdk_mach_arch maps between rpm and dpdk arch name, often same as _target_cpu
+# dpdk_mach_tmpl is the config template dpdk_mach name, often "native"
+# dpdk_mach is the actual dpdk_mach name used in the dpdk make system
+%ifarch x86_64
+%define dpdk_mach_arch x86_64
+%define dpdk_mach_tmpl native
+%define dpdk_mach default
+%endif
+%ifarch aarch64
+%define dpdk_mach_arch arm64
+%define dpdk_mach_tmpl armv8a
+%define dpdk_mach armv8a
+%endif
+%ifarch ppc64le
+%define dpdk_mach_arch ppc_64
+%define dpdk_mach_tmpl power8
+%define dpdk_mach power8
+%endif
+
+%define dpdktarget %{dpdk_mach_arch}-%{dpdk_mach_tmpl}-linuxapp-gcc
+
# ovs-patches
# OVS (including OVN) backports (0 - 300)
Patch10: 0001-ofproto-dpif-Delete-system-tunnel-interface-when-rem.patch
+
# DPDK backports (400-500)
Patch400: 0001-vhost_user_protect_active_rings_from_async_ring_changes.patch
@@ -79,54 +117,40 @@ Patch423: 0004-vhost-destroy-unused-virtqueues-when-multiqueue-not-.patch
Patch424: 0005-vhost-add-flag-for-built-in-virtio-driver.patch
Patch425: 0006-vhost-drop-virtqueues-only-with-built-in-virtio-driv.patch
-%if %{with dpdk}
-%define dpdkarches x86_64 aarch64 ppc64le
-
-# machine_arch maps between rpm and dpdk arch name, often same as _target_cpu
-# machine_tmpl is the config template machine name, often "native"
-# machine is the actual machine name used in the dpdk make system
-%ifarch x86_64
-%define machine_arch x86_64
-%define machine_tmpl native
-%define machine default
-%endif
-%ifarch aarch64
-%define machine_arch arm64
-%define machine_tmpl armv8a
-%define machine armv8a
-%endif
-%ifarch ppc64le
-%define machine_arch ppc_64
-%define machine_tmpl power8
-%define machine power8
-%endif
-
-%define dpdktarget %{machine_arch}-%{machine_tmpl}-linuxapp-gcc
-%endif
-ExcludeArch: ppc
BuildRequires: gcc
-BuildRequires: python-sphinx
+BuildRequires: python2-sphinx
BuildRequires: autoconf automake libtool
BuildRequires: systemd-units openssl openssl-devel
BuildRequires: python2-devel python2-six
BuildRequires: python3-devel python3-six
BuildRequires: desktop-file-utils
-BuildRequires: groff graphviz
+BuildRequires: groff-base graphviz
# make check dependencies
-%if %{with check}
-BuildRequires: python2-twisted python2-zope-interface
BuildRequires: procps-ng
+BuildRequires: pyOpenSSL
+%if %{with check_datapath_kernel}
+BuildRequires: nmap-ncat
+# would be useful but not available in RHEL or EPEL
+#BuildRequires: pyftpdlib
+%endif
+
+%if %{with libcapng}
+BuildRequires: libcap-ng libcap-ng-devel
%endif
+
%if %{with dpdk}
%ifarch %{dpdkarches}
# DPDK driver dependencies
-BuildRequires: libpcap-devel numactl-devel
-%endif
+BuildRequires: zlib-devel libpcap-devel numactl-devel
+
+# Virtual provide for depending on DPDK-enabled OVS
+Provides: openvswitch-dpdk = %{version}-%{release}
+# Migration path for openvswitch-dpdk package
+Obsoletes: openvswitch-dpdk < 2.6.0
+# Required by packaging policy for the bundled DPDK
+Provides: bundled(dpdk) = %{dpdkver}
%endif
-
-%if %{with libcapng}
-BuildRequires: libcap-ng libcap-ng-devel
%endif
Requires: openssl iproute module-init-tools
@@ -228,6 +252,7 @@ Requires: openvswitch
%description ovn-common
Utilities that are use to diagnose and manage the OVN components.
+%if %{with ovn_docker}
%package ovn-docker
Summary: Open vSwitch - Open Virtual Network support
License: ASL 2.0
@@ -235,6 +260,7 @@ Requires: openvswitch openvswitch-ovn-common python2-openvswitch
%description ovn-docker
Docker network plugins for OVN.
+%endif
%prep
%if 0%{?commit0:1}
@@ -244,8 +270,14 @@ Docker network plugins for OVN.
%endif
%build
+%if 0%{?commit0:1}
+# fix the snapshot unreleased version to be the released one.
+sed -i.old -e "s/^AC_INIT(openvswitch,.*,/AC_INIT(openvswitch, %{version},/" configure.ac
+%endif
+./boot.sh
+
%if %{with dpdk}
-%ifarch %{dpdkarches}
+%ifarch %{dpdkarches} # build dpdk
# Lets build DPDK first
cd %{dpdkdir}-%{dpdkver}
@@ -276,7 +308,7 @@ DPDK drivers included in this package:
EOF
-for f in $(ls %{machine_arch}-%{machine_tmpl}-linuxapp-gcc/lib/lib*_pmd_*); do
+for f in $(ls %{dpdk_mach_arch}-%{dpdk_mach_tmpl}-linuxapp-gcc/lib/lib*_pmd_*); do
basename ${f} | cut -c12- | cut -d. -f1 | tr [:lower:] [:upper:]
done >> README.DPDK-PMDS
@@ -287,15 +319,10 @@ http://dpdk.org/doc/guides-%{dpdksver}/nics/index.html
EOF
cd -
-%endif
+%endif # build dpdk
%endif
-%if 0%{?commit0:1}
-# fix the snapshot unreleased version to be the released one.
-sed -i.old -e "s/^AC_INIT(openvswitch,.*,/AC_INIT(openvswitch, %{version},/" configure.ac
-%endif
-./boot.sh
-
+# And now for OVS...
%configure \
%if %{with libcapng}
--enable-libcapng \
@@ -330,11 +357,12 @@ install -p -D -m 0644 rhel/usr_lib_udev_rules.d_91-vfio.rules \
install -p -D -m 0644 \
rhel/usr_share_openvswitch_scripts_systemd_sysconfig.template \
$RPM_BUILD_ROOT/%{_sysconfdir}/sysconfig/openvswitch
+
for service in openvswitch ovsdb-server ovs-vswitchd ovs-delete-transient-ports \
ovn-controller ovn-controller-vtep ovn-northd; do
install -p -D -m 0644 \
- rhel/usr_lib_systemd_system_${service}.service \
- $RPM_BUILD_ROOT%{_unitdir}/${service}.service
+ rhel/usr_lib_systemd_system_${service}.service \
+ $RPM_BUILD_ROOT%{_unitdir}/${service}.service
done
install -m 0755 rhel/etc_init.d_openvswitch \
@@ -375,16 +403,28 @@ install -d -m 0755 $RPM_BUILD_ROOT%{_prefix}/lib/ocf/resource.d/ovn
ln -s %{_datadir}/openvswitch/scripts/ovndb-servers.ocf \
$RPM_BUILD_ROOT%{_prefix}/lib/ocf/resource.d/ovn/ovndb-servers
+install -p -D -m 0755 \
+ rhel/usr_share_openvswitch_scripts_ovs-systemd-reload \
+ $RPM_BUILD_ROOT%{_datadir}/openvswitch/scripts/ovs-systemd-reload
+
touch $RPM_BUILD_ROOT%{_sysconfdir}/openvswitch/conf.db
touch $RPM_BUILD_ROOT%{_sysconfdir}/openvswitch/system-id.conf
# remove unpackaged files
rm -f $RPM_BUILD_ROOT/%{_bindir}/ovs-benchmark \
+ $RPM_BUILD_ROOT/%{_bindir}/ovs-docker \
$RPM_BUILD_ROOT/%{_bindir}/ovs-parse-backtrace \
+ $RPM_BUILD_ROOT/%{_bindir}/ovs-testcontroller \
$RPM_BUILD_ROOT/%{_sbindir}/ovs-vlan-bug-workaround \
$RPM_BUILD_ROOT/%{_mandir}/man1/ovs-benchmark.1* \
+ $RPM_BUILD_ROOT/%{_mandir}/man8/ovs-testcontroller.* \
$RPM_BUILD_ROOT/%{_mandir}/man8/ovs-vlan-bug-workaround.8*
+%if %{without ovn_docker}
+rm -f $RPM_BUILD_ROOT/%{_bindir}/ovn-docker-overlay-driver \
+ $RPM_BUILD_ROOT/%{_bindir}/ovn-docker-underlay-driver
+%endif
+
%check
%if %{with check}
if make check TESTSUITEFLAGS='%{_smp_mflags}' ||
@@ -394,6 +434,16 @@ rm -f $RPM_BUILD_ROOT/%{_bindir}/ovs-benchmark \
exit 1
fi
%endif
+%if %{with check_datapath_kernel}
+ if make check-kernel RECHECK=yes; then :;
+ else
+ cat tests/system-kmod-testsuite.log
+ exit 1
+ fi
+%endif
+
+%clean
+rm -rf $RPM_BUILD_ROOT
%preun
%if 0%{?systemd_preun:1}
@@ -529,14 +579,10 @@ fi
%endif
%postun
-%if 0%{?systemd_postun_with_restart:1}
- %systemd_postun_with_restart %{name}.service
+%if 0%{?systemd_postun:1}
+ %systemd_postun %{name}.service
%else
/bin/systemctl daemon-reload >/dev/null 2>&1 || :
- if [ "$1" -ge "1" ] ; then
- # Package upgrade, not uninstall
- /bin/systemctl try-restart %{name}.service >/dev/null 2>&1 || :
- fi
%endif
@@ -578,13 +624,13 @@ fi
%config %ghost %{_sysconfdir}/openvswitch/conf.db
%config %ghost %{_sysconfdir}/openvswitch/system-id.conf
%config(noreplace) %{_sysconfdir}/sysconfig/openvswitch
-%config(noreplace) %{_sysconfdir}/logrotate.d/openvswitch
%defattr(-,root,root)
%{_sysconfdir}/bash_completion.d/ovs-appctl-bashcomp.bash
%{_sysconfdir}/bash_completion.d/ovs-vsctl-bashcomp.bash
+%config(noreplace) %{_sysconfdir}/logrotate.d/openvswitch
%{_unitdir}/openvswitch.service
-%{_unitdir}/ovs-vswitchd.service
%{_unitdir}/ovsdb-server.service
+%{_unitdir}/ovs-vswitchd.service
%{_unitdir}/ovs-delete-transient-ports.service
%{_datadir}/openvswitch/scripts/openvswitch.init
%{_sysconfdir}/sysconfig/network-scripts/ifup-ovs
@@ -596,17 +642,16 @@ fi
%{_datadir}/openvswitch/scripts/ovs-save
%{_datadir}/openvswitch/scripts/ovs-vtep
%{_datadir}/openvswitch/scripts/ovs-ctl
+%{_datadir}/openvswitch/scripts/ovs-systemd-reload
%config %{_datadir}/openvswitch/vswitch.ovsschema
%config %{_datadir}/openvswitch/vtep.ovsschema
%{_bindir}/ovs-appctl
-%{_bindir}/ovs-docker
%{_bindir}/ovs-dpctl
%{_bindir}/ovs-dpctl-top
%{_bindir}/ovs-ofctl
%{_bindir}/ovs-vsctl
%{_bindir}/ovsdb-client
%{_bindir}/ovsdb-tool
-%{_bindir}/ovs-testcontroller
%{_bindir}/ovs-pki
%{_bindir}/vtep-ctl
%{_sbindir}/ovs-bugtool
@@ -632,16 +677,22 @@ fi
%{_mandir}/man8/ovs-vsctl.8*
%{_mandir}/man8/ovs-vswitchd.8*
%{_mandir}/man8/ovs-parse-backtrace.8*
-%{_mandir}/man8/ovs-testcontroller.8*
%{_udevrulesdir}/91-vfio.rules
%doc COPYING NOTICE README.rst NEWS rhel/README.RHEL.rst
+%if %{with dpdk}
+%ifarch %{dpdkarches}
+%doc dpdk-%{dpdkver}/README.DPDK-PMDS
+%endif
+%endif
/var/lib/openvswitch
%attr(755,-,-) /var/log/openvswitch
%ghost %attr(755,root,root) %{_rundir}/openvswitch
+%if %{with ovn_docker}
%files ovn-docker
%{_bindir}/ovn-docker-overlay-driver
%{_bindir}/ovn-docker-underlay-driver
+%endif
%files ovn-common
%{_bindir}/ovn-detrace
diff --git a/sources b/sources
index 42c9bf1..9e29d2b 100644
--- a/sources
+++ b/sources
@@ -1,2 +1,2 @@
SHA512 (openvswitch-2.9.0.tar.gz) = c9feb45c650b73093ad1f25f2fc6dbd135dfab691b3322bf87c6efe34bcbfc0a099d1db85c14fe08eb05f4154eae56dd81de54c0a6be97b42a4aa4b6ae53e37b
-SHA512 (dpdk-17.11.tar.gz) = 5d18b86ae73d3098ccc28aefff180ddcc3ebf023678bc009cf93533f36bd5fa93713721cbf1eec81a6f59901ec4ff0d26b2841888a7969cc0c15c3d129c5e063
+SHA512 (dpdk-17.11.tar.xz) = 0b4dd3ce0dd2c57a0ab4dc8d8f7a27b914d418e48219eecfd6aad123af8ca64515b414385cb512aa5bc1fca6bda429841590f90fcc461821717deaa50545ca8d
6 years, 4 months
Architecture specific change in rpms/libp11.git
by githook-noreply@fedoraproject.org
The package rpms/libp11.git has added or updated architecture specific content in its
spec file (ExclusiveArch/ExcludeArch or %ifarch/%ifnarch) in commit(s):
https://src.fedoraproject.org/cgit/rpms/libp11.git/commit/?id=d38047a2677....
Change:
-%ifnarch ppc ppc64 ppc64le
Thanks.
Full change:
============
commit dbd07f7706ba9fb42ebe3aec6d71bab11b79c6cd
Author: Anderson Toshiyuki Sasaki <ansasaki(a)redhat.com>
Date: Tue Feb 20 14:20:15 2018 +0100
Use %autosetup instead of %setup -q
Using %autosetup automatically apply patches, avoiding the use of extra
lines for each patch.
diff --git a/libp11.spec b/libp11.spec
index fe30498..b91bc17 100644
--- a/libp11.spec
+++ b/libp11.spec
@@ -45,7 +45,7 @@ openssl to a PKCS#11 module. Engine_pkcs11 is meant to be used with smart
cards and software for using smart cards in PKCS#11 format, such as OpenSC.
%prep
-%setup -q
+%autosetup
%build
autoreconf -fvi
commit 2d2f528e0e4570ba08654689741f15adf6a09200
Author: Anderson Toshiyuki Sasaki <ansasaki(a)redhat.com>
Date: Tue Feb 20 14:17:22 2018 +0100
Make used CFLAGS more visible
CFLAGS definition extracted from %configure line and exported in a line
alone.
diff --git a/libp11.spec b/libp11.spec
index c7811a9..fe30498 100644
--- a/libp11.spec
+++ b/libp11.spec
@@ -49,7 +49,8 @@ cards and software for using smart cards in PKCS#11 format, such as OpenSC.
%build
autoreconf -fvi
-%configure CFLAGS="%{optflags}" --disable-static --with-enginesdir=%{enginesdir}
+export CFLAGS="%{optflags}"
+%configure --disable-static --with-enginesdir=%{enginesdir}
make V=1 %{?_smp_mflags}
%install
commit d38047a2677f0d347ad06ae4e06409f6fe3192a1
Author: Anderson Toshiyuki Sasaki <ansasaki(a)redhat.com>
Date: Tue Feb 20 13:42:15 2018 +0100
Remove conditionals for PPC
Conditinals for PPC architecture were used in the past, but they are not
needed anymore.
diff --git a/libp11.spec b/libp11.spec
index b2c3f59..c7811a9 100644
--- a/libp11.spec
+++ b/libp11.spec
@@ -16,15 +16,8 @@ BuildRequires: autoconf automake libtool
BuildRequires: libtool-ltdl-devel
BuildRequires: openssl-devel
BuildRequires: pkgconfig
-%if 0%{?fedora}
-BuildRequires: autoconf automake libtool
# needed for testsuite
BuildRequires: softhsm opensc
-%else
-%ifnarch ppc ppc64 ppc64le
-BuildRequires: softhsm opensc
-%endif
-%endif
%description
@@ -40,15 +33,8 @@ License: BSD
BuildRequires: openssl-devel pkgconfig
BuildRequires: pkgconfig(p11-kit-1)
-%if 0%{?fedora}
-BuildRequires: softhsm opensc
-Recommends: p11-kit-trust
-%else
-%ifnarch ppc ppc64 ppc64le
BuildRequires: softhsm opensc
Requires: p11-kit-trust
-%endif
-%endif
Requires: openssl > 0.9.6
Requires: %{name}%{?_isa} = %{version}-%{release}
@@ -62,9 +48,7 @@ cards and software for using smart cards in PKCS#11 format, such as OpenSC.
%setup -q
%build
-%if 0%{?fedora}
autoreconf -fvi
-%endif
%configure CFLAGS="%{optflags}" --disable-static --with-enginesdir=%{enginesdir}
make V=1 %{?_smp_mflags}
@@ -82,9 +66,7 @@ rm -f %{buildroot}%{_libdir}/pkgconfig/libp11.pc
rm -f %{buildroot}%{_includedir}/*.h
%check
-%if 0%{?fedora}
make check %{?_smp_mflags}
-%endif
%post -p /sbin/ldconfig
commit 47ba7fe60434d3e747093f1b01d4dca2bdaa17e7
Author: Anderson Toshiyuki Sasaki <ansasaki(a)redhat.com>
Date: Tue Feb 20 10:57:12 2018 +0100
Remove API documentation
Since the -devel package is no longer shipped, the documentation should
not be generated or installed.
diff --git a/libp11.spec b/libp11.spec
index b8c07a8..b2c3f59 100644
--- a/libp11.spec
+++ b/libp11.spec
@@ -13,7 +13,6 @@ URL: https://github.com/OpenSC/libp11
Source0: https://github.com/OpenSC/libp11/releases/download/%{name}-%{version}/%{n...
BuildRequires: autoconf automake libtool
-BuildRequires: doxygen graphviz
BuildRequires: libtool-ltdl-devel
BuildRequires: openssl-devel
BuildRequires: pkgconfig
@@ -66,18 +65,13 @@ cards and software for using smart cards in PKCS#11 format, such as OpenSC.
%if 0%{?fedora}
autoreconf -fvi
%endif
-%configure CFLAGS="%{optflags}" --disable-static --enable-api-doc --with-enginesdir=%{enginesdir}
+%configure CFLAGS="%{optflags}" --disable-static --with-enginesdir=%{enginesdir}
make V=1 %{?_smp_mflags}
%install
mkdir -p %{buildroot}%{enginesdir}
make install DESTDIR=%{buildroot}
-# Use %%doc to install documentation in a standard location
-mkdir __docdir
-mv %{buildroot}%{_datadir}/doc/%{name}/api/ __docdir/
-rm -rf %{buildroot}%{_datadir}/doc/%{name}/
-
# Remove libtool .la files
rm -f %{buildroot}%{_libdir}/*.la
rm -f %{buildroot}%{enginesdir}/*.la
commit e20bc96519a42982e5557f8524bc6f3b62f4a23a
Author: Anderson Toshiyuki Sasaki <ansasaki(a)redhat.com>
Date: Mon Feb 19 16:47:44 2018 +0100
Remove conditionals for old Fedora versions
Since Fedora 25 and previous versions reached EOL, these conditionals
are not needed anymore.
diff --git a/libp11.spec b/libp11.spec
index 9aa8b3b..b8c07a8 100644
--- a/libp11.spec
+++ b/libp11.spec
@@ -1,11 +1,9 @@
# This spec file has been automatically updated
Version: 0.4.7
Release: 2%{?dist}
-%if 0%{?fedora} >= 26
+
+# Define the directory where the OpenSSL engines are installed
%global enginesdir %{_libdir}/engines-1.1
-%else
-%global enginesdir %{_libdir}/openssl/engines
-%endif
Name: libp11
Summary: Library for using PKCS#11 modules
commit b4392231903bf281e00f090e1deeaf595cf61cf0
Author: Anderson Toshiyuki Sasaki <ansasaki(a)redhat.com>
Date: Mon Feb 19 16:42:23 2018 +0100
Remove unecessary %defattr(-,root,root,-)
It was necessary in the past, but it is not anymore.
diff --git a/libp11.spec b/libp11.spec
index 22b4303..9aa8b3b 100644
--- a/libp11.spec
+++ b/libp11.spec
@@ -99,13 +99,11 @@ make check %{?_smp_mflags}
%postun -p /sbin/ldconfig
%files
-%defattr(-,root,root,-)
%license COPYING
%doc NEWS
%{_libdir}/libp11.so.*
%files -n engine_pkcs11
-%defattr(-,root,root,-)
%doc NEWS
%{enginesdir}/*.so
commit 90ca9983cd79ecab97f49f678c89536ab708b4e0
Author: Anderson Toshiyuki Sasaki <ansasaki(a)redhat.com>
Date: Thu Feb 15 11:06:16 2018 +0100
Remove Group Tag
Following the Packaging Guidelines section:
https://fedoraproject.org/wiki/Packaging:Guidelines#Tags_and_Sections
diff --git a/libp11.spec b/libp11.spec
index 141d617..22b4303 100644
--- a/libp11.spec
+++ b/libp11.spec
@@ -10,7 +10,6 @@ Release: 2%{?dist}
Name: libp11
Summary: Library for using PKCS#11 modules
-Group: System Environment/Libraries
License: LGPLv2+
URL: https://github.com/OpenSC/libp11
Source0: https://github.com/OpenSC/libp11/releases/download/%{name}-%{version}/%{n...
@@ -40,7 +39,6 @@ make using PKCS#11 implementations easier.
%package -n engine_pkcs11
Summary: A PKCS#11 engine for use with OpenSSL
-Group: Development/Libraries
License: BSD
BuildRequires: openssl-devel pkgconfig
commit fb2a531dcebdd48e52fda62de85dacf696046d06
Author: Anderson Toshiyuki Sasaki <ansasaki(a)redhat.com>
Date: Tue Feb 13 15:56:06 2018 +0100
Remove commented line and expand tabs in spec file
The commented line containing a macro and the mix of tabs and spaces
were causing warnings in rpmlint.
diff --git a/libp11.spec b/libp11.spec
index f5ab2ef..141d617 100644
--- a/libp11.spec
+++ b/libp11.spec
@@ -1,5 +1,5 @@
# This spec file has been automatically updated
-Version: 0.4.7
+Version: 0.4.7
Release: 2%{?dist}
%if 0%{?fedora} >= 26
%global enginesdir %{_libdir}/engines-1.1
@@ -15,7 +15,7 @@ License: LGPLv2+
URL: https://github.com/OpenSC/libp11
Source0: https://github.com/OpenSC/libp11/releases/download/%{name}-%{version}/%{n...
-BuildRequires: autoconf automake libtool
+BuildRequires: autoconf automake libtool
BuildRequires: doxygen graphviz
BuildRequires: libtool-ltdl-devel
BuildRequires: openssl-devel
@@ -47,15 +47,15 @@ BuildRequires: openssl-devel pkgconfig
BuildRequires: pkgconfig(p11-kit-1)
%if 0%{?fedora}
BuildRequires: softhsm opensc
-Recommends: p11-kit-trust
+Recommends: p11-kit-trust
%else
%ifnarch ppc ppc64 ppc64le
BuildRequires: softhsm opensc
-Requires: p11-kit-trust
+Requires: p11-kit-trust
%endif
%endif
-Requires: openssl > 0.9.6
-Requires: %{name}%{?_isa} = %{version}-%{release}
+Requires: openssl > 0.9.6
+Requires: %{name}%{?_isa} = %{version}-%{release}
%description -n engine_pkcs11
Engine_pkcs11 is an implementation of an engine for OpenSSL. It can be loaded
@@ -75,7 +75,6 @@ make V=1 %{?_smp_mflags}
%install
mkdir -p %{buildroot}%{enginesdir}
-#make install DESTDIR=%{buildroot} INSTALL="install -p"
make install DESTDIR=%{buildroot}
# Use %%doc to install documentation in a standard location
commit c2e3487337c721f29426426f9cb6a3d756163890
Author: Anderson Toshiyuki Sasaki <ansasaki(a)redhat.com>
Date: Tue Feb 13 15:24:04 2018 +0100
Add full versioned dependency in subpackage
Following the Packaging Guidelines section:
https://fedoraproject.org/wiki/Packaging:Guidelines#Requiring_Base_Package
diff --git a/libp11.spec b/libp11.spec
index fc5c644..f5ab2ef 100644
--- a/libp11.spec
+++ b/libp11.spec
@@ -55,7 +55,7 @@ Requires: p11-kit-trust
%endif
%endif
Requires: openssl > 0.9.6
-Requires: %{name} = %{version}-%{release}
+Requires: %{name}%{?_isa} = %{version}-%{release}
%description -n engine_pkcs11
Engine_pkcs11 is an implementation of an engine for OpenSSL. It can be loaded
commit 2b7b8452a2d57d3275ec332911397a79fe764c74
Author: Anderson Toshiyuki Sasaki <ansasaki(a)redhat.com>
Date: Tue Feb 13 14:55:25 2018 +0100
Make %build to honor applicable compiler flags
Following the Package Guidelines section:
https://fedoraproject.org/wiki/Packaging:Guidelines#Compiler_flags
diff --git a/libp11.spec b/libp11.spec
index e99ec71..fc5c644 100644
--- a/libp11.spec
+++ b/libp11.spec
@@ -70,7 +70,7 @@ cards and software for using smart cards in PKCS#11 format, such as OpenSC.
%if 0%{?fedora}
autoreconf -fvi
%endif
-%configure --disable-static --enable-api-doc --with-enginesdir=%{enginesdir}
+%configure CFLAGS="%{optflags}" --disable-static --enable-api-doc --with-enginesdir=%{enginesdir}
make V=1 %{?_smp_mflags}
%install
commit f8c7cfab908e7da4ea8dbd2ffe2c54632622cab1
Author: Anderson Toshiyuki Sasaki <ansasaki(a)redhat.com>
Date: Tue Feb 13 11:59:04 2018 +0100
Use %global instead of %define
Following the Packaging Guidelines section:
https://fedoraproject.org/wiki/Packaging:Guidelines#.25global_preferred_o...
diff --git a/libp11.spec b/libp11.spec
index 688f06b..e99ec71 100644
--- a/libp11.spec
+++ b/libp11.spec
@@ -2,9 +2,9 @@
Version: 0.4.7
Release: 2%{?dist}
%if 0%{?fedora} >= 26
-%define enginesdir %{_libdir}/engines-1.1
+%global enginesdir %{_libdir}/engines-1.1
%else
-%define enginesdir %{_libdir}/openssl/engines
+%global enginesdir %{_libdir}/openssl/engines
%endif
Name: libp11
@@ -74,23 +74,23 @@ autoreconf -fvi
make V=1 %{?_smp_mflags}
%install
-mkdir -p $RPM_BUILD_ROOT%{enginesdir}
-#make install DESTDIR=$RPM_BUILD_ROOT INSTALL="install -p"
-make install DESTDIR=$RPM_BUILD_ROOT
+mkdir -p %{buildroot}%{enginesdir}
+#make install DESTDIR=%{buildroot} INSTALL="install -p"
+make install DESTDIR=%{buildroot}
# Use %%doc to install documentation in a standard location
mkdir __docdir
-mv $RPM_BUILD_ROOT%{_datadir}/doc/%{name}/api/ __docdir/
-rm -rf $RPM_BUILD_ROOT%{_datadir}/doc/%{name}/
+mv %{buildroot}%{_datadir}/doc/%{name}/api/ __docdir/
+rm -rf %{buildroot}%{_datadir}/doc/%{name}/
# Remove libtool .la files
-rm -f $RPM_BUILD_ROOT%{_libdir}/*.la
-rm -f $RPM_BUILD_ROOT%{enginesdir}/*.la
+rm -f %{buildroot}%{_libdir}/*.la
+rm -f %{buildroot}%{enginesdir}/*.la
## Remove development files
-rm -f $RPM_BUILD_ROOT%{_libdir}/libp11.so
-rm -f $RPM_BUILD_ROOT%{_libdir}/pkgconfig/libp11.pc
-rm -f $RPM_BUILD_ROOT%{_includedir}/*.h
+rm -f %{buildroot}%{_libdir}/libp11.so
+rm -f %{buildroot}%{_libdir}/pkgconfig/libp11.pc
+rm -f %{buildroot}%{_includedir}/*.h
%check
%if 0%{?fedora}
commit 06a0780ed5e003bcbbaba42830b28ed7e1dd158e
Author: Anderson Toshiyuki Sasaki <ansasaki(a)redhat.com>
Date: Tue Feb 13 11:19:44 2018 +0100
Include license file COPYING in %license
Following the Licensing Guidelines section:
https://fedoraproject.org/wiki/Packaging:LicensingGuidelines#License_Text
diff --git a/libp11.spec b/libp11.spec
index 79a6ecd..688f06b 100644
--- a/libp11.spec
+++ b/libp11.spec
@@ -103,7 +103,8 @@ make check %{?_smp_mflags}
%files
%defattr(-,root,root,-)
-%doc COPYING NEWS
+%license COPYING
+%doc NEWS
%{_libdir}/libp11.so.*
%files -n engine_pkcs11
6 years, 4 months