[gdb/f15/master] Rebase to FSF GDB 7.2.50.20110305 (which is a 7.3 pre-release).

Jan Kratochvil jankratochvil at fedoraproject.org
Sat Mar 5 12:25:06 UTC 2011


commit d5159132e2b9bf78498f115faad1c415cace377a
Author: Jan Kratochvil <jan.kratochvil at redhat.com>
Date:   Sat Mar 5 13:24:53 2011 +0100

    Rebase to FSF GDB 7.2.50.20110305 (which is a 7.3 pre-release).

 .gitignore                      |    2 +-
 gdb-6.3-test-pie-20050107.patch |   66 +++---
 gdb-archer.patch                |  443 +++++++++++++++++++++++----------------
 gdb-python-newbacktrace.patch   |   45 ++--
 gdb-upstream.patch              |   66 ++++++
 gdb.spec                        |   11 +-
 sources                         |    2 +-
 7 files changed, 388 insertions(+), 247 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index d5f6f77..ae274c5 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,2 +1,2 @@
 /libstdc++-v3-python-r155978.tar.bz2
-/gdb-7.2.50.20110222.tar.bz2
+/gdb-7.2.50.20110305.tar.bz2
diff --git a/gdb-6.3-test-pie-20050107.patch b/gdb-6.3-test-pie-20050107.patch
index 97a1140..9828afa 100644
--- a/gdb-6.3-test-pie-20050107.patch
+++ b/gdb-6.3-test-pie-20050107.patch
@@ -1,40 +1,40 @@
-Index: gdb-7.2.50.20110117/gdb/testsuite/configure.ac
+Index: gdb-7.2.50.20110305/gdb/testsuite/configure.ac
 ===================================================================
---- gdb-7.2.50.20110117.orig/gdb/testsuite/configure.ac	2011-01-05 06:09:55.000000000 +0100
-+++ gdb-7.2.50.20110117/gdb/testsuite/configure.ac	2011-01-17 15:50:03.000000000 +0100
-@@ -144,6 +144,6 @@ AC_OUTPUT([Makefile \
-   gdb.cp/Makefile gdb.disasm/Makefile gdb.dwarf2/Makefile \
-   gdb.fortran/Makefile gdb.server/Makefile gdb.java/Makefile \
+--- gdb-7.2.50.20110305.orig/gdb/testsuite/configure.ac	2011-03-03 17:57:55.000000000 +0100
++++ gdb-7.2.50.20110305/gdb/testsuite/configure.ac	2011-03-05 08:26:53.000000000 +0100
+@@ -97,6 +97,6 @@ AC_OUTPUT([Makefile \
+   gdb.hp/gdb.aCC/Makefile gdb.hp/gdb.compat/Makefile \
+   gdb.hp/gdb.defects/Makefile \
    gdb.mi/Makefile gdb.modula2/Makefile gdb.multi/Makefile \
 -  gdb.objc/Makefile gdb.opencl/Makefile gdb.opt/Makefile gdb.pascal/Makefile \
 +  gdb.objc/Makefile gdb.opencl/Makefile gdb.opt/Makefile gdb.pascal/Makefile gdb.pie/Makefile \
-   gdb.python/Makefile gdb.reverse/Makefile \
+   gdb.python/Makefile gdb.reverse/Makefile gdb.stabs/Makefile \
    gdb.threads/Makefile gdb.trace/Makefile gdb.xml/Makefile])
-Index: gdb-7.2.50.20110117/gdb/testsuite/configure
+Index: gdb-7.2.50.20110305/gdb/testsuite/configure
 ===================================================================
---- gdb-7.2.50.20110117.orig/gdb/testsuite/configure	2011-01-07 03:51:09.000000000 +0100
-+++ gdb-7.2.50.20110117/gdb/testsuite/configure	2011-01-17 15:50:09.000000000 +0100
-@@ -3515,7 +3515,7 @@ done
+--- gdb-7.2.50.20110305.orig/gdb/testsuite/configure	2011-03-03 17:57:55.000000000 +0100
++++ gdb-7.2.50.20110305/gdb/testsuite/configure	2011-03-05 08:26:58.000000000 +0100
+@@ -3448,7 +3448,7 @@ done
  
  
  
--ac_config_files="$ac_config_files Makefile gdb.ada/Makefile gdb.arch/Makefile gdb.asm/Makefile gdb.base/Makefile gdb.cp/Makefile gdb.disasm/Makefile gdb.dwarf2/Makefile gdb.fortran/Makefile gdb.server/Makefile gdb.java/Makefile gdb.mi/Makefile gdb.modula2/Makefile gdb.multi/Makefile gdb.objc/Makefile gdb.opencl/Makefile gdb.opt/Makefile gdb.pascal/Makefile gdb.python/Makefile gdb.reverse/Makefile gdb.threads/Makefile gdb.trace/Makefile gdb.xml/Makefile"
-+ac_config_files="$ac_config_files Makefile gdb.ada/Makefile gdb.arch/Makefile gdb.asm/Makefile gdb.base/Makefile gdb.cp/Makefile gdb.disasm/Makefile gdb.dwarf2/Makefile gdb.fortran/Makefile gdb.server/Makefile gdb.java/Makefile gdb.mi/Makefile gdb.modula2/Makefile gdb.multi/Makefile gdb.objc/Makefile gdb.opencl/Makefile gdb.opt/Makefile gdb.pascal/Makefile gdb.pie/Makefile gdb.python/Makefile gdb.reverse/Makefile gdb.threads/Makefile gdb.trace/Makefile gdb.xml/Makefile"
+-ac_config_files="$ac_config_files Makefile gdb.ada/Makefile gdb.arch/Makefile gdb.asm/Makefile gdb.base/Makefile gdb.cell/Makefile gdb.cp/Makefile gdb.disasm/Makefile gdb.dwarf2/Makefile gdb.fortran/Makefile gdb.server/Makefile gdb.java/Makefile gdb.hp/Makefile gdb.hp/gdb.objdbg/Makefile gdb.hp/gdb.base-hp/Makefile gdb.hp/gdb.aCC/Makefile gdb.hp/gdb.compat/Makefile gdb.hp/gdb.defects/Makefile gdb.mi/Makefile gdb.modula2/Makefile gdb.multi/Makefile gdb.objc/Makefile gdb.opencl/Makefile gdb.opt/Makefile gdb.pascal/Makefile gdb.python/Makefile gdb.reverse/Makefile gdb.stabs/Makefile gdb.threads/Makefile gdb.trace/Makefile gdb.xml/Makefile"
++ac_config_files="$ac_config_files Makefile gdb.ada/Makefile gdb.arch/Makefile gdb.asm/Makefile gdb.base/Makefile gdb.cell/Makefile gdb.cp/Makefile gdb.disasm/Makefile gdb.dwarf2/Makefile gdb.fortran/Makefile gdb.server/Makefile gdb.java/Makefile gdb.hp/Makefile gdb.hp/gdb.objdbg/Makefile gdb.hp/gdb.base-hp/Makefile gdb.hp/gdb.aCC/Makefile gdb.hp/gdb.compat/Makefile gdb.hp/gdb.defects/Makefile gdb.mi/Makefile gdb.modula2/Makefile gdb.multi/Makefile gdb.objc/Makefile gdb.opencl/Makefile gdb.opt/Makefile gdb.pascal/Makefile gdb.pie/Makefile gdb.python/Makefile gdb.reverse/Makefile gdb.stabs/Makefile gdb.threads/Makefile gdb.trace/Makefile gdb.xml/Makefile"
  
  cat >confcache <<\_ACEOF
  # This file is a shell script that caches the results of configure
-@@ -4233,6 +4233,7 @@ do
+@@ -4173,6 +4173,7 @@ do
      "gdb.opencl/Makefile") CONFIG_FILES="$CONFIG_FILES gdb.opencl/Makefile" ;;
      "gdb.opt/Makefile") CONFIG_FILES="$CONFIG_FILES gdb.opt/Makefile" ;;
      "gdb.pascal/Makefile") CONFIG_FILES="$CONFIG_FILES gdb.pascal/Makefile" ;;
 +    "gdb.pie/Makefile") CONFIG_FILES="$CONFIG_FILES gdb.pie/Makefile" ;;
      "gdb.python/Makefile") CONFIG_FILES="$CONFIG_FILES gdb.python/Makefile" ;;
      "gdb.reverse/Makefile") CONFIG_FILES="$CONFIG_FILES gdb.reverse/Makefile" ;;
-     "gdb.threads/Makefile") CONFIG_FILES="$CONFIG_FILES gdb.threads/Makefile" ;;
-Index: gdb-7.2.50.20110117/gdb/testsuite/gdb.pie/attach.c
+     "gdb.stabs/Makefile") CONFIG_FILES="$CONFIG_FILES gdb.stabs/Makefile" ;;
+Index: gdb-7.2.50.20110305/gdb/testsuite/gdb.pie/attach.c
 ===================================================================
 --- /dev/null	1970-01-01 00:00:00.000000000 +0000
-+++ gdb-7.2.50.20110117/gdb/testsuite/gdb.pie/attach.c	2011-01-17 15:50:03.000000000 +0100
++++ gdb-7.2.50.20110305/gdb/testsuite/gdb.pie/attach.c	2011-03-05 08:26:28.000000000 +0100
 @@ -0,0 +1,20 @@
 +/* This program is intended to be started outside of gdb, and then
 +   attached to by gdb.  Thus, it simply spins in a loop.  The loop
@@ -56,10 +56,10 @@ Index: gdb-7.2.50.20110117/gdb/testsuite/gdb.pie/attach.c
 +    }
 +  return 0;
 +}
-Index: gdb-7.2.50.20110117/gdb/testsuite/gdb.pie/attach2.c
+Index: gdb-7.2.50.20110305/gdb/testsuite/gdb.pie/attach2.c
 ===================================================================
 --- /dev/null	1970-01-01 00:00:00.000000000 +0000
-+++ gdb-7.2.50.20110117/gdb/testsuite/gdb.pie/attach2.c	2011-01-17 15:50:03.000000000 +0100
++++ gdb-7.2.50.20110305/gdb/testsuite/gdb.pie/attach2.c	2011-03-05 08:26:28.000000000 +0100
 @@ -0,0 +1,24 @@
 +/* This program is intended to be started outside of gdb, and then
 +   attached to by gdb.  Thus, it simply spins in a loop.  The loop
@@ -85,10 +85,10 @@ Index: gdb-7.2.50.20110117/gdb/testsuite/gdb.pie/attach2.c
 +    }
 +  return (0);
 +}
-Index: gdb-7.2.50.20110117/gdb/testsuite/gdb.pie/break.c
+Index: gdb-7.2.50.20110305/gdb/testsuite/gdb.pie/break.c
 ===================================================================
 --- /dev/null	1970-01-01 00:00:00.000000000 +0000
-+++ gdb-7.2.50.20110117/gdb/testsuite/gdb.pie/break.c	2011-01-17 15:50:03.000000000 +0100
++++ gdb-7.2.50.20110305/gdb/testsuite/gdb.pie/break.c	2011-03-05 08:26:28.000000000 +0100
 @@ -0,0 +1,146 @@
 +/* This testcase is part of GDB, the GNU debugger.
 +
@@ -236,10 +236,10 @@ Index: gdb-7.2.50.20110117/gdb/testsuite/gdb.pie/break.c
 +    }
 +  return 0;
 +}
-Index: gdb-7.2.50.20110117/gdb/testsuite/gdb.pie/break1.c
+Index: gdb-7.2.50.20110305/gdb/testsuite/gdb.pie/break1.c
 ===================================================================
 --- /dev/null	1970-01-01 00:00:00.000000000 +0000
-+++ gdb-7.2.50.20110117/gdb/testsuite/gdb.pie/break1.c	2011-01-17 15:50:03.000000000 +0100
++++ gdb-7.2.50.20110305/gdb/testsuite/gdb.pie/break1.c	2011-03-05 08:26:28.000000000 +0100
 @@ -0,0 +1,44 @@
 +/* This testcase is part of GDB, the GNU debugger.
 +
@@ -285,10 +285,10 @@ Index: gdb-7.2.50.20110117/gdb/testsuite/gdb.pie/break1.c
 +void marker3 (a, b) char *a, *b; {}	/* set breakpoint 18 here */
 +void marker4 (d) long d; {}		/* set breakpoint 13 here */
 +#endif
-Index: gdb-7.2.50.20110117/gdb/testsuite/gdb.pie/coremaker.c
+Index: gdb-7.2.50.20110305/gdb/testsuite/gdb.pie/coremaker.c
 ===================================================================
 --- /dev/null	1970-01-01 00:00:00.000000000 +0000
