From bf87ff816c84416d47859bd2cb5dc1d617c43b5f Mon Sep 17 00:00:00 2001
From: Sergio Durigan Junior <sergiodj@redhat.com>
Date: Fri, 29 Jun 2018 19:32:31 -0400
Subject: [PATCH] Rebase to FSF GDB 8.1.50.20180629 (8.2pre). Remove pahole.py.
 Adjust handling of gdb-gdb.py.

---
 .gitignore                              |  2 +-
 _git_upstream_commit                    |  2 +-
 gdb-6.3-gstack-20050411.patch           |  6 +-
 gdb-6.5-bz203661-emit-relocs.patch      |  2 +-
 gdb-6.6-buildid-locate-rpm.patch        | 14 ++--
 gdb-6.6-buildid-locate.patch            |  4 +-
 gdb-archer.patch                        | 93 +------------------------
 gdb-attach-fail-reasons-5of5.patch      |  4 +-
 gdb-bz533176-fortran-omp-step.patch     |  4 +-
 gdb-fedora-libncursesw.patch            | 12 ++--
 gdb-jit-reader-multilib.patch           |  4 +-
 gdb-linux_perf-bundle.patch             |  4 +-
 gdb-rhbz795424-bitpos-20of25.patch      | 54 +++++++-------
 gdb-rhbz795424-bitpos-22of25.patch      |  2 +-
 gdb-vla-intel-fortran-strides.patch     | 12 ++--
 gdb-vla-intel-fortran-vla-strings.patch |  4 +-
 gdb.spec                                | 11 ++-
 sources                                 |  2 +-
 18 files changed, 77 insertions(+), 159 deletions(-)

diff --git a/.gitignore b/.gitignore
index 67d9856..a46c566 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,3 +1,3 @@
 /gdb-libstdc++-v3-python-7.1.1-20170526.tar.xz
 /v1.6.1.tar.gz
-/gdb-8.1.50.20180624.tar.xz
+/gdb-8.1.50.20180629.tar.xz
diff --git a/_git_upstream_commit b/_git_upstream_commit
index 7529270..bcd1724 100644
--- a/_git_upstream_commit
+++ b/_git_upstream_commit
@@ -1 +1 @@
-6706f7706241eda253d26ce4c927dd5bed4942a7
+fd1ae9058720aa2738cc4852647097dd89c2bb88
diff --git a/gdb-6.3-gstack-20050411.patch b/gdb-6.3-gstack-20050411.patch
index 77cb3d0..37b09de 100644
--- a/gdb-6.3-gstack-20050411.patch
+++ b/gdb-6.3-gstack-20050411.patch
@@ -16,7 +16,7 @@ Subject: gdb-6.3-gstack-20050411.patch
 diff --git a/gdb/Makefile.in b/gdb/Makefile.in
 --- a/gdb/Makefile.in
 +++ b/gdb/Makefile.in
-@@ -1731,7 +1731,7 @@ info install-info clean-info dvi pdf install-pdf html install-html: force
+@@ -1735,7 +1735,7 @@ info install-info clean-info dvi pdf install-pdf html install-html: force
  install: all
  	@$(MAKE) $(FLAGS_TO_PASS) install-only
  
@@ -25,7 +25,7 @@ diff --git a/gdb/Makefile.in b/gdb/Makefile.in
  	transformed_name=`t='$(program_transform_name)'; \
  			  echo gdb | sed -e "$$t"` ; \
  		if test "x$$transformed_name" = x; then \
-@@ -1780,7 +1780,25 @@ install-guile:
+@@ -1784,7 +1784,25 @@ install-guile:
  install-python:
  	$(SHELL) $(srcdir)/../mkinstalldirs $(DESTDIR)$(GDB_DATADIR)/python/gdb
  
@@ -52,7 +52,7 @@ diff --git a/gdb/Makefile.in b/gdb/Makefile.in
  	transformed_name=`t='$(program_transform_name)'; \
  			  echo gdb | sed -e $$t` ; \
  		if test "x$$transformed_name" = x; then \
-@@ -1803,6 +1821,18 @@ uninstall: force $(CONFIG_UNINSTALL)
+@@ -1807,6 +1825,18 @@ uninstall: force $(CONFIG_UNINSTALL)
  	fi
  	@$(MAKE) DO=uninstall "DODIRS=$(SUBDIRS)" $(FLAGS_TO_PASS) subdir_do
  