-+++ gdb-7.2.50.20110117/gdb/testsuite/gdb.pie/coremaker.c	2011-01-17 15:50:03.000000000 +0100
++++ gdb-7.2.50.20110305/gdb/testsuite/gdb.pie/coremaker.c	2011-03-05 08:26:28.000000000 +0100
 @@ -0,0 +1,142 @@
 +/* Copyright 1992, 1993, 1994, 1995, 1996, 1999
 +   Free Software Foundation, Inc.
@@ -432,10 +432,10 @@ Index: gdb-7.2.50.20110117/gdb/testsuite/gdb.pie/coremaker.c
 +  return 0;
 +}
 +
-Index: gdb-7.2.50.20110117/gdb/testsuite/gdb.pie/attach.exp
+Index: gdb-7.2.50.20110305/gdb/testsuite/gdb.pie/attach.exp
 ===================================================================
 --- /dev/null	1970-01-01 00:00:00.000000000 +0000
-+++ gdb-7.2.50.20110117/gdb/testsuite/gdb.pie/attach.exp	2011-01-17 15:50:03.000000000 +0100
++++ gdb-7.2.50.20110305/gdb/testsuite/gdb.pie/attach.exp	2011-03-05 08:26:28.000000000 +0100
 @@ -0,0 +1,423 @@
 +#   Copyright 1997, 1999, 2002 Free Software Foundation, Inc.
 +
@@ -860,10 +860,10 @@ Index: gdb-7.2.50.20110117/gdb/testsuite/gdb.pie/attach.exp
 +do_call_attach_tests
 +
 +return 0
-Index: gdb-7.2.50.20110117/gdb/testsuite/gdb.pie/break.exp
+Index: gdb-7.2.50.20110305/gdb/testsuite/gdb.pie/break.exp
 ===================================================================
 --- /dev/null	1970-01-01 00:00:00.000000000 +0000
-+++ gdb-7.2.50.20110117/gdb/testsuite/gdb.pie/break.exp	2011-01-17 15:50:03.000000000 +0100
++++ gdb-7.2.50.20110305/gdb/testsuite/gdb.pie/break.exp	2011-03-05 08:26:28.000000000 +0100
 @@ -0,0 +1,966 @@
 +#   Copyright 1988, 1990, 1991, 1992, 1994, 1995, 1996, 1997, 1998, 1999,
 +#   2000, 2002, 2003, 2004
@@ -1831,10 +1831,10 @@ Index: gdb-7.2.50.20110117/gdb/testsuite/gdb.pie/break.exp
 +    send_gdb "set args main\n"
 +    gdb_expect -re ".*$gdb_prompt $" {}
 +}
-Index: gdb-7.2.50.20110117/gdb/testsuite/gdb.pie/corefile.exp
+Index: gdb-7.2.50.20110305/gdb/testsuite/gdb.pie/corefile.exp
 ===================================================================
 --- /dev/null	1970-01-01 00:00:00.000000000 +0000
-+++ gdb-7.2.50.20110117/gdb/testsuite/gdb.pie/corefile.exp	2011-01-17 15:50:03.000000000 +0100
++++ gdb-7.2.50.20110305/gdb/testsuite/gdb.pie/corefile.exp	2011-03-05 08:26:28.000000000 +0100
 @@ -0,0 +1,233 @@
 +# Copyright 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000
 +# Free Software Foundation, Inc.
@@ -2069,10 +2069,10 @@ Index: gdb-7.2.50.20110117/gdb/testsuite/gdb.pie/corefile.exp
 +gdb_test "up" "#\[0-9\]* *\[0-9xa-fH'\]* in .* \\(.*\\).*" "up in corefile.exp (reinit)"
 +
 +gdb_test "core" "No core file now."
-Index: gdb-7.2.50.20110117/gdb/testsuite/gdb.pie/Makefile.in
+Index: gdb-7.2.50.20110305/gdb/testsuite/gdb.pie/Makefile.in
 ===================================================================
 --- /dev/null	1970-01-01 00:00:00.000000000 +0000
-+++ gdb-7.2.50.20110117/gdb/testsuite/gdb.pie/Makefile.in	2011-01-17 15:50:03.000000000 +0100
++++ gdb-7.2.50.20110305/gdb/testsuite/gdb.pie/Makefile.in	2011-03-05 08:26:28.000000000 +0100
 @@ -0,0 +1,19 @@
 +VPATH = @srcdir@
 +srcdir = @srcdir@
diff --git a/gdb-archer.patch b/gdb-archer.patch
index 6bd1ec3..690b025 100644
--- a/gdb-archer.patch
+++ b/gdb-archer.patch
@@ -2,7 +2,7 @@ http://sourceware.org/gdb/wiki/ProjectArcher
 http://sourceware.org/gdb/wiki/ArcherBranchManagement
 
 GIT snapshot:
-commit 691a5a1b3015e2199040ead20cc85bc277af14e3
+commit e802e1fb23d455d675dca0f4d7d6c8df18467719
 
 branch `archer' - the merge of branches:
 archer-jankratochvil-vla
@@ -14,20 +14,20 @@ archer-tromey-python
 
 
 diff --git a/gdb/Makefile.in b/gdb/Makefile.in
-index 6363773..7bd1020 100644
+index 00d624f..635acd3 100644
 --- a/gdb/Makefile.in
 +++ b/gdb/Makefile.in
 @@ -808,7 +808,8 @@ annotate.h sim-regno.h dictionary.h dfp.h main.h frame-unwind.h	\
  remote-fileio.h i386-linux-tdep.h vax-tdep.h objc-lang.h \
  sentinel-frame.h bcache.h symfile.h windows-tdep.h linux-tdep.h \
  gdb_usleep.h jit.h xml-syscall.h microblaze-tdep.h \
--psymtab.h psympriv.h progspace.h bfin-tdep.h ia64-hpux-tdep.h printcmd.h
-+psymtab.h psympriv.h progspace.h bfin-tdep.h ia64-hpux-tdep.h printcmd.h \
+-psymtab.h psympriv.h progspace.h bfin-tdep.h ia64-hpux-tdep.h
++psymtab.h psympriv.h progspace.h bfin-tdep.h ia64-hpux-tdep.h \
 +python/python.h python/python-internal.h
  
  # Header files that already have srcdir in them, or which are in objdir.
  
-@@ -1340,6 +1341,12 @@ stamp-h: $(srcdir)/config.in config.status
+@@ -1317,6 +1318,12 @@ stamp-h: $(srcdir)/config.in config.status
  	  CONFIG_LINKS= \
  	  $(SHELL) config.status
  
@@ -41,7 +41,7 @@ index 6363773..7bd1020 100644
  	$(SHELL) config.status --recheck
  
 diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c
-index 467e4df..555914c 100644
+index d0a1014..32537cb 100644
 --- a/gdb/ada-lang.c
 +++ b/gdb/ada-lang.c
 @@ -11389,6 +11389,7 @@ ada_operator_length (const struct expression *exp, int pc, int *oplenp,
@@ -392,7 +392,7 @@ index b9aaf54..e1f3242 100644
  
  /* Return the innermost stack frame executing inside of BLOCK, or NULL
 diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c
-index 623effa..4bcd681 100644
+index 5bcab87..529ea62 100644
 --- a/gdb/breakpoint.c
 +++ b/gdb/breakpoint.c
 @@ -63,6 +63,7 @@
@@ -413,7 +413,7 @@ index 623effa..4bcd681 100644
  /* This function is used in gdbtk sources and thus can not be made
     static.  */
  struct breakpoint *set_raw_breakpoint (struct gdbarch *gdbarch,
-@@ -217,6 +221,10 @@ static void disable_trace_command (char *, int);
+@@ -218,6 +222,10 @@ static void disable_trace_command (char *, int);
  
  static void trace_pass_command (char *, int);
  
@@ -424,7 +424,7 @@ index 623effa..4bcd681 100644
  /* Assuming we're creating a static tracepoint, does S look like a
     static tracepoint marker spec ("-m MARKER_ID")?  */
  #define is_marker_spec(s)						\
-@@ -1148,6 +1156,22 @@ watchpoint_in_thread_scope (struct breakpoint *b)
+@@ -1149,6 +1157,22 @@ watchpoint_in_thread_scope (struct breakpoint *b)
  	      && !is_executing (inferior_ptid)));
  }
  
@@ -447,7 +447,7 @@ index 623effa..4bcd681 100644
  /* Assuming that B is a watchpoint:
     - Reparse watchpoint expression, if REPARSE is non-zero
     - Evaluate expression and store the result in B->val
-@@ -1207,12 +1231,17 @@ update_watchpoint (struct breakpoint *b, int reparse)
+@@ -1208,12 +1232,17 @@ update_watchpoint (struct breakpoint *b, int reparse)
    struct frame_id saved_frame_id;
    int frame_saved;
  
@@ -465,7 +465,7 @@ index 623effa..4bcd681 100644
    if (b->disposition == disp_del_at_next_stop)
      return;
   
-@@ -1442,13 +1471,7 @@ update_watchpoint (struct breakpoint *b, int reparse)
+@@ -1443,13 +1472,7 @@ update_watchpoint (struct breakpoint *b, int reparse)
  Watchpoint %d deleted because the program has left the block\n\
  in which its expression is valid.\n"),
  		       b->number);
@@ -480,7 +480,7 @@ index 623effa..4bcd681 100644
      }
  
    /* Restore the selected frame.  */
-@@ -1839,6 +1862,7 @@ insert_breakpoint_locations (void)
+@@ -1840,6 +1863,7 @@ insert_breakpoint_locations (void)
    int val = 0;
    int disabled_breaks = 0;
    int hw_breakpoint_error = 0;
@@ -488,7 +488,7 @@ index 623effa..4bcd681 100644
  
    struct ui_file *tmp_error_stream = mem_fileopen ();
    struct cleanup *cleanups = make_cleanup_ui_file_delete (tmp_error_stream);
-@@ -1866,9 +1890,13 @@ insert_breakpoint_locations (void)
+@@ -1867,9 +1891,13 @@ insert_breakpoint_locations (void)
        /* For targets that support global breakpoints, there's no need
  	 to select an inferior to insert breakpoint to.  In fact, even
  	 if we aren't attached to any process yet, we should still
@@ -504,7 +504,7 @@ index 623effa..4bcd681 100644
  	continue;
  
        val = insert_bp_location (bl, tmp_error_stream, &disabled_breaks,
-@@ -1892,13 +1920,19 @@ insert_breakpoint_locations (void)
+@@ -1893,13 +1921,19 @@ insert_breakpoint_locations (void)
  
        if (bpt->disposition == disp_del_at_next_stop)
  	continue;
@@ -530,7 +530,7 @@ index 623effa..4bcd681 100644
        if (some_failed)
  	{
  	  for (loc = bpt->loc; loc; loc = loc->next)
-@@ -3482,6 +3516,8 @@ print_it_typical (bpstat bs)
+@@ -3479,6 +3513,8 @@ print_it_typical (bpstat bs)
      case bp_tracepoint:
      case bp_fast_tracepoint:
      case bp_jit_event:
@@ -539,7 +539,7 @@ index 623effa..4bcd681 100644
      default:
        result = PRINT_UNKNOWN;
        break;
-@@ -3703,6 +3739,8 @@ watchpoint_check (void *p)
+@@ -3704,6 +3740,8 @@ watchpoint_check (void *p)
    gdb_assert (bs->breakpoint_at != NULL);
    b = bs->breakpoint_at;
  
@@ -548,7 +548,7 @@ index 623effa..4bcd681 100644
    /* If this is a local watchpoint, we only want to check if the
       watchpoint frame is in scope if the current thread is the thread
       that was used to create the watchpoint.  */
-@@ -3812,13 +3850,7 @@ watchpoint_check (void *p)
+@@ -3813,13 +3851,7 @@ watchpoint_check (void *p)
  		   " deleted because the program has left the block in\n\
  which its expression is valid.\n");     
  
@@ -563,7 +563,7 @@ index 623effa..4bcd681 100644
  
        return WP_DELETED;
      }
-@@ -4023,9 +4055,7 @@ bpstat_check_watchpoint (bpstat bs)
+@@ -4024,9 +4056,7 @@ bpstat_check_watchpoint (bpstat bs)
  	    case 0:
  	      /* Error from catch_errors.  */
  	      printf_filtered (_("Watchpoint %d deleted.\n"), b->number);
@@ -574,7 +574,7 @@ index 623effa..4bcd681 100644
  	      /* We've already printed what needs to be printed.  */
  	      bs->print_it = print_it_done;
  	      break;
-@@ -4231,7 +4261,7 @@ bpstat_stop_status (struct address_space *aspace,
+@@ -4232,7 +4262,7 @@ bpstat_stop_status (struct address_space *aspace,
  	     watchpoint as triggered so that we will handle the
  	     out-of-scope event.  We'll get to the watchpoint next
  	     iteration.  */
@@ -583,7 +583,7 @@ index 623effa..4bcd681 100644
  	    b->related_breakpoint->watchpoint_triggered = watch_triggered_yes;
  	}
      }
-@@ -4353,7 +4383,7 @@ handle_jit_event (void)
+@@ -4354,7 +4384,7 @@ handle_jit_event (void)
  /* Decide what infrun needs to do with this bpstat.  */
  
  struct bpstat_what
@@ -592,7 +592,7 @@ index 623effa..4bcd681 100644
  {
    struct bpstat_what retval;
    /* We need to defer calling `solib_add', as adding new symbols
-@@ -4361,12 +4391,13 @@ bpstat_what (bpstat bs)
+@@ -4362,12 +4392,13 @@ bpstat_what (bpstat bs)
       and hence may clear unprocessed entries in the BS chain.  */
    int shlib_event = 0;
    int jit_event = 0;
@@ -607,7 +607,7 @@ index 623effa..4bcd681 100644
      {
        /* Extract this BS's action.  After processing each BS, we check
  	 if its action overrides all we've seem so far.  */
-@@ -4496,6 +4527,20 @@ bpstat_what (bpstat bs)
+@@ -4497,6 +4528,20 @@ bpstat_what (bpstat bs)
  	     out already.  */
  	  internal_error (__FILE__, __LINE__,
  			  _("bpstat_what: tracepoint encountered"));
@@ -628,7 +628,7 @@ index 623effa..4bcd681 100644
  	default:
  	  internal_error (__FILE__, __LINE__,
  			  _("bpstat_what: unhandled bptype %d"), (int) bptype);
-@@ -4533,6 +4578,21 @@ bpstat_what (bpstat bs)
+@@ -4534,6 +4579,21 @@ bpstat_what (bpstat bs)
        handle_jit_event ();
      }
  
@@ -650,7 +650,7 @@ index 623effa..4bcd681 100644
    return retval;
  }
  
-@@ -4654,6 +4714,8 @@ bptype_string (enum bptype type)
+@@ -4689,6 +4749,8 @@ bptype_string (enum bptype type)
      {bp_fast_tracepoint, "fast tracepoint"},
      {bp_static_tracepoint, "static tracepoint"},
      {bp_jit_event, "jit events"},
@@ -659,7 +659,7 @@ index 623effa..4bcd681 100644
    };
  
    if (((int) type >= (sizeof (bptypes) / sizeof (bptypes[0])))
-@@ -4801,6 +4863,8 @@ print_one_breakpoint_location (struct breakpoint *b,
+@@ -4823,6 +4885,8 @@ print_one_breakpoint_location (struct breakpoint *b,
        case bp_fast_tracepoint:
        case bp_static_tracepoint:
        case bp_jit_event:
@@ -668,7 +668,7 @@ index 623effa..4bcd681 100644
  	if (opts.addressprint)
  	  {
  	    annotate_field (4);
-@@ -5082,7 +5146,8 @@ user_settable_breakpoint (const struct breakpoint *b)
+@@ -5098,7 +5162,8 @@ user_settable_breakpoint (const struct breakpoint *b)
  	  || b->type == bp_catchpoint
  	  || b->type == bp_hardware_breakpoint
  	  || is_tracepoint (b)
@@ -678,7 +678,7 @@ index 623effa..4bcd681 100644
  }
  
  /* Return true if this breakpoint was set by the user, false if it is
-@@ -5571,6 +5636,8 @@ allocate_bp_location (struct breakpoint *bpt)
+@@ -5594,6 +5659,8 @@ allocate_bp_location (struct breakpoint *bpt)
      case bp_longjmp_master:
      case bp_std_terminate_master:
      case bp_exception_master:
@@ -687,7 +687,7 @@ index 623effa..4bcd681 100644
        loc->loc_type = bp_loc_software_breakpoint;
        break;
      case bp_hardware_breakpoint:
-@@ -5660,6 +5727,7 @@ set_raw_breakpoint_without_location (struct gdbarch *gdbarch,
+@@ -5683,6 +5750,7 @@ set_raw_breakpoint_without_location (struct gdbarch *gdbarch,
    b->ops = NULL;
    b->condition_not_parsed = 0;
    b->py_bp_object = NULL;
@@ -695,7 +695,7 @@ index 623effa..4bcd681 100644
  
    /* Add this breakpoint to the end of the chain so that a list of
       breakpoints will come out in order of increasing numbers.  */
-@@ -5678,7 +5746,7 @@ set_raw_breakpoint_without_location (struct gdbarch *gdbarch,
+@@ -5701,7 +5769,7 @@ set_raw_breakpoint_without_location (struct gdbarch *gdbarch,
  
  /* Initialize loc->function_name.  */
  static void
@@ -704,7 +704,7 @@ index 623effa..4bcd681 100644
  {
    gdb_assert (loc->owner != NULL);
  
-@@ -5686,8 +5754,29 @@ set_breakpoint_location_function (struct bp_location *loc)
+@@ -5709,8 +5777,29 @@ set_breakpoint_location_function (struct bp_location *loc)
        || loc->owner->type == bp_hardware_breakpoint
        || is_tracepoint (loc->owner))
      {
@@ -736,7 +736,7 @@ index 623effa..4bcd681 100644
        if (loc->function_name)
  	loc->function_name = xstrdup (loc->function_name);
      }
-@@ -5762,7 +5851,8 @@ set_raw_breakpoint (struct gdbarch *gdbarch,
+@@ -5785,7 +5874,8 @@ set_raw_breakpoint (struct gdbarch *gdbarch,
    b->loc->section = sal.section;
    b->line_number = sal.line;
  
@@ -746,7 +746,7 @@ index 623effa..4bcd681 100644
  
    breakpoints_changed ();
  
-@@ -6879,7 +6969,7 @@ clone_momentary_breakpoint (struct breakpoint *orig)
+@@ -6902,7 +6992,7 @@ clone_momentary_breakpoint (struct breakpoint *orig)
  
    copy = set_raw_breakpoint_without_location (orig->gdbarch, orig->type);
    copy->loc = allocate_bp_location (copy);
@@ -755,7 +755,7 @@ index 623effa..4bcd681 100644
  
    copy->loc->gdbarch = orig->loc->gdbarch;
    copy->loc->requested_address = orig->loc->requested_address;
-@@ -6979,6 +7069,7 @@ mention (struct breakpoint *b)
+@@ -7002,6 +7092,7 @@ mention (struct breakpoint *b)
  	do_cleanups (ui_out_chain);
  	break;
        case bp_breakpoint:
@@ -763,7 +763,7 @@ index 623effa..4bcd681 100644
  	if (ui_out_is_mi_like_p (uiout))
  	  {
  	    say_where = 0;
-@@ -6989,6 +7080,8 @@ mention (struct breakpoint *b)
+@@ -7012,6 +7103,8 @@ mention (struct breakpoint *b)
  	else
  	  printf_filtered (_("Breakpoint"));
  	printf_filtered (_(" %d"), b->number);
@@ -772,7 +772,7 @@ index 623effa..4bcd681 100644
  	say_where = 1;
  	break;
        case bp_hardware_breakpoint:
-@@ -7048,6 +7141,7 @@ mention (struct breakpoint *b)
+@@ -7071,6 +7164,7 @@ mention (struct breakpoint *b)
        case bp_longjmp_master:
        case bp_std_terminate_master:
        case bp_exception_master:
@@ -780,7 +780,7 @@ index 623effa..4bcd681 100644
  	break;
        }
  
-@@ -7108,7 +7202,8 @@ add_location_to_breakpoint (struct breakpoint *b,
+@@ -7131,7 +7225,8 @@ add_location_to_breakpoint (struct breakpoint *b,
    gdb_assert (loc->pspace != NULL);
    loc->section = sal->section;
  
@@ -790,7 +790,7 @@ index 623effa..4bcd681 100644
    return loc;
  }
  
-@@ -8542,6 +8637,7 @@ watch_command_1 (char *arg, int accessflag, int from_tty,
+@@ -8566,6 +8661,7 @@ watch_command_1 (char *arg, int accessflag, int from_tty,
    b = set_raw_breakpoint_without_location (NULL, bp_type);
    set_breakpoint_number (internal, b);
    b->thread = thread;
@@ -798,7 +798,7 @@ index 623effa..4bcd681 100644
    b->disposition = disp_donttouch;
    b->exp = exp;
    b->exp_valid_block = exp_valid_block;
-@@ -9704,6 +9800,9 @@ update_global_location_list (int should_insert)
+@@ -9728,6 +9824,9 @@ update_global_location_list (int should_insert)
        int keep_in_target = 0;
        int removed = 0;
  
@@ -808,7 +808,7 @@ index 623effa..4bcd681 100644
        /* Skip LOCP entries which will definitely never be needed.
  	 Stop either at or being the one matching OLD_LOC.  */
        while (locp < bp_location + bp_location_count
-@@ -10020,12 +10119,20 @@ delete_breakpoint (struct breakpoint *bpt)
+@@ -10044,12 +10143,20 @@ delete_breakpoint (struct breakpoint *bpt)
  
    /* At least avoid this stale reference until the reference counting
       of breakpoints gets resolved.  */
@@ -834,7 +834,7 @@ index 623effa..4bcd681 100644
      }
  
    observer_notify_breakpoint_deleted (bpt->number);
-@@ -10356,6 +10463,9 @@ update_breakpoint_locations (struct breakpoint *b,
+@@ -10380,6 +10487,9 @@ update_breakpoint_locations (struct breakpoint *b,
      return;
  
    b->loc = NULL;
@@ -844,7 +844,7 @@ index 623effa..4bcd681 100644
  
    for (i = 0; i < sals.nelts; ++i)
      {
-@@ -10383,11 +10493,7 @@ update_breakpoint_locations (struct breakpoint *b,
+@@ -10407,11 +10517,7 @@ update_breakpoint_locations (struct breakpoint *b,
  	    }
  	}
  
@@ -857,7 +857,7 @@ index 623effa..4bcd681 100644
  	b->source_file = xstrdup (sals.sals[i].symtab->filename);
  
        if (b->line_number == 0)
-@@ -10470,6 +10576,7 @@ breakpoint_re_set_one (void *bint)
+@@ -10494,6 +10600,7 @@ breakpoint_re_set_one (void *bint)
      case bp_tracepoint:
      case bp_fast_tracepoint:
      case bp_static_tracepoint:
@@ -865,7 +865,7 @@ index 623effa..4bcd681 100644
        /* Do not attempt to re-set breakpoints disabled during startup.  */
        if (b->enable_state == bp_startup_disabled)
  	return 0;
-@@ -10640,6 +10747,7 @@ breakpoint_re_set_one (void *bint)
+@@ -10664,6 +10771,7 @@ breakpoint_re_set_one (void *bint)
      case bp_exception:
      case bp_exception_resume:
      case bp_jit_event:
@@ -873,7 +873,7 @@ index 623effa..4bcd681 100644
        break;
      }
  
-@@ -10804,11 +10912,25 @@ map_breakpoint_numbers (char *args, void (*function) (struct breakpoint *,
+@@ -10828,11 +10936,25 @@ map_breakpoint_numbers (char *args, void (*function) (struct breakpoint *,
  	  ALL_BREAKPOINTS_SAFE (b, tmp)
  	    if (b->number == num)
  	      {
@@ -903,10 +903,11 @@ index 623effa..4bcd681 100644
  		break;
  	      }
  	  if (match == 0)
-@@ -11923,6 +12045,22 @@ all_tracepoints ()
+@@ -11949,6 +12071,24 @@ all_tracepoints ()
    return tp_vec;
  }
  
++#if 0
 +/* Call type_mark_used for any TYPEs referenced from this GDB source file.  */
 +
 +static void
@@ -922,11 +923,12 @@ index 623effa..4bcd681 100644
 +	type_mark_used (value_type (b->val));
 +    }
 +}
++#endif
 +
  
  /* This help string is used for the break, hbreak, tbreak and thbreak
     commands.  It is defined as a macro to prevent duplication.
-@@ -12008,6 +12146,107 @@ iterate_over_breakpoints (int (*callback) (struct breakpoint *, void *),
+@@ -12034,6 +12174,107 @@ iterate_over_breakpoints (int (*callback) (struct breakpoint *, void *),
    return NULL;
  }
  
@@ -1034,11 +1036,13 @@ index 623effa..4bcd681 100644
  void
  _initialize_breakpoint (void)
  {
-@@ -12544,4 +12783,5 @@ inferior in all-stop mode, gdb behaves as if always-inserted mode is off."),
+@@ -12568,4 +12809,7 @@ inferior in all-stop mode, gdb behaves as if always-inserted mode is off."),
    automatic_hardware_breakpoints = 1;
  
    observer_attach_about_to_proceed (breakpoint_about_to_proceed);
++#if 0
 +  observer_attach_mark_used (breakpoint_types_mark_used);
++#endif
  }
 diff --git a/gdb/breakpoint.h b/gdb/breakpoint.h
 index a0fea21..4b24701 100644
@@ -1121,7 +1125,7 @@ index 9409dde..f0fa4c7 100644
  extern char *xfullpath (const char *);
  
 diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo
-index f8b7e2d..72c47e6 100644
+index a5eaa72..6cc98dc 100644
 --- a/gdb/doc/gdb.texinfo
 +++ b/gdb/doc/gdb.texinfo
 @@ -1177,6 +1177,16 @@ for remote debugging.
@@ -1141,7 +1145,7 @@ index f8b7e2d..72c47e6 100644
  @c resolve the situation of these eventually
  @item -tui
  @cindex @code{--tui}
-@@ -20683,8 +20693,6 @@ containing @code{end}.  For example:
+@@ -20677,8 +20687,6 @@ containing @code{end}.  For example:
  
  @smallexample
  (@value{GDBP}) python
@@ -1150,7 +1154,7 @@ index f8b7e2d..72c47e6 100644
  >print 23
  >end
  23
-@@ -20697,6 +20705,14 @@ in a Python script.  This can be controlled using @code{maint set
+@@ -20691,6 +20699,14 @@ in a Python script.  This can be controlled using @code{maint set
  python print-stack}: if @code{on}, the default, then Python stack
  printing is enabled; if @code{off}, then Python stack printing is
  disabled.
@@ -1165,7 +1169,7 @@ index f8b7e2d..72c47e6 100644
  @end table
  
  It is also possible to execute a Python script from the @value{GDBN}
-@@ -20718,6 +20734,14 @@ and thus is always available.
+@@ -20712,6 +20728,14 @@ and thus is always available.
  @cindex python api
  @cindex programming in python
  
@@ -1310,17 +1314,17 @@ index a494707..d5b9cf8 100644
  
  @node Language Support
 diff --git a/gdb/doc/observer.texi b/gdb/doc/observer.texi
-index d16c865..d8d24d9 100644
+index d16c865..946ad95 100644
 --- a/gdb/doc/observer.texi
 +++ b/gdb/doc/observer.texi
 @@ -223,6 +223,11 @@ Bytes from @var{data} to @var{data} + @var{len} have been written
  to the current inferior at @var{addr}.
  @end deftypefun
  
-+ at deftypefun void mark_used (void)
-+Mark any possibly reclaimable objects as used during a mark-and-sweep garbage
-+collector pass.  Currently only @code{type_mark_used} marker is supported.
-+ at end deftypefun
++ at c @deftypefun void mark_used (void)
++ at c Mark any possibly reclaimable objects as used during a mark-and-sweep garbage
++ at c collector pass.  Currently only @code{type_mark_used} marker is supported.
++ at c @end deftypefun
 +
  @deftypefun void test_notification (int @var{somearg})
  This observer is used for internal testing.  Do not use.  
@@ -1344,7 +1348,7 @@ index afe6dde..d364b14 100644
  	  error (_("Unhandled dwarf expression opcode 0x%x"), op);
  	}
 diff --git a/gdb/dwarf2expr.h b/gdb/dwarf2expr.h
-index 620269f..c6fc64f 100644
+index 78ff53f..c83f23d 100644
 --- a/gdb/dwarf2expr.h
 +++ b/gdb/dwarf2expr.h
 @@ -114,9 +114,15 @@ struct dwarf_expr_context
@@ -1365,7 +1369,7 @@ index 620269f..c6fc64f 100644
    /* The current depth of dwarf expression recursion, via DW_OP_call*,
       DW_OP_fbreg, DW_OP_push_object_address, etc., and the maximum
 diff --git a/gdb/dwarf2loc.c b/gdb/dwarf2loc.c
-index a439f72..9abcd56 100644
+index e516dfa..12f6a19 100644
 --- a/gdb/dwarf2loc.c
 +++ b/gdb/dwarf2loc.c
 @@ -134,6 +134,9 @@ struct dwarf_expr_baton
@@ -1636,7 +1640,7 @@ index a439f72..9abcd56 100644
  	    retval = allocate_value_lazy (type);
  	    VALUE_LVAL (retval) = lval_memory;
  	    if (in_stack_memory)
-@@ -2811,11 +2969,51 @@ loclist_tracepoint_var_ref (struct symbol *symbol, struct gdbarch *gdbarch,
+@@ -2807,11 +2965,51 @@ loclist_tracepoint_var_ref (struct symbol *symbol, struct gdbarch *gdbarch,
  			       dlbaton->per_cu);
  }
  
@@ -1711,7 +1715,7 @@ index 96a490e..b0ebb06 100644
  /* Compile a DWARF location expression to an agent expression.
     
 diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c
-index 08b804a..a9099be 100644
+index d12028f..3f45aff 100644
 --- a/gdb/dwarf2read.c
 +++ b/gdb/dwarf2read.c
 @@ -1211,6 +1211,9 @@ static void fill_in_loclist_baton (struct dwarf2_cu *cu,
@@ -1744,7 +1748,7 @@ index 08b804a..a9099be 100644
  static void dwarf2_release_queue (void *dummy);
  
  static void queue_comp_unit (struct dwarf2_per_cu_data *per_cu,
-@@ -7312,6 +7321,29 @@ process_enumeration_scope (struct die_info *die, struct dwarf2_cu *cu)
+@@ -7315,6 +7324,29 @@ process_enumeration_scope (struct die_info *die, struct dwarf2_cu *cu)
    new_symbol (die, this_type, cu);
  }
  
@@ -1774,7 +1778,7 @@ index 08b804a..a9099be 100644
  /* Extract all information from a DW_TAG_array_type DIE and put it in
     the DIE's type field.  For now, this only handles one dimensional
     arrays.  */
-@@ -7325,7 +7357,7 @@ read_array_type (struct die_info *die, struct dwarf2_cu *cu)
+@@ -7328,7 +7360,7 @@ read_array_type (struct die_info *die, struct dwarf2_cu *cu)
    struct type *element_type, *range_type, *index_type;
    struct type **range_types = NULL;
    struct attribute *attr;
@@ -1783,7 +1787,7 @@ index 08b804a..a9099be 100644
    struct cleanup *back_to;
    char *name;
  
-@@ -7378,17 +7410,19 @@ read_array_type (struct die_info *die, struct dwarf2_cu *cu)
+@@ -7381,17 +7413,19 @@ read_array_type (struct die_info *die, struct dwarf2_cu *cu)
    type = element_type;
  
    if (read_array_order (die, cu) == DW_ORD_col_major)
@@ -1814,7 +1818,7 @@ index 08b804a..a9099be 100644
  
    /* Understand Dwarf2 support for vector types (like they occur on
       the PowerPC w/ AltiVec).  Gcc just adds another attribute to the
-@@ -7882,29 +7916,114 @@ read_tag_string_type (struct die_info *die, struct dwarf2_cu *cu)
+@@ -7884,29 +7918,114 @@ read_tag_string_type (struct die_info *die, struct dwarf2_cu *cu)
    struct gdbarch *gdbarch = get_objfile_arch (objfile);
    struct type *type, *range_type, *index_type, *char_type;
    struct attribute *attr;
@@ -1943,7 +1947,7 @@ index 08b804a..a9099be 100644
    char_type = language_string_char_type (cu->language_defn, gdbarch);
    type = create_string_type (NULL, char_type, range_type);
  
-@@ -8190,8 +8309,7 @@ read_subrange_type (struct die_info *die, struct dwarf2_cu *cu)
+@@ -8191,8 +8310,7 @@ read_subrange_type (struct die_info *die, struct dwarf2_cu *cu)
    struct type *base_type;
    struct type *range_type;
    struct attribute *attr;
@@ -1953,7 +1957,7 @@ index 08b804a..a9099be 100644
    char *name;
    LONGEST negative_mask;
  
-@@ -8204,53 +8322,126 @@ read_subrange_type (struct die_info *die, struct dwarf2_cu *cu)
+@@ -8205,53 +8323,126 @@ read_subrange_type (struct die_info *die, struct dwarf2_cu *cu)
    if (range_type)
      return range_type;
  
@@ -2115,7 +2119,7 @@ index 08b804a..a9099be 100644
      }
  
    /* Dwarf-2 specifications explicitly allows to create subrange types
-@@ -8291,24 +8482,41 @@ read_subrange_type (struct die_info *die, struct dwarf2_cu *cu)
+@@ -8292,24 +8483,41 @@ read_subrange_type (struct die_info *die, struct dwarf2_cu *cu)
  	}
      }
  
@@ -2173,7 +2177,7 @@ index 08b804a..a9099be 100644
  
    name = dwarf2_name (die, cu);
    if (name)
-@@ -10785,10 +10993,12 @@ var_decode_location (struct attribute *attr, struct symbol *sym,
+@@ -10786,10 +10994,12 @@ var_decode_location (struct attribute *attr, struct symbol *sym,
       (i.e. when the value of a register or memory location is
       referenced, or a thread-local block, etc.).  Then again, it might
       not be worthwhile.  I'm assuming that it isn't unless performance
@@ -2188,7 +2192,7 @@ index 08b804a..a9099be 100644
  }
  
  /* Given a pointer to a DWARF information entry, figure out if we need
-@@ -10826,6 +11036,8 @@ new_symbol_full (struct die_info *die, struct type *type, struct dwarf2_cu *cu,
+@@ -10827,6 +11037,8 @@ new_symbol_full (struct die_info *die, struct type *type, struct dwarf2_cu *cu,
        else
  	sym = OBSTACK_ZALLOC (&objfile->objfile_obstack, struct symbol);
        OBJSTAT (objfile, n_syms++);
@@ -2197,7 +2201,7 @@ index 08b804a..a9099be 100644
  
        /* Cache this symbol's name and the name's demangled form (if any).  */
        SYMBOL_SET_LANGUAGE (sym, cu->language);
-@@ -11598,6 +11810,9 @@ read_type_die_1 (struct die_info *die, struct dwarf2_cu *cu)
+@@ -11599,6 +11811,9 @@ read_type_die_1 (struct die_info *die, struct dwarf2_cu *cu)
        break;
      }
  
@@ -2680,7 +2684,7 @@ index c59134b..c2c8229 100644
  
    /* Add synthetic symbols - for instance, names for any PLT entries.  */
 diff --git a/gdb/eval.c b/gdb/eval.c
-index de25b39..f9c7a82 100644
+index 09b41a0..7c0a8f9 100644
 --- a/gdb/eval.c
 +++ b/gdb/eval.c
 @@ -44,6 +44,7 @@
@@ -2691,7 +2695,7 @@ index de25b39..f9c7a82 100644
  
  #include "gdb_assert.h"
  
-@@ -505,27 +506,202 @@ init_array_element (struct value *array, struct value *element,
+@@ -489,27 +490,217 @@ init_array_element (struct value *array, struct value *element,
  }
  
  static struct value *
@@ -2713,7 +2717,7 @@ index de25b39..f9c7a82 100644
 +  struct type *new_array_type;
 +
 +  /* Type being iterated for each dimension.  */
-+  struct type *type;
++  struct type *type, *type_last_target;
 +
 +  /* Pointer in the last holder to the type of current dimension.  */
 +  struct type **typep = &new_array_type;
@@ -2733,6 +2737,7 @@ index de25b39..f9c7a82 100644
 +	};
 +    }
 +  *subscript_array;
++  struct type **type_array;
 +  int i;
 +  struct cleanup *old_chain;
 +  CORE_ADDR value_byte_address, value_byte_offset = 0;
@@ -2812,7 +2817,9 @@ index de25b39..f9c7a82 100644
 +	  struct value *val;
 +
 +	  index->kind = SUBSCRIPT_NUMBER;
-+
+ 
+-  if (range_type == HIGH_BOUND_DEFAULT || range_type == BOTH_BOUND_DEFAULT)
+-    high_bound = TYPE_HIGH_BOUND (range);
 +	  /* Evaluate each subscript; it must be a legal integer in F77.  */
 +	  val = evaluate_subexp_with_coercion (exp, pos, noside);
 +	  index->number = value_as_long (val);
@@ -2824,9 +2831,7 @@ index de25b39..f9c7a82 100644
 +    {
 +      struct subscript_index *index = &subscript_array[i];
 +      struct type *range_type = TYPE_INDEX_TYPE (type);
- 
--  if (range_type == HIGH_BOUND_DEFAULT || range_type == BOTH_BOUND_DEFAULT)
--    high_bound = TYPE_HIGH_BOUND (range);
++
 +      switch (index->kind)
 +	{
 +	case SUBSCRIPT_RANGE:
@@ -2881,7 +2886,21 @@ index de25b39..f9c7a82 100644
 +	}
 +    }
 +
-+  check_typedef (new_array_type);
++  type_last_target = type;
++  type_array = alloca (sizeof (*type_array) * nargs);
++  i = 0;
++  for (type = new_array_type; type != type_last_target;
++       type = TYPE_TARGET_TYPE (type))
++    type_array[i++] = type;
++  while (i > 0)
++    {
++      struct type *type = type_array[--i];
++
++      /* Force TYPE_LENGTH (type) recalculation.  */
++      TYPE_TARGET_STUB (type) = 1;
++      check_typedef (type);
++    }
++
 +  saved_array = array;
 +  array = allocate_value_lazy (new_array_type);
 +  VALUE_LVAL (array) = VALUE_LVAL (saved_array);
@@ -2898,19 +2917,19 @@ index de25b39..f9c7a82 100644
 +    {
 +      allocate_value_contents (array);
 +      set_value_lazy (array, 0);
-+
+ 
+-  return value_slice (array, low_bound, high_bound - low_bound + 1);
 +      memcpy (value_contents_writeable (array),
 +	      value_contents (saved_array) + value_byte_offset,
 +	      TYPE_LENGTH (new_array_type));
 +    }
- 
--  return value_slice (array, low_bound, high_bound - low_bound + 1);
++
 +  do_cleanups (old_chain);
 +  return array;
  }
  
  
-@@ -806,6 +982,7 @@ evaluate_subexp_standard (struct type *expect_type,
+@@ -790,6 +981,7 @@ evaluate_subexp_standard (struct type *expect_type,
    int save_pos1;
    struct symbol *function = NULL;
    char *function_name = NULL;
@@ -2918,7 +2937,7 @@ index de25b39..f9c7a82 100644
  
    pc = (*pos)++;
    op = exp->elts[pc].opcode;
-@@ -1849,6 +2026,8 @@ evaluate_subexp_standard (struct type *expect_type,
+@@ -1832,6 +2024,8 @@ evaluate_subexp_standard (struct type *expect_type,
  	      return value_zero (builtin_type (exp->gdbarch)->builtin_int,
  				 not_lval);
  	    }
@@ -2927,7 +2946,7 @@ index de25b39..f9c7a82 100644
  	  else if (TYPE_TARGET_TYPE (ftype))
  	    return allocate_value (TYPE_TARGET_TYPE (ftype));
  	  else
-@@ -1877,6 +2056,8 @@ evaluate_subexp_standard (struct type *expect_type,
+@@ -1860,6 +2054,8 @@ evaluate_subexp_standard (struct type *expect_type,
  
        /* First determine the type code we are dealing with.  */
        arg1 = evaluate_subexp (NULL_TYPE, exp, pos, noside);
@@ -2936,7 +2955,7 @@ index de25b39..f9c7a82 100644
        type = check_typedef (value_type (arg1));
        code = TYPE_CODE (type);
  
-@@ -1897,23 +2078,13 @@ evaluate_subexp_standard (struct type *expect_type,
+@@ -1880,23 +2076,13 @@ evaluate_subexp_standard (struct type *expect_type,
  	      code = TYPE_CODE (type);
  	    }
  	} 
@@ -2962,7 +2981,7 @@ index de25b39..f9c7a82 100644
  
  	case TYPE_CODE_PTR:
  	case TYPE_CODE_FUNC:
-@@ -2352,49 +2523,6 @@ evaluate_subexp_standard (struct type *expect_type,
+@@ -2335,49 +2521,6 @@ evaluate_subexp_standard (struct type *expect_type,
  	}
        return (arg1);
  
@@ -3012,7 +3031,7 @@ index de25b39..f9c7a82 100644
      case BINOP_LOGICAL_AND:
        arg1 = evaluate_subexp (NULL_TYPE, exp, pos, noside);
        if (noside == EVAL_SKIP)
-@@ -2626,15 +2754,23 @@ evaluate_subexp_standard (struct type *expect_type,
+@@ -2609,15 +2752,23 @@ evaluate_subexp_standard (struct type *expect_type,
        if (expect_type && TYPE_CODE (expect_type) == TYPE_CODE_PTR)
  	expect_type = TYPE_TARGET_TYPE (check_typedef (expect_type));
        arg1 = evaluate_subexp (expect_type, exp, pos, noside);
@@ -3038,7 +3057,7 @@ index de25b39..f9c7a82 100644
        else if (noside == EVAL_AVOID_SIDE_EFFECTS)
  	{
  	  type = check_typedef (value_type (arg1));
-@@ -2643,12 +2779,18 @@ evaluate_subexp_standard (struct type *expect_type,
+@@ -2626,12 +2777,18 @@ evaluate_subexp_standard (struct type *expect_type,
  	  /* In C you can dereference an array to get the 1st elt.  */
  	      || TYPE_CODE (type) == TYPE_CODE_ARRAY
  	    )
@@ -3062,7 +3081,7 @@ index de25b39..f9c7a82 100644
  	  else
  	    error (_("Attempt to take contents of a non-pointer value."));
  	}
-@@ -2658,9 +2800,14 @@ evaluate_subexp_standard (struct type *expect_type,
+@@ -2641,9 +2798,14 @@ evaluate_subexp_standard (struct type *expect_type,
  	 do.  "long long" variables are rare enough that
  	 BUILTIN_TYPE_LONGEST would seem to be a mistake.  */
        if (TYPE_CODE (type) == TYPE_CODE_INT)
@@ -3080,7 +3099,7 @@ index de25b39..f9c7a82 100644
  
      case UNOP_ADDR:
        /* C++: check for and handle pointer to members.  */
-@@ -3006,7 +3153,7 @@ evaluate_subexp_with_coercion (struct expression *exp,
+@@ -2989,7 +3151,7 @@ evaluate_subexp_with_coercion (struct expression *exp,
  {
    enum exp_opcode op;
    int pc;
@@ -3089,7 +3108,7 @@ index de25b39..f9c7a82 100644
    struct symbol *var;
    struct type *type;
  
-@@ -3017,13 +3164,18 @@ evaluate_subexp_with_coercion (struct expression *exp,
+@@ -3000,13 +3162,18 @@ evaluate_subexp_with_coercion (struct expression *exp,
      {
      case OP_VAR_VALUE:
        var = exp->elts[pc + 2].symbol;
@@ -3109,7 +3128,7 @@ index de25b39..f9c7a82 100644
  	  return value_cast (lookup_pointer_type (TYPE_TARGET_TYPE (type)),
  			     val);
  	}
-@@ -3075,9 +3227,13 @@ evaluate_subexp_for_sizeof (struct expression *exp, int *pos)
+@@ -3058,9 +3225,13 @@ evaluate_subexp_for_sizeof (struct expression *exp, int *pos)
  
      case OP_VAR_VALUE:
        (*pos) += 4;
@@ -3126,7 +3145,7 @@ index de25b39..f9c7a82 100644
  
      default:
        val = evaluate_subexp (NULL_TYPE, exp, pos, EVAL_AVOID_SIDE_EFFECTS);
-@@ -3108,18 +3264,25 @@ parse_and_eval_type (char *p, int length)
+@@ -3091,18 +3262,25 @@ parse_and_eval_type (char *p, int length)
  int
  calc_f77_array_dims (struct type *array_type)
  {
@@ -3568,7 +3587,7 @@ index ffb7f53..a2e7e94 100644
  
  b internal_error
 diff --git a/gdb/gdbtypes.c b/gdb/gdbtypes.c
-index 91fafa2..0e91248 100644
+index 91fafa2..eda2506 100644
 --- a/gdb/gdbtypes.c
 +++ b/gdb/gdbtypes.c
 @@ -39,6 +39,9 @@
@@ -3581,25 +3600,28 @@ index 91fafa2..0e91248 100644
  
  
  /* Initialize BADNESS constants.  */
-@@ -144,7 +147,14 @@ static void print_bit_vector (B_TYPE *, int);
+@@ -144,7 +147,16 @@ static void print_bit_vector (B_TYPE *, int);
  static void print_arg_types (struct field *, int, int);
  static void dump_fn_fieldlists (struct type *, int);
  static void print_cplus_stuff (struct type *, int);
 +static LONGEST type_length_get (struct type *type, struct type *target_type,
 +				int full_span);
  
++#if 0
 +/* The hash table holding all discardable `struct type *' references.  */
 +static htab_t type_discardable_table;
 +
 +/* Current type_discardable_check pass used for TYPE_DISCARDABLE_AGE.  */
 +static int type_discardable_age_current;
++#endif
  
  /* Allocate a new OBJFILE-associated type structure and fill it
     with some defaults.  Space for the type structure is allocated
-@@ -175,6 +185,39 @@ alloc_type (struct objfile *objfile)
+@@ -175,6 +187,43 @@ alloc_type (struct objfile *objfile)
    return type;
  }
  
++#if 0
 +/* Declare TYPE as discardable on next garbage collection by free_all_types.
 +   You must call type_mark_used during each free_all_types to protect TYPE from
 +   being deallocated.  */
@@ -3618,6 +3640,7 @@ index 91fafa2..0e91248 100644
 +  gdb_assert (!*slot);
 +  *slot = type;
 +}
++#endif
 +
 +/* Allocate a new type like alloc_type but preserve for it the discardability
 +   state of PARENT_TYPE.  */
@@ -3627,8 +3650,10 @@ index 91fafa2..0e91248 100644
 +{
 +  struct type *new_type = alloc_type_copy (parent_type);
 +
++#if 0
 +  if (TYPE_DISCARDABLE (parent_type))
 +    set_type_as_discardable (new_type);
++#endif
 +
 +  return new_type;
 +}
@@ -3636,7 +3661,7 @@ index 91fafa2..0e91248 100644
  /* Allocate a new GDBARCH-associated type structure and fill it
     with some defaults.  Space for the type structure is allocated
     on the heap.  */
-@@ -300,7 +343,7 @@ make_pointer_type (struct type *type, struct type **typeptr)
+@@ -300,7 +349,7 @@ make_pointer_type (struct type *type, struct type **typeptr)
  
    if (typeptr == 0 || *typeptr == 0)	/* We'll need to allocate one.  */
      {
@@ -3645,7 +3670,7 @@ index 91fafa2..0e91248 100644
        if (typeptr)
  	*typeptr = ntype;
      }
-@@ -377,7 +420,7 @@ make_reference_type (struct type *type, struct type **typeptr)
+@@ -377,7 +426,7 @@ make_reference_type (struct type *type, struct type **typeptr)
  
    if (typeptr == 0 || *typeptr == 0)	/* We'll need to allocate one.  */
      {
@@ -3654,7 +3679,7 @@ index 91fafa2..0e91248 100644
        if (typeptr)
  	*typeptr = ntype;
      }
-@@ -748,6 +791,7 @@ create_range_type (struct type *result_type, struct type *index_type,
+@@ -748,6 +797,7 @@ create_range_type (struct type *result_type, struct type *index_type,
      TYPE_ZALLOC (result_type, sizeof (struct range_bounds));
    TYPE_LOW_BOUND (result_type) = low_bound;
    TYPE_HIGH_BOUND (result_type) = high_bound;
@@ -3662,7 +3687,7 @@ index 91fafa2..0e91248 100644
  
    if (low_bound >= 0)
      TYPE_UNSIGNED (result_type) = 1;
-@@ -891,26 +935,31 @@ create_array_type (struct type *result_type,
+@@ -891,26 +941,31 @@ create_array_type (struct type *result_type,
  
    TYPE_CODE (result_type) = TYPE_CODE_ARRAY;
    TYPE_TARGET_TYPE (result_type) = element_type;
@@ -3707,7 +3732,7 @@ index 91fafa2..0e91248 100644
  
    return result_type;
  }
-@@ -1413,6 +1462,105 @@ stub_noname_complaint (void)
+@@ -1413,6 +1468,105 @@ stub_noname_complaint (void)
    complaint (&symfile_complaints, _("stub type has NULL name"));
  }
  
@@ -3813,7 +3838,7 @@ index 91fafa2..0e91248 100644
  /* Find the real type of TYPE.  This function returns the real type,
     after removing all layers of typedefs, and completing opaque or stub
     types.  Completion changes the TYPE argument, but stripping of
-@@ -1575,52 +1723,35 @@ check_typedef (struct type *type)
+@@ -1575,52 +1729,37 @@ check_typedef (struct type *type)
          }
      }
  
@@ -3829,6 +3854,8 @@ index 91fafa2..0e91248 100644
 +      htab_delete (copied_types);
 +
 +      gdb_assert (TYPE_DYNAMIC (type) == 0);
++      /* Force TYPE_LENGTH (type) recalculation.  */
++      TYPE_DYNAMIC (type) = 1;
 +    }
 +
 +  if (TYPE_TARGET_STUB (type) || TYPE_DYNAMIC (type))
@@ -3885,7 +3912,7 @@ index 91fafa2..0e91248 100644
  	  TYPE_TARGET_STUB (type) = 0;
  	}
        else if (TYPE_CODE (type) == TYPE_CODE_RANGE)
-@@ -1628,6 +1759,7 @@ check_typedef (struct type *type)
+@@ -1628,6 +1767,7 @@ check_typedef (struct type *type)
  	  TYPE_LENGTH (type) = TYPE_LENGTH (target_type);
  	  TYPE_TARGET_STUB (type) = 0;
  	}
@@ -3893,7 +3920,7 @@ index 91fafa2..0e91248 100644
      }
  
    type = make_qualified_type (type, instance_flags, NULL);
-@@ -1902,6 +2034,8 @@ init_type (enum type_code code, int length, int flags,
+@@ -1902,6 +2042,8 @@ init_type (enum type_code code, int length, int flags,
      TYPE_STUB_SUPPORTED (type) = 1;
    if (flags & TYPE_FLAG_FIXED_INSTANCE)
      TYPE_FIXED_INSTANCE (type) = 1;
@@ -3902,7 +3929,7 @@ index 91fafa2..0e91248 100644
  
    if (name)
      TYPE_NAME (type) = obsavestring (name, strlen (name),
-@@ -3264,33 +3398,42 @@ type_pair_eq (const void *item_lhs, const void *item_rhs)
+@@ -3264,33 +3406,42 @@ type_pair_eq (const void *item_lhs, const void *item_rhs)
  }
  
  /* Allocate the hash table used by copy_type_recursive to walk
@@ -3960,7 +3987,7 @@ index 91fafa2..0e91248 100644
      return type;
  
    /* This type shouldn't be pointing to any types in other objfiles;
-@@ -3305,9 +3448,10 @@ copy_type_recursive (struct objfile *objfile,
+@@ -3305,9 +3456,10 @@ copy_type_recursive (struct objfile *objfile,
    new_type = alloc_type_arch (get_type_arch (type));
  
    /* We must add the new type to the hash table immediately, in case
@@ -3974,15 +4001,17 @@ index 91fafa2..0e91248 100644
    stored->old = type;
    stored->new = new_type;
    *slot = stored;
-@@ -3318,6 +3462,19 @@ copy_type_recursive (struct objfile *objfile,
+@@ -3318,6 +3470,21 @@ copy_type_recursive (struct objfile *objfile,
    TYPE_OBJFILE_OWNED (new_type) = 0;
    TYPE_OWNER (new_type).gdbarch = get_type_arch (type);
  
++#if 0
 +  /* TYPE_MAIN_TYPE memory copy above rewrote the TYPE_DISCARDABLE flag so we
 +     need to initialize it again.  And even if TYPE was already discardable
 +     NEW_TYPE so far is not registered in TYPE_DISCARDABLE_TABLE.  */
 +  TYPE_DISCARDABLE (new_type) = 0;
 +  set_type_as_discardable (new_type);
++#endif
 +
 +  /* Pre-clear the fields processed by delete_main_type.  If DWARF block
 +     evaluations below call error we would leave an unfreeable TYPE.  */
@@ -3994,7 +4023,7 @@ index 91fafa2..0e91248 100644
    if (TYPE_NAME (type))
      TYPE_NAME (new_type) = xstrdup (TYPE_NAME (type));
    if (TYPE_TAG_NAME (type))
-@@ -3326,12 +3483,48 @@ copy_type_recursive (struct objfile *objfile,
+@@ -3326,12 +3493,48 @@ copy_type_recursive (struct objfile *objfile,
    TYPE_INSTANCE_FLAGS (new_type) = TYPE_INSTANCE_FLAGS (type);
    TYPE_LENGTH (new_type) = TYPE_LENGTH (type);
  
@@ -4043,7 +4072,7 @@ index 91fafa2..0e91248 100644
        TYPE_FIELDS (new_type) = XCALLOC (nfields, struct field);
        for (i = 0; i < nfields; i++)
  	{
-@@ -3340,8 +3533,8 @@ copy_type_recursive (struct objfile *objfile,
+@@ -3340,8 +3543,8 @@ copy_type_recursive (struct objfile *objfile,
  	  TYPE_FIELD_BITSIZE (new_type, i) = TYPE_FIELD_BITSIZE (type, i);
  	  if (TYPE_FIELD_TYPE (type, i))
  	    TYPE_FIELD_TYPE (new_type, i)
@@ -4054,7 +4083,7 @@ index 91fafa2..0e91248 100644
  	  if (TYPE_FIELD_NAME (type, i))
  	    TYPE_FIELD_NAME (new_type, i) = 
  	      xstrdup (TYPE_FIELD_NAME (type, i));
-@@ -3368,24 +3561,184 @@ copy_type_recursive (struct objfile *objfile,
+@@ -3368,24 +3571,184 @@ copy_type_recursive (struct objfile *objfile,
  	}
      }
  
@@ -4246,7 +4275,7 @@ index 91fafa2..0e91248 100644
    /* Maybe copy the type_specific bits.
  
       NOTE drow/2005-12-09: We do not copy the C++-specific bits like
-@@ -3402,6 +3755,17 @@ copy_type_recursive (struct objfile *objfile,
+@@ -3402,6 +3765,17 @@ copy_type_recursive (struct objfile *objfile,
    return new_type;
  }
  
@@ -4264,10 +4293,11 @@ index 91fafa2..0e91248 100644
  /* Make a copy of the given TYPE, except that the pointer & reference
     types are not preserved.
     
-@@ -3424,6 +3788,199 @@ copy_type (const struct type *type)
+@@ -3424,6 +3798,201 @@ copy_type (const struct type *type)
    return new_type;
  }
  
++#if 0
 +/* Callback type for main_type_crawl.  */
 +typedef int (*main_type_crawl_iter) (struct type *type, void *data);
 +
@@ -4461,10 +4491,11 @@ index 91fafa2..0e91248 100644
 +
 +  htab_traverse (type_discardable_table, type_discardable_remove, NULL);
 +}
++#endif
  
  /* Helper functions to initialize architecture-specific types.  */
  
-@@ -3772,6 +4329,8 @@ gdbtypes_post_init (struct gdbarch *gdbarch)
+@@ -3772,6 +4341,8 @@ gdbtypes_post_init (struct gdbarch *gdbarch)
      = lookup_pointer_type (builtin_type->builtin_void);
    builtin_type->builtin_func_ptr
      = lookup_pointer_type (lookup_function_type (builtin_type->builtin_void));
@@ -4473,7 +4504,7 @@ index 91fafa2..0e91248 100644
  
    /* This type represents a GDB internal function.  */
    builtin_type->internal_fn
-@@ -3885,6 +4444,18 @@ objfile_type (struct objfile *objfile)
+@@ -3885,6 +4456,18 @@ objfile_type (struct objfile *objfile)
  		 "<text variable, no debug info>", objfile);
    TYPE_TARGET_TYPE (objfile_type->nodebug_text_symbol)
      = objfile_type->builtin_int;
@@ -4492,20 +4523,22 @@ index 91fafa2..0e91248 100644
    objfile_type->nodebug_data_symbol
      = init_type (TYPE_CODE_INT,
  		 gdbarch_int_bit (gdbarch) / HOST_CHAR_BIT, 0,
-@@ -3939,6 +4510,11 @@ void
+@@ -3939,6 +4522,13 @@ void
  _initialize_gdbtypes (void)
  {
    gdbtypes_data = gdbarch_data_register_post_init (gdbtypes_post_init);
 +
++#if 0
 +  type_discardable_table = htab_create_alloc (20, type_discardable_hash,
 +					     type_discardable_equal, NULL,
 +					     xcalloc, xfree);
++#endif
 +
    objfile_type_data = register_objfile_data ();
  
    add_setshow_zinteger_cmd ("overload", no_class, &overload_debug,
 diff --git a/gdb/gdbtypes.h b/gdb/gdbtypes.h
-index debb41c..c31c9b8 100644
+index 5f89fec..4b4720a 100644
 --- a/gdb/gdbtypes.h
 +++ b/gdb/gdbtypes.h
 @@ -170,6 +170,7 @@ enum type_flag_value
@@ -4541,10 +4574,11 @@ index debb41c..c31c9b8 100644
  /* Type owner.  If TYPE_OBJFILE_OWNED is true, the type is owned by
     the objfile retrieved as TYPE_OBJFILE.  Otherweise, the type is
     owned by an architecture; TYPE_OBJFILE is NULL in this case.  */
-@@ -285,6 +297,48 @@ enum type_instance_flag_value
+@@ -285,6 +297,50 @@ enum type_instance_flag_value
  
  #define TYPE_DECLARED_CLASS(t) (TYPE_MAIN_TYPE (t)->flag_declared_class)
  
++#if 0
 +/* Define this type as being reclaimable during free_all_types.  Type is
 +   required to be have TYPE_OBJFILE set to NULL.  Setting this flag requires
 +   initializing TYPE_DISCARDABLE_AGE, see alloc_type_discardable.  */
@@ -4556,6 +4590,7 @@ index debb41c..c31c9b8 100644
 +   by TYPE_DISCARDABLE_AGE_CURRENT.  */
 +
 +#define TYPE_DISCARDABLE_AGE(t)	(TYPE_MAIN_TYPE (t)->flag_discardable_age)
++#endif
 +
 +/* Is HIGH_BOUND a low-bound relative count (1) or the high bound itself (0)?  */
 +
@@ -4590,7 +4625,7 @@ index debb41c..c31c9b8 100644
  /* Constant type.  If this is set, the corresponding type has a
     const modifier.  */
  
-@@ -387,11 +441,19 @@ struct main_type
+@@ -387,11 +443,21 @@ struct main_type
    unsigned int flag_varargs : 1;
    unsigned int flag_vector : 1;
    unsigned int flag_stub_supported : 1;
@@ -4600,8 +4635,10 @@ index debb41c..c31c9b8 100644
    /* True if this type was declared with "class" rather than
       "struct".  */
    unsigned int flag_declared_class : 1;
++#if 0
 +  unsigned int flag_discardable : 1;
 +  unsigned int flag_discardable_age : 1;
++#endif
 +  unsigned int flag_dynamic : 1;
 +  unsigned int flag_range_high_bound_is_count : 1;
 +  unsigned int flag_not_allocated : 1;
@@ -4610,7 +4647,7 @@ index debb41c..c31c9b8 100644
  
    /* A discriminant telling us which field of the type_specific union
       is being used for this type, if any.  */
-@@ -465,6 +527,20 @@ struct main_type
+@@ -465,6 +531,20 @@ struct main_type
  
    struct type *target_type;
  
@@ -4631,7 +4668,7 @@ index debb41c..c31c9b8 100644
    /* For structure and union types, a description of each field.
       For set and pascal array types, there is one "field",
       whose type is the domain type of the set or array.
-@@ -539,13 +615,34 @@ struct main_type
+@@ -539,13 +619,34 @@ struct main_type
  
      struct range_bounds
      {
@@ -4671,7 +4708,7 @@ index debb41c..c31c9b8 100644
  
        /* Flags indicating whether the values of low and high are
           valid.  When true, the respective range value is
-@@ -918,9 +1015,9 @@ extern void allocate_gnat_aux_type (struct type *);
+@@ -918,9 +1019,9 @@ extern void allocate_gnat_aux_type (struct type *);
  #define TYPE_POINTER_TYPE(thistype) (thistype)->pointer_type
  #define TYPE_REFERENCE_TYPE(thistype) (thistype)->reference_type
  #define TYPE_CHAIN(thistype) (thistype)->chain
@@ -4684,7 +4721,7 @@ index debb41c..c31c9b8 100644
     calls check_typedef, TYPE_LENGTH (VALUE_TYPE (X)) is safe.  */
  #define TYPE_LENGTH(thistype) (thistype)->length
  /* Note that TYPE_CODE can be TYPE_CODE_TYPEDEF, so if you want the real
-@@ -928,11 +1025,16 @@ extern void allocate_gnat_aux_type (struct type *);
+@@ -928,11 +1029,16 @@ extern void allocate_gnat_aux_type (struct type *);
  #define TYPE_CODE(thistype) TYPE_MAIN_TYPE(thistype)->code
  #define TYPE_NFIELDS(thistype) TYPE_MAIN_TYPE(thistype)->nfields
  #define TYPE_FIELDS(thistype) TYPE_MAIN_TYPE(thistype)->flds_bnds.fields
@@ -4703,7 +4740,7 @@ index debb41c..c31c9b8 100644
  #define TYPE_LOW_BOUND_UNDEFINED(range_type) \
     TYPE_RANGE_DATA(range_type)->low_undefined
  #define TYPE_HIGH_BOUND_UNDEFINED(range_type) \
-@@ -949,7 +1051,14 @@ extern void allocate_gnat_aux_type (struct type *);
+@@ -949,7 +1055,14 @@ extern void allocate_gnat_aux_type (struct type *);
     (TYPE_HIGH_BOUND(TYPE_INDEX_TYPE((arraytype))))
  
  #define TYPE_ARRAY_LOWER_BOUND_VALUE(arraytype) \
@@ -4719,7 +4756,7 @@ index debb41c..c31c9b8 100644
  
  /* C++ */
  
-@@ -1178,6 +1287,10 @@ struct builtin_type
+@@ -1178,6 +1291,10 @@ struct builtin_type
       (*) () can server as a generic function pointer.  */
    struct type *builtin_func_ptr;
  
@@ -4730,7 +4767,7 @@ index debb41c..c31c9b8 100644
  
    /* Special-purpose types.  */
  
-@@ -1218,6 +1331,8 @@ struct objfile_type
+@@ -1218,6 +1335,8 @@ struct objfile_type
  
    /* Types used for symbols with no debug information.  */
    struct type *nodebug_text_symbol;
@@ -4739,7 +4776,7 @@ index debb41c..c31c9b8 100644
    struct type *nodebug_data_symbol;
    struct type *nodebug_unknown_symbol;
    struct type *nodebug_tls_symbol;
-@@ -1365,6 +1480,18 @@ extern struct type *create_array_type (struct type *, struct type *,
+@@ -1365,6 +1484,18 @@ extern struct type *create_array_type (struct type *, struct type *,
  				       struct type *);
  extern struct type *lookup_array_range_type (struct type *, int, int);
  
@@ -4758,16 +4795,18 @@ index debb41c..c31c9b8 100644
  extern struct type *create_string_type (struct type *, struct type *,
  					struct type *);
  extern struct type *lookup_string_range_type (struct type *, int, int);
-@@ -1410,6 +1537,8 @@ extern int is_public_ancestor (struct type *, struct type *);
+@@ -1410,6 +1541,10 @@ extern int is_public_ancestor (struct type *, struct type *);
  
  extern int is_unique_ancestor (struct type *, struct value *);
  
++#if 0
 +extern void type_mark_used (struct type *type);
++#endif
 +
  /* Overload resolution */
  
  #define LENGTH_MATCH(bv) ((bv)->rank[0])
-@@ -1482,10 +1611,11 @@ extern void maintenance_print_type (char *, int);
+@@ -1482,10 +1617,13 @@ extern void maintenance_print_type (char *, int);
  
  extern htab_t create_copied_types_hash (struct objfile *objfile);
  
@@ -4778,11 +4817,13 @@ index debb41c..c31c9b8 100644
  
  extern struct type *copy_type (const struct type *type);
  
++#if 0
 +extern void free_all_types (void);
++#endif
 +
  #endif /* GDBTYPES_H */
 diff --git a/gdb/i386-linux-nat.c b/gdb/i386-linux-nat.c
-index c3cbbcc..7f86c29 100644
+index e32a119..2024ae8 100644
 --- a/gdb/i386-linux-nat.c
 +++ b/gdb/i386-linux-nat.c
 @@ -649,22 +649,13 @@ i386_linux_store_inferior_registers (struct target_ops *ops,
@@ -4990,7 +5031,7 @@ index c3cbbcc..7f86c29 100644
  
  
 diff --git a/gdb/i386-nat.c b/gdb/i386-nat.c
-index 0606ce1..1ad0e39 100644
+index 7e6814e..b1e8e7d 100644
 --- a/gdb/i386-nat.c
 +++ b/gdb/i386-nat.c
 @@ -25,6 +25,7 @@
@@ -5208,7 +5249,7 @@ index 0606ce1..1ad0e39 100644
        i++;
      }
  }
-@@ -312,6 +386,7 @@ Invalid hardware breakpoint length %d in i386_length_and_rw_bits.\n"), len);
+@@ -313,6 +387,7 @@ Invalid hardware breakpoint length %d in i386_length_and_rw_bits.\n"), len);
  static int
  i386_insert_aligned_watchpoint (CORE_ADDR addr, unsigned len_rw_bits)
  {
@@ -5216,7 +5257,7 @@ index 0606ce1..1ad0e39 100644
    int i;
  
    if (!i386_dr_low.set_addr || !i386_dr_low.set_control)
-@@ -322,11 +397,10 @@ i386_insert_aligned_watchpoint (CORE_ADDR addr, unsigned len_rw_bits)
+@@ -323,11 +398,10 @@ i386_insert_aligned_watchpoint (CORE_ADDR addr, unsigned len_rw_bits)
       reuse it for this watchpoint as well (and save a register).  */
    ALL_DEBUG_REGISTERS(i)
      {
@@ -5231,7 +5272,7 @@ index 0606ce1..1ad0e39 100644
  	  return 0;
  	}
      }
-@@ -334,7 +408,7 @@ i386_insert_aligned_watchpoint (CORE_ADDR addr, unsigned len_rw_bits)
+@@ -335,7 +409,7 @@ i386_insert_aligned_watchpoint (CORE_ADDR addr, unsigned len_rw_bits)
    /* Next, look for a vacant debug register.  */
    ALL_DEBUG_REGISTERS(i)
      {
@@ -5240,7 +5281,7 @@ index 0606ce1..1ad0e39 100644
  	break;
      }
  
-@@ -345,9 +419,9 @@ i386_insert_aligned_watchpoint (CORE_ADDR addr, unsigned len_rw_bits)
+@@ -346,9 +420,9 @@ i386_insert_aligned_watchpoint (CORE_ADDR addr, unsigned len_rw_bits)
    /* Now set up the register I to watch our region.  */
  
    /* Record the info in our local mirrored array.  */
@@ -5253,7 +5294,7 @@ index 0606ce1..1ad0e39 100644
    /* Note: we only enable the watchpoint locally, i.e. in the current
       task.  Currently, no i386 target allows or supports global
       watchpoints; however, if any target would want that in the
-@@ -355,13 +429,13 @@ i386_insert_aligned_watchpoint (CORE_ADDR addr, unsigned len_rw_bits)
+@@ -356,13 +430,13 @@ i386_insert_aligned_watchpoint (CORE_ADDR addr, unsigned len_rw_bits)
       to enable watchpoints globally or locally, and the code below
       should use global or local enable and slow-down flags as
       appropriate.  */
@@ -5271,7 +5312,7 @@ index 0606ce1..1ad0e39 100644
  
    /* Only a sanity check for leftover bits (set possibly only by inferior).  */
    if (i386_dr_low.unset_status)
-@@ -379,21 +453,21 @@ i386_insert_aligned_watchpoint (CORE_ADDR addr, unsigned len_rw_bits)
+@@ -380,21 +454,21 @@ i386_insert_aligned_watchpoint (CORE_ADDR addr, unsigned len_rw_bits)
  static int
  i386_remove_aligned_watchpoint (CORE_ADDR addr, unsigned len_rw_bits)
  {
@@ -5300,7 +5341,7 @@ index 0606ce1..1ad0e39 100644
  	      if (i386_dr_low.reset_addr)
  		i386_dr_low.reset_addr (i);
  	    }
-@@ -555,26 +629,27 @@ i386_region_ok_for_watchpoint (CORE_ADDR addr, int len)
+@@ -556,26 +630,27 @@ i386_region_ok_for_watchpoint (CORE_ADDR addr, int len)
  static int
  i386_stopped_data_address (struct target_ops *ops, CORE_ADDR *addr_p)
  {
@@ -5333,7 +5374,7 @@ index 0606ce1..1ad0e39 100644
  	  rc = 1;
  	  if (maint_show_dr)
  	    i386_show_dr ("watchpoint_hit", addr, -1, hw_write);
-@@ -688,6 +763,10 @@ i386_use_watchpoints (struct target_ops *t)
+@@ -689,6 +764,10 @@ i386_use_watchpoints (struct target_ops *t)
    t->to_remove_watchpoint = i386_remove_watchpoint;
    t->to_insert_hw_breakpoint = i386_insert_hw_breakpoint;
    t->to_remove_hw_breakpoint = i386_remove_hw_breakpoint;
@@ -5492,7 +5533,7 @@ index 75de56c..2a64a0e 100644
        /* Handle the case of functions lacking debugging info.
           Their values are characters since their addresses are char.  */
 diff --git a/gdb/linux-nat.c b/gdb/linux-nat.c
-index cd88df8..48662ba 100644
+index 922a2cf..f7f5798 100644
 --- a/gdb/linux-nat.c
 +++ b/gdb/linux-nat.c
 @@ -1254,6 +1254,64 @@ iterate_over_lwps (ptid_t filter,
@@ -5791,7 +5832,7 @@ index 8497991..4635853 100644
  		       SYMBOL_LINKAGE_NAME (tsymbol)) == 0)
  	  return SYMBOL_VALUE_ADDRESS (msymbol);
 diff --git a/gdb/p-valprint.c b/gdb/p-valprint.c
-index ee76542..aaf8be6 100644
+index 618fc17..1180b2f 100644
 --- a/gdb/p-valprint.c
 +++ b/gdb/p-valprint.c
 @@ -39,6 +39,7 @@
@@ -5871,7 +5912,7 @@ index ee76542..aaf8be6 100644
  }
  
 diff --git a/gdb/parse.c b/gdb/parse.c
-index 856c24d..dbb38c5 100644
+index 856c24d..6db71c3 100644
 --- a/gdb/parse.c
 +++ b/gdb/parse.c
 @@ -487,9 +487,21 @@ write_exp_msymbol (struct minimal_symbol *msymbol)
@@ -5994,7 +6035,7 @@ index 856c24d..dbb38c5 100644
  	return 1;
  
        endpos = pos;
-@@ -1615,7 +1643,26 @@ exp_uses_objfile (struct expression *exp, struct objfile *objfile)
+@@ -1615,8 +1643,29 @@ exp_uses_objfile (struct expression *exp, struct objfile *objfile)
  {
    gdb_assert (objfile->separate_debug_objfile_backlink == NULL);
  
@@ -6004,6 +6045,7 @@ index 856c24d..dbb38c5 100644
 +
 +/* Helper for exp_types_mark_used.  */
 +
++#if 0
 +static int
 +exp_types_mark_used_iter (struct type *type, void *unused)
 +{
@@ -6020,10 +6062,12 @@ index 856c24d..dbb38c5 100644
 +{
 +  exp_iterate (exp, exp_types_mark_used_iter, NULL, NULL);
  }
++#endif
  
  void
+ _initialize_parse (void)
 diff --git a/gdb/parser-defs.h b/gdb/parser-defs.h
-index 3f743d1..0ee19f5 100644
+index 3f743d1..3b942c4 100644
 --- a/gdb/parser-defs.h
 +++ b/gdb/parser-defs.h
 @@ -194,6 +194,8 @@ extern void operator_length_standard (const struct expression *, int, int *,
@@ -6043,17 +6087,19 @@ index 3f743d1..0ee19f5 100644
  			   int (*objfile_func) (struct objfile *objfile,
  						void *data),
  			   void *data);
-@@ -329,4 +332,8 @@ extern void parser_fprintf (FILE *, const char *, ...) ATTRIBUTE_PRINTF (2, 3);
+@@ -329,4 +332,10 @@ extern void parser_fprintf (FILE *, const char *, ...) ATTRIBUTE_PRINTF (2, 3);
  
  extern int exp_uses_objfile (struct expression *exp, struct objfile *objfile);
  
 +extern int exp_uses_objfile (struct expression *exp, struct objfile *objfile);
 +
++#if 0
 +extern void exp_types_mark_used (struct expression *exp);
++#endif
 +
  #endif /* PARSER_DEFS_H */
 diff --git a/gdb/ppc-linux-nat.c b/gdb/ppc-linux-nat.c
-index 0c5563e..e4f0b25 100644
+index 049cde8..f3d35ec 100644
 --- a/gdb/ppc-linux-nat.c
 +++ b/gdb/ppc-linux-nat.c
 @@ -1637,12 +1637,18 @@ booke_remove_point (struct ppc_hw_breakpoint *b, int tid)
@@ -6197,10 +6243,10 @@ index 0c5563e..e4f0b25 100644
  
    return ret;
 diff --git a/gdb/printcmd.c b/gdb/printcmd.c
-index ebca5a3..4159985 100644
+index 12249a0..69aae01 100644
 --- a/gdb/printcmd.c
 +++ b/gdb/printcmd.c
-@@ -971,6 +971,11 @@ print_command_1 (char *exp, int inspect, int voidprint)
+@@ -970,6 +970,11 @@ print_command_1 (char *exp, int inspect, int voidprint)
    else
      val = access_value_history (0);
  
@@ -6212,11 +6258,12 @@ index ebca5a3..4159985 100644
    if (voidprint || (val && value_type (val) &&
  		    TYPE_CODE (value_type (val)) != TYPE_CODE_VOID))
      {
-@@ -1472,6 +1477,22 @@ x_command (char *exp, int from_tty)
+@@ -1471,6 +1476,24 @@ x_command (char *exp, int from_tty)
  	set_internalvar (lookup_internalvar ("__"), last_examine_value);
      }
  }
 +
++#if 0
 +/* Call type_mark_used for any TYPEs referenced from this GDB source file.  */
 +
 +static void
@@ -6231,16 +6278,19 @@ index ebca5a3..4159985 100644
 +    if (d->exp)
 +      exp_types_mark_used (d->exp);
 +}
++#endif
 +
  
  
  /* Add an expression to the auto-display chain.
-@@ -2884,4 +2905,6 @@ Show printing of source filename and line number with <symbol>."), NULL,
+@@ -2864,4 +2887,8 @@ Show printing of source filename and line number with <symbol>."), NULL,
    add_com ("eval", no_class, eval_command, _("\
  Convert \"printf format string\", arg1, arg2, arg3, ..., argn to\n\
  a command line, and call it."));
 +
++#if 0
 +  observer_attach_mark_used (print_types_mark_used);
++#endif
  }
 diff --git a/gdb/python/lib/gdb/FrameIterator.py b/gdb/python/lib/gdb/FrameIterator.py
 new file mode 100644
@@ -7071,7 +7121,7 @@ index 0000000..debb3bb
 +
 +InScope ()
 diff --git a/gdb/python/py-type.c b/gdb/python/py-type.c
-index c010420..92073f6 100644
+index c010420..3f4a261 100644
 --- a/gdb/python/py-type.c
 +++ b/gdb/python/py-type.c
 @@ -29,6 +29,8 @@
@@ -7083,7 +7133,7 @@ index c010420..92073f6 100644
  
  typedef struct pyty_type_object
  {
-@@ -37,11 +39,17 @@ typedef struct pyty_type_object
+@@ -37,11 +39,19 @@ typedef struct pyty_type_object
  
    /* If a Type object is associated with an objfile, it is kept on a
       doubly-linked list, rooted in the objfile.  This lets us copy the
@@ -7096,13 +7146,15 @@ index c010420..92073f6 100644
    struct pyty_type_object *next;
  } type_object;
  
++#if 0
 +/* First element of a doubly-linked list of TYPE_DISCARDABLE Types.  */
 +static type_object *pyty_objects_discardable;
++#endif
 +
  static PyTypeObject type_object_type;
  
  /* A Field object.  */
-@@ -919,8 +927,59 @@ typy_richcompare (PyObject *self, PyObject *other, int op)
+@@ -919,8 +929,63 @@ typy_richcompare (PyObject *self, PyObject *other, int op)
  
  
  
@@ -7127,6 +7179,7 @@ index c010420..92073f6 100644
 +	type_obj->next->prev = type_obj;
 +      set_objfile_data (objfile, typy_objfile_data_key, type_obj);
 +    }
++#if 0
 +  else if (type_obj->type && TYPE_DISCARDABLE (type_obj->type))
 +    {
 +      type_obj->next = pyty_objects_discardable;
@@ -7134,6 +7187,7 @@ index c010420..92073f6 100644
 +	type_obj->next->prev = type_obj;
 +      pyty_objects_discardable = type_obj;
 +    }
++#endif
 +  else
 +    type_obj->next = NULL;
 +}
@@ -7152,8 +7206,10 @@ index c010420..92073f6 100644
 +
 +      set_objfile_data (objfile, typy_objfile_data_key, type_obj->next);
 +    }
++#if 0
 +  else if (pyty_objects_discardable == type_obj)
 +    pyty_objects_discardable = type_obj->next;
++#endif
 +
 +  if (type_obj->next)
 +    type_obj->next->prev = type_obj->prev;
@@ -7162,7 +7218,7 @@ index c010420..92073f6 100644
  static void
  save_objfile_types (struct objfile *objfile, void *datum)
  {
-@@ -938,12 +997,13 @@ save_objfile_types (struct objfile *objfile, void *datum)
+@@ -938,12 +1003,13 @@ save_objfile_types (struct objfile *objfile, void *datum)
      {
        type_object *next = obj->next;
  
@@ -7180,7 +7236,7 @@ index c010420..92073f6 100644
  
        obj = next;
      }
-@@ -954,42 +1014,25 @@ save_objfile_types (struct objfile *objfile, void *datum)
+@@ -954,43 +1020,28 @@ save_objfile_types (struct objfile *objfile, void *datum)
  }
  
  static void
@@ -7206,6 +7262,7 @@ index c010420..92073f6 100644
 +  type_obj->ob_type->tp_free (obj);
  }
  
++#if 0
 +/* Call type_mark_used for any TYPEs referenced from this GDB source file.  */
  static void
 -typy_dealloc (PyObject *obj)
@@ -7233,9 +7290,11 @@ index c010420..92073f6 100644
 +       type_obj = type_obj->next)
 +    type_mark_used (type_obj->type);
  }
++#endif
  
  /* Create a new Type referring to TYPE.  */
-@@ -1000,7 +1043,10 @@ type_to_type_object (struct type *type)
+ PyObject *
+@@ -1000,7 +1051,10 @@ type_to_type_object (struct type *type)
  
    type_obj = PyObject_New (type_object, &type_object_type);
    if (type_obj)
@@ -7247,17 +7306,19 @@ index c010420..92073f6 100644
  
    return (PyObject *) type_obj;
  }
-@@ -1074,6 +1120,8 @@ gdbpy_initialize_types (void)
+@@ -1074,6 +1128,10 @@ gdbpy_initialize_types (void)
  
    Py_INCREF (&field_object_type);
    PyModule_AddObject (gdb_module, "Field", (PyObject *) &field_object_type);
 +
++#if 0
 +  observer_attach_mark_used (typy_types_mark_used);
++#endif
  }
  
  
 diff --git a/gdb/python/py-value.c b/gdb/python/py-value.c
-index 27bf101..8c08f39 100644
+index 515eaec..5d483ed 100644
 --- a/gdb/python/py-value.c
 +++ b/gdb/python/py-value.c
 @@ -28,6 +28,7 @@
@@ -7268,10 +7329,11 @@ index 27bf101..8c08f39 100644
  
  #ifdef HAVE_PYTHON
  
-@@ -1211,6 +1212,17 @@ gdbpy_is_value_object (PyObject *obj)
+@@ -1210,6 +1211,19 @@ gdbpy_is_value_object (PyObject *obj)
    return PyObject_TypeCheck (obj, &value_object_type);
  }
  
++#if 0
 +/* Call type_mark_used for any TYPEs referenced from this GDB source file.  */
 +
 +static void
@@ -7282,21 +7344,24 @@ index 27bf101..8c08f39 100644
 +  for (iter = values_in_python; iter; iter = iter->next)
 +    type_mark_used (value_type (iter->value));
 +}
++#endif
 +
  void
  gdbpy_initialize_values (void)
  {
-@@ -1221,6 +1233,8 @@ gdbpy_initialize_values (void)
+@@ -1220,6 +1234,10 @@ gdbpy_initialize_values (void)
    PyModule_AddObject (gdb_module, "Value", (PyObject *) &value_object_type);
  
    values_in_python = NULL;
 +
++#if 0
 +  observer_attach_mark_used (python_types_mark_used);
++#endif
  }
  
  
 diff --git a/gdb/python/python.c b/gdb/python/python.c
-index b79504a..2011668 100644
+index 3b10d8c..7485d14 100644
 --- a/gdb/python/python.c
 +++ b/gdb/python/python.c
 @@ -49,8 +49,11 @@ static int gdbpy_should_print_stack = 1;
@@ -7311,7 +7376,7 @@ index b79504a..2011668 100644
  
  static PyMethodDef GdbMethods[];
  
-@@ -722,6 +725,53 @@ gdbpy_print_stack (void)
+@@ -723,6 +726,53 @@ gdbpy_print_stack (void)
  
  /* Return the current Progspace.
     There always is one.  */
@@ -7365,7 +7430,7 @@ index b79504a..2011668 100644
  
  static PyObject *
  gdbpy_get_current_progspace (PyObject *unused1, PyObject *unused2)
-@@ -1106,6 +1156,8 @@ static PyMethodDef GdbMethods[] =
+@@ -1108,6 +1158,8 @@ static PyMethodDef GdbMethods[] =
      "Get a value from history" },
    { "execute", (PyCFunction) execute_gdb_command, METH_VARARGS | METH_KEYWORDS,
      "Execute a gdb command" },
@@ -7442,7 +7507,7 @@ index 4be8106..081b532 100644
  	  ms_type = 'S';
  	  break;
 diff --git a/gdb/symtab.c b/gdb/symtab.c
-index 3105327..cd1e18f 100644
+index 60bc585..5ee0459 100644
 --- a/gdb/symtab.c
 +++ b/gdb/symtab.c
 @@ -3006,7 +3006,7 @@ search_symbols (char *regexp, domain_enum kind, int nfiles, char *files[],
@@ -11116,10 +11181,10 @@ index 0000000..295602d
 +  writeln(s); { set breakpoint 2 here }
 +end.
 diff --git a/gdb/testsuite/gdb.python/py-frame.exp b/gdb/testsuite/gdb.python/py-frame.exp
-index e3b5629..2a63d8d 100644
+index 1cb573e..3605ee5 100644
 --- a/gdb/testsuite/gdb.python/py-frame.exp
 +++ b/gdb/testsuite/gdb.python/py-frame.exp
-@@ -87,8 +87,6 @@ gdb_test "python print bframe == gdb.newest_frame()" True \
+@@ -78,8 +78,6 @@ gdb_test "python print bframe == gdb.newest_frame()" True \
  
  gdb_test "python print 'result =', f0 == f1" " = False" "test equality comparison (false)"
  gdb_test "python print 'result =', f0 == f0" " = True" "test equality comparison (true)"
@@ -11128,7 +11193,7 @@ index e3b5629..2a63d8d 100644
  gdb_test "python print 'result =', f0.is_valid ()" " = True" "test Frame.is_valid"
  gdb_test "python print 'result =', f0.name ()" " = f2" "test Frame.name"
  gdb_test "python print 'result =', f0.type () == gdb.NORMAL_FRAME" " = True" "test Frame.type"
-@@ -103,3 +101,5 @@ gdb_test "python print 'result =', f0.read_var ('variable_which_surely_doesnt_ex
+@@ -94,3 +92,5 @@ gdb_test "python print 'result =', f0.read_var ('variable_which_surely_doesnt_ex
  gdb_test "python print 'result =', f0.read_var ('a')" " = 1" "test Frame.read_var - success"
  
  gdb_test "python print 'result =', gdb.selected_frame () == f1" " = True" "test gdb.selected_frame"
@@ -11867,14 +11932,16 @@ index 891da37..236c5ca 100644
      set pascal_init_done 1
  }   
 diff --git a/gdb/top.c b/gdb/top.c
-index df2b163..a205d00 100644
+index df2b163..6061b33 100644
 --- a/gdb/top.c
 +++ b/gdb/top.c
-@@ -343,6 +343,7 @@ void
+@@ -343,6 +343,9 @@ void
  prepare_execute_command (void)
  {
    free_all_values ();
++#if 0
 +  free_all_types ();
++#endif
  
    /* With multiple threads running while the one we're examining is
       stopped, the dcache can get stale without us being able to detect
@@ -11936,10 +12003,10 @@ index 03e6332..ce6d1e0 100644
  
  static void
 diff --git a/gdb/utils.c b/gdb/utils.c
-index 82e3adb..a5b9146 100644
+index 91e6af4..88b82f5 100644
 --- a/gdb/utils.c
 +++ b/gdb/utils.c
-@@ -2238,6 +2238,36 @@ set_batch_flag_and_make_cleanup_restore_page_info (void)
+@@ -2243,6 +2243,36 @@ set_batch_flag_and_make_cleanup_restore_page_info (void)
    return back_to;
  }
  
@@ -12004,7 +12071,7 @@ index 68f649f..aaa4487 100644
  }
  
 diff --git a/gdb/valops.c b/gdb/valops.c
-index 5465aba..d267bf8 100644
+index 0c07e5c..5749cce 100644
 --- a/gdb/valops.c
 +++ b/gdb/valops.c
 @@ -47,6 +47,7 @@
@@ -12232,16 +12299,16 @@ index 286ef9e..1fe58b1 100644
  
  /* Read LEN bytes of target memory at address MEMADDR, placing the
 diff --git a/gdb/value.c b/gdb/value.c
-index 011b5e7..bcfbe5d 100644
+index 2acb1df..d1db8f5 100644
 --- a/gdb/value.c
 +++ b/gdb/value.c
-@@ -41,6 +41,7 @@
- #include "cli/cli-decode.h"
- #include "exceptions.h"
+@@ -43,6 +43,7 @@
  #include "python/python.h"
+ #include <ctype.h>
+ #include "tracepoint.h"
 +#include "observer.h"
  
- #include "tracepoint.h"
+ /* Prototypes for exported functions.  */
  
 @@ -1339,12 +1340,15 @@ void
  set_value_component_location (struct value *component,
@@ -12272,7 +12339,7 @@ index 011b5e7..bcfbe5d 100644
  }
  
  
-@@ -1485,6 +1495,29 @@ show_values (char *num_exp, int from_tty)
+@@ -1485,6 +1495,31 @@ show_values (char *num_exp, int from_tty)
        num_exp[1] = '\0';
      }
  }
@@ -12297,15 +12364,18 @@ index 011b5e7..bcfbe5d 100644
 +
 +  /* Free the unreferenced types above.  */
 +  free_all_values ();
++#if 0
 +  free_all_types ();
++#endif
 +}
  
  /* Internal variables.  These are variables within the debugger
     that hold values assigned by debugger commands.
-@@ -1963,6 +1996,36 @@ call_internal_function (struct gdbarch *gdbarch,
+@@ -1963,6 +1998,38 @@ call_internal_function (struct gdbarch *gdbarch,
    return (*ifn->handler) (gdbarch, language, ifn->cookie, argc, argv);
  }
  
++#if 0
 +/* Call type_mark_used for any TYPEs referenced from this GDB source file.  */
 +
 +static void
@@ -12335,11 +12405,12 @@ index 011b5e7..bcfbe5d 100644
 +	  type_mark_used (value_type (chunk->values[i]));
 +    }
 +}
++#endif
 +
  /* The 'function' command.  This does nothing -- it is just a
     placeholder to let "help function NAME" work.  This is also used as
     the implementation of the sub-command that is created when
-@@ -2010,11 +2073,10 @@ preserve_one_value (struct value *value, struct objfile *objfile,
+@@ -2010,11 +2077,10 @@ preserve_one_value (struct value *value, struct objfile *objfile,
  		    htab_t copied_types)
  {
    if (TYPE_OBJFILE (value->type) == objfile)
@@ -12353,7 +12424,7 @@ index 011b5e7..bcfbe5d 100644
  						 copied_types);
  }
  
-@@ -2029,7 +2091,7 @@ preserve_one_internalvar (struct internalvar *var, struct objfile *objfile,
+@@ -2029,7 +2095,7 @@ preserve_one_internalvar (struct internalvar *var, struct objfile *objfile,
      case INTERNALVAR_INTEGER:
        if (var->u.integer.type && TYPE_OBJFILE (var->u.integer.type) == objfile)
  	var->u.integer.type
@@ -12362,7 +12433,7 @@ index 011b5e7..bcfbe5d 100644
        break;
  
      case INTERNALVAR_VALUE:
-@@ -2994,7 +3056,24 @@ value_from_decfloat (struct type *type, const gdb_byte *dec)
+@@ -3047,7 +3113,24 @@ value_from_history_ref (char *h, char **endp)
  struct value *
  coerce_ref (struct value *arg)
  {
@@ -12388,22 +12459,24 @@ index 011b5e7..bcfbe5d 100644
  
    if (TYPE_CODE (value_type_arg_tmp) == TYPE_CODE_REF)
      arg = value_at_lazy (TYPE_TARGET_TYPE (value_type_arg_tmp),
-@@ -3092,4 +3171,8 @@ VARIABLE is already initialized."));
+@@ -3145,4 +3228,10 @@ VARIABLE is already initialized."));
    add_prefix_cmd ("function", no_class, function_command, _("\
  Placeholder command for showing help on convenience functions."),
  		  &functionlist, "function ", 0, &cmdlist);
 +
 +  make_final_cleanup (value_history_cleanup, NULL);
 +
++#if 0
 +  observer_attach_mark_used (value_types_mark_used);
++#endif
  }
 diff --git a/gdb/value.h b/gdb/value.h
-index e019e56..ba5e20f 100644
+index 0889cef..1be7f0b 100644
 --- a/gdb/value.h
 +++ b/gdb/value.h
-@@ -472,6 +472,10 @@ extern struct value *value_from_double (struct type *type, DOUBLEST num);
- extern struct value *value_from_decfloat (struct type *type,
+@@ -473,6 +473,10 @@ extern struct value *value_from_decfloat (struct type *type,
  					  const gdb_byte *decbytes);
+ extern struct value *value_from_history_ref (char *, char **);
  
 +extern const char *object_address_data_not_valid (struct type *type);
 +extern struct type *object_address_get_data (struct type *type,
diff --git a/gdb-python-newbacktrace.patch b/gdb-python-newbacktrace.patch
index 31439fa..c07757c 100644
--- a/gdb-python-newbacktrace.patch
+++ b/gdb-python-newbacktrace.patch
@@ -41,12 +41,12 @@ Phil
 
 --
 
-diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo
-index 161ac1f..55eca2a 100644
---- a/gdb/doc/gdb.texinfo
-+++ b/gdb/doc/gdb.texinfo
-@@ -22718,6 +22718,13 @@ domain constant defined in the @code{gdb} module and described later
- in this chapter.
+Index: gdb-7.2.50.20110305/gdb/doc/gdb.texinfo
+===================================================================
+--- gdb-7.2.50.20110305.orig/gdb/doc/gdb.texinfo	2011-03-05 08:27:09.000000000 +0100
++++ gdb-7.2.50.20110305/gdb/doc/gdb.texinfo	2011-03-05 08:28:33.000000000 +0100
+@@ -22919,6 +22919,13 @@ The result is a @code{gdb.Symbol} object
+ is not found.
  @end defun
  
 +A @code{gdb.Symbol} object has the following methods:
@@ -59,10 +59,10 @@ index 161ac1f..55eca2a 100644
  A @code{gdb.Symbol} object has the following attributes:
  
  @table @code
-diff --git a/gdb/python/lib/gdb/FrameWrapper.py b/gdb/python/lib/gdb/FrameWrapper.py
-index b790a54..5d98b0f 100644
---- a/gdb/python/lib/gdb/FrameWrapper.py
-+++ b/gdb/python/lib/gdb/FrameWrapper.py
+Index: gdb-7.2.50.20110305/gdb/python/lib/gdb/FrameWrapper.py
+===================================================================
+--- gdb-7.2.50.20110305.orig/gdb/python/lib/gdb/FrameWrapper.py	2011-03-05 08:26:12.000000000 +0100
++++ gdb-7.2.50.20110305/gdb/python/lib/gdb/FrameWrapper.py	2011-03-05 08:27:22.000000000 +0100
 @@ -46,7 +46,7 @@ class FrameWrapper:
              return
  
@@ -81,11 +81,11 @@ index b790a54..5d98b0f 100644
  
          for sym in block:
              if not sym.is_argument:
-diff --git a/gdb/python/py-symbol.c b/gdb/python/py-symbol.c
-index e072dc8..1dfe394 100644
---- a/gdb/python/py-symbol.c
-+++ b/gdb/python/py-symbol.c
-@@ -167,6 +167,27 @@ sympy_is_variable (PyObject *self, void *closure)
+Index: gdb-7.2.50.20110305/gdb/python/py-symbol.c
+===================================================================
+--- gdb-7.2.50.20110305.orig/gdb/python/py-symbol.c	2011-02-26 03:07:09.000000000 +0100
++++ gdb-7.2.50.20110305/gdb/python/py-symbol.c	2011-03-05 08:27:22.000000000 +0100
+@@ -167,6 +167,27 @@ sympy_is_variable (PyObject *self, void 
  			      || class == LOC_OPTIMIZED_OUT));
  }
  
@@ -113,7 +113,7 @@ index e072dc8..1dfe394 100644
  /* Given a symbol, and a symbol_object that has previously been
     allocated and initialized, populate the symbol_object with the
     struct symbol data.  Also, register the symbol_object life-cycle
-@@ -362,6 +383,13 @@ gdbpy_initialize_symbols (void)
+@@ -396,6 +417,13 @@ gdbpy_initialize_symbols (void)
  
  
  
@@ -127,7 +127,7 @@ index e072dc8..1dfe394 100644
  static PyGetSetDef symbol_object_getset[] = {
    { "symtab", sympy_get_symtab, NULL,
      "Symbol table in which the symbol appears.", NULL },
-@@ -415,7 +443,7 @@ PyTypeObject symbol_object_type = {
+@@ -449,7 +477,7 @@ PyTypeObject symbol_object_type = {
    0,				  /*tp_weaklistoffset */
    0,				  /*tp_iter */
    0,				  /*tp_iternext */
@@ -136,11 +136,11 @@ index e072dc8..1dfe394 100644
    0,				  /*tp_members */
    symbol_object_getset		  /*tp_getset */
  };
-diff --git a/gdb/testsuite/gdb.python/py-symbol.exp b/gdb/testsuite/gdb.python/py-symbol.exp
-index 8e3aec1..6d43566 100644
---- a/gdb/testsuite/gdb.python/py-symbol.exp
-+++ b/gdb/testsuite/gdb.python/py-symbol.exp
-@@ -69,6 +69,10 @@ gdb_test "python print func.print_name" "func" "Test func.print_name"
+Index: gdb-7.2.50.20110305/gdb/testsuite/gdb.python/py-symbol.exp
+===================================================================
+--- gdb-7.2.50.20110305.orig/gdb/testsuite/gdb.python/py-symbol.exp	2011-02-22 23:48:12.000000000 +0100
++++ gdb-7.2.50.20110305/gdb/testsuite/gdb.python/py-symbol.exp	2011-03-05 08:27:22.000000000 +0100
+@@ -76,6 +76,10 @@ gdb_test "python print func.print_name" 
  gdb_test "python print func.linkage_name" "func" "Test func.linkage_name"
  gdb_test "python print func.addr_class == gdb.SYMBOL_LOC_BLOCK" "True" "Test func.addr_class"
  
@@ -151,4 +151,3 @@ index 8e3aec1..6d43566 100644
  gdb_breakpoint [gdb_get_line_number "Break at end."]
  gdb_continue_to_breakpoint "Break at end."
  gdb_py_test_silent_cmd "python frame = gdb.selected_frame()" "Get Frame" 0
-
diff --git a/gdb-upstream.patch b/gdb-upstream.patch
new file mode 100644
index 0000000..1e349df
--- /dev/null
+++ b/gdb-upstream.patch
@@ -0,0 +1,66 @@
+http://sourceware.org/ml/gdb-cvs/2011-03/msg00077.html
+
+### src/gdb/gdbserver/ChangeLog	2011/03/04 06:31:54	1.463
+### src/gdb/gdbserver/ChangeLog	2011/03/05 03:45:26	1.464
+## -1,3 +1,10 @@
++2011-03-05  Yao Qi  <yao at codesourcery.com>
++
++	* Makefile.in (CLEANDIRS, REQUIRED_SUBDIRS): New variable.
++	(subdir_do): New make target.  Copied from gdb/Makefile.
++	(maintainer-clean, realclean, distclean, clean): Call corresponding
++	make targets in common/Makefile.
++
+ 2011-03-04  Yao Qi  <yao at codesourcery.com>
+ 
+ 	* Makefile.in: Remove GNU make feature --directory.
+--- src/gdb/gdbserver/Makefile.in	2011/03/04 06:31:54	1.104
++++ src/gdb/gdbserver/Makefile.in	2011/03/05 03:45:26	1.105
+@@ -136,6 +136,9 @@
+ LIBCOMMON = $(LIBCOMMON_DIR)/libcommon.a
+ LIBCOMMON_SRC = $(srcdir)/$(LIBCOMMON_DIR)
+ 
++CLEANDIRS = $(LIBCOMMON_DIR)
++REQUIRED_SUBDIRS = $(LIBCOMMON_DIR)
++
+ SOURCES = $(SFILES)
+ TAGFILES = $(SOURCES) ${HFILES} ${ALLPARAM} ${POSSLIBS}
+ 
+@@ -291,6 +294,7 @@
+ tags: TAGS
+ 
+ clean:
++	@$(MAKE) $(FLAGS_TO_PASS) DO=clean "DODIRS=$(CLEANDIRS)" subdir_do
+ 	rm -f *.o ${ADD_FILES} *~
+ 	rm -f version.c
+ 	rm -f gdbserver$(EXEEXT) gdbreplay$(EXEEXT) core make.log
+@@ -314,6 +318,7 @@
+ 	rm -f i386-mmx.c i386-mmx-linux.c
+ 
+ maintainer-clean realclean distclean: clean
++	@$(MAKE) $(FLAGS_TO_PASS) DO=$@ "DODIRS=$(CLEANDIRS)" subdir_do
+ 	rm -f nm.h tm.h xm.h config.status config.h stamp-h config.log
+ 	rm -f Makefile
+ 
+@@ -321,6 +326,22 @@
+ stamp-h: config.in config.status
+ 	CONFIG_FILES="" CONFIG_HEADERS=config.h:config.in $(SHELL) ./config.status
+ 
++subdir_do: force
++	@for i in $(DODIRS); do \
++		case $$i in \
++		$(REQUIRED_SUBDIRS)) \
++			if [ ! -f ./$$i/Makefile ] ; then \
++				echo "Missing $$i/Makefile" >&2 ; \
++				exit 1 ; \
++			fi ;; \
++		esac ; \
++		if [ -f ./$$i/Makefile ] ; then \
++			if (cd ./$$i; \
++				$(MAKE) $(FLAGS_TO_PASS) $(DO)) ; then true ; \
++			else exit 1 ; fi ; \
++		else true ; fi ; \
++	done
++
+ Makefile: Makefile.in config.status
+ 	CONFIG_HEADERS="" $(SHELL) ./config.status
+ 
diff --git a/gdb.spec b/gdb.spec
index 6a1a685..93db69a 100644
--- a/gdb.spec
+++ b/gdb.spec
@@ -23,11 +23,11 @@ Name: gdb%{?_with_debug:-debug}
 # Set version to contents of gdb/version.in.
 # NOTE: the FSF gdb versions are numbered N.M for official releases, like 6.3
 # and, since January 2005, X.Y.Z.date for daily snapshots, like 6.3.50.20050112 # (daily snapshot from mailine), or 6.3.0.20040112 (head of the release branch).
-Version: 7.2.50.20110222
+Version: 7.2.50.20110305
 
 # 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: 27%{?_with_upstream:.upstream}%{?dist}
+Release: 28%{?_with_upstream:.upstream}%{?dist}
 
 License: GPLv3+ and GPLv3+ with exceptions and GPLv2+ and GPLv2+ with exceptions and GPL+ and LGPLv2+ and BSD and Public Domain
 Group: Development/Debuggers
@@ -264,7 +264,7 @@ Patch231: gdb-6.3-bz202689-exec-from-pthread-test.patch
 
 # Backported fixups post the source tarball.
 #Xdrop: Just backports.
-#Patch232: gdb-upstream.patch
+Patch232: gdb-upstream.patch
 
 # Testcase for PPC Power6/DFP instructions disassembly (BZ 230000).
 #=fedoratest+ppc
@@ -717,7 +717,7 @@ rm -f gdb/jv-exp.c gdb/m2-exp.c gdb/objc-exp.c gdb/p-exp.c
 
 %if 0%{!?_with_upstream:1}
 
-#patch232 -p1
+%patch232 -p1
 %patch349 -p1
 %patch1 -p1
 %patch3 -p1
@@ -1258,6 +1258,9 @@ fi
 %{_infodir}/gdb.info*
 
 %changelog
+* Sat Mar  5 2011 Jan Kratochvil <jan.kratochvil at redhat.com> - 7.2.50.20110305-28.fc15
+- Rebase to FSF GDB 7.2.50.20110305 (which is a 7.3 pre-release).
+
 * Fri Feb 25 2011 Jan Kratochvil <jan.kratochvil at redhat.com> - 7.2.50.20110222-27.fc15
 - Include doc also in the PDF form; new BuildRequires: texinfo-tex.
 
diff --git a/sources b/sources
index 63f3744..d29a2bd 100644
--- a/sources
+++ b/sources
@@ -1,2 +1,2 @@
 04e5c4b1b9e633422cc48990fe61958d  libstdc++-v3-python-r155978.tar.bz2
-2e26a654bcd0c9c46cfc104e4068a95c  gdb-7.2.50.20110222.tar.bz2
+143ab09e8724b0058fbf882832f6d2f3  gdb-7.2.50.20110305.tar.bz2


More information about the scm-commits mailing list