diff --git a/gdb-6.5-bz203661-emit-relocs.patch b/gdb-6.5-bz203661-emit-relocs.patch
index 5ef4f39..75ca84f 100644
--- a/gdb-6.5-bz203661-emit-relocs.patch
+++ b/gdb-6.5-bz203661-emit-relocs.patch
@@ -9,7 +9,7 @@ Subject: gdb-6.5-bz203661-emit-relocs.patch
 diff --git a/gdb/symfile.c b/gdb/symfile.c
 --- a/gdb/symfile.c
 +++ b/gdb/symfile.c
-@@ -3492,6 +3492,12 @@ default_symfile_relocate (struct objfile *objfile, asection *sectp,
+@@ -3584,6 +3584,12 @@ default_symfile_relocate (struct objfile *objfile, asection *sectp,
       DWO file.  */
    bfd *abfd = sectp->owner;
  
diff --git a/gdb-6.6-buildid-locate-rpm.patch b/gdb-6.6-buildid-locate-rpm.patch
index 8972abe..d5ec4b0 100644
--- a/gdb-6.6-buildid-locate-rpm.patch
+++ b/gdb-6.6-buildid-locate-rpm.patch
@@ -703,7 +703,7 @@ diff --git a/gdb/config.in b/gdb/config.in
 diff --git a/gdb/configure b/gdb/configure
 --- a/gdb/configure
 +++ b/gdb/configure
-@@ -748,6 +748,11 @@ PKGVERSION
+@@ -749,6 +749,11 @@ CODESIGN_CERT
  HAVE_NATIVE_GCORE_TARGET
  TARGET_OBS
  subdirs
@@ -715,7 +715,7 @@ diff --git a/gdb/configure b/gdb/configure
  GDB_DATADIR
  DEBUGDIR
  MAKEINFO_EXTRA_FLAGS
-@@ -852,6 +857,7 @@ with_gdb_datadir
+@@ -853,6 +858,7 @@ with_gdb_datadir
  with_relocated_sources
  with_auto_load_dir
  with_auto_load_safe_path
@@ -723,7 +723,7 @@ diff --git a/gdb/configure b/gdb/configure
  enable_targets
  enable_64_bit_bfd
  enable_gdbcli
-@@ -910,6 +916,11 @@ CCC
+@@ -912,6 +918,11 @@ CCC
  CPP
  MAKEINFO
  MAKEINFOFLAGS
@@ -735,7 +735,7 @@ diff --git a/gdb/configure b/gdb/configure
  YACC
  YFLAGS
  XMKMF'
-@@ -1580,6 +1591,8 @@ Optional Packages:
+@@ -1583,6 +1594,8 @@ Optional Packages:
                            [--with-auto-load-dir]
    --without-auto-load-safe-path
                            do not restrict auto-loaded files locations
@@ -744,7 +744,7 @@ diff --git a/gdb/configure b/gdb/configure
    --with-libunwind-ia64   use libunwind frame unwinding for ia64 targets
    --with-curses           use the curses library instead of the termcap
                            library
-@@ -1637,6 +1650,13 @@ Some influential environment variables:
+@@ -1640,6 +1653,13 @@ Some influential environment variables:
    MAKEINFO    Parent configure detects if it is of sufficient version.
    MAKEINFOFLAGS
                Parameters for MAKEINFO.
@@ -758,7 +758,7 @@ diff --git a/gdb/configure b/gdb/configure
    YACC        The `Yet Another Compiler Compiler' implementation to use.
                Defaults to the first program found out of: `bison -y', `byacc',
                `yacc'.
-@@ -6572,6 +6592,494 @@ _ACEOF
+@@ -6575,6 +6595,494 @@ _ACEOF
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_auto_load_safe_path" >&5
  $as_echo "$with_auto_load_safe_path" >&6; }
  
@@ -1503,7 +1503,7 @@ diff --git a/gdb/event-top.c b/gdb/event-top.c
 diff --git a/gdb/symfile.h b/gdb/symfile.h
 --- a/gdb/symfile.h
 +++ b/gdb/symfile.h
-@@ -538,6 +538,8 @@ void map_symbol_filenames (symbol_filename_ftype *fun, void *data,
+@@ -540,6 +540,8 @@ void map_symbol_filenames (symbol_filename_ftype *fun, void *data,
  /* build-id support.  */
  extern struct bfd_build_id *build_id_addr_get (CORE_ADDR addr);
  extern void debug_print_missing (const char *binary, const char *debug);
diff --git a/gdb-6.6-buildid-locate.patch b/gdb-6.6-buildid-locate.patch
index 6b41426..618f41a 100644
--- a/gdb-6.6-buildid-locate.patch
+++ b/gdb-6.6-buildid-locate.patch
@@ -979,7 +979,7 @@ diff --git a/gdb/corelow.c b/gdb/corelow.c
 diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo
 --- a/gdb/doc/gdb.texinfo
 +++ b/gdb/doc/gdb.texinfo
-@@ -19562,6 +19562,27 @@ information files.
+@@ -19570,6 +19570,27 @@ information files.
  
  @end table
  
@@ -1148,7 +1148,7 @@ diff --git a/gdb/solib-svr4.c b/gdb/solib-svr4.c
 diff --git a/gdb/symfile.h b/gdb/symfile.h
 --- a/gdb/symfile.h
 +++ b/gdb/symfile.h
-@@ -535,6 +535,10 @@ void expand_symtabs_matching
+@@ -537,6 +537,10 @@ void expand_symtabs_matching
  void map_symbol_filenames (symbol_filename_ftype *fun, void *data,
  			   int need_fullname);
  
diff --git a/gdb-archer.patch b/gdb-archer.patch
index 73006be..dcb989c 100644
--- a/gdb-archer.patch
+++ b/gdb-archer.patch
@@ -17,7 +17,7 @@ tromey/python
 diff --git a/gdb/Makefile.in b/gdb/Makefile.in
 --- a/gdb/Makefile.in
 +++ b/gdb/Makefile.in
-@@ -2098,6 +2098,12 @@ stamp-h: $(srcdir)/config.in config.status
+@@ -2112,6 +2112,12 @@ stamp-h: $(srcdir)/config.in config.status
  	  CONFIG_LINKS= \
  	  $(SHELL) config.status
  
@@ -33,16 +33,15 @@ diff --git a/gdb/Makefile.in b/gdb/Makefile.in
 diff --git a/gdb/data-directory/Makefile.in b/gdb/data-directory/Makefile.in
 --- a/gdb/data-directory/Makefile.in
 +++ b/gdb/data-directory/Makefile.in
-@@ -80,6 +80,8 @@ PYTHON_FILE_LIST = \
+@@ -80,6 +80,7 @@ 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 = \
+@@ -92,6 +93,8 @@ PYTHON_FILE_LIST = \
  	gdb/function/as_string.py \
  	gdb/function/caller_is.py \
  	gdb/function/strfns.py \
@@ -311,92 +310,6 @@ new file mode 100644
 +            pass
 +
 +IgnoreErrorsCommand ()
-diff --git a/gdb/python/lib/gdb/command/pahole.py b/gdb/python/lib/gdb/command/pahole.py
-new file mode 100644
---- /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
 --- /dev/null
diff --git a/gdb-attach-fail-reasons-5of5.patch b/gdb-attach-fail-reasons-5of5.patch
index e1ecd3a..6842d18 100644
--- a/gdb-attach-fail-reasons-5of5.patch
+++ b/gdb-attach-fail-reasons-5of5.patch
@@ -68,7 +68,7 @@ diff --git a/gdb/config.in b/gdb/config.in
 diff --git a/gdb/configure b/gdb/configure
 --- a/gdb/configure
 +++ b/gdb/configure
-@@ -15843,6 +15843,64 @@ cat >>confdefs.h <<_ACEOF
+@@ -15854,6 +15854,64 @@ cat >>confdefs.h <<_ACEOF
  _ACEOF
  
  
@@ -136,7 +136,7 @@ diff --git a/gdb/configure b/gdb/configure
 diff --git a/gdb/configure.ac b/gdb/configure.ac
 --- a/gdb/configure.ac
 +++ b/gdb/configure.ac
-@@ -2047,6 +2047,10 @@ case $host_os in
+@@ -2054,6 +2054,10 @@ case $host_os in
  esac
  AC_DEFINE_UNQUOTED(GDBINIT,"$gdbinit",[The .gdbinit filename.])
  
diff --git a/gdb-bz533176-fortran-omp-step.patch b/gdb-bz533176-fortran-omp-step.patch
index ba1bceb..c42c458 100644
--- a/gdb-bz533176-fortran-omp-step.patch
+++ b/gdb-bz533176-fortran-omp-step.patch
@@ -30,7 +30,7 @@ debugging problem of GOMP outside of the scope of this Bug.
 diff --git a/gdb/infrun.c b/gdb/infrun.c
 --- a/gdb/infrun.c
 +++ b/gdb/infrun.c
-@@ -6670,6 +6670,16 @@ process_event_stop_test (struct execution_control_state *ecs)
+@@ -6694,6 +6694,16 @@ process_event_stop_test (struct execution_control_state *ecs)
  
        if (ecs->event_thread->control.step_over_calls == STEP_OVER_ALL)
  	{
@@ -47,7 +47,7 @@ diff --git a/gdb/infrun.c b/gdb/infrun.c
  	  /* We're doing a "next".
  
  	     Normal (forward) execution: set a breakpoint at the
-@@ -6703,6 +6713,7 @@ process_event_stop_test (struct execution_control_state *ecs)
+@@ -6727,6 +6737,7 @@ process_event_stop_test (struct execution_control_state *ecs)
  
  	  keep_going (ecs);
  	  return;
diff --git a/gdb-fedora-libncursesw.patch b/gdb-fedora-libncursesw.patch
index 66c7b48..5037e29 100644
--- a/gdb-fedora-libncursesw.patch
+++ b/gdb-fedora-libncursesw.patch
@@ -12,7 +12,7 @@ https://bugzilla.redhat.com/show_bug.cgi?id=1270534
 diff --git a/gdb/configure b/gdb/configure
 --- a/gdb/configure
 +++ b/gdb/configure
-@@ -9382,6 +9382,7 @@ if test x"$prefer_curses" = xyes; then
+@@ -9393,6 +9393,7 @@ if test x"$prefer_curses" = xyes; then
    # search /usr/local/include, if ncurses is installed in /usr/local.  A
    # default installation of ncurses on alpha*-dec-osf* will lead to such
    # a situation.
@@ -20,7 +20,7 @@ diff --git a/gdb/configure b/gdb/configure
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing waddstr" >&5
  $as_echo_n "checking for library containing waddstr... " >&6; }
  if ${ac_cv_search_waddstr+:} false; then :
-@@ -9406,7 +9407,7 @@ return waddstr ();
+@@ -9417,7 +9418,7 @@ return waddstr ();
    return 0;
  }
  _ACEOF
@@ -29,7 +29,7 @@ diff --git a/gdb/configure b/gdb/configure
    if test -z "$ac_lib"; then
      ac_res="none required"
    else
-@@ -9480,6 +9481,7 @@ case $host_os in
+@@ -9491,6 +9492,7 @@ case $host_os in
  esac
  
  # These are the libraries checked by Readline.
@@ -37,7 +37,7 @@ diff --git a/gdb/configure b/gdb/configure
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing tgetent" >&5
  $as_echo_n "checking for library containing tgetent... " >&6; }
  if ${ac_cv_search_tgetent+:} false; then :
-@@ -9504,7 +9506,7 @@ return tgetent ();
+@@ -9515,7 +9517,7 @@ return tgetent ();
    return 0;
  }
  _ACEOF
@@ -49,7 +49,7 @@ diff --git a/gdb/configure b/gdb/configure
 diff --git a/gdb/configure.ac b/gdb/configure.ac
 --- a/gdb/configure.ac
 +++ b/gdb/configure.ac
-@@ -759,7 +759,8 @@ if test x"$prefer_curses" = xyes; then
+@@ -766,7 +766,8 @@ if test x"$prefer_curses" = xyes; then
    # search /usr/local/include, if ncurses is installed in /usr/local.  A
    # default installation of ncurses on alpha*-dec-osf* will lead to such
    # a situation.
@@ -59,7 +59,7 @@ diff --git a/gdb/configure.ac b/gdb/configure.ac
  
    if test "$ac_cv_search_waddstr" != no; then
      curses_found=yes
-@@ -801,7 +802,8 @@ case $host_os in
+@@ -808,7 +809,8 @@ case $host_os in
  esac
  
  # These are the libraries checked by Readline.
diff --git a/gdb-jit-reader-multilib.patch b/gdb-jit-reader-multilib.patch
index 6efe38a..2aa41c2 100644
--- a/gdb-jit-reader-multilib.patch
+++ b/gdb-jit-reader-multilib.patch
@@ -9,7 +9,7 @@ Subject: gdb-jit-reader-multilib.patch
 diff --git a/gdb/configure b/gdb/configure
 --- a/gdb/configure
 +++ b/gdb/configure
-@@ -9669,10 +9669,12 @@ _ACEOF
+@@ -9680,10 +9680,12 @@ _ACEOF
  
  
  
@@ -28,7 +28,7 @@ diff --git a/gdb/configure b/gdb/configure
 diff --git a/gdb/configure.ac b/gdb/configure.ac
 --- a/gdb/configure.ac
 +++ b/gdb/configure.ac
-@@ -836,10 +836,12 @@ AC_CHECK_SIZEOF(unsigned long long)
+@@ -843,10 +843,12 @@ AC_CHECK_SIZEOF(unsigned long long)
  AC_CHECK_SIZEOF(unsigned long)
  AC_CHECK_SIZEOF(unsigned __int128)
  
diff --git a/gdb-linux_perf-bundle.patch b/gdb-linux_perf-bundle.patch
index f5bcb6e..c7533f7 100644
--- a/gdb-linux_perf-bundle.patch
+++ b/gdb-linux_perf-bundle.patch
@@ -9,7 +9,7 @@ Subject: gdb-linux_perf-bundle.patch
 diff --git a/gdb/configure b/gdb/configure
 --- a/gdb/configure
 +++ b/gdb/configure
-@@ -12048,7 +12048,7 @@ else
+@@ -12059,7 +12059,7 @@ else
  
  #include <linux/perf_event.h>
  #ifndef PERF_ATTR_SIZE_VER5
@@ -21,7 +21,7 @@ diff --git a/gdb/configure b/gdb/configure
 diff --git a/gdb/configure.ac b/gdb/configure.ac
 --- a/gdb/configure.ac
 +++ b/gdb/configure.ac
-@@ -1470,7 +1470,7 @@ else
+@@ -1477,7 +1477,7 @@ else
    AC_PREPROC_IFELSE([AC_LANG_SOURCE([[
  #include <linux/perf_event.h>
  #ifndef PERF_ATTR_SIZE_VER5
diff --git a/gdb-rhbz795424-bitpos-20of25.patch b/gdb-rhbz795424-bitpos-20of25.patch
index e30b4ee..85691f0 100644
--- a/gdb-rhbz795424-bitpos-20of25.patch
+++ b/gdb-rhbz795424-bitpos-20of25.patch
@@ -1401,30 +1401,6 @@ diff --git a/gdb/c-lang.h b/gdb/c-lang.h
  			const char *user_encoding,
  			int force_ellipses,
  			const struct value_print_options *options);
-diff --git a/gdb/c-typeprint.c b/gdb/c-typeprint.c
---- a/gdb/c-typeprint.c
-+++ b/gdb/c-typeprint.c
-@@ -968,7 +968,8 @@ c_print_type_union_field_offset (struct type *type, unsigned int field_idx,
- {
-   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)));
- }
- 
- /* Helper function for ptype/o implementation that prints information
-@@ -1568,8 +1569,8 @@ c_type_print_base_struct_union (struct type *type, struct ui_file *stream,
- 	      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 --git a/gdb/c-valprint.c b/gdb/c-valprint.c
 --- a/gdb/c-valprint.c
 +++ b/gdb/c-valprint.c
@@ -2794,7 +2770,7 @@ diff --git a/gdb/remote.c b/gdb/remote.c
 diff --git a/gdb/rust-lang.c b/gdb/rust-lang.c
 --- a/gdb/rust-lang.c
 +++ b/gdb/rust-lang.c
-@@ -286,7 +286,7 @@ rust_printchar (int c, struct type *type, struct ui_file *stream)
+@@ -288,7 +288,7 @@ rust_printchar (int c, struct type *type, struct ui_file *stream)
  
  static void
  rust_printstr (struct ui_file *stream, struct type *type,
@@ -2803,7 +2779,7 @@ diff --git a/gdb/rust-lang.c b/gdb/rust-lang.c
  	       const char *user_encoding, int force_ellipses,
  	       const struct value_print_options *options)
  {
-@@ -495,7 +495,7 @@ static const struct generic_val_print_decorations rust_decorations =
+@@ -497,7 +497,7 @@ static const struct generic_val_print_decorations rust_decorations =
  /* la_val_print implementation for Rust.  */
  
  static void
@@ -2970,7 +2946,7 @@ diff --git a/gdb/target.c b/gdb/target.c
  
  static void default_rcmd (struct target_ops *, const char *, struct ui_file *);
  
-@@ -3180,7 +3180,7 @@ target_fileio_read_stralloc (struct inferior *inf, const char *filename)
+@@ -3181,7 +3181,7 @@ target_fileio_read_stralloc (struct inferior *inf, const char *filename)
  
  static int
  default_region_ok_for_hw_watchpoint (struct target_ops *self,
@@ -3099,6 +3075,30 @@ diff --git a/gdb/tracepoint.h b/gdb/tracepoint.h
    void collect_symbol (struct symbol *sym,
  		       struct gdbarch *gdbarch,
  		       long frame_regno, long frame_offset,
+diff --git a/gdb/typeprint.c b/gdb/typeprint.c
+--- a/gdb/typeprint.c
++++ b/gdb/typeprint.c
+@@ -120,7 +120,8 @@ print_offset_data::update (struct type *type, unsigned int field_idx,
+     {
+       /* Since union fields don't have the concept of offsets, we just
+ 	 print their sizes.  */
+-      fprintf_filtered (stream, "/*              %4u */", TYPE_LENGTH (ftype));
++      fprintf_filtered (stream, "/*              %4s */",
++			pulongest (TYPE_LENGTH (ftype)));
+       return;
+     }
+ 
+@@ -183,8 +184,8 @@ print_offset_data::finish (struct type *type, int level,
+ 
+   fputs_filtered ("\n", stream);
+   print_spaces_filtered (level + 4 + print_offset_data::indentation, stream);
+-  fprintf_filtered (stream, "/* total size (bytes): %4u */\n",
+-		    TYPE_LENGTH (type));
++  fprintf_filtered (stream, "/* total size (bytes): %4s */\n",
++		    pulongest (TYPE_LENGTH (type)));
+ }
+ 
+ 
 diff --git a/gdb/valarith.c b/gdb/valarith.c
 --- a/gdb/valarith.c
 +++ b/gdb/valarith.c
diff --git a/gdb-rhbz795424-bitpos-22of25.patch b/gdb-rhbz795424-bitpos-22of25.patch
index e02d3f1..5788c27 100644
--- a/gdb-rhbz795424-bitpos-22of25.patch
+++ b/gdb-rhbz795424-bitpos-22of25.patch
@@ -526,7 +526,7 @@ diff --git a/gdb/target.c b/gdb/target.c
  
  static int default_region_ok_for_hw_watchpoint (struct target_ops *,
  						CORE_ADDR, LONGEST);
-@@ -3188,7 +3188,7 @@ default_region_ok_for_hw_watchpoint (struct target_ops *self,
+@@ -3189,7 +3189,7 @@ default_region_ok_for_hw_watchpoint (struct target_ops *self,
  static int
  default_watchpoint_addr_within_range (struct target_ops *target,
  				      CORE_ADDR addr,
diff --git a/gdb-vla-intel-fortran-strides.patch b/gdb-vla-intel-fortran-strides.patch
index 847c7cc..941a9d0 100644
--- a/gdb-vla-intel-fortran-strides.patch
+++ b/gdb-vla-intel-fortran-strides.patch
@@ -1078,7 +1078,7 @@ diff --git a/gdb/rust-exp.y b/gdb/rust-exp.y
 diff --git a/gdb/rust-lang.c b/gdb/rust-lang.c
 --- a/gdb/rust-lang.c
 +++ b/gdb/rust-lang.c
-@@ -1105,13 +1105,11 @@ rust_range (struct expression *exp, int *pos, enum noside noside)
+@@ -1149,13 +1149,11 @@ rust_range (struct expression *exp, int *pos, enum noside noside)
    kind = (enum range_type) longest_to_int (exp->elts[*pos + 1].longconst);
    *pos += 3;
  
@@ -1095,7 +1095,7 @@ diff --git a/gdb/rust-lang.c b/gdb/rust-lang.c
  
    if (noside == EVAL_SKIP)
      return value_from_longest (builtin_type (exp->gdbarch)->builtin_int, 1);
-@@ -1200,7 +1198,7 @@ rust_compute_range (struct type *type, struct value *range,
+@@ -1244,7 +1242,7 @@ rust_compute_range (struct type *type, struct value *range,
  
    *low = 0;
    *high = 0;
@@ -1104,7 +1104,7 @@ diff --git a/gdb/rust-lang.c b/gdb/rust-lang.c
  
    if (TYPE_NFIELDS (type) == 0)
      return;
-@@ -1208,15 +1206,14 @@ rust_compute_range (struct type *type, struct value *range,
+@@ -1252,15 +1250,14 @@ rust_compute_range (struct type *type, struct value *range,
    i = 0;
    if (strcmp (TYPE_FIELD_NAME (type, 0), "start") == 0)
      {
@@ -1122,7 +1122,7 @@ diff --git a/gdb/rust-lang.c b/gdb/rust-lang.c
        *high = value_as_long (value_field (range, i));
  
        if (rust_inclusive_range_type_p (type))
-@@ -1234,7 +1231,7 @@ rust_subscript (struct expression *exp, int *pos, enum noside noside,
+@@ -1278,7 +1275,7 @@ rust_subscript (struct expression *exp, int *pos, enum noside noside,
    struct type *rhstype;
    LONGEST low, high_bound;
    /* Initialized to appease the compiler.  */
@@ -1131,7 +1131,7 @@ diff --git a/gdb/rust-lang.c b/gdb/rust-lang.c
    LONGEST high = 0;
    int want_slice = 0;
  
-@@ -1332,7 +1329,7 @@ rust_subscript (struct expression *exp, int *pos, enum noside noside,
+@@ -1376,7 +1373,7 @@ rust_subscript (struct expression *exp, int *pos, enum noside noside,
  	error (_("Cannot subscript non-array type"));
  
        if (want_slice
@@ -1140,7 +1140,7 @@ diff --git a/gdb/rust-lang.c b/gdb/rust-lang.c
  	low = low_bound;
        if (low < 0)
  	error (_("Index less than zero"));
-@@ -1350,7 +1347,7 @@ rust_subscript (struct expression *exp, int *pos, enum noside noside,
+@@ -1394,7 +1391,7 @@ rust_subscript (struct expression *exp, int *pos, enum noside noside,
  	  CORE_ADDR addr;
  	  struct value *addrval, *tem;
  
diff --git a/gdb-vla-intel-fortran-vla-strings.patch b/gdb-vla-intel-fortran-vla-strings.patch
index f944945..980b94c 100644
--- a/gdb-vla-intel-fortran-vla-strings.patch
+++ b/gdb-vla-intel-fortran-vla-strings.patch
@@ -33,7 +33,7 @@ git diff --stat -p gdb/master...gdb/users/bheckel/fortran-vla-strings
 diff --git a/gdb/NEWS b/gdb/NEWS
 --- a/gdb/NEWS
 +++ b/gdb/NEWS
-@@ -86,6 +86,8 @@ SH-5/SH64 running OpenBSD 	SH-5/SH64 support in sh*-*-openbsd*
+@@ -103,6 +103,8 @@ SH-5/SH64 running OpenBSD 	SH-5/SH64 support in sh*-*-openbsd*
  
  *** Changes in GDB 8.1
  
@@ -1277,7 +1277,7 @@ diff --git a/gdb/testsuite/gdb.mi/mi-vla-fortran.exp b/gdb/testsuite/gdb.mi/mi-v
 diff --git a/gdb/typeprint.c b/gdb/typeprint.c
 --- a/gdb/typeprint.c
 +++ b/gdb/typeprint.c
-@@ -464,6 +464,25 @@ whatis_exp (const char *exp, int show)
+@@ -589,6 +589,25 @@ whatis_exp (const char *exp, int show)
        printf_filtered (" */\n");    
      }
  
diff --git a/gdb.spec b/gdb.spec
index 4fd3db7..94eb916 100644
--- a/gdb.spec
+++ b/gdb.spec
@@ -18,7 +18,7 @@
 Name: %{?scl_prefix}gdb
 
 # Freeze it when GDB gets branched
-%global snapsrc    20180624
+%global snapsrc    20180629
 # See timestamp of source gnulib installed into gdb/gnulib/ .
 %global snapgnulib 20161115
 %global tarname gdb-%{version}
@@ -26,7 +26,7 @@ Version: 8.1.50.%{snapsrc}
 
 # The release always contains a leading reserved number, start it at 1.
 # `upstream' is not a part of `name' to stay fully rpm dependencies compatible for the testing.
-Release: 25%{?dist}
+Release: 26%{?dist}
 
 License: GPLv3+ and GPLv3+ with exceptions and GPLv2+ and GPLv2+ with exceptions and GPL+ and LGPLv2+ and LGPLv3+ and BSD and Public Domain and GFDL
 Group: Development/Debuggers
@@ -830,7 +830,7 @@ done
 
 %if 0%{?_enable_debug_packages:1} && 0%{!?_without_python:1}
 mkdir -p $RPM_BUILD_ROOT/usr/lib/debug%{_bindir}
-cp -p $RPM_BUILD_DIR/%{gdb_src}/gdb/gdb-gdb.py $RPM_BUILD_ROOT/usr/lib/debug%{_bindir}/
+cp -p ./gdb/gdb-gdb.py $RPM_BUILD_ROOT/usr/lib/debug%{_bindir}/
 for pyo in "" "-O";do
   # RHEL-5: AttributeError: 'module' object has no attribute 'compile_file'
   %{__python} $pyo -c 'import compileall, re, sys; sys.exit (not compileall.compile_dir("'"$RPM_BUILD_ROOT/usr/lib/debug%{_bindir}"'", 1, "'"/usr/lib/debug%{_bindir}"'"))'
@@ -1040,6 +1040,11 @@ fi
 %endif
 
 %changelog
+* Fri Jun 29 2018 Sergio Durigan Junior <sergiodj@redhat.com> - 8.1.50.20180629-26.fc29
+- Rebase to FSF GDB 8.1.50.20180629 (8.2pre).
+- Remove pahole.py.
+- Adjust handling of gdb-gdb.py.
+
 * Sun Jun 24 2018 Sergio Durigan Junior <sergiodj@redhat.com> - 8.1.50.20180624-25.fc29
 - Rebase to FSF GDB 8.1.50.20180624 (8.2pre).
 
diff --git a/sources b/sources
index 23ef074..d1088ae 100644
--- a/sources
+++ b/sources
@@ -1,3 +1,3 @@
 SHA512 (gdb-libstdc++-v3-python-7.1.1-20170526.tar.xz) = 3d540b99581ffa4cf2810bec979c9a01a1f8ce782b7c8efb46b40dd2421d60cdb0e52b53c5477c3e86a57957a2a14489f5c29dc53868738a1ef79e79cf76d0a1
 SHA512 (v1.6.1.tar.gz) = c7c9c8ba78021fff3fde12a216f5729c6031114e5a727f49b7ff1a31c53b5ddba24d1b3aee252d8278ecd1fafe78a44ed059c12b9eb29eca33093e0720673468
-SHA512 (gdb-8.1.50.20180624.tar.xz) = aaf9a9cb270f12b103d34e30fd5fcb180583a7b0fedeb05e3abf79762243abc9acfc168a770df20f81447c7641f44fb99fea7800fd25696fb8a2fde4b82171eb
+SHA512 (gdb-8.1.50.20180629.tar.xz) = 8950feb5f7a6fef41f6220aa01d93454ed0198b4c0e6fb021da4235b537fab46d46031593e251a6255d9e2a715f0f9174abdf068ee8fc3e1b0c99d60a5b75a95