]> git.pld-linux.org Git - packages/gdb.git/commitdiff
- update to 6.8.91.20090930-1 from fedora
authorElan Ruusamäe <glen@pld-linux.org>
Mon, 7 Dec 2009 23:29:15 +0000 (23:29 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Changed files:
    gdb-6.3-dtorfix-20050121.patch -> 1.2
    gdb-6.3-gcore-thread-20050204.patch -> 1.2
    gdb-6.3-gstack-20050411.patch -> 1.2
    gdb-6.3-gstack-without-path-20060414.patch -> 1.2
    gdb-6.3-ia64-gcore-page0-20050421.patch -> 1.2
    gdb-6.3-ia64-gcore-speedup-20050714.patch -> 1.2
    gdb-6.3-ia64-sigtramp-fp-20050926.patch -> 1.2
    gdb-6.3-inheritancetest-20050726.patch -> 1.2
    gdb-6.3-large-core-20051206.patch -> 1.2
    gdb-6.3-linespec-20041213.patch -> 1.2
    gdb-6.3-mapping-zero-inode-test.patch -> 1.2
    gdb-6.3-pie-20050110.patch -> 1.2
    gdb-6.3-ppc64syscall-20040622.patch -> 1.2
    gdb-6.3-ppcdotsolib-20041022.patch -> 1.2
    gdb-6.3-readnever-20050907.patch -> 1.2
    gdb-6.3-removebp-20041130.patch -> 1.2
    gdb-6.3-rh-testlibunwind-20041202.patch -> 1.2
    gdb-6.3-rh-testlibunwind1fix-20041202.patch -> 1.2
    gdb-6.3-test-pie-20050107.patch -> 1.2
    gdb-6.3-threaded-watchpoints2-20050225.patch -> 1.2
    gdb-6.5-bz181390-memory-address-width.patch -> 1.2
    gdb-6.5-bz185337-resolve-tls-without-debuginfo-v2.patch -> 1.2
    gdb-6.5-bz190810-gdbserver-arch-advice.patch -> 1.2
    gdb-6.5-bz203661-emit-relocs.patch -> 1.2
    gdb-6.5-bz216711-clone-is-outermost.patch -> 1.2
    gdb-6.5-bz218379-solib-trampoline-lookup-lock-fix.patch -> 1.2
    gdb-6.5-gcore-i386-on-amd64.patch -> 1.2
    gdb-6.6-buildid-locate-rpm.patch -> 1.4
    gdb-6.6-buildid-locate.patch -> 1.3
    gdb-6.6-multifork-debugreg.patch -> 1.2
    gdb-6.6-scheduler_locking-step-is-default.patch -> 1.2
    gdb-6.6-scheduler_locking-step-sw-watchpoints2.patch -> 1.2
    gdb-6.6-step-thread-exit.patch -> 1.2
    gdb-6.7-testsuite-stable-results.patch -> 1.2
    gdb-6.8-attach-signalled-detach-stopped.patch -> 1.2
    gdb-6.8-bz254229-gcore-prpsinfo.patch -> 1.2
    gdb-6.8-bz436037-reg-no-longer-active.patch -> 1.2
    gdb-6.8-bz457187-largefile-test.patch -> 1.1
    gdb-6.8-bz457187-largefile.patch -> 1.2
    gdb-6.8-bz466901-backtrace-full-prelinked.patch -> 1.2
    gdb-6.8-constant-watchpoints.patch -> 1.2
    gdb-6.8-ctors-dtors-unique.patch -> 1.2
    gdb-6.8-fortran-tag-constant.patch -> 1.2
    gdb-6.8-inlining-addon.patch -> 1.2
    gdb-6.8-inlining.patch -> 1.3
    gdb-archer.patch -> 1.3
    gdb-readline-6.0.patch -> 1.1
    gdb-simultaneous-step-resume-breakpoint-test.patch -> 1.1
    gdb.spec -> 1.115
    libstdc++-v3-python-common-prefix.patch -> 1.1

50 files changed:
gdb-6.3-dtorfix-20050121.patch [deleted file]
gdb-6.3-gcore-thread-20050204.patch
gdb-6.3-gstack-20050411.patch
gdb-6.3-gstack-without-path-20060414.patch
gdb-6.3-ia64-gcore-page0-20050421.patch
gdb-6.3-ia64-gcore-speedup-20050714.patch
gdb-6.3-ia64-sigtramp-fp-20050926.patch [deleted file]
gdb-6.3-inheritancetest-20050726.patch
gdb-6.3-large-core-20051206.patch
gdb-6.3-linespec-20041213.patch [deleted file]
gdb-6.3-mapping-zero-inode-test.patch
gdb-6.3-pie-20050110.patch
gdb-6.3-ppc64syscall-20040622.patch
gdb-6.3-ppcdotsolib-20041022.patch
gdb-6.3-readnever-20050907.patch
gdb-6.3-removebp-20041130.patch [deleted file]
gdb-6.3-rh-testlibunwind-20041202.patch
gdb-6.3-rh-testlibunwind1fix-20041202.patch [deleted file]
gdb-6.3-test-pie-20050107.patch
gdb-6.3-threaded-watchpoints2-20050225.patch
gdb-6.5-bz181390-memory-address-width.patch [deleted file]
gdb-6.5-bz185337-resolve-tls-without-debuginfo-v2.patch
gdb-6.5-bz190810-gdbserver-arch-advice.patch
gdb-6.5-bz203661-emit-relocs.patch
gdb-6.5-bz216711-clone-is-outermost.patch
gdb-6.5-bz218379-solib-trampoline-lookup-lock-fix.patch
gdb-6.5-gcore-i386-on-amd64.patch
gdb-6.6-buildid-locate-rpm.patch
gdb-6.6-buildid-locate.patch
gdb-6.6-multifork-debugreg.patch [deleted file]
gdb-6.6-scheduler_locking-step-is-default.patch
gdb-6.6-scheduler_locking-step-sw-watchpoints2.patch
gdb-6.6-step-thread-exit.patch
gdb-6.7-testsuite-stable-results.patch
gdb-6.8-attach-signalled-detach-stopped.patch
gdb-6.8-bz254229-gcore-prpsinfo.patch
gdb-6.8-bz436037-reg-no-longer-active.patch
gdb-6.8-bz457187-largefile-test.patch [new file with mode: 0644]
gdb-6.8-bz457187-largefile.patch
gdb-6.8-bz466901-backtrace-full-prelinked.patch
gdb-6.8-constant-watchpoints.patch
gdb-6.8-ctors-dtors-unique.patch [deleted file]
gdb-6.8-fortran-tag-constant.patch
gdb-6.8-inlining-addon.patch
gdb-6.8-inlining.patch [deleted file]
gdb-archer.patch
gdb-readline-6.0.patch [new file with mode: 0644]
gdb-simultaneous-step-resume-breakpoint-test.patch [new file with mode: 0644]
gdb.spec
libstdc++-v3-python-common-prefix.patch [new file with mode: 0644]

diff --git a/gdb-6.3-dtorfix-20050121.patch b/gdb-6.3-dtorfix-20050121.patch
deleted file mode 100644 (file)
index 55cd23e..0000000
+++ /dev/null
@@ -1,52 +0,0 @@
-2005-01-21  Jeff Johnston  <jjohnstn@redhat.com>
-
-       * linespec.c (collect_methods): Don't do special processing for
-       destructors as this will be handled in find_methods.
-       (find_methods): Fix ctor check to also check for dtor.
-
-2007-10-14  Jan Kratochvil  <jan.kratochvil@redhat.com>
-
-       Port to GDB-6.7.
-
-Index: gdb-6.7/gdb/linespec.c
-===================================================================
---- gdb-6.7.orig/gdb/linespec.c        2007-10-13 05:26:33.000000000 +0200
-+++ gdb-6.7/gdb/linespec.c     2007-10-14 23:31:03.000000000 +0200
-@@ -398,12 +398,14 @@ add_matching_methods (int method_counter
-       /* Check for special case of looking for member that
-        doesn't have a mangled name provided.  This will happen
--       when we have in-charge and not-in-charge constructors.
-+       when we have in-charge and not-in-charge ctors/dtors.
-        Since we don't have a mangled name to work with, if we
--       look for the symbol, we can only find the class itself.
-+       look for the symbol, we can at best find the class itself.
-        We can find the information we need in the minimal symbol
-        table which has the full member name information we need.  */
--      if (strlen (phys_name) <= strlen (class_name))
-+     if (strlen (phys_name) <= strlen (class_name)
-+         || (strlen (phys_name) == strlen (class_name) + 1
-+             && phys_name[0] == '~'))
-       return add_minsym_members (class_name, phys_name, msym_arr);
-       /* Destructor is handled by caller, don't add it to
-@@ -1731,6 +1733,11 @@ collect_methods (char *copy, struct type
- {
-   int i1 = 0; /*  Counter for the symbol array.  */
-+#if 0
-+  /* Ignore this special method for getting destructors because
-+     find_methods is more robust and can handle multiple
-+     destructors which is the case when gcc generates a not-in-charge
-+     vs an in-charge destructor.  */
-   if (destructor_name_p (copy, t))
-     {
-       /* Destructors are a special case.  */
-@@ -1749,6 +1756,7 @@ collect_methods (char *copy, struct type
-       }
-     }
-   else
-+#endif
-     i1 = find_methods (t, copy, SYMBOL_LANGUAGE (sym_class), sym_arr, msym_arr);
-   return i1;
index 7da5240da0f6da5f5b08a29bfee7d557fb3a7f35..31ecbba2268b90b29bbf9d260f7b4aaa9e3e0d1e 100644 (file)
@@ -3,13 +3,13 @@
         * linux-nat.c (linux_nat_xfer_memory): Don't use
         linux_proc_xfer_memory for ia64.
 
-Index: gdb-6.8.50.20081209/gdb/linux-nat.c
+Index: gdb-6.8.50.20090803/gdb/linux-nat.c
 ===================================================================
---- gdb-6.8.50.20081209.orig/gdb/linux-nat.c   2008-12-10 01:22:23.000000000 +0100
-+++ gdb-6.8.50.20081209/gdb/linux-nat.c        2008-12-10 01:25:26.000000000 +0100
-@@ -4123,10 +4123,15 @@ linux_xfer_partial (struct target_ops *o
-     return linux_nat_xfer_osdata (ops, object, annex, readbuf, writebuf,
-                                offset, len);
+--- gdb-6.8.50.20090803.orig/gdb/linux-nat.c   2009-08-04 06:29:47.000000000 +0200
++++ gdb-6.8.50.20090803/gdb/linux-nat.c        2009-08-04 06:29:55.000000000 +0200
+@@ -4495,10 +4495,15 @@ linux_xfer_partial (struct target_ops *o
+       offset &= ((ULONGEST) 1 << addr_bit) - 1;
+     }
  
 +#ifndef NATIVE_XFER_UNWIND_TABLE
 +  /* FIXME: For ia64, we cannot currently use linux_proc_xfer_memory
index 5e54928d1aac6f42cd942498f0ddafeb854083e4..0aa6426240aea0bf24adf9b5e8189ec1eb7b6b8f 100644 (file)
@@ -4,11 +4,11 @@
        to install and uninstall.
        * gstack.sh, gstack.1: New files.
 
-Index: gdb-6.8.50.20090226/gdb/Makefile.in
+Index: gdb-6.8.91.20090917/gdb/Makefile.in
 ===================================================================
---- gdb-6.8.50.20090226.orig/gdb/Makefile.in   2009-02-26 22:09:59.000000000 +0100
-+++ gdb-6.8.50.20090226/gdb/Makefile.in        2009-02-26 22:10:22.000000000 +0100
-@@ -973,7 +973,7 @@ install: all install-only 
+--- gdb-6.8.91.20090917.orig/gdb/Makefile.in   2009-09-17 12:47:07.000000000 +0200
++++ gdb-6.8.91.20090917/gdb/Makefile.in        2009-09-17 12:47:38.000000000 +0200
+@@ -989,7 +989,7 @@ install: all install-only 
  
  # The "install-only" target also installs the syscalls' XML files in
  # the system.
@@ -17,7 +17,7 @@ Index: gdb-6.8.50.20090226/gdb/Makefile.in
        transformed_name=`t='$(program_transform_name)'; \
                          echo gdb | sed -e "$$t"` ; \
                if test "x$$transformed_name" = x; then \
-@@ -1005,9 +1005,26 @@ install-tui:
+@@ -1021,9 +1021,26 @@ install-tui:
                        $(DESTDIR)$(man1dir) ; \
                $(INSTALL_DATA) $(srcdir)/gdb.1 \
                        $(DESTDIR)$(man1dir)/$$transformed_name.1
@@ -45,7 +45,7 @@ Index: gdb-6.8.50.20090226/gdb/Makefile.in
        transformed_name=`t='$(program_transform_name)'; \
                          echo gdb | sed -e $$t` ; \
                if test "x$$transformed_name" = x; then \
-@@ -1029,6 +1046,17 @@ uninstall-tui:
+@@ -1045,6 +1062,17 @@ uninstall-tui:
                fi ; \
                rm -f $(DESTDIR)$(bindir)/$$transformed_name$(EXEEXT) \
                      $(DESTDIR)$(man1dir)/$$transformed_name.1
@@ -63,11 +63,11 @@ Index: gdb-6.8.50.20090226/gdb/Makefile.in
  
  # The C++ name parser can be built standalone for testing.
  test-cp-name-parser.o: cp-name-parser.c
-Index: gdb-6.8.50.20090226/gdb/gstack.sh
+Index: gdb-6.8.91.20090917/gdb/gstack.sh
 ===================================================================
 --- /dev/null  1970-01-01 00:00:00.000000000 +0000
-+++ gdb-6.8.50.20090226/gdb/gstack.sh  2009-02-26 22:10:05.000000000 +0100
-@@ -0,0 +1,45 @@
++++ gdb-6.8.91.20090917/gdb/gstack.sh  2009-09-17 12:47:14.000000000 +0200
+@@ -0,0 +1,48 @@
 +#!/bin/sh
 +
 +if test $# -ne 1; then
@@ -107,6 +107,9 @@ Index: gdb-6.8.50.20090226/gdb/gstack.sh
 +
 +# Run GDB, strip out unwanted noise.
 +$GDB --quiet $readnever -nx /proc/$1/exe $1 <<EOF 2>&1 | 
++set width 0
++set height 0
++set pagination no
 +$backtrace
 +EOF
 +sed -n \
index ffc4b6963a65da9b98427967ee619a3ac456cbbc..677f934706e280981214e4ba7b89c4b55f591a43 100644 (file)
@@ -24,7 +24,7 @@ Index: gdb-6.3/gdb/gstack.sh
  if $GDB -nx --quiet --batch --readnever > /dev/null 2>&1; then
      readnever=--readnever
 @@ -39,7 +39,7 @@ fi
- $GDB --quiet $readnever -nx /proc/$1/exe $1 <<EOF 2>&1 | 
+ set pagination no
  $backtrace
  EOF
 -sed -n \
index 093d6415ffe1b6faceb368f1535c5693d1ba3f8d..0c4245cc8c61887276138233a7bbf306af517b60 100644 (file)
@@ -1,8 +1,8 @@
-Index: gdb-6.8.50.20081128/gdb/gcore.c
+Index: gdb-6.8.50.20090802/gdb/gcore.c
 ===================================================================
---- gdb-6.8.50.20081128.orig/gdb/gcore.c       2008-09-11 16:27:34.000000000 +0200
-+++ gdb-6.8.50.20081128/gdb/gcore.c    2008-12-01 16:39:04.000000000 +0100
-@@ -475,8 +475,14 @@ gcore_copy_callback (bfd *obfd, asection
+--- gdb-6.8.50.20090802.orig/gdb/gcore.c       2009-08-03 12:27:55.000000000 +0200
++++ gdb-6.8.50.20090802/gdb/gcore.c    2009-08-03 12:28:56.000000000 +0200
+@@ -479,8 +479,14 @@ gcore_copy_callback (bfd *obfd, asection
        if (size > total_size)
        size = total_size;
  
@@ -12,9 +12,9 @@ Index: gdb-6.8.50.20081128/gdb/gcore.c
        if (target_read_memory (bfd_section_vma (obfd, osec) + offset,
 -                            memhunk, size) != 0)
 +                            memhunk, size) != 0
-+        && (strcmp (gdbarch_bfd_arch_info (current_gdbarch)->arch_name,
++        && (strcmp (gdbarch_bfd_arch_info (target_gdbarch)->arch_name,
 +                    "ia64")
 +            || bfd_section_vma (obfd, osec) != 0))
        {
-         warning (_("Memory read failed for corefile section, %s bytes at 0x%s."),
-                  plongest (size), paddr (bfd_section_vma (obfd, osec)));
+         warning (_("Memory read failed for corefile section, %s bytes at %s."),
+                  plongest (size),
index a9d4377175c4128481a6ddb2c8fe8a01172ef0a7..f902e62f6e2e5c3c38c3fb392ae91a7a84ed8500 100644 (file)
@@ -7,13 +7,13 @@
        (ia64_rse_skip_regs): Ditto.
        (ia64_linux_check_stack_region): New function.
        
-Index: gdb-6.8.50.20090226/gdb/linux-nat.c
+Index: gdb-6.8.50.20090803/gdb/linux-nat.c
 ===================================================================
---- gdb-6.8.50.20090226.orig/gdb/linux-nat.c   2009-02-27 07:51:44.000000000 +0100
-+++ gdb-6.8.50.20090226/gdb/linux-nat.c        2009-02-28 07:19:05.000000000 +0100
-@@ -4386,15 +4386,38 @@ linux_xfer_partial (struct target_ops *o
-     return linux_nat_xfer_osdata (ops, object, annex, readbuf, writebuf,
-                                offset, len);
+--- gdb-6.8.50.20090803.orig/gdb/linux-nat.c   2009-08-04 06:29:55.000000000 +0200
++++ gdb-6.8.50.20090803/gdb/linux-nat.c        2009-08-04 06:30:53.000000000 +0200
+@@ -4495,15 +4495,38 @@ linux_xfer_partial (struct target_ops *o
+       offset &= ((ULONGEST) 1 << addr_bit) - 1;
+     }
  
 -#ifndef NATIVE_XFER_UNWIND_TABLE
 -  /* FIXME: For ia64, we cannot currently use linux_proc_xfer_memory
@@ -55,10 +55,10 @@ Index: gdb-6.8.50.20090226/gdb/linux-nat.c
  
    return super_xfer_partial (ops, object, annex, readbuf, writebuf,
                             offset, len);
-Index: gdb-6.8.50.20090226/gdb/ia64-linux-nat.c
+Index: gdb-6.8.50.20090803/gdb/ia64-linux-nat.c
 ===================================================================
---- gdb-6.8.50.20090226.orig/gdb/ia64-linux-nat.c      2009-02-23 01:03:49.000000000 +0100
-+++ gdb-6.8.50.20090226/gdb/ia64-linux-nat.c   2009-02-28 07:18:10.000000000 +0100
+--- gdb-6.8.50.20090803.orig/gdb/ia64-linux-nat.c      2009-02-23 01:03:49.000000000 +0100
++++ gdb-6.8.50.20090803/gdb/ia64-linux-nat.c   2009-08-04 06:30:53.000000000 +0200
 @@ -809,6 +809,64 @@ ia64_linux_xfer_partial (struct target_o
  
  void _initialize_ia64_linux_nat (void);
diff --git a/gdb-6.3-ia64-sigtramp-fp-20050926.patch b/gdb-6.3-ia64-sigtramp-fp-20050926.patch
deleted file mode 100644 (file)
index 528afbf..0000000
+++ /dev/null
@@ -1,163 +0,0 @@
-2005-09-27  Jeff Johnston  <jjohnstn@redhat.com>
-
-       * libunwind-frame.c (libunwind_frame_cache): Save the current
-       stack pointer in the cache.
-       (libunwind_sigtramp_frame_this_id): New function.
-       (libunwind_sigtramp_frame_unwind): New unwinder.
-       (libunwind_sigtramp_frame_sniffer): Return 
-       libunwind_sigtramp_frame_unwind address.
-       * libunwind-frame.h (libunwind_sigtramp_frame_this_id): New
-       prototype.
-       * ia64-tdep.c (ia64_libunwind_sigtramp_frame_this_id): Calculate
-       the base address using the current stack pointer plus a fixed
-       offset.
-
-2007-10-14  Jan Kratochvil  <jan.kratochvil@redhat.com>
-
-       Port to GDB-6.7.
-
-2008-02-24  Jan Kratochvil  <jan.kratochvil@redhat.com>
-
-       Port to GDB-6.8pre.
-
-2008-04-16  Yi Zhan  <yi.zhan@intel.com>
-
-       Fix a compilation error on a typo.
-
-Index: gdb-6.8.50.20081128/gdb/libunwind-frame.c
-===================================================================
---- gdb-6.8.50.20081128.orig/gdb/libunwind-frame.c     2008-05-06 20:37:46.000000000 +0200
-+++ gdb-6.8.50.20081128/gdb/libunwind-frame.c  2008-12-02 19:46:26.000000000 +0100
-@@ -61,6 +61,7 @@ static unw_word_t (*unw_find_dyn_list_p)
- struct libunwind_frame_cache
- {
-   CORE_ADDR base;
-+  CORE_ADDR sp;
-   CORE_ADDR func_addr;
-   unw_cursor_t cursor;
-   unw_addr_space_t as;
-@@ -133,6 +134,7 @@ libunwind_frame_cache (struct frame_info
-   unw_accessors_t *acc;
-   unw_addr_space_t as;
-   unw_word_t fp;
-+  unw_word_t sp;
-   unw_regnum_t uw_sp_regnum;
-   struct libunwind_frame_cache *cache;
-   struct libunwind_descr *descr;
-@@ -174,14 +176,30 @@ libunwind_frame_cache (struct frame_info
-                                : __LITTLE_ENDIAN);
-   unw_init_remote_p (&cache->cursor, as, this_frame);
-+
-+  /* For the base address, we have a small problem.  The majority
-+     of the time, we can get the stack pointer of the previous
-+     frame to use as a frame pointer.  In the case where we have
-+     a signal trampoline, the stack may change due to a sigaltstack
-+     being set up.  In that case, the normal mechanism will give us
-+     an address in the regular stack which is not at the end of the
-+     sigaltstack as we want.  To handle this, we record the stack
-+     address so the caller may calculate a more correct base address
-+     to use.  */
-+  uw_sp_regnum = descr->gdb2uw (gdbarch_sp_regnum (gdbarch));
-+  ret = unw_get_reg_p (&cache->cursor, uw_sp_regnum, &sp);
-+  if (ret < 0)
-+    {
-+      unw_destroy_addr_space_p (as);
-+      error (_("Can't get libunwind sp register."));
-+    }
-+
-   if (unw_step_p (&cache->cursor) < 0)
-     {
-       unw_destroy_addr_space_p (as);
-       return NULL;
-     }
--  /* To get base address, get sp from previous frame.  */
--  uw_sp_regnum = descr->gdb2uw (gdbarch_sp_regnum (gdbarch));
-   ret = unw_get_reg_p (&cache->cursor, uw_sp_regnum, &fp);
-   if (ret < 0)
-     {
-@@ -189,6 +207,7 @@ libunwind_frame_cache (struct frame_info
-       error (_("Can't get libunwind sp register."));
-     }
-+  cache->sp = (CORE_ADDR)sp;
-   cache->base = (CORE_ADDR)fp;
-   cache->as = as;
-@@ -376,6 +395,31 @@ libunwind_search_unwind_table (void *as,
-                                   di, pi, need_unwind_info, args);
- }
-+void
-+libunwind_sigtramp_frame_this_id (struct frame_info *this_frame, 
-+                                void **this_cache,
-+                                struct frame_id *this_id)
-+{
-+  struct libunwind_frame_cache *cache =
-+    libunwind_frame_cache (this_frame, this_cache);
-+
-+  /* Unlike a regular frame, we can't use the normal frame pointer
-+     mechanism because a sigaltstack may have been used.  Instead,
-+     we return the current stack pointer for the caller to use
-+     to calculate the base address.  */
-+  if (cache != NULL)
-+    (*this_id) = frame_id_build (cache->sp, cache->func_addr);
-+  else
-+    (*this_id) = null_frame_id;
-+}
-+
-+static const struct frame_unwind libunwind_sigtramp_frame_unwind =
-+{
-+  SIGTRAMP_FRAME,
-+  libunwind_sigtramp_frame_this_id,
-+  libunwind_frame_prev_register
-+};
-+
- /* Verify if we are in a sigtramp frame and we can use libunwind to unwind.  */
- int
- libunwind_sigtramp_frame_sniffer (const struct frame_unwind *self,
-Index: gdb-6.8.50.20081128/gdb/libunwind-frame.h
-===================================================================
---- gdb-6.8.50.20081128.orig/gdb/libunwind-frame.h     2008-05-06 20:37:46.000000000 +0200
-+++ gdb-6.8.50.20081128/gdb/libunwind-frame.h  2008-12-02 19:38:55.000000000 +0100
-@@ -52,6 +52,9 @@ void libunwind_frame_set_descr (struct g
- void libunwind_frame_this_id (struct frame_info *this_frame, void **this_cache,
-                             struct frame_id *this_id);
-+void libunwind_sigtramp_frame_this_id (struct frame_info *this_frame, 
-+                                     void **this_cache,
-+                                     struct frame_id *this_id);
- struct value *libunwind_frame_prev_register (struct frame_info *this_frame,
-                                              void **this_cache, int regnum);
- void libunwind_frame_dealloc_cache (struct frame_info *self, void *cache);
-Index: gdb-6.8.50.20081128/gdb/ia64-tdep.c
-===================================================================
---- gdb-6.8.50.20081128.orig/gdb/ia64-tdep.c   2008-12-02 19:04:32.000000000 +0100
-+++ gdb-6.8.50.20081128/gdb/ia64-tdep.c        2008-12-02 21:09:46.000000000 +0100
-@@ -2964,7 +2964,7 @@ ia64_libunwind_sigtramp_frame_this_id (s
-   struct frame_id id;
-   CORE_ADDR prev_ip;
--  libunwind_frame_this_id (this_frame, this_cache, &id);
-+  libunwind_sigtramp_frame_this_id (this_frame, this_cache, &id);
-   if (frame_id_eq (id, null_frame_id))
-     {
-       (*this_id) = null_frame_id;
-@@ -2976,8 +2976,14 @@ ia64_libunwind_sigtramp_frame_this_id (s
-   get_frame_register (this_frame, IA64_BSP_REGNUM, buf);
-   bsp = extract_unsigned_integer (buf, 8);
--  /* For a sigtramp frame, we don't make the check for previous ip being 0.  */
--  (*this_id) = frame_id_build_special (id.stack_addr, id.code_addr, bsp);
-+  /* For a sigtramp frame, we don't make the check for previous ip being 0.  
-+     We also must calculate the frame pointer because libunwind will give
-+     us back the current stack pointer instead of the frame pointer since
-+     it cannot figure this out when in a sigaltstack.  We make a basic
-+     assumption of 16 (default size) + 8 bytes for sigcontext address.
-+     FIXME: if libunwind were to export the frame pointer address, we
-+            could eliminate the assumption and get the actual value.  */
-+  (*this_id) = frame_id_build_special (id.stack_addr + 24, id.code_addr, bsp);
-   if (gdbarch_debug >= 1)
-     fprintf_unfiltered (gdb_stdlog,
index 74d793c7e02ec633660df4e089ad12e0a6bdf5af..5f33571102fedec47b8c27c528832cb2e250f2f9 100644 (file)
@@ -5,8 +5,10 @@
        * gdb.cp/b146835b.cc: Ditto.
        * gdb.cp/b146835.h: Ditto.
 
---- gdb-6.3/gdb/testsuite/gdb.cp/b146835b.cc.fix3      2005-07-26 16:47:12.000000000 -0400
-+++ gdb-6.3/gdb/testsuite/gdb.cp/b146835b.cc   2005-07-26 16:53:31.000000000 -0400
+Index: gdb-6.8.50.20090811/gdb/testsuite/gdb.cp/b146835b.cc
+===================================================================
+--- /dev/null  1970-01-01 00:00:00.000000000 +0000
++++ gdb-6.8.50.20090811/gdb/testsuite/gdb.cp/b146835b.cc       2009-08-12 06:07:50.000000000 +0200
 @@ -0,0 +1,11 @@
 +#include "b146835.h"
 +
 +void A::funcD (class E *e, class D *d) {}
 +void A::funcE (E *e, D *d) {}
 +void A::funcF (unsigned long x, D *d) {}
---- gdb-6.3/gdb/testsuite/gdb.cp/b146835.cc.fix3       2005-07-26 16:47:20.000000000 -0400
-+++ gdb-6.3/gdb/testsuite/gdb.cp/b146835.cc    2005-07-26 16:46:50.000000000 -0400
+Index: gdb-6.8.50.20090811/gdb/testsuite/gdb.cp/b146835.cc
+===================================================================
+--- /dev/null  1970-01-01 00:00:00.000000000 +0000
++++ gdb-6.8.50.20090811/gdb/testsuite/gdb.cp/b146835.cc        2009-08-12 06:07:50.000000000 +0200
 @@ -0,0 +1,32 @@
 +#include "b146835.h"
 +#include <iostream>
 +   f.foo();
 +}
 +
---- gdb-6.3/gdb/testsuite/gdb.cp/b146835.exp.fix3      2005-07-26 16:47:26.000000000 -0400
-+++ gdb-6.3/gdb/testsuite/gdb.cp/b146835.exp   2005-07-26 16:46:50.000000000 -0400
-@@ -0,0 +1,55 @@
+Index: gdb-6.8.50.20090811/gdb/testsuite/gdb.cp/b146835.exp
+===================================================================
+--- /dev/null  1970-01-01 00:00:00.000000000 +0000
++++ gdb-6.8.50.20090811/gdb/testsuite/gdb.cp/b146835.exp       2009-08-12 06:58:28.000000000 +0200
+@@ -0,0 +1,54 @@
 +# This testcase is part of GDB, the GNU debugger.
 +
 +# Copyright 2005 Free Software Foundation, Inc.
 +gdb_continue_to_breakpoint "First line foo"
 +
 +# Verify that we can access the inherited member d
-+gdb_test "p d" ".*(struct D \*.).*0x0" "Verify inherited member d accessible"
-+
---- gdb-6.3/gdb/testsuite/gdb.cp/b146835.h.fix3        2005-07-26 16:47:36.000000000 -0400
-+++ gdb-6.3/gdb/testsuite/gdb.cp/b146835.h     2005-07-26 16:53:18.000000000 -0400
++gdb_test "p d" " = \\(D \\*\\) *0x0" "Verify inherited member d accessible"
+Index: gdb-6.8.50.20090811/gdb/testsuite/gdb.cp/b146835.h
+===================================================================
+--- /dev/null  1970-01-01 00:00:00.000000000 +0000
++++ gdb-6.8.50.20090811/gdb/testsuite/gdb.cp/b146835.h 2009-08-12 06:07:50.000000000 +0200
 @@ -0,0 +1,36 @@
 +
 +class A {
index 73e8139bbe31ff9fd2621952c74b383250450733..2876b750cef09b47ad5146dd4cb0445910ddb3d4 100644 (file)
 
        Port to GDB-6.7.
 
-Index: gdb-6.8.50.20090226/gdb/symfile-mem.c
+Index: gdb-6.8.50.20090909/gdb/symfile-mem.c
 ===================================================================
---- gdb-6.8.50.20090226.orig/gdb/symfile-mem.c 2009-02-21 17:14:49.000000000 +0100
-+++ gdb-6.8.50.20090226/gdb/symfile-mem.c      2009-02-28 07:22:09.000000000 +0100
+--- gdb-6.8.50.20090909.orig/gdb/symfile-mem.c 2009-07-02 19:21:06.000000000 +0200
++++ gdb-6.8.50.20090909/gdb/symfile-mem.c      2009-09-09 19:06:57.000000000 +0200
 @@ -56,6 +56,14 @@
  #include "elf/common.h"
  
@@ -53,11 +53,11 @@ Index: gdb-6.8.50.20090226/gdb/symfile-mem.c
    if (nbfd == NULL)
      error (_("Failed to read a valid object file image from memory."));
  
-Index: gdb-6.8.50.20090226/gdb/target.c
+Index: gdb-6.8.50.20090909/gdb/target.c
 ===================================================================
---- gdb-6.8.50.20090226.orig/gdb/target.c      2009-02-27 00:04:32.000000000 +0100
-+++ gdb-6.8.50.20090226/gdb/target.c   2009-02-28 07:22:09.000000000 +0100
-@@ -57,7 +57,7 @@ static int nosymbol (char *, CORE_ADDR *
+--- gdb-6.8.50.20090909.orig/gdb/target.c      2009-09-09 19:05:56.000000000 +0200
++++ gdb-6.8.50.20090909/gdb/target.c   2009-09-09 19:08:11.000000000 +0200
+@@ -59,7 +59,7 @@ static int nosymbol (char *, CORE_ADDR *
  
  static void tcomplain (void) ATTR_NORETURN;
  
@@ -66,16 +66,16 @@ Index: gdb-6.8.50.20090226/gdb/target.c
  
  static int return_zero (void);
  
-@@ -286,7 +286,7 @@ target_create_inferior (char *exec_file,
+@@ -492,7 +492,7 @@ target_terminal_inferior (void)
+   (*current_target.to_terminal_inferior) ();
  }
  
 -static int
 +static LONGEST
  nomemory (CORE_ADDR memaddr, char *myaddr, int len, int write,
          struct target_ops *t)
  {
-@@ -507,7 +507,7 @@ update_current_target (void)
+@@ -711,7 +711,7 @@ update_current_target (void)
            (void (*) (struct regcache *))
            noprocess);
    de_fault (deprecated_xfer_memory,
@@ -84,25 +84,34 @@ Index: gdb-6.8.50.20090226/gdb/target.c
            nomemory);
    de_fault (to_files_info,
            (void (*) (struct target_ops *))
-@@ -1237,7 +1237,7 @@ target_xfer_partial (struct target_ops *
+@@ -1443,7 +1443,7 @@ target_xfer_partial (struct target_ops *
     it makes no progress, and then return how much was transferred). */
  
  int
 -target_read_memory (CORE_ADDR memaddr, gdb_byte *myaddr, int len)
 +target_read_memory (CORE_ADDR memaddr, gdb_byte *myaddr, LONGEST len)
  {
-   if (target_read (&current_target, TARGET_OBJECT_MEMORY, NULL,
-                  myaddr, memaddr, len) == len)
-@@ -1247,7 +1247,7 @@ target_read_memory (CORE_ADDR memaddr, g
+   /* Dispatch to the topmost target, not the flattened current_target.
+      Memory accesses check target->to_has_(all_)memory, and the
+@@ -1459,7 +1459,7 @@ target_read_memory (CORE_ADDR memaddr, g
+    the target's stack.  This may trigger different cache behavior.  */
+ int
+-target_read_stack (CORE_ADDR memaddr, gdb_byte *myaddr, int len)
++target_read_stack (CORE_ADDR memaddr, gdb_byte *myaddr, LONGEST len)
+ {
+   /* Dispatch to the topmost target, not the flattened current_target.
+      Memory accesses check target->to_has_(all_)memory, and the
+@@ -1473,7 +1473,7 @@ target_read_stack (CORE_ADDR memaddr, gd
  }
  
  int
 -target_write_memory (CORE_ADDR memaddr, const gdb_byte *myaddr, int len)
 +target_write_memory (CORE_ADDR memaddr, const gdb_byte *myaddr, LONGEST len)
  {
-   if (target_write (&current_target, TARGET_OBJECT_MEMORY, NULL,
-                   myaddr, memaddr, len) == len)
-@@ -2777,8 +2777,8 @@ debug_to_prepare_to_store (struct regcac
+   /* Dispatch to the topmost target, not the flattened current_target.
+      Memory accesses check target->to_has_(all_)memory, and the
+@@ -2964,8 +2964,8 @@ debug_to_prepare_to_store (struct regcac
    fprintf_unfiltered (gdb_stdlog, "target_prepare_to_store ()\n");
  }
  
@@ -113,22 +122,22 @@ Index: gdb-6.8.50.20090226/gdb/target.c
                              int write, struct mem_attrib *attrib,
                              struct target_ops *target)
  {
-@@ -2788,8 +2788,8 @@ deprecated_debug_xfer_memory (CORE_ADDR 
+@@ -2975,8 +2975,8 @@ deprecated_debug_xfer_memory (CORE_ADDR 
                                                attrib, target);
  
    fprintf_unfiltered (gdb_stdlog,
 -                    "target_xfer_memory (%s, xxx, %d, %s, xxx) = %d",
--                    paddress (memaddr), len, write ? "write" : "read",
+-                    paddress (target_gdbarch, memaddr), len,
 +                    "target_xfer_memory (%s, xxx, %ld, %s, xxx) = %d",
-+                    paddress (memaddr), (long) len, write ? "write" : "read",
-                       retval);
++                    paddress (target_gdbarch, memaddr), (long) len,
+                     write ? "write" : "read", retval);
  
    if (retval > 0)
-Index: gdb-6.8.50.20090226/gdb/target.h
+Index: gdb-6.8.50.20090909/gdb/target.h
 ===================================================================
---- gdb-6.8.50.20090226.orig/gdb/target.h      2009-02-27 00:04:32.000000000 +0100
-+++ gdb-6.8.50.20090226/gdb/target.h   2009-02-28 07:22:09.000000000 +0100
-@@ -376,10 +376,10 @@ struct target_ops
+--- gdb-6.8.50.20090909.orig/gdb/target.h      2009-09-09 19:05:56.000000000 +0200
++++ gdb-6.8.50.20090909/gdb/target.h   2009-09-09 19:07:36.000000000 +0200
+@@ -366,10 +366,10 @@ struct target_ops
         NOTE: cagney/2004-10-01: This has been entirely superseeded by
         to_xfer_partial and inferior inheritance.  */
  
@@ -142,76 +151,73 @@ Index: gdb-6.8.50.20090226/gdb/target.h
 +                                     struct target_ops *target);
  
      void (*to_files_info) (struct target_ops *);
-     int (*to_insert_breakpoint) (struct bp_target_info *);
-@@ -679,13 +679,14 @@ extern DCACHE *target_dcache;
+     int (*to_insert_breakpoint) (struct gdbarch *, struct bp_target_info *);
+@@ -680,12 +680,12 @@ extern void target_dcache_invalidate (vo
  
  extern int target_read_string (CORE_ADDR, char **, int, int *);
  
 -extern int target_read_memory (CORE_ADDR memaddr, gdb_byte *myaddr, int len);
-+extern int target_read_memory (CORE_ADDR memaddr, gdb_byte *myaddr,
-+                             LONGEST len);
++extern int target_read_memory (CORE_ADDR memaddr, gdb_byte *myaddr, LONGEST len);
+-extern int target_read_stack (CORE_ADDR memaddr, gdb_byte *myaddr, int len);
++extern int target_read_stack (CORE_ADDR memaddr, gdb_byte *myaddr, LONGEST len);
  
  extern int target_write_memory (CORE_ADDR memaddr, const gdb_byte *myaddr,
 -                              int len);
 +                              LONGEST len);
  
--extern int xfer_memory (CORE_ADDR, gdb_byte *, int, int,
--                      struct mem_attrib *, struct target_ops *);
-+extern LONGEST xfer_memory (CORE_ADDR, gdb_byte *, LONGEST, int,
-+                          struct mem_attrib *, struct target_ops *);
  /* Fetches the target's memory map.  If one is found it is sorted
     and returned, after some consistency checking.  Otherwise, NULL
-Index: gdb-6.8.50.20090226/gdb/dcache.c
+Index: gdb-6.8.50.20090909/gdb/dcache.c
 ===================================================================
---- gdb-6.8.50.20090226.orig/gdb/dcache.c      2009-01-03 06:57:51.000000000 +0100
-+++ gdb-6.8.50.20090226/gdb/dcache.c   2009-02-28 07:22:09.000000000 +0100
-@@ -524,9 +524,9 @@ dcache_free (DCACHE *dcache)
+--- gdb-6.8.50.20090909.orig/gdb/dcache.c      2009-08-31 22:18:45.000000000 +0200
++++ gdb-6.8.50.20090909/gdb/dcache.c   2009-09-09 19:09:21.000000000 +0200
+@@ -390,10 +390,10 @@ dcache_free (DCACHE *dcache)
  
-    This routine is indended to be called by remote_xfer_ functions. */
+    The meaning of the result is the same as for target_write.  */
  
 -int
 +LONGEST
- dcache_xfer_memory (DCACHE *dcache, CORE_ADDR memaddr, gdb_byte *myaddr,
+ dcache_xfer_memory (struct target_ops *ops, DCACHE *dcache,
+                   CORE_ADDR memaddr, gdb_byte *myaddr,
 -                  int len, int should_write)
 +                  LONGEST len, int should_write)
  {
    int i;
-   int (*xfunc) (DCACHE *dcache, CORE_ADDR addr, gdb_byte *ptr);
-Index: gdb-6.8.50.20090226/gdb/dcache.h
+   int res;
+Index: gdb-6.8.50.20090909/gdb/dcache.h
 ===================================================================
---- gdb-6.8.50.20090226.orig/gdb/dcache.h      2009-01-03 06:57:51.000000000 +0100
-+++ gdb-6.8.50.20090226/gdb/dcache.h   2009-02-28 07:22:09.000000000 +0100
-@@ -35,7 +35,7 @@ void dcache_free (DCACHE *);
+--- gdb-6.8.50.20090909.orig/gdb/dcache.h      2009-08-31 22:18:45.000000000 +0200
++++ gdb-6.8.50.20090909/gdb/dcache.h   2009-09-09 19:08:54.000000000 +0200
+@@ -35,8 +35,8 @@ void dcache_free (DCACHE *);
  
  /* Simple to call from <remote>_xfer_memory */
  
--int dcache_xfer_memory (DCACHE *cache, CORE_ADDR mem, gdb_byte *my,
--                      int len, int should_write);
-+LONGEST dcache_xfer_memory (DCACHE *cache, CORE_ADDR mem, gdb_byte *my,
-+                          LONGEST len, int should_write);
+-int dcache_xfer_memory (struct target_ops *ops, DCACHE *cache, CORE_ADDR mem,
+-                      gdb_byte *my, int len, int should_write);
++LONGEST dcache_xfer_memory (struct target_ops *ops, DCACHE *cache, CORE_ADDR mem,
++                      gdb_byte *my, LONGEST len, int should_write);
  
- #endif /* DCACHE_H */
-Index: gdb-6.8.50.20090226/gdb/exec.c
+ void dcache_update (DCACHE *dcache, CORE_ADDR memaddr, gdb_byte *myaddr,
+                   int len);
+Index: gdb-6.8.50.20090909/gdb/exec.c
 ===================================================================
---- gdb-6.8.50.20090226.orig/gdb/exec.c        2009-02-22 20:35:47.000000000 +0100
-+++ gdb-6.8.50.20090226/gdb/exec.c     2009-02-28 07:22:09.000000000 +0100
-@@ -464,8 +464,8 @@ map_vmap (bfd *abfd, bfd *arch)
-    The same routine is used to handle both core and exec files;
-    we just tail-call it with more arguments to select between them.  */
+--- gdb-6.8.50.20090909.orig/gdb/exec.c        2009-07-02 19:21:06.000000000 +0200
++++ gdb-6.8.50.20090909/gdb/exec.c     2009-09-09 19:06:57.000000000 +0200
+@@ -560,7 +560,7 @@ map_vmap (bfd *abfd, bfd *arch)
+ }
\f
  
 -int
--xfer_memory (CORE_ADDR memaddr, gdb_byte *myaddr, int len, int write,
 +LONGEST
-+xfer_memory (CORE_ADDR memaddr, gdb_byte *myaddr, LONGEST len, int write,
-            struct mem_attrib *attrib, struct target_ops *target)
- {
-   int res;
-Index: gdb-6.8.50.20090226/gdb/linux-nat.c
+ section_table_xfer_memory_partial (gdb_byte *readbuf, const gdb_byte *writebuf,
+                                  ULONGEST offset, LONGEST len,
+                                  struct target_section *sections,
+Index: gdb-6.8.50.20090909/gdb/linux-nat.c
 ===================================================================
---- gdb-6.8.50.20090226.orig/gdb/linux-nat.c   2009-02-28 07:22:02.000000000 +0100
-+++ gdb-6.8.50.20090226/gdb/linux-nat.c        2009-02-28 07:22:32.000000000 +0100
-@@ -4407,7 +4407,7 @@ linux_xfer_partial (struct target_ops *o
+--- gdb-6.8.50.20090909.orig/gdb/linux-nat.c   2009-09-09 19:06:46.000000000 +0200
++++ gdb-6.8.50.20090909/gdb/linux-nat.c        2009-09-09 19:06:57.000000000 +0200
+@@ -4622,7 +4622,7 @@ linux_xfer_partial (struct target_ops *o
  #endif
        if (iterate_over_lwps (ia64_linux_check_stack_region, &range) != NULL)
        { /* This region contains ia64 rse registers, we have to re-read.  */
@@ -220,10 +226,10 @@ Index: gdb-6.8.50.20090226/gdb/linux-nat.c
  
          /* Re-read register stack area.  */
          xxfer = super_xfer_partial (ops, object, annex,
-Index: gdb-6.8.50.20090226/gdb/remote.c
+Index: gdb-6.8.50.20090909/gdb/remote.c
 ===================================================================
---- gdb-6.8.50.20090226.orig/gdb/remote.c      2009-02-25 03:14:22.000000000 +0100
-+++ gdb-6.8.50.20090226/gdb/remote.c   2009-02-28 07:22:09.000000000 +0100
+--- gdb-6.8.50.20090909.orig/gdb/remote.c      2009-08-18 18:17:16.000000000 +0200
++++ gdb-6.8.50.20090909/gdb/remote.c   2009-09-09 19:06:57.000000000 +0200
 @@ -25,6 +25,7 @@
  #include "gdb_string.h"
  #include <ctype.h>
@@ -232,7 +238,7 @@ Index: gdb-6.8.50.20090226/gdb/remote.c
  #include "inferior.h"
  #include "bfd.h"
  #include "symfile.h"
-@@ -5683,12 +5684,19 @@ handle_notification (char *buf, size_t l
+@@ -5764,12 +5765,19 @@ handle_notification (char *buf, size_t l
     if SHOULD_WRITE is nonzero.  Returns length of data written or
     read; 0 for error.  TARGET is unused.  */
  
@@ -254,7 +260,7 @@ Index: gdb-6.8.50.20090226/gdb/remote.c
  
    set_general_thread (inferior_ptid);
  
-@@ -5697,7 +5705,7 @@ remote_xfer_memory (CORE_ADDR mem_addr, 
+@@ -5778,7 +5786,7 @@ remote_xfer_memory (CORE_ADDR mem_addr, 
    else
      res = remote_read_bytes (mem_addr, buffer, mem_len);
  
@@ -263,11 +269,11 @@ Index: gdb-6.8.50.20090226/gdb/remote.c
  }
  
  /* Sends a packet with content determined by the printf format string
-Index: gdb-6.8.50.20090226/gdb/remote-sim.c
+Index: gdb-6.8.50.20090909/gdb/remote-sim.c
 ===================================================================
---- gdb-6.8.50.20090226.orig/gdb/remote-sim.c  2009-02-23 19:31:23.000000000 +0100
-+++ gdb-6.8.50.20090226/gdb/remote-sim.c       2009-02-28 07:22:09.000000000 +0100
-@@ -754,11 +754,14 @@ gdbsim_prepare_to_store (struct regcache
+--- gdb-6.8.50.20090909.orig/gdb/remote-sim.c  2009-07-02 19:21:06.000000000 +0200
++++ gdb-6.8.50.20090909/gdb/remote-sim.c       2009-09-09 19:06:57.000000000 +0200
+@@ -752,11 +752,14 @@ gdbsim_prepare_to_store (struct regcache
  
     Returns the number of bytes transferred. */
  
@@ -284,33 +290,16 @@ Index: gdb-6.8.50.20090226/gdb/remote-sim.c
    /* If no program is running yet, then ignore the simulator for
       memory.  Pass the request down to the next target, hopefully
       an exec file.  */
-@@ -774,22 +777,22 @@ gdbsim_xfer_inferior_memory (CORE_ADDR m
-       printf_filtered ("gdbsim_xfer_inferior_memory: myaddr 0x");
-       gdb_print_host_address (myaddr, gdb_stdout);
-       printf_filtered (", memaddr 0x%s, len %d, write %d\n",
--                     paddr_nz (memaddr), len, write);
-+                     paddr_nz (memaddr), xfer_len, write);
-       if (remote_debug && write)
--      dump_mem (myaddr, len);
-+      dump_mem (myaddr, xfer_len);
-     }
-   if (write)
-     {
--      len = sim_write (gdbsim_desc, memaddr, myaddr, len);
-+      xfer_len = sim_write (gdbsim_desc, memaddr, myaddr, xfer_len);
-     }
-   else
-     {
--      len = sim_read (gdbsim_desc, memaddr, myaddr, len);
--      if (remote_debug && len > 0)
--      dump_mem (myaddr, len);
-+      xfer_len = sim_read (gdbsim_desc, memaddr, myaddr, xfer_len);
-+      if (remote_debug && xfer_len > 0)
-+      dump_mem (myaddr, xfer_len);
-     }
--  return len;
-+  return (LONGEST)xfer_len;
- }
+Index: gdb-6.8.50.20090909/gdb/exec.h
+===================================================================
+--- gdb-6.8.50.20090909.orig/gdb/exec.h        2009-06-12 20:38:36.000000000 +0200
++++ gdb-6.8.50.20090909/gdb/exec.h     2009-09-09 19:06:57.000000000 +0200
+@@ -56,7 +56,7 @@ extern int resize_section_table (struct 
+    One, and only one, of readbuf or writebuf must be non-NULL.  */
  
- static void
+-extern int section_table_xfer_memory_partial (gdb_byte *, const gdb_byte *,
++extern LONGEST section_table_xfer_memory_partial (gdb_byte *, const gdb_byte *,
+                                             ULONGEST, LONGEST,
+                                             struct target_section *,
+                                             struct target_section *,
diff --git a/gdb-6.3-linespec-20041213.patch b/gdb-6.3-linespec-20041213.patch
deleted file mode 100644 (file)
index eb373ef..0000000
+++ /dev/null
@@ -1,464 +0,0 @@
-[base]
-
-2007-09-21  Jan Kratochvil  <jan.kratochvil@redhat.com>
-
-       * linespec.c (add_minsym_members): Support also the `$allocate' and
-       `$delete' variants.
-
-2007-10-05  Jan Kratochvil  <jan.kratochvil@redhat.com>
-
-       * linespec.c (add_minsym_members): Support also the `$allocate' and
-       `$delete' variants.
-       (decode_variable): Renamed to ...
-       (decode_variable_1) ... here, its parameter NOT_FOUND_PTR and its
-       exception throwing was moved to ...
-       (decode_variable_not_found): ... a new function here.
-       (decode_variable): New function.
-
-2007-10-31  Jan Kratochvil  <jan.kratochvil@redhat.com>
-
-       Port to GDB-6.7.
-
-[ Remove decode_variable* for GDB-6.8+ as no longer needed.  ]
-
-Index: gdb-6.8.50.20081128/gdb/linespec.c
-===================================================================
---- gdb-6.8.50.20081128.orig/gdb/linespec.c    2008-09-05 13:37:17.000000000 +0200
-+++ gdb-6.8.50.20081128/gdb/linespec.c 2008-12-04 01:43:36.000000000 +0100
-@@ -39,6 +39,7 @@
- #include "interps.h"
- #include "mi/mi-cmds.h"
- #include "target.h"
-+#include "gdb_assert.h"
- /* We share this one with symtab.c, but it is not exported widely. */
-@@ -78,7 +79,8 @@ static struct symtabs_and_lines find_met
- static int collect_methods (char *copy, struct type *t,
-                           struct symbol *sym_class,
--                          struct symbol **sym_arr);
-+                          struct symbol **sym_arr,
-+                          struct minimal_symbol **msym_arr);
- static NORETURN void cplusplus_error (const char *name,
-                                     const char *fmt, ...)
-@@ -87,11 +89,13 @@ static NORETURN void cplusplus_error (co
- static int total_number_of_methods (struct type *type);
- static int find_methods (struct type *, char *,
--                       enum language, struct symbol **);
-+                       enum language, struct symbol **,
-+                       struct minimal_symbol **);
- static int add_matching_methods (int method_counter, struct type *t,
-                                enum language language,
--                               struct symbol **sym_arr);
-+                               struct symbol **sym_arr,
-+                               struct minimal_symbol **msym_arr);
- static int add_constructors (int method_counter, struct type *t,
-                            enum language language,
-@@ -107,6 +111,9 @@ static int is_objc_method_format (const 
- static struct symtabs_and_lines decode_line_2 (struct symbol *[],
-                                              int, int, char ***);
-+static struct symtabs_and_lines decode_line_3 (struct minimal_symbol *[],
-+                                             int, int, char ***);
-+
- static struct symtab *symtab_from_filename (char **argptr,
-                                           char *p, int is_quote_enclosed,
-                                           int *not_found_ptr);
-@@ -196,13 +203,18 @@ total_number_of_methods (struct type *ty
- /* Recursive helper function for decode_line_1.
-    Look for methods named NAME in type T.
-    Return number of matches.
--   Put matches in SYM_ARR, which should have been allocated with
-+   Put symbol matches in SYM_ARR, which should have been allocated with
-    a size of total_number_of_methods (T) * sizeof (struct symbol *).
-+   In a special case where we are looking for constructors, we may
-+   have to return minimal symbols in the array: MSYM_ARR.  This occurs
-+   when the compiler does not generate mangled names for the constructor's
-+   debug info because there are multiple versions of the constructor
-+   (in-charge vs not-in-charge).
-    Note that this function is g++ specific.  */
- static int
- find_methods (struct type *t, char *name, enum language language,
--            struct symbol **sym_arr)
-+            struct symbol **sym_arr, struct minimal_symbol **msym_arr)
- {
-   int i1 = 0;
-   int ibase;
-@@ -244,7 +256,7 @@ find_methods (struct type *t, char *name
-         if (strcmp_iw (name, method_name) == 0)
-           /* Find all the overloaded methods with that name.  */
-           i1 += add_matching_methods (method_counter, t, language,
--                                      sym_arr + i1);
-+                                      sym_arr + i1, msym_arr);
-         else if (strncmp (class_name, name, name_len) == 0
-                  && (class_name[name_len] == '\0'
-                      || class_name[name_len] == '<'))
-@@ -267,21 +279,100 @@ find_methods (struct type *t, char *name
-   if (i1 == 0)
-     for (ibase = 0; ibase < TYPE_N_BASECLASSES (t); ibase++)
-       i1 += find_methods (TYPE_BASECLASS (t, ibase), name,
--                        language, sym_arr + i1);
-+                        language, sym_arr + i1, msym_arr);
-   return i1;
- }
-+static int
-+add_minsym_members (const char *class_name,
-+                  const char *member_name,
-+                  struct minimal_symbol **msym_arr)
-+{
-+  char *completion_name;
-+  char **list;
-+  int i;
-+  int comp_len;
-+  int counter = 0;
-+
-+  /* To find the member, we first cheat and use symbol completion.
-+     This will give us a list of all the member names including
-+     the function signature.  */
-+  completion_name = xmalloc (strlen (class_name) +
-+                           strlen (member_name) + 9);
-+  completion_name[0] = '\'';
-+  strcpy (completion_name+1, class_name);
-+  /* FIXME: make this the language class separator.  */
-+  strcat (completion_name, "::");
-+  strcat (completion_name, member_name);
-+  strcat (completion_name, "(");
-+  list = make_symbol_completion_list (completion_name,
-+                                    completion_name+1);
-+
-+  /* Now that we have the list, we generate an array of their
-+     corresponding minimal symbols.  */
-+  counter = 0;
-+  while (list && list[counter] != NULL)
-+    {
-+      msym_arr[counter] = lookup_minimal_symbol (list[counter], NULL, NULL);
-+      ++counter;
-+    }
-+
-+  xfree (list);
-+
-+  /* In the case of constructors, there may be in-charge vs not-in-charge
-+     constructors.  Check for names with $base which indicates not-in-charge
-+     constructors.  */
-+  comp_len = strlen (completion_name);
-+  strcpy (completion_name + comp_len - 1, "$base(");
-+  list = make_symbol_completion_list (completion_name,
-+                                    completion_name+1);
-+
-+  /* Again we have a list.  Add their minimal symbols to the array.  */
-+  i = 0;
-+  while (list && list[i] != NULL)
-+    {
-+      msym_arr[counter] = lookup_minimal_symbol (list[i++], NULL, NULL);
-+      ++counter;
-+    }
-+  xfree (list);
-+
-+  /* Target also the allocating/deleting variants.  */
-+  if (member_name[0] == '~')
-+    strcpy (completion_name + comp_len - 1, "$delete(");
-+  else
-+    strcpy (completion_name + comp_len - 1, "$allocate(");
-+  list = make_symbol_completion_list (completion_name,
-+                                    completion_name+1);
-+
-+  /* Again we have a list.  Add their minimal symbols to the array.  */
-+  i = 0;
-+  while (list && list[i] != NULL)
-+    {
-+      msym_arr[counter] = lookup_minimal_symbol (list[i++], NULL, NULL);
-+      ++counter;
-+    }
-+  xfree (list);
-+
-+  xfree (completion_name);
-+
-+  return counter;
-+}
-+
- /* Add the symbols associated to methods of the class whose type is T
-    and whose name matches the method indexed by METHOD_COUNTER in the
-    array SYM_ARR.  Return the number of methods added.  */
- static int
- add_matching_methods (int method_counter, struct type *t,
--                    enum language language, struct symbol **sym_arr)
-+                    enum language language, struct symbol **sym_arr,
-+                    struct minimal_symbol **msym_arr)
- {
-   int field_counter;
-   int i1 = 0;
-+  int cons_index = 0;
-+  char *class_name = type_name_no_tag (t);
-+  char **list = NULL;
-   for (field_counter = TYPE_FN_FIELDLIST_LENGTH (t, method_counter) - 1;
-        field_counter >= 0;
-@@ -306,6 +397,16 @@ add_matching_methods (int method_counter
-       else
-       phys_name = TYPE_FN_FIELD_PHYSNAME (f, field_counter);
-+      /* Check for special case of looking for member that
-+       doesn't have a mangled name provided.  This will happen
-+       when we have in-charge and not-in-charge constructors.
-+       Since we don't have a mangled name to work with, if we
-+       look for the symbol, we can only find the class itself.
-+       We can find the information we need in the minimal symbol
-+       table which has the full member name information we need.  */
-+      if (strlen (phys_name) <= strlen (class_name))
-+      return add_minsym_members (class_name, phys_name, msym_arr);
-+
-       /* Destructor is handled by caller, don't add it to
-        the list.  */
-       if (is_destructor_name (phys_name) != 0)
-@@ -330,6 +431,9 @@ add_matching_methods (int method_counter
-       }
-     }
-+  if (list)
-+    xfree (list);
-+
-   return i1;
- }
-@@ -630,6 +734,146 @@ See set/show multiple-symbol."));
-   discard_cleanups (old_chain);
-   return return_values;
- }
-+
-+/* Given a list of NELTS minimal symbols in MSYM_ARR, return a list of lines to
-+   operate on (ask user if necessary).
-+   If CANONICAL is non-NULL return a corresponding array of mangled names
-+   as canonical line specs there.  */
-+
-+static struct symtabs_and_lines
-+decode_line_3 (struct minimal_symbol *msym_arr[],
-+             int nelts, int funfirstline,
-+             char ***canonical)
-+{
-+  struct symtabs_and_lines values, return_values;
-+  char *args, *arg1;
-+  int i;
-+  char *prompt;
-+  char *symname;
-+  struct cleanup *old_chain;
-+  char **canonical_arr = (char **) NULL;
-+
-+  values.sals = (struct symtab_and_line *)
-+    alloca (nelts * sizeof (struct symtab_and_line));
-+  return_values.sals = (struct symtab_and_line *)
-+    xmalloc (nelts * sizeof (struct symtab_and_line));
-+  old_chain = make_cleanup (xfree, return_values.sals);
-+
-+  if (canonical)
-+    {
-+      canonical_arr = (char **) xmalloc (nelts * sizeof (char *));
-+      make_cleanup (xfree, canonical_arr);
-+      memset (canonical_arr, 0, nelts * sizeof (char *));
-+      *canonical = canonical_arr;
-+    }
-+
-+  i = 0;
-+  printf_unfiltered ("[0] cancel\n[1] all\n");
-+  while (i < nelts)
-+    {
-+      init_sal (&return_values.sals[i]);      /* Initialize to zeroes.  */
-+      init_sal (&values.sals[i]);
-+      if (msym_arr[i])
-+      {
-+        struct symtabs_and_lines msal = minsym_found (funfirstline,
-+                                                      msym_arr[i]);
-+        memcpy (&values.sals[i], &msal.sals[0],
-+                sizeof (struct symtab_and_line));
-+        if (values.sals[i].symtab)
-+          printf_unfiltered ("[%d] %s at %s:%d\n",
-+                             (i + 2),
-+                             SYMBOL_PRINT_NAME (msym_arr[i]),
-+                             values.sals[i].symtab->filename,
-+                             values.sals[i].line);
-+        else
-+          printf_unfiltered ("[%d] %s at ?FILE:%d [No symtab? Probably broken debug info...]\n",
-+                             (i + 2),
-+                             SYMBOL_PRINT_NAME (msym_arr[i]),
-+                             values.sals[i].line);
-+
-+      }
-+      else
-+      printf_unfiltered ("?HERE\n");
-+      i++;
-+    }
-+
-+  prompt = getenv ("PS2");
-+  if (prompt == NULL)
-+    {
-+      prompt = "> ";
-+    }
-+  args = command_line_input (prompt, 0, "overload-choice");
-+
-+  if (args == 0 || *args == 0)
-+    error_no_arg ("one or more choice numbers");
-+
-+  i = 0;
-+  while (*args)
-+    {
-+      int num;
-+
-+      arg1 = args;
-+      while (*arg1 >= '0' && *arg1 <= '9')
-+      arg1++;
-+      if (*arg1 && *arg1 != ' ' && *arg1 != '\t')
-+      error ("Arguments must be choice numbers.");
-+
-+      num = atoi (args);
-+
-+      if (num == 0)
-+      error ("canceled");
-+      else if (num == 1)
-+      {
-+        if (canonical_arr)
-+          {
-+            for (i = 0; i < nelts; i++)
-+              {
-+                if (canonical_arr[i] == NULL)
-+                  {
-+                    symname = SYMBOL_LINKAGE_NAME (msym_arr[i]);
-+                    canonical_arr[i] = savestring (symname, strlen (symname));
-+                  }
-+              }
-+          }
-+        memcpy (return_values.sals, values.sals,
-+                (nelts * sizeof (struct symtab_and_line)));
-+        return_values.nelts = nelts;
-+        discard_cleanups (old_chain);
-+        return return_values;
-+      }
-+
-+      if (num >= nelts + 2)
-+      {
-+        printf_unfiltered ("No choice number %d.\n", num);
-+      }
-+      else
-+      {
-+        num -= 2;
-+        if (values.sals[num].pc)
-+          {
-+            if (canonical_arr)
-+              {
-+                symname = SYMBOL_LINKAGE_NAME (msym_arr[num]);
-+                make_cleanup (xfree, symname);
-+                canonical_arr[i] = savestring (symname, strlen (symname));
-+              }
-+            return_values.sals[i++] = values.sals[num];
-+            values.sals[num].pc = 0;
-+          }
-+        else
-+          {
-+            printf_unfiltered ("duplicate request for %d ignored.\n", num);
-+          }
-+      }
-+
-+      args = arg1;
-+      while (*args == ' ' || *args == '\t')
-+      args++;
-+    }
-+  return_values.nelts = i;
-+  discard_cleanups (old_chain);
-+  return return_values;
-+}
\f
- /* The parser of linespec itself. */
-@@ -1438,35 +1682,47 @@ find_method (int funfirstline, char ***c
-   struct symbol **sym_arr =  alloca (total_number_of_methods (t)
-                                    * sizeof (struct symbol *));
-+  struct minimal_symbol **msym_arr =  alloca (total_number_of_methods (t)
-+                                   * sizeof (struct minimal_symbol *));
-+
-+  msym_arr[0] = NULL;
-+
-   /* Find all methods with a matching name, and put them in
-      sym_arr.  */
--  i1 = collect_methods (copy, t, sym_class, sym_arr);
-+  i1 = collect_methods (copy, t, sym_class, sym_arr, msym_arr);
-   if (i1 == 1)
-     {
-       /* There is exactly one field with that name.  */
--      sym = sym_arr[0];
--
--      if (sym && SYMBOL_CLASS (sym) == LOC_BLOCK)
--      {
--        values.sals = (struct symtab_and_line *)
--          xmalloc (sizeof (struct symtab_and_line));
--        values.nelts = 1;
--        values.sals[0] = find_function_start_sal (sym,
--                                                  funfirstline);
--      }
-+      if (msym_arr[0] != NULL)
-+      return minsym_found (funfirstline, msym_arr[0]);
-       else
-       {
--        values.sals = NULL;
--        values.nelts = 0;
-+          sym = sym_arr[0];
-+
-+          if (sym && SYMBOL_CLASS (sym) == LOC_BLOCK)
-+          {
-+            values.sals = (struct symtab_and_line *)
-+              xmalloc (sizeof (struct symtab_and_line));
-+            values.nelts = 1;
-+            values.sals[0] = find_function_start_sal (sym,
-+                                                      funfirstline);
-+          }
-+          else
-+          {
-+            values.sals = NULL;
-+            values.nelts = 0;
-+          }
-+          return values;
-       }
--      return values;
-     }
-   if (i1 > 0)
-     {
-       /* There is more than one field with that name
-        (overloaded).  Ask the user which one to use.  */
-+      if (msym_arr[0] != NULL)
-+      return decode_line_3 (msym_arr, i1, funfirstline, canonical);
-       return decode_line_2 (sym_arr, i1, funfirstline, canonical);
-     }
-   else
-@@ -1493,11 +1748,12 @@ find_method (int funfirstline, char ***c
- }
- /* Find all methods named COPY in the class whose type is T, and put
--   them in SYM_ARR.  Return the number of methods found.  */
-+   them in SYM_ARR or MSYM_ARR.  Return the number of methods found.  */
- static int
- collect_methods (char *copy, struct type *t,
--               struct symbol *sym_class, struct symbol **sym_arr)
-+               struct symbol *sym_class, struct symbol **sym_arr,
-+               struct minimal_symbol **msym_arr)
- {
-   int i1 = 0; /*  Counter for the symbol array.  */
-@@ -1518,7 +1774,7 @@ collect_methods (char *copy, struct type
-       }
-     }
-   else
--    i1 = find_methods (t, copy, SYMBOL_LANGUAGE (sym_class), sym_arr);
-+    i1 = find_methods (t, copy, SYMBOL_LANGUAGE (sym_class), sym_arr, msym_arr);
-   return i1;
- }
index 8b4a8c8a8be0e5f689b36ffd85a3a818c656e69c..73d24464c15f759a9da77de1f55bb024e32b4ed3 100644 (file)
@@ -1,7 +1,9 @@
---- /dev/null  2008-05-02 23:36:22.370004160 +0200
-+++ gdb-6.8/gdb/testsuite/gdb.base/gcore-shmid0.exp    2008-05-03 22:36:56.000000000 +0200
-@@ -0,0 +1,120 @@
-+# Copyright 2007 Free Software Foundation, Inc.
+Index: gdb-6.8.50.20090302/gdb/testsuite/gdb.base/gcore-shmid0.exp
+===================================================================
+--- /dev/null  1970-01-01 00:00:00.000000000 +0000
++++ gdb-6.8.50.20090302/gdb/testsuite/gdb.base/gcore-shmid0.exp        2009-06-29 16:24:36.000000000 +0200
+@@ -0,0 +1,96 @@
++# Copyright 2007, 2009 Free Software Foundation, Inc.
 +
 +# This program is free software; you can redistribute it and/or modify
 +# it under the terms of the GNU General Public License as published by
 +# along with this program; if not, write to the Free Software
 +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  
 +
-+# Please email any bugs, comments, and/or additions to this file to:
-+# bug-gdb@prep.ai.mit.edu
-+
 +# Test GDB's handling of gcore for mapping with a name but zero inode.
 +
-+set testfile "gcore-shmid0"
-+set srcfile  ${testfile}.c
-+set binfile  ${objdir}/${subdir}/${testfile}
-+
-+if  { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
-+     untested gcore.exp
-+     return -1
++if { [prepare_for_testing gcore-shmid0.exp gcore-shmid0] } {
++    return -1
 +}
 +
-+# Start with a fresh gdb.
-+
-+gdb_exit
-+gdb_start
-+gdb_reinitialize_dir $srcdir/$subdir
-+gdb_load ${binfile}
-+
 +# Does this gdb support gcore?
-+send_gdb "help gcore\n"
-+gdb_expect {
++set test "help gcore"
++gdb_test_multiple $test $test {
 +    -re "Undefined command: .gcore.*$gdb_prompt $" {
 +      # gcore command not supported -- nothing to test here.
 +      unsupported "gdb does not support gcore on this target"
 +      return -1;
 +    }
 +    -re "Save a core file .*$gdb_prompt $" {
-+      pass "help gcore"
-+    }
-+    -re ".*$gdb_prompt $" {
-+      fail "help gcore"
-+    }
-+    timeout {
-+      fail "help gcore (timeout)"
++      pass $test
 +    }
 +}
 +
@@ -86,9 +67,6 @@
 +    -re "Can't create a corefile\[\r\n\]+$gdb_prompt $" {
 +      unsupported $test
 +    }
-+    eof {
-+      fail $test
-+    }
 +}
 +
 +# Be sure to remove the handle first.
 +      fail $test
 +    }
 +}
---- /dev/null  2008-05-02 23:36:22.370004160 +0200
-+++ gdb-6.8/gdb/testsuite/gdb.base/gcore-shmid0.c      2008-05-03 22:39:10.000000000 +0200
-@@ -0,0 +1,95 @@
-+/* Copyright 2007 Free Software Foundation, Inc.
+Index: gdb-6.8.50.20090302/gdb/testsuite/gdb.base/gcore-shmid0.c
+===================================================================
+--- /dev/null  1970-01-01 00:00:00.000000000 +0000
++++ gdb-6.8.50.20090302/gdb/testsuite/gdb.base/gcore-shmid0.c  2009-06-29 16:22:49.000000000 +0200
+@@ -0,0 +1,123 @@
++/* Copyright 2007, 2009 Free Software Foundation, Inc.
 +
 +   This file is part of GDB.
 +
 +#include <unistd.h>
 +#include <assert.h>
 +
-+/* We need a backtrace through the stack.  */
++/* The same test running in a parallel testsuite may steal us the zero SID,
++   even if we never get any EEXIST.  Just try a while.  */
++
++#define TIMEOUT_SEC 10
 +
 +static void
 +initialized (void)
 +{
 +  int sid;
 +  unsigned int *addr = (void *) -1L;
-+  int try;
++  int attempt, round = 0;
++  time_t ts_start, ts;
 +
-+  /* The generated SID will cycle with an increment of 32768, try until it
++  if (time (&ts_start) == (time_t) -1)
++    {
++      printf ("time (): %m\n");
++      exit (1);
++    }
++
++  /* The generated SID will cycle with an increment of 32768, attempt until it
 +   * wraps to 0.  */
 +
-+  for (try = 0; addr == (void *) -1L; try++)
++  for (attempt = 0; addr == (void *) -1L; attempt++)
 +    {
-+      /* At least kernel-2.6.25-8.fc9.x86_64 just never returns the value 0 by
-+         shmget(2).  */
-+      if (try > 0x10000)
++      /* kernel-2.6.25-8.fc9.x86_64 just never returns the value 0 by
++       shmget(2).  shmget returns SID range 0..1<<31 in steps of 32768,
++       0x1000 should be enough but wrap the range it to be sure.  */
++
++      if (attempt > 0x21000)
 +        {
-+        printf ("Problem no longer reproducible on this kernel (try %d)\n",
-+                try);
++        if (time (&ts) == (time_t) -1)
++          {
++            printf ("time (): %m\n");
++            exit (1);
++          }
++
++        if (ts >= ts_start && ts < ts_start + TIMEOUT_SEC)
++          {
++            attempt = 0;
++            round++;
++            continue;
++          }
++
++        printf ("Problem is not reproducible on this kernel (attempt %d, "
++                "round %d))\n", attempt, round);
 +        unresolved ();
 +        exit (1);
 +      }
 +      sid = shmget ((key_t) rand (), 0x1000, IPC_CREAT | IPC_EXCL | 0777);
 +      if (sid == -1)
 +      {
++        if (errno == EEXIST)
++          continue;
++
 +        printf ("shmget (%d, 0x1000, IPC_CREAT): errno %d\n", 0, errno);
 +        exit (1);
 +      }
index 6600d2e1592fa8b7e849f0cb37aa8d614acdf60d..18fd7f7e7bfbf0a3c866e83492fc2f27556aa38f 100644 (file)
 
        Fix scan_dyntag() for binaries provided by valgrind (BZ 460319).
 
-Index: gdb-6.8.50.20090302/gdb/amd64-tdep.c
+Index: gdb-6.8.91.20090925/gdb/amd64-tdep.c
 ===================================================================
---- gdb-6.8.50.20090302.orig/gdb/amd64-tdep.c  2009-03-07 00:30:09.000000000 +0100
-+++ gdb-6.8.50.20090302/gdb/amd64-tdep.c       2009-03-07 00:30:12.000000000 +0100
+--- gdb-6.8.91.20090925.orig/gdb/amd64-tdep.c  2009-09-25 10:25:39.000000000 +0200
++++ gdb-6.8.91.20090925/gdb/amd64-tdep.c       2009-09-25 10:25:45.000000000 +0200
 @@ -36,6 +36,7 @@
  #include "regcache.h"
  #include "regset.h"
@@ -38,15 +38,17 @@ Index: gdb-6.8.50.20090302/gdb/amd64-tdep.c
  
  #include "gdb_assert.h"
  
-@@ -1586,16 +1587,28 @@ amd64_analyze_stack_align (CORE_ADDR pc,
+@@ -1591,18 +1592,31 @@ amd64_analyze_stack_align (CORE_ADDR pc,
     Any function that doesn't start with this sequence will be assumed
     to have no prologue and thus no valid frame pointer in %rbp.  */
  
 -static CORE_ADDR
--amd64_analyze_prologue (CORE_ADDR pc, CORE_ADDR current_pc,
+-amd64_analyze_prologue (struct gdbarch *gdbarch,
+-                      CORE_ADDR pc, CORE_ADDR current_pc,
 -                      struct amd64_frame_cache *cache)
 +struct amd64_analyze_prologue_data
 +  {
++    struct gdbarch *gdbarch;
 +    CORE_ADDR pc, current_pc;
 +    struct amd64_frame_cache *cache;
 +    CORE_ADDR retval;
@@ -56,8 +58,10 @@ Index: gdb-6.8.50.20090302/gdb/amd64-tdep.c
 +amd64_analyze_prologue_1 (void *data_pointer)
  {
 +  struct amd64_analyze_prologue_data *data = data_pointer;
++  struct gdbarch *gdbarch = data->gdbarch;
 +  CORE_ADDR pc = data->pc, current_pc = data->current_pc;
 +  struct amd64_frame_cache *cache = data->cache;
+   enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
    static gdb_byte proto[3] = { 0x48, 0x89, 0xe5 }; /* movq %rsp, %rbp */
    gdb_byte buf[3];
    gdb_byte op;
@@ -71,7 +75,7 @@ Index: gdb-6.8.50.20090302/gdb/amd64-tdep.c
  
    pc = amd64_analyze_stack_align (pc, current_pc, cache);
  
-@@ -1610,18 +1623,57 @@ amd64_analyze_prologue (CORE_ADDR pc, CO
+@@ -1617,18 +1631,59 @@ amd64_analyze_prologue (struct gdbarch *
  
        /* If that's all, return now.  */
        if (current_pc <= pc + 1)
@@ -107,7 +111,8 @@ Index: gdb-6.8.50.20090302/gdb/amd64-tdep.c
 +   ->find_function_start_sal  */
 +
 +static CORE_ADDR
-+amd64_analyze_prologue (CORE_ADDR pc, CORE_ADDR current_pc,
++amd64_analyze_prologue (struct gdbarch *gdbarch,
++                      CORE_ADDR pc, CORE_ADDR current_pc,
 +                      struct amd64_frame_cache *cache)
 +{
 +  int status;
@@ -118,6 +123,7 @@ Index: gdb-6.8.50.20090302/gdb/amd64-tdep.c
 +  saved_gdb_stderr = gdb_stderr;
 +  gdb_stderr = ui_file_new ();
 +
++  data.gdbarch = gdbarch;
 +  data.pc = pc;
 +  data.current_pc = current_pc;
 +  data.cache = cache;
@@ -132,11 +138,11 @@ Index: gdb-6.8.50.20090302/gdb/amd64-tdep.c
    return pc;
  }
  
-Index: gdb-6.8.50.20090302/gdb/auxv.c
+Index: gdb-6.8.91.20090925/gdb/auxv.c
 ===================================================================
---- gdb-6.8.50.20090302.orig/gdb/auxv.c        2009-03-07 00:30:06.000000000 +0100
-+++ gdb-6.8.50.20090302/gdb/auxv.c     2009-03-07 00:30:12.000000000 +0100
-@@ -81,7 +81,7 @@ procfs_xfer_auxv (struct target_ops *ops
+--- gdb-6.8.91.20090925.orig/gdb/auxv.c        2009-07-02 19:25:52.000000000 +0200
++++ gdb-6.8.91.20090925/gdb/auxv.c     2009-09-25 10:25:45.000000000 +0200
+@@ -78,7 +78,7 @@ procfs_xfer_auxv (struct target_ops *ops
     Return 1 if an entry was read into *TYPEP and *VALP.  */
  static int
  default_auxv_parse (struct target_ops *ops, gdb_byte **readptr,
@@ -145,7 +151,7 @@ Index: gdb-6.8.50.20090302/gdb/auxv.c
  {
    const int sizeof_auxv_field = gdbarch_ptr_bit (target_gdbarch)
                                / TARGET_CHAR_BIT;
-@@ -108,7 +108,7 @@ default_auxv_parse (struct target_ops *o
+@@ -106,7 +106,7 @@ default_auxv_parse (struct target_ops *o
     Return 1 if an entry was read into *TYPEP and *VALP.  */
  int
  target_auxv_parse (struct target_ops *ops, gdb_byte **readptr,
@@ -154,7 +160,7 @@ Index: gdb-6.8.50.20090302/gdb/auxv.c
  {
    struct target_ops *t;
    for (t = ops; t != NULL; t = t->beneath)
-@@ -123,9 +123,10 @@ target_auxv_parse (struct target_ops *op
+@@ -121,9 +121,10 @@ target_auxv_parse (struct target_ops *op
     an error getting the information.  On success, return 1 after
     storing the entry's value field in *VALP.  */
  int
@@ -167,7 +173,7 @@ Index: gdb-6.8.50.20090302/gdb/auxv.c
    gdb_byte *data;
    LONGEST n = target_read_alloc (ops, TARGET_OBJECT_AUXV, NULL, &data);
    gdb_byte *ptr = data;
-@@ -135,10 +136,10 @@ target_auxv_search (struct target_ops *o
+@@ -133,10 +134,10 @@ target_auxv_search (struct target_ops *o
      return n;
  
    while (1)
@@ -180,7 +186,7 @@ Index: gdb-6.8.50.20090302/gdb/auxv.c
          {
            xfree (data);
            *valp = val;
-@@ -161,7 +162,8 @@ target_auxv_search (struct target_ops *o
+@@ -159,7 +160,8 @@ target_auxv_search (struct target_ops *o
  int
  fprint_target_auxv (struct ui_file *file, struct target_ops *ops)
  {
@@ -190,7 +196,7 @@ Index: gdb-6.8.50.20090302/gdb/auxv.c
    gdb_byte *data;
    LONGEST len = target_read_alloc (ops, TARGET_OBJECT_AUXV, NULL,
                                   &data);
-@@ -171,13 +173,13 @@ fprint_target_auxv (struct ui_file *file
+@@ -169,13 +171,13 @@ fprint_target_auxv (struct ui_file *file
    if (len <= 0)
      return len;
  
@@ -206,7 +212,7 @@ Index: gdb-6.8.50.20090302/gdb/auxv.c
        {
  #define TAG(tag, text, kind) \
        case tag: name = #tag; description = text; flavor = kind; break
-@@ -232,7 +234,7 @@ fprint_target_auxv (struct ui_file *file
+@@ -231,7 +233,7 @@ fprint_target_auxv (struct ui_file *file
        }
  
        fprintf_filtered (file, "%-4s %-20s %-30s ",
@@ -215,7 +221,7 @@ Index: gdb-6.8.50.20090302/gdb/auxv.c
        switch (flavor)
        {
        case dec:
-@@ -254,7 +256,7 @@ fprint_target_auxv (struct ui_file *file
+@@ -253,7 +255,7 @@ fprint_target_auxv (struct ui_file *file
          break;
        }
        ++ents;
@@ -224,11 +230,11 @@ Index: gdb-6.8.50.20090302/gdb/auxv.c
        break;
      }
  
-Index: gdb-6.8.50.20090302/gdb/auxv.h
+Index: gdb-6.8.91.20090925/gdb/auxv.h
 ===================================================================
---- gdb-6.8.50.20090302.orig/gdb/auxv.h        2009-01-03 06:57:50.000000000 +0100
-+++ gdb-6.8.50.20090302/gdb/auxv.h     2009-03-07 00:30:12.000000000 +0100
-@@ -36,14 +36,14 @@ struct target_ops;         /* Forward declarati
+--- gdb-6.8.91.20090925.orig/gdb/auxv.h        2009-06-07 21:07:08.000000000 +0200
++++ gdb-6.8.91.20090925/gdb/auxv.h     2009-09-25 10:25:45.000000000 +0200
+@@ -31,14 +31,14 @@
     Return 1 if an entry was read into *TYPEP and *VALP.  */
  extern int target_auxv_parse (struct target_ops *ops,
                              gdb_byte **readptr, gdb_byte *endptr,
@@ -245,123 +251,24 @@ Index: gdb-6.8.50.20090302/gdb/auxv.h
  
  /* Print the contents of the target's AUXV on the specified file. */
  extern int fprint_target_auxv (struct ui_file *file, struct target_ops *ops);
-Index: gdb-6.8.50.20090302/gdb/breakpoint.c
+Index: gdb-6.8.91.20090925/gdb/dwarf2read.c
 ===================================================================
---- gdb-6.8.50.20090302.orig/gdb/breakpoint.c  2009-03-07 00:30:10.000000000 +0100
-+++ gdb-6.8.50.20090302/gdb/breakpoint.c       2009-03-07 00:30:12.000000000 +0100
-@@ -3920,7 +3920,8 @@ describe_other_breakpoints (CORE_ADDR pc
-             printf_filtered (" (thread %d)", b->thread);
-           printf_filtered ("%s%s ",
-                            ((b->enable_state == bp_disabled || 
--                             b->enable_state == bp_call_disabled) 
-+                             b->enable_state == bp_call_disabled ||
-+                             b->enable_state == bp_startup_disabled)
-                             ? " (disabled)"
-                             : b->enable_state == bp_permanent 
-                             ? " (permanent)"
-@@ -5008,6 +5009,61 @@ create_catchpoint (int tempflag, char *c
-   return b;
- }
-+void
-+disable_breakpoints_at_startup (int silent)
-+{
-+  struct breakpoint *b;
-+  int disabled_startup_breaks = 0;
-+
-+  if (bfd_get_start_address (exec_bfd) != entry_point_address ())
-+    {
-+      ALL_BREAKPOINTS (b)
-+      {
-+        if (((b->type == bp_breakpoint) ||
-+             (b->type == bp_hardware_breakpoint)) &&
-+            b->enable_state == bp_enabled &&
-+            !b->loc->duplicate)
-+          {
-+            b->enable_state = bp_startup_disabled;
-+            if (!silent)
-+              {
-+                if (!disabled_startup_breaks)
-+                  {
-+                    target_terminal_ours_for_output ();
-+                    warning ("Temporarily disabling breakpoints:");
-+                  }
-+                disabled_startup_breaks = 1;
-+                warning ("breakpoint #%d addr 0x%s", b->number, paddr_nz(b->loc->address));
-+              }
-+          }
-+      }
-+    }
-+}
-+
-+/* Try to reenable any breakpoints after startup.  */
-+void
-+re_enable_breakpoints_at_startup (void)
-+{
-+  struct breakpoint *b;
-+
-+  if (bfd_get_start_address (exec_bfd) != entry_point_address ())
-+    {
-+      ALL_BREAKPOINTS (b)
-+      if (b->enable_state == bp_startup_disabled)
-+        {
-+          char buf[1];
-+
-+          /* Do not reenable the breakpoint if the shared library
-+             is still not mapped in.  */
-+          if (target_read_memory (b->loc->address, buf, 1) == 0)
-+            {
-+              /*printf ("enabling breakpoint at 0x%s\n", paddr_nz(b->loc->address));*/
-+              b->enable_state = bp_enabled;
-+            }
-+        }
-+    }
-+}
-+
- static void
- create_fork_vfork_event_catchpoint (int tempflag, char *cond_string,
-                                     struct breakpoint_ops *ops)
-Index: gdb-6.8.50.20090302/gdb/breakpoint.h
-===================================================================
---- gdb-6.8.50.20090302.orig/gdb/breakpoint.h  2009-03-07 00:30:06.000000000 +0100
-+++ gdb-6.8.50.20090302/gdb/breakpoint.h       2009-03-07 00:30:12.000000000 +0100
-@@ -127,6 +127,7 @@ enum enable_state
-                          automatically enabled and reset when the call 
-                          "lands" (either completes, or stops at another 
-                          eventpoint). */
-+    bp_startup_disabled,
-     bp_permanent      /* There is a breakpoint instruction hard-wired into
-                          the target's code.  Don't try to write another
-                          breakpoint instruction on top of it, or restore
-@@ -847,6 +848,10 @@ extern void remove_thread_event_breakpoi
- extern void disable_breakpoints_in_shlibs (void);
-+extern void disable_breakpoints_at_startup (int silent);
-+
-+extern void re_enable_breakpoints_at_startup (void);
-+
- /* This function returns TRUE if ep is a catchpoint. */
- extern int ep_is_catchpoint (struct breakpoint *);
-Index: gdb-6.8.50.20090302/gdb/dwarf2read.c
-===================================================================
---- gdb-6.8.50.20090302.orig/gdb/dwarf2read.c  2009-03-07 00:30:10.000000000 +0100
-+++ gdb-6.8.50.20090302/gdb/dwarf2read.c       2009-03-07 00:30:12.000000000 +0100
-@@ -1413,7 +1413,7 @@ dwarf2_build_psymtabs (struct objfile *o
-   else
-     dwarf2_per_objfile->loc_buffer = NULL;
+--- gdb-6.8.91.20090925.orig/gdb/dwarf2read.c  2009-09-25 10:25:39.000000000 +0200
++++ gdb-6.8.91.20090925/gdb/dwarf2read.c       2009-09-25 10:25:45.000000000 +0200
+@@ -1717,7 +1717,7 @@ dwarf2_build_psymtabs (struct objfile *o
+   dwarf2_read_section (objfile, &dwarf2_per_objfile->eh_frame);
+   dwarf2_read_section (objfile, &dwarf2_per_objfile->frame);
  
 -  if (mainline
 +  if ((mainline == 1)
        || (objfile->global_psymbols.size == 0
          && objfile->static_psymbols.size == 0))
      {
-Index: gdb-6.8.50.20090302/gdb/elfread.c
+Index: gdb-6.8.91.20090925/gdb/elfread.c
 ===================================================================
---- gdb-6.8.50.20090302.orig/gdb/elfread.c     2009-03-07 00:30:06.000000000 +0100
-+++ gdb-6.8.50.20090302/gdb/elfread.c  2009-03-07 00:30:12.000000000 +0100
-@@ -680,7 +680,7 @@ elf_symfile_read (struct objfile *objfil
+--- gdb-6.8.91.20090925.orig/gdb/elfread.c     2009-09-25 10:25:38.000000000 +0200
++++ gdb-6.8.91.20090925/gdb/elfread.c  2009-09-25 10:25:45.000000000 +0200
+@@ -681,7 +681,7 @@ elf_symfile_read (struct objfile *objfil
    /* If we are reinitializing, or if we have never loaded syms yet,
       set table to empty.  MAINLINE is cleared so that *_read_psymtab
       functions do not all also re-initialize the psymbol table. */
@@ -370,29 +277,28 @@ Index: gdb-6.8.50.20090302/gdb/elfread.c
      {
        init_psymbol_list (objfile, 0);
        mainline = 0;
-Index: gdb-6.8.50.20090302/gdb/infrun.c
+Index: gdb-6.8.91.20090925/gdb/infrun.c
 ===================================================================
---- gdb-6.8.50.20090302.orig/gdb/infrun.c      2009-03-07 00:30:10.000000000 +0100
-+++ gdb-6.8.50.20090302/gdb/infrun.c   2009-03-07 00:30:12.000000000 +0100
-@@ -3354,6 +3354,11 @@ infrun: BPSTAT_WHAT_SET_LONGJMP_RESUME (
+--- gdb-6.8.91.20090925.orig/gdb/infrun.c      2009-09-25 10:25:39.000000000 +0200
++++ gdb-6.8.91.20090925/gdb/infrun.c   2009-09-25 10:25:45.000000000 +0200
+@@ -3659,6 +3659,10 @@ infrun: BPSTAT_WHAT_SET_LONGJMP_RESUME (
  #endif
          target_terminal_inferior ();
  
 +        /* For PIE executables, we dont really know where the
-+           breakpoints are going to be until we start up the
-+           inferior.  */
-+          re_enable_breakpoints_at_startup ();
++           breakpoints are going to be until we start up the inferior.  */
++        enable_breakpoints_after_startup ();
 +
          /* If requested, stop when the dynamic linker notifies
             gdb of events.  This allows the user to get control
             and place breakpoints in initializer routines for
-Index: gdb-6.8.50.20090302/gdb/objfiles.c
+Index: gdb-6.8.91.20090925/gdb/objfiles.c
 ===================================================================
---- gdb-6.8.50.20090302.orig/gdb/objfiles.c    2009-03-07 00:30:06.000000000 +0100
-+++ gdb-6.8.50.20090302/gdb/objfiles.c 2009-03-07 00:30:12.000000000 +0100
-@@ -51,6 +51,9 @@
- #include "arch-utils.h"
- #include "exec.h"
+--- gdb-6.8.91.20090925.orig/gdb/objfiles.c    2009-09-25 10:25:38.000000000 +0200
++++ gdb-6.8.91.20090925/gdb/objfiles.c 2009-09-25 10:25:45.000000000 +0200
+@@ -53,6 +53,9 @@
+ #include "observer.h"
+ #include "complaints.h"
  
 +#include "auxv.h"
 +#include "elf/common.h"
@@ -400,42 +306,29 @@ Index: gdb-6.8.50.20090302/gdb/objfiles.c
  /* Prototypes for local functions */
  
  static void objfile_alloc_data (struct objfile *objfile);
-@@ -271,7 +274,19 @@ init_entry_point_info (struct objfile *o
+@@ -280,9 +283,17 @@ init_entry_point_info (struct objfile *o
  CORE_ADDR
  entry_point_address (void)
  {
--  return symfile_objfile ? symfile_objfile->ei.entry_point : 0;
 +  int ret;
-+  CORE_ADDR entry_addr;
 +
+   struct gdbarch *gdbarch;
+   CORE_ADDR entry_point;
 +  /* Find the address of the entry point of the program from the
 +     auxv vector.  */
-+  ret = target_auxv_search (&current_target, AT_ENTRY, &entry_addr);
++  ret = target_auxv_search (&current_target, AT_ENTRY, &entry_point);
 +  if (ret == 1)
-+     return entry_addr;                                                                              
-+  /*if (ret == 0 || ret == -1)*/
-+  else
-+    {
-+      return symfile_objfile ? symfile_objfile->ei.entry_point : 0;
-+    }
- }
- /* Create the terminating entry of OBJFILE's minimal symbol table.
-@@ -443,6 +458,9 @@ free_objfile (struct objfile *objfile)
-   if (objfile == rt_common_objfile)
-     rt_common_objfile = NULL;
-+  if (objfile == symfile_objfile)
-+    symfile_objfile = NULL;
++     return entry_point;                                                                              
 +
-   /* Before the symbol table code was redone to make it easier to
-      selectively load and remove information particular to a specific
-      linkage unit, gdb used to do these things whenever the monolithic
-Index: gdb-6.8.50.20090302/gdb/solib-svr4.c
+   if (symfile_objfile == NULL)
+     return 0;
+Index: gdb-6.8.91.20090925/gdb/solib-svr4.c
 ===================================================================
---- gdb-6.8.50.20090302.orig/gdb/solib-svr4.c  2009-03-07 00:30:09.000000000 +0100
-+++ gdb-6.8.50.20090302/gdb/solib-svr4.c       2009-03-07 00:30:12.000000000 +0100
-@@ -45,6 +45,7 @@
+--- gdb-6.8.91.20090925.orig/gdb/solib-svr4.c  2009-09-25 10:25:39.000000000 +0200
++++ gdb-6.8.91.20090925/gdb/solib-svr4.c       2009-09-25 10:28:07.000000000 +0200
+@@ -47,6 +47,7 @@
  #include "exec.h"
  #include "auxv.h"
  #include "exceptions.h"
@@ -443,7 +336,7 @@ Index: gdb-6.8.50.20090302/gdb/solib-svr4.c
  
  static struct link_map_offsets *svr4_fetch_link_map_offsets (void);
  static int svr4_have_link_map_offsets (void);
-@@ -287,7 +288,9 @@ static CORE_ADDR main_lm_addr;
+@@ -359,7 +360,9 @@ solib_svr4_inferior_exit (int pid)
  
  /* Local function prototypes */
  
@@ -453,7 +346,7 @@ Index: gdb-6.8.50.20090302/gdb/solib-svr4.c
  
  static CORE_ADDR bfd_lookup_symbol (bfd *, char *);
  
-@@ -521,10 +524,12 @@ scan_dyntag (int dyntag, bfd *abfd, CORE
+@@ -600,10 +603,12 @@ scan_dyntag (int dyntag, bfd *abfd, CORE
    int arch_size, step, sect_size;
    long dyn_tag;
    CORE_ADDR dyn_ptr, dyn_addr;
@@ -466,9 +359,9 @@ Index: gdb-6.8.50.20090302/gdb/solib-svr4.c
  
    if (abfd == NULL)
      return 0;
-@@ -532,19 +537,81 @@ scan_dyntag (int dyntag, bfd *abfd, CORE
+@@ -615,19 +620,81 @@ scan_dyntag (int dyntag, bfd *abfd, CORE
    if (arch_size == -1)
-    return 0;
+     return 0;
  
 +  /* The auxv vector based relocatable files reading is limited to the main
 +     executable.  */
@@ -489,21 +382,21 @@ Index: gdb-6.8.50.20090302/gdb/solib-svr4.c
 +
 +        if (debug_solib)
 +          fprintf_unfiltered (gdb_stdlog,
-+                              "elf_locate_base: program entry address not found. Using bfd's 0x%s for %s\n",
-+                              paddr_nz (entry_addr), exec_bfd->filename);
++                              "elf_locate_base: program entry address not found. Using bfd's %s for %s\n",
++                              paddress (target_gdbarch, entry_addr), exec_bfd->filename);
 +      }
 +      else
 +      {
 +        if (debug_solib)
 +          fprintf_unfiltered (gdb_stdlog,
-+                              "elf_locate_base: found program entry address 0x%s for %s\n",
-+                              paddr_nz (entry_addr), exec_bfd->filename);
++                              "elf_locate_base: found program entry address %s for %s\n",
++                              paddress (target_gdbarch, entry_addr), exec_bfd->filename);
 +      }
 +      reloc_addr = entry_addr - bfd_get_start_address (exec_bfd);
 +      if (debug_solib)
 +      fprintf_unfiltered (gdb_stdlog,
-+                          "elf_locate_base: expected relocation offset 0x%s for %s\n",
-+                          paddr_nz (reloc_addr), exec_bfd->filename);
++                          "elf_locate_base: expected relocation offset %s for %s\n",
++                          paddress (target_gdbarch, reloc_addr), exec_bfd->filename);
 +    }
 +
    /* Find the start address of the .dynamic section.  */
@@ -528,8 +421,8 @@ Index: gdb-6.8.50.20090302/gdb/solib-svr4.c
    dyn_addr = bfd_section_vma (abfd, sect);
 +  if (debug_solib)
 +    fprintf_unfiltered (gdb_stdlog,
-+                      "elf_locate_base: .dynamic addr 0x%s\n",
-+                      paddr_nz (dyn_addr));
++                      "elf_locate_base: .dynamic addr %s\n",
++                      paddress (target_gdbarch, dyn_addr));
  
    /* Read in .dynamic from the BFD.  We will get the actual value
       from memory later.  */
@@ -550,7 +443,7 @@ Index: gdb-6.8.50.20090302/gdb/solib-svr4.c
  
    /* Iterate over BUF and scan for DYNTAG.  If found, set PTR and return.  */
    step = (arch_size == 32) ? sizeof (Elf32_External_Dyn)
-@@ -565,26 +632,105 @@ scan_dyntag (int dyntag, bfd *abfd, CORE
+@@ -648,26 +715,105 @@ scan_dyntag (int dyntag, bfd *abfd, CORE
        dyn_tag = bfd_h_get_64 (abfd, (bfd_byte *) x_dynp_64->d_tag);
        dyn_ptr = bfd_h_get_64 (abfd, (bfd_byte *) x_dynp_64->d_un.d_ptr);
        }
@@ -573,7 +466,7 @@ Index: gdb-6.8.50.20090302/gdb/solib-svr4.c
 +                fprintf_unfiltered (gdb_stdlog,
 +                                    "elf_locate_base: tag at offset 0x%lx does not match,"
 +                                    " dropping relocation offset %s\n",
-+                                    (unsigned long) (buf - bufstart), paddr_nz (reloc_addr));
++                                    (unsigned long) (buf - bufstart), paddress (target_gdbarch, reloc_addr));
 +              reloc_addr = 0;
 +            }
 +        }
@@ -583,7 +476,7 @@ Index: gdb-6.8.50.20090302/gdb/solib-svr4.c
 +            fprintf_unfiltered (gdb_stdlog,
 +                                "elf_locate_base: tag at offset 0x%lx is not readable,"
 +                                " dropping relocation offset %s\n",
-+                                (unsigned long) (buf - bufstart), paddr_nz (reloc_addr));
++                                (unsigned long) (buf - bufstart), paddress (target_gdbarch, reloc_addr));
 +          reloc_addr = 0;
 +        }
 +      }
@@ -623,14 +516,14 @@ Index: gdb-6.8.50.20090302/gdb/solib-svr4.c
 +            {
 +              if (debug_solib)
 +                fprintf_unfiltered (gdb_stdlog,
-+                                    "elf_locate_base: unrelocated ptr addr 0x%s\n",
-+                                    paddr_nz (ptr_addr));
++                                    "elf_locate_base: unrelocated ptr addr %s\n",
++                                    paddress (target_gdbarch, ptr_addr));
 +              ptr_addr += reloc_addr;
 +              if (debug_solib) 
 +                fprintf_unfiltered (gdb_stdlog, 
-+                                    "elf_locate_base: relocated ptr addr 0x%s"
++                                    "elf_locate_base: relocated ptr addr %s"
 +                                    " (relocation offset %s) for %s\n",
-+                                    paddr_nz (ptr_addr), paddr_nz (reloc_addr),
++                                    paddress (target_gdbarch, ptr_addr), paddress (target_gdbarch, reloc_addr),
 +                                    exec_bfd->filename);
 +            }
 +          got = target_read_memory (ptr_addr, ptr_buf, arch_size / 8);
@@ -639,9 +532,9 @@ Index: gdb-6.8.50.20090302/gdb/solib-svr4.c
 +              ptr_addr -= reloc_addr;
 +              if (debug_solib) 
 +                fprintf_unfiltered (gdb_stdlog, 
-+                                    "elf_locate_base: unrelocated back to ptr addr 0x%s"
++                                    "elf_locate_base: unrelocated back to ptr addr %s"
 +                                    " as the memory was unreable for %s\n",
-+                                    paddr_nz (ptr_addr), exec_bfd->filename);
++                                    paddress (target_gdbarch, ptr_addr), exec_bfd->filename);
 +              got = target_read_memory (ptr_addr, ptr_buf, arch_size / 8);
 +            }
 +
@@ -655,8 +548,8 @@ Index: gdb-6.8.50.20090302/gdb/solib-svr4.c
 +                {
 +                  if (debug_solib)
 +                    fprintf_unfiltered (gdb_stdlog,
-+                                        "elf_locate_base: Tag entry has value 0x%s -- return now\n",
-+                                        paddr_nz (dyn_ptr));
++                                        "elf_locate_base: Tag entry has value %s -- return now\n",
++                                        paddress (target_gdbarch, dyn_ptr));
 +                }
 +            }
 +          else
@@ -675,33 +568,22 @@ Index: gdb-6.8.50.20090302/gdb/solib-svr4.c
    }
  
    return 0;
-@@ -774,6 +920,10 @@ solib_svr4_r_map (void)
-   struct link_map_offsets *lmo = svr4_fetch_link_map_offsets ();
-   struct type *ptr_type = builtin_type (target_gdbarch)->builtin_data_ptr;
-+  if (debug_solib)
-+    fprintf_unfiltered (gdb_stdlog, 
-+                        "solib_svr4_r_map: read at 0x%s\n",
-+                        paddr_nz (debug_base + lmo->r_map_offset));
-   return read_memory_typed_address (debug_base + lmo->r_map_offset, ptr_type);
- }
-@@ -945,6 +1095,11 @@ svr4_current_sos (void)
-   struct so_list *head = 0;
-   struct so_list **link_ptr = &head;
+@@ -1040,6 +1186,11 @@ svr4_current_sos (void)
    CORE_ADDR ldsomap = 0;
+   struct inferior *inf;
+   struct svr4_info *info;
 +  const char *filename = exec_bfd ? exec_bfd->filename : "<none>";
 +
 +  if (debug_solib)
 +    fprintf_unfiltered (gdb_stdlog, 
 +                        "svr4_current_sos: exec_bfd %s\n", filename);
  
-   /* Always locate the debug struct, in case it has moved.  */
-   debug_base = 0;
-@@ -953,10 +1108,19 @@ svr4_current_sos (void)
+   if (ptid_equal (inferior_ptid, null_ptid))
+     return NULL;
+@@ -1054,7 +1205,13 @@ svr4_current_sos (void)
    /* If we can't find the dynamic linker's base structure, this
       must not be a dynamically linked executable.  Hmm.  */
-   if (! debug_base)
+   if (! info->debug_base)
 -    return svr4_default_sos ();
 +    {
 +      if (debug_solib)
@@ -713,19 +595,13 @@ Index: gdb-6.8.50.20090302/gdb/solib-svr4.c
  
    /* Walk the inferior's link map list, and build our list of
       `struct so_list' nodes.  */
-+  if (debug_solib)
-+    fprintf_unfiltered (gdb_stdlog, 
-+                      "svr4_current_sos: walk link map in %s\n", filename);
-   lm = solib_svr4_r_map ();
-   while (lm)
-@@ -973,26 +1137,104 @@ svr4_current_sos (void)
+@@ -1074,26 +1231,104 @@ svr4_current_sos (void)
        new->lm_info->lm = xzalloc (lmo->link_map_size);
        make_cleanup (xfree, new->lm_info->lm);
  
 +      if (debug_solib)
 +        fprintf_unfiltered (gdb_stdlog, 
-+                            "svr4_current_sos: read lm at 0x%s\n", paddr_nz(lm));
++                            "svr4_current_sos: read lm at %s\n", paddress (target_gdbarch, lm));
        read_memory (lm, new->lm_info->lm, lmo->link_map_size);
  
        lm = LM_NEXT (new);
@@ -743,7 +619,7 @@ Index: gdb-6.8.50.20090302/gdb/solib-svr4.c
 -      if (IGNORE_FIRST_LINK_MAP_ENTRY (new) && ldsomap == 0)
 +      if (exec_bfd != NULL && IGNORE_FIRST_LINK_MAP_ENTRY (new) && ldsomap == 0)
        {
--        main_lm_addr = new->lm_info->lm_addr;
+-        info->main_lm_addr = new->lm_info->lm_addr;
 -        free_so (new);
 -      }
 +          /* It is the first link map entry, i.e. it is the main executable.  */
@@ -751,7 +627,7 @@ Index: gdb-6.8.50.20090302/gdb/solib-svr4.c
 +        if (bfd_get_start_address (exec_bfd) == entry_point_address ())
 +          {
 +            /* Non-pie case, main executable has not been relocated.  */
-+            main_lm_addr = new->lm_info->lm_addr;
++            info->main_lm_addr = new->lm_info->lm_addr;
 +            free_so (new);
 +          }
 +        else
@@ -828,11 +704,19 @@ Index: gdb-6.8.50.20090302/gdb/solib-svr4.c
          target_read_string (LM_NAME (new), &buffer,
                              SO_NAME_MAX_PATH_SIZE - 1, &errcode);
          if (errcode != 0)
-@@ -1000,47 +1242,60 @@ svr4_current_sos (void)
+@@ -1101,63 +1336,76 @@ svr4_current_sos (void)
                     safe_strerror (errcode));
          else
            {
 -            struct build_id *build_id;
+-
+-            strncpy (new->so_original_name, buffer, SO_NAME_MAX_PATH_SIZE - 1);
+-            new->so_original_name[SO_NAME_MAX_PATH_SIZE - 1] = '\0';
+-            /* May get overwritten below.  */
+-            strcpy (new->so_name, new->so_original_name);
+-
+-            build_id = build_id_addr_get (LM_DYNAMIC_FROM_LINK_MAP (new));
+-            if (build_id != NULL)
 +            if (debug_solib)
 +              fprintf_unfiltered (gdb_stdlog, 
 +                                  "svr4_current_sos: LM_NAME is <%s>\n",
@@ -842,25 +726,25 @@ Index: gdb-6.8.50.20090302/gdb/solib-svr4.c
 +            if (strcmp (buffer, "") == 0)
 +              free_so (new);
 +            else
-+              {
+               {
+-                char *name, *build_id_filename;
 +                struct build_id *build_id;
--            strncpy (new->so_original_name, buffer, SO_NAME_MAX_PATH_SIZE - 1);
--            new->so_original_name[SO_NAME_MAX_PATH_SIZE - 1] = '\0';
--            /* May get overwritten below.  */
--            strcpy (new->so_name, new->so_original_name);
++
 +                strncpy (new->so_original_name, buffer, SO_NAME_MAX_PATH_SIZE - 1);
 +                new->so_original_name[SO_NAME_MAX_PATH_SIZE - 1] = '\0';
 +                /* May get overwritten below.  */
 +                strcpy (new->so_name, new->so_original_name);
  
--            build_id = build_id_addr_get (LM_DYNAMIC_FROM_LINK_MAP (new));
--            if (build_id != NULL)
--              {
--                char *name, *build_id_filename;
+-                /* Missing the build-id matching separate debug info file
+-                   would be handled while SO_NAME gets loaded.  */
+-                name = build_id_to_filename (build_id, &build_id_filename, 0);
+-                if (name != NULL)
 +                build_id = build_id_addr_get (LM_DYNAMIC_FROM_LINK_MAP (new));
 +                if (build_id != NULL)
-+                  {
+                   {
+-                    strncpy (new->so_name, name, SO_NAME_MAX_PATH_SIZE - 1);
+-                    new->so_name[SO_NAME_MAX_PATH_SIZE - 1] = '\0';
+-                    xfree (name);
 +                    char *name, *build_id_filename;
 +
 +                    /* Missing the build-id matching separate debug info file
@@ -873,21 +757,46 @@ Index: gdb-6.8.50.20090302/gdb/solib-svr4.c
 +                        xfree (name);
 +                      }
 +                    else
-+                      debug_print_missing (new->so_name, build_id_filename);
++                      {
++                        debug_print_missing (new->so_name, build_id_filename);
++
++                        /* In the case the main executable was found according to
++                           its build-id (from a core file) prevent loading
++                           a different build of a library with accidentally the
++                           same SO_NAME.
++
++                           It suppresses bogus backtraces (and prints "??" there
++                           instead) if the on-disk files no longer match the
++                           running program version.  */
++
++                        if (symfile_objfile != NULL
++                            && (symfile_objfile->flags
++                                & OBJF_BUILD_ID_CORE_LOADED) != 0)
++                          new->so_name[0] = 0;
++                      }
 +
 +                    xfree (build_id_filename);
 +                    xfree (build_id);
-+                  }
+                   }
+-                else
+-                  {
+-                    debug_print_missing (new->so_name, build_id_filename);
  
--                /* Missing the build-id matching separate debug info file
--                   would be handled while SO_NAME gets loaded.  */
--                name = build_id_to_filename (build_id, &build_id_filename, 0);
--                if (name != NULL)
+-                    /* In the case the main executable was found according to
+-                       its build-id (from a core file) prevent loading
+-                       a different build of a library with accidentally the
+-                       same SO_NAME.
+-
+-                       It suppresses bogus backtraces (and prints "??" there
+-                       instead) if the on-disk files no longer match the
+-                       running program version.  */
+-
+-                    if (symfile_objfile != NULL
+-                        && (symfile_objfile->flags
+-                            & OBJF_BUILD_ID_CORE_LOADED) != 0)
+-                      new->so_name[0] = 0;
 +                if (debug_solib)
-                   {
--                    strncpy (new->so_name, name, SO_NAME_MAX_PATH_SIZE - 1);
--                    new->so_name[SO_NAME_MAX_PATH_SIZE - 1] = '\0';
--                    xfree (name);
++                  {
 +                    fprintf_unfiltered (gdb_stdlog, 
 +                                        "svr4_current_sos: Processing DSO: %s\n",
 +                                        new->so_name);
@@ -895,8 +804,6 @@ Index: gdb-6.8.50.20090302/gdb/solib-svr4.c
 +                                        "svr4_current_sos: first link entry %d\n",
 +                                        IGNORE_FIRST_LINK_MAP_ENTRY (new));
                    }
--                else
--                  debug_print_missing (new->so_name, build_id_filename);
  
 -                xfree (build_id_filename);
 -                xfree (build_id);
@@ -922,7 +829,7 @@ Index: gdb-6.8.50.20090302/gdb/solib-svr4.c
        }
  
        /* On Solaris, the dynamic linker is not in the normal list of
-@@ -1056,6 +1311,9 @@ svr4_current_sos (void)
+@@ -1173,6 +1421,9 @@ svr4_current_sos (void)
    if (head == NULL)
      return svr4_default_sos ();
  
@@ -932,7 +839,7 @@ Index: gdb-6.8.50.20090302/gdb/solib-svr4.c
    return head;
  }
  
-@@ -1087,7 +1345,7 @@ svr4_fetch_objfile_link_map (struct objf
+@@ -1205,7 +1456,7 @@ svr4_fetch_objfile_link_map (struct objf
  /* On some systems, the only way to recognize the link map entry for
     the main executable file is by looking at its name.  Return
     non-zero iff SONAME matches one of the known main executable names.  */
@@ -941,7 +848,7 @@ Index: gdb-6.8.50.20090302/gdb/solib-svr4.c
  static int
  match_main (char *soname)
  {
-@@ -1101,6 +1359,7 @@ match_main (char *soname)
+@@ -1219,6 +1470,7 @@ match_main (char *soname)
  
    return (0);
  }
@@ -949,7 +856,7 @@ Index: gdb-6.8.50.20090302/gdb/solib-svr4.c
  
  /* Return 1 if PC lies in the dynamic symbol resolution code of the
     SVR4 run time loader.  */
-@@ -1251,15 +1510,29 @@ enable_break (void)
+@@ -1370,15 +1622,29 @@ enable_break (struct svr4_info *info)
    /* Find the program interpreter; if not found, warn the user and drop
       into the old breakpoint at symbol code.  */
    interp_name = find_program_interpreter ();
@@ -979,7 +886,7 @@ Index: gdb-6.8.50.20090302/gdb/solib-svr4.c
  
        sym_addr = 0;
  
-@@ -1276,6 +1549,9 @@ enable_break (void)
+@@ -1395,6 +1661,9 @@ enable_break (struct svr4_info *info)
          {
          tmp_bfd = solib_bfd_open (interp_name);
        }
@@ -989,7 +896,7 @@ Index: gdb-6.8.50.20090302/gdb/solib-svr4.c
        if (tmp_bfd == NULL)
        goto bkpt_at_symbol;
  
-@@ -1329,16 +1605,16 @@ enable_break (void)
+@@ -1452,16 +1721,16 @@ enable_break (struct svr4_info *info)
        interp_sect = bfd_get_section_by_name (tmp_bfd, ".text");
        if (interp_sect)
        {
@@ -1010,29 +917,26 @@ Index: gdb-6.8.50.20090302/gdb/solib-svr4.c
          interp_plt_sect_high =
            interp_plt_sect_low + bfd_section_size (tmp_bfd, interp_sect);
        }
-@@ -1373,7 +1649,11 @@ enable_break (void)
+@@ -1496,7 +1765,7 @@ enable_break (struct svr4_info *info)
  
        if (sym_addr != 0)
        {
--        create_solib_event_breakpoint (load_addr + sym_addr);
-+        create_solib_event_breakpoint ((load_addr + sym_addr)
-+                                       & load_addr_mask);
-+        if (debug_solib)
-+          fprintf_unfiltered (gdb_stdlog,
-+                             "enable_break: solib bp set\n");
+-        create_solib_event_breakpoint (target_gdbarch, load_addr + sym_addr);
++        create_solib_event_breakpoint (target_gdbarch, (load_addr + sym_addr) & load_addr_mask);
          xfree (interp_name);
          return 1;
        }
-@@ -1639,6 +1919,8 @@ svr4_solib_create_inferior_hook (void)
+@@ -1769,6 +2038,9 @@ svr4_solib_create_inferior_hook (void)
    while (tp->stop_signal != TARGET_SIGNAL_TRAP);
    inf->stop_soon = NO_STOP_QUIETLY;
  #endif /* defined(_SCO_DS) */
 +
-+   disable_breakpoints_at_startup (1);
++  if (bfd_get_start_address (exec_bfd) != entry_point_address ())
++    disable_breakpoints_before_startup ();
  }
  
  static void
-@@ -1820,6 +2102,75 @@ svr4_lp64_fetch_link_map_offsets (void)
+@@ -1945,6 +2217,76 @@ svr4_lp64_fetch_link_map_offsets (void)
  
    return lmp;
  }
@@ -1040,16 +944,17 @@ Index: gdb-6.8.50.20090302/gdb/solib-svr4.c
 +info_linkmap_command (char *cmd, int from_tty)
 +{
 +  CORE_ADDR lm;
++  struct svr4_info *info = get_svr4_info (PIDGET (inferior_ptid));
 +                                                                                
 +  /* Make sure we've looked up the inferior's dynamic linker's base
 +     structure.  */
-+  if (! debug_base)
++  if (! info->debug_base)
 +    {
-+      debug_base = locate_base ();
++      info->debug_base = locate_base (info);
 +                                                                                
 +      /* If we can't find the dynamic linker's base structure, this
 +         must not be a dynamically linked executable.  Hmm.  */
-+      if (! debug_base)
++      if (! info->debug_base)
 +        {
 +          if (debug_solib)
 +            fprintf_unfiltered (gdb_stdlog,
@@ -1061,7 +966,7 @@ Index: gdb-6.8.50.20090302/gdb/solib-svr4.c
 +                                                                                
 +  /* Walk the inferior's link map list, and print the info.  */
 + 
-+  lm = solib_svr4_r_map ();
++  lm = solib_svr4_r_map (info);
 +  while (lm)
 +    {
 +      int errcode;
@@ -1084,7 +989,7 @@ Index: gdb-6.8.50.20090302/gdb/solib-svr4.c
 +
 +      if (debug_solib)
 +        fprintf_unfiltered (gdb_stdlog,
-+                            "svr4_print_linkmap: read lm at 0x%s\n", paddr_nz(lm));
++                            "svr4_print_linkmap: read lm at %s\n", paddress (target_gdbarch, lm));
 +      read_memory (lm, new->lm_info->lm, lmo->link_map_size);
 +
 +      lm = LM_NEXT (new);
@@ -1100,7 +1005,7 @@ Index: gdb-6.8.50.20090302/gdb/solib-svr4.c
 +        warning ("svr4_print_linkmap: Can't read pathname for load map: %s\n",
 +                 safe_strerror (errcode));
 +      }
-+      fprintf_filtered (gdb_stdout, "%-8s %-30s\n", paddr(load_addr), buffer);
++      fprintf_filtered (gdb_stdout, "%-8s %-30s\n", paddress (target_gdbarch, load_addr), buffer);
 +      do_cleanups (old_chain);
 +    }
 +}                                                                                
@@ -1108,19 +1013,19 @@ Index: gdb-6.8.50.20090302/gdb/solib-svr4.c
  \f
  
  struct target_so_ops svr4_so_ops;
-@@ -1859,4 +2210,7 @@ _initialize_svr4_solib (void)
-   svr4_so_ops.in_dynsym_resolve_code = svr4_in_dynsym_resolve_code;
-   svr4_so_ops.lookup_lib_global_symbol = elf_lookup_lib_symbol;
+@@ -1985,4 +2327,7 @@ _initialize_svr4_solib (void)
    svr4_so_ops.same = svr4_same;
+   observer_attach_inferior_exit (solib_svr4_inferior_exit);
 +
 +  add_info ("linkmap", info_linkmap_command,
 +          "Display the inferior's linkmap.");
  }
-Index: gdb-6.8.50.20090302/gdb/solib.c
+Index: gdb-6.8.91.20090925/gdb/solib.c
 ===================================================================
---- gdb-6.8.50.20090302.orig/gdb/solib.c       2009-02-21 17:14:49.000000000 +0100
-+++ gdb-6.8.50.20090302/gdb/solib.c    2009-03-07 00:30:12.000000000 +0100
-@@ -81,6 +81,8 @@ set_solib_ops (struct gdbarch *gdbarch, 
+--- gdb-6.8.91.20090925.orig/gdb/solib.c       2009-09-25 10:25:38.000000000 +0200
++++ gdb-6.8.91.20090925/gdb/solib.c    2009-09-25 10:25:45.000000000 +0200
+@@ -82,6 +82,8 @@ set_solib_ops (struct gdbarch *gdbarch, 
  
  /* external data declarations */
  
@@ -1129,7 +1034,7 @@ Index: gdb-6.8.50.20090302/gdb/solib.c
  /* FIXME: gdbarch needs to control this variable, or else every
     configuration needs to call set_solib_ops.  */
  struct target_so_ops *current_target_so_ops;
-@@ -104,6 +106,8 @@ The search path for loading non-absolute
+@@ -105,6 +107,8 @@ The search path for loading non-absolute
                    value);
  }
  
@@ -1138,35 +1043,7 @@ Index: gdb-6.8.50.20090302/gdb/solib.c
  /*
  
     GLOBAL FUNCTION
-@@ -426,10 +430,23 @@ free_so (struct so_list *so)
-       
-   if (so->abfd)
-     {
--      bfd_filename = bfd_get_filename (so->abfd);
--      if (! bfd_close (so->abfd))
--      warning (_("cannot close \"%s\": %s"),
--               bfd_filename, bfd_errmsg (bfd_get_error ()));
-+      struct objfile *objfile;
-+
-+      ALL_OBJFILES (objfile)
-+      if (objfile->obfd == so->abfd)
-+        {
-+          gdb_assert (objfile->flags & OBJF_KEEPBFD);
-+          objfile->flags &= ~OBJF_KEEPBFD;
-+          break;
-+        }
-+
-+      if (!objfile)
-+      {
-+        bfd_filename = bfd_get_filename (so->abfd);
-+        if (! bfd_close (so->abfd))
-+          warning (_("cannot close \"%s\": %s"),
-+                   bfd_filename, bfd_errmsg (bfd_get_error ()));
-+      }
-     }
-   if (bfd_filename)
-@@ -460,15 +477,40 @@ symbol_add_stub (void *arg)
+@@ -449,14 +453,38 @@ symbol_add_stub (struct so_list *so, int
    /* Have we already loaded this shared object?  */
    ALL_OBJFILES (so->objfile)
      {
@@ -1174,7 +1051,7 @@ Index: gdb-6.8.50.20090302/gdb/solib.c
 +      /* Found an already loaded shared library.  */
 +      if (strcmp (so->objfile->name, so->so_name) == 0
 +        && !so->main)
-+      return 1;
++      return;
 +      /* Found an already loaded main executable.  This could happen in
 +       two circumstances.
 +       First case: the main file has already been read in
@@ -1186,31 +1063,28 @@ Index: gdb-6.8.50.20090302/gdb/solib.c
 +      if (strcmp (so->objfile->name, so->so_name) == 0
 +        && so->main
 +        && so->main_relocated)
-       return 1;
+       return;
      }
  
    sap = build_section_addr_info_from_section_table (so->sections,
                                                      so->sections_end);
  
--  so->objfile = symbol_file_add_from_bfd (so->abfd, so->from_tty,
--                                        sap, 0, OBJF_SHARED | OBJF_KEEPBFD);
+-  so->objfile = symbol_file_add_from_bfd (so->abfd, flags, sap, OBJF_SHARED);
 +  if (so->main)
 +    {
 +      if (debug_solib)
 +        fprintf_unfiltered (gdb_stdlog,
 +                          "symbol_add_stub: adding symbols for main\n");
-+      so->objfile = symbol_file_add_from_bfd (so->abfd, /*so->from_tty*/ 0,
-+                                            sap, 1, OBJF_KEEPBFD);
++      so->objfile = symbol_file_add_from_bfd (so->abfd, (flags & ~SYMFILE_VERBOSE) | SYMFILE_MAINLINE, sap, 0);
 +      so->main_relocated = 1;
 +    }
 +  else
-+    so->objfile = symbol_file_add_from_bfd (so->abfd, so->from_tty,
-+                                          sap, 0, OBJF_SHARED | OBJF_KEEPBFD);
++    so->objfile = symbol_file_add_from_bfd (so->abfd, flags, sap, OBJF_SHARED);
 +
    free_section_addr_info (sap);
  
-   return (1);
-@@ -600,6 +642,10 @@ update_solib_list (int from_tty, struct 
+   return;
+@@ -596,6 +624,10 @@ update_solib_list (int from_tty, struct 
            }
          else
            {
@@ -1221,7 +1095,7 @@ Index: gdb-6.8.50.20090302/gdb/solib.c
              if (! strcmp (gdb->so_original_name, i->so_original_name))
                break;        
            }
-@@ -654,28 +700,7 @@ update_solib_list (int from_tty, struct 
+@@ -650,18 +682,7 @@ update_solib_list (int from_tty, struct 
        /* Fill in the rest of each of the `struct so_list' nodes.  */
        for (i = inferior; i; i = i->next)
        {
@@ -1232,26 +1106,16 @@ Index: gdb-6.8.50.20090302/gdb/solib.c
 -                      "Error while mapping shared library sections:\n",
 -                      RETURN_MASK_ALL);
 -
--        /* If requested, add the shared object's sections to the TARGET's
--           section table.  Do this immediately after mapping the object so
--           that later nodes in the list can query this object, as is needed
--           in solib-osf.c.  */
--        if (target)
--          {
--            int count = (i->sections_end - i->sections);
--            if (count > 0)
--              {
--                int space = target_resize_to_sections (target, count);
--                memcpy (target->to_sections + space,
--                        i->sections,
--                        count * sizeof (i->sections[0]));
--              }
--          }
-+        add_to_target_sections (from_tty, target, i);
+-        /* Add the shared object's sections to the current set of
+-           file section tables.  Do this immediately after mapping
+-           the object so that later nodes in the list can query this
+-           object, as is needed in solib-osf.c.  */
+-        add_target_sections (i->sections, i->sections_end);
++        add_to_target_sections (from_tty, target, i);
  
          /* Notify any observer that the shared object has been
               loaded now that we've added it to GDB's tables.  */
-@@ -771,6 +796,41 @@ solib_add (char *pattern, int from_tty, 
+@@ -771,6 +792,32 @@ solib_add (char *pattern, int from_tty, 
    }
  }
  
@@ -1267,33 +1131,24 @@ Index: gdb-6.8.50.20090302/gdb/solib.c
 +
 +  /* Fill in the rest of the `struct so_list' node.  */
 +  catch_errors (solib_map_sections, solib,
-+              "Error while mapping shared library sections:\n",
-+              RETURN_MASK_ALL);
-+
-+  /* If requested, add the shared object's sections to the TARGET's
-+     section table.  Do this immediately after mapping the object so
-+     that later nodes in the list can query this object, as is needed
-+     in solib-osf.c.  */
-+  if (target)
-+    {
-+      int count = (solib->sections_end - solib->sections);
-+      if (count > 0)
-+      {
-+        int space = target_resize_to_sections (target, count);
-+          if (debug_solib)
-+             fprintf_unfiltered (gdb_stdlog,
-+                                 "add_to_target_sections: add %s to to_sections\n",
-+                                 solib->so_original_name);
-+        memcpy (target->to_sections + space,
-+                solib->sections,
-+                count * sizeof (solib->sections[0]));
-+      }
-+    }
++             "Error while mapping shared library sections:\n",
++             RETURN_MASK_ALL);
++
++  if (debug_solib)
++     fprintf_unfiltered (gdb_stdlog,
++                       "add_to_target_sections: add %s to to_sections\n",
++                       solib->so_original_name);
++
++  /* Add the shared object's sections to the current set of
++     file section tables.  Do this immediately after mapping
++     the object so that later nodes in the list can query this
++     object, as is needed in solib-osf.c.  */
++  add_target_sections (solib->sections, solib->sections_end);
 +}
  
  /*
  
-@@ -1089,4 +1149,12 @@ This takes precedence over the environme
+@@ -1189,4 +1236,12 @@ This takes precedence over the environme
                                     reload_shared_libraries,
                                     show_solib_search_path,
                                     &setlist, &showlist);
@@ -1306,10 +1161,10 @@ Index: gdb-6.8.50.20090302/gdb/solib.c
 +                         NULL, NULL,
 +                         &setdebuglist, &showdebuglist);
  }
-Index: gdb-6.8.50.20090302/gdb/solist.h
+Index: gdb-6.8.91.20090925/gdb/solist.h
 ===================================================================
---- gdb-6.8.50.20090302.orig/gdb/solist.h      2009-02-04 09:42:11.000000000 +0100
-+++ gdb-6.8.50.20090302/gdb/solist.h   2009-03-07 00:30:12.000000000 +0100
+--- gdb-6.8.91.20090925.orig/gdb/solist.h      2009-09-25 10:25:38.000000000 +0200
++++ gdb-6.8.91.20090925/gdb/solist.h   2009-09-25 10:25:45.000000000 +0200
 @@ -61,6 +61,8 @@ struct so_list
      bfd *abfd;
      char symbols_loaded;      /* flag: symbols read in yet? */
@@ -1317,10 +1172,10 @@ Index: gdb-6.8.50.20090302/gdb/solist.h
 +    char main;                  /* flag: is this the main executable? */
 +    char main_relocated;        /* flag: has it been relocated yet? */
      struct objfile *objfile;  /* objfile for loaded lib */
-     struct section_table *sections;
-     struct section_table *sections_end;
-@@ -149,4 +151,10 @@ struct symbol *solib_global_lookup (cons
-                                   const char *linkage_name,
+     struct target_section *sections;
+     struct target_section *sections_end;
+@@ -147,4 +149,10 @@ struct symbol *solib_global_lookup (cons
+                                   const char *name,
                                    const domain_enum domain);
  
 +/* Add the list of sections in so_list to the target to_sections.  */
@@ -1330,24 +1185,24 @@ Index: gdb-6.8.50.20090302/gdb/solist.h
 +extern int debug_solib;
 +
  #endif
-Index: gdb-6.8.50.20090302/gdb/symfile-mem.c
+Index: gdb-6.8.91.20090925/gdb/symfile-mem.c
 ===================================================================
---- gdb-6.8.50.20090302.orig/gdb/symfile-mem.c 2009-03-07 00:30:08.000000000 +0100
-+++ gdb-6.8.50.20090302/gdb/symfile-mem.c      2009-03-07 00:30:12.000000000 +0100
-@@ -116,7 +116,7 @@ symbol_file_add_from_memory (struct bfd 
+--- gdb-6.8.91.20090925.orig/gdb/symfile-mem.c 2009-09-25 10:25:38.000000000 +0200
++++ gdb-6.8.91.20090925/gdb/symfile-mem.c      2009-09-25 10:25:45.000000000 +0200
+@@ -115,7 +115,7 @@ symbol_file_add_from_memory (struct bfd 
+       ++i;
        }
  
-   objf = symbol_file_add_from_bfd (nbfd, from_tty,
--                                   sai, 0, OBJF_SHARED);
-+                                   sai, 2, OBJF_SHARED);
+-  objf = symbol_file_add_from_bfd (nbfd, from_tty ? SYMFILE_VERBOSE : 0,
++  objf = symbol_file_add_from_bfd (nbfd, (from_tty ? SYMFILE_VERBOSE : 0) | SYMFILE_MAINLINE2_BOTH,
+                                    sai, OBJF_SHARED);
  
    /* This might change our ideas about frames already looked at.  */
-   reinit_frame_cache ();
-Index: gdb-6.8.50.20090302/gdb/symfile.c
+Index: gdb-6.8.91.20090925/gdb/symfile.c
 ===================================================================
---- gdb-6.8.50.20090302.orig/gdb/symfile.c     2009-03-07 00:30:09.000000000 +0100
-+++ gdb-6.8.50.20090302/gdb/symfile.c  2009-03-07 00:31:24.000000000 +0100
-@@ -47,6 +47,7 @@
+--- gdb-6.8.91.20090925.orig/gdb/symfile.c     2009-09-25 10:25:39.000000000 +0200
++++ gdb-6.8.91.20090925/gdb/symfile.c  2009-09-25 10:25:45.000000000 +0200
+@@ -49,6 +49,7 @@
  #include "readline/readline.h"
  #include "gdb_assert.h"
  #include "block.h"
@@ -1355,16 +1210,16 @@ Index: gdb-6.8.50.20090302/gdb/symfile.c
  #include "observer.h"
  #include "exec.h"
  #include "parser-defs.h"
-@@ -787,7 +788,7 @@ syms_from_objfile (struct objfile *objfi
+@@ -779,7 +780,7 @@ syms_from_objfile (struct objfile *objfi
  
    /* Now either addrs or offsets is non-zero.  */
  
 -  if (mainline)
-+  if (mainline == 1)
++  if ((add_flags & SYMFILE_MAINLINE) && !(add_flags & SYMFILE_MAINLINE2_ONLY))
      {
        /* We will modify the main symbol table, make sure that all its users
           will be cleaned up if an error occurs during symbol reading.  */
-@@ -815,7 +816,7 @@ syms_from_objfile (struct objfile *objfi
+@@ -807,7 +808,7 @@ syms_from_objfile (struct objfile *objfi
  
       We no longer warn if the lowest section is not a text segment (as
       happens for the PA64 port.  */
@@ -1373,20 +1228,30 @@ Index: gdb-6.8.50.20090302/gdb/symfile.c
      {
        asection *lower_sect;
        asection *sect;
-@@ -917,17 +918,21 @@ new_symfile_objfile (struct objfile *obj
+@@ -890,7 +891,7 @@ syms_from_objfile (struct objfile *objfi
+       init_objfile_sect_indices (objfile);
+     }
+-  (*objfile->sf->sym_read) (objfile, mainline);
++  (*objfile->sf->sym_read) (objfile, add_flags & SYMFILE_MAINLINE2_ONLY ? 2 : (add_flags & SYMFILE_MAINLINE ? 1 : 0));
+   /* Discard cleanups as symbol reading was successful.  */
+@@ -909,17 +910,22 @@ new_symfile_objfile (struct objfile *obj
    /* If this is the main symbol file we have to clean up all users of the
       old main symbol file. Otherwise it is sufficient to fixup all the
       breakpoints that may have been redefined by this symbol file.  */
--  if (mainline)
-+  if (mainline == 1)
+-  if (add_flags & SYMFILE_MAINLINE)
++  if (add_flags & SYMFILE_MAINLINE && !(add_flags & SYMFILE_MAINLINE2_ONLY))
      {
        /* OK, make it the "real" symbol file.  */
        symfile_objfile = objfile;
  
        clear_symtab_users ();
      }
--  else
-+  else if (mainline == 0)
+-  else if ((add_flags & SYMFILE_DEFER_BP_RESET) == 0)
++  else if ((add_flags & SYMFILE_DEFER_BP_RESET) == 0
++           && (add_flags & SYMFILE_MAINLINE2_BOTH) == 0)
      {
        breakpoint_re_set ();
      }
@@ -1396,28 +1261,27 @@ Index: gdb-6.8.50.20090302/gdb/symfile.c
 +    }
  
    /* We're done reading the symbol file; finish off complaints.  */
-   clear_complaints (&symfile_complaints, 0, verbo);
-@@ -980,7 +985,7 @@ symbol_file_add_with_addrs_or_offsets (b
+   clear_complaints (&symfile_complaints, 0, add_flags & SYMFILE_VERBOSE);
+@@ -973,7 +979,7 @@ symbol_file_add_with_addrs_or_offsets (b
    /* Give user a chance to burp if we'd be
       interactively wiping out any existing symbols.  */
  
--  if (mainline
-+  if (mainline == 1
+-  if ((add_flags & SYMFILE_MAINLINE)
++  if ((add_flags & SYMFILE_MAINLINE) && !(add_flags & SYMFILE_MAINLINE2_ONLY)
+       && (have_full_symbols () || have_partial_symbols ())
        && from_tty
        && (have_full_symbols () || have_partial_symbols ())
-       && !query (_("Load new symbol table from \"%s\"? "), name))
-@@ -1175,6 +1180,10 @@ symbol_file_clear (int from_tty)
+@@ -1163,6 +1169,9 @@ symbol_file_clear (int from_tty)
                    symfile_objfile->name)
          : !query (_("Discard symbol table? "))))
      error (_("Not confirmed."));
 +#ifdef CLEAR_SOLIB
 +      CLEAR_SOLIB ();
 +#endif
-+
-     free_all_objfiles ();
  
-     /* solib descriptors may have handles to objfiles.  Since their
-@@ -3275,6 +3284,8 @@ reread_symbols (void)
+   free_all_objfiles ();
+@@ -3367,6 +3376,8 @@ reread_symbols (void)
              /* Discard cleanups as symbol reading was successful.  */
              discard_cleanups (old_cleanups);
  
@@ -1426,11 +1290,11 @@ Index: gdb-6.8.50.20090302/gdb/symfile.c
              /* If the mtime has changed between the time we set new_modtime
                 and now, we *want* this to be out of date, so don't call stat
                 again now.  */
-Index: gdb-6.8.50.20090302/gdb/target.h
+Index: gdb-6.8.91.20090925/gdb/target.h
 ===================================================================
---- gdb-6.8.50.20090302.orig/gdb/target.h      2009-03-07 00:30:09.000000000 +0100
-+++ gdb-6.8.50.20090302/gdb/target.h   2009-03-07 00:30:12.000000000 +0100
-@@ -542,7 +542,7 @@ struct target_ops
+--- gdb-6.8.91.20090925.orig/gdb/target.h      2009-09-25 10:25:38.000000000 +0200
++++ gdb-6.8.91.20090925/gdb/target.h   2009-09-25 10:25:45.000000000 +0200
+@@ -545,7 +545,7 @@ struct target_ops
         Return -1 if there is insufficient buffer for a whole entry.
         Return 1 if an entry was read into *TYPEP and *VALP.  */
      int (*to_auxv_parse) (struct target_ops *ops, gdb_byte **readptr,
@@ -1439,3 +1303,48 @@ Index: gdb-6.8.50.20090302/gdb/target.h
  
      /* Search SEARCH_SPACE_LEN bytes beginning at START_ADDR for the
         sequence of bytes in PATTERN with length PATTERN_LEN.
+Index: gdb-6.8.91.20090925/gdb/symfile.h
+===================================================================
+--- gdb-6.8.91.20090925.orig/gdb/symfile.h     2009-09-25 10:25:39.000000000 +0200
++++ gdb-6.8.91.20090925/gdb/symfile.h  2009-09-25 10:25:45.000000000 +0200
+@@ -229,7 +229,13 @@ enum symfile_add_flags
+     SYMFILE_MAINLINE = 1 << 2,
+     /* Do not call breakpoint_re_set when adding this symbol file.  */
+-    SYMFILE_DEFER_BP_RESET = 1 << 3
++    SYMFILE_DEFER_BP_RESET = 1 << 3,
++
++    /* Red Hat PIE patch: Like SYMFILE_MAINLINE but for mainline == 2.
++       Former code was checking `if (mainline)' being satisfied both by
++       standard 1 and rare 2, simulate it here.  */
++    SYMFILE_MAINLINE2_ONLY = 1 << 4,
++    SYMFILE_MAINLINE2_BOTH = SYMFILE_MAINLINE2_ONLY | SYMFILE_MAINLINE
+   };
+ extern void syms_from_objfile (struct objfile *,
+Index: gdb-6.8.91.20090925/gdb/infcmd.c
+===================================================================
+--- gdb-6.8.91.20090925.orig/gdb/infcmd.c      2009-09-25 10:25:39.000000000 +0200
++++ gdb-6.8.91.20090925/gdb/infcmd.c   2009-09-25 10:25:45.000000000 +0200
+@@ -2308,6 +2308,9 @@ attach_command_post_wait (char *args, in
+   post_create_inferior (&current_target, from_tty);
++  /* Undo the disable from post_create_inferior.  */
++  enable_breakpoints_after_startup ();
++
+   /* Install inferior's terminal modes.  */
+   target_terminal_inferior ();
+Index: gdb-6.8.91.20090925/gdb/linux-tdep.c
+===================================================================
+--- gdb-6.8.91.20090925.orig/gdb/linux-tdep.c  2009-08-04 22:41:13.000000000 +0200
++++ gdb-6.8.91.20090925/gdb/linux-tdep.c       2009-09-25 10:25:45.000000000 +0200
+@@ -163,5 +163,7 @@ in this session.\n"));
+ void
+ _initialize_linux_tdep (void)
+ {
++#if 0 /* gdb-6.3-pie-20050110.patch */
+   observer_attach_executable_changed (check_is_pie_binary);
++#endif
+ }
index 99529db089eb213934dc79024bc6107f2ffa0f70..8e6c39115d386cde183698ee5dab4e0adf946609 100644 (file)
@@ -6,11 +6,11 @@
        use to skip over first half of a GNU/Linux syscall and update
        "func_start".
 
-Index: gdb-6.8/gdb/rs6000-tdep.c
+Index: gdb-6.8.50.20090802/gdb/rs6000-tdep.c
 ===================================================================
---- gdb-6.8.orig/gdb/rs6000-tdep.c     2008-02-20 15:34:43.000000000 +0100
-+++ gdb-6.8/gdb/rs6000-tdep.c  2008-07-14 10:25:29.000000000 +0200
-@@ -124,6 +124,7 @@ static const char *powerpc_vector_abi_st
+--- gdb-6.8.50.20090802.orig/gdb/rs6000-tdep.c 2009-07-31 17:23:20.000000000 +0200
++++ gdb-6.8.50.20090802/gdb/rs6000-tdep.c      2009-08-03 09:52:39.000000000 +0200
+@@ -126,6 +126,7 @@ static const char *powerpc_vector_abi_st
  
  struct rs6000_framedata
    {
@@ -18,7 +18,7 @@ Index: gdb-6.8/gdb/rs6000-tdep.c
      int offset;                       /* total size of frame --- the distance
                                   by which we decrement sp to allocate
                                   the frame */
-@@ -1262,7 +1263,6 @@ static CORE_ADDR
+@@ -1488,7 +1489,6 @@ static CORE_ADDR
  skip_prologue (struct gdbarch *gdbarch, CORE_ADDR pc, CORE_ADDR lim_pc,
               struct rs6000_framedata *fdata)
  {
@@ -26,7 +26,7 @@ Index: gdb-6.8/gdb/rs6000-tdep.c
    CORE_ADDR last_prologue_pc = pc;
    CORE_ADDR li_found_pc = 0;
    gdb_byte buf[4];
-@@ -1280,11 +1280,13 @@ skip_prologue (struct gdbarch *gdbarch, 
+@@ -1506,12 +1506,14 @@ skip_prologue (struct gdbarch *gdbarch, 
    int minimal_toc_loaded = 0;
    int prev_insn_was_prologue_insn = 1;
    int num_skip_non_prologue_insns = 0;
@@ -34,15 +34,16 @@ Index: gdb-6.8/gdb/rs6000-tdep.c
    int r0_contains_arg = 0;
    const struct bfd_arch_info *arch_info = gdbarch_bfd_arch_info (gdbarch);
    struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
+   enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
  
    memset (fdata, 0, sizeof (struct rs6000_framedata));
 +  fdata->func_start = pc;
    fdata->saved_gpr = -1;
    fdata->saved_fpr = -1;
    fdata->saved_vr = -1;
-@@ -1313,6 +1315,55 @@ skip_prologue (struct gdbarch *gdbarch, 
+@@ -1545,6 +1547,55 @@ skip_prologue (struct gdbarch *gdbarch, 
        break;
-       op = extract_unsigned_integer (buf, 4);
+       op = extract_unsigned_integer (buf, 4, byte_order);
  
 +      /* A PPC64 GNU/Linux system call function is split into two
 +       sub-functions: a non-threaded fast-path (__NAME_nocancel)
@@ -96,7 +97,7 @@ Index: gdb-6.8/gdb/rs6000-tdep.c
        if ((op & 0xfc1fffff) == 0x7c0802a6)
        {                       /* mflr Rx */
          /* Since shared library / PIC code, which needs to get its
-@@ -1486,9 +1537,9 @@ skip_prologue (struct gdbarch *gdbarch, 
+@@ -1726,9 +1777,9 @@ skip_prologue (struct gdbarch *gdbarch, 
             we have no line table information or the line info tells
             us that the subroutine call is not part of the line
             associated with the prologue.  */
index 046633e016e475616f98bce181790779be1760b0..7226c0d8becdb78925de8f87e49d935a981c353b 100644 (file)
@@ -8,11 +8,11 @@
 
        Port to GDB-6.7.
        
-Index: gdb-6.7/gdb/solib-svr4.c
+Index: gdb-6.8.50.20090802/gdb/solib-svr4.c
 ===================================================================
---- gdb-6.7.orig/gdb/solib-svr4.c      2007-10-09 20:03:30.000000000 +0200
-+++ gdb-6.7/gdb/solib-svr4.c   2007-10-12 22:34:03.000000000 +0200
-@@ -1089,7 +1089,15 @@ enable_break (void)
+--- gdb-6.8.50.20090802.orig/gdb/solib-svr4.c  2009-08-03 10:03:36.000000000 +0200
++++ gdb-6.8.50.20090802/gdb/solib-svr4.c       2009-08-03 10:51:15.000000000 +0200
+@@ -1431,7 +1431,15 @@ enable_break (struct svr4_info *info)
        {
          sym_addr = bfd_lookup_symbol (tmp_bfd, *bkpt_namep);
          if (sym_addr != 0)
@@ -20,7 +20,7 @@ Index: gdb-6.7/gdb/solib-svr4.c
 +          {
 +            /* The symbol might be a descriptor, convert to into the
 +               corresponding code address.  */
-+            sym_addr = gdbarch_convert_from_func_ptr_addr (current_gdbarch,
++            sym_addr = gdbarch_convert_from_func_ptr_addr (target_gdbarch,
 +                                                           sym_addr,
 +                                                           tmp_bfd_target);
 +            if (sym_addr != 0)
index ab645b4b0740480e8b65c106e876b8164ed76608..823c38f6a0bc0b80bb19bdf6c5d87bdd80cb16b0 100644 (file)
 
         * gdb.texinfo (File Options): Document --readnever.
 
-Index: gdb-6.8.50.20090228/gdb/doc/gdb.texinfo
+Index: gdb-6.8.50.20090811/gdb/doc/gdb.texinfo
 ===================================================================
---- gdb-6.8.50.20090228.orig/gdb/doc/gdb.texinfo       2009-03-02 01:01:15.000000000 +0100
-+++ gdb-6.8.50.20090228/gdb/doc/gdb.texinfo    2009-03-02 01:01:23.000000000 +0100
-@@ -988,6 +988,12 @@ Read each symbol file's entire symbol ta
+--- gdb-6.8.50.20090811.orig/gdb/doc/gdb.texinfo       2009-08-13 10:14:15.000000000 +0200
++++ gdb-6.8.50.20090811/gdb/doc/gdb.texinfo    2009-08-13 10:14:18.000000000 +0200
+@@ -991,6 +991,12 @@ Read each symbol file's entire symbol ta
  the default, which is to read it incrementally as it is needed.
  This makes startup slower, but makes future operations faster.
  
@@ -28,11 +28,11 @@ Index: gdb-6.8.50.20090228/gdb/doc/gdb.texinfo
  @end table
  
  @node Mode Options
-Index: gdb-6.8.50.20090228/gdb/main.c
+Index: gdb-6.8.50.20090811/gdb/main.c
 ===================================================================
---- gdb-6.8.50.20090228.orig/gdb/main.c        2009-03-02 01:01:17.000000000 +0100
-+++ gdb-6.8.50.20090228/gdb/main.c     2009-03-02 01:01:23.000000000 +0100
-@@ -427,6 +427,7 @@ captured_main (void *data)
+--- gdb-6.8.50.20090811.orig/gdb/main.c        2009-08-13 10:14:15.000000000 +0200
++++ gdb-6.8.50.20090811/gdb/main.c     2009-08-13 10:14:18.000000000 +0200
+@@ -382,6 +382,7 @@ captured_main (void *data)
        {"xdb", no_argument, &xdb_commands, 1},
        {"dbx", no_argument, &dbx_commands, 1},
        {"readnow", no_argument, &readnow_symbol_files, 1},
@@ -40,7 +40,7 @@ Index: gdb-6.8.50.20090228/gdb/main.c
        {"r", no_argument, &readnow_symbol_files, 1},
        {"quiet", no_argument, &quiet, 1},
        {"q", no_argument, &quiet, 1},
-@@ -1070,6 +1071,7 @@ Options:\n\n\
+@@ -1030,6 +1031,7 @@ Options:\n\n\
    fputs_unfiltered (_("\
    --quiet            Do not print version number on startup.\n\
    --readnow          Fully read symbol files on first access.\n\
@@ -48,11 +48,11 @@ Index: gdb-6.8.50.20090228/gdb/main.c
  "), stream);
    fputs_unfiltered (_("\
    --se=FILE          Use FILE as symbol file and executable file.\n\
-Index: gdb-6.8.50.20090228/gdb/symfile.c
+Index: gdb-6.8.50.20090811/gdb/symfile.c
 ===================================================================
---- gdb-6.8.50.20090228.orig/gdb/symfile.c     2009-03-02 01:01:17.000000000 +0100
-+++ gdb-6.8.50.20090228/gdb/symfile.c  2009-03-02 01:01:23.000000000 +0100
-@@ -77,6 +77,7 @@ static void clear_symtab_users_cleanup (
+--- gdb-6.8.50.20090811.orig/gdb/symfile.c     2009-08-13 10:14:15.000000000 +0200
++++ gdb-6.8.50.20090811/gdb/symfile.c  2009-08-13 10:14:18.000000000 +0200
+@@ -79,6 +79,7 @@ static void clear_symtab_users_cleanup (
  
  /* Global variables owned by this file */
  int readnow_symbol_files;     /* Read full symbols immediately */
@@ -60,32 +60,32 @@ Index: gdb-6.8.50.20090228/gdb/symfile.c
  
  /* External variables and functions referenced. */
  
-Index: gdb-6.8.50.20090228/gdb/dwarf2read.c
+Index: gdb-6.8.50.20090811/gdb/dwarf2read.c
 ===================================================================
---- gdb-6.8.50.20090228.orig/gdb/dwarf2read.c  2009-03-02 01:01:15.000000000 +0100
-+++ gdb-6.8.50.20090228/gdb/dwarf2read.c       2009-03-02 01:01:36.000000000 +0100
-@@ -49,6 +49,7 @@
- #include "f-lang.h"
- #include "c-lang.h"
- #include "typeprint.h"
+--- gdb-6.8.50.20090811.orig/gdb/dwarf2read.c  2009-08-13 10:14:15.000000000 +0200
++++ gdb-6.8.50.20090811/gdb/dwarf2read.c       2009-08-13 10:14:29.000000000 +0200
+@@ -53,6 +53,7 @@
+ #include "jv-lang.h"
+ #include "vec.h"
+ #include "block.h"
 +#include "top.h"
  
  #include <fcntl.h>
  #include "gdb_string.h"
-@@ -1161,7 +1162,8 @@ dwarf2_has_info (struct objfile *objfile
-   dwarf_aranges_section = 0;
-   
-   bfd_map_over_sections (objfile->obfd, dwarf2_locate_sections, &update_sizes);
--  return (dwarf_info_section != NULL && dwarf_abbrev_section != NULL);
+@@ -1245,7 +1246,8 @@ dwarf2_has_info (struct objfile *objfile
+       bfd_map_over_sections (objfile->obfd, dwarf2_locate_sections, NULL);
+     }
+-  return (dwarf2_per_objfile->info.asection != NULL
 +  return !readnever_symbol_files
-+       && dwarf_info_section != NULL && dwarf_abbrev_section != NULL;
++      && (dwarf2_per_objfile->info.asection != NULL
+         && dwarf2_per_objfile->abbrev.asection != NULL);
  }
  
- /* When loading sections, we can either look for ".<name>", or for
-Index: gdb-6.8.50.20090228/gdb/top.h
+Index: gdb-6.8.50.20090811/gdb/top.h
 ===================================================================
---- gdb-6.8.50.20090228.orig/gdb/top.h 2009-01-03 06:57:53.000000000 +0100
-+++ gdb-6.8.50.20090228/gdb/top.h      2009-03-02 01:01:23.000000000 +0100
+--- gdb-6.8.50.20090811.orig/gdb/top.h 2009-01-03 06:57:53.000000000 +0100
++++ gdb-6.8.50.20090811/gdb/top.h      2009-08-13 10:14:18.000000000 +0200
 @@ -59,6 +59,7 @@ extern void set_prompt (char *);
  
  /* From random places.  */
diff --git a/gdb-6.3-removebp-20041130.patch b/gdb-6.3-removebp-20041130.patch
deleted file mode 100644 (file)
index 093b3c2..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-2004-11-30  Jeff Johnston  <jjohnstn@redhat.com> 
-
-       * breakpoint.c (remove_breakpoints): Continue removing breakpoints
-       even if an error occurs.  Remove a failure code for the last failure
-       only.
-
---- gdb+dejagnu-20040607/gdb/breakpoint.c.fix2 Tue Nov 30 18:01:33 2004
-+++ gdb+dejagnu-20040607/gdb/breakpoint.c      Tue Nov 30 18:06:01 2004
-@@ -1297,6 +1297,7 @@ remove_breakpoints (void)
- {
-   struct bp_location *b;
-   int val;
-+  int return_val = 0;
-   ALL_BP_LOCATIONS (b)
-   {
-@@ -1304,10 +1305,10 @@ remove_breakpoints (void)
-       {
-       val = remove_breakpoint (b, mark_uninserted);
-       if (val != 0)
--        return val;
-+        return_val = val;
-       }
-   }
--  return 0;
-+  return return_val;
- }
- int
index 5c238044da690c4e0ae90da573ff613a31a0eeca..0a121c30f898ec64bd0e280051c692bdb09fa70d 100644 (file)
@@ -3,11 +3,53 @@
         From Jeff Johnston <jjohnstn@redhat.com>
         * gdb.arch/ia64-libunwind.exp: New file.
         * gdb.arch/ia64-libunwind.c: New file.
+
+2004-08-03  Jeff Johnston  <jjohnstn@redhat.com>
+   
+        * gdb.arch/ia64-libunwind.exp: Fix test string to match
+       current code base.
+
+       [ acquire_unwind_info -> ia64_find_proc_info_x ]
+
+2009-04-30  Jan Kratochvil  <jan.kratochvil@redhat.com>
+
+       Remove a race from send_gdb "COMMAND\n".
+       Cleanup.
+       Merge in: Patch4: gdb-6.3-rh-testlibunwind1fix-20041202.patch
  
---- /dev/null  Thu Apr 11 10:25:15 2002
-+++ gdb+dejagnu-20040223/gdb/testsuite/gdb.arch/ia64-libunwind.exp     Mon Nov 17 15:57:04 2003
-@@ -0,0 +1,55 @@
-+#   Copyright 2003 Free Software Foundation, Inc.
+--- /dev/null  2009-04-19 08:52:54.499000000 +0200
++++ gdb-6.8/gdb/testsuite/gdb.arch/ia64-libunwind.c    2009-04-30 19:15:16.000000000 +0200
+@@ -0,0 +1,26 @@
++/* Copyright 2003, 2009 Free Software Foundation, Inc.
++
++   This file is part of GDB.
++
++   This program is free software; you can redistribute it and/or modify
++   it under the terms of the GNU General Public License as published by
++   the Free Software Foundation; either version 3 of the License, or
++   (at your option) any later version.
++
++   This program is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++   GNU General Public License for more details.
++
++   You should have received a copy of the GNU General Public License
++   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
++
++#include <stdio.h>
++
++int
++main ()
++{
++  printf ("hello world\n");
++ 
++  return 0;
++}
+--- /dev/null  2009-04-19 08:52:54.499000000 +0200
++++ gdb-6.8/gdb/testsuite/gdb.arch/ia64-libunwind.exp  2009-04-30 19:19:22.000000000 +0200
+@@ -0,0 +1,52 @@
++# Copyright 2003, 2009 Free Software Foundation, Inc.
 +
 +# This program is free software; you can redistribute it and/or modify
 +# it under the terms of the GNU General Public License as published by
 +
 +# This file was written by Jeff Johnston (jjohnstn@redhat.com)
 +
-+if $tracelevel then {
-+    strace $tracelevel
-+}
-+
-+#
-+# test running programs
-+#
-+set prms_id 0
-+set bug_id 0
-+
 +if ![istarget "ia64-*-*"] then {
 +    return
 +}
 +gdb_start
 +gdb_reinitialize_dir $srcdir/$subdir
 +gdb_load ${binfile}
-+send_gdb "set debug arch 1\n"
-+send_gdb "break main\n"
-+gdb_test "run" ".*acquire_unwind_info.*"
-+ 
---- /dev/null  Thu Apr 11 10:25:15 2002
-+++ gdb+dejagnu-20040223/gdb/testsuite/gdb.arch/ia64-libunwind.c       Mon Nov 17 15:58:27 2003
-@@ -0,0 +1,9 @@
-+#include <stdio.h>
 +
-+int main()
-+{
-+  printf ("hello world\n");
-+ 
-+  return 0;
-+}
++gdb_test "set debug arch 1"
++gdb_breakpoint "main"
++gdb_run_cmd
 +
++set test "libunwind message"
++gdb_test_multiple "" $test {
++    -re "ia64_find_proc_info_x.*$gdb_prompt $" {
++      pass $test
++    }
++}
diff --git a/gdb-6.3-rh-testlibunwind1fix-20041202.patch b/gdb-6.3-rh-testlibunwind1fix-20041202.patch
deleted file mode 100644 (file)
index a30617c..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-2004-08-03  Jeff Johnston  <jjohnstn@redhat.com>
-   
-        * gdb.arch/ia64-libunwind.exp: Fix test string to match
-       current code base.
-
---- gdb+dejagnu-20040607/gdb/testsuite/gdb.arch/ia64-libunwind.exp.fix Tue Aug  3 18:29:22 2004
-+++ gdb+dejagnu-20040607/gdb/testsuite/gdb.arch/ia64-libunwind.exp     Tue Aug  3 18:41:01 2004
-@@ -51,5 +51,5 @@ gdb_reinitialize_dir $srcdir/$subdir
- gdb_load ${binfile}
- send_gdb "set debug arch 1\n"
- send_gdb "break main\n"
--gdb_test "run" ".*acquire_unwind_info.*"
-+gdb_test "run" ".*ia64_find_proc_info_x.*"
-  
index 48bb8d9e4fd86538780f0e97f8eaa1200a210a25..6ba24a0cc12a0257222e6d88f0e1c20d99507f3e 100644 (file)
@@ -1,40 +1,40 @@
-Index: gdb-6.8.50.20081128/gdb/testsuite/configure.ac
+Index: gdb-6.8.50.20090909/gdb/testsuite/configure.ac
 ===================================================================
---- gdb-6.8.50.20081128.orig/gdb/testsuite/configure.ac        2008-12-09 17:02:39.000000000 +0100
-+++ gdb-6.8.50.20081128/gdb/testsuite/configure.ac     2008-12-09 17:02:55.000000000 +0100
-@@ -116,6 +116,6 @@ AC_OUTPUT([Makefile \
+--- gdb-6.8.50.20090909.orig/gdb/testsuite/configure.ac        2009-07-31 17:38:16.000000000 +0200
++++ gdb-6.8.50.20090909/gdb/testsuite/configure.ac     2009-09-09 19:06:01.000000000 +0200
+@@ -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.mi/Makefile gdb.modula2/Makefile \
 -  gdb.objc/Makefile gdb.opt/Makefile gdb.pascal/Makefile \
 +  gdb.objc/Makefile gdb.opt/Makefile gdb.pascal/Makefile gdb.pie/Makefile \
-   gdb.python/Makefile \
+   gdb.python/Makefile gdb.reverse/Makefile \
    gdb.threads/Makefile gdb.trace/Makefile gdb.xml/Makefile])
-Index: gdb-6.8.50.20081128/gdb/testsuite/configure
+Index: gdb-6.8.50.20090909/gdb/testsuite/configure
 ===================================================================
---- gdb-6.8.50.20081128.orig/gdb/testsuite/configure   2008-12-09 17:02:39.000000000 +0100
-+++ gdb-6.8.50.20081128/gdb/testsuite/configure        2008-12-09 17:02:55.000000000 +0100
-@@ -3131,7 +3131,7 @@ done
+--- gdb-6.8.50.20090909.orig/gdb/testsuite/configure   2009-08-22 18:56:43.000000000 +0200
++++ gdb-6.8.50.20090909/gdb/testsuite/configure        2009-09-09 19:06:27.000000000 +0200
+@@ -3515,7 +3515,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.objc/Makefile gdb.opt/Makefile gdb.pascal/Makefile gdb.python/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.objc/Makefile gdb.opt/Makefile gdb.pascal/Makefile gdb.pie/Makefile gdb.python/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.objc/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.objc/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"
  cat >confcache <<\_ACEOF
  # This file is a shell script that caches the results of configure
- # tests run on this system so they can be shared between configure
-@@ -3698,6 +3698,7 @@ do
-   "gdb.objc/Makefile" ) CONFIG_FILES="$CONFIG_FILES gdb.objc/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.threads/Makefile" ) CONFIG_FILES="$CONFIG_FILES gdb.threads/Makefile" ;;
-   "gdb.trace/Makefile" ) CONFIG_FILES="$CONFIG_FILES gdb.trace/Makefile" ;;
-Index: gdb-6.8.50.20081128/gdb/testsuite/gdb.pie/attach.c
+@@ -4231,6 +4231,7 @@ do
+     "gdb.objc/Makefile") CONFIG_FILES="$CONFIG_FILES gdb.objc/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-6.8.50.20090909/gdb/testsuite/gdb.pie/attach.c
 ===================================================================
 --- /dev/null  1970-01-01 00:00:00.000000000 +0000
-+++ gdb-6.8.50.20081128/gdb/testsuite/gdb.pie/attach.c 2008-12-09 17:02:55.000000000 +0100
++++ gdb-6.8.50.20090909/gdb/testsuite/gdb.pie/attach.c 2009-09-09 19:06:01.000000000 +0200
 @@ -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-6.8.50.20081128/gdb/testsuite/gdb.pie/attach.c
 +    }
 +  return 0;
 +}
-Index: gdb-6.8.50.20081128/gdb/testsuite/gdb.pie/attach2.c
+Index: gdb-6.8.50.20090909/gdb/testsuite/gdb.pie/attach2.c
 ===================================================================
 --- /dev/null  1970-01-01 00:00:00.000000000 +0000
-+++ gdb-6.8.50.20081128/gdb/testsuite/gdb.pie/attach2.c        2008-12-09 17:02:55.000000000 +0100
++++ gdb-6.8.50.20090909/gdb/testsuite/gdb.pie/attach2.c        2009-09-09 19:06:01.000000000 +0200
 @@ -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-6.8.50.20081128/gdb/testsuite/gdb.pie/attach2.c
 +    }
 +  return (0);
 +}
-Index: gdb-6.8.50.20081128/gdb/testsuite/gdb.pie/break.c
+Index: gdb-6.8.50.20090909/gdb/testsuite/gdb.pie/break.c
 ===================================================================
 --- /dev/null  1970-01-01 00:00:00.000000000 +0000
-+++ gdb-6.8.50.20081128/gdb/testsuite/gdb.pie/break.c  2008-12-09 17:02:55.000000000 +0100
++++ gdb-6.8.50.20090909/gdb/testsuite/gdb.pie/break.c  2009-09-09 19:06:01.000000000 +0200
 @@ -0,0 +1,146 @@
 +/* This testcase is part of GDB, the GNU debugger.
 +
@@ -236,10 +236,10 @@ Index: gdb-6.8.50.20081128/gdb/testsuite/gdb.pie/break.c
 +    }
 +  return 0;
 +}
-Index: gdb-6.8.50.20081128/gdb/testsuite/gdb.pie/break1.c
+Index: gdb-6.8.50.20090909/gdb/testsuite/gdb.pie/break1.c
 ===================================================================
 --- /dev/null  1970-01-01 00:00:00.000000000 +0000
-+++ gdb-6.8.50.20081128/gdb/testsuite/gdb.pie/break1.c 2008-12-09 17:02:55.000000000 +0100
++++ gdb-6.8.50.20090909/gdb/testsuite/gdb.pie/break1.c 2009-09-09 19:06:01.000000000 +0200
 @@ -0,0 +1,44 @@
 +/* This testcase is part of GDB, the GNU debugger.
 +
@@ -285,10 +285,10 @@ Index: gdb-6.8.50.20081128/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-6.8.50.20081128/gdb/testsuite/gdb.pie/coremaker.c
+Index: gdb-6.8.50.20090909/gdb/testsuite/gdb.pie/coremaker.c
 ===================================================================
 --- /dev/null  1970-01-01 00:00:00.000000000 +0000
-+++ gdb-6.8.50.20081128/gdb/testsuite/gdb.pie/coremaker.c      2008-12-09 17:02:55.000000000 +0100
++++ gdb-6.8.50.20090909/gdb/testsuite/gdb.pie/coremaker.c      2009-09-09 19:06:01.000000000 +0200
 @@ -0,0 +1,142 @@
 +/* Copyright 1992, 1993, 1994, 1995, 1996, 1999
 +   Free Software Foundation, Inc.
@@ -432,10 +432,10 @@ Index: gdb-6.8.50.20081128/gdb/testsuite/gdb.pie/coremaker.c
 +  return 0;
 +}
 +
-Index: gdb-6.8.50.20081128/gdb/testsuite/gdb.pie/attach.exp
+Index: gdb-6.8.50.20090909/gdb/testsuite/gdb.pie/attach.exp
 ===================================================================
 --- /dev/null  1970-01-01 00:00:00.000000000 +0000
-+++ gdb-6.8.50.20081128/gdb/testsuite/gdb.pie/attach.exp       2008-12-09 17:02:55.000000000 +0100
++++ gdb-6.8.50.20090909/gdb/testsuite/gdb.pie/attach.exp       2009-09-09 19:06:01.000000000 +0200
 @@ -0,0 +1,432 @@
 +#   Copyright 1997, 1999, 2002 Free Software Foundation, Inc.
 +
@@ -869,11 +869,11 @@ Index: gdb-6.8.50.20081128/gdb/testsuite/gdb.pie/attach.exp
 +do_call_attach_tests
 +
 +return 0
-Index: gdb-6.8.50.20081128/gdb/testsuite/gdb.pie/break.exp
+Index: gdb-6.8.50.20090909/gdb/testsuite/gdb.pie/break.exp
 ===================================================================
 --- /dev/null  1970-01-01 00:00:00.000000000 +0000
-+++ gdb-6.8.50.20081128/gdb/testsuite/gdb.pie/break.exp        2008-12-09 17:24:34.000000000 +0100
-@@ -0,0 +1,973 @@
++++ gdb-6.8.50.20090909/gdb/testsuite/gdb.pie/break.exp        2009-09-09 19:06:01.000000000 +0200
+@@ -0,0 +1,977 @@
 +#   Copyright 1988, 1990, 1991, 1992, 1994, 1995, 1996, 1997, 1998, 1999,
 +#   2000, 2002, 2003, 2004
 +#   Free Software Foundation, Inc.
@@ -1055,6 +1055,9 @@ Index: gdb-6.8.50.20081128/gdb/testsuite/gdb.pie/break.exp
 +set bp_location8 [gdb_get_line_number "set breakpoint 8 here" $srcfile1]
 +set bp_location9 [gdb_get_line_number "set breakpoint 9 here" $srcfile1]
 +
++# Test a pending breakpoint in PIE executable does not crash later GDB.
++gdb_breakpoint "non_existent_function" allow-pending
++
 +gdb_test "info break" \
 +    "Num\[ \]+Type\[ \]+Disp Enb Address\[ \]+What.*
 +\[0-9\]+\[\t \]+breakpoint     keep y.* in main at .*$srcfile:$main_line.*
@@ -1064,7 +1067,8 @@ Index: gdb-6.8.50.20081128/gdb/testsuite/gdb.pie/break.exp
 +\[0-9\]+\[\t \]+breakpoint     keep y.* in main at .*$srcfile:$bp_location1.*
 +\[0-9\]+\[\t \]+breakpoint     keep y.* in main at .*$srcfile:$bp_location2.*
 +\[0-9\]+\[\t \]+breakpoint     keep y.* in multi_line_if_conditional at .*$srcfile:$bp_location3.*
-+\[0-9\]+\[\t \]+breakpoint     keep y.* in multi_line_while_conditional at .*$srcfile:$bp_location4" \
++\[0-9\]+\[\t \]+breakpoint     keep y.* in multi_line_while_conditional at .*$srcfile:$bp_location4.*
++\[0-9\]+\[\t \]+breakpoint     keep y.* <PENDING> *non_existent_function" \
 +    "breakpoint info"
 +
 +# FIXME: The rest of this test doesn't work with anything that can't
@@ -1490,7 +1494,7 @@ Index: gdb-6.8.50.20081128/gdb/testsuite/gdb.pie/break.exp
 +}
 +send_gdb "print marker2(99)\n"
 +gdb_expect {
-+  -re "The program being debugged stopped while in a function called from GDB.\r\nWhen the function .marker2$proto. is done executing, GDB will silently\r\nstop .instead of continuing to evaluate the expression containing\r\nthe function call...*$gdb_prompt $"\
++  -re "The program being debugged stopped while in a function called from GDB.\r\nEvaluation of the expression containing the function\r\n.marker2$proto. will be abandoned.\r\nWhen the function is done executing, GDB will silently stop.\r\n$gdb_prompt $"\
 +          {pass "hit breakpoint on called function"}
 +  -re "$gdb_prompt $"\
 +          {fail "hit breakpoint on called function"}
@@ -1847,10 +1851,10 @@ Index: gdb-6.8.50.20081128/gdb/testsuite/gdb.pie/break.exp
 +    send_gdb "set args main\n"
 +    gdb_expect -re ".*$gdb_prompt $" {}
 +}
-Index: gdb-6.8.50.20081128/gdb/testsuite/gdb.pie/corefile.exp
+Index: gdb-6.8.50.20090909/gdb/testsuite/gdb.pie/corefile.exp
 ===================================================================
 --- /dev/null  1970-01-01 00:00:00.000000000 +0000
-+++ gdb-6.8.50.20081128/gdb/testsuite/gdb.pie/corefile.exp     2008-12-09 17:02:55.000000000 +0100
++++ gdb-6.8.50.20090909/gdb/testsuite/gdb.pie/corefile.exp     2009-09-09 19:06:01.000000000 +0200
 @@ -0,0 +1,243 @@
 +# Copyright 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000
 +# Free Software Foundation, Inc.
@@ -2095,10 +2099,10 @@ Index: gdb-6.8.50.20081128/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-6.8.50.20081128/gdb/testsuite/gdb.pie/Makefile.in
+Index: gdb-6.8.50.20090909/gdb/testsuite/gdb.pie/Makefile.in
 ===================================================================
 --- /dev/null  1970-01-01 00:00:00.000000000 +0000
-+++ gdb-6.8.50.20081128/gdb/testsuite/gdb.pie/Makefile.in      2008-12-09 17:02:55.000000000 +0100
++++ gdb-6.8.50.20090909/gdb/testsuite/gdb.pie/Makefile.in      2009-09-09 19:06:01.000000000 +0200
 @@ -0,0 +1,19 @@
 +VPATH = @srcdir@
 +srcdir = @srcdir@
index 2d7965cc4982af2ad63f42b3c23a4ca139acb1f4..859638df7b746894679bba8fe173707877367aea 100644 (file)
@@ -42,7 +42,7 @@ FIXME: The testcase does not expects multiple watchpoints hits per one stop.
 Index: gdb-6.5/gdb/testsuite/gdb.threads/watchthreads2.c
 ===================================================================
 --- /dev/null  1970-01-01 00:00:00.000000000 +0000
-+++ gdb-6.5/gdb/testsuite/gdb.threads/watchthreads2.c  2006-07-12 01:54:29.000000000 -0300
++++ gdb-6.5/gdb/testsuite/gdb.threads/watchthreads-threaded.c  2006-07-12 01:54:29.000000000 -0300
 @@ -0,0 +1,66 @@
 +/* This testcase is part of GDB, the GNU debugger.
 +
@@ -113,7 +113,7 @@ Index: gdb-6.5/gdb/testsuite/gdb.threads/watchthreads2.c
 Index: gdb-6.5/gdb/testsuite/gdb.threads/watchthreads2.exp
 ===================================================================
 --- /dev/null  1970-01-01 00:00:00.000000000 +0000
-+++ gdb-6.5/gdb/testsuite/gdb.threads/watchthreads2.exp        2006-07-12 01:54:29.000000000 -0300
++++ gdb-6.5/gdb/testsuite/gdb.threads/watchthreads-threaded.exp        2006-07-12 01:54:29.000000000 -0300
 @@ -0,0 +1,133 @@
 +# This testcase is part of GDB, the GNU debugger.
 +
diff --git a/gdb-6.5-bz181390-memory-address-width.patch b/gdb-6.5-bz181390-memory-address-width.patch
deleted file mode 100644 (file)
index 894ca0c..0000000
+++ /dev/null
@@ -1,197 +0,0 @@
-https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=181390
-
-2006-09-28  Jan Kratochvil  <jan.kratochvil@redhat.com>
-
-       * gdb/utils.c (paddress): Disable cutting of the printed addresses
-       to the target's address bit size; user wants to see everything.
-       * gdb/value.c (value_as_address1): Original `value_as_address'.
-       (value_as_address): New `value_as_address' wrapper - cut memory address
-       to the target's address bit size, bugreport by John Reiser.
-
-2008-03-02  Jan Kratochvil  <jan.kratochvil@redhat.com>
-
-       Port to GDB-6.8pre.
-       New testcase `gdb.arch/amd64-i386-address.exp'.
-
-Index: gdb-6.7.50.20080227/gdb/utils.c
-===================================================================
---- gdb-6.7.50.20080227.orig/gdb/utils.c       2008-03-02 14:28:44.000000000 +0100
-+++ gdb-6.7.50.20080227/gdb/utils.c    2008-03-02 14:35:09.000000000 +0100
-@@ -2540,6 +2540,14 @@ paddr_nz (CORE_ADDR addr)
- const char *
- paddress (CORE_ADDR addr)
- {
-+  /* Do not cut the address as the user should see all the information
-+     available.  Otherwise 64-bit gdb debugging 32-bit inferior would
-+     report for `x/x 0xffffffffffffce70' error
-+     `Cannot access memory at 0xffffce70' while the error occured just
-+     because of the higher order bits 0xffffffff00000000 there.
-+     This specific error no longer occurs as the address is now cut
-+     during execution by `value_as_address'.  */
-+#if 0
-   /* Truncate address to the size of a target address, avoiding shifts
-      larger or equal than the width of a CORE_ADDR.  The local
-      variable ADDR_BIT stops the compiler reporting a shift overflow
-@@ -2553,6 +2561,8 @@ paddress (CORE_ADDR addr)
-   if (addr_bit < (sizeof (CORE_ADDR) * HOST_CHAR_BIT))
-     addr &= ((CORE_ADDR) 1 << addr_bit) - 1;
-+#endif
-+
-   return hex_string (addr);
- }
-Index: gdb-6.7.50.20080227/gdb/value.c
-===================================================================
---- gdb-6.7.50.20080227.orig/gdb/value.c       2008-01-18 18:07:40.000000000 +0100
-+++ gdb-6.7.50.20080227/gdb/value.c    2008-03-02 14:36:38.000000000 +0100
-@@ -983,11 +983,9 @@ value_as_double (struct value *val)
-   return foo;
- }
--/* Extract a value as a C pointer. Does not deallocate the value.  
--   Note that val's type may not actually be a pointer; value_as_long
--   handles all the cases.  */
--CORE_ADDR
--value_as_address (struct value *val)
-+/* See `value_as_address' below - core of value to C pointer extraction.  */
-+static CORE_ADDR
-+value_as_address1 (struct value *val)
- {
-   /* Assume a CORE_ADDR can fit in a LONGEST (for now).  Not sure
-      whether we want this to be true eventually.  */
-@@ -1087,6 +1085,34 @@ value_as_address (struct value *val)
-   return unpack_long (value_type (val), value_contents (val));
- #endif
- }
-+
-+/* Extract a value as a C pointer. Does not deallocate the value.  
-+   Note that val's type may not actually be a pointer; value_as_long
-+   handles all the cases.  */
-+CORE_ADDR
-+value_as_address (struct value *val)
-+{
-+  CORE_ADDR addr;
-+  int addr_bit;
-+
-+  addr = value_as_address1 (val);
-+
-+  /* Truncate address to the size of a target address, avoiding shifts
-+     larger or equal than the width of a CORE_ADDR.  The local
-+     variable ADDR_BIT stops the compiler reporting a shift overflow
-+     when it won't occur. */
-+  /* NOTE: This assumes that the significant address information is
-+     kept in the least significant bits of ADDR - the upper bits were
-+     either zero or sign extended.  Should ADDRESS_TO_POINTER() or
-+     some ADDRESS_TO_PRINTABLE() be used to do the conversion?  */
-+
-+  addr_bit = gdbarch_addr_bit (current_gdbarch);
-+
-+  if (addr_bit < (sizeof (CORE_ADDR) * HOST_CHAR_BIT))
-+    addr &= ((CORE_ADDR) 1 << addr_bit) - 1;
-+
-+  return addr;
-+}
\f
- /* Unpack raw data (copied from debugee, target byte order) at VALADDR
-    as a long, or as a double, assuming the raw data is described
---- /dev/null  2008-03-01 10:30:54.797374318 +0100
-+++ gdb-6.7.50.20080227/gdb/testsuite/gdb.arch/amd64-i386-address.S    2008-03-02 12:47:06.000000000 +0100
-@@ -0,0 +1,32 @@
-+/* Copyright 2008 Free Software Foundation, Inc.
-+
-+   This program is free software; you can redistribute it and/or modify
-+   it under the terms of the GNU General Public License as published by
-+   the Free Software Foundation; either version 3 of the License, or
-+   (at your option) any later version.
-+
-+   This program is distributed in the hope that it will be useful,
-+   but WITHOUT ANY WARRANTY; without even the implied warranty of
-+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-+   GNU General Public License for more details.
-+
-+   You should have received a copy of the GNU General Public License
-+   along with this program.  If not, see <http://www.gnu.org/licenses/>.
-+
-+   Please email any bugs, comments, and/or additions to this file to:
-+   bug-gdb@gnu.org
-+
-+   This file is part of the gdb testsuite.
-+
-+   Test UNsigned extension of the 32-bit inferior address on a 64-bit host.
-+   This file is based on the work by John Reiser.
-+   This file was created by Jan Kratochvil <jan.kratochvil@redhat.com>.
-+   https://bugzilla.redhat.com/show_bug.cgi?id=181390  */
-+
-+_start:       .globl  _start
-+      nop
-+      int3
-+      movl    %esp,%ebx
-+      int3    # examining memory from $ebx fails, from $esp succeeds
-+      nop
-+      nop
---- /dev/null  2008-03-01 10:30:54.797374318 +0100
-+++ gdb-6.7.50.20080227/gdb/testsuite/gdb.arch/amd64-i386-address.exp  2008-03-02 12:57:11.000000000 +0100
-@@ -0,0 +1,62 @@
-+# Copyright 2008 Free Software Foundation, Inc.
-+
-+# This program is free software; you can redistribute it and/or modify
-+# it under the terms of the GNU General Public License as published by
-+# the Free Software Foundation; either version 3 of the License, or
-+# (at your option) any later version.
-+#
-+# This program is distributed in the hope that it will be useful,
-+# but WITHOUT ANY WARRANTY; without even the implied warranty of
-+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-+# GNU General Public License for more details.
-+#
-+# You should have received a copy of the GNU General Public License
-+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
-+
-+# Please email any bugs, comments, and/or additions to this file to:
-+# bug-gdb@gnu.org
-+
-+# This file is part of the gdb testsuite.
-+
-+# Test UNsigned extension of the 32-bit inferior address on a 64-bit host.
-+# This file is based on the work by John Reiser.
-+# This file was created by Jan Kratochvil <jan.kratochvil@redhat.com>.
-+# https://bugzilla.redhat.com/show_bug.cgi?id=181390
-+
-+if {![istarget "x86_64-*-*"]} then {
-+    verbose "Skipping amd64->i386 adress test."
-+    return
-+}
-+
-+set testfile "amd64-i386-address"
-+set srcfile ${testfile}.S
-+set binfile ${objdir}/${subdir}/${testfile}
-+
-+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable [list debug "additional_flags=-m32 -nostdlib"]] != "" } {
-+    untested amd64-i386-address.exp
-+    return -1
-+}
-+
-+# Get things started.
-+
-+gdb_exit
-+gdb_start
-+gdb_reinitialize_dir $srcdir/$subdir
-+gdb_load ${binfile}
-+
-+gdb_run_cmd
-+
-+set test "trap stop"
-+gdb_test_multiple "" $test {
-+    -re "Program received signal SIGTRAP,.*_start .*$gdb_prompt $" {
-+      pass $test
-+    }
-+}
-+
-+gdb_test "stepi" ".*_start .*int3.*"
-+
-+gdb_test "x/x \$esp" "0x\[0-9a-f\]*:\t0x0*1"
-+
-+# Failure case would be:
-+#     0xff8d7f00:     Cannot access memory at address 0xff8d7f00
-+gdb_test "x/x \$ebx" "0x\[0-9a-f\]*:\t0x0*1"
index f183f6dc23bbff4a7ff8c8f3d648dfce3c25e8a2..9dd75d49c1700a12ac6448a5b8359d30e4cb0a6a 100644 (file)
@@ -30,75 +30,55 @@ glibc-debuginfo-2.7-2.x86_64: /usr/lib/debug/lib64/libc.so.6.debug:
   <81a2>     DW_AT_name        : (indirect string, offset: 0x280e): __errno_location
   <81a8>     DW_AT_MIPS_linkage_name: (indirect string, offset: 0x2808): *__GI___errno_location
 
-Index: gdb-6.8.50.20090228/gdb/gdbtypes.c
+Index: gdb-6.8.50.20090802/gdb/gdbtypes.c
 ===================================================================
---- gdb-6.8.50.20090228.orig/gdb/gdbtypes.c    2009-03-02 01:01:15.000000000 +0100
-+++ gdb-6.8.50.20090228/gdb/gdbtypes.c 2009-03-02 01:01:53.000000000 +0100
-@@ -3633,6 +3633,8 @@ gdbtypes_post_init (struct gdbarch *gdba
-     init_type (TYPE_CODE_INT, 
-              gdbarch_int_bit (gdbarch) / TARGET_CHAR_BIT,
-              0, "int", OBJFILE_INTERNAL);
-+  builtin_type->builtin_int_ptr =
-+    make_pointer_type (builtin_type->builtin_int, NULL);
-   builtin_type->builtin_unsigned_int =
-     init_type (TYPE_CODE_INT, 
-              gdbarch_int_bit (gdbarch) / TARGET_CHAR_BIT,
-@@ -3742,6 +3744,12 @@ gdbtypes_post_init (struct gdbarch *gdba
-              "<text variable, no debug info>", OBJFILE_INTERNAL);
-   TYPE_TARGET_TYPE (builtin_type->nodebug_text_symbol) =
-     builtin_type->builtin_int;
-+  builtin_type->nodebug_text_symbol_errno_location =
-+    init_type (TYPE_CODE_FUNC, 1, 0, 
-+             "<text variable for __errno_location, no debug info>",
-+             OBJFILE_INTERNAL);
-+  TYPE_TARGET_TYPE (builtin_type->nodebug_text_symbol_errno_location) =
-+    builtin_type->builtin_int_ptr;
-   builtin_type->nodebug_data_symbol =
-     init_type (TYPE_CODE_INT, 
-              gdbarch_int_bit (gdbarch) / HOST_CHAR_BIT, 0,
-Index: gdb-6.8.50.20090228/gdb/gdbtypes.h
+--- gdb-6.8.50.20090802.orig/gdb/gdbtypes.c    2009-08-03 09:50:57.000000000 +0200
++++ gdb-6.8.50.20090802/gdb/gdbtypes.c 2009-08-03 15:42:51.000000000 +0200
+@@ -3769,6 +3769,9 @@ gdbtypes_post_init (struct gdbarch *gdba
+     = arch_type (gdbarch, TYPE_CODE_INTERNAL_FUNCTION, 0,
+                "<internal function>");
++  builtin_type->nodebug_text_symbol_errno_location
++    = lookup_function_type (lookup_pointer_type (builtin_type->builtin_int));
++
+   return builtin_type;
+ }
+Index: gdb-6.8.50.20090802/gdb/gdbtypes.h
 ===================================================================
---- gdb-6.8.50.20090228.orig/gdb/gdbtypes.h    2009-03-02 01:01:15.000000000 +0100
-+++ gdb-6.8.50.20090228/gdb/gdbtypes.h 2009-03-02 01:01:53.000000000 +0100
-@@ -1053,6 +1053,7 @@ struct builtin_type
+--- gdb-6.8.50.20090802.orig/gdb/gdbtypes.h    2009-08-03 09:50:57.000000000 +0200
++++ gdb-6.8.50.20090802/gdb/gdbtypes.h 2009-08-03 15:40:02.000000000 +0200
+@@ -1128,6 +1128,8 @@ struct builtin_type
  
-   /* Types used for symbols with no debug information.  */
-   struct type *nodebug_text_symbol;
+   /* This type is used to represent a GDB internal function.  */
+   struct type *internal_fn;
++
 +  struct type *nodebug_text_symbol_errno_location;
-   struct type *nodebug_data_symbol;
-   struct type *nodebug_unknown_symbol;
-   struct type *nodebug_tls_symbol;
-@@ -1065,6 +1066,7 @@ struct builtin_type
-   struct type *builtin_char;
-   struct type *builtin_short;
-   struct type *builtin_int;
-+  struct type *builtin_int_ptr;
-   struct type *builtin_long;
-   struct type *builtin_signed_char;
-   struct type *builtin_unsigned_char;
-Index: gdb-6.8.50.20090228/gdb/parse.c
+ };
+ /* Return the type table for the specified architecture.  */
+Index: gdb-6.8.50.20090802/gdb/parse.c
 ===================================================================
---- gdb-6.8.50.20090228.orig/gdb/parse.c       2009-03-02 01:01:15.000000000 +0100
-+++ gdb-6.8.50.20090228/gdb/parse.c    2009-03-02 01:01:53.000000000 +0100
-@@ -508,7 +508,12 @@ write_exp_msymbol (struct minimal_symbol
+--- gdb-6.8.50.20090802.orig/gdb/parse.c       2009-08-03 09:50:57.000000000 +0200
++++ gdb-6.8.50.20090802/gdb/parse.c    2009-08-03 15:41:54.000000000 +0200
+@@ -510,7 +510,11 @@ write_exp_msymbol (struct minimal_symbol
      case mst_text:
      case mst_file_text:
      case mst_solib_trampoline:
--      write_exp_elt_type (builtin_type (gdbarch)->nodebug_text_symbol);
+-      write_exp_elt_type (objfile_type (objfile)->nodebug_text_symbol);
 +      if (builtin_type (gdbarch)->nodebug_text_symbol_errno_location != NULL
 +          && strcmp (SYMBOL_LINKAGE_NAME (msymbol), "__errno_location") == 0)
-+      write_exp_elt_type (builtin_type (gdbarch)
-+                                        ->nodebug_text_symbol_errno_location);
++      write_exp_elt_type (builtin_type (gdbarch)->nodebug_text_symbol_errno_location);
 +      else
-+      write_exp_elt_type (builtin_type (gdbarch)->nodebug_text_symbol);
++      write_exp_elt_type (objfile_type (objfile)->nodebug_text_symbol);
        break;
  
      case mst_data:
-Index: gdb-6.8.50.20090228/gdb/target.c
+Index: gdb-6.8.50.20090802/gdb/target.c
 ===================================================================
---- gdb-6.8.50.20090228.orig/gdb/target.c      2009-03-02 01:01:44.000000000 +0100
-+++ gdb-6.8.50.20090228/gdb/target.c   2009-03-02 01:01:53.000000000 +0100
-@@ -827,6 +827,25 @@ pop_all_targets (int quitting)
+--- gdb-6.8.50.20090802.orig/gdb/target.c      2009-08-03 12:38:47.000000000 +0200
++++ gdb-6.8.50.20090802/gdb/target.c   2009-08-03 12:49:33.000000000 +0200
+@@ -933,6 +933,25 @@ pop_all_targets (int quitting)
    pop_all_targets_above (dummy_stratum, quitting);
  }
  
@@ -124,7 +104,7 @@ Index: gdb-6.8.50.20090228/gdb/target.c
  /* Using the objfile specified in OBJFILE, find the address for the
     current thread's thread-local storage with offset OFFSET.  */
  CORE_ADDR
-@@ -917,7 +936,28 @@ target_translate_tls_address (struct obj
+@@ -1023,7 +1042,28 @@ target_translate_tls_address (struct obj
    /* It wouldn't be wrong here to try a gdbarch method, too; finding
       TLS is an ABI-specific thing.  But we don't do that yet.  */
    else
@@ -154,10 +134,10 @@ Index: gdb-6.8.50.20090228/gdb/target.c
  
    return addr;
  }
-Index: gdb-6.8.50.20090228/gdb/testsuite/gdb.dwarf2/dw2-errno.c
+Index: gdb-6.8.50.20090802/gdb/testsuite/gdb.dwarf2/dw2-errno.c
 ===================================================================
 --- /dev/null  1970-01-01 00:00:00.000000000 +0000
-+++ gdb-6.8.50.20090228/gdb/testsuite/gdb.dwarf2/dw2-errno.c   2009-03-02 01:01:53.000000000 +0100
++++ gdb-6.8.50.20090802/gdb/testsuite/gdb.dwarf2/dw2-errno.c   2009-08-03 12:49:33.000000000 +0200
 @@ -0,0 +1,28 @@
 +/* This testcase is part of GDB, the GNU debugger.
 +
@@ -187,10 +167,10 @@ Index: gdb-6.8.50.20090228/gdb/testsuite/gdb.dwarf2/dw2-errno.c
 +
 +  return 0;   /* breakpoint */
 +}
-Index: gdb-6.8.50.20090228/gdb/testsuite/gdb.dwarf2/dw2-errno.exp
+Index: gdb-6.8.50.20090802/gdb/testsuite/gdb.dwarf2/dw2-errno.exp
 ===================================================================
 --- /dev/null  1970-01-01 00:00:00.000000000 +0000
-+++ gdb-6.8.50.20090228/gdb/testsuite/gdb.dwarf2/dw2-errno.exp 2009-03-02 01:01:53.000000000 +0100
++++ gdb-6.8.50.20090802/gdb/testsuite/gdb.dwarf2/dw2-errno.exp 2009-08-03 12:49:33.000000000 +0200
 @@ -0,0 +1,67 @@
 +# Copyright 2007 Free Software Foundation, Inc.
 +
index fa3653c7ad8a6ca6e8b3d2b1a08420b6ed1a65c7..c702327c11de9442110c2e854f687106d654b933 100644 (file)
@@ -7,23 +7,22 @@ https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=190810
        (remote_async_wait): Likewise.
 
 
-Index: gdb-6.8.50.20081128/gdb/remote.c
+Index: gdb-6.8.50.20090818/gdb/remote.c
 ===================================================================
---- gdb-6.8.50.20081128.orig/gdb/remote.c      2008-12-09 16:59:51.000000000 +0100
-+++ gdb-6.8.50.20081128/gdb/remote.c   2008-12-09 17:00:04.000000000 +0100
-@@ -4329,8 +4329,13 @@ Packet: '%s'\n"),
-               VEC_safe_push (cached_reg_t, event->regcache, &cached_reg);
-             }
+--- gdb-6.8.50.20090818.orig/gdb/remote.c      2009-08-18 21:00:35.000000000 +0200
++++ gdb-6.8.50.20090818/gdb/remote.c   2009-08-18 21:04:46.000000000 +0200
+@@ -4408,8 +4408,13 @@ Packet: '%s'\n"),
+             VEC_safe_push (cached_reg_t, event->regcache, &cached_reg);
+           }
  
--          if (*p != ';')
--            error (_("Remote register badly formatted: %s\nhere: %s"),
-+          /* It may also occur on amd64 which defaults to 32-bit i386
-+             target.  gdbserver(1) is not aware of the `set architecture'
-+             name itself as it is not using libbfd.  */
-+          if (*p != ';')
-+            error (_("Remote register badly formatted: %s\nhere: %s"
-+                     "\nTry to load the executable by `file' first,"
-+                     "\nyou may also check `set/show architecture'."),
-                    buf, p);
-           ++p;
-         }
++        /* It may also occur on amd64 which defaults to 32-bit i386
++           target.  gdbserver(1) is not aware of the `set architecture'
++           name itself as it is not using libbfd.  */
+         if (*p != ';')
+-          error (_("Remote register badly formatted: %s\nhere: %s"),
++          error (_("Remote register badly formatted: %s\nhere: %s"
++                   "\nTry to load the executable by `file' first,"
++                   "\nyou may also check `set/show architecture'."),
+                  buf, p);
+         ++p;
+       }
index e09c8886f6055537d89657fa958dc73ae37bffd4..f58cc9ecccccae1daa80f9ad2f716a23ab85a529 100644 (file)
@@ -1,8 +1,8 @@
-Index: gdb-6.5/gdb/symfile.c
+Index: gdb-6.8.50.20090802/gdb/symfile.c
 ===================================================================
---- gdb-6.5.orig/gdb/symfile.c 2006-08-24 02:56:02.000000000 -0300
-+++ gdb-6.5/gdb/symfile.c      2006-08-24 02:56:36.000000000 -0300
-@@ -3739,6 +3739,12 @@ symfile_dummy_outputs (bfd *abfd, asecti
+--- gdb-6.8.50.20090802.orig/gdb/symfile.c     2009-08-03 12:29:58.000000000 +0200
++++ gdb-6.8.50.20090802/gdb/symfile.c  2009-08-03 12:40:58.000000000 +0200
+@@ -4012,6 +4012,12 @@ symfile_dummy_outputs (bfd *abfd, asecti
  bfd_byte *
  symfile_relocate_debug_section (bfd *abfd, asection *sectp, bfd_byte *buf)
  {
@@ -12,6 +12,6 @@ Index: gdb-6.5/gdb/symfile.c
 +  if ((abfd->flags & EXEC_P) != 0)
 +    return NULL;
 +
-   /* We're only interested in debugging sections with relocation
+   /* We're only interested in sections with relocation
       information.  */
    if ((sectp->flags & SEC_RELOC) == 0)
index c8c25b5af1151c59b0fe5eb74587e639d42f0ccc..b2dc451259010c1f24b5be91d369b8afe6ac506b 100644 (file)
@@ -23,11 +23,11 @@ instead.
 
        Port to GDB-6.7.
 
-Index: gdb-6.8.50.20081128/gdb/amd64-linux-tdep.c
+Index: gdb-6.8.50.20090802/gdb/amd64-linux-tdep.c
 ===================================================================
---- gdb-6.8.50.20081128.orig/gdb/amd64-linux-tdep.c    2008-12-08 10:56:17.000000000 +0100
-+++ gdb-6.8.50.20081128/gdb/amd64-linux-tdep.c 2008-12-08 21:11:08.000000000 +0100
-@@ -234,6 +234,80 @@ amd64_linux_register_reggroup_p (struct 
+--- gdb-6.8.50.20090802.orig/gdb/amd64-linux-tdep.c    2009-07-02 19:25:52.000000000 +0200
++++ gdb-6.8.50.20090802/gdb/amd64-linux-tdep.c 2009-08-03 15:50:08.000000000 +0200
+@@ -238,6 +238,80 @@ amd64_linux_register_reggroup_p (struct 
  
  /* Set the program counter for process PTID to PC.  */
  
@@ -108,7 +108,7 @@ Index: gdb-6.8.50.20081128/gdb/amd64-linux-tdep.c
  static void
  amd64_linux_write_pc (struct regcache *regcache, CORE_ADDR pc)
  {
-@@ -272,6 +346,8 @@ amd64_linux_init_abi (struct gdbarch_inf
+@@ -276,6 +350,8 @@ amd64_linux_init_abi (struct gdbarch_inf
    tdep->sc_reg_offset = amd64_linux_sc_reg_offset;
    tdep->sc_num_regs = ARRAY_SIZE (amd64_linux_sc_reg_offset);
  
@@ -117,11 +117,11 @@ Index: gdb-6.8.50.20081128/gdb/amd64-linux-tdep.c
    /* GNU/Linux uses SVR4-style shared libraries.  */
    set_solib_svr4_fetch_link_map_offsets
      (gdbarch, svr4_lp64_fetch_link_map_offsets);
-Index: gdb-6.8.50.20081128/gdb/amd64-tdep.c
+Index: gdb-6.8.50.20090802/gdb/amd64-tdep.c
 ===================================================================
---- gdb-6.8.50.20081128.orig/gdb/amd64-tdep.c  2008-12-08 10:56:17.000000000 +0100
-+++ gdb-6.8.50.20081128/gdb/amd64-tdep.c       2008-12-08 21:05:12.000000000 +0100
-@@ -1044,11 +1044,16 @@ amd64_frame_this_id (struct frame_info *
+--- gdb-6.8.50.20090802.orig/gdb/amd64-tdep.c  2009-07-02 19:25:52.000000000 +0200
++++ gdb-6.8.50.20090802/gdb/amd64-tdep.c       2009-08-03 15:50:08.000000000 +0200
+@@ -1736,11 +1736,16 @@ amd64_frame_this_id (struct frame_info *
  {
    struct amd64_frame_cache *cache =
      amd64_frame_cache (this_frame, this_cache);
@@ -138,38 +138,34 @@ Index: gdb-6.8.50.20081128/gdb/amd64-tdep.c
    (*this_id) = frame_id_build (cache->base + 16, cache->pc);
  }
  
-Index: gdb-6.8.50.20081128/gdb/i386-tdep.c
-===================================================================
---- gdb-6.8.50.20081128.orig/gdb/i386-tdep.c   2008-12-08 10:56:17.000000000 +0100
-+++ gdb-6.8.50.20081128/gdb/i386-tdep.c        2008-12-08 11:00:43.000000000 +0100
-@@ -2698,6 +2698,9 @@ i386_gdbarch_init (struct gdbarch_info i
+--- gdb-6.8.50.20090811/gdb/i386-tdep.c.orig   2009-08-10 05:02:39.000000000 +0200
++++ gdb-6.8.50.20090811/gdb/i386-tdep.c        2009-08-11 16:33:51.000000000 +0200
+@@ -5432,6 +5432,9 @@ i386_gdbarch_init (struct gdbarch_info i
    tdep->sc_pc_offset = -1;
    tdep->sc_sp_offset = -1;
  
 +  /* Unwinding stops on i386 automatically.  */
 +  tdep->outermost_frame_p = NULL;
 +
+   tdep->record_regmap = i386_record_regmap;
    /* The format used for `long double' on almost all i386 targets is
-      the i387 extended floating-point format.  In fact, of all targets
-      in the GCC 2.95 tree, only OSF/1 does it different, and insists
-Index: gdb-6.8.50.20081128/gdb/i386-tdep.h
-===================================================================
---- gdb-6.8.50.20081128.orig/gdb/i386-tdep.h   2008-12-08 10:56:17.000000000 +0100
-+++ gdb-6.8.50.20081128/gdb/i386-tdep.h        2008-12-08 21:07:47.000000000 +0100
-@@ -106,6 +106,9 @@ struct gdbarch_tdep
-   /* ISA-specific data types.  */
-   struct type *i386_mmx_type;
-   struct type *i386_sse_type;
+--- gdb-6.8.50.20090811/gdb/i386-tdep.h.orig   2009-08-10 05:02:39.000000000 +0200
++++ gdb-6.8.50.20090811/gdb/i386-tdep.h        2009-08-11 16:34:08.000000000 +0200
+@@ -120,6 +120,9 @@ struct gdbarch_tdep
+   int (*i386_sysenter_record) (struct regcache *regcache);
+   /* Parse syscall args.  */
+   int (*i386_syscall_record) (struct regcache *regcache);
 +
 +  /* Detect OS dependent outermost frames; such as `clone'.  */
 +  int (*outermost_frame_p) (struct frame_info *this_frame);
  };
  
  /* Floating-point registers.  */
-Index: gdb-6.8.50.20081128/gdb/testsuite/gdb.threads/bt-clone-stop.c
+Index: gdb-6.8.50.20090802/gdb/testsuite/gdb.threads/bt-clone-stop.c
 ===================================================================
 --- /dev/null  1970-01-01 00:00:00.000000000 +0000
-+++ gdb-6.8.50.20081128/gdb/testsuite/gdb.threads/bt-clone-stop.c      2008-12-08 11:00:43.000000000 +0100
++++ gdb-6.8.50.20090802/gdb/testsuite/gdb.threads/bt-clone-stop.c      2009-08-03 15:50:08.000000000 +0200
 @@ -0,0 +1,39 @@
 +/* This testcase is part of GDB, the GNU debugger.
 +
@@ -210,10 +206,10 @@ Index: gdb-6.8.50.20081128/gdb/testsuite/gdb.threads/bt-clone-stop.c
 +      for (;;)
 +              pause();
 +}
-Index: gdb-6.8.50.20081128/gdb/testsuite/gdb.threads/bt-clone-stop.exp
+Index: gdb-6.8.50.20090802/gdb/testsuite/gdb.threads/bt-clone-stop.exp
 ===================================================================
 --- /dev/null  1970-01-01 00:00:00.000000000 +0000
-+++ gdb-6.8.50.20081128/gdb/testsuite/gdb.threads/bt-clone-stop.exp    2008-12-08 11:00:43.000000000 +0100
++++ gdb-6.8.50.20090802/gdb/testsuite/gdb.threads/bt-clone-stop.exp    2009-08-03 15:50:08.000000000 +0200
 @@ -0,0 +1,61 @@
 +# Copyright 2006 Free Software Foundation, Inc.
 +
index 5fee1e6e66aaa5dd57bc44080f914b25a3cd4213..b7bbe42af0d7764a4a87a6c127df7d4c6e24cf47 100644 (file)
@@ -1,11 +1,11 @@
 https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=218379
 
 
-Index: gdb-6.8/gdb/symtab.c
+Index: gdb-6.8.50.20090803/gdb/symtab.c
 ===================================================================
---- gdb-6.8.orig/gdb/symtab.c  2008-02-05 23:17:40.000000000 +0100
-+++ gdb-6.8/gdb/symtab.c       2008-07-14 10:27:32.000000000 +0200
-@@ -2132,6 +2132,13 @@ find_pc_sect_line (CORE_ADDR pc, struct 
+--- gdb-6.8.50.20090803.orig/gdb/symtab.c      2009-08-03 16:09:36.000000000 +0200
++++ gdb-6.8.50.20090803/gdb/symtab.c   2009-08-03 16:13:13.000000000 +0200
+@@ -2261,6 +2261,13 @@ find_pc_sect_line (CORE_ADDR pc, struct 
          /* See above comment about why warning is commented out */
          /* warning ("In stub for %s; unable to find real function/line info", SYMBOL_LINKAGE_NAME (msymbol)) */ ;
        /* fall through */
@@ -14,7 +14,7 @@ Index: gdb-6.8/gdb/symtab.c
 +         Avoid `find_pc_sect_line'<->`find_pc_line' infinite loop.
 +         Red Hat Bug 218379.  */
 +      else if (SYMBOL_VALUE (mfunsym) == pc)
-+        warning ("In stub for %s (0x%s); interlocked, please submit the binary to http://bugzilla.redhat.com", SYMBOL_LINKAGE_NAME (msymbol), paddr (pc));
++        warning ("In stub for %s (0x%s); interlocked, please submit the binary to http://bugzilla.redhat.com", SYMBOL_LINKAGE_NAME (msymbol), paddress (target_gdbarch, pc));
 +      /* fall through */
        else
          return find_pc_line (SYMBOL_VALUE_ADDRESS (mfunsym), 0);
index b4fb9c5ac94c213a7244ce2afb983ccbb2163c51..7dae330dc3f9901643c7685544c58f0c3b5442c7 100644 (file)
 
        Port to GDB-6.8pre.
 
-Index: gdb-6.8.50.20081214/gdb/amd64-linux-nat.c
+Index: gdb-6.8.50.20090802/gdb/amd64-linux-nat.c
 ===================================================================
---- gdb-6.8.50.20081214.orig/gdb/amd64-linux-nat.c     2008-12-14 21:17:01.000000000 +0100
-+++ gdb-6.8.50.20081214/gdb/amd64-linux-nat.c  2008-12-14 21:24:19.000000000 +0100
-@@ -50,6 +50,9 @@
- #include "amd64-tdep.h"
+--- gdb-6.8.50.20090802.orig/gdb/amd64-linux-nat.c     2009-06-17 20:44:23.000000000 +0200
++++ gdb-6.8.50.20090802/gdb/amd64-linux-nat.c  2009-08-03 15:49:33.000000000 +0200
+@@ -51,6 +51,9 @@
  #include "i386-linux-tdep.h"
  #include "amd64-nat.h"
+ #include "i386-nat.h"
 +#include "i387-tdep.h"
 +#include "elf-bfd.h"
 +#include "gdb_procfs32.h"
  
  /* Mapping between the general-purpose registers in GNU/Linux x86-64
     `struct user' format and GDB's register cache layout.  */
-@@ -84,6 +87,35 @@ static int amd64_linux_gregset64_reg_off
+@@ -85,6 +88,35 @@ static int amd64_linux_gregset64_reg_off
     GNU/Linux i386 registers are all 32-bit, but since we're
     little-endian we get away with that.  */
  
@@ -73,7 +73,7 @@ Index: gdb-6.8.50.20081214/gdb/amd64-linux-nat.c
  /* From <sys/reg.h> on GNU/Linux i386.  */
  static int amd64_linux_gregset32_reg_offset[] =
  {
-@@ -102,6 +134,96 @@ static int amd64_linux_gregset32_reg_off
+@@ -103,6 +135,96 @@ static int amd64_linux_gregset32_reg_off
  };
  \f
  
@@ -84,7 +84,7 @@ Index: gdb-6.8.50.20081214/gdb/amd64-linux-nat.c
 +amd64_linux_elfcore_write_prpsinfo (bfd *abfd, char *buf, int *bufsiz,
 +                                  const char *fname, const char *psargs)
 +{
-+  if (gdbarch_ptr_bit(current_gdbarch) == 32)
++  if (gdbarch_ptr_bit (target_gdbarch) == 32)
 +    {
 +      int note_type;
 +      char *note_name = "CORE";
@@ -118,7 +118,7 @@ Index: gdb-6.8.50.20081214/gdb/amd64-linux-nat.c
 +amd64_linux_elfcore_write_prstatus (bfd *abfd, char *buf, int *bufsiz,
 +                            long pid, int cursig, const void *gregs)
 +{
-+  if (gdbarch_ptr_bit(current_gdbarch) == 32)
++  if (gdbarch_ptr_bit (target_gdbarch) == 32)
 +    {
 +      char *note_name = "CORE";
 +      struct elf_prstatus32 prstat;
@@ -151,7 +151,7 @@ Index: gdb-6.8.50.20081214/gdb/amd64-linux-nat.c
 +                                 int *bufsiz, const void *fpregs, int size,
 +                                 struct regcache *regcache)
 +{
-+  if (gdbarch_ptr_bit(current_gdbarch) == 32)
++  if (gdbarch_ptr_bit (target_gdbarch) == 32)
 +    {
 +      char *note_name = "CORE";
 +      elf_fpregset32_t fpregs32;
@@ -170,7 +170,7 @@ Index: gdb-6.8.50.20081214/gdb/amd64-linux-nat.c
  /* Transfering the general-purpose registers between GDB, inferiors
     and core files.  */
  
-@@ -431,6 +553,11 @@ _initialize_amd64_linux_nat (void)
+@@ -682,6 +804,11 @@ _initialize_amd64_linux_nat (void)
    t->to_fetch_registers = amd64_linux_fetch_inferior_registers;
    t->to_store_registers = amd64_linux_store_inferior_registers;
  
@@ -182,11 +182,11 @@ Index: gdb-6.8.50.20081214/gdb/amd64-linux-nat.c
    /* Register the target.  */
    linux_nat_add_target (t);
    linux_nat_set_new_thread (t, amd64_linux_new_thread);
-Index: gdb-6.8.50.20081214/gdb/config.in
+Index: gdb-6.8.50.20090802/gdb/config.in
 ===================================================================
---- gdb-6.8.50.20081214.orig/gdb/config.in     2008-12-14 21:17:01.000000000 +0100
-+++ gdb-6.8.50.20081214/gdb/config.in  2008-12-14 21:34:50.000000000 +0100
-@@ -136,6 +136,9 @@
+--- gdb-6.8.50.20090802.orig/gdb/config.in     2009-08-03 09:50:57.000000000 +0200
++++ gdb-6.8.50.20090802/gdb/config.in  2009-08-03 15:48:31.000000000 +0200
+@@ -146,6 +146,9 @@
  /* Define to 1 if you have the <elf_hp.h> header file. */
  #undef HAVE_ELF_HP_H
  
@@ -196,7 +196,7 @@ Index: gdb-6.8.50.20081214/gdb/config.in
  /* Define to 1 if your system has the etext variable. */
  #undef HAVE_ETEXT
  
-@@ -465,6 +468,9 @@
+@@ -487,6 +490,9 @@
  /* Define to 1 if you have the <sys/poll.h> header file. */
  #undef HAVE_SYS_POLL_H
  
@@ -206,7 +206,7 @@ Index: gdb-6.8.50.20081214/gdb/config.in
  /* Define to 1 if you have the <sys/procfs.h> header file. */
  #undef HAVE_SYS_PROCFS_H
  
-@@ -492,6 +498,9 @@
+@@ -514,6 +520,9 @@
  /* Define to 1 if you have the <sys/types.h> header file. */
  #undef HAVE_SYS_TYPES_H
  
@@ -216,11 +216,11 @@ Index: gdb-6.8.50.20081214/gdb/config.in
  /* Define to 1 if you have the <sys/user.h> header file. */
  #undef HAVE_SYS_USER_H
  
-Index: gdb-6.8.50.20081214/gdb/configure
+Index: gdb-6.8.50.20090802/gdb/configure
 ===================================================================
---- gdb-6.8.50.20081214.orig/gdb/configure     2008-12-14 21:17:01.000000000 +0100
-+++ gdb-6.8.50.20081214/gdb/configure  2008-12-14 21:33:30.000000000 +0100
-@@ -12026,6 +12026,268 @@ _ACEOF
+--- gdb-6.8.50.20090802.orig/gdb/configure     2009-08-03 09:50:57.000000000 +0200
++++ gdb-6.8.50.20090802/gdb/configure  2009-08-03 15:48:31.000000000 +0200
+@@ -12545,6 +12545,268 @@ _ACEOF
  
  fi
  
@@ -489,11 +489,11 @@ Index: gdb-6.8.50.20081214/gdb/configure
  # elf_hp.h is for HP/UX 64-bit shared library support.
  # FIXME: kettenis/20030102: In most cases we include these (ctype.h, time.h)
  # unconditionally, so what's the point in checking these?
-Index: gdb-6.8.50.20081214/gdb/configure.ac
+Index: gdb-6.8.50.20090802/gdb/configure.ac
 ===================================================================
---- gdb-6.8.50.20081214.orig/gdb/configure.ac  2008-12-14 21:17:01.000000000 +0100
-+++ gdb-6.8.50.20081214/gdb/configure.ac       2008-12-14 21:32:35.000000000 +0100
-@@ -686,6 +686,11 @@ AC_SUBST(PYTHON_CFLAGS)
+--- gdb-6.8.50.20090802.orig/gdb/configure.ac  2009-08-03 09:50:57.000000000 +0200
++++ gdb-6.8.50.20090802/gdb/configure.ac       2009-08-03 15:48:31.000000000 +0200
+@@ -744,6 +744,11 @@ AC_SUBST(PYTHON_CFLAGS)
  AC_HEADER_DIRENT
  AC_HEADER_STAT
  AC_HEADER_STDC
@@ -505,11 +505,11 @@ Index: gdb-6.8.50.20081214/gdb/configure.ac
  # elf_hp.h is for HP/UX 64-bit shared library support.
  # FIXME: kettenis/20030102: In most cases we include these (ctype.h, time.h)
  # unconditionally, so what's the point in checking these?
-Index: gdb-6.8.50.20081214/gdb/gcore.c
+Index: gdb-6.8.50.20090802/gdb/gcore.c
 ===================================================================
---- gdb-6.8.50.20081214.orig/gdb/gcore.c       2008-12-14 21:17:01.000000000 +0100
-+++ gdb-6.8.50.20081214/gdb/gcore.c    2008-12-14 21:17:10.000000000 +0100
-@@ -320,6 +320,11 @@ gcore_create_callback (CORE_ADDR vaddr, 
+--- gdb-6.8.50.20090802.orig/gdb/gcore.c       2009-08-03 12:28:56.000000000 +0200
++++ gdb-6.8.50.20090802/gdb/gcore.c    2009-08-03 15:48:31.000000000 +0200
+@@ -324,6 +324,11 @@ gcore_create_callback (CORE_ADDR vaddr, 
    asection *osec;
    flagword flags = SEC_ALLOC | SEC_HAS_CONTENTS | SEC_LOAD;
  
@@ -521,10 +521,10 @@ Index: gdb-6.8.50.20081214/gdb/gcore.c
    /* If the memory segment has no permissions set, ignore it, otherwise
       when we later try to access it for read/write, we'll get an error
       or jam the kernel.  */
-Index: gdb-6.8.50.20081214/gdb/gdb_procfs32.h
+Index: gdb-6.8.50.20090802/gdb/gdb_procfs32.h
 ===================================================================
 --- /dev/null  1970-01-01 00:00:00.000000000 +0000
-+++ gdb-6.8.50.20081214/gdb/gdb_procfs32.h     2008-12-14 21:32:56.000000000 +0100
++++ gdb-6.8.50.20090802/gdb/gdb_procfs32.h     2009-08-03 15:48:31.000000000 +0200
 @@ -0,0 +1,128 @@
 +#ifdef HAVE_SYS_PROCFS32_H
 +#include <sys/procfs32.h>
@@ -654,10 +654,10 @@ Index: gdb-6.8.50.20081214/gdb/gdb_procfs32.h
 +#endif        /* _SYS_PROCFS32_H */
 +
 +#endif /* HAVE_SYS_PROCFS32_H */
-Index: gdb-6.8.50.20081214/gdb/gdb_user32.h
+Index: gdb-6.8.50.20090802/gdb/gdb_user32.h
 ===================================================================
 --- /dev/null  1970-01-01 00:00:00.000000000 +0000
-+++ gdb-6.8.50.20081214/gdb/gdb_user32.h       2008-12-14 21:17:10.000000000 +0100
++++ gdb-6.8.50.20090802/gdb/gdb_user32.h       2009-08-03 15:48:31.000000000 +0200
 @@ -0,0 +1,108 @@
 +#ifdef HAVE_SYS_USER32_H
 +#include <sys/user32.h>
@@ -767,11 +767,11 @@ Index: gdb-6.8.50.20081214/gdb/gdb_user32.h
 +#endif        /* _SYS_USER32_H */
 +
 +#endif /* HAVE_SYS_USER32_H */
-Index: gdb-6.8.50.20081214/gdb/linux-nat.c
+Index: gdb-6.8.50.20090802/gdb/linux-nat.c
 ===================================================================
---- gdb-6.8.50.20081214.orig/gdb/linux-nat.c   2008-12-14 21:17:01.000000000 +0100
-+++ gdb-6.8.50.20081214/gdb/linux-nat.c        2008-12-14 21:24:20.000000000 +0100
-@@ -213,6 +213,21 @@ static LONGEST (*super_xfer_partial) (st
+--- gdb-6.8.50.20090802.orig/gdb/linux-nat.c   2009-08-03 12:31:26.000000000 +0200
++++ gdb-6.8.50.20090802/gdb/linux-nat.c        2009-08-03 15:48:31.000000000 +0200
+@@ -219,6 +219,21 @@ static LONGEST (*super_xfer_partial) (st
                                      const gdb_byte *,
                                      ULONGEST, LONGEST);
  
@@ -793,7 +793,7 @@ Index: gdb-6.8.50.20081214/gdb/linux-nat.c
  static int debug_linux_nat;
  static void
  show_debug_linux_nat (struct ui_file *file, int from_tty,
-@@ -3473,7 +3488,7 @@ linux_nat_do_thread_registers (bfd *obfd
+@@ -3586,7 +3601,7 @@ linux_nat_do_thread_registers (bfd *obfd
    else
      fill_gregset (regcache, &gregs, -1);
  
@@ -802,7 +802,7 @@ Index: gdb-6.8.50.20081214/gdb/linux-nat.c
                                               note_data,
                                               note_size,
                                               lwp,
-@@ -3523,10 +3538,10 @@ linux_nat_do_thread_registers (bfd *obfd
+@@ -3636,10 +3651,10 @@ linux_nat_do_thread_registers (bfd *obfd
        else
        fill_fpregset (regcache, &fpregs, -1);
  
@@ -815,7 +815,7 @@ Index: gdb-6.8.50.20081214/gdb/linux-nat.c
      }
  
    return note_data;
-@@ -3595,9 +3610,9 @@ linux_nat_make_corefile_notes (bfd *obfd
+@@ -3822,9 +3837,9 @@ linux_nat_make_corefile_notes (bfd *obfd
                       psargs_end - string_end);
            }
        }
@@ -828,11 +828,11 @@ Index: gdb-6.8.50.20081214/gdb/linux-nat.c
      }
  
    /* Dump information for threads.  */
-Index: gdb-6.8.50.20081214/gdb/linux-nat.h
+Index: gdb-6.8.50.20090802/gdb/linux-nat.h
 ===================================================================
---- gdb-6.8.50.20081214.orig/gdb/linux-nat.h   2008-12-14 21:17:01.000000000 +0100
-+++ gdb-6.8.50.20081214/gdb/linux-nat.h        2008-12-14 21:24:11.000000000 +0100
-@@ -134,3 +134,12 @@ void linux_nat_switch_fork (ptid_t new_p
+--- gdb-6.8.50.20090802.orig/gdb/linux-nat.h   2009-08-03 10:52:00.000000000 +0200
++++ gdb-6.8.50.20090802/gdb/linux-nat.h        2009-08-03 15:48:31.000000000 +0200
+@@ -144,3 +144,12 @@ void linux_nat_switch_fork (ptid_t new_p
  
  /* Return the saved siginfo associated with PTID.  */
  struct siginfo *linux_nat_get_siginfo (ptid_t ptid);
index 3324280259e07f90aadd204c8ba527f9ee558cef..32cbca3a39e1696e151a97dacba2ee500bd1a862 100644 (file)
@@ -1,7 +1,7 @@
-Index: gdb-6.8.50.20090302/gdb/event-top.c
+Index: gdb-6.8.50.20090909/gdb/event-top.c
 ===================================================================
---- gdb-6.8.50.20090302.orig/gdb/event-top.c   2009-03-07 17:13:33.000000000 +0100
-+++ gdb-6.8.50.20090302/gdb/event-top.c        2009-03-07 17:25:06.000000000 +0100
+--- gdb-6.8.50.20090909.orig/gdb/event-top.c   2009-09-09 20:05:48.000000000 +0200
++++ gdb-6.8.50.20090909/gdb/event-top.c        2009-09-09 20:08:04.000000000 +0200
 @@ -33,6 +33,7 @@
  #include "cli/cli-script.h"     /* for reset_command_nest_depth */
  #include "main.h"
@@ -28,11 +28,11 @@ Index: gdb-6.8.50.20090302/gdb/event-top.c
    /* Each interpreter has its own rules on displaying the command
       prompt.  */
    if (!current_interp_display_prompt_p ())
-Index: gdb-6.8.50.20090302/gdb/symfile.c
+Index: gdb-6.8.50.20090909/gdb/symfile.c
 ===================================================================
---- gdb-6.8.50.20090302.orig/gdb/symfile.c     2009-03-07 17:22:21.000000000 +0100
-+++ gdb-6.8.50.20090302/gdb/symfile.c  2009-03-07 17:26:47.000000000 +0100
-@@ -55,6 +55,7 @@
+--- gdb-6.8.50.20090909.orig/gdb/symfile.c     2009-09-09 20:08:04.000000000 +0200
++++ gdb-6.8.50.20090909/gdb/symfile.c  2009-09-09 20:08:04.000000000 +0200
+@@ -57,6 +57,7 @@
  #include "solib.h"
  #include "remote.h"
  #include "libbfd.h"
@@ -40,7 +40,7 @@ Index: gdb-6.8.50.20090302/gdb/symfile.c
  
  #include <sys/types.h>
  #include <fcntl.h>
-@@ -63,6 +64,7 @@
+@@ -65,6 +66,7 @@
  #include <ctype.h>
  #include <time.h>
  #include <sys/time.h>
@@ -48,7 +48,7 @@ Index: gdb-6.8.50.20090302/gdb/symfile.c
  
  
  int (*deprecated_ui_load_progress_hook) (const char *section, unsigned long num);
-@@ -1684,8 +1686,352 @@ build_id_to_filename (struct build_id *b
+@@ -1673,8 +1675,352 @@ build_id_to_filename (struct build_id *b
    return retval;
  }
  
@@ -402,7 +402,7 @@ Index: gdb-6.8.50.20090302/gdb/symfile.c
     avoidance.  */
  
  struct missing_filepair
-@@ -1739,11 +2085,17 @@ missing_filepair_change (void)
+@@ -1728,11 +2074,17 @@ missing_filepair_change (void)
        /* All their memory came just from missing_filepair_OBSTACK.  */
        missing_filepair_hash = NULL;
      }
@@ -420,8 +420,8 @@ Index: gdb-6.8.50.20090302/gdb/symfile.c
    missing_filepair_change ();
  }
  
-@@ -1802,14 +2154,33 @@ debug_print_missing (const char *binary,
-     }
+@@ -1799,14 +2151,33 @@ debug_print_missing (const char *binary,
    *slot = missing_filepair;
  
 -  /* We do not collect and flush these messages as each such message
@@ -455,17 +455,17 @@ Index: gdb-6.8.50.20090302/gdb/symfile.c
 +      fprintf_unfiltered (gdb_stdlog,
 +                          _("Missing separate debuginfo for %s\n"), binary);
 +        if (debug != NULL)
-+        fprintf_unfiltered (gdb_stdlog, _("Try to install package that provides `%s' file\n"),
-+                            debug);
++        fprintf_unfiltered (gdb_stdlog, _("Try: %s %s\n"),
++                            "yum --enablerepo='*-debuginfo' install", debug);
 +      }
  }
  
  static char *
-Index: gdb-6.8.50.20090302/gdb/symfile.h
+Index: gdb-6.8.50.20090909/gdb/symfile.h
 ===================================================================
---- gdb-6.8.50.20090302.orig/gdb/symfile.h     2009-03-07 17:13:33.000000000 +0100
-+++ gdb-6.8.50.20090302/gdb/symfile.h  2009-03-07 17:25:06.000000000 +0100
-@@ -378,6 +378,7 @@ extern struct build_id *build_id_addr_ge
+--- gdb-6.8.50.20090909.orig/gdb/symfile.h     2009-09-09 20:08:04.000000000 +0200
++++ gdb-6.8.50.20090909/gdb/symfile.h  2009-09-09 20:08:04.000000000 +0200
+@@ -387,6 +387,7 @@ extern struct build_id *build_id_addr_ge
  extern char *build_id_to_filename (struct build_id *build_id,
                                   char **link_return, int add_debug_suffix);
  extern void debug_print_missing (const char *binary, const char *debug);
@@ -473,11 +473,11 @@ Index: gdb-6.8.50.20090302/gdb/symfile.h
  
  /* From dwarf2read.c */
  
-Index: gdb-6.8.50.20090302/gdb/testsuite/lib/gdb.exp
+Index: gdb-6.8.50.20090909/gdb/testsuite/lib/gdb.exp
 ===================================================================
---- gdb-6.8.50.20090302.orig/gdb/testsuite/lib/gdb.exp 2009-03-07 17:13:33.000000000 +0100
-+++ gdb-6.8.50.20090302/gdb/testsuite/lib/gdb.exp      2009-03-07 17:25:06.000000000 +0100
-@@ -1230,7 +1230,7 @@ proc default_gdb_start { } {
+--- gdb-6.8.50.20090909.orig/gdb/testsuite/lib/gdb.exp 2009-09-09 20:08:04.000000000 +0200
++++ gdb-6.8.50.20090909/gdb/testsuite/lib/gdb.exp      2009-09-09 20:08:04.000000000 +0200
+@@ -1248,7 +1248,7 @@ proc default_gdb_start { } {
            warning "Couldn't set the width to 0."
        }
      }
@@ -486,8 +486,10 @@ Index: gdb-6.8.50.20090302/gdb/testsuite/lib/gdb.exp
      send_gdb "set build-id-verbose 0\n"
      gdb_expect 10 {
        -re "$gdb_prompt $" {
---- ./gdb/testsuite/lib/mi-support.exp 2009-03-22 16:37:58.000000000 +0100
-+++ ./gdb/testsuite/lib/mi-support.exp 2009-03-22 16:37:12.000000000 +0100
+Index: gdb-6.8.50.20090909/gdb/testsuite/lib/mi-support.exp
+===================================================================
+--- gdb-6.8.50.20090909.orig/gdb/testsuite/lib/mi-support.exp  2009-09-09 20:08:04.000000000 +0200
++++ gdb-6.8.50.20090909/gdb/testsuite/lib/mi-support.exp       2009-09-09 20:08:04.000000000 +0200
 @@ -221,7 +221,7 @@ proc default_mi_gdb_start { args } {
            }
        }
@@ -497,10 +499,10 @@ Index: gdb-6.8.50.20090302/gdb/testsuite/lib/gdb.exp
      send_gdb "190-gdb-set build-id-verbose 0\n"
      gdb_expect 10 {
        -re ".*190-gdb-set build-id-verbose 0\r\n190\\\^done\r\n$mi_gdb_prompt$" {
-Index: gdb-6.8.50.20090302/gdb/tui/tui-interp.c
+Index: gdb-6.8.50.20090909/gdb/tui/tui-interp.c
 ===================================================================
---- gdb-6.8.50.20090302.orig/gdb/tui/tui-interp.c      2009-03-07 17:13:33.000000000 +0100
-+++ gdb-6.8.50.20090302/gdb/tui/tui-interp.c   2009-03-07 17:25:06.000000000 +0100
+--- gdb-6.8.50.20090909.orig/gdb/tui/tui-interp.c      2009-09-09 20:05:48.000000000 +0200
++++ gdb-6.8.50.20090909/gdb/tui/tui-interp.c   2009-09-09 20:08:04.000000000 +0200
 @@ -30,6 +30,7 @@
  #include "tui/tui.h"
  #include "tui/tui-io.h"
@@ -518,13 +520,13 @@ Index: gdb-6.8.50.20090302/gdb/tui/tui-interp.c
        /* Tell readline what the prompt to display is and what function
           it will need to call after a whole line is read. This also
           displays the first prompt.  */
-Index: gdb-6.8.50.20090302/gdb/aclocal.m4
+Index: gdb-6.8.50.20090909/gdb/aclocal.m4
 ===================================================================
---- gdb-6.8.50.20090302.orig/gdb/aclocal.m4    2009-03-07 17:13:33.000000000 +0100
-+++ gdb-6.8.50.20090302/gdb/aclocal.m4 2009-03-07 17:25:06.000000000 +0100
-@@ -11,6 +11,162 @@
- # even the implied warranty of MERCHANTABILITY or FITNESS FOR A
- # PARTICULAR PURPOSE.
+--- gdb-6.8.50.20090909.orig/gdb/aclocal.m4    2009-09-09 20:05:48.000000000 +0200
++++ gdb-6.8.50.20090909/gdb/aclocal.m4 2009-09-09 20:09:32.000000000 +0200
+@@ -19,6 +19,162 @@ You have another version of autoconf.  I
+ If you have problems, you may need to regenerate the build system entirely.
+ To do so, use the procedure documented by the package, typically `autoreconf'.])])
  
 +# pkg.m4 - Macros to locate and utilise pkg-config.            -*- Autoconf -*-
 +# 
@@ -682,50 +684,14 @@ Index: gdb-6.8.50.20090302/gdb/aclocal.m4
 +fi[]dnl
 +])# PKG_CHECK_MODULES
 +
- # Copyright (C) 2002, 2003, 2005  Free Software Foundation, Inc.
+ # Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008  Free Software Foundation, Inc.
  #
  # This file is free software; the Free Software Foundation
-@@ -468,6 +624,27 @@ AC_DEFUN([AM_PROG_INSTALL_SH],
- install_sh=${install_sh-"$am_aux_dir/install-sh"}
- AC_SUBST(install_sh)])
-+# Copyright (C) 2003, 2005  Free Software Foundation, Inc.
-+#
-+# This file is free software; the Free Software Foundation
-+# gives unlimited permission to copy and/or distribute it,
-+# with or without modifications, as long as this notice is preserved.
-+
-+# serial 2
-+
-+# Check whether the underlying file-system supports filenames
-+# with a leading dot.  For instance MS-DOS doesn't.
-+AC_DEFUN([AM_SET_LEADING_DOT],
-+[rm -rf .tst 2>/dev/null
-+mkdir .tst 2>/dev/null
-+if test -d .tst; then
-+  am__leading_dot=.
-+else
-+  am__leading_dot=_
-+fi
-+rmdir .tst 2>/dev/null
-+AC_SUBST([am__leading_dot])])
-+
- # Add --enable-maintainer-mode option to configure.         -*- Autoconf -*-
- # From Jim Meyering
-@@ -868,7 +1045,4 @@ m4_include([gnulib/m4/onceonly_2_57.m4])
- m4_include([gnulib/m4/stdint.m4])
- m4_include([gnulib/m4/string_h.m4])
- m4_include([gnulib/m4/wchar.m4])
--m4_include([../config/extensions.m4])
--m4_include([../config/lead-dot.m4])
--m4_include([../config/proginstall.m4])
- m4_include([acinclude.m4])
-Index: gdb-6.8.50.20090302/gdb/config.in
+Index: gdb-6.8.50.20090909/gdb/config.in
 ===================================================================
---- gdb-6.8.50.20090302.orig/gdb/config.in     2009-03-07 17:13:33.000000000 +0100
-+++ gdb-6.8.50.20090302/gdb/config.in  2009-03-07 17:25:06.000000000 +0100
-@@ -38,6 +38,9 @@
+--- gdb-6.8.50.20090909.orig/gdb/config.in     2009-09-09 20:08:04.000000000 +0200
++++ gdb-6.8.50.20090909/gdb/config.in  2009-09-09 20:08:04.000000000 +0200
+@@ -42,6 +42,9 @@
  /* Define to BFD's default target vector. */
  #undef DEFAULT_BFD_VEC
  
@@ -735,7 +701,7 @@ Index: gdb-6.8.50.20090302/gdb/config.in
  /* Define to 1 if translation of program messages to the user's native
     language is requested. */
  #undef ENABLE_NLS
-@@ -211,6 +214,9 @@
+@@ -221,6 +224,9 @@
  /* Define if Python 2.6 is being used. */
  #undef HAVE_LIBPYTHON2_6
  
@@ -745,107 +711,58 @@ Index: gdb-6.8.50.20090302/gdb/config.in
  /* Define if libunwind library is being used. */
  #undef HAVE_LIBUNWIND
  
-Index: gdb-6.8.50.20090302/gdb/configure
+Index: gdb-6.8.50.20090909/gdb/configure
 ===================================================================
---- gdb-6.8.50.20090302.orig/gdb/configure     2009-03-07 17:13:33.000000000 +0100
-+++ gdb-6.8.50.20090302/gdb/configure  2009-03-07 17:25:06.000000000 +0100
-@@ -314,7 +314,7 @@ ac_subdirs_all="$ac_subdirs_all doc test
- ac_subdirs_all="$ac_subdirs_all gdbtk"
- ac_subdirs_all="$ac_subdirs_all multi-ice"
- ac_subdirs_all="$ac_subdirs_all gdbserver"
--ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS MAINTAINER_MODE_TRUE MAINTAINER_MODE_FALSE MAINT CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT CPP EGREP RANLIB ac_ct_RANLIB build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os am__leading_dot DEPDIR CCDEPMODE MAKE GMAKE_TRUE GMAKE_FALSE SET_MAKE USE_NLS LIBINTL LIBINTL_DEP INCINTL XGETTEXT GMSGFMT POSUB CATALOGS DATADIRNAME INSTOBJEXT GENCAT CATOBJEXT localedir GL_COND_LIBTOOL_TRUE GL_COND_LIBTOOL_FALSE GNULIB_MEMMEM GNULIB_MEMPCPY GNULIB_MEMRCHR GNULIB_STPCPY GNULIB_STPNCPY GNULIB_STRCHRNUL GNULIB_STRDUP GNULIB_STRNDUP GNULIB_STRNLEN GNULIB_STRPBRK GNULIB_STRSEP GNULIB_STRSTR GNULIB_STRCASESTR GNULIB_STRTOK_R GNULIB_MBSLEN GNULIB_MBSNLEN GNULIB_MBSCHR GNULIB_MBSRCHR GNULIB_MBSSTR GNULIB_MBSCASECMP GNULIB_MBSNCASECMP GNULIB_MBSPCASECMP GNULIB_MBSCASESTR GNULIB_MBSCSPN GNULIB_MBSPBRK GNULIB_MBSSPN GNULIB_MBSSEP GNULIB_MBSTOK_R GNULIB_STRERROR GNULIB_STRSIGNAL HAVE_DECL_MEMMEM HAVE_MEMPCPY HAVE_DECL_MEMRCHR HAVE_STPCPY HAVE_STPNCPY HAVE_STRCHRNUL HAVE_DECL_STRDUP HAVE_STRNDUP HAVE_DECL_STRNDUP HAVE_DECL_STRNLEN HAVE_STRPBRK HAVE_STRSEP HAVE_STRCASESTR HAVE_DECL_STRTOK_R HAVE_DECL_STRERROR HAVE_DECL_STRSIGNAL REPLACE_STRERROR REPLACE_STRSIGNAL REPLACE_MEMMEM REPLACE_STRCASESTR REPLACE_STRSTR HAVE_LONG_LONG_INT HAVE_UNSIGNED_LONG_LONG_INT HAVE_INTTYPES_H HAVE_SYS_TYPES_H INCLUDE_NEXT NEXT_STDINT_H HAVE_STDINT_H HAVE_SYS_INTTYPES_H HAVE_SYS_BITYPES_H BITSIZEOF_PTRDIFF_T BITSIZEOF_SIG_ATOMIC_T BITSIZEOF_SIZE_T BITSIZEOF_WCHAR_T BITSIZEOF_WINT_T HAVE_SIGNED_SIG_ATOMIC_T HAVE_SIGNED_WCHAR_T HAVE_SIGNED_WINT_T PTRDIFF_T_SUFFIX SIG_ATOMIC_T_SUFFIX SIZE_T_SUFFIX WCHAR_T_SUFFIX WINT_T_SUFFIX STDINT_H NEXT_STRING_H GNULIB_WCWIDTH HAVE_DECL_WCWIDTH REPLACE_WCWIDTH WCHAR_H HAVE_WCHAR_H NEXT_WCHAR_H LIBGNU_LIBDEPS LIBGNU_LTLIBDEPS GNULIB_STDINT_H PACKAGE INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM mkdir_p AWK AMTAR am__tar am__untar am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH am__fastdepCC_TRUE am__fastdepCC_FALSE GDB_DATADIR_PATH pythondir subdirs TARGET_OBS PKGVERSION REPORT_BUGS_TO REPORT_BUGS_TEXI LN_S YACC AR ac_ct_AR DLLTOOL ac_ct_DLLTOOL WINDRES ac_ct_WINDRES MIG ac_ct_MIG LIBICONV LIBICONV_INCLUDE LIBICONV_LIBDIR READLINE READLINE_DEPS READLINE_CFLAGS HAVE_LIBEXPAT LIBEXPAT LTLIBEXPAT PYTHON_CFLAGS ALLOCA CONFIG_LDFLAGS TARGET_SYSTEM_ROOT TARGET_SYSTEM_ROOT_DEFINE WARN_CFLAGS WERROR_CFLAGS SER_HARDWIRE WIN32LIBS LIBGUI GUI_CFLAGS_X WIN32LDAPP TCL_VERSION TCL_PATCH_LEVEL TCL_BIN_DIR TCL_SRC_DIR TCL_LIB_FILE TCL_LIB_FLAG TCL_LIB_SPEC TCL_STUB_LIB_FILE TCL_STUB_LIB_FLAG TCL_STUB_LIB_SPEC TCL_INCLUDE TCL_LIBRARY TCL_DEPS TK_VERSION TK_BIN_DIR TK_SRC_DIR TK_LIB_FILE TK_LIB_FLAG TK_LIB_SPEC TK_STUB_LIB_FILE TK_STUB_LIB_FLAG TK_STUB_LIB_SPEC TK_INCLUDE TK_LIBRARY TK_DEPS TK_XINCLUDES X_CFLAGS X_LDFLAGS X_LIBS GDBTKLIBS GDBTK_CFLAGS GDBTK_SRC_DIR SIM SIM_OBS ENABLE_CFLAGS PROFILE_CFLAGS CONFIG_OBS CONFIG_DEPS CONFIG_SRCS CONFIG_ALL CONFIG_CLEAN CONFIG_INSTALL CONFIG_UNINSTALL target_subdir frags nm_h LIBOBJS LTLIBOBJS gl_LIBOBJS gl_LTLIBOBJS gltests_LIBOBJS gltests_LTLIBOBJS'
-+ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS MAINTAINER_MODE_TRUE MAINTAINER_MODE_FALSE MAINT CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT CPP EGREP RANLIB ac_ct_RANLIB build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os am__leading_dot DEPDIR CCDEPMODE MAKE GMAKE_TRUE GMAKE_FALSE SET_MAKE USE_NLS LIBINTL LIBINTL_DEP INCINTL XGETTEXT GMSGFMT POSUB CATALOGS DATADIRNAME INSTOBJEXT GENCAT CATOBJEXT localedir GL_COND_LIBTOOL_TRUE GL_COND_LIBTOOL_FALSE GNULIB_MEMMEM GNULIB_MEMPCPY GNULIB_MEMRCHR GNULIB_STPCPY GNULIB_STPNCPY GNULIB_STRCHRNUL GNULIB_STRDUP GNULIB_STRNDUP GNULIB_STRNLEN GNULIB_STRPBRK GNULIB_STRSEP GNULIB_STRSTR GNULIB_STRCASESTR GNULIB_STRTOK_R GNULIB_MBSLEN GNULIB_MBSNLEN GNULIB_MBSCHR GNULIB_MBSRCHR GNULIB_MBSSTR GNULIB_MBSCASECMP GNULIB_MBSNCASECMP GNULIB_MBSPCASECMP GNULIB_MBSCASESTR GNULIB_MBSCSPN GNULIB_MBSPBRK GNULIB_MBSSPN GNULIB_MBSSEP GNULIB_MBSTOK_R GNULIB_STRERROR GNULIB_STRSIGNAL HAVE_DECL_MEMMEM HAVE_MEMPCPY HAVE_DECL_MEMRCHR HAVE_STPCPY HAVE_STPNCPY HAVE_STRCHRNUL HAVE_DECL_STRDUP HAVE_STRNDUP HAVE_DECL_STRNDUP HAVE_DECL_STRNLEN HAVE_STRPBRK HAVE_STRSEP HAVE_STRCASESTR HAVE_DECL_STRTOK_R HAVE_DECL_STRERROR HAVE_DECL_STRSIGNAL REPLACE_STRERROR REPLACE_STRSIGNAL REPLACE_MEMMEM REPLACE_STRCASESTR REPLACE_STRSTR HAVE_LONG_LONG_INT HAVE_UNSIGNED_LONG_LONG_INT HAVE_INTTYPES_H HAVE_SYS_TYPES_H INCLUDE_NEXT NEXT_STDINT_H HAVE_STDINT_H HAVE_SYS_INTTYPES_H HAVE_SYS_BITYPES_H BITSIZEOF_PTRDIFF_T BITSIZEOF_SIG_ATOMIC_T BITSIZEOF_SIZE_T BITSIZEOF_WCHAR_T BITSIZEOF_WINT_T HAVE_SIGNED_SIG_ATOMIC_T HAVE_SIGNED_WCHAR_T HAVE_SIGNED_WINT_T PTRDIFF_T_SUFFIX SIG_ATOMIC_T_SUFFIX SIZE_T_SUFFIX WCHAR_T_SUFFIX WINT_T_SUFFIX STDINT_H NEXT_STRING_H GNULIB_WCWIDTH HAVE_DECL_WCWIDTH REPLACE_WCWIDTH WCHAR_H HAVE_WCHAR_H NEXT_WCHAR_H LIBGNU_LIBDEPS LIBGNU_LTLIBDEPS GNULIB_STDINT_H PACKAGE INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM mkdir_p AWK AMTAR am__tar am__untar am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH am__fastdepCC_TRUE am__fastdepCC_FALSE GDB_DATADIR_PATH pythondir PKG_CONFIG ac_pt_PKG_CONFIG RPM_CFLAGS RPM_LIBS subdirs TARGET_OBS PKGVERSION REPORT_BUGS_TO REPORT_BUGS_TEXI LN_S YACC AR ac_ct_AR DLLTOOL ac_ct_DLLTOOL WINDRES ac_ct_WINDRES MIG ac_ct_MIG LIBICONV LIBICONV_INCLUDE LIBICONV_LIBDIR READLINE READLINE_DEPS READLINE_CFLAGS HAVE_LIBEXPAT LIBEXPAT LTLIBEXPAT PYTHON_CFLAGS ALLOCA CONFIG_LDFLAGS TARGET_SYSTEM_ROOT TARGET_SYSTEM_ROOT_DEFINE WARN_CFLAGS WERROR_CFLAGS SER_HARDWIRE WIN32LIBS LIBGUI GUI_CFLAGS_X WIN32LDAPP TCL_VERSION TCL_PATCH_LEVEL TCL_BIN_DIR TCL_SRC_DIR TCL_LIB_FILE TCL_LIB_FLAG TCL_LIB_SPEC TCL_STUB_LIB_FILE TCL_STUB_LIB_FLAG TCL_STUB_LIB_SPEC TCL_INCLUDE TCL_LIBRARY TCL_DEPS TK_VERSION TK_BIN_DIR TK_SRC_DIR TK_LIB_FILE TK_LIB_FLAG TK_LIB_SPEC TK_STUB_LIB_FILE TK_STUB_LIB_FLAG TK_STUB_LIB_SPEC TK_INCLUDE TK_LIBRARY TK_DEPS TK_XINCLUDES X_CFLAGS X_LDFLAGS X_LIBS GDBTKLIBS GDBTK_CFLAGS GDBTK_SRC_DIR SIM SIM_OBS ENABLE_CFLAGS PROFILE_CFLAGS CONFIG_OBS CONFIG_DEPS CONFIG_SRCS CONFIG_ALL CONFIG_CLEAN CONFIG_INSTALL CONFIG_UNINSTALL target_subdir frags nm_h LIBOBJS LTLIBOBJS gl_LIBOBJS gl_LTLIBOBJS gltests_LIBOBJS gltests_LTLIBOBJS'
- ac_subst_files='host_makefile_frag'
- ac_pwd=`pwd`
-@@ -776,6 +776,18 @@ ac_env_CPP_set=${CPP+set}
- ac_env_CPP_value=$CPP
- ac_cv_env_CPP_set=${CPP+set}
- ac_cv_env_CPP_value=$CPP
-+ac_env_PKG_CONFIG_set=${PKG_CONFIG+set}
-+ac_env_PKG_CONFIG_value=$PKG_CONFIG
-+ac_cv_env_PKG_CONFIG_set=${PKG_CONFIG+set}
-+ac_cv_env_PKG_CONFIG_value=$PKG_CONFIG
-+ac_env_RPM_CFLAGS_set=${RPM_CFLAGS+set}
-+ac_env_RPM_CFLAGS_value=$RPM_CFLAGS
-+ac_cv_env_RPM_CFLAGS_set=${RPM_CFLAGS+set}
-+ac_cv_env_RPM_CFLAGS_value=$RPM_CFLAGS
-+ac_env_RPM_LIBS_set=${RPM_LIBS+set}
-+ac_env_RPM_LIBS_value=$RPM_LIBS
-+ac_cv_env_RPM_LIBS_set=${RPM_LIBS+set}
-+ac_cv_env_RPM_LIBS_value=$RPM_LIBS
- #
- # Report the --help message.
-@@ -886,6 +898,8 @@ Optional Packages:
+--- gdb-6.8.50.20090909.orig/gdb/configure     2009-09-09 20:08:04.000000000 +0200
++++ gdb-6.8.50.20090909/gdb/configure  2009-09-09 20:09:35.000000000 +0200
+@@ -676,6 +676,9 @@ REPORT_BUGS_TO
+ PKGVERSION
+ TARGET_OBS
+ subdirs
++RPM_LIBS
++RPM_CFLAGS
++PKG_CONFIG
+ pythondir
+ GDB_DATADIR_PATH
+ GDB_DATADIR
+@@ -886,6 +889,7 @@ with_separate_debug_dir
+ with_gdb_datadir
+ with_relocated_sources
+ with_pythondir
++with_rpm
+ enable_targets
+ enable_64_bit_bfd
+ enable_gdbcli
+@@ -925,6 +929,9 @@ LDFLAGS
+ LIBS
+ CPPFLAGS
+ CPP
++PKG_CONFIG
++RPM_CFLAGS
++RPM_LIBS
+ YACC
+ YFLAGS
+ XMKMF'
+@@ -1588,6 +1595,8 @@ Optional Packages:
                            [DATADIR/gdb]
    --with-pythondir        install Python data files in this path
                            [DATADIR/gdb/python]
-+  --with-rpm              query rpm database for missing debuginfos
-+                          [yes/no,], [def.], [auto=librpm.so]
-   --with-libunwind            Use libunwind frame unwinding support
-   --with-pkgversion=PKG   Use PKG in the version string in place of "GDB"
-   --with-bugurl=URL       Direct users to URL to report a bug
-@@ -913,6 +927,9 @@ Some influential environment variables:
-   CPPFLAGS    C/C++ preprocessor flags, e.g. -I<include dir> if you have
-               headers in a nonstandard directory <include dir>
++  --with-rpm              query rpm database for missing debuginfos (yes/no,
++                          def. auto=librpm.so)
+   --with-libunwind        use libunwind frame unwinding support
+   --with-curses           use the curses library instead of the termcap
+                           library
+@@ -1621,6 +1630,9 @@ Some influential environment variables:
+   CPPFLAGS    C/C++/Objective C preprocessor flags, e.g. -I<include dir> if
+               you have headers in a nonstandard directory <include dir>
    CPP         C preprocessor
 +  PKG_CONFIG  path to pkg-config utility
 +  RPM_CFLAGS  C compiler flags for RPM, overriding pkg-config
 +  RPM_LIBS    linker flags for RPM, overriding pkg-config
- Use these variables to override the choices made by `configure' or to help
- it to find libraries and programs with nonstandard names/locations.
-@@ -6556,7 +6573,6 @@ am__api_version="1.9"
- # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
- # OS/2's system install, which has a completely different semantic
- # ./install, which can be erroneously created by make from ./install.sh.
--# Reject install programs that cannot install multiple files.
- echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5
- echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6
- if test -z "$INSTALL"; then
-@@ -6590,18 +6606,8 @@ case $as_dir/ in
-           # program-specific install script used by HP pwplus--don't use.
-           :
-         else
--          rm -rf conftest.one conftest.two conftest.dir
--          echo one > conftest.one
--          echo two > conftest.two
--          mkdir conftest.dir
--          if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" &&
--            test -s conftest.one && test -s conftest.two &&
--            test -s conftest.dir/conftest.one &&
--            test -s conftest.dir/conftest.two
--          then
--            ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
--            break 3
--          fi
-+          ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
-+          break 3
-         fi
-       fi
-       done
-@@ -6610,16 +6616,15 @@ case $as_dir/ in
- esac
- done
--rm -rf conftest.one conftest.two conftest.dir
- fi
-   if test "${ac_cv_path_install+set}" = set; then
-     INSTALL=$ac_cv_path_install
-   else
--    # As a last resort, use the slow shell script.  Don't cache a
--    # value for INSTALL within a source directory, because that will
-+    # As a last resort, use the slow shell script.  We don't cache a
-+    # path for INSTALL within a source directory, because that will
-     # break other packages using the cache if that directory is
--    # removed, or if the value is a relative name.
-+    # removed, or if the path is relative.
-     INSTALL=$ac_install_sh
-   fi
- fi
-@@ -7202,6 +7207,559 @@ _ACEOF
+   YACC        The `Yet Another C Compiler' implementation to use. Defaults to
+               the first program found out of: `bison -y', `byacc', `yacc'.
+   YFLAGS      The list of arguments that will be passed by default to $YACC.
+@@ -6675,6 +6687,486 @@ _ACEOF
  fi
  
  
@@ -866,13 +783,13 @@ Index: gdb-6.8.50.20090302/gdb/configure
 +#   cannot find librpm use to the rpmless compilation (like `--without-rpm').
 +
 +
-+# Check whether --with-rpm or --without-rpm was given.
-+if test "${with_rpm+set}" = set; then
-+  withval="$with_rpm"
-+
++# Check whether --with-rpm was given.
++if test "${with_rpm+set}" = set; then :
++  withval=$with_rpm;
 +else
 +  with_rpm="auto"
-+fi;
++fi
++
 +
 +
 +
@@ -892,25 +809,18 @@ Index: gdb-6.8.50.20090302/gdb/configure
 +  fi
 +  LIBRPM_STRING='"'"$LIBRPM"'"'
 +
-+  echo "$as_me:$LINENO: checking specific librpm version" >&5
-+echo $ECHO_N "checking specific librpm version... $ECHO_C" >&6
++  { $as_echo "$as_me:${as_lineno-$LINENO}: checking specific librpm version" >&5
++$as_echo_n "checking specific librpm version... " >&6; }
 +  HAVE_DLOPEN_LIBRPM=false
 +  save_LIBS="$LIBS"
 +  LIBS="$LIBS -ldl"
-+  if test "$cross_compiling" = yes; then
-+  { { echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
-+echo "$as_me: error: in \`$ac_pwd':" >&2;}
-+{ { echo "$as_me:$LINENO: error: cannot run test program while cross compiling
-+See \`config.log' for more details." >&5
-+echo "$as_me: error: cannot run test program while cross compiling
-+See \`config.log' for more details." >&2;}
-+   { (exit 1); exit 1; }; }; }
++  if test "$cross_compiling" = yes; then :
++  { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
++$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
++as_fn_error "cannot run test program while cross compiling
++See \`config.log' for more details." "$LINENO" 5; }
 +else
-+  cat >conftest.$ac_ext <<_ACEOF
-+/* confdefs.h.  */
-+_ACEOF
-+cat confdefs.h >>conftest.$ac_ext
-+cat >>conftest.$ac_ext <<_ACEOF
++  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 +/* end confdefs.h.  */
 +
 +#include <rpm/rpmlib.h>
@@ -993,49 +903,32 @@ Index: gdb-6.8.50.20090302/gdb/configure
 +  return 0;
 +}
 +_ACEOF
-+rm -f conftest$ac_exeext
-+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-+  (eval $ac_link) 2>&5
-+  ac_status=$?
-+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
-+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-+  (eval $ac_try) 2>&5
-+  ac_status=$?
-+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+  (exit $ac_status); }; }; then
++if ac_fn_c_try_run "$LINENO"; then :
 +
 +    DLOPEN_LIBRPM="`cat conftest.out`"
 +    if test "x$DLOPEN_LIBRPM" != "x"; then
 +      HAVE_DLOPEN_LIBRPM=true
-+      echo "$as_me:$LINENO: result: $DLOPEN_LIBRPM" >&5
-+echo "${ECHO_T}$DLOPEN_LIBRPM" >&6
++      { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DLOPEN_LIBRPM" >&5
++$as_echo "$DLOPEN_LIBRPM" >&6; }
 +    fi
 +
-+else
-+  echo "$as_me: program exited with status $ac_status" >&5
-+echo "$as_me: failed program was:" >&5
-+sed 's/^/| /' conftest.$ac_ext >&5
-+
 +fi
-+rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
++rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
++  conftest.$ac_objext conftest.beam conftest.$ac_ext
 +fi
++
 +  rm -f conftest.out
 +
 +
 +
 +  if $HAVE_DLOPEN_LIBRPM; then
 +
-+    echo "$as_me:$LINENO: checking rpm library API compatibility" >&5
-+echo $ECHO_N "checking rpm library API compatibility... $ECHO_C" >&6
++    { $as_echo "$as_me:${as_lineno-$LINENO}: checking rpm library API compatibility" >&5
++$as_echo_n "checking rpm library API compatibility... " >&6; }
 +    # The compilation requires -Werror to verify anything.
 +    save_CFLAGS="$CFLAGS"
 +    CFLAGS="$CFLAGS -Werror"
-+    cat >conftest.$ac_ext <<_ACEOF
-+/* confdefs.h.  */
-+_ACEOF
-+cat confdefs.h >>conftest.$ac_ext
-+cat >>conftest.$ac_ext <<_ACEOF
++    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 +/* end confdefs.h.  */
 +
 +/* Duplicate here the declarations to verify they match "symfile.c".  */
@@ -1060,44 +953,20 @@ Index: gdb-6.8.50.20090302/gdb/configure
 +  return 0;
 +}
 +_ACEOF
-+rm -f conftest.$ac_objext
-+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-+  (eval $ac_compile) 2>conftest.er1
-+  ac_status=$?
-+  grep -v '^ *+' conftest.er1 >conftest.err
-+  rm -f conftest.er1
-+  cat conftest.err >&5
-+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+  (exit $ac_status); } &&
-+       { ac_try='test -z "$ac_c_werror_flag"
-+                       || test ! -s conftest.err'
-+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-+  (eval $ac_try) 2>&5
-+  ac_status=$?
-+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+  (exit $ac_status); }; } &&
-+       { ac_try='test -s conftest.$ac_objext'
-+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-+  (eval $ac_try) 2>&5
-+  ac_status=$?
-+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+  (exit $ac_status); }; }; then
++if ac_fn_c_try_compile "$LINENO"; then :
 +
 +      LIBRPM_COMPAT=true
-+      echo "$as_me:$LINENO: result: yes" >&5
-+echo "${ECHO_T}yes" >&6
++      { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
++$as_echo "yes" >&6; }
 +
 +else
-+  echo "$as_me: failed program was:" >&5
-+sed 's/^/| /' conftest.$ac_ext >&5
-+
 +
 +      LIBRPM_COMPAT=false
-+      echo "$as_me:$LINENO: result: no" >&5
-+echo "${ECHO_T}no" >&6
++      { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
++$as_echo "no" >&6; }
 +
 +fi
-+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
++rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 +    CFLAGS="$save_CFLAGS"
 +
 +    if ! $LIBRPM_COMPAT; then
@@ -1113,18 +982,14 @@ Index: gdb-6.8.50.20090302/gdb/configure
 +_ACEOF
 +
 +
-+cat >>confdefs.h <<\_ACEOF
-+#define HAVE_LIBRPM 1
-+_ACEOF
++$as_echo "#define HAVE_LIBRPM 1" >>confdefs.h
 +
 +  else
-+    echo "$as_me:$LINENO: result: no" >&5
-+echo "${ECHO_T}no" >&6
++    { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
++$as_echo "no" >&6; }
 +    LIBS="$save_LIBS"
 +    if $DLOPEN_REQUIRE; then
-+      { { echo "$as_me:$LINENO: error: Specific name $LIBRPM was requested but it could not be opened." >&5
-+echo "$as_me: error: Specific name $LIBRPM was requested but it could not be opened." >&2;}
-+   { (exit 1); exit 1; }; }
++      as_fn_error "Specific name $LIBRPM was requested but it could not be opened." "$LINENO" 5
 +    fi
 +
 +
@@ -1132,10 +997,10 @@ Index: gdb-6.8.50.20090302/gdb/configure
 +      if test -n "$ac_tool_prefix"; then
 +  # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args.
 +set dummy ${ac_tool_prefix}pkg-config; ac_word=$2
-+echo "$as_me:$LINENO: checking for $ac_word" >&5
-+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-+if test "${ac_cv_path_PKG_CONFIG+set}" = set; then
-+  echo $ECHO_N "(cached) $ECHO_C" >&6
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
++$as_echo_n "checking for $ac_word... " >&6; }
++if test "${ac_cv_path_PKG_CONFIG+set}" = set; then :
++  $as_echo_n "(cached) " >&6
 +else
 +  case $PKG_CONFIG in
 +  [\\/]* | ?:[\\/]*)
@@ -1147,37 +1012,38 @@ Index: gdb-6.8.50.20090302/gdb/configure
 +do
 +  IFS=$as_save_IFS
 +  test -z "$as_dir" && as_dir=.
-+  for ac_exec_ext in '' $ac_executable_extensions; do
-+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
++    for ac_exec_ext in '' $ac_executable_extensions; do
++  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
 +    ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
-+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
++    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
 +    break 2
 +  fi
 +done
-+done
++  done
++IFS=$as_save_IFS
 +
 +  ;;
 +esac
 +fi
 +PKG_CONFIG=$ac_cv_path_PKG_CONFIG
-+
 +if test -n "$PKG_CONFIG"; then
-+  echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5
-+echo "${ECHO_T}$PKG_CONFIG" >&6
++  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5
++$as_echo "$PKG_CONFIG" >&6; }
 +else
-+  echo "$as_me:$LINENO: result: no" >&5
-+echo "${ECHO_T}no" >&6
++  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
++$as_echo "no" >&6; }
 +fi
 +
++
 +fi
 +if test -z "$ac_cv_path_PKG_CONFIG"; then
 +  ac_pt_PKG_CONFIG=$PKG_CONFIG
 +  # Extract the first word of "pkg-config", so it can be a program name with args.
 +set dummy pkg-config; ac_word=$2
-+echo "$as_me:$LINENO: checking for $ac_word" >&5
-+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-+if test "${ac_cv_path_ac_pt_PKG_CONFIG+set}" = set; then
-+  echo $ECHO_N "(cached) $ECHO_C" >&6
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
++$as_echo_n "checking for $ac_word... " >&6; }
++if test "${ac_cv_path_ac_pt_PKG_CONFIG+set}" = set; then :
++  $as_echo_n "(cached) " >&6
 +else
 +  case $ac_pt_PKG_CONFIG in
 +  [\\/]* | ?:[\\/]*)
@@ -1189,29 +1055,39 @@ Index: gdb-6.8.50.20090302/gdb/configure
 +do
 +  IFS=$as_save_IFS
 +  test -z "$as_dir" && as_dir=.
-+  for ac_exec_ext in '' $ac_executable_extensions; do
-+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
++    for ac_exec_ext in '' $ac_executable_extensions; do
++  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
 +    ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
-+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
++    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
 +    break 2
 +  fi
 +done
-+done
++  done
++IFS=$as_save_IFS
 +
 +  ;;
 +esac
 +fi
 +ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG
-+
 +if test -n "$ac_pt_PKG_CONFIG"; then
-+  echo "$as_me:$LINENO: result: $ac_pt_PKG_CONFIG" >&5
-+echo "${ECHO_T}$ac_pt_PKG_CONFIG" >&6
++  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKG_CONFIG" >&5
++$as_echo "$ac_pt_PKG_CONFIG" >&6; }
 +else
-+  echo "$as_me:$LINENO: result: no" >&5
-+echo "${ECHO_T}no" >&6
++  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
++$as_echo "no" >&6; }
 +fi
 +
-+  PKG_CONFIG=$ac_pt_PKG_CONFIG
++  if test "x$ac_pt_PKG_CONFIG" = x; then
++    PKG_CONFIG=""
++  else
++    case $cross_compiling:$ac_tool_warned in
++yes:)
++{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
++$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
++ac_tool_warned=yes ;;
++esac
++    PKG_CONFIG=$ac_pt_PKG_CONFIG
++  fi
 +else
 +  PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
 +fi
@@ -1219,32 +1095,32 @@ Index: gdb-6.8.50.20090302/gdb/configure
 +fi
 +if test -n "$PKG_CONFIG"; then
 +      _pkg_min_version=0.9.0
-+      echo "$as_me:$LINENO: checking pkg-config is at least version $_pkg_min_version" >&5
-+echo $ECHO_N "checking pkg-config is at least version $_pkg_min_version... $ECHO_C" >&6
++      { $as_echo "$as_me:${as_lineno-$LINENO}: checking pkg-config is at least version $_pkg_min_version" >&5
++$as_echo_n "checking pkg-config is at least version $_pkg_min_version... " >&6; }
 +      if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
-+              echo "$as_me:$LINENO: result: yes" >&5
-+echo "${ECHO_T}yes" >&6
++              { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
++$as_echo "yes" >&6; }
 +      else
-+              echo "$as_me:$LINENO: result: no" >&5
-+echo "${ECHO_T}no" >&6
++              { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
++$as_echo "no" >&6; }
 +              PKG_CONFIG=""
 +      fi
 +
 +fi
 +
 +pkg_failed=no
-+echo "$as_me:$LINENO: checking for RPM" >&5
-+echo $ECHO_N "checking for RPM... $ECHO_C" >&6
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for RPM" >&5
++$as_echo_n "checking for RPM... " >&6; }
 +
 +if test -n "$RPM_CFLAGS"; then
 +    pkg_cv_RPM_CFLAGS="$RPM_CFLAGS"
 + elif test -n "$PKG_CONFIG"; then
 +    if test -n "$PKG_CONFIG" && \
-+    { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"rpm\"") >&5
++    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"rpm\""; } >&5
 +  ($PKG_CONFIG --exists --print-errors "rpm") 2>&5
 +  ac_status=$?
-+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+  (exit $ac_status); }; then
++  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
++  test $ac_status = 0; }; then
 +  pkg_cv_RPM_CFLAGS=`$PKG_CONFIG --cflags "rpm" 2>/dev/null`
 +else
 +  pkg_failed=yes
@@ -1256,11 +1132,11 @@ Index: gdb-6.8.50.20090302/gdb/configure
 +    pkg_cv_RPM_LIBS="$RPM_LIBS"
 + elif test -n "$PKG_CONFIG"; then
 +    if test -n "$PKG_CONFIG" && \
-+    { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"rpm\"") >&5
++    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"rpm\""; } >&5
 +  ($PKG_CONFIG --exists --print-errors "rpm") 2>&5
 +  ac_status=$?
-+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+  (exit $ac_status); }; then
++  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
++  test $ac_status = 0; }; then
 +  pkg_cv_RPM_LIBS=`$PKG_CONFIG --libs "rpm" 2>/dev/null`
 +else
 +  pkg_failed=yes
@@ -1286,31 +1162,27 @@ Index: gdb-6.8.50.20090302/gdb/configure
 +      # Put the nasty error message in config.log where it belongs
 +      echo "$RPM_PKG_ERRORS" >&5
 +
-+      echo "$as_me:$LINENO: result: no" >&5
-+echo "${ECHO_T}no" >&6
++      { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
++$as_echo "no" >&6; }
 +                HAVE_LIBRPM=false
 +elif test $pkg_failed = untried; then
 +      HAVE_LIBRPM=false
 +else
 +      RPM_CFLAGS=$pkg_cv_RPM_CFLAGS
 +      RPM_LIBS=$pkg_cv_RPM_LIBS
-+        echo "$as_me:$LINENO: result: yes" >&5
-+echo "${ECHO_T}yes" >&6
++        { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
++$as_echo "yes" >&6; }
 +      HAVE_LIBRPM=true
 +fi
 +
 +    if $HAVE_LIBRPM; then
 +
-+    echo "$as_me:$LINENO: checking rpm library API compatibility" >&5
-+echo $ECHO_N "checking rpm library API compatibility... $ECHO_C" >&6
++    { $as_echo "$as_me:${as_lineno-$LINENO}: checking rpm library API compatibility" >&5
++$as_echo_n "checking rpm library API compatibility... " >&6; }
 +    # The compilation requires -Werror to verify anything.
 +    save_CFLAGS="$CFLAGS"
 +    CFLAGS="$CFLAGS -Werror"
-+    cat >conftest.$ac_ext <<_ACEOF
-+/* confdefs.h.  */
-+_ACEOF
-+cat confdefs.h >>conftest.$ac_ext
-+cat >>conftest.$ac_ext <<_ACEOF
++    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 +/* end confdefs.h.  */
 +
 +/* Duplicate here the declarations to verify they match "symfile.c".  */
@@ -1335,44 +1207,20 @@ Index: gdb-6.8.50.20090302/gdb/configure
 +  return 0;
 +}
 +_ACEOF
-+rm -f conftest.$ac_objext
-+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-+  (eval $ac_compile) 2>conftest.er1
-+  ac_status=$?
-+  grep -v '^ *+' conftest.er1 >conftest.err
-+  rm -f conftest.er1
-+  cat conftest.err >&5
-+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+  (exit $ac_status); } &&
-+       { ac_try='test -z "$ac_c_werror_flag"
-+                       || test ! -s conftest.err'
-+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-+  (eval $ac_try) 2>&5
-+  ac_status=$?
-+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+  (exit $ac_status); }; } &&
-+       { ac_try='test -s conftest.$ac_objext'
-+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-+  (eval $ac_try) 2>&5
-+  ac_status=$?
-+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+  (exit $ac_status); }; }; then
++if ac_fn_c_try_compile "$LINENO"; then :
 +
 +      LIBRPM_COMPAT=true
-+      echo "$as_me:$LINENO: result: yes" >&5
-+echo "${ECHO_T}yes" >&6
++      { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
++$as_echo "yes" >&6; }
 +
 +else
-+  echo "$as_me: failed program was:" >&5
-+sed 's/^/| /' conftest.$ac_ext >&5
-+
 +
 +      LIBRPM_COMPAT=false
-+      echo "$as_me:$LINENO: result: no" >&5
-+echo "${ECHO_T}no" >&6
++      { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
++$as_echo "no" >&6; }
 +
 +fi
-+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
++rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 +    CFLAGS="$save_CFLAGS"
 +
 +      if ! $LIBRPM_COMPAT; then
@@ -1383,20 +1231,16 @@ Index: gdb-6.8.50.20090302/gdb/configure
 +
 +    if $HAVE_LIBRPM; then
 +
-+cat >>confdefs.h <<\_ACEOF
-+#define HAVE_LIBRPM 1
-+_ACEOF
++$as_echo "#define HAVE_LIBRPM 1" >>confdefs.h
 +
 +      CFLAGS="$CFLAGS $RPM_CFLAGS"
 +      LIBS="$LIBS $RPM_LIBS"
 +    else
 +      if $RPM_REQUIRE; then
-+      { { echo "$as_me:$LINENO: error: $RPM_PKG_ERRORS" >&5
-+echo "$as_me: error: $RPM_PKG_ERRORS" >&2;}
-+   { (exit 1); exit 1; }; }
++      as_fn_error "$RPM_PKG_ERRORS" "$LINENO" 5
 +      else
-+      { echo "$as_me:$LINENO: WARNING: $RPM_PKG_ERRORS" >&5
-+echo "$as_me: WARNING: $RPM_PKG_ERRORS" >&2;}
++      { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $RPM_PKG_ERRORS" >&5
++$as_echo "$as_me: WARNING: $RPM_PKG_ERRORS" >&2;}
 +      fi
 +    fi
 +  fi
@@ -1405,71 +1249,287 @@ Index: gdb-6.8.50.20090302/gdb/configure
  
  
  
-@@ -8623,7 +9181,6 @@ done
- # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
- # OS/2's system install, which has a completely different semantic
- # ./install, which can be erroneously created by make from ./install.sh.
--# Reject install programs that cannot install multiple files.
- echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5
- echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6
- if test -z "$INSTALL"; then
-@@ -8657,18 +9214,8 @@ case $as_dir/ in
-           # program-specific install script used by HP pwplus--don't use.
-           :
-         else
--          rm -rf conftest.one conftest.two conftest.dir
--          echo one > conftest.one
--          echo two > conftest.two
--          mkdir conftest.dir
--          if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" &&
--            test -s conftest.one && test -s conftest.two &&
--            test -s conftest.dir/conftest.one &&
--            test -s conftest.dir/conftest.two
--          then
--            ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
--            break 3
--          fi
-+          ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
-+          break 3
-         fi
-       fi
-       done
-@@ -8677,16 +9224,15 @@ case $as_dir/ in
- esac
- done
+@@ -9721,265 +10213,25 @@ $as_echo "#define STDC_HEADERS 1" >>conf
+ fi
  
--rm -rf conftest.one conftest.two conftest.dir
+-
+-
+ for ac_header in sys/user32.h sys/procfs32.h
+-do
+-as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+-if eval "test \"\${$as_ac_Header+set}\" = set"; then
+-  echo "$as_me:$LINENO: checking for $ac_header" >&5
+-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+-if eval "test \"\${$as_ac_Header+set}\" = set"; then
+-  echo $ECHO_N "(cached) $ECHO_C" >&6
+-fi
+-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+-echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+-else
+-  # Is the header compilable?
+-echo "$as_me:$LINENO: checking $ac_header usability" >&5
+-echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
+-cat >conftest.$ac_ext <<_ACEOF
+-/* confdefs.h.  */
+-_ACEOF
+-cat confdefs.h >>conftest.$ac_ext
+-cat >>conftest.$ac_ext <<_ACEOF
+-/* end confdefs.h.  */
+-$ac_includes_default
+-#include <$ac_header>
+-_ACEOF
+-rm -f conftest.$ac_objext
+-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+-  (eval $ac_compile) 2>conftest.er1
+-  ac_status=$?
+-  grep -v '^ *+' conftest.er1 >conftest.err
+-  rm -f conftest.er1
+-  cat conftest.err >&5
+-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+-  (exit $ac_status); } &&
+-       { ac_try='test -z "$ac_c_werror_flag"
+-                       || test ! -s conftest.err'
+-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+-  (eval $ac_try) 2>&5
+-  ac_status=$?
+-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+-  (exit $ac_status); }; } &&
+-       { ac_try='test -s conftest.$ac_objext'
+-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+-  (eval $ac_try) 2>&5
+-  ac_status=$?
+-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+-  (exit $ac_status); }; }; then
+-  ac_header_compiler=yes
+-else
+-  echo "$as_me: failed program was:" >&5
+-sed 's/^/| /' conftest.$ac_ext >&5
+-
+-ac_header_compiler=no
+-fi
+-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+-echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+-echo "${ECHO_T}$ac_header_compiler" >&6
+-
+-# Is the header present?
+-echo "$as_me:$LINENO: checking $ac_header presence" >&5
+-echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
+-cat >conftest.$ac_ext <<_ACEOF
+-/* confdefs.h.  */
+-_ACEOF
+-cat confdefs.h >>conftest.$ac_ext
+-cat >>conftest.$ac_ext <<_ACEOF
+-/* end confdefs.h.  */
+-#include <$ac_header>
+-_ACEOF
+-if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+-  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+-  ac_status=$?
+-  grep -v '^ *+' conftest.er1 >conftest.err
+-  rm -f conftest.er1
+-  cat conftest.err >&5
+-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+-  (exit $ac_status); } >/dev/null; then
+-  if test -s conftest.err; then
+-    ac_cpp_err=$ac_c_preproc_warn_flag
+-    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+-  else
+-    ac_cpp_err=
+-  fi
+-else
+-  ac_cpp_err=yes
+-fi
+-if test -z "$ac_cpp_err"; then
+-  ac_header_preproc=yes
+-else
+-  echo "$as_me: failed program was:" >&5
+-sed 's/^/| /' conftest.$ac_ext >&5
+-
+-  ac_header_preproc=no
+-fi
+-rm -f conftest.err conftest.$ac_ext
+-echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+-echo "${ECHO_T}$ac_header_preproc" >&6
+-
+-# So?  What about this header?
+-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+-  yes:no: )
+-    { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+-echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+-    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
+-echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
+-    ac_header_preproc=yes
+-    ;;
+-  no:yes:* )
+-    { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+-echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+-    { echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
+-echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
+-    { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
+-echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
+-    { echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
+-echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
+-    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+-echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+-    { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
+-echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+-    (
+-      cat <<\_ASBOX
+-## ------------------------------------------ ##
+-## Report this to the AC_PACKAGE_NAME lists.  ##
+-## ------------------------------------------ ##
+-_ASBOX
+-    ) |
+-      sed "s/^/$as_me: WARNING:     /" >&2
+-    ;;
+-esac
+-echo "$as_me:$LINENO: checking for $ac_header" >&5
+-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+-if eval "test \"\${$as_ac_Header+set}\" = set"; then
+-  echo $ECHO_N "(cached) $ECHO_C" >&6
+-else
+-  eval "$as_ac_Header=\$ac_header_preproc"
+-fi
+-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+-echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+-
+-fi
+-if test `eval echo '${'$as_ac_Header'}'` = yes; then
++do :
++  as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
++ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
++eval as_val=\$$as_ac_Header
++   if test "x$as_val" = x""yes; then :
+   cat >>confdefs.h <<_ACEOF
+-#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
++#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+ _ACEOF
  
  fi
-   if test "${ac_cv_path_install+set}" = set; then
-     INSTALL=$ac_cv_path_install
-   else
--    # As a last resort, use the slow shell script.  Don't cache a
--    # value for INSTALL within a source directory, because that will
-+    # As a last resort, use the slow shell script.  We don't cache a
-+    # path for INSTALL within a source directory, because that will
-     # break other packages using the cache if that directory is
--    # removed, or if the value is a relative name.
-+    # removed, or if the path is relative.
-     INSTALL=$ac_install_sh
-   fi
+ done
+-echo "$as_me:$LINENO: checking for struct elf_prstatus32.pr_reg" >&5
+-echo $ECHO_N "checking for struct elf_prstatus32.pr_reg... $ECHO_C" >&6
+-if test "${ac_cv_member_struct_elf_prstatus32_pr_reg+set}" = set; then
+-  echo $ECHO_N "(cached) $ECHO_C" >&6
+-else
+-  cat >conftest.$ac_ext <<_ACEOF
+-/* confdefs.h.  */
+-_ACEOF
+-cat confdefs.h >>conftest.$ac_ext
+-cat >>conftest.$ac_ext <<_ACEOF
+-/* end confdefs.h.  */
+-#include <sys/procfs.h>
+-
+-int
+-main ()
+-{
+-static struct elf_prstatus32 ac_aggr;
+-if (ac_aggr.pr_reg)
+-return 0;
+-  ;
+-  return 0;
+-}
+-_ACEOF
+-rm -f conftest.$ac_objext
+-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+-  (eval $ac_compile) 2>conftest.er1
+-  ac_status=$?
+-  grep -v '^ *+' conftest.er1 >conftest.err
+-  rm -f conftest.er1
+-  cat conftest.err >&5
+-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+-  (exit $ac_status); } &&
+-       { ac_try='test -z "$ac_c_werror_flag"
+-                       || test ! -s conftest.err'
+-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+-  (eval $ac_try) 2>&5
+-  ac_status=$?
+-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+-  (exit $ac_status); }; } &&
+-       { ac_try='test -s conftest.$ac_objext'
+-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+-  (eval $ac_try) 2>&5
+-  ac_status=$?
+-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+-  (exit $ac_status); }; }; then
+-  ac_cv_member_struct_elf_prstatus32_pr_reg=yes
+-else
+-  echo "$as_me: failed program was:" >&5
+-sed 's/^/| /' conftest.$ac_ext >&5
+-
+-cat >conftest.$ac_ext <<_ACEOF
+-/* confdefs.h.  */
+-_ACEOF
+-cat confdefs.h >>conftest.$ac_ext
+-cat >>conftest.$ac_ext <<_ACEOF
+-/* end confdefs.h.  */
+-#include <sys/procfs.h>
+-
+-int
+-main ()
+-{
+-static struct elf_prstatus32 ac_aggr;
+-if (sizeof ac_aggr.pr_reg)
+-return 0;
+-  ;
+-  return 0;
+-}
+-_ACEOF
+-rm -f conftest.$ac_objext
+-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+-  (eval $ac_compile) 2>conftest.er1
+-  ac_status=$?
+-  grep -v '^ *+' conftest.er1 >conftest.err
+-  rm -f conftest.er1
+-  cat conftest.err >&5
+-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+-  (exit $ac_status); } &&
+-       { ac_try='test -z "$ac_c_werror_flag"
+-                       || test ! -s conftest.err'
+-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+-  (eval $ac_try) 2>&5
+-  ac_status=$?
+-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+-  (exit $ac_status); }; } &&
+-       { ac_try='test -s conftest.$ac_objext'
+-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+-  (eval $ac_try) 2>&5
+-  ac_status=$?
+-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+-  (exit $ac_status); }; }; then
+-  ac_cv_member_struct_elf_prstatus32_pr_reg=yes
+-else
+-  echo "$as_me: failed program was:" >&5
+-sed 's/^/| /' conftest.$ac_ext >&5
+-
+-ac_cv_member_struct_elf_prstatus32_pr_reg=no
+-fi
+-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+-fi
+-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+-fi
+-echo "$as_me:$LINENO: result: $ac_cv_member_struct_elf_prstatus32_pr_reg" >&5
+-echo "${ECHO_T}$ac_cv_member_struct_elf_prstatus32_pr_reg" >&6
+-if test $ac_cv_member_struct_elf_prstatus32_pr_reg = yes; then
++ac_fn_c_check_member "$LINENO" "struct elf_prstatus32" "pr_reg" "ac_cv_member_struct_elf_prstatus32_pr_reg" "#include <sys/procfs.h>
++"
++if test "x$ac_cv_member_struct_elf_prstatus32_pr_reg" = x""yes; then :
+-cat >>confdefs.h <<\_ACEOF
+-#define HAVE_ELF_PRSTATUS32 1
+-_ACEOF
++$as_echo "#define HAVE_ELF_PRSTATUS32 1" >>confdefs.h
  fi
-@@ -22270,6 +22816,10 @@ s,@am__fastdepCC_TRUE@,$am__fastdepCC_TR
- s,@am__fastdepCC_FALSE@,$am__fastdepCC_FALSE,;t t
- s,@GDB_DATADIR_PATH@,$GDB_DATADIR_PATH,;t t
- s,@pythondir@,$pythondir,;t t
-+s,@PKG_CONFIG@,$PKG_CONFIG,;t t
-+s,@ac_pt_PKG_CONFIG@,$ac_pt_PKG_CONFIG,;t t
-+s,@RPM_CFLAGS@,$RPM_CFLAGS,;t t
-+s,@RPM_LIBS@,$RPM_LIBS,;t t
- s,@subdirs@,$subdirs,;t t
- s,@TARGET_OBS@,$TARGET_OBS,;t t
- s,@PKGVERSION@,$PKGVERSION,;t t
-Index: gdb-6.8.50.20090302/gdb/configure.ac
+Index: gdb-6.8.50.20090909/gdb/configure.ac
 ===================================================================
---- gdb-6.8.50.20090302.orig/gdb/configure.ac  2009-03-07 17:13:33.000000000 +0100
-+++ gdb-6.8.50.20090302/gdb/configure.ac       2009-03-07 17:25:06.000000000 +0100
-@@ -162,6 +162,199 @@ else
+--- gdb-6.8.50.20090909.orig/gdb/configure.ac  2009-09-09 20:08:04.000000000 +0200
++++ gdb-6.8.50.20090909/gdb/configure.ac       2009-09-09 20:08:04.000000000 +0200
+@@ -151,6 +151,199 @@ else
  fi
  AC_SUBST(pythondir)
  
@@ -1491,7 +1551,7 @@ Index: gdb-6.8.50.20090302/gdb/configure.ac
 +
 +AC_ARG_WITH([rpm],
 +  [AS_HELP_STRING([--with-rpm],
-+                  [query rpm database for missing debuginfos [yes/no, def. auto=librpm.so]])], [], [with_rpm="auto"])
++                  [query rpm database for missing debuginfos (yes/no, def. auto=librpm.so)])], [], [with_rpm="auto"])
 +
 +m4_pattern_allow([^AC_MSG_ERROR$])
 +m4_pattern_allow([^AC_MSG_WARN$])
@@ -1669,3 +1729,22 @@ Index: gdb-6.8.50.20090302/gdb/configure.ac
  
  AC_CONFIG_SUBDIRS(doc testsuite)
  
+Index: gdb-6.8.50.20090909/gdb/acinclude.m4
+===================================================================
+--- gdb-6.8.50.20090909.orig/gdb/acinclude.m4  2009-09-09 20:05:48.000000000 +0200
++++ gdb-6.8.50.20090909/gdb/acinclude.m4       2009-09-09 20:08:04.000000000 +0200
+@@ -1,3 +1,5 @@
++# serial 1
++
+ dnl written by Rob Savoye <rob@cygnus.com> for Cygnus Support
+ dnl major rewriting for Tcl 7.5 by Don Libes <libes@nist.gov>
+@@ -79,8 +81,6 @@ AC_MSG_RESULT(yes)
+ # Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ # Boston, MA 02110-1301, USA.
+-# serial 1
+-
+ # @defmac AC_PROG_CC_STDC
+ # @maindex PROG_CC_STDC
+ # @ovindex CC
index cfea671c461135182861893ff17f1d06746f9579..edc52bd988b4754e48d8e43b67e62b5f257e5029 100644 (file)
@@ -1,7 +1,7 @@
-Index: gdb-6.8.50.20090302/gdb/corelow.c
+Index: gdb-6.8.91.20090925/gdb/corelow.c
 ===================================================================
---- gdb-6.8.50.20090302.orig/gdb/corelow.c     2009-02-23 01:03:48.000000000 +0100
-+++ gdb-6.8.50.20090302/gdb/corelow.c  2009-03-07 17:04:57.000000000 +0100
+--- gdb-6.8.91.20090925.orig/gdb/corelow.c     2009-07-31 17:25:21.000000000 +0200
++++ gdb-6.8.91.20090925/gdb/corelow.c  2009-09-25 09:39:09.000000000 +0200
 @@ -45,6 +45,10 @@
  #include "exceptions.h"
  #include "solib.h"
@@ -13,7 +13,7 @@ Index: gdb-6.8.50.20090302/gdb/corelow.c
  
  
  #ifndef O_LARGEFILE
-@@ -267,6 +271,56 @@ add_to_thread_list (bfd *abfd, asection 
+@@ -273,6 +277,52 @@ add_to_thread_list (bfd *abfd, asection 
      inferior_ptid = ptid;                      /* Yes, make it current */
  }
  
@@ -26,8 +26,9 @@ Index: gdb-6.8.50.20090302/gdb/corelow.c
 +  struct build_id *build_id;
 +  char *exec_filename, *debug_filename;
 +  char *build_id_filename;
++  struct cleanup *back_to;
 +
-+  if (exec_bfd != NULL)
++  if (exec_bfd != NULL || symfile_objfile != NULL)
 +    return;
 +
 +  if (target_auxv_search (&current_target, AT_ENTRY, &at_entry) <= 0)
@@ -37,32 +38,27 @@ Index: gdb-6.8.50.20090302/gdb/corelow.c
 +  if (build_id == NULL)
 +    return;
 +
++  /* SYMFILE_OBJFILE should refer to the main executable (not only to its
++     separate debug info file).  gcc44+ keeps .eh_frame only in the main
++     executable without its duplicate .debug_frame in the separate debug info
++     file - such .eh_frame would not be found if SYMFILE_OBJFILE would refer
++     directly to the separate debug info file.  */
++
 +  exec_filename = build_id_to_filename (build_id, &build_id_filename, 0);
-+  if (exec_filename != NULL)
-+    exec_file_attach (exec_filename, from_tty);
-+  else
-+    debug_print_missing (_("the main executable file"), build_id_filename);
-+  xfree (build_id_filename);
++  back_to = make_cleanup (xfree, build_id_filename);
 +
-+  /* `.note.gnu.build-id' section exists even for files without a separate
-+     debuginfo.  */
-+  debug_filename = build_id_to_filename (build_id, &build_id_filename, 1);
-+  if (debug_filename != NULL)
++  if (exec_filename != NULL)
 +    {
-+      symbol_file_add_main (debug_filename, from_tty);
-+      xfree (debug_filename);
++      make_cleanup (xfree, exec_filename);
++      exec_file_attach (exec_filename, from_tty);
++      symbol_file_add_main (exec_filename, from_tty);
++      if (symfile_objfile != NULL)
++        symfile_objfile->flags |= OBJF_BUILD_ID_CORE_LOADED;
 +    }
 +  else
-+    {
-+      if (exec_filename != NULL)
-+      symbol_file_add_main (exec_filename, from_tty);
-+      /* For EXEC_FILENAME NULL we were already complaining above.  */
-+      if (symfile_objfile == NULL && exec_filename != NULL)
-+      debug_print_missing (exec_filename, build_id_filename);
-+    }
-+  xfree (build_id_filename);
++    debug_print_missing (_("the main executable file"), build_id_filename);
 +
-+  xfree (exec_filename);
++  do_cleanups (back_to);
 +
 +  /* No automatic SOLIB_ADD as the libraries would get read twice.  */
 +}
@@ -70,7 +66,7 @@ Index: gdb-6.8.50.20090302/gdb/corelow.c
  /* This routine opens and sets up the core file bfd.  */
  
  static void
-@@ -363,6 +417,12 @@ core_open (char *filename, int from_tty)
+@@ -371,6 +421,12 @@ core_open (char *filename, int from_tty)
    push_target (&core_ops);
    discard_cleanups (old_chain);
  
@@ -83,7 +79,7 @@ Index: gdb-6.8.50.20090302/gdb/corelow.c
    add_inferior_silent (corelow_pid);
  
    /* Do this before acknowledging the inferior, so if
-@@ -751,4 +811,11 @@ _initialize_corelow (void)
+@@ -878,4 +934,11 @@ _initialize_corelow (void)
    init_core_ops ();
  
    add_target (&core_ops);
@@ -95,11 +91,11 @@ Index: gdb-6.8.50.20090302/gdb/corelow.c
 +                         NULL, NULL, NULL,
 +                         &setlist, &showlist);
  }
-Index: gdb-6.8.50.20090302/gdb/doc/gdb.texinfo
+Index: gdb-6.8.91.20090925/gdb/doc/gdb.texinfo
 ===================================================================
---- gdb-6.8.50.20090302.orig/gdb/doc/gdb.texinfo       2009-03-07 17:04:56.000000000 +0100
-+++ gdb-6.8.50.20090302/gdb/doc/gdb.texinfo    2009-03-07 17:04:57.000000000 +0100
-@@ -13294,6 +13294,27 @@ information files.
+--- gdb-6.8.91.20090925.orig/gdb/doc/gdb.texinfo       2009-09-25 09:29:58.000000000 +0200
++++ gdb-6.8.91.20090925/gdb/doc/gdb.texinfo    2009-09-25 09:29:58.000000000 +0200
+@@ -13895,6 +13895,27 @@ information files.
  
  @end table
  
@@ -127,11 +123,11 @@ Index: gdb-6.8.50.20090302/gdb/doc/gdb.texinfo
  @cindex @code{.gnu_debuglink} sections
  @cindex debug link sections
  A debug link is a special section of the executable file named
-Index: gdb-6.8.50.20090302/gdb/solib-svr4.c
+Index: gdb-6.8.91.20090925/gdb/solib-svr4.c
 ===================================================================
---- gdb-6.8.50.20090302.orig/gdb/solib-svr4.c  2009-03-07 17:04:52.000000000 +0100
-+++ gdb-6.8.50.20090302/gdb/solib-svr4.c       2009-03-07 17:04:57.000000000 +0100
-@@ -1000,9 +1000,33 @@ svr4_current_sos (void)
+--- gdb-6.8.91.20090925.orig/gdb/solib-svr4.c  2009-09-25 09:29:57.000000000 +0200
++++ gdb-6.8.91.20090925/gdb/solib-svr4.c       2009-09-25 09:43:14.000000000 +0200
+@@ -1101,9 +1101,49 @@ svr4_current_sos (void)
                     safe_strerror (errcode));
          else
            {
@@ -160,7 +156,23 @@ Index: gdb-6.8.50.20090302/gdb/solib-svr4.c
 +                    xfree (name);
 +                  }
 +                else
-+                  debug_print_missing (new->so_name, build_id_filename);
++                  {
++                    debug_print_missing (new->so_name, build_id_filename);
++
++                    /* In the case the main executable was found according to
++                       its build-id (from a core file) prevent loading
++                       a different build of a library with accidentally the
++                       same SO_NAME.
++
++                       It suppresses bogus backtraces (and prints "??" there
++                       instead) if the on-disk files no longer match the
++                       running program version.  */
++
++                    if (symfile_objfile != NULL
++                        && (symfile_objfile->flags
++                            & OBJF_BUILD_ID_CORE_LOADED) != 0)
++                      new->so_name[0] = 0;
++                  }
 +
 +                xfree (build_id_filename);
 +                xfree (build_id);
@@ -168,11 +180,11 @@ Index: gdb-6.8.50.20090302/gdb/solib-svr4.c
            }
          xfree (buffer);
  
-Index: gdb-6.8.50.20090302/gdb/symfile.c
+Index: gdb-6.8.91.20090925/gdb/symfile.c
 ===================================================================
---- gdb-6.8.50.20090302.orig/gdb/symfile.c     2009-03-07 17:04:53.000000000 +0100
-+++ gdb-6.8.50.20090302/gdb/symfile.c  2009-03-07 17:22:21.000000000 +0100
-@@ -54,6 +54,7 @@
+--- gdb-6.8.91.20090925.orig/gdb/symfile.c     2009-09-25 09:29:57.000000000 +0200
++++ gdb-6.8.91.20090925/gdb/symfile.c  2009-09-25 09:29:58.000000000 +0200
+@@ -56,6 +56,7 @@
  #include "elf-bfd.h"
  #include "solib.h"
  #include "remote.h"
@@ -180,8 +192,8 @@ Index: gdb-6.8.50.20090302/gdb/symfile.c
  
  #include <sys/types.h>
  #include <fcntl.h>
-@@ -1185,16 +1186,65 @@ symbol_file_clear (int from_tty)
-       printf_unfiltered (_("No symbol file now.\n"));
+@@ -1173,16 +1174,65 @@ symbol_file_clear (int from_tty)
+     printf_unfiltered (_("No symbol file now.\n"));
  }
  
 +/* Locate NT_GNU_BUILD_ID and return its matching debug filename.
@@ -248,7 +260,7 @@ Index: gdb-6.8.50.20090302/gdb/symfile.c
  {
    struct build_id *retval;
  
-@@ -1210,6 +1260,348 @@ build_id_bfd_get (bfd *abfd)
+@@ -1198,6 +1248,348 @@ build_id_bfd_get (bfd *abfd)
    return retval;
  }
  
@@ -597,7 +609,7 @@ Index: gdb-6.8.50.20090302/gdb/symfile.c
  /* Return if FILENAME has NT_GNU_BUILD_ID matching the CHECK value.  */
  
  static int
-@@ -1227,7 +1619,7 @@ build_id_verify (const char *filename, s
+@@ -1215,7 +1607,7 @@ build_id_verify (const char *filename, s
    if (abfd == NULL)
      return 0;
  
@@ -606,7 +618,7 @@ Index: gdb-6.8.50.20090302/gdb/symfile.c
  
    if (found == NULL)
      warning (_("File \"%s\" has no build-id, file skipped"), filename);
-@@ -1246,8 +1638,9 @@ build_id_verify (const char *filename, s
+@@ -1234,8 +1626,9 @@ build_id_verify (const char *filename, s
    return retval;
  }
  
@@ -618,7 +630,7 @@ Index: gdb-6.8.50.20090302/gdb/symfile.c
  {
    char *link, *s, *retval = NULL;
    gdb_byte *data = build_id->data;
-@@ -1255,7 +1648,9 @@ build_id_to_debug_filename (struct build
+@@ -1243,7 +1636,9 @@ build_id_to_debug_filename (struct build
  
    /* DEBUG_FILE_DIRECTORY/.build-id/ab/cdef */
    link = xmalloc (strlen (debug_file_directory) + (sizeof "/.build-id/" - 1) + 1
@@ -629,7 +641,7 @@ Index: gdb-6.8.50.20090302/gdb/symfile.c
    s = link + sprintf (link, "%s/.build-id/", debug_file_directory);
    if (size > 0)
      {
-@@ -1266,12 +1661,14 @@ build_id_to_debug_filename (struct build
+@@ -1254,12 +1649,14 @@ build_id_to_debug_filename (struct build
      *s++ = '/';
    while (size-- > 0)
      s += sprintf (s, "%02x", (unsigned) *data++);
@@ -646,7 +658,7 @@ Index: gdb-6.8.50.20090302/gdb/symfile.c
  
    if (retval != NULL && !build_id_verify (retval, build_id))
      {
-@@ -1279,9 +1676,142 @@ build_id_to_debug_filename (struct build
+@@ -1267,9 +1664,150 @@ build_id_to_debug_filename (struct build
        retval = NULL;
      }
  
@@ -655,9 +667,9 @@ Index: gdb-6.8.50.20090302/gdb/symfile.c
 +  else
 +    xfree (link);
 +
-+  return retval;
-+}
-+
+   return retval;
+ }
 +/* This MISSING_FILEPAIR_HASH tracker is used only for the duplicite messages
 +     Try to install the hash file ...
 +   avoidance.  */
@@ -680,9 +692,9 @@ Index: gdb-6.8.50.20090302/gdb/symfile.c
 +
 +  retval = obstack_alloc (&missing_filepair_obstack, size);
 +  memset (retval, 0, size);
-   return retval;
- }
++  return retval;
++}
++
 +static hashval_t
 +missing_filepair_hash_func (const struct missing_filepair *elem)
 +{
@@ -700,8 +712,8 @@ Index: gdb-6.8.50.20090302/gdb/symfile.c
 +                     const struct missing_filepair *elem2)
 +{
 +  return strcmp (elem1->binary, elem2->binary) == 0
-+         && ((elem1->debug == NULL && elem2->debug == NULL)
-+           || strcmp (elem1->debug, elem2->debug) == 0);
++         && ((elem1->debug == NULL) == (elem2->debug == NULL))
++         && (elem1->debug == NULL || strcmp (elem1->debug, elem2->debug) == 0);
 +}
 +
 +static void
@@ -732,6 +744,7 @@ Index: gdb-6.8.50.20090302/gdb/symfile.c
 +{
 +  size_t binary_len0 = strlen (binary) + 1;
 +  size_t debug_len0 = debug ? strlen (debug) + 1 : 0;
++  struct missing_filepair missing_filepair_find;
 +  struct missing_filepair *missing_filepair;
 +  struct missing_filepair **slot;
 +
@@ -747,6 +760,27 @@ Index: gdb-6.8.50.20090302/gdb/symfile.c
 +      missing_filepair_xcalloc, NULL);
 +    }
 +
++  /* Use MISSING_FILEPAIR_FIND first instead of calling obstack_alloc with
++     obstack_free in the case of a (rare) match.  The problem is ALLOC_F for
++     MISSING_FILEPAIR_HASH allocates from MISSING_FILEPAIR_OBSTACK maintenance
++     structures for MISSING_FILEPAIR_HASH.  Calling obstack_free would possibly
++     not to free only MISSING_FILEPAIR but also some such structures (allocated
++     during the htab_find_slot call).  */
++
++  missing_filepair_find.binary = (char *) binary;
++  missing_filepair_find.debug = (char *) debug;
++  slot = (struct missing_filepair **) htab_find_slot (missing_filepair_hash,
++                                                    &missing_filepair_find,
++                                                    INSERT);
++
++  /* While it may be still printed duplicitely with the missing debuginfo file
++   * it is due to once printing about the binary file build-id link and once
++   * about the .debug file build-id link as both the build-id symlinks are
++   * located in the debuginfo package.  */
++
++  if (*slot != NULL)
++    return;
++
 +  missing_filepair = obstack_alloc (&missing_filepair_obstack,
 +                                    sizeof (*missing_filepair) - 1
 +                                    + binary_len0 + debug_len0);
@@ -760,20 +794,6 @@ Index: gdb-6.8.50.20090302/gdb/symfile.c
 +  else
 +    missing_filepair->debug = NULL;
 +
-+  slot = (struct missing_filepair **) htab_find_slot (missing_filepair_hash,
-+                                                      missing_filepair,
-+                                                      INSERT);
-+
-+  /* While it may be still printed duplicitely with the missing debuginfo file
-+   * it is due to once printing about the binary file build-id link and once
-+   * about the .debug file build-id link as both the build-id symlinks are
-+   * located in the debuginfo package.  */
-+
-+  if (*slot != NULL)
-+    {
-+      obstack_free (&missing_filepair_obstack, missing_filepair);
-+      return;
-+    }
 +  *slot = missing_filepair;
 +
 +  /* We do not collect and flush these messages as each such message
@@ -789,7 +809,7 @@ Index: gdb-6.8.50.20090302/gdb/symfile.c
  static char *
  get_debug_link_info (struct objfile *objfile, unsigned long *crc32_out)
  {
-@@ -1364,32 +1894,36 @@ static char *
+@@ -1352,32 +1890,36 @@ static char *
  find_separate_debug_file (struct objfile *objfile)
  {
    asection *sect;
@@ -834,7 +854,7 @@ Index: gdb-6.8.50.20090302/gdb/symfile.c
      }
  
    basename = get_debug_link_info (objfile, &crc32);
-@@ -1397,7 +1931,7 @@ find_separate_debug_file (struct objfile
+@@ -1385,7 +1927,7 @@ find_separate_debug_file (struct objfile
    if (basename == NULL)
      /* There's no separate debug info, hence there's no way we could
         load it => no warning.  */
@@ -843,18 +863,18 @@ Index: gdb-6.8.50.20090302/gdb/symfile.c
  
    dir = xstrdup (objfile->name);
  
-@@ -1413,23 +1947,19 @@ find_separate_debug_file (struct objfile
-   gdb_assert (i >= 0 && IS_DIR_SEPARATOR (dir[i]));
-   dir[i+1] = '\0';
+@@ -1407,24 +1949,19 @@ find_separate_debug_file (struct objfile
+   if (canon_name && strlen (canon_name) > i)
+     i = strlen (canon_name);
  
 -  debugfile = alloca (strlen (debug_file_directory) + 1
--                      + strlen (dir)
+-                      + i
 -                      + strlen (DEBUG_SUBDIRECTORY)
 -                      + strlen ("/")
 -                      + strlen (basename)
 -                      + 1);
 +  debugfile = xmalloc (strlen (debug_file_directory) + 1
-+                     + strlen (dir)
++                     + i
 +                     + strlen (DEBUG_SUBDIRECTORY)
 +                     + strlen ("/")
 +                     + strlen (basename)
@@ -868,39 +888,42 @@ Index: gdb-6.8.50.20090302/gdb/symfile.c
 -    {
 -      xfree (basename);
 -      xfree (dir);
+-      xfree (canon_name);
 -      return xstrdup (debugfile);
 -    }
 +    goto cleanup_return_debugfile;
  
    /* Then try in the subdirectory named DEBUG_SUBDIRECTORY.  */
    strcpy (debugfile, dir);
-@@ -1438,11 +1968,7 @@ find_separate_debug_file (struct objfile
+@@ -1433,12 +1970,7 @@ find_separate_debug_file (struct objfile
    strcat (debugfile, basename);
  
    if (separate_debug_file_exists (debugfile, crc32, objfile->name))
 -    {
 -      xfree (basename);
 -      xfree (dir);
+-      xfree (canon_name);
 -      return xstrdup (debugfile);
 -    }
 +    goto cleanup_return_debugfile;
  
    /* Then try in the global debugfile directory.  */
    strcpy (debugfile, debug_file_directory);
-@@ -1451,11 +1977,7 @@ find_separate_debug_file (struct objfile
+@@ -1447,12 +1979,7 @@ find_separate_debug_file (struct objfile
    strcat (debugfile, basename);
  
    if (separate_debug_file_exists (debugfile, crc32, objfile->name))
 -    {
 -      xfree (basename);
 -      xfree (dir);
+-      xfree (canon_name);
 -      return xstrdup (debugfile);
 -    }
 +    goto cleanup_return_debugfile;
  
    /* If the file is in the sysroot, try using its base path in the
       global debugfile directory.  */
-@@ -1470,20 +1992,18 @@ find_separate_debug_file (struct objfile
+@@ -1466,20 +1993,18 @@ find_separate_debug_file (struct objfile
        strcat (debugfile, basename);
  
        if (separate_debug_file_exists (debugfile, crc32, objfile->name))
@@ -910,15 +933,14 @@ Index: gdb-6.8.50.20090302/gdb/symfile.c
 -        xfree (dir);
 -        return xstrdup (debugfile);
 -      }
-+        goto cleanup_return_debugfile;
++      goto cleanup_return_debugfile;
      }
--  
+   
 -  if (canon_name)
 -    xfree (canon_name);
 +  debugfile = NULL;
 +  debug_print_missing (objfile->name, build_id_filename);
-+
 +cleanup_return_debugfile:
 +  xfree (build_id_filename);
 +  xfree (canon_name);
@@ -929,28 +951,28 @@ Index: gdb-6.8.50.20090302/gdb/symfile.c
  }
  
  
-@@ -4216,4 +4736,16 @@ Show printing of symbol loading messages
-                            NULL,
-                            NULL,
-                            &setprintlist, &showprintlist);
-+
-+  add_setshow_zinteger_cmd ("build-id-verbose", no_class, &build_id_verbose,
-+                          _("\
-+Set debugging level of the build-id locator."), _("\
-+Show debugging level of the build-id locator."), _("\
-+Level 1 (default) enables printing the missing debug filenames,\n\
-+level 2 also prints the parsing of binaries to find the identificators."),
-+                          NULL,
-+                          show_build_id_verbose,
-+                          &setlist, &showlist);
-+
-+  observer_attach_executable_changed (debug_print_executable_changed);
+@@ -4229,4 +4754,16 @@ the global debug-file directory prepende
+                                    NULL,
+                                    show_debug_file_directory,
+                                    &setlist, &showlist);
++ 
++   add_setshow_zinteger_cmd ("build-id-verbose", no_class, &build_id_verbose,
++                          _("\
++ Set debugging level of the build-id locator."), _("\
++ Show debugging level of the build-id locator."), _("\
++ Level 1 (default) enables printing the missing debug filenames,\n\
++ level 2 also prints the parsing of binaries to find the identificators."),
++                          NULL,
++                          show_build_id_verbose,
++                          &setlist, &showlist);
++ 
++   observer_attach_executable_changed (debug_print_executable_changed);
  }
-Index: gdb-6.8.50.20090302/gdb/symfile.h
+Index: gdb-6.8.91.20090925/gdb/symfile.h
 ===================================================================
---- gdb-6.8.50.20090302.orig/gdb/symfile.h     2009-03-07 17:04:52.000000000 +0100
-+++ gdb-6.8.50.20090302/gdb/symfile.h  2009-03-07 17:13:33.000000000 +0100
-@@ -372,6 +372,13 @@ extern int symfile_map_offsets_to_segmen
+--- gdb-6.8.91.20090925.orig/gdb/symfile.h     2009-09-25 09:29:57.000000000 +0200
++++ gdb-6.8.91.20090925/gdb/symfile.h  2009-09-25 09:29:58.000000000 +0200
+@@ -381,6 +381,13 @@ extern int symfile_map_offsets_to_segmen
  struct symfile_segment_data *get_symfile_segment_data (bfd *abfd);
  void free_symfile_segment_data (struct symfile_segment_data *data);
  
@@ -964,11 +986,11 @@ Index: gdb-6.8.50.20090302/gdb/symfile.h
  /* From dwarf2read.c */
  
  extern int dwarf2_has_info (struct objfile *);
-Index: gdb-6.8.50.20090302/gdb/testsuite/lib/gdb.exp
+Index: gdb-6.8.91.20090925/gdb/testsuite/lib/gdb.exp
 ===================================================================
---- gdb-6.8.50.20090302.orig/gdb/testsuite/lib/gdb.exp 2009-03-07 17:04:52.000000000 +0100
-+++ gdb-6.8.50.20090302/gdb/testsuite/lib/gdb.exp      2009-03-07 17:13:33.000000000 +0100
-@@ -1230,6 +1230,16 @@ proc default_gdb_start { } {
+--- gdb-6.8.91.20090925.orig/gdb/testsuite/lib/gdb.exp 2009-09-25 09:29:57.000000000 +0200
++++ gdb-6.8.91.20090925/gdb/testsuite/lib/gdb.exp      2009-09-25 09:29:58.000000000 +0200
+@@ -1248,6 +1248,16 @@ proc default_gdb_start { } {
            warning "Couldn't set the width to 0."
        }
      }
@@ -985,8 +1007,10 @@ Index: gdb-6.8.50.20090302/gdb/testsuite/lib/gdb.exp
      return 0;
  }
  
---- ./gdb/testsuite/lib/mi-support.exp 2009-03-21 21:09:09.000000000 +0100
-+++ ./gdb/testsuite/lib/mi-support.exp 2009-03-22 16:37:58.000000000 +0100
+Index: gdb-6.8.91.20090925/gdb/testsuite/lib/mi-support.exp
+===================================================================
+--- gdb-6.8.91.20090925.orig/gdb/testsuite/lib/mi-support.exp  2009-09-15 20:51:26.000000000 +0200
++++ gdb-6.8.91.20090925/gdb/testsuite/lib/mi-support.exp       2009-09-25 09:29:58.000000000 +0200
 @@ -221,6 +221,16 @@ proc default_mi_gdb_start { args } {
            }
        }
@@ -1004,3 +1028,18 @@ Index: gdb-6.8.50.20090302/gdb/testsuite/lib/gdb.exp
  
      detect_async
  
+Index: gdb-6.8.91.20090925/gdb/objfiles.h
+===================================================================
+--- gdb-6.8.91.20090925.orig/gdb/objfiles.h    2009-09-25 09:29:57.000000000 +0200
++++ gdb-6.8.91.20090925/gdb/objfiles.h 2009-09-25 09:38:27.000000000 +0200
+@@ -428,6 +428,10 @@ struct objfile
+ #define OBJF_MAIN (1 << 7)
++/* This file was loaded according to the BUILD_ID_CORE_LOADS rules.  */
++
++#define OBJF_BUILD_ID_CORE_LOADED (1 << 12)
++
+ /* The object file that the main symbol table was loaded from (e.g. the
+    argument to the "symbol-file" or "file" command).  */
diff --git a/gdb-6.6-multifork-debugreg.patch b/gdb-6.6-multifork-debugreg.patch
deleted file mode 100644 (file)
index 8e8bca5..0000000
+++ /dev/null
@@ -1,1337 +0,0 @@
-http://sourceware.org/ml/gdb-patches/2008-01/msg00042.html
-[ Backported for GDB-6.6 (only removed the new file inclusion). ]
-
-+
-
-2007-09-16  Daniel Jacobowitz  <dan@codesourcery.com>
-           Jeff Johnston  <jjohnstn@redhat.com>
-
-       * gdb.texinfo (Setting Watchpoints): Adjust warning text about
-       multi-threaded watchpoints.
-
-2007-12-15  Jan Kratochvil  <jan.kratochvil@redhat.com>
-
-       * gdb.texinfo (Setting Watchpoints): New paragraph on the software
-       watchpoints safety wrt `set scheduler-locking'.
-
-2008-03-01  Jan Kratochvil  <jan.kratochvil@redhat.com>
-
-       Port to GDB-6.8pre.
-
-2008-03-31  Jan Kratochvil  <jan.kratochvil@redhat.com>
-
-       * gdb.threads/watchpoint-fork-forkoff.c (forkoff): New delay after the
-       parent/child messages to fix a race.
-
-2008-05-28  Jan Kratochvil  <jan.kratochvil@redhat.com>
-
-       * s390-nat.c (s390_fix_watch_points): Fix its compilation failure
-       - rename it to S390_FIX_WATCH_POINTS_LIST.
-
-Index: gdb-6.8.50.20090209/gdb/amd64-linux-nat.c
-===================================================================
---- gdb-6.8.50.20090209.orig/gdb/amd64-linux-nat.c     2009-02-09 16:02:27.000000000 +0100
-+++ gdb-6.8.50.20090209/gdb/amd64-linux-nat.c  2009-02-09 16:03:30.000000000 +0100
-@@ -408,25 +408,43 @@ amd64_linux_dr_set (ptid_t ptid, int reg
- void
- amd64_linux_dr_set_control (unsigned long control)
- {
--  struct lwp_info *lp;
--  ptid_t ptid;
--
-   amd64_linux_dr[DR_CONTROL] = control;
--  ALL_LWPS (lp, ptid)
--    amd64_linux_dr_set (ptid, DR_CONTROL, control);
-+
-+  /* I386_DETACH_BREAKPOINTS may need to reset the registers on single process
-+     not listed for ALL_LWPS.  */
-+
-+  if (ptid_get_lwp (inferior_ptid) == 0)
-+    amd64_linux_dr_set (inferior_ptid, DR_CONTROL, control);
-+  else
-+    {
-+      struct lwp_info *lp;
-+      ptid_t ptid;
-+
-+      ALL_LWPS (lp, ptid)
-+      amd64_linux_dr_set (ptid, DR_CONTROL, control);
-+    }
- }
- void
- amd64_linux_dr_set_addr (int regnum, CORE_ADDR addr)
- {
--  struct lwp_info *lp;
--  ptid_t ptid;
--
-   gdb_assert (regnum >= 0 && regnum <= DR_LASTADDR - DR_FIRSTADDR);
-   amd64_linux_dr[DR_FIRSTADDR + regnum] = addr;
--  ALL_LWPS (lp, ptid)
--    amd64_linux_dr_set (ptid, DR_FIRSTADDR + regnum, addr);
-+
-+  /* I386_DETACH_BREAKPOINTS may need to reset the registers on single process
-+     not listed for ALL_LWPS.  */
-+
-+  if (ptid_get_lwp (inferior_ptid) == 0)
-+    amd64_linux_dr_set (inferior_ptid, DR_FIRSTADDR + regnum, addr);
-+  else
-+    {
-+      struct lwp_info *lp;
-+      ptid_t ptid;
-+
-+      ALL_LWPS (lp, ptid)
-+      amd64_linux_dr_set (ptid, DR_FIRSTADDR + regnum, addr);
-+    }
- }
- void
-@@ -451,6 +469,41 @@ amd64_linux_new_thread (ptid_t ptid)
-   amd64_linux_dr_set (ptid, DR_CONTROL, amd64_linux_dr[DR_CONTROL]);
- }
-+
-+/* TO_FOLLOW_FORK stores here the PID under DETACH_BREAKPOINTS for the child
-+   process of traced FORK.  We must clear such watchpoints only once during
-+   DETACH_BREAKPOINTS.  */
-+
-+static int amd64_linux_detach_breakpoints_pid;
-+
-+/* Remove a watchpoint that watched the memory region which starts at
-+   address ADDR, whose length is LEN bytes, and for accesses of the
-+   type TYPE.  Return 0 on success, -1 on failure.  */
-+int
-+amd64_linux_remove_watchpoint (CORE_ADDR addr, int len, int type)
-+{
-+  if (ptid_get_pid (inferior_ptid) == amd64_linux_detach_breakpoints_pid)
-+    return 0;
-+  /* FOLLOW-FORK-MODE CHILD runs later the CHILD with no restrictions.  */
-+  amd64_linux_detach_breakpoints_pid = 0;
-+
-+  return i386_remove_watchpoint (addr, len, type);
-+}
-+
-+static void
-+amd64_linux_detach_breakpoints (int detached_pid)
-+{
-+  struct cleanup *old_chain = save_inferior_ptid ();
-+  int i;
-+
-+  amd64_linux_detach_breakpoints_pid = detached_pid;
-+  /* Depend on `!is_lwp (inferior_ptid)' for the I386_* macros.  */
-+  inferior_ptid = pid_to_ptid (detached_pid);
-+
-+  i386_detach_breakpoints (detached_pid);
-+
-+  do_cleanups (old_chain);
-+}
\f
- /* This function is called by libthread_db as part of its handling of
-@@ -755,6 +808,42 @@ amd64_linux_siginfo_fixup (struct siginf
-     return 0;
- }
-+static int (*amd64_linux_super_follow_fork) (struct target_ops *ops,
-+                                           int follow_child);
-+
-+/* We need to duplicate the LINUX_CHILD_FOLLOW_FORK behavior here and catch its
-+   called DETACH_BREAKPOINTS to avoid corrupting our local registers mirror.  */
-+
-+static int
-+amd64_linux_follow_fork (struct target_ops *ops, int follow_child)
-+{
-+  ptid_t last_ptid;
-+  struct target_waitstatus last_status;
-+  int has_vforked;
-+  int parent_pid, child_pid;
-+
-+  get_last_target_status (&last_ptid, &last_status);
-+  has_vforked = (last_status.kind == TARGET_WAITKIND_VFORKED);
-+  parent_pid = ptid_get_lwp (last_ptid);
-+  if (parent_pid == 0)
-+    parent_pid = ptid_get_pid (last_ptid);
-+  child_pid = ptid_get_lwp (last_status.value.related_pid);
-+  if (child_pid == 0)
-+    child_pid = ptid_get_pid (last_status.value.related_pid);
-+
-+  if (! follow_child)
-+    {
-+      amd64_linux_detach_breakpoints (child_pid);
-+    }
-+  else
-+    {
-+      if (! has_vforked)
-+      amd64_linux_detach_breakpoints (child_pid);
-+    }
-+
-+  return (*amd64_linux_super_follow_fork) (ops, follow_child);
-+}
-+
- /* Provide a prototype to silence -Wmissing-prototypes.  */
- void _initialize_amd64_linux_nat (void);
-@@ -791,6 +880,9 @@ _initialize_amd64_linux_nat (void)
-   linux_elfcore_write_prstatus = amd64_linux_elfcore_write_prstatus;
-   linux_elfcore_write_prfpreg = amd64_linux_elfcore_write_prfpreg;
-+  amd64_linux_super_follow_fork = t->to_follow_fork;
-+  t->to_follow_fork = amd64_linux_follow_fork;
-+
-   /* Register the target.  */
-   linux_nat_add_target (t);
-   linux_nat_set_new_thread (t, amd64_linux_new_thread);
-Index: gdb-6.8.50.20090209/gdb/config/i386/nm-i386.h
-===================================================================
---- gdb-6.8.50.20090209.orig/gdb/config/i386/nm-i386.h 2009-01-03 06:57:54.000000000 +0100
-+++ gdb-6.8.50.20090209/gdb/config/i386/nm-i386.h      2009-02-09 16:02:42.000000000 +0100
-@@ -120,6 +120,8 @@ extern int i386_stopped_by_watchpoint (v
- #endif /* I386_WATCHPOINTS_IN_TARGET_VECTOR */
-+extern void i386_detach_breakpoints (int detached_pid);
-+
- #endif /* I386_USE_GENERIC_WATCHPOINTS */
- #endif /* NM_I386_H */
-Index: gdb-6.8.50.20090209/gdb/i386-linux-nat.c
-===================================================================
---- gdb-6.8.50.20090209.orig/gdb/i386-linux-nat.c      2009-01-03 06:57:51.000000000 +0100
-+++ gdb-6.8.50.20090209/gdb/i386-linux-nat.c   2009-02-09 16:02:42.000000000 +0100
-@@ -634,21 +634,42 @@ i386_linux_dr_set_control (unsigned long
-   ptid_t ptid;
-   i386_linux_dr[DR_CONTROL] = control;
--  ALL_LWPS (lp, ptid)
--    i386_linux_dr_set (ptid, DR_CONTROL, control);
-+
-+  /* I386_DETACH_BREAKPOINTS may need to reset the registers on single process
-+     not listed for ALL_LWPS.  */
-+
-+  if (ptid_get_lwp (inferior_ptid) == 0)
-+    i386_linux_dr_set (inferior_ptid, DR_CONTROL, control);
-+  else
-+    {
-+      struct lwp_info *lp;
-+      ptid_t ptid;
-+
-+      ALL_LWPS (lp, ptid)
-+      i386_linux_dr_set (ptid, DR_CONTROL, control);
-+    }
- }
- void
- i386_linux_dr_set_addr (int regnum, CORE_ADDR addr)
- {
--  struct lwp_info *lp;
--  ptid_t ptid;
--
-   gdb_assert (regnum >= 0 && regnum <= DR_LASTADDR - DR_FIRSTADDR);
-   i386_linux_dr[DR_FIRSTADDR + regnum] = addr;
--  ALL_LWPS (lp, ptid)
--    i386_linux_dr_set (ptid, DR_FIRSTADDR + regnum, addr);
-+
-+  /* I386_DETACH_BREAKPOINTS may need to reset the registers on single process
-+     not listed for ALL_LWPS.  */
-+
-+  if (ptid_get_lwp (inferior_ptid) == 0)
-+    i386_linux_dr_set (inferior_ptid, DR_FIRSTADDR + regnum, addr);
-+  else
-+    {
-+      struct lwp_info *lp;
-+      ptid_t ptid;
-+
-+      ALL_LWPS (lp, ptid)
-+      i386_linux_dr_set (ptid, DR_FIRSTADDR + regnum, addr);
-+    }
- }
- void
-@@ -673,6 +694,41 @@ i386_linux_new_thread (ptid_t ptid)
-   i386_linux_dr_set (ptid, DR_CONTROL, i386_linux_dr[DR_CONTROL]);
- }
-+
-+/* TO_FOLLOW_FORK stores here the PID under DETACH_BREAKPOINTS for the child
-+   process of traced FORK.  We must clear such watchpoints only once during
-+   DETACH_BREAKPOINTS.  */
-+
-+static int i386_linux_detach_breakpoints_pid;
-+
-+/* Remove a watchpoint that watched the memory region which starts at
-+   address ADDR, whose length is LEN bytes, and for accesses of the
-+   type TYPE.  Return 0 on success, -1 on failure.  */
-+int
-+i386_linux_remove_watchpoint (CORE_ADDR addr, int len, int type)
-+{
-+  if (ptid_get_pid (inferior_ptid) == i386_linux_detach_breakpoints_pid)
-+    return 0;
-+  /* FOLLOW-FORK-MODE CHILD runs later the CHILD with no restrictions.  */
-+  i386_linux_detach_breakpoints_pid = 0;
-+
-+  return i386_remove_watchpoint (addr, len, type);
-+}
-+
-+static void
-+i386_linux_detach_breakpoints (int detached_pid)
-+{
-+  struct cleanup *old_chain = save_inferior_ptid ();
-+  int i;
-+
-+  i386_linux_detach_breakpoints_pid = detached_pid;
-+  /* Depend on `!is_lwp (inferior_ptid)' for the I386_* macros.  */
-+  inferior_ptid = pid_to_ptid (detached_pid);
-+
-+  i386_detach_breakpoints (detached_pid);
-+
-+  do_cleanups (old_chain);
-+}
\f
- /* Called by libthread_db.  Returns a pointer to the thread local
-@@ -812,6 +868,40 @@ i386_linux_child_post_startup_inferior (
-   super_post_startup_inferior (ptid);
- }
-+static int (*i386_linux_super_follow_fork) (struct target_ops *ops,
-+                                          int follow_child);
-+
-+/* We need to duplicate the LINUX_CHILD_FOLLOW_FORK behavior here and catch its
-+   called DETACH_BREAKPOINTS to avoid corrupting our local registers mirror.  */
-+
-+static int
-+i386_linux_follow_fork (struct target_ops *ops, int follow_child)
-+{
-+  ptid_t last_ptid;
-+  struct target_waitstatus last_status;
-+  int has_vforked;
-+  int parent_pid, child_pid;
-+
-+  get_last_target_status (&last_ptid, &last_status);
-+  has_vforked = (last_status.kind == TARGET_WAITKIND_VFORKED);
-+  parent_pid = ptid_get_lwp (last_ptid);
-+  if (parent_pid == 0)
-+    parent_pid = ptid_get_pid (last_ptid);
-+  child_pid = ptid_get_pid (last_status.value.related_pid);
-+
-+  if (! follow_child)
-+    {
-+      i386_linux_detach_breakpoints (child_pid);
-+    }
-+  else
-+    {
-+      if (! has_vforked)
-+      i386_linux_detach_breakpoints (child_pid);
-+    }
-+
-+  return (*i386_linux_super_follow_fork) (ops, follow_child);
-+}
-+
- void
- _initialize_i386_linux_nat (void)
- {
-@@ -833,6 +923,9 @@ _initialize_i386_linux_nat (void)
-   t->to_fetch_registers = i386_linux_fetch_inferior_registers;
-   t->to_store_registers = i386_linux_store_inferior_registers;
-+  i386_linux_super_follow_fork = t->to_follow_fork;
-+  t->to_follow_fork = i386_linux_follow_fork;
-+
-   /* Register the target.  */
-   linux_nat_add_target (t);
-   linux_nat_set_new_thread (t, i386_linux_new_thread);
-Index: gdb-6.8.50.20090209/gdb/i386-nat.c
-===================================================================
---- gdb-6.8.50.20090209.orig/gdb/i386-nat.c    2009-01-03 06:57:51.000000000 +0100
-+++ gdb-6.8.50.20090209/gdb/i386-nat.c 2009-02-09 16:02:42.000000000 +0100
-@@ -546,6 +546,17 @@ i386_remove_watchpoint (CORE_ADDR addr, 
-   return retval;
- }
-+void
-+i386_detach_breakpoints (int detached_pid)
-+{
-+  int i;
-+
-+  /* Do not touch any DR_MIRROR or DR_CONTROL_MIRROR mirrors here.  */
-+  I386_DR_LOW_SET_CONTROL (0);
-+  ALL_DEBUG_REGISTERS(i)
-+    I386_DR_LOW_RESET_ADDR (i);
-+}
-+
- /* Return non-zero if we can watch a memory region that starts at
-    address ADDR and whose length is LEN bytes.  */
-Index: gdb-6.8.50.20090209/gdb/ia64-linux-nat.c
-===================================================================
---- gdb-6.8.50.20090209.orig/gdb/ia64-linux-nat.c      2009-02-09 15:48:43.000000000 +0100
-+++ gdb-6.8.50.20090209/gdb/ia64-linux-nat.c   2009-02-09 16:02:42.000000000 +0100
-@@ -583,6 +583,12 @@ ia64_linux_insert_watchpoint (CORE_ADDR 
-   return 0;
- }
-+/* TO_FOLLOW_FORK stores here the PID under DETACH_BREAKPOINTS for the child
-+   process of traced FORK.  We must clear such watchpoints only once during
-+   DETACH_BREAKPOINTS.  */
-+
-+static int ia64_linux_detach_breakpoints_pid;
-+
- static int
- ia64_linux_remove_watchpoint (CORE_ADDR addr, int len, int type)
- {
-@@ -590,6 +596,11 @@ ia64_linux_remove_watchpoint (CORE_ADDR 
-   long dbr_addr, dbr_mask;
-   int max_watchpoints = 4;
-+  if (ptid_get_pid (inferior_ptid) == ia64_linux_detach_breakpoints_pid)
-+    return 0;
-+  /* FOLLOW-FORK-MODE CHILD runs later the CHILD with no restrictions.  */
-+  ia64_linux_detach_breakpoints_pid = 0;
-+
-   if (len <= 0 || !is_power_of_2 (len))
-     return -1;
-@@ -617,6 +628,22 @@ ia64_linux_remove_watchpoint (CORE_ADDR 
- }
- static void
-+ia64_linux_detach_breakpoints (int detached_pid)
-+{
-+  int idx, i;
-+  long dbr_addr, dbr_mask;
-+  int max_watchpoints = 4;
-+
-+  ia64_linux_detach_breakpoints_pid = detached_pid;
-+
-+  /* Do not touch any DEBUG_REGISTERS mirrors here.  */
-+  dbr_addr = 0;
-+  dbr_mask = 0;
-+  for (idx = 0; idx < max_watchpoints; idx++)
-+    store_debug_register_pair (ptid_build (detached_pid, 0, 0), idx, &dbr_addr, &dbr_mask);
-+}
-+
-+static void
- ia64_linux_new_thread (ptid_t ptid)
- {
-   int i, any;
-@@ -805,6 +832,40 @@ ia64_linux_xfer_partial (struct target_o
-                            offset, len);
- }
-+static int (*ia64_linux_super_follow_fork) (struct target_ops *ops,
-+                                          int follow_child);
-+
-+/* We need to duplicate the LINUX_CHILD_FOLLOW_FORK behavior here and catch its
-+   called DETACH_BREAKPOINTS to avoid corrupting our local registers mirror.  */
-+
-+int
-+ia64_linux_follow_fork (struct target_ops *ops, int follow_child)
-+{
-+  ptid_t last_ptid;
-+  struct target_waitstatus last_status;
-+  int has_vforked;
-+  int parent_pid, child_pid;
-+
-+  get_last_target_status (&last_ptid, &last_status);
-+  has_vforked = (last_status.kind == TARGET_WAITKIND_VFORKED);
-+  parent_pid = ptid_get_lwp (last_ptid);
-+  if (parent_pid == 0)
-+    parent_pid = ptid_get_pid (last_ptid);
-+  child_pid = ptid_get_pid (last_status.value.related_pid);
-+
-+  if (! follow_child)
-+    {
-+      ia64_linux_detach_breakpoints (child_pid);
-+    }
-+  else
-+    {
-+      if (! has_vforked)
-+      ia64_linux_detach_breakpoints (child_pid);
-+    }
-+
-+  return (*ia64_linux_super_follow_fork) (ops, follow_child);
-+}
-+
- void _initialize_ia64_linux_nat (void);
- /*
-@@ -899,6 +960,9 @@ _initialize_ia64_linux_nat (void)
-   t->to_insert_watchpoint = ia64_linux_insert_watchpoint;
-   t->to_remove_watchpoint = ia64_linux_remove_watchpoint;
-+  ia64_linux_super_follow_fork = t->to_follow_fork;
-+  t->to_follow_fork = ia64_linux_follow_fork;
-+
-   /* Register the target.  */
-   linux_nat_add_target (t);
-   linux_nat_set_new_thread (t, ia64_linux_new_thread);
-Index: gdb-6.8.50.20090209/gdb/ppc-linux-nat.c
-===================================================================
---- gdb-6.8.50.20090209.orig/gdb/ppc-linux-nat.c       2009-01-03 06:57:52.000000000 +0100
-+++ gdb-6.8.50.20090209/gdb/ppc-linux-nat.c    2009-02-09 16:02:42.000000000 +0100
-@@ -1118,6 +1118,12 @@ ppc_linux_insert_watchpoint (CORE_ADDR a
-   return 0;
- }
-+/* TO_FOLLOW_FORK stores here the PID under DETACH_BREAKPOINTS for the child
-+   process of traced FORK.  We must clear such watchpoints only once during
-+   DETACH_BREAKPOINTS.  */
-+
-+static int ppc_linux_detach_breakpoints_pid;
-+
- static int
- ppc_linux_remove_watchpoint (CORE_ADDR addr, int len, int rw)
- {
-@@ -1125,6 +1131,11 @@ ppc_linux_remove_watchpoint (CORE_ADDR a
-   ptid_t ptid;
-   long dabr_value = 0;
-+  if (ptid_get_pid (inferior_ptid) == ppc_linux_detach_breakpoints_pid)
-+    return 0;
-+  /* FOLLOW-FORK-MODE CHILD runs later the CHILD with no restrictions.  */
-+  ppc_linux_detach_breakpoints_pid = 0;
-+
-   saved_dabr_value = 0;
-   ALL_LWPS (lp, ptid)
-     if (ptrace (PTRACE_SET_DEBUGREG, TIDGET (ptid), 0, saved_dabr_value) < 0)
-@@ -1138,6 +1149,15 @@ ppc_linux_new_thread (ptid_t ptid)
-   ptrace (PTRACE_SET_DEBUGREG, TIDGET (ptid), 0, saved_dabr_value);
- }
-+static void
-+ppc_linux_detach_breakpoints (int detached_pid)
-+{
-+  ppc_linux_detach_breakpoints_pid = detached_pid;
-+
-+  /* Do not touch the SAVED_DABR_VALUE mirror here.  */
-+  ptrace (PTRACE_SET_DEBUGREG, detached_pid, 0, 0);
-+}
-+
- static int
- ppc_linux_stopped_data_address (struct target_ops *target, CORE_ADDR *addr_p)
- {
-@@ -1318,6 +1338,40 @@ ppc_linux_read_description (struct targe
-   return isa205? tdesc_powerpc_isa205_32l : tdesc_powerpc_32l;
- }
-+static int (*ppc_linux_super_follow_fork) (struct target_ops *ops,
-+                                         int follow_child);
-+
-+/* We need to duplicate the LINUX_CHILD_FOLLOW_FORK behavior here and catch its
-+   called DETACH_BREAKPOINTS to avoid corrupting our local registers mirror.  */
-+
-+int
-+ppc_linux_follow_fork (struct target_ops *ops, int follow_child)
-+{
-+  ptid_t last_ptid;
-+  struct target_waitstatus last_status;
-+  int has_vforked;
-+  int parent_pid, child_pid;
-+
-+  get_last_target_status (&last_ptid, &last_status);
-+  has_vforked = (last_status.kind == TARGET_WAITKIND_VFORKED);
-+  parent_pid = ptid_get_lwp (last_ptid);
-+  if (parent_pid == 0)
-+    parent_pid = ptid_get_pid (last_ptid);
-+  child_pid = ptid_get_pid (last_status.value.related_pid);
-+
-+  if (! follow_child)
-+    {
-+      ppc_linux_detach_breakpoints (child_pid);
-+    }
-+  else
-+    {
-+      if (! has_vforked)
-+      ppc_linux_detach_breakpoints (child_pid);
-+    }
-+
-+  return (*ppc_linux_super_follow_fork) (ops, follow_child);
-+}
-+
- void _initialize_ppc_linux_nat (void);
- void
-@@ -1343,6 +1397,9 @@ _initialize_ppc_linux_nat (void)
-   t->to_read_description = ppc_linux_read_description;
-+  ppc_linux_super_follow_fork = t->to_follow_fork;
-+  t->to_follow_fork = ppc_linux_follow_fork;
-+
-   /* Register the target.  */
-   linux_nat_add_target (t);
-   linux_nat_set_new_thread (t, ppc_linux_new_thread);
-Index: gdb-6.8.50.20090209/gdb/s390-nat.c
-===================================================================
---- gdb-6.8.50.20090209.orig/gdb/s390-nat.c    2007-11-07 07:36:57.000000000 +0100
-+++ gdb-6.8.50.20090209/gdb/s390-nat.c 2009-02-09 16:02:42.000000000 +0100
-@@ -283,21 +283,15 @@ s390_stopped_by_watchpoint (void)
- }
- static void
--s390_fix_watch_points (ptid_t ptid)
-+s390_fix_watch_points_list (int tid, struct watch_area *area_list)
- {
--  int tid;
--
-   per_struct per_info;
-   ptrace_area parea;
-   CORE_ADDR watch_lo_addr = (CORE_ADDR)-1, watch_hi_addr = 0;
-   struct watch_area *area;
--  tid = TIDGET (ptid);
--  if (tid == 0)
--    tid = PIDGET (ptid);
--
--  for (area = watch_base; area; area = area->next)
-+  for (area = area_list; area; area = area->next)
-     {
-       watch_lo_addr = min (watch_lo_addr, area->lo_addr);
-       watch_hi_addr = max (watch_hi_addr, area->hi_addr);
-@@ -309,7 +303,7 @@ s390_fix_watch_points (ptid_t ptid)
-   if (ptrace (PTRACE_PEEKUSR_AREA, tid, &parea) < 0)
-     perror_with_name (_("Couldn't retrieve watchpoint status"));
--  if (watch_base)
-+  if (area_list)
-     {
-       per_info.control_regs.bits.em_storage_alteration = 1;
-       per_info.control_regs.bits.storage_alt_space_ctl = 1;
-@@ -326,6 +320,18 @@ s390_fix_watch_points (ptid_t ptid)
-     perror_with_name (_("Couldn't modify watchpoint status"));
- }
-+static void
-+s390_fix_watch_points (ptid_t ptid)
-+{
-+  int tid;
-+
-+  tid = TIDGET (ptid);
-+  if (tid == 0)
-+    tid = PIDGET (ptid);
-+
-+  s390_fix_watch_points_list (tid, watch_base);
-+}
-+
- static int
- s390_insert_watchpoint (CORE_ADDR addr, int len, int type)
- {
-@@ -347,6 +353,12 @@ s390_insert_watchpoint (CORE_ADDR addr, 
-   return 0;
- }
-+/* TO_FOLLOW_FORK stores here the PID under DETACH_BREAKPOINTS for the child
-+   process of traced FORK.  We must clear such watchpoints only once during
-+   DETACH_BREAKPOINTS.  */
-+
-+static int s390_detach_breakpoints_pid;
-+
- static int
- s390_remove_watchpoint (CORE_ADDR addr, int len, int type)
- {
-@@ -354,6 +366,11 @@ s390_remove_watchpoint (CORE_ADDR addr, 
-   ptid_t ptid;
-   struct watch_area *area, **parea;
-+  if (ptid_get_pid (inferior_ptid) == s390_detach_breakpoints_pid)
-+    return 0;
-+  /* FOLLOW-FORK-MODE CHILD runs later the CHILD with no restrictions.  */
-+  s390_detach_breakpoints_pid = 0;
-+
-   for (parea = &watch_base; *parea; parea = &(*parea)->next)
-     if ((*parea)->lo_addr == addr
-       && (*parea)->hi_addr == addr + len - 1)
-@@ -361,8 +378,10 @@ s390_remove_watchpoint (CORE_ADDR addr, 
-   if (!*parea)
-     {
-+#if 0 /* Red Hat fork/threads watchpoints changes may trigger it.  */
-       fprintf_unfiltered (gdb_stderr,
-                         "Attempt to remove nonexistent watchpoint.\n");
-+#endif
-       return -1;
-     }
-@@ -375,6 +394,15 @@ s390_remove_watchpoint (CORE_ADDR addr, 
-   return 0;
- }
-+static void
-+s390_detach_breakpoints (int detached_pid)
-+{
-+  s390_detach_breakpoints_pid = detached_pid;
-+
-+  /* Do not touch the WATCH_BASE here.  */
-+  s390_fix_watch_points_list (detached_pid, NULL);
-+}
-+
- static int
- s390_can_use_hw_breakpoint (int type, int cnt, int othertype)
- {
-@@ -387,6 +415,39 @@ s390_region_ok_for_hw_watchpoint (CORE_A
-   return 1;
- }
-+static int (*s390_super_follow_fork) (struct target_ops *ops, int follow_child);
-+
-+/* We need to duplicate the LINUX_CHILD_FOLLOW_FORK behavior here and catch its
-+   called DETACH_BREAKPOINTS to avoid corrupting our local registers mirror.  */
-+
-+int
-+s390_follow_fork (struct target_ops *ops, int follow_child)
-+{
-+  ptid_t last_ptid;
-+  struct target_waitstatus last_status;
-+  int has_vforked;
-+  int parent_pid, child_pid;
-+
-+  get_last_target_status (&last_ptid, &last_status);
-+  has_vforked = (last_status.kind == TARGET_WAITKIND_VFORKED);
-+  parent_pid = ptid_get_lwp (last_ptid);
-+  if (parent_pid == 0)
-+    parent_pid = ptid_get_pid (last_ptid);
-+  child_pid = ptid_get_pid (last_status.value.related_pid);
-+
-+  if (! follow_child)
-+    {
-+      s390_detach_breakpoints (child_pid);
-+    }
-+  else
-+    {
-+      if (! has_vforked)
-+      s390_detach_breakpoints (child_pid);
-+    }
-+
-+  return (*s390_super_follow_fork) (ops, follow_child);
-+}
-+
- void _initialize_s390_nat (void);
-@@ -410,6 +471,9 @@ _initialize_s390_nat (void)
-   t->to_insert_watchpoint = s390_insert_watchpoint;
-   t->to_remove_watchpoint = s390_remove_watchpoint;
-+  s390_super_follow_fork = t->to_follow_fork;
-+  t->to_follow_fork = s390_follow_fork;
-+
-   /* Register the target.  */
-   linux_nat_add_target (t);
-   linux_nat_set_new_thread (t, s390_fix_watch_points);
-Index: gdb-6.8.50.20090209/gdb/testsuite/gdb.threads/watchpoint-fork-forkoff.c
-===================================================================
---- /dev/null  1970-01-01 00:00:00.000000000 +0000
-+++ gdb-6.8.50.20090209/gdb/testsuite/gdb.threads/watchpoint-fork-forkoff.c    2009-02-09 16:02:42.000000000 +0100
-@@ -0,0 +1,172 @@
-+/* Test case for forgotten hw-watchpoints after fork()-off of a process.
-+
-+   Copyright 2008
-+   Free Software Foundation, Inc.
-+
-+   This file is part of GDB.
-+
-+   This program is free software; you can redistribute it and/or modify
-+   it under the terms of the GNU General Public License as published by
-+   the Free Software Foundation; either version 2 of the License, or
-+   (at your option) any later version.
-+
-+   This program is distributed in the hope that it will be useful,
-+   but WITHOUT ANY WARRANTY; without even the implied warranty of
-+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-+   GNU General Public License for more details.
-+
-+   You should have received a copy of the GNU General Public License
-+   along with this program; if not, write to the Free Software
-+   Foundation, Inc., 59 Temple Place - Suite 330,
-+   Boston, MA 02111-1307, USA.  */
-+
-+#include <string.h>
-+#include <errno.h>
-+
-+static void delay (void)
-+{
-+  int i = usleep (1000000 / 100);
-+  assert (i == 0 || errno == EINTR);
-+}
-+
-+#if defined FOLLOW_PARENT
-+
-+static void forkoff (int nr)
-+{
-+  pid_t child, pid_got;
-+  int exit_code = 42 + nr;
-+  int status, i;
-+
-+  child = fork ();
-+  switch (child)
-+    {
-+    case -1:
-+      assert (0);
-+    case 0:
-+      printf ("child%d: %d\n", nr, (int) getpid ());
-+      /* Delay to get both the "child%d" and "parent%d" message printed without
-+       a race breaking expect by its endless wait on `$gdb_prompt$':
-+       Breakpoint 3, breakpoint () at ../../../gdb/testsuite/gdb.threads/watchpoint-fork.c:33
-+       33      }
-+       (gdb) parent2: 14223  */
-+      i = sleep (1);
-+      assert (i == 0);
-+
-+      /* We must not get caught here (against a forgotten breakpoint).  */
-+      var++;
-+      breakpoint ();
-+
-+      _exit (exit_code);
-+    default:
-+      printf ("parent%d: %d\n", nr, (int) child);
-+      /* Delay to get both the "child%d" and "parent%d" message printed, see
-+       above.  */
-+      i = sleep (1);
-+      assert (i == 0);
-+
-+      pid_got = wait (&status);
-+      assert (pid_got == child);
-+      assert (WIFEXITED (status));
-+      assert (WEXITSTATUS (status) == exit_code);
-+
-+      /* We must get caught here (against a false watchpoint removal).  */
-+      breakpoint ();
-+    }
-+}
-+
-+#elif defined FOLLOW_CHILD
-+
-+static volatile int usr1_got;
-+
-+static void handler_usr1 (int signo)
-+{
-+  usr1_got++;
-+}
-+
-+static void forkoff (int nr)
-+{
-+  pid_t child;
-+  int i, loop;
-+  struct sigaction act, oldact;
-+#ifdef THREAD
-+  void *thread_result;
-+#endif
-+
-+  memset (&act, 0, sizeof act);
-+  act.sa_flags = SA_RESTART;
-+  act.sa_handler = handler_usr1;
-+  sigemptyset (&act.sa_mask);
-+  i = sigaction (SIGUSR1, &act, &oldact);
-+  assert (i == 0);
-+
-+  child = fork ();
-+  switch (child)
-+    {
-+    case -1:
-+      assert (0);
-+    default:
-+      printf ("parent%d: %d\n", nr, (int) child);
-+
-+      /* Sleep for a while to possibly get incorrectly ATTACH_THREADed by GDB
-+         tracing the child fork with no longer valid thread/lwp entries of the
-+         parent.  */
-+
-+      i = sleep (2);
-+      assert (i == 0);
-+
-+      /* We must not get caught here (against a forgotten breakpoint).  */
-+
-+      var++;
-+      breakpoint ();
-+
-+#ifdef THREAD
-+      /* And neither got caught our thread.  */
-+
-+      step = 99;
-+      i = pthread_join (thread, &thread_result);
-+      assert (i == 0);
-+      assert (thread_result == (void *) 99UL);
-+#endif
-+
-+      /* Be sure our child knows we did not get caught above.  */
-+
-+      i = kill (child, SIGUSR1);
-+      assert (i == 0);
-+
-+      /* Sleep for a while to check GDB's `info threads' no longer tracks us in
-+         the child fork.  */
-+
-+      i = sleep (2);
-+      assert (i == 0);
-+
-+      _exit (0);
-+    case 0:
-+      printf ("child%d: %d\n", nr, (int) getpid ());
-+
-+      /* Let the parent signal us about its success.  Be careful of races.  */
-+
-+      for (loop = 0; loop < 1000; loop++)
-+        {
-+        /* Parent either died (and USR1_GOT is zero) or it succeeded.  */
-+        if (kill (getppid (), 0) != 0)
-+          break;
-+        /* Parent succeeded?  */
-+        if (usr1_got)
-+          break;
-+
-+        delay ();
-+      }
-+      assert (usr1_got);
-+
-+      /* We must get caught here (against a false watchpoint removal).  */
-+
-+      breakpoint ();
-+    }
-+
-+  i = sigaction (SIGUSR1, &oldact, NULL);
-+  assert (i == 0);
-+}
-+
-+#else
-+# error "!FOLLOW_PARENT && !FOLLOW_CHILD"
-+#endif
-Index: gdb-6.8.50.20090209/gdb/testsuite/gdb.threads/watchpoint-fork-mt.c
-===================================================================
---- /dev/null  1970-01-01 00:00:00.000000000 +0000
-+++ gdb-6.8.50.20090209/gdb/testsuite/gdb.threads/watchpoint-fork-mt.c 2009-02-09 16:02:42.000000000 +0100
-@@ -0,0 +1,154 @@
-+/* Test case for forgotten hw-watchpoints after fork()-off of a process.
-+
-+   Copyright 2008
-+   Free Software Foundation, Inc.
-+
-+   This file is part of GDB.
-+
-+   This program is free software; you can redistribute it and/or modify
-+   it under the terms of the GNU General Public License as published by
-+   the Free Software Foundation; either version 2 of the License, or
-+   (at your option) any later version.
-+
-+   This program is distributed in the hope that it will be useful,
-+   but WITHOUT ANY WARRANTY; without even the implied warranty of
-+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-+   GNU General Public License for more details.
-+
-+   You should have received a copy of the GNU General Public License
-+   along with this program; if not, write to the Free Software
-+   Foundation, Inc., 59 Temple Place - Suite 330,
-+   Boston, MA 02111-1307, USA.  */
-+
-+#include <assert.h>
-+#include <unistd.h>
-+#include <sys/wait.h>
-+#include <stdio.h>
-+#include <stdlib.h>
-+#include <pthread.h>
-+
-+#include <asm/unistd.h>
-+#include <unistd.h>
-+#define gettid() syscall (__NR_gettid)
-+
-+/* Non-atomic `var++' should not hurt as we synchronize the threads by the STEP
-+   variable.  Hit-comments need to be duplicite there to catch both at-stops
-+   and behind-stops, depending on the target.  */
-+
-+static volatile int var;
-+
-+static void dummy (void)
-+{
-+}
-+
-+static void breakpoint (void)
-+{
-+}
-+
-+/* Include here the functions:
-+   static void forkoff (int nr);
-+   static void delay (void);  */
-+
-+static pthread_t thread;
-+static volatile int step;
-+#define THREAD
-+
-+#include "watchpoint-fork-forkoff.c"
-+
-+static void *start (void *arg)
-+{
-+  if (step >= 3)
-+    goto step_3;
-+
-+  while (step != 1)
-+    delay ();
-+
-+  var++;      /* validity-thread-B */
-+  dummy ();   /* validity-thread-B */
-+  step = 2;
-+  while (step != 3)
-+    {
-+      if (step == 99)
-+        goto step_99;
-+      delay ();
-+    }
-+
-+step_3:
-+  if (step >= 5)
-+    goto step_5;
-+
-+  var++;      /* after-fork1-B */
-+  dummy ();   /* after-fork1-B */
-+  step = 4;
-+  while (step != 5)
-+    {
-+      if (step == 99)
-+        goto step_99;
-+      delay ();
-+    }
-+
-+step_5:
-+  var++;      /* after-fork2-B */
-+  dummy ();   /* after-fork2-B */
-+  return (void *) 5UL;
-+
-+step_99:
-+  /* We must not get caught here (against a forgotten breakpoint).  */
-+  var++;
-+  breakpoint ();
-+  return (void *) 99UL;
-+}
-+
-+int main (void)
-+{
-+  int i;
-+  void *thread_result;
-+
-+  setbuf (stdout, NULL);
-+  printf ("main: %d\n", (int) gettid ());
-+
-+  /* General watchpoints validity.  */
-+  var++;      /* validity-first */
-+  dummy ();   /* validity-first */
-+
-+  i = pthread_create (&thread, NULL, start, NULL);
-+  assert (i == 0);
-+
-+  var++;      /* validity-thread-A */
-+  dummy ();   /* validity-thread-A */
-+  step = 1;
-+  while (step != 2)
-+    delay ();
-+
-+  /* Hardware watchpoints got disarmed here.  */
-+  forkoff (1);
-+
-+  var++;      /* after-fork1-A */
-+  dummy ();   /* after-fork1-A */
-+  step = 3;
-+#ifdef FOLLOW_CHILD
-+  /* Spawn new thread as it was deleted in the child of FORK.  */
-+  i = pthread_create (&thread, NULL, start, NULL);
-+  assert (i == 0);
-+#endif
-+  while (step != 4)
-+    delay ();
-+
-+  /* A sanity check for double hardware watchpoints removal.  */
-+  forkoff (2);
-+
-+  var++;      /* after-fork2-A */
-+  dummy ();   /* after-fork2-A */
-+  step = 5;
-+#ifdef FOLLOW_CHILD
-+  /* Spawn new thread as it was deleted in the child of FORK.  */
-+  i = pthread_create (&thread, NULL, start, NULL);
-+  assert (i == 0);
-+#endif
-+
-+  i = pthread_join (thread, &thread_result);
-+  assert (i == 0);
-+  assert (thread_result == (void *) 5UL);
-+
-+  return 0;
-+}
-Index: gdb-6.8.50.20090209/gdb/testsuite/gdb.threads/watchpoint-fork.c
-===================================================================
---- /dev/null  1970-01-01 00:00:00.000000000 +0000
-+++ gdb-6.8.50.20090209/gdb/testsuite/gdb.threads/watchpoint-fork.c    2009-02-09 16:02:42.000000000 +0100
-@@ -0,0 +1,56 @@
-+/* Test case for forgotten hw-watchpoints after fork()-off of a process.
-+
-+   Copyright 2008
-+   Free Software Foundation, Inc.
-+
-+   This file is part of GDB.
-+
-+   This program is free software; you can redistribute it and/or modify
-+   it under the terms of the GNU General Public License as published by
-+   the Free Software Foundation; either version 2 of the License, or
-+   (at your option) any later version.
-+
-+   This program is distributed in the hope that it will be useful,
-+   but WITHOUT ANY WARRANTY; without even the implied warranty of
-+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-+   GNU General Public License for more details.
-+
-+   You should have received a copy of the GNU General Public License
-+   along with this program; if not, write to the Free Software
-+   Foundation, Inc., 59 Temple Place - Suite 330,
-+   Boston, MA 02111-1307, USA.  */
-+
-+#include <assert.h>
-+#include <unistd.h>
-+#include <sys/wait.h>
-+#include <stdio.h>
-+#include <stdlib.h>
-+
-+static volatile int var;
-+
-+static void breakpoint (void)
-+{
-+}
-+
-+/* Include here the function:
-+   static void forkoff (int nr);  */
-+
-+#include "watchpoint-fork-forkoff.c"
-+
-+int main (void)
-+{
-+  setbuf (stdout, NULL);
-+  printf ("main: %d\n", (int) getpid ());
-+
-+  /* General watchpoints validity.  */
-+  var++;
-+  /* Hardware watchpoints got disarmed here.  */
-+  forkoff (1);
-+  /* This watchpoint got lost before.  */
-+  var++;
-+  /* A sanity check for double hardware watchpoints removal.  */
-+  forkoff (2);
-+  var++;
-+
-+  return 0;
-+}
-Index: gdb-6.8.50.20090209/gdb/testsuite/gdb.threads/watchpoint-fork.exp
-===================================================================
---- /dev/null  1970-01-01 00:00:00.000000000 +0000
-+++ gdb-6.8.50.20090209/gdb/testsuite/gdb.threads/watchpoint-fork.exp  2009-02-09 16:02:42.000000000 +0100
-@@ -0,0 +1,140 @@
-+# Copyright 2008 Free Software Foundation, Inc.
-+
-+# This program is free software; you can redistribute it and/or modify
-+# it under the terms of the GNU General Public License as published by
-+# the Free Software Foundation; either version 3 of the License, or
-+# (at your option) any later version.
-+#
-+# This program is distributed in the hope that it will be useful,
-+# but WITHOUT ANY WARRANTY; without even the implied warranty of
-+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-+# GNU General Public License for more details.
-+#
-+# You should have received a copy of the GNU General Public License
-+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
-+
-+# Test case for forgotten hw-watchpoints after fork()-off of a process.
-+
-+proc test {type symbol} {
-+    global objdir subdir srcdir
-+
-+    global pf_prefix
-+    set prefix_test $pf_prefix
-+    lappend pf_prefix "$type:"
-+    set prefix_mt $pf_prefix
-+
-+    # no threads
-+
-+    set pf_prefix $prefix_mt
-+    lappend pf_prefix "singlethreaded:"
-+
-+    set testfile watchpoint-fork
-+    set srcfile ${testfile}.c
-+    set binfile ${objdir}/${subdir}/${testfile}
-+
-+    if  { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable "debug additional_flags=-D$symbol"] != "" } {
-+      untested "Couldn't compile test program"
-+      return -1
-+    }
-+
-+    gdb_exit
-+    gdb_start
-+    gdb_reinitialize_dir $srcdir/$subdir
-+    gdb_load ${binfile}
-+
-+    gdb_test "set follow-fork-mode $type"
-+    # Testcase uses it for the `follow-fork-mode child' type.
-+    gdb_test "handle SIGUSR1 nostop noprint pass"
-+
-+    if { ![runto_main] } then {
-+      gdb_suppress_tests
-+      return
-+    }
-+
-+    # Install the watchpoint only after getting into MAIN - workaround some PPC
-+    # problem.
-+    gdb_test "watch var" "atchpoint 2: var" "Set the watchpoint"
-+
-+    # It is never hit but it should not be left over in the fork()ed-off child.
-+    gdb_breakpoint "breakpoint"
-+
-+    gdb_test "continue" \
-+           "atchpoint 2: var.*Old value = 0.*New value = 1.*forkoff *\\(1\\).*" "watchpoints work"
-+    gdb_test "continue" \
-+           "reakpoint 3, breakpoint.*" "breakpoint after the first fork"
-+    gdb_test "continue" \
-+           "atchpoint 2: var.*Old value = 1.*New value = 2.*forkoff *\\(2\\).*" "watchpoint after the first fork"
-+    gdb_test "continue" \
-+           "reakpoint 3, breakpoint.*" "breakpoint after the second fork"
-+    gdb_test "continue" \
-+           "atchpoint 2: var.*Old value = 2.*New value = 3.*return *0;" "watchpoint after the second fork"
-+    gdb_test "continue" "Continuing..*Program exited normally." "finish"
-+
-+
-+    # threads
-+
-+    set pf_prefix $prefix_mt
-+    lappend pf_prefix "multithreaded:"
-+
-+    set testfile watchpoint-fork-mt
-+    set srcfile ${testfile}.c
-+    set binfile ${objdir}/${subdir}/${testfile}
-+
-+    if  { [gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable "debug additional_flags=-D$symbol"] != "" } {
-+      untested "Couldn't compile test program"
-+      return -1
-+    }
-+
-+    gdb_exit
-+    gdb_start
-+    gdb_reinitialize_dir $srcdir/$subdir
-+    gdb_load ${binfile}
-+
-+    gdb_test "set follow-fork-mode $type"
-+    # Testcase uses it for the `follow-fork-mode child' type.
-+    gdb_test "handle SIGUSR1 nostop noprint pass"
-+
-+    if { ![runto_main] } then {
-+      gdb_suppress_tests
-+      return
-+    }
-+
-+    # Install the watchpoint only after getting into MAIN - workaround some PPC
-+    # problem.
-+    gdb_test "watch var" "atchpoint 2: var" "Set the watchpoint"
-+
-+    # It is never hit but it should not be left over in the fork()ed-off child.
-+    gdb_breakpoint "breakpoint"
-+
-+    gdb_test "continue" \
-+           "atchpoint 2: var.*Old value = 0.*New value = 1.*validity-first.*" "singlethread watchpoints work"
-+    gdb_test "continue" \
-+           "atchpoint 2: var.*Old value = 1.*New value = 2.*validity-thread-A.*" "multithreaded watchpoints work at A"
-+    gdb_test "continue" \
-+           "atchpoint 2: var.*Old value = 2.*New value = 3.*validity-thread-B.*" "multithreaded watchpoints work at B"
-+    gdb_test "continue" \
-+           "reakpoint 3, breakpoint.*" "breakpoint (A) after the first fork"
-+    gdb_test "continue" \
-+           "atchpoint 2: var.*Old value = 3.*New value = 4.*after-fork1-A.*" "watchpoint A after the first fork"
-+    gdb_test "continue" \
-+           "atchpoint 2: var.*Old value = 4.*New value = 5.*after-fork1-B.*" "watchpoint B after the first fork"
-+    gdb_test "continue" \
-+           "reakpoint 3, breakpoint.*" "breakpoint (A) after the second fork"
-+    gdb_test "continue" \
-+           "atchpoint 2: var.*Old value = 5.*New value = 6.*after-fork2-A.*" "watchpoint A after the second fork"
-+    gdb_test "continue" \
-+           "atchpoint 2: var.*Old value = 6.*New value = 7.*after-fork2-B.*" "watchpoint B after the second fork"
-+    gdb_test "continue" "Continuing..*Program exited normally." "finish"
-+
-+
-+    # cleanup
-+
-+    set pf_prefix $prefix_test
-+}
-+
-+test parent FOLLOW_PARENT
-+
-+# Only GNU/Linux is known to support `set follow-fork-mode child'.
-+if {[istarget "*-*-linux*"]} {
-+    test child FOLLOW_CHILD
-+}
-Index: gdb-6.8.50.20090209/gdb/doc/gdb.texinfo
-===================================================================
---- gdb-6.8.50.20090209.orig/gdb/doc/gdb.texinfo       2009-02-09 16:02:35.000000000 +0100
-+++ gdb-6.8.50.20090209/gdb/doc/gdb.texinfo    2009-02-09 16:02:42.000000000 +0100
-@@ -3588,6 +3588,14 @@ confident that no other thread can becom
- software watchpoints as usual.  However, @value{GDBN} may not notice
- when a non-current thread's activity changes the expression.  (Hardware
- watchpoints, in contrast, watch an expression in all threads.)
-+
-+Software watchpoints single-step the current thread to track the changes.
-+Other threads are left freely running on @code{continue}; therefore, their
-+changes cannot be caught.  To get more reliable software watchpoints, please
-+use @code{set scheduler-locking on}.  The default for Red Hat/Fedora
-+@value{GDBN} is @code{set scheduler-locking step}, which makes the software
-+watchpoints safe for the @code{step} command, but not for the @code{continue}
-+command.  @xref{Thread Stops}.
- @end quotation
- @xref{set remote hardware-watchpoint-limit}.
-Index: gdb-6.8.50.20090209/gdb/config/i386/nm-linux.h
-===================================================================
---- gdb-6.8.50.20090209.orig/gdb/config/i386/nm-linux.h        2009-01-03 06:57:54.000000000 +0100
-+++ gdb-6.8.50.20090209/gdb/config/i386/nm-linux.h     2009-02-09 16:02:42.000000000 +0100
-@@ -46,6 +46,16 @@ extern void i386_linux_dr_reset_addr (in
- extern unsigned long i386_linux_dr_get_status (void);
- #define I386_DR_LOW_GET_STATUS() \
-   i386_linux_dr_get_status ()
-+
-+/* Remove a watchpoint that watched the memory region which starts at
-+ *    address ADDR, whose length is LEN bytes, and for accesses of the
-+ *       type TYPE.  Return 0 on success, -1 on failure.  */
-+extern int i386_linux_remove_watchpoint (CORE_ADDR addr, int len, int type);
-+
-+/* Override basic i386 macros for watchpoint and hardware breakpoint
-+   insertion/removal to support threads.  */
-+#define target_remove_watchpoint(addr, len, type) \
-+  i386_linux_remove_watchpoint (addr, len, type)
\f
- #ifdef HAVE_PTRACE_GETFPXREGS
-Index: gdb-6.8.50.20090209/gdb/config/i386/nm-linux64.h
-===================================================================
---- gdb-6.8.50.20090209.orig/gdb/config/i386/nm-linux64.h      2009-01-03 06:57:54.000000000 +0100
-+++ gdb-6.8.50.20090209/gdb/config/i386/nm-linux64.h   2009-02-09 16:02:42.000000000 +0100
-@@ -51,4 +51,14 @@ extern unsigned long amd64_linux_dr_get_
- #define I386_DR_LOW_GET_STATUS() \
-   amd64_linux_dr_get_status ()
-+/* Remove a watchpoint that watched the memory region which starts at
-+ *    address ADDR, whose length is LEN bytes, and for accesses of the
-+ *       type TYPE.  Return 0 on success, -1 on failure.  */
-+extern int amd64_linux_remove_watchpoint (CORE_ADDR addr, int len, int type);
-+
-+/* Override basic amd64 macros for watchpoint and hardware breakpoint
-+   insertion/removal to support threads.  */
-+#define target_remove_watchpoint(addr, len, type) \
-+  amd64_linux_remove_watchpoint (addr, len, type)
-+
- #endif /* nm-linux64.h */
-Index: gdb-6.8.50.20090209/gdb/target.h
-===================================================================
---- gdb-6.8.50.20090209.orig/gdb/target.h      2009-02-09 15:49:25.000000000 +0100
-+++ gdb-6.8.50.20090209/gdb/target.h   2009-02-09 16:02:42.000000000 +0100
-@@ -1113,7 +1113,9 @@ extern char *normal_pid_to_str (ptid_t p
- #ifndef target_insert_watchpoint
- #define       target_insert_watchpoint(addr, len, type)       \
-      (*current_target.to_insert_watchpoint) (addr, len, type)
-+#endif
-+#ifndef target_remove_watchpoint
- #define       target_remove_watchpoint(addr, len, type)       \
-      (*current_target.to_remove_watchpoint) (addr, len, type)
- #endif
index f1053e68c2300469162da438fd57adc49edc58af..44e03141d0051c02086fac07798b6280dde73ac5 100644 (file)
@@ -1,8 +1,8 @@
-Index: gdb-6.8.50.20081128/gdb/infrun.c
+Index: gdb-6.8.50.20090811/gdb/infrun.c
 ===================================================================
---- gdb-6.8.50.20081128.orig/gdb/infrun.c      2008-12-09 15:56:16.000000000 +0100
-+++ gdb-6.8.50.20081128/gdb/infrun.c   2008-12-09 15:56:59.000000000 +0100
-@@ -931,7 +931,7 @@ static const char *scheduler_enums[] = {
+--- gdb-6.8.50.20090811.orig/gdb/infrun.c      2009-08-12 06:56:29.000000000 +0200
++++ gdb-6.8.50.20090811/gdb/infrun.c   2009-08-12 07:13:08.000000000 +0200
+@@ -1075,7 +1075,7 @@ static const char *scheduler_enums[] = {
    schedlock_step,
    NULL
  };
@@ -11,10 +11,10 @@ Index: gdb-6.8.50.20081128/gdb/infrun.c
  static void
  show_scheduler_mode (struct ui_file *file, int from_tty,
                     struct cmd_list_element *c, const char *value)
-Index: gdb-6.8.50.20081128/gdb/testsuite/gdb.mi/mi-console.exp
+Index: gdb-6.8.50.20090811/gdb/testsuite/gdb.mi/mi-console.exp
 ===================================================================
---- gdb-6.8.50.20081128.orig/gdb/testsuite/gdb.mi/mi-console.exp       2008-08-06 14:52:08.000000000 +0200
-+++ gdb-6.8.50.20081128/gdb/testsuite/gdb.mi/mi-console.exp    2008-12-09 15:59:34.000000000 +0100
+--- gdb-6.8.50.20090811.orig/gdb/testsuite/gdb.mi/mi-console.exp       2009-08-12 06:56:29.000000000 +0200
++++ gdb-6.8.50.20090811/gdb/testsuite/gdb.mi/mi-console.exp    2009-08-12 06:58:45.000000000 +0200
 @@ -47,6 +47,9 @@ if  { [gdb_compile "${srcdir}/${subdir}/
  
  mi_run_to_main
@@ -25,10 +25,10 @@ Index: gdb-6.8.50.20081128/gdb/testsuite/gdb.mi/mi-console.exp
  # Next over the hello() call which will produce lots of output
  mi_gdb_test "220-exec-next" \
            "220\\^running(\r\n\\*running,thread-id=\"all\")?" \
-Index: gdb-6.8.50.20081128/gdb/testsuite/gdb.mi/mi2-console.exp
+Index: gdb-6.8.50.20090811/gdb/testsuite/gdb.mi/mi2-console.exp
 ===================================================================
---- gdb-6.8.50.20081128.orig/gdb/testsuite/gdb.mi/mi2-console.exp      2008-08-06 14:52:08.000000000 +0200
-+++ gdb-6.8.50.20081128/gdb/testsuite/gdb.mi/mi2-console.exp   2008-12-09 16:00:33.000000000 +0100
+--- gdb-6.8.50.20090811.orig/gdb/testsuite/gdb.mi/mi2-console.exp      2009-08-12 06:56:29.000000000 +0200
++++ gdb-6.8.50.20090811/gdb/testsuite/gdb.mi/mi2-console.exp   2009-08-12 06:58:45.000000000 +0200
 @@ -47,6 +47,9 @@ if  { [gdb_compile "${srcdir}/${subdir}/
  
  mi_run_to_main
@@ -39,3 +39,16 @@ Index: gdb-6.8.50.20081128/gdb/testsuite/gdb.mi/mi2-console.exp
  # Next over the hello() call which will produce lots of output
  send_gdb "220-exec-next\n"
  gdb_expect {
+Index: gdb-6.8.50.20090811/gdb/testsuite/gdb.mi/mi-cli.exp
+===================================================================
+--- gdb-6.8.50.20090811.orig/gdb/testsuite/gdb.mi/mi-cli.exp   2009-06-09 19:12:42.000000000 +0200
++++ gdb-6.8.50.20090811/gdb/testsuite/gdb.mi/mi-cli.exp        2009-08-12 07:13:32.000000000 +0200
+@@ -173,7 +173,7 @@ mi_execute_to "exec-continue" "breakpoin
+ # Test that the token is output even for CLI commands
+ # Also test that *stopped includes frame information.
+ mi_gdb_test "34 next" \
+-    ".*34\\\^running.*\\*running,thread-id=\"all\"" \
++    ".*34\\\^running.*\\*running,thread-id=\"1\"" \
+     "34 next: run"
+ if {!$async} {
index cdf9225c02f5a0c7bfab28c6195cb2f88e545e20..5b5917d7907b81e48107a12a717ee398b3b0c97d 100644 (file)
 
        Port to GDB-6.8pre.
 
-Index: gdb-6.8.50.20081209/gdb/inferior.h
+Index: gdb-6.8.50.20090803/gdb/inferior.h
 ===================================================================
---- gdb-6.8.50.20081209.orig/gdb/inferior.h    2008-11-20 01:35:23.000000000 +0100
-+++ gdb-6.8.50.20081209/gdb/inferior.h 2008-12-10 01:22:23.000000000 +0100
-@@ -168,7 +168,15 @@ extern void reopen_exec_file (void);
+--- gdb-6.8.50.20090803.orig/gdb/inferior.h    2009-06-28 02:20:22.000000000 +0200
++++ gdb-6.8.50.20090803/gdb/inferior.h 2009-08-03 17:19:56.000000000 +0200
+@@ -181,7 +181,15 @@ extern void reopen_exec_file (void);
  /* The `resume' routine should only be called in special circumstances.
     Normally, use `proceed', which handles a lot of bookkeeping.  */
  
@@ -42,20 +42,20 @@ Index: gdb-6.8.50.20081209/gdb/inferior.h
  
  /* From misc files */
  
-Index: gdb-6.8.50.20081209/gdb/infrun.c
+Index: gdb-6.8.50.20090803/gdb/infrun.c
 ===================================================================
---- gdb-6.8.50.20081209.orig/gdb/infrun.c      2008-12-02 20:20:23.000000000 +0100
-+++ gdb-6.8.50.20081209/gdb/infrun.c   2008-12-10 01:23:46.000000000 +0100
-@@ -73,7 +73,7 @@ static int follow_fork (void);
+--- gdb-6.8.50.20090803.orig/gdb/infrun.c      2009-07-31 01:01:27.000000000 +0200
++++ gdb-6.8.50.20090803/gdb/infrun.c   2009-08-03 21:39:28.000000000 +0200
+@@ -74,7 +74,7 @@ static int follow_fork (void);
  static void set_schedlock_func (char *args, int from_tty,
                                struct cmd_list_element *c);
  
 -static int currently_stepping (struct thread_info *tp);
 +static enum resume_step currently_stepping (struct thread_info *tp);
  
- static int currently_stepping_callback (struct thread_info *tp, void *data);
-@@ -961,7 +961,7 @@ set_schedlock_func (char *args, int from
+ static int currently_stepping_or_nexting_callback (struct thread_info *tp,
+                                                  void *data);
+@@ -1137,7 +1137,7 @@ maybe_software_singlestep (struct gdbarc
     STEP nonzero if we should step (zero to continue instead).
     SIG is the signal to give the inferior (zero for none).  */
  void
@@ -64,7 +64,7 @@ Index: gdb-6.8.50.20081209/gdb/infrun.c
  {
    int should_resume = 1;
    struct cleanup *old_cleanups = make_cleanup (resume_cleanups, 0);
-@@ -975,10 +975,12 @@ resume (int step, enum target_signal sig
+@@ -1149,10 +1149,12 @@ resume (int step, enum target_signal sig
    QUIT;
  
    if (debug_infrun)
@@ -81,7 +81,7 @@ Index: gdb-6.8.50.20081209/gdb/infrun.c
  
    /* Some targets (e.g. Solaris x86) have a kernel bug when stepping
       over an instruction that causes a page fault without triggering
-@@ -1127,9 +1129,10 @@ a command like `return' or `jump' to con
+@@ -1271,9 +1273,10 @@ a command like `return' or `jump' to con
             individually.  */
          resume_ptid = inferior_ptid;
        }
@@ -94,16 +94,16 @@ Index: gdb-6.8.50.20081209/gdb/infrun.c
        {
          /* User-settable 'scheduler' mode requires solo thread resume. */
          resume_ptid = inferior_ptid;
-@@ -1302,7 +1305,7 @@ proceed (CORE_ADDR addr, enum target_sig
-   struct gdbarch *gdbarch = get_regcache_arch (regcache);
+@@ -1474,7 +1477,7 @@ proceed (CORE_ADDR addr, enum target_sig
+   struct gdbarch *gdbarch;
    struct thread_info *tp;
-   CORE_ADDR pc = regcache_read_pc (regcache);
+   CORE_ADDR pc;
 -  int oneproc = 0;
 +  enum resume_step resume_step = RESUME_STEP_CONTINUE;
  
-   if (step > 0)
-     step_start_function = find_pc_function (pc);
-@@ -1322,13 +1325,13 @@ proceed (CORE_ADDR addr, enum target_sig
+   /* If we're stopped at a fork/vfork, follow the branch set by the
+      "set follow-fork-mode" command; otherwise, we'll just proceed
+@@ -1508,13 +1511,13 @@ proceed (CORE_ADDR addr, enum target_sig
           actually be executing the breakpoint insn anyway.
           We'll be (un-)executing the previous instruction.  */
  
@@ -119,7 +119,7 @@ Index: gdb-6.8.50.20081209/gdb/infrun.c
      }
    else
      {
-@@ -1359,13 +1362,13 @@ proceed (CORE_ADDR addr, enum target_sig
+@@ -1545,13 +1548,13 @@ proceed (CORE_ADDR addr, enum target_sig
         is required it returns TRUE and sets the current thread to
         the old thread. */
        if (prepare_to_proceed (step))
@@ -135,7 +135,7 @@ Index: gdb-6.8.50.20081209/gdb/infrun.c
      {
        tp->trap_expected = 1;
        /* If displaced stepping is enabled, we can step over the
-@@ -1451,8 +1454,13 @@ proceed (CORE_ADDR addr, enum target_sig
+@@ -1637,8 +1640,13 @@ proceed (CORE_ADDR addr, enum target_sig
    /* Reset to normal state.  */
    init_infwait_state ();
  
@@ -150,16 +150,21 @@ Index: gdb-6.8.50.20081209/gdb/infrun.c
  
    /* Wait for it to stop (if not standalone)
       and in any case decode why it stopped, and act accordingly.  */
-@@ -3690,10 +3698,16 @@ currently_stepping_callback (struct thre
-   return tp != data && currently_stepping_thread (tp);
- }
+@@ -4171,13 +4179,18 @@ infrun: not switching back to stepped th
+ /* Is thread TP in the middle of single-stepping?  */
  
 -static int
 +static enum resume_step
  currently_stepping (struct thread_info *tp)
  {
--  return currently_stepping_thread (tp) || bpstat_should_step ();
-+  if (currently_stepping_thread (tp))
+-  return ((tp->step_range_end && tp->step_resume_breakpoint == NULL)
+-        || tp->trap_expected
+-        || tp->stepping_through_solib_after_catch
+-        || bpstat_should_step ());
++  if ((tp->step_range_end && tp->step_resume_breakpoint == NULL)
++      || tp->trap_expected
++      || tp->stepping_through_solib_after_catch)
 +    return RESUME_STEP_USER;
 +
 +  if (bpstat_should_step ())
@@ -168,12 +173,12 @@ Index: gdb-6.8.50.20081209/gdb/infrun.c
 +  return RESUME_STEP_CONTINUE;
  }
  
- /* Inferior has stepped into a subroutine call with source code that
-Index: gdb-6.8.50.20081209/gdb/linux-nat.c
+ /* Returns true if any thread *but* the one passed in "data" is in the
+Index: gdb-6.8.50.20090803/gdb/linux-nat.c
 ===================================================================
---- gdb-6.8.50.20081209.orig/gdb/linux-nat.c   2008-12-02 08:57:36.000000000 +0100
-+++ gdb-6.8.50.20081209/gdb/linux-nat.c        2008-12-10 01:22:23.000000000 +0100
-@@ -2343,7 +2343,10 @@ count_events_callback (struct lwp_info *
+--- gdb-6.8.50.20090803.orig/gdb/linux-nat.c   2009-07-31 17:25:21.000000000 +0200
++++ gdb-6.8.50.20090803/gdb/linux-nat.c        2009-08-03 21:39:10.000000000 +0200
+@@ -2351,7 +2351,10 @@ count_events_callback (struct lwp_info *
  static int
  select_singlestep_lwp_callback (struct lwp_info *lp, void *data)
  {
@@ -185,10 +190,10 @@ Index: gdb-6.8.50.20081209/gdb/linux-nat.c
      return 1;
    else
      return 0;
-Index: gdb-6.8.50.20081209/gdb/linux-nat.h
+Index: gdb-6.8.50.20090803/gdb/linux-nat.h
 ===================================================================
---- gdb-6.8.50.20081209.orig/gdb/linux-nat.h   2008-07-27 23:12:40.000000000 +0200
-+++ gdb-6.8.50.20081209/gdb/linux-nat.h        2008-12-10 01:22:23.000000000 +0100
+--- gdb-6.8.50.20090803.orig/gdb/linux-nat.h   2009-05-18 19:11:25.000000000 +0200
++++ gdb-6.8.50.20090803/gdb/linux-nat.h        2009-08-03 21:39:09.000000000 +0200
 @@ -55,8 +55,8 @@ struct lwp_info
    /* If non-zero, a pending wait status.  */
    int status;
index 142c77de4809dcfcd7c933d77de07fc0d7f29b6d..ce802328b557d7f7f73546c7bf3bd18534190805 100644 (file)
@@ -1,16 +1,17 @@
-Index: gdb-6.8.50.20090226/gdb/linux-nat.c
+Index: gdb-6.8.50.20090811/gdb/linux-nat.c
 ===================================================================
---- gdb-6.8.50.20090226.orig/gdb/linux-nat.c   2009-02-27 00:04:35.000000000 +0100
-+++ gdb-6.8.50.20090226/gdb/linux-nat.c        2009-02-27 07:51:44.000000000 +0100
-@@ -1790,15 +1790,17 @@ resume_set_callback (struct lwp_info *lp
+--- gdb-6.8.50.20090811.orig/gdb/linux-nat.c   2009-08-12 07:21:20.000000000 +0200
++++ gdb-6.8.50.20090811/gdb/linux-nat.c        2009-08-12 08:11:25.000000000 +0200
+@@ -1656,16 +1656,18 @@ resume_set_callback (struct lwp_info *lp
  
  static void
  linux_nat_resume (struct target_ops *ops,
 -                ptid_t ptid, int step, enum target_signal signo)
 +                ptid_t ptid, int step_int, enum target_signal signo)
  {
+   sigset_t prev_mask;
    struct lwp_info *lp;
-   int resume_all;
+   int resume_many;
 +  enum resume_step step = step_int;
  
    if (debug_linux_nat)
@@ -22,40 +23,38 @@ Index: gdb-6.8.50.20090226/gdb/linux-nat.c
                        target_pid_to_str (ptid),
                        signo ? strsignal (signo) : "0",
                        target_pid_to_str (inferior_ptid));
-@@ -2740,6 +2742,9 @@ linux_nat_filter_event (int lwpid, int s
-   /* Check if the thread has exited.  */
-   if ((WIFEXITED (status) || WIFSIGNALED (status)) && num_lwps > 1)
-     {
-+      enum resume_step step = lp->step;
-+      pid_t pid = GET_PID (lp->ptid);
-+
-       /* If this is the main thread, we must stop all threads and
-        verify if they are still alive.  This is because in the nptl
-        thread model, there is no signal issued for exiting LWPs
-@@ -2763,6 +2768,26 @@ linux_nat_filter_event (int lwpid, int s
-       exit_lwp (lp);
+@@ -2625,10 +2627,34 @@ linux_nat_filter_event (int lwpid, int s
  
-+      if (step == RESUME_STEP_USER)
-+      {
-+        /* Now stop the closest LWP's ...  */
-+        lp = find_lwp_pid (pid_to_ptid (pid));
-+        if (!lp)
-+          lp = lwp_list;
-+        gdb_assert (lp != NULL);
-+        errno = 0;
-+        ptrace (PTRACE_CONT, GET_LWP (lp->ptid), 0,
-+                (void *) (unsigned long) SIGSTOP);
-+        if (debug_linux_nat)
-+          fprintf_unfiltered (gdb_stdlog,
-+                              "PTRACE_CONT %s, 0, 0 (%s)\n",
-+                              target_pid_to_str (lp->ptid),
-+                              errno ? safe_strerror (errno)
-+                                    : "OK");
-+        /* Avoid the silent `delayed SIGSTOP' handling.  */
-+        lp->signalled = 0;
-+      }
+       if (num_lwps (GET_PID (lp->ptid)) > 1)
+        {
++      enum resume_step step = lp->step;
++      pid_t pid = GET_PID (lp->ptid);
++
+        /* If there is at least one more LWP, then the exit signal
+           was not the end of the debugged application and should be
+           ignored.  */
+        exit_lwp (lp);
++
++      if (step == RESUME_STEP_USER)
++        {
++          /* Now stop the closest LWP's ...  */
++          lp = find_lwp_pid (pid_to_ptid (pid));
++          if (!lp)
++            lp = lwp_list;
++          gdb_assert (lp != NULL);
++          errno = 0;
++          ptrace (PTRACE_CONT, GET_LWP (lp->ptid), 0,
++                  (void *) (unsigned long) SIGSTOP);
++          if (debug_linux_nat)
++            fprintf_unfiltered (gdb_stdlog,
++                                "PTRACE_CONT %s, 0, 0 (%s)\n",
++                                target_pid_to_str (lp->ptid),
++                                errno ? safe_strerror (errno)
++                                      : "OK");
++          /* Avoid the silent `delayed SIGSTOP' handling.  */
++          lp->signalled = 0;
++        }
 +
-       /* If there is at least one more LWP, then the exit signal was
-        not the end of the debugged application and should be
-        ignored.  */
+        return NULL;
+        }
+     }
index 50273e45d8bc87d060df127de9414dcce1eb38d9..75f68b37a433701c0272833e400900d9004c2516 100644 (file)
@@ -102,107 +102,3 @@ frames-invalid can happen asynchronously.
  
  set timeout $oldtimeout
  return 0
---- sources/gdb/testsuite/gdb.base/dump.exp-orig       2008-08-28 11:44:40.000000000 +0200
-+++ sources/gdb/testsuite/gdb.base/dump.exp    2008-08-28 11:44:49.000000000 +0200
-@@ -493,8 +493,10 @@ if ![string compare $is64bitonly "no"] t
-   gdb_test "print zero_all ()" "" ""
-   # restore with expressions 
-+  # Address may fit in int32 but its negative result would be 0xffffxxxx for
-+  # 64-bit LONGEST addresses.
-   test_restore_saved_value \
--      "intarr3.srec ${array2_start}-${array_start} &intarray\[3\] &intarray\[4\]" \
-+      "intarr3.srec (long)${array2_start}-${array_start} &intarray\[3\] &intarray\[4\]" \
-       "array partial with expressions" 4 "intarray2\[3\]"
-   gdb_test "print intarray2\[2\] == 0" " = 1" "element 2 not changed, == 4"
---- gdb-6.8.50.20090209/gdb/testsuite/gdb.base/annota1.exp-orig        2009-02-09 16:31:11.000000000 +0100
-+++ gdb-6.8.50.20090209/gdb/testsuite/gdb.base/annota1.exp     2009-02-09 21:27:38.000000000 +0100
-@@ -286,7 +286,7 @@ if [target_info exists gdb,nosignals] {
- } else {
-     send_gdb "signal SIGUSR1\n"
-     gdb_expect {
--      -re "\r\n\032\032post-prompt\r\nContinuing with signal SIGUSR1.\r\n\r\n\032\032starting\r\n\r\n\032\032frames-invalid\r\n\r\n\032\032breakpoint 2\r\n\r\nBreakpoint 2, \r\n\032\032frame-begin 0 $hex\r\n\r\n\032\032frame-function-name\r\nhandle_USR1\r\n\032\032frame-args\r\n \\(\r\n\032\032arg-begin\r\nsig\r\n\032\032arg-name-end\r\n=\r\n\032\032arg-value -\r\n$decimal\r\n\032\032arg-end\r\n\\)\r\n\032\032frame-source-begin\r\n at \r\n\032\032frame-source-file\r\n${escapedsrcfile}\r\n\032\032frame-source-file-end\r\n:\r\n\032\032frame-source-line\r\n.*\r\n\032\032frame-source-end\r\n\r\n\r\n\032\032source.*annota1.c:.*:.*:beg:$hex\r\n\r\n\032\032frame-end\r\n\r\n\032\032stopped\r\n$gdb_prompt$" \
-+      -re "\r\n\032\032post-prompt\r\nContinuing with signal SIGUSR1.\r\n\r\n\032\032starting\r\n(\r\n\032\032frames-invalid\r\n)*\r\n\032\032breakpoint 2\r\n\r\nBreakpoint 2, \r\n\032\032frame-begin 0 $hex\r\n\r\n\032\032frame-function-name\r\nhandle_USR1\r\n\032\032frame-args\r\n \\(\r\n\032\032arg-begin\r\nsig\r\n\032\032arg-name-end\r\n=\r\n\032\032arg-value -\r\n$decimal\r\n\032\032arg-end\r\n\\)\r\n\032\032frame-source-begin\r\n at \r\n\032\032frame-source-file\r\n${escapedsrcfile}\r\n\032\032frame-source-file-end\r\n:\r\n\032\032frame-source-line\r\n.*\r\n\032\032frame-source-end\r\n\r\n\r\n\032\032source.*annota1.c:.*:.*:beg:$hex\r\n\r\n\032\032frame-end\r\n\r\n\032\032stopped\r\n$gdb_prompt$" \
-           { pass "send SIGUSR1" }
-       -re "\r\n\032\032post-prompt\r\nContinuing with signal SIGUSR1.\r\n\r\n\032\032starting\r\n\r\n\032\032frames-invalid\r\n\r\n\032\032breakpoint 2\r\n\r\nBreakpoint 2, \r\n\032\032frame-begin 0 $hex\r\n\r\n\032\032frame-function-name\r\nhandle_USR1\r\n\032\032frame-args\r\n \\(\r\n\032\032arg-begin\r\nsig\r\n\032\032arg-name-end\r\n=\r\n\032\032arg-value -\r\n$decimal\r\n\032\032arg-end\r\n\\)\r\n\032\032frame-source-begin\r\n at \r\n\032\032frame-source-file\r\n.*${srcfile}\r\n\032\032frame-source-file-end\r\n:\r\n\032\032frame-source-line\r\n.*\r\n\032\032frame-source-end\r\n\r\n\r\n\032\032source.*annota1.c:.*:.*:beg:$hex\r\n\r\n\032\032frame-end\r\n\r\n\032\032stopped\r\n$gdb_prompt$" \
-           { setup_xfail "*-*-*" 1270
---- ./gdb/testsuite/gdb.base/auxv.exp  2009-02-11 00:54:54.000000000 +0100
-+++ ./gdb/testsuite/gdb.base/auxv.exp  2009-02-11 00:51:30.000000000 +0100
-@@ -78,8 +78,10 @@ proc fetch_auxv {test} {
-     set auxv_lines {}
-     set bad -1
-+    # Former trailing `\[\r\n\]+' may eat just \r leaving \n in the buffer
-+    # corrupting the next matches.
-     if {[gdb_test_multiple "info auxv" $test {
--      -re "info auxv\[\r\n\]+" {
-+      -re "info auxv\r\n" {
-           exp_continue
-       }
-       -ex "The program has no auxiliary information now" {
-@@ -94,20 +96,20 @@ proc fetch_auxv {test} {
-           set bad 1
-           exp_continue
-       }
--      -re "^\[0-9\]+\[ \t\]+(AT_\[^ \t\]+)\[^\r\n\]+\[\r\n\]+" {
-+      -re "^\[0-9\]+\[ \t\]+(AT_\[^ \t\]+)\[^\r\n\]+\r\n" {
-           lappend auxv_lines $expect_out(0,string)
-           exp_continue
-       }
--      -re "^\[0-9\]+\[ \t\]+\\?\\?\\?\[^\r\n\]+\[\r\n\]+" {
-+      -re "^\[0-9\]+\[ \t\]+\\?\\?\\?\[^\r\n\]+\r\n" {
-           warning "Unrecognized tag value: $expect_out(0,string)"
-           set bad 1
-           lappend auxv_lines $expect_out(0,string)
-           exp_continue
-       }
--      -re ".*$gdb_prompt $" {
-+      -re "$gdb_prompt $" {
-           incr bad
-       }
--      -re "^\[^\r\n\]+\[\r\n\]+" {
-+      -re "^\[^\r\n\]+\r\n" {
-           if {!$bad} {
-               warning "Unrecognized output: $expect_out(0,string)"
-               set bad 1
---- ./gdb/testsuite/gdb.base/callfuncs.exp     2009-01-03 06:58:03.000000000 +0100
-+++ ./gdb/testsuite/gdb.base/callfuncs.exp     2009-02-11 00:51:42.000000000 +0100
-@@ -249,15 +249,17 @@ proc fetch_all_registers {test} {
-     set all_registers_lines {}
-     set bad -1
-+    # Former trailing `\[\r\n\]+' may eat just \r leaving \n in the buffer
-+    # corrupting the next matches.
-     if {[gdb_test_multiple "info all-registers" $test {
--      -re "info all-registers\[\r\n\]+" {
-+      -re "info all-registers\r\n" {
-           exp_continue
-       }
-       -ex "The program has no registers now" {
-           set bad 1
-           exp_continue
-       }
--      -re "^bspstore\[ \t\]+\[^\r\n\]+\[\r\n\]+" {
-+      -re "^bspstore\[ \t\]+\[^\r\n\]+\r\n" {
-           if [istarget "ia64-*-*"] {
-               # Filter out bspstore which is specially tied to bsp,
-               # giving spurious differences.
-@@ -266,14 +268,14 @@ proc fetch_all_registers {test} {
-           }
-           exp_continue
-       }
--      -re "^\[^ \t\]+\[ \t\]+\[^\r\n\]+\[\r\n\]+" {
-+      -re "^\[^ \t\]+\[ \t\]+\[^\r\n\]+\r\n" {
-           lappend all_registers_lines $expect_out(0,string)
-           exp_continue
-       }
--      -re ".*$gdb_prompt $" {
-+      -re "$gdb_prompt $" {
-           incr bad
-       }
--      -re "^\[^\r\n\]+\[\r\n\]+" {
-+      -re "^\[^\r\n\]+\r\n" {
-           if {!$bad} {
-               warning "Unrecognized output: $expect_out(0,string)"
-               set bad 1
index a297ec47fd886cef3652370e180019898666c057..4c462e1f152f6e653f1c6ca616b896c152dfa101 100644 (file)
@@ -1,8 +1,8 @@
-Index: gdb-6.8.50.20090209/gdb/linux-nat.c
+Index: gdb-6.8.50.20090803/gdb/linux-nat.c
 ===================================================================
---- gdb-6.8.50.20090209.orig/gdb/linux-nat.c   2009-02-09 16:12:23.000000000 +0100
-+++ gdb-6.8.50.20090209/gdb/linux-nat.c        2009-02-09 16:15:30.000000000 +0100
-@@ -204,6 +204,9 @@ blocked.  */
+--- gdb-6.8.50.20090803.orig/gdb/linux-nat.c   2009-08-03 17:24:03.000000000 +0200
++++ gdb-6.8.50.20090803/gdb/linux-nat.c        2009-08-03 17:27:23.000000000 +0200
+@@ -202,6 +202,9 @@ blocked.  */
  static struct target_ops *linux_ops;
  static struct target_ops linux_ops_saved;
  
@@ -12,10 +12,10 @@ Index: gdb-6.8.50.20090209/gdb/linux-nat.c
  /* The method to call, if any, when a new thread is attached.  */
  static void (*linux_nat_new_thread) (ptid_t);
  
-@@ -902,7 +905,14 @@ linux_child_follow_fork (struct target_o
-         fork_save_infrun_state (fp, 0);
+@@ -790,7 +793,14 @@ linux_child_follow_fork (struct target_o
+         linux_parent_pid = parent_pid;
        }
-       else
+       else if (detach_fork)
 -      target_detach (NULL, 0);
 +      {
 +        /* We should check PID_WAS_STOPPED and detach it stopped accordingly.
@@ -27,8 +27,8 @@ Index: gdb-6.8.50.20090209/gdb/linux-nat.c
 +      }
  
        inferior_ptid = ptid_build (child_pid, child_pid, 0);
-@@ -1229,6 +1239,7 @@ linux_nat_post_attach_wait (ptid_t ptid,
+       add_thread (inferior_ptid);
+@@ -1231,6 +1241,7 @@ linux_nat_post_attach_wait (ptid_t ptid,
        if (debug_linux_nat)
        fprintf_unfiltered (gdb_stdlog,
                            "LNPAW: Attaching to a stopped process\n");
@@ -36,7 +36,7 @@ Index: gdb-6.8.50.20090209/gdb/linux-nat.c
  
        /* The process is definitely stopped.  It is in a job control
         stop, unless the kernel predates the TASK_STOPPED /
-@@ -1561,6 +1572,9 @@ GPT: lwp %s had signal %s, but it is in 
+@@ -1512,6 +1523,9 @@ GPT: lwp %s had signal %s, but it is in 
        *status = lp->status;
      }
  
@@ -46,7 +46,7 @@ Index: gdb-6.8.50.20090209/gdb/linux-nat.c
    return 0;
  }
  
-@@ -1671,6 +1685,8 @@ linux_nat_detach (struct target_ops *ops
+@@ -1621,6 +1635,8 @@ linux_nat_detach (struct target_ops *ops
      }
    else
      linux_ops->to_detach (ops, args, from_tty);
@@ -55,7 +55,7 @@ Index: gdb-6.8.50.20090209/gdb/linux-nat.c
  }
  
  /* Resume LP.  */
-@@ -1825,6 +1841,14 @@ linux_nat_resume (ptid_t ptid, int step_
+@@ -1774,6 +1790,14 @@ linux_nat_resume (struct target_ops *ops
       resume_callback.  */
    lp->stopped = 0;
  
@@ -67,10 +67,10 @@ Index: gdb-6.8.50.20090209/gdb/linux-nat.c
 +  if (!step && lp && pid_was_stopped == GET_PID (lp->ptid))
 +    pid_was_stopped = 0;
 +
-   if (resume_all)
-     iterate_over_lwps (resume_callback, NULL);
+   if (resume_many)
+     iterate_over_lwps (ptid, resume_callback, NULL);
  
-@@ -3316,6 +3340,8 @@ linux_nat_mourn_inferior (struct target_
+@@ -3322,6 +3346,8 @@ linux_nat_mourn_inferior (struct target_
         there are other viable forks to debug.  Delete the exiting
         one and context-switch to the first available.  */
      linux_fork_mourn_inferior ();
@@ -79,10 +79,10 @@ Index: gdb-6.8.50.20090209/gdb/linux-nat.c
  }
  
  /* Convert a native/host siginfo object, into/from the siginfo in the
-Index: gdb-6.8.50.20090209/gdb/testsuite/gdb.threads/attach-stopped.exp
+Index: gdb-6.8.50.20090803/gdb/testsuite/gdb.threads/attach-stopped.exp
 ===================================================================
---- gdb-6.8.50.20090209.orig/gdb/testsuite/gdb.threads/attach-stopped.exp      2009-01-03 06:58:07.000000000 +0100
-+++ gdb-6.8.50.20090209/gdb/testsuite/gdb.threads/attach-stopped.exp   2009-02-09 16:12:41.000000000 +0100
+--- gdb-6.8.50.20090803.orig/gdb/testsuite/gdb.threads/attach-stopped.exp      2009-01-03 06:58:07.000000000 +0100
++++ gdb-6.8.50.20090803/gdb/testsuite/gdb.threads/attach-stopped.exp   2009-08-03 17:26:22.000000000 +0200
 @@ -62,7 +62,65 @@ proc corefunc { threadtype } {
      gdb_reinitialize_dir $srcdir/$subdir
      gdb_load ${binfile}
@@ -150,10 +150,10 @@ Index: gdb-6.8.50.20090209/gdb/testsuite/gdb.threads/attach-stopped.exp
         
      set test "$threadtype: attach2 to stopped, after setting file"
      gdb_test_multiple "attach $testpid" "$test" {
-Index: gdb-6.8.50.20090209/gdb/testsuite/gdb.threads/attachstop-mt.exp
+Index: gdb-6.8.50.20090803/gdb/testsuite/gdb.threads/attachstop-mt.exp
 ===================================================================
---- gdb-6.8.50.20090209.orig/gdb/testsuite/gdb.threads/attachstop-mt.exp       2009-01-03 06:58:07.000000000 +0100
-+++ gdb-6.8.50.20090209/gdb/testsuite/gdb.threads/attachstop-mt.exp    2009-02-09 16:12:41.000000000 +0100
+--- gdb-6.8.50.20090803.orig/gdb/testsuite/gdb.threads/attachstop-mt.exp       2009-01-03 06:58:07.000000000 +0100
++++ gdb-6.8.50.20090803/gdb/testsuite/gdb.threads/attachstop-mt.exp    2009-08-03 17:26:22.000000000 +0200
 @@ -176,12 +176,23 @@ gdb_test "bt" ".*sleep.*(func|main).*" "
  # Exit and detach the process.
  gdb_exit
index c2d79beee00ec8fc9c96ff6ac5ba668099ce0a7c..82e64f9e93577edfc47877f926589c4b26176af7 100644 (file)
@@ -1,8 +1,8 @@
-Index: gdb-6.8.50.20081209/bfd/elf-bfd.h
+Index: gdb-6.8.50.20090910/bfd/elf-bfd.h
 ===================================================================
---- gdb-6.8.50.20081209.orig/bfd/elf-bfd.h     2008-12-03 15:50:57.000000000 +0100
-+++ gdb-6.8.50.20081209/bfd/elf-bfd.h  2008-12-10 01:35:08.000000000 +0100
-@@ -2154,7 +2154,7 @@ extern Elf_Internal_Phdr * _bfd_elf_find
+--- gdb-6.8.50.20090910.orig/bfd/elf-bfd.h     2009-09-09 23:38:57.000000000 +0200
++++ gdb-6.8.50.20090910/bfd/elf-bfd.h  2009-09-10 23:01:15.000000000 +0200
+@@ -2121,7 +2121,7 @@ extern Elf_Internal_Phdr * _bfd_elf_find
  extern char *elfcore_write_note
    (bfd *, char *, int *, const char *, int, const void *, int);
  extern char *elfcore_write_prpsinfo
@@ -11,11 +11,11 @@ Index: gdb-6.8.50.20081209/bfd/elf-bfd.h
  extern char *elfcore_write_prstatus
    (bfd *, char *, int *, long, int, const void *);
  extern char * elfcore_write_pstatus
-Index: gdb-6.8.50.20081209/bfd/elf.c
+Index: gdb-6.8.50.20090910/bfd/elf.c
 ===================================================================
---- gdb-6.8.50.20081209.orig/bfd/elf.c 2008-12-03 15:50:57.000000000 +0100
-+++ gdb-6.8.50.20081209/bfd/elf.c      2008-12-10 01:35:08.000000000 +0100
-@@ -8345,6 +8345,7 @@ char *
+--- gdb-6.8.50.20090910.orig/bfd/elf.c 2009-09-09 23:38:57.000000000 +0200
++++ gdb-6.8.50.20090910/bfd/elf.c      2009-09-10 23:04:17.000000000 +0200
+@@ -8398,6 +8398,7 @@ char *
  elfcore_write_prpsinfo (bfd  *abfd,
                        char *buf,
                        int  *bufsiz,
@@ -23,7 +23,7 @@ Index: gdb-6.8.50.20081209/bfd/elf.c
                        const char *fname,
                        const char *psargs)
  {
-@@ -8371,9 +8372,15 @@ elfcore_write_prpsinfo (bfd  *abfd,
+@@ -8424,9 +8425,15 @@ elfcore_write_prpsinfo (bfd  *abfd,
        int note_type = NT_PRPSINFO;
  #endif
  
@@ -42,7 +42,7 @@ Index: gdb-6.8.50.20081209/bfd/elf.c
        return elfcore_write_note (abfd, buf, bufsiz,
                                 note_name, note_type, &data, sizeof (data));
      }
-@@ -8388,9 +8395,15 @@ elfcore_write_prpsinfo (bfd  *abfd,
+@@ -8441,9 +8448,15 @@ elfcore_write_prpsinfo (bfd  *abfd,
        int note_type = NT_PRPSINFO;
  #endif
  
@@ -61,19 +61,19 @@ Index: gdb-6.8.50.20081209/bfd/elf.c
        return elfcore_write_note (abfd, buf, bufsiz,
                                 note_name, note_type, &data, sizeof (data));
      }
-Index: gdb-6.8.50.20081209/gdb/amd64-linux-nat.c
+Index: gdb-6.8.50.20090910/gdb/amd64-linux-nat.c
 ===================================================================
---- gdb-6.8.50.20081209.orig/gdb/amd64-linux-nat.c     2008-12-10 01:28:28.000000000 +0100
-+++ gdb-6.8.50.20081209/gdb/amd64-linux-nat.c  2008-12-10 01:35:08.000000000 +0100
-@@ -139,6 +139,7 @@ static int amd64_linux_gregset32_reg_off
+--- gdb-6.8.50.20090910.orig/gdb/amd64-linux-nat.c     2009-09-10 23:01:07.000000000 +0200
++++ gdb-6.8.50.20090910/gdb/amd64-linux-nat.c  2009-09-10 23:01:15.000000000 +0200
+@@ -140,6 +140,7 @@ static int amd64_linux_gregset32_reg_off
  
  static char *
  amd64_linux_elfcore_write_prpsinfo (bfd *abfd, char *buf, int *bufsiz,
 +                                  void *info,
                                    const char *fname, const char *psargs)
  {
-   if (gdbarch_ptr_bit(current_gdbarch) == 32)
-@@ -148,14 +149,20 @@ amd64_linux_elfcore_write_prpsinfo (bfd 
+   if (gdbarch_ptr_bit (target_gdbarch) == 32)
+@@ -149,14 +150,20 @@ amd64_linux_elfcore_write_prpsinfo (bfd 
        struct elf_prpsinfo32 data;
        note_type = NT_PRPSINFO;
  
@@ -98,11 +98,11 @@ Index: gdb-6.8.50.20081209/gdb/amd64-linux-nat.c
  }
  
  static void
-Index: gdb-6.8.50.20081209/gdb/fbsd-nat.c
+Index: gdb-6.8.50.20090910/gdb/fbsd-nat.c
 ===================================================================
---- gdb-6.8.50.20081209.orig/gdb/fbsd-nat.c    2008-10-28 16:22:12.000000000 +0100
-+++ gdb-6.8.50.20081209/gdb/fbsd-nat.c 2008-12-10 01:35:08.000000000 +0100
-@@ -210,6 +210,7 @@ fbsd_make_corefile_notes (bfd *obfd, int
+--- gdb-6.8.50.20090910.orig/gdb/fbsd-nat.c    2009-07-02 19:21:06.000000000 +0200
++++ gdb-6.8.50.20090910/gdb/fbsd-nat.c 2009-09-10 23:01:15.000000000 +0200
+@@ -211,6 +211,7 @@ fbsd_make_corefile_notes (bfd *obfd, int
        psargs = reconcat (psargs, psargs, " ", get_inferior_args (), NULL);
  
        note_data = elfcore_write_prpsinfo (obfd, note_data, note_size,
@@ -110,19 +110,19 @@ Index: gdb-6.8.50.20081209/gdb/fbsd-nat.c
                                          fname, psargs);
      }
  
-Index: gdb-6.8.50.20081209/gdb/linux-nat.c
+Index: gdb-6.8.50.20090910/gdb/linux-nat.c
 ===================================================================
---- gdb-6.8.50.20081209.orig/gdb/linux-nat.c   2008-12-10 01:28:14.000000000 +0100
-+++ gdb-6.8.50.20081209/gdb/linux-nat.c        2008-12-10 01:35:25.000000000 +0100
-@@ -53,6 +53,7 @@
- #include <sys/types.h>
- #include "gdb_dirent.h"
+--- gdb-6.8.50.20090910.orig/gdb/linux-nat.c   2009-09-10 23:01:06.000000000 +0200
++++ gdb-6.8.50.20090910/gdb/linux-nat.c        2009-09-10 23:01:15.000000000 +0200
+@@ -55,6 +55,7 @@
  #include "xml-support.h"
+ #include "terminal.h"
+ #include <sys/vfs.h>
 +#include "gdb_procfs32.h"     /* for struct elf_prpsinfo32 */
  
- #ifdef HAVE_PERSONALITY
- # include <sys/personality.h>
-@@ -216,7 +217,7 @@ static LONGEST (*super_xfer_partial) (st
+ #ifndef SPUFS_MAGIC
+ #define SPUFS_MAGIC 0x23c9b64e
+@@ -222,7 +223,7 @@ static LONGEST (*super_xfer_partial) (st
  /* This functions make elfcore note sections.
     They may get overriden by code adjusting data for multi-target builds.  */
  char *(*linux_elfcore_write_prpsinfo)
@@ -131,8 +131,8 @@ Index: gdb-6.8.50.20081209/gdb/linux-nat.c
  char *(*linux_elfcore_write_prstatus)
    (bfd *, char *, int *, long, int, const void *) = elfcore_write_prstatus;
  static char *
-@@ -3614,6 +3615,159 @@ linux_nat_corefile_thread_callback (stru
-   return 0;
+@@ -3946,6 +3947,159 @@ linux_spu_make_corefile_notes (bfd *obfd
+   return args.note_data;
  }
  
 +/* Should be always true for Linux */
@@ -242,7 +242,7 @@ Index: gdb-6.8.50.20081209/gdb/linux-nat.c
 +
 +#if ULONG_MAX > 0xffffffffU
 +  /* We skip this code on 32-bit gdb.  */
-+  if (gdbarch_ptr_bit (current_gdbarch) == 64)
++  if (gdbarch_ptr_bit (target_gdbarch) == 64)
 +    {
 +      struct elf_prpsinfo *info = xzalloc (sizeof (*info));
 +
@@ -263,7 +263,7 @@ Index: gdb-6.8.50.20081209/gdb/linux-nat.c
 +      return info;
 +    }
 +#endif
-+  if (gdbarch_ptr_bit (current_gdbarch) == 32)
++  if (gdbarch_ptr_bit (target_gdbarch) == 32)
 +    {
 +      struct elf_prpsinfo32 *info = xzalloc (sizeof (*info));
 +
@@ -291,7 +291,7 @@ Index: gdb-6.8.50.20081209/gdb/linux-nat.c
  /* Fills the "to_make_corefile_note" target vector.  Builds the note
     section for a corefile, and returns it in a malloc buffer.  */
  
-@@ -3633,8 +3787,14 @@ linux_nat_make_corefile_notes (bfd *obfd
+@@ -3966,8 +4120,14 @@ linux_nat_make_corefile_notes (bfd *obfd
  
    if (get_exec_file (0))
      {
@@ -306,7 +306,7 @@ Index: gdb-6.8.50.20081209/gdb/linux-nat.c
        if (get_inferior_args ())
        {
          char *string_end;
-@@ -3650,9 +3810,15 @@ linux_nat_make_corefile_notes (bfd *obfd
+@@ -3983,9 +4143,15 @@ linux_nat_make_corefile_notes (bfd *obfd
                       psargs_end - string_end);
            }
        }
@@ -324,11 +324,11 @@ Index: gdb-6.8.50.20081209/gdb/linux-nat.c
      }
  
    /* Dump information for threads.  */
-Index: gdb-6.8.50.20081209/gdb/linux-nat.h
+Index: gdb-6.8.50.20090910/gdb/linux-nat.h
 ===================================================================
---- gdb-6.8.50.20081209.orig/gdb/linux-nat.h   2008-12-10 01:27:33.000000000 +0100
-+++ gdb-6.8.50.20081209/gdb/linux-nat.h        2008-12-10 01:35:08.000000000 +0100
-@@ -138,7 +138,7 @@ struct siginfo *linux_nat_get_siginfo (p
+--- gdb-6.8.50.20090910.orig/gdb/linux-nat.h   2009-09-10 23:01:06.000000000 +0200
++++ gdb-6.8.50.20090910/gdb/linux-nat.h        2009-09-10 23:01:15.000000000 +0200
+@@ -154,7 +154,7 @@ struct siginfo *linux_nat_get_siginfo (p
  /* These functions make elfcore note sections.
     They may get overriden by code adjusting data for multi-target builds.  */
  extern char *(*linux_elfcore_write_prpsinfo)
@@ -337,11 +337,11 @@ Index: gdb-6.8.50.20081209/gdb/linux-nat.h
  extern char *(*linux_elfcore_write_prstatus)
    (bfd *, char *, int *, long, int, const void *);
  extern char *(*linux_elfcore_write_prfpreg)
-Index: gdb-6.8.50.20081209/gdb/procfs.c
+Index: gdb-6.8.50.20090910/gdb/procfs.c
 ===================================================================
---- gdb-6.8.50.20081209.orig/gdb/procfs.c      2008-11-09 12:27:17.000000000 +0100
-+++ gdb-6.8.50.20081209/gdb/procfs.c   2008-12-10 01:35:08.000000000 +0100
-@@ -6181,6 +6181,7 @@ procfs_make_note_section (bfd *obfd, int
+--- gdb-6.8.50.20090910.orig/gdb/procfs.c      2009-08-01 02:02:04.000000000 +0200
++++ gdb-6.8.50.20090910/gdb/procfs.c   2009-09-10 23:01:15.000000000 +0200
+@@ -6147,6 +6147,7 @@ procfs_make_note_section (bfd *obfd, int
    note_data = (char *) elfcore_write_prpsinfo (obfd,
                                               note_data,
                                               note_size,
index e03d45bc541815d4123f7fddd02dd42be402d436..49877147c9f3036e7cb959940aa49bff85b0e45e 100644 (file)
@@ -1,8 +1,9 @@
-diff -d -urpN src.0/gdb/valops.c src.1/gdb/valops.c
---- src.0/gdb/valops.c 2008-07-27 04:00:03.000000000 +0200
-+++ src.1/gdb/valops.c 2008-07-31 15:17:42.000000000 +0200
-@@ -813,10 +813,18 @@ value_assign (struct value *toval, struc
-       struct frame_info *frame;
+Index: gdb-6.8.50.20090803/gdb/valops.c
+===================================================================
+--- gdb-6.8.50.20090803.orig/gdb/valops.c      2009-08-04 06:30:45.000000000 +0200
++++ gdb-6.8.50.20090803/gdb/valops.c   2009-08-04 06:33:05.000000000 +0200
+@@ -926,10 +926,18 @@ value_assign (struct value *toval, struc
+       struct gdbarch *gdbarch;
        int value_reg;
  
 -      /* Figure out which frame this is in currently.  */
@@ -21,4 +22,4 @@ diff -d -urpN src.0/gdb/valops.c src.1/gdb/valops.c
 +      /* Probably never happens.  */
        if (!frame)
          error (_("Value being assigned to is no longer active."));
-       
diff --git a/gdb-6.8-bz457187-largefile-test.patch b/gdb-6.8-bz457187-largefile-test.patch
new file mode 100644 (file)
index 0000000..86f8fdf
--- /dev/null
@@ -0,0 +1,105 @@
+--- /dev/null  2009-04-19 14:49:00.974648389 +0200
++++ gdb-6.8/gdb/testsuite/gdb.arch/i386-biarch-core.exp        2009-04-19 16:30:12.000000000 +0200
+@@ -0,0 +1,61 @@
++# This testcase is part of GDB, the GNU debugger.
++
++# Copyright 2009 Free Software Foundation, Inc.
++
++# This program is free software; you can redistribute it and/or modify
++# it under the terms of the GNU General Public License as published by
++# the Free Software Foundation; either version 2 of the License, or
++# (at your option) any later version.
++#
++# This program is distributed in the hope that it will be useful,
++# but WITHOUT ANY WARRANTY; without even the implied warranty of
++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++# GNU General Public License for more details.
++#
++# You should have received a copy of the GNU General Public License
++# along with this program; if not, write to the Free Software
++# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  
++
++# Test ability to load an elf64-i386 core file.  The provided core file was
++# elf64-x8664 one but it got binary patched to i386:
++# Elf32_Ehdr.e_machine @0x12..0x13
++# Elf64_Ehdr.e_machine @0x12..0x13
++# #define EM_386           3              /* Intel 80386 */
++# #define EM_X86_64       62              /* AMD x86-64 architecture */
++# patch @0x12: 0x3E -> 0x03
++
++if { ![istarget "i?86-*-*"] && ![istarget "x86_64-*-*"] } then {
++    verbose "Skipping i386-biarch-core test."
++    return
++}
++
++set testfile "i386-biarch-core"
++set corebz2uufile ${srcdir}/${subdir}/${testfile}.core.bz2.uu
++set corefile ${objdir}/${subdir}/${testfile}.core
++# Entry point of the original executable.
++set address 0x400078
++
++if {[catch "system \"uudecode -o - ${corebz2uufile} | bzip2 -dc >${corefile}\""] != 0} {
++    untested "failed uudecode or bzip2"
++    return -1
++}
++file stat ${corefile} corestat
++if {$corestat(size) != 102400} {
++    untested "uudecode or bzip2 produce invalid result"
++    return -1
++}
++
++gdb_exit
++gdb_start
++gdb_reinitialize_dir $srcdir/$subdir
++
++# Wrongly built GDB complains by:
++# "..." is not a core dump: File format not recognized
++# As the provided test core has 64bit PRSTATUS i386 built GDB cannot parse it.
++# This is just a problem of the test care, real-world elf64-i386 file will have
++# 32bit PRSTATUS.  One cannot prepare elf64-i386 core file from elf32-i386 by
++# objcopy as it corrupts the core file beyond all recognition.
++# "\r\nCore was generated by `\[^\r\n\]*'\\.\r\nProgram terminated with signal 11, Segmentation fault\\.\r\n.*"
++gdb_test "core-file ${corefile}"
++
++gdb_test "x/i $address" "\r\n$address:\[ \t\]*hlt\[ \t\]*" ".text is readable"
+--- /dev/null  2009-04-19 14:49:00.974648389 +0200
++++ gdb-6.8/gdb/testsuite/gdb.arch/i386-biarch-core.S  2009-04-19 14:52:28.000000000 +0200
+@@ -0,0 +1,22 @@
++/* This testcase is part of GDB, the GNU debugger.
++
++   Copyright 2009 Free Software Foundation, Inc.
++  
++   This program is free software; you can redistribute it and/or modify
++   it under the terms of the GNU General Public License as published by
++   the Free Software Foundation; either version 2 of the License, or
++   (at your option) any later version.
++  
++   This program is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++   GNU General Public License for more details.
++  
++   You should have received a copy of the GNU General Public License
++   along with this program; if not, write to the Free Software
++   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
++ */
++
++      .globl _start
++_start:
++      hlt
+--- /dev/null  2009-04-19 14:49:00.974648389 +0200
++++ gdb-6.8/gdb/testsuite/gdb.arch/i386-biarch-core.core.bz2.uu        2009-04-19 15:02:12.000000000 +0200
+@@ -0,0 +1,13 @@
++begin 600 i386-biarch-core.core.bz2
++M0EIH.3%!629361`P1\P`!)?_____\9'@"8Q)6P380'9@'&#`0D@``"``%(``
++M@`#`"!<(L`%F"(:$GH13::F-)M&D&U,AD:`--#)M0&FT0XR9--,)D9`P(Q-&
++M",(-&F``02)%38HT]0T`&AH```'H@``T^>9T*(,("&)SE`>`9@+GP=[,N)KB
++M'I8BL(L]N5TCY\%V]/?DB.BN*UZ'U@]TN7-]UJ5\_%0QTT<*086#%MHT7XVJ
++M9D"+C!"2*L:8D1XPD!`--M@*XT1H5RFYN&)(!0P0#:`I:;2;$5M&\*9"0@%:
++MK@X[T()M)9N7`D$VA!^63)%,;@8LT`(7\K&[7G;U:"B6'!GG+46ALOZF.2F-
++M!@>C*%86X$-]C2`KE;HG)UL(913VR2G]0BD:J=Z_`G@S,`W%.8RMS-#5P:J0
++MAJ2\8&X?@DE;UF68QHM<,D`('::J65/S:PAG*R-09["8DBI)'V]Y.[(/AM*L
++M"X_O^V;%FY.S6Q]FM=D37>5F,%4-F1ZF#,CFJVU;H*^IT<(%<V`.32$`JU["
++/G`68?\7<D4X4)`0,$?,`
++`
++end
index 6e297d7e71c7aa61da6faea981427f6ce4891046..199d7a290f01fffc1711aeac5ed4789579538495 100644 (file)
@@ -5,31 +5,30 @@ gdb/
        * config.in: Regenerate.
        * configure: Regenerate.
 
-diff -up -rup gdb-orig/configure.ac gdb/configure.ac
---- ./gdb-orig/configure.ac    2009-03-02 23:39:01.000000000 +0100
-+++ ./gdb/configure.ac 2009-03-02 23:40:46.000000000 +0100
-@@ -30,6 +30,7 @@ AC_GNU_SOURCE
- AC_AIX
- AC_ISC_POSIX
+Index: gdb-6.8.50.20090909/gdb/configure.ac
+===================================================================
+--- gdb-6.8.50.20090909.orig/gdb/configure.ac  2009-09-09 20:08:04.000000000 +0200
++++ gdb-6.8.50.20090909/gdb/configure.ac       2009-09-09 20:11:04.000000000 +0200
+@@ -28,6 +28,7 @@ AM_MAINTAINER_MODE
+ AC_PROG_CC
+ AC_USE_SYSTEM_EXTENSIONS
  gl_EARLY
 +AC_SYS_LARGEFILE
  AM_PROG_CC_STDC
  
  AC_CONFIG_AUX_DIR(..)
-diff -up -rup gdb-orig/config.in gdb/config.in
---- ./gdb-orig/config.in       2009-03-02 23:39:01.000000000 +0100
-+++ ./gdb/config.in    2009-03-02 23:40:53.000000000 +0100
-@@ -725,6 +725,9 @@
- # undef _ALL_SOURCE
+Index: gdb-6.8.50.20090909/gdb/config.in
+===================================================================
+--- gdb-6.8.50.20090909.orig/gdb/config.in     2009-09-09 20:08:04.000000000 +0200
++++ gdb-6.8.50.20090909/gdb/config.in  2009-09-09 20:11:33.000000000 +0200
+@@ -751,10 +751,16 @@
+ # endif
  #endif
  
 +/* Number of bits in a file offset, on hosts where this is settable. */
 +#undef _FILE_OFFSET_BITS
 +
- /* Enable GNU extensions on systems that have them.  */
- #ifndef _GNU_SOURCE
- # undef _GNU_SOURCE
-@@ -734,6 +737,9 @@
+ /* Define to 1 so <sys/proc.h> gets a definition of anon_hdl. Works around a
     <sys/proc.h> problem on IRIX 5. */
  #undef _KMEMUSER
  
@@ -39,44 +38,49 @@ diff -up -rup gdb-orig/config.in gdb/config.in
  /* Define to 1 if on MINIX. */
  #undef _MINIX
  
-diff -up -rup gdb-orig/configure gdb/configure
---- ./gdb-orig/configure       2009-03-02 23:39:01.000000000 +0100
-+++ ./gdb/configure    2009-03-02 23:40:49.000000000 +0100
-@@ -862,6 +862,7 @@ Optional Features:
+Index: gdb-6.8.50.20090909/gdb/configure
+===================================================================
+--- gdb-6.8.50.20090909.orig/gdb/configure     2009-09-09 20:10:45.000000000 +0200
++++ gdb-6.8.50.20090909/gdb/configure  2009-09-09 20:11:07.000000000 +0200
+@@ -884,6 +884,7 @@ ac_subst_files='host_makefile_frag'
+ ac_user_opts='
+ enable_option_checking
+ enable_maintainer_mode
++enable_largefile
+ enable_dependency_tracking
+ with_separate_debug_dir
+ with_gdb_datadir
+@@ -1562,6 +1563,7 @@ Optional Features:
    --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
    --enable-maintainer-mode  enable make rules and dependencies not useful
                          (and sometimes confusing) to the casual installer
 +  --disable-largefile     omit support for large files
    --disable-dependency-tracking  speeds up one-time build
    --enable-dependency-tracking   do not reject slow dependency extractors
-   --enable-targets        alternative target configurations
-@@ -3313,6 +3314,370 @@ _ACEOF
+   --enable-targets=TARGETS
+@@ -4100,6 +4102,204 @@ fi
  
  
  
-+# Check whether --enable-largefile or --disable-largefile was given.
-+if test "${enable_largefile+set}" = set; then
-+  enableval="$enable_largefile"
++# Check whether --enable-largefile was given.
++if test "${enable_largefile+set}" = set; then :
++  enableval=$enable_largefile;
++fi
 +
-+fi;
 +if test "$enable_largefile" != no; then
 +
-+  echo "$as_me:$LINENO: checking for special C compiler options needed for large files" >&5
-+echo $ECHO_N "checking for special C compiler options needed for large files... $ECHO_C" >&6
-+if test "${ac_cv_sys_largefile_CC+set}" = set; then
-+  echo $ECHO_N "(cached) $ECHO_C" >&6
++  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for special C compiler options needed for large files" >&5
++$as_echo_n "checking for special C compiler options needed for large files... " >&6; }
++if test "${ac_cv_sys_largefile_CC+set}" = set; then :
++  $as_echo_n "(cached) " >&6
 +else
 +  ac_cv_sys_largefile_CC=no
 +     if test "$GCC" != yes; then
 +       ac_save_CC=$CC
 +       while :; do
-+       # IRIX 6.2 and later do not support large files by default,
-+       # so use the C compiler's -n32 option if that helps.
-+       cat >conftest.$ac_ext <<_ACEOF
-+/* confdefs.h.  */
-+_ACEOF
-+cat confdefs.h >>conftest.$ac_ext
-+cat >>conftest.$ac_ext <<_ACEOF
++       # IRIX 6.2 and later do not support large files by default,
++       # so use the C compiler's -n32 option if that helps.
++       cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 +/* end confdefs.h.  */
 +#include <sys/types.h>
 + /* Check that off_t can represent 2**63 - 1 correctly.
@@ -95,89 +99,34 @@ diff -up -rup gdb-orig/configure gdb/configure
 +  return 0;
 +}
 +_ACEOF
-+       rm -f conftest.$ac_objext
-+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-+  (eval $ac_compile) 2>conftest.er1
-+  ac_status=$?
-+  grep -v '^ *+' conftest.er1 >conftest.err
-+  rm -f conftest.er1
-+  cat conftest.err >&5
-+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+  (exit $ac_status); } &&
-+       { ac_try='test -z "$ac_c_werror_flag"
-+                       || test ! -s conftest.err'
-+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-+  (eval $ac_try) 2>&5
-+  ac_status=$?
-+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+  (exit $ac_status); }; } &&
-+       { ac_try='test -s conftest.$ac_objext'
-+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-+  (eval $ac_try) 2>&5
-+  ac_status=$?
-+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+  (exit $ac_status); }; }; then
++       if ac_fn_c_try_compile "$LINENO"; then :
 +  break
-+else
-+  echo "$as_me: failed program was:" >&5
-+sed 's/^/| /' conftest.$ac_ext >&5
-+
 +fi
-+rm -f conftest.err conftest.$ac_objext
-+       CC="$CC -n32"
-+       rm -f conftest.$ac_objext
-+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-+  (eval $ac_compile) 2>conftest.er1
-+  ac_status=$?
-+  grep -v '^ *+' conftest.er1 >conftest.err
-+  rm -f conftest.er1
-+  cat conftest.err >&5
-+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+  (exit $ac_status); } &&
-+       { ac_try='test -z "$ac_c_werror_flag"
-+                       || test ! -s conftest.err'
-+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-+  (eval $ac_try) 2>&5
-+  ac_status=$?
-+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+  (exit $ac_status); }; } &&
-+       { ac_try='test -s conftest.$ac_objext'
-+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-+  (eval $ac_try) 2>&5
-+  ac_status=$?
-+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+  (exit $ac_status); }; }; then
++rm -f core conftest.err conftest.$ac_objext
++       CC="$CC -n32"
++       if ac_fn_c_try_compile "$LINENO"; then :
 +  ac_cv_sys_largefile_CC=' -n32'; break
-+else
-+  echo "$as_me: failed program was:" >&5
-+sed 's/^/| /' conftest.$ac_ext >&5
-+
 +fi
-+rm -f conftest.err conftest.$ac_objext
++rm -f core conftest.err conftest.$ac_objext
 +       break
 +       done
 +       CC=$ac_save_CC
 +       rm -f conftest.$ac_ext
 +    fi
 +fi
-+echo "$as_me:$LINENO: result: $ac_cv_sys_largefile_CC" >&5
-+echo "${ECHO_T}$ac_cv_sys_largefile_CC" >&6
++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_largefile_CC" >&5
++$as_echo "$ac_cv_sys_largefile_CC" >&6; }
 +  if test "$ac_cv_sys_largefile_CC" != no; then
 +    CC=$CC$ac_cv_sys_largefile_CC
 +  fi
 +
-+  echo "$as_me:$LINENO: checking for _FILE_OFFSET_BITS value needed for large files" >&5
-+echo $ECHO_N "checking for _FILE_OFFSET_BITS value needed for large files... $ECHO_C" >&6
-+if test "${ac_cv_sys_file_offset_bits+set}" = set; then
-+  echo $ECHO_N "(cached) $ECHO_C" >&6
++  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _FILE_OFFSET_BITS value needed for large files" >&5
++$as_echo_n "checking for _FILE_OFFSET_BITS value needed for large files... " >&6; }
++if test "${ac_cv_sys_file_offset_bits+set}" = set; then :
++  $as_echo_n "(cached) " >&6
 +else
 +  while :; do
-+  ac_cv_sys_file_offset_bits=no
-+  cat >conftest.$ac_ext <<_ACEOF
-+/* confdefs.h.  */
-+_ACEOF
-+cat confdefs.h >>conftest.$ac_ext
-+cat >>conftest.$ac_ext <<_ACEOF
++  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 +/* end confdefs.h.  */
 +#include <sys/types.h>
 + /* Check that off_t can represent 2**63 - 1 correctly.
@@ -196,40 +145,11 @@ diff -up -rup gdb-orig/configure gdb/configure
 +  return 0;
 +}
 +_ACEOF
-+rm -f conftest.$ac_objext
-+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-+  (eval $ac_compile) 2>conftest.er1
-+  ac_status=$?
-+  grep -v '^ *+' conftest.er1 >conftest.err
-+  rm -f conftest.er1
-+  cat conftest.err >&5
-+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+  (exit $ac_status); } &&
-+       { ac_try='test -z "$ac_c_werror_flag"
-+                       || test ! -s conftest.err'
-+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-+  (eval $ac_try) 2>&5
-+  ac_status=$?
-+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+  (exit $ac_status); }; } &&
-+       { ac_try='test -s conftest.$ac_objext'
-+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-+  (eval $ac_try) 2>&5
-+  ac_status=$?
-+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+  (exit $ac_status); }; }; then
-+  break
-+else
-+  echo "$as_me: failed program was:" >&5
-+sed 's/^/| /' conftest.$ac_ext >&5
-+
++if ac_fn_c_try_compile "$LINENO"; then :
++  ac_cv_sys_file_offset_bits=no; break
 +fi
-+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-+  cat >conftest.$ac_ext <<_ACEOF
-+/* confdefs.h.  */
-+_ACEOF
-+cat confdefs.h >>conftest.$ac_ext
-+cat >>conftest.$ac_ext <<_ACEOF
++rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
++  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 +/* end confdefs.h.  */
 +#define _FILE_OFFSET_BITS 64
 +#include <sys/types.h>
@@ -249,60 +169,33 @@ diff -up -rup gdb-orig/configure gdb/configure
 +  return 0;
 +}
 +_ACEOF
-+rm -f conftest.$ac_objext
-+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-+  (eval $ac_compile) 2>conftest.er1
-+  ac_status=$?
-+  grep -v '^ *+' conftest.er1 >conftest.err
-+  rm -f conftest.er1
-+  cat conftest.err >&5
-+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+  (exit $ac_status); } &&
-+       { ac_try='test -z "$ac_c_werror_flag"
-+                       || test ! -s conftest.err'
-+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-+  (eval $ac_try) 2>&5
-+  ac_status=$?
-+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+  (exit $ac_status); }; } &&
-+       { ac_try='test -s conftest.$ac_objext'
-+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-+  (eval $ac_try) 2>&5
-+  ac_status=$?
-+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+  (exit $ac_status); }; }; then
++if ac_fn_c_try_compile "$LINENO"; then :
 +  ac_cv_sys_file_offset_bits=64; break
-+else
-+  echo "$as_me: failed program was:" >&5
-+sed 's/^/| /' conftest.$ac_ext >&5
-+
 +fi
-+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
++rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
++  ac_cv_sys_file_offset_bits=unknown
 +  break
 +done
 +fi
-+echo "$as_me:$LINENO: result: $ac_cv_sys_file_offset_bits" >&5
-+echo "${ECHO_T}$ac_cv_sys_file_offset_bits" >&6
-+if test "$ac_cv_sys_file_offset_bits" != no; then
-+
++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_file_offset_bits" >&5
++$as_echo "$ac_cv_sys_file_offset_bits" >&6; }
++case $ac_cv_sys_file_offset_bits in #(
++  no | unknown) ;;
++  *)
 +cat >>confdefs.h <<_ACEOF
 +#define _FILE_OFFSET_BITS $ac_cv_sys_file_offset_bits
 +_ACEOF
-+
-+fi
-+rm -f conftest*
-+  echo "$as_me:$LINENO: checking for _LARGE_FILES value needed for large files" >&5
-+echo $ECHO_N "checking for _LARGE_FILES value needed for large files... $ECHO_C" >&6
-+if test "${ac_cv_sys_large_files+set}" = set; then
-+  echo $ECHO_N "(cached) $ECHO_C" >&6
++;;
++esac
++rm -rf conftest*
++  if test $ac_cv_sys_file_offset_bits = unknown; then
++    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _LARGE_FILES value needed for large files" >&5
++$as_echo_n "checking for _LARGE_FILES value needed for large files... " >&6; }
++if test "${ac_cv_sys_large_files+set}" = set; then :
++  $as_echo_n "(cached) " >&6
 +else
 +  while :; do
-+  ac_cv_sys_large_files=no
-+  cat >conftest.$ac_ext <<_ACEOF
-+/* confdefs.h.  */
-+_ACEOF
-+cat confdefs.h >>conftest.$ac_ext
-+cat >>conftest.$ac_ext <<_ACEOF
++  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 +/* end confdefs.h.  */
 +#include <sys/types.h>
 + /* Check that off_t can represent 2**63 - 1 correctly.
@@ -321,40 +214,11 @@ diff -up -rup gdb-orig/configure gdb/configure
 +  return 0;
 +}
 +_ACEOF
-+rm -f conftest.$ac_objext
-+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-+  (eval $ac_compile) 2>conftest.er1
-+  ac_status=$?
-+  grep -v '^ *+' conftest.er1 >conftest.err
-+  rm -f conftest.er1
-+  cat conftest.err >&5
-+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+  (exit $ac_status); } &&
-+       { ac_try='test -z "$ac_c_werror_flag"
-+                       || test ! -s conftest.err'
-+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-+  (eval $ac_try) 2>&5
-+  ac_status=$?
-+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+  (exit $ac_status); }; } &&
-+       { ac_try='test -s conftest.$ac_objext'
-+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-+  (eval $ac_try) 2>&5
-+  ac_status=$?
-+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+  (exit $ac_status); }; }; then
-+  break
-+else
-+  echo "$as_me: failed program was:" >&5
-+sed 's/^/| /' conftest.$ac_ext >&5
-+
++if ac_fn_c_try_compile "$LINENO"; then :
++  ac_cv_sys_large_files=no; break
 +fi
-+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-+  cat >conftest.$ac_ext <<_ACEOF
-+/* confdefs.h.  */
-+_ACEOF
-+cat confdefs.h >>conftest.$ac_ext
-+cat >>conftest.$ac_ext <<_ACEOF
++rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
++  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 +/* end confdefs.h.  */
 +#define _LARGE_FILES 1
 +#include <sys/types.h>
@@ -374,48 +238,26 @@ diff -up -rup gdb-orig/configure gdb/configure
 +  return 0;
 +}
 +_ACEOF
-+rm -f conftest.$ac_objext
-+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-+  (eval $ac_compile) 2>conftest.er1
-+  ac_status=$?
-+  grep -v '^ *+' conftest.er1 >conftest.err
-+  rm -f conftest.er1
-+  cat conftest.err >&5
-+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+  (exit $ac_status); } &&
-+       { ac_try='test -z "$ac_c_werror_flag"
-+                       || test ! -s conftest.err'
-+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-+  (eval $ac_try) 2>&5
-+  ac_status=$?
-+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+  (exit $ac_status); }; } &&
-+       { ac_try='test -s conftest.$ac_objext'
-+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-+  (eval $ac_try) 2>&5
-+  ac_status=$?
-+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+  (exit $ac_status); }; }; then
++if ac_fn_c_try_compile "$LINENO"; then :
 +  ac_cv_sys_large_files=1; break
-+else
-+  echo "$as_me: failed program was:" >&5
-+sed 's/^/| /' conftest.$ac_ext >&5
-+
 +fi
-+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
++rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
++  ac_cv_sys_large_files=unknown
 +  break
 +done
 +fi
-+echo "$as_me:$LINENO: result: $ac_cv_sys_large_files" >&5
-+echo "${ECHO_T}$ac_cv_sys_large_files" >&6
-+if test "$ac_cv_sys_large_files" != no; then
-+
++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_large_files" >&5
++$as_echo "$ac_cv_sys_large_files" >&6; }
++case $ac_cv_sys_large_files in #(
++  no | unknown) ;;
++  *)
 +cat >>confdefs.h <<_ACEOF
 +#define _LARGE_FILES $ac_cv_sys_large_files
 +_ACEOF
-+
-+fi
-+rm -f conftest*
++;;
++esac
++rm -rf conftest*
++  fi
 +fi
 +
  
index 9a96ac8f5b4c3d2271aaaef2462372b3e99a2cfd..f9ec3495f0cefe7ff3ca7ebde6b8e49551c25996 100644 (file)
@@ -1,10 +1,10 @@
 Fix resolving of variables at locations lists in prelinked libs (BZ 466901).
 
-Index: gdb-6.8.50.20081128/gdb/dwarf2loc.c
+Index: gdb-6.8.50.20090909/gdb/dwarf2loc.c
 ===================================================================
---- gdb-6.8.50.20081128.orig/gdb/dwarf2loc.c   2008-12-08 11:00:45.000000000 +0100
-+++ gdb-6.8.50.20081128/gdb/dwarf2loc.c        2008-12-08 18:02:49.000000000 +0100
-@@ -55,7 +55,9 @@ find_location_expression (struct dwarf2_
+--- gdb-6.8.50.20090909.orig/gdb/dwarf2loc.c   2009-09-09 20:08:03.000000000 +0200
++++ gdb-6.8.50.20090909/gdb/dwarf2loc.c        2009-09-09 20:10:35.000000000 +0200
+@@ -56,7 +56,9 @@ find_location_expression (struct dwarf2_
    CORE_ADDR low, high;
    gdb_byte *loc_ptr, *buf_end;
    int length;
@@ -13,12 +13,12 @@ Index: gdb-6.8.50.20081128/gdb/dwarf2loc.c
 +  struct objfile *objfile = objfile1->separate_debug_objfile
 +                          ? objfile1->separate_debug_objfile : objfile1;
    struct gdbarch *gdbarch = get_objfile_arch (objfile);
+   enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
    unsigned int addr_size = dwarf2_per_cu_addr_size (baton->per_cu);
-   CORE_ADDR base_mask = ~(~(CORE_ADDR)1 << (addr_size * 8 - 1));
-Index: gdb-6.8.50.20081128/gdb/testsuite/gdb.dwarf2/dw2-loclist-prelinked.exp
+Index: gdb-6.8.50.20090909/gdb/testsuite/gdb.dwarf2/dw2-loclist-prelinked.exp
 ===================================================================
 --- /dev/null  1970-01-01 00:00:00.000000000 +0000
-+++ gdb-6.8.50.20081128/gdb/testsuite/gdb.dwarf2/dw2-loclist-prelinked.exp     2008-12-08 18:00:43.000000000 +0100
++++ gdb-6.8.50.20090909/gdb/testsuite/gdb.dwarf2/dw2-loclist-prelinked.exp     2009-09-09 20:10:35.000000000 +0200
 @@ -0,0 +1,102 @@
 +# Copyright 2008 Free Software Foundation, Inc.
 +
@@ -122,10 +122,10 @@ Index: gdb-6.8.50.20081128/gdb/testsuite/gdb.dwarf2/dw2-loclist-prelinked.exp
 +
 +# `abort' can get expressed as `*__GI_abort'.
 +gdb_test "bt full" "in \[^ \]*abort \\(.*in func \\(.*\r\n\[\t \]+i = -?\[0-9\].*in main \\(.*" "Backtrace after abort()"
-Index: gdb-6.8.50.20081128/gdb/testsuite/gdb.dwarf2/dw2-loclist-prelinked-main.c
+Index: gdb-6.8.50.20090909/gdb/testsuite/gdb.dwarf2/dw2-loclist-prelinked-main.c
 ===================================================================
 --- /dev/null  1970-01-01 00:00:00.000000000 +0000
-+++ gdb-6.8.50.20081128/gdb/testsuite/gdb.dwarf2/dw2-loclist-prelinked-main.c  2008-12-08 18:00:43.000000000 +0100
++++ gdb-6.8.50.20090909/gdb/testsuite/gdb.dwarf2/dw2-loclist-prelinked-main.c  2009-09-09 20:10:35.000000000 +0200
 @@ -0,0 +1,26 @@
 +/* This testcase is part of GDB, the GNU debugger.
 +
@@ -153,10 +153,10 @@ Index: gdb-6.8.50.20081128/gdb/testsuite/gdb.dwarf2/dw2-loclist-prelinked-main.c
 +  func ();
 +  return 0;
 +}
-Index: gdb-6.8.50.20081128/gdb/testsuite/gdb.dwarf2/dw2-loclist-prelinked-func.S
+Index: gdb-6.8.50.20090909/gdb/testsuite/gdb.dwarf2/dw2-loclist-prelinked-func.S
 ===================================================================
 --- /dev/null  1970-01-01 00:00:00.000000000 +0000
-+++ gdb-6.8.50.20081128/gdb/testsuite/gdb.dwarf2/dw2-loclist-prelinked-func.S  2008-12-08 18:00:43.000000000 +0100
++++ gdb-6.8.50.20090909/gdb/testsuite/gdb.dwarf2/dw2-loclist-prelinked-func.S  2009-09-09 20:10:35.000000000 +0200
 @@ -0,0 +1,328 @@
 +/* This testcase is part of GDB, the GNU debugger.
 +
index baa242bb03620e337be620423950de2eb626f48d..df29d8d542d1159dc6a685f5cfff06415805c307 100644 (file)
        gdb.base/watchpoint.c (global_ptr_ptr): New variable.
        (func4): New testing code for GLOBAL_PTR_PTR.
 
-Index: gdb-6.8.50.20090209/gdb/breakpoint.c
+Index: gdb-6.8.50.20090803/gdb/breakpoint.c
 ===================================================================
---- gdb-6.8.50.20090209.orig/gdb/breakpoint.c  2009-02-09 15:39:01.000000000 +0100
-+++ gdb-6.8.50.20090209/gdb/breakpoint.c       2009-02-09 16:04:10.000000000 +0100
-@@ -769,7 +769,15 @@ is_hardware_watchpoint (struct breakpoin
+--- gdb-6.8.50.20090803.orig/gdb/breakpoint.c  2009-08-04 06:29:47.000000000 +0200
++++ gdb-6.8.50.20090803/gdb/breakpoint.c       2009-08-04 06:32:50.000000000 +0200
+@@ -823,7 +823,15 @@ is_hardware_watchpoint (struct breakpoin
     If VAL_CHAIN is non-NULL, *VAL_CHAIN will be released from the
     value chain.  The caller must free the values individually.  If
     VAL_CHAIN is NULL, all generated values will be left on the value
@@ -39,16 +39,16 @@ Index: gdb-6.8.50.20090209/gdb/breakpoint.c
  
  static void
  fetch_watchpoint_value (struct expression *exp, struct value **valp,
-@@ -5862,7 +5870,7 @@ watch_command_1 (char *arg, int accessfl
+@@ -6301,7 +6309,7 @@ watch_command_1 (char *arg, int accessfl
    struct symtab_and_line sal;
    struct expression *exp;
    struct block *exp_valid_block;
 -  struct value *val, *mark;
 +  struct value *val, *mark, *val_chain;
    struct frame_info *frame;
-   struct frame_info *prev_frame = NULL;
    char *exp_start = NULL;
-@@ -5954,6 +5962,27 @@ watch_command_1 (char *arg, int accessfl
+   char *exp_end = NULL;
+@@ -6392,6 +6400,27 @@ watch_command_1 (char *arg, int accessfl
    exp_valid_block = innermost_block;
    mark = value_mark ();
    fetch_watchpoint_value (exp, &val, NULL, NULL);
@@ -76,11 +76,11 @@ Index: gdb-6.8.50.20090209/gdb/breakpoint.c
    if (val != NULL)
      release_value (val);
  
-Index: gdb-6.8.50.20090209/gdb/gdbtypes.h
+Index: gdb-6.8.50.20090803/gdb/gdbtypes.h
 ===================================================================
---- gdb-6.8.50.20090209.orig/gdb/gdbtypes.h    2009-02-09 15:51:57.000000000 +0100
-+++ gdb-6.8.50.20090209/gdb/gdbtypes.h 2009-02-09 16:04:10.000000000 +0100
-@@ -70,7 +70,22 @@ enum type_code
+--- gdb-6.8.50.20090803.orig/gdb/gdbtypes.h    2009-08-04 06:31:58.000000000 +0200
++++ gdb-6.8.50.20090803/gdb/gdbtypes.h 2009-08-04 06:32:50.000000000 +0200
+@@ -71,7 +71,22 @@ enum type_code
      TYPE_CODE_UNION,          /* C union or Pascal variant part */
      TYPE_CODE_ENUM,           /* Enumeration type */
      TYPE_CODE_FLAGS,          /* Bit flags type */
@@ -104,11 +104,11 @@ Index: gdb-6.8.50.20090209/gdb/gdbtypes.h
      TYPE_CODE_INT,            /* Integer type */
  
      /* Floating type.  This is *NOT* a complex type.  Beware, there are parts
-Index: gdb-6.8.50.20090209/gdb/doc/gdb.texinfo
+Index: gdb-6.8.50.20090803/gdb/doc/gdb.texinfo
 ===================================================================
---- gdb-6.8.50.20090209.orig/gdb/doc/gdb.texinfo       2009-02-09 16:02:42.000000000 +0100
-+++ gdb-6.8.50.20090209/gdb/doc/gdb.texinfo    2009-02-09 16:04:10.000000000 +0100
-@@ -3480,6 +3480,18 @@ This command prints a list of watchpoint
+--- gdb-6.8.50.20090803.orig/gdb/doc/gdb.texinfo       2009-08-04 06:32:39.000000000 +0200
++++ gdb-6.8.50.20090803/gdb/doc/gdb.texinfo    2009-08-04 06:32:50.000000000 +0200
+@@ -3517,6 +3517,18 @@ This command prints a list of watchpoint
  it is the same as @code{info break} (@pxref{Set Breaks}).
  @end table
  
@@ -127,10 +127,10 @@ Index: gdb-6.8.50.20090209/gdb/doc/gdb.texinfo
  @value{GDBN} sets a @dfn{hardware watchpoint} if possible.  Hardware
  watchpoints execute very quickly, and the debugger reports a change in
  value at the exact instruction where the change occurs.  If @value{GDBN}
-Index: gdb-6.8.50.20090209/gdb/testsuite/gdb.base/watchpoint.c
+Index: gdb-6.8.50.20090803/gdb/testsuite/gdb.base/watchpoint.c
 ===================================================================
---- gdb-6.8.50.20090209.orig/gdb/testsuite/gdb.base/watchpoint.c       2008-03-03 14:24:12.000000000 +0100
-+++ gdb-6.8.50.20090209/gdb/testsuite/gdb.base/watchpoint.c    2009-02-09 16:04:10.000000000 +0100
+--- gdb-6.8.50.20090803.orig/gdb/testsuite/gdb.base/watchpoint.c       2008-03-03 14:24:12.000000000 +0100
++++ gdb-6.8.50.20090803/gdb/testsuite/gdb.base/watchpoint.c    2009-08-04 06:32:50.000000000 +0200
 @@ -40,6 +40,7 @@ struct foo struct1, struct2, *ptr1, *ptr
  int doread = 0;
  
@@ -150,10 +150,10 @@ Index: gdb-6.8.50.20090209/gdb/testsuite/gdb.base/watchpoint.c
  }
  
  int main ()
-Index: gdb-6.8.50.20090209/gdb/testsuite/gdb.base/watchpoint.exp
+Index: gdb-6.8.50.20090803/gdb/testsuite/gdb.base/watchpoint.exp
 ===================================================================
---- gdb-6.8.50.20090209.orig/gdb/testsuite/gdb.base/watchpoint.exp     2009-01-03 06:58:03.000000000 +0100
-+++ gdb-6.8.50.20090209/gdb/testsuite/gdb.base/watchpoint.exp  2009-02-09 16:05:03.000000000 +0100
+--- gdb-6.8.50.20090803.orig/gdb/testsuite/gdb.base/watchpoint.exp     2009-01-03 06:58:03.000000000 +0100
++++ gdb-6.8.50.20090803/gdb/testsuite/gdb.base/watchpoint.exp  2009-08-04 06:32:50.000000000 +0200
 @@ -641,7 +641,21 @@ proc test_watchpoint_and_breakpoint {} {
        }
      }
diff --git a/gdb-6.8-ctors-dtors-unique.patch b/gdb-6.8-ctors-dtors-unique.patch
deleted file mode 100644 (file)
index 21e8729..0000000
+++ /dev/null
@@ -1,73 +0,0 @@
---- ./gdb/linespec.c   2008-08-27 00:27:33.000000000 +0200
-+++ ./gdb/linespec.c   2008-08-27 00:53:16.000000000 +0200
-@@ -284,6 +284,15 @@ find_methods (struct type *t, char *name
- }
- static int
-+add_minsym_members_compar (const void *ap, const void *bp)
-+{
-+  const char *a = *(const char **) ap;
-+  const char *b = *(const char **) bp;
-+
-+  return strcmp (a, b);
-+}
-+
-+static int
- add_minsym_members (const char *class_name,
-                   const char *member_name,
-                   struct minimal_symbol **msym_arr)
-@@ -293,6 +302,7 @@ add_minsym_members (const char *class_na
-   int i;
-   int comp_len;
-   int counter = 0;
-+  int src_i, dst_i;
-   /* To find the member, we first cheat and use symbol completion.
-      This will give us a list of all the member names including
-@@ -307,6 +317,28 @@ add_minsym_members (const char *class_na
-   strcat (completion_name, "(");
-   list = make_symbol_completion_list (completion_name,
-                                     completion_name+1);
-+  if (list == NULL || list[0] == NULL)
-+    {
-+      xfree (completion_name);
-+      return 0;
-+    }
-+
-+  /* Make the list entries unique - Multi-PC breakpoints are already resolved
-+     by GDB-6.8+.  */
-+  counter = 0;
-+  while (list && list[counter] != NULL)
-+    counter++;
-+  qsort (list, counter, sizeof (*list), add_minsym_members_compar);
-+  src_i = dst_i = 0;
-+  while (src_i + 1 < counter)
-+    {
-+      if (strcmp (list[src_i], list[src_i + 1]) != 0)
-+      list[dst_i++] = list[src_i];
-+      src_i++;
-+    }
-+  list[dst_i++] = list[src_i++];
-+  gdb_assert (list[src_i] == NULL);
-+  list[dst_i] = 0;
-   /* Now that we have the list, we generate an array of their
-      corresponding minimal symbols.  */
-@@ -319,6 +351,8 @@ add_minsym_members (const char *class_na
-   xfree (list);
-+#if 0 /* Multi-PC breakpoints are already resolved by GDB-6.8+.  */
-+
-   /* In the case of constructors, there may be in-charge vs not-in-charge
-      constructors.  Check for names with $base which indicates not-in-charge
-      constructors.  */
-@@ -353,6 +387,8 @@ add_minsym_members (const char *class_na
-     }
-   xfree (list);
-+#endif /* Multi-PC breakpoints are already resolved by GDB-6.8+.  */
-+
-   xfree (completion_name);
-   return counter;
index 5140d25283bcd2964f09b9904b3eed49cbad6b81..a7cc1ddfbc698ba411991d8aeacb29e4789c8c8e 100644 (file)
@@ -1,8 +1,8 @@
-Index: gdb-6.8.50.20090228/gdb/dwarf2read.c
+Index: gdb-6.8.50.20090811/gdb/dwarf2read.c
 ===================================================================
---- gdb-6.8.50.20090228.orig/gdb/dwarf2read.c  2009-03-02 01:07:36.000000000 +0100
-+++ gdb-6.8.50.20090228/gdb/dwarf2read.c       2009-03-02 01:07:50.000000000 +0100
-@@ -1996,6 +1996,7 @@ scan_partial_symbols (struct partial_die
+--- gdb-6.8.50.20090811.orig/gdb/dwarf2read.c  2009-08-13 10:14:45.000000000 +0200
++++ gdb-6.8.50.20090811/gdb/dwarf2read.c       2009-08-13 10:22:36.000000000 +0200
+@@ -2480,6 +2480,7 @@ scan_partial_symbols (struct partial_die
              add_partial_subprogram (pdi, lowpc, highpc, need_pc, cu);
              break;
            case DW_TAG_variable:
@@ -10,7 +10,7 @@ Index: gdb-6.8.50.20090228/gdb/dwarf2read.c
            case DW_TAG_typedef:
            case DW_TAG_union_type:
              if (!pdi->is_declaration)
-@@ -2211,6 +2212,7 @@ add_partial_symbol (struct partial_die_i
+@@ -2675,6 +2676,7 @@ add_partial_symbol (struct partial_die_i
        }
        break;
      case DW_TAG_variable:
@@ -18,7 +18,15 @@ Index: gdb-6.8.50.20090228/gdb/dwarf2read.c
        if (pdi->is_external)
        {
          /* Global Variable.
-@@ -4213,7 +4215,8 @@ dwarf2_add_field (struct field_info *fip
+@@ -2805,6 +2807,7 @@ die_needs_namespace (struct die_info *di
+       return 1;
+     case DW_TAG_variable:
++    case DW_TAG_constant:
+       {
+       struct attribute *attr;
+       attr = dwarf2_attr (die, DW_AT_specification, cu);
+@@ -4741,7 +4744,8 @@ dwarf2_add_field (struct field_info *fip
          fip->non_public_fields = 1;
        }
      }
@@ -28,7 +36,7 @@ Index: gdb-6.8.50.20090228/gdb/dwarf2read.c
      {
        /* C++ static member.  */
  
-@@ -4703,7 +4706,8 @@ read_structure_type (struct die_info *di
+@@ -5233,7 +5237,8 @@ read_structure_type (struct die_info *di
        while (child_die && child_die->tag)
        {
          if (child_die->tag == DW_TAG_member
@@ -38,7 +46,7 @@ Index: gdb-6.8.50.20090228/gdb/dwarf2read.c
            {
              /* NOTE: carlton/2002-11-05: A C++ static data member
                 should be a DW_TAG_member that is a declaration, but
-@@ -4822,6 +4826,7 @@ process_structure_scope (struct die_info
+@@ -5352,6 +5357,7 @@ process_structure_scope (struct die_info
      {
        if (child_die->tag == DW_TAG_member
          || child_die->tag == DW_TAG_variable
@@ -46,15 +54,15 @@ Index: gdb-6.8.50.20090228/gdb/dwarf2read.c
          || child_die->tag == DW_TAG_inheritance)
        {
          /* Do nothing.  */
-@@ -6455,6 +6460,7 @@ load_partial_dies (bfd *abfd, gdb_byte *
+@@ -6980,6 +6986,7 @@ load_partial_dies (bfd *abfd, gdb_byte *
          && abbrev->tag != DW_TAG_subprogram
          && abbrev->tag != DW_TAG_lexical_block
          && abbrev->tag != DW_TAG_variable
 +        && abbrev->tag != DW_TAG_constant
          && abbrev->tag != DW_TAG_namespace
+         && abbrev->tag != DW_TAG_module
          && abbrev->tag != DW_TAG_member)
-       {
-@@ -6562,6 +6568,7 @@ load_partial_dies (bfd *abfd, gdb_byte *
+@@ -7088,6 +7095,7 @@ load_partial_dies (bfd *abfd, gdb_byte *
        if (load_all
          || abbrev->tag == DW_TAG_subprogram
          || abbrev->tag == DW_TAG_variable
@@ -62,7 +70,7 @@ Index: gdb-6.8.50.20090228/gdb/dwarf2read.c
          || abbrev->tag == DW_TAG_namespace
          || part_die->is_declaration)
        {
-@@ -8341,6 +8348,11 @@ new_symbol (struct die_info *die, struct
+@@ -8901,6 +8909,11 @@ new_symbol (struct die_info *die, struct
          /* Do not add the symbol to any lists.  It will be found via
             BLOCK_FUNCTION from the blockvector.  */
          break;
index 211b4f4f0ee6cb69e560bcb39eb2533c422625f2..4edcd1afdda400b99bf29e003c36c4873f5d408c 100644 (file)
@@ -5,10 +5,10 @@ causing: FAIL: gdb.base/unwindonsignal.exp: unwindonsignal, stack unwound
 resume() -> target_resume() move of clear_inline_frame_state() is for:
 gdb.mi/mi-nsmoribund.exp
 
-Index: gdb-6.8.50.20090302/gdb/testsuite/gdb.opt/inline-bt.c
+Index: gdb-6.8.91.20090917/gdb/testsuite/gdb.opt/inline-bt.c
 ===================================================================
---- gdb-6.8.50.20090302.orig/gdb/testsuite/gdb.opt/inline-bt.c 2009-03-06 19:07:30.000000000 +0100
-+++ gdb-6.8.50.20090302/gdb/testsuite/gdb.opt/inline-bt.c      2009-03-06 19:07:30.000000000 +0100
+--- gdb-6.8.91.20090917.orig/gdb/testsuite/gdb.opt/inline-bt.c 2009-06-28 02:20:24.000000000 +0200
++++ gdb-6.8.91.20090917/gdb/testsuite/gdb.opt/inline-bt.c      2009-09-17 12:49:01.000000000 +0200
 @@ -13,10 +13,16 @@
     You should have received a copy of the GNU General Public License
     along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
@@ -28,42 +28,10 @@ Index: gdb-6.8.50.20090302/gdb/testsuite/gdb.opt/inline-bt.c
  
  inline int func1(void)
  {
-Index: gdb-6.8.50.20090302/gdb/testsuite/gdb.opt/inline-bt.exp
+Index: gdb-6.8.91.20090917/gdb/testsuite/gdb.opt/inline-cmds.c
 ===================================================================
---- gdb-6.8.50.20090302.orig/gdb/testsuite/gdb.opt/inline-bt.exp       2009-03-06 19:07:30.000000000 +0100
-+++ gdb-6.8.50.20090302/gdb/testsuite/gdb.opt/inline-bt.exp    2009-03-06 19:07:30.000000000 +0100
-@@ -41,18 +41,19 @@ if { [skip_inline_frame_tests] } {
-     return
- }
--set line1 [gdb_get_line_number "set breakpoint 1 here" ${fullsrcfile2}]
--gdb_breakpoint $srcfile2:$line1
-+set line1 [gdb_get_line_number "set breakpoint 1 here" ${srcfile}]
-+gdb_breakpoint $srcfile:$line1
- gdb_test "continue" ".*set breakpoint 1 here.*" "continue to bar (1)"
- gdb_test "backtrace" "#0  bar.*#1  .*main.*" "backtrace from bar (1)"
--gdb_test "info frame" ".*called by frame.*" "bar not inlined"
-+gdb_test "info frame" ".*inlined into frame.*" "bar inlined"
--gdb_test "continue" ".*set breakpoint 1 here.*" "continue to bar (2)"
--gdb_test "backtrace" "#0  bar.*#1  .*func1.*#2  .*main.*" \
--    "backtrace from bar (2)"
--gdb_test "up" "#1  .*func1.*" "up from bar (2)"
--gdb_test "info frame" ".*inlined into frame.*" "func1 inlined (2)"
-+# gcc-4.3.1 omits the line number information for (2).
-+#gdb_test "continue" ".*set breakpoint 1 here.*" "continue to bar (2)"
-+#gdb_test "backtrace" "#0  bar.*#1  .*func1.*#2  .*main.*" \
-+#    "backtrace from bar (2)"
-+#gdb_test "up" "#1  .*func1.*" "up from bar (2)"
-+#gdb_test "info frame" ".*inlined into frame.*" "func1 inlined (2)"
- gdb_test "continue" ".*set breakpoint 1 here.*" "continue to bar (3)"
- gdb_test "backtrace" "#0  bar.*#1  .*func1.*#2  .*func2.*#3  .*main.*" \
-Index: gdb-6.8.50.20090302/gdb/testsuite/gdb.opt/inline-cmds.c
-===================================================================
---- gdb-6.8.50.20090302.orig/gdb/testsuite/gdb.opt/inline-cmds.c       2009-03-06 19:07:30.000000000 +0100
-+++ gdb-6.8.50.20090302/gdb/testsuite/gdb.opt/inline-cmds.c    2009-03-06 19:07:30.000000000 +0100
+--- gdb-6.8.91.20090917.orig/gdb/testsuite/gdb.opt/inline-cmds.c       2009-06-28 02:20:24.000000000 +0200
++++ gdb-6.8.91.20090917/gdb/testsuite/gdb.opt/inline-cmds.c    2009-09-17 12:49:01.000000000 +0200
 @@ -13,13 +13,19 @@
     You should have received a copy of the GNU General Public License
     along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
@@ -86,49 +54,11 @@ Index: gdb-6.8.50.20090302/gdb/testsuite/gdb.opt/inline-cmds.c
  inline int func1(void)
  {
    bar ();
-Index: gdb-6.8.50.20090302/gdb/testsuite/gdb.opt/inline-cmds.exp
+Index: gdb-6.8.91.20090917/gdb/testsuite/gdb.opt/inline-cmds.exp
 ===================================================================
---- gdb-6.8.50.20090302.orig/gdb/testsuite/gdb.opt/inline-cmds.exp     2009-03-06 19:07:30.000000000 +0100
-+++ gdb-6.8.50.20090302/gdb/testsuite/gdb.opt/inline-cmds.exp  2009-03-06 19:07:30.000000000 +0100
-@@ -45,28 +45,28 @@ if { [skip_inline_frame_tests] } {
- # First, check that the things we expected to be inlined really were,
- # and those that shouldn't be weren't.
--set line1 [gdb_get_line_number "set breakpoint 1 here" ${fullsrcfile2}]
-+set line1 [gdb_get_line_number "set breakpoint 1 here" ${srcfile2}]
- gdb_breakpoint $srcfile2:$line1
--set line2 [gdb_get_line_number "set breakpoint 2 here" ${fullsrcfile2}]
-+set line2 [gdb_get_line_number "set breakpoint 2 here" ${srcfile2}]
- gdb_breakpoint $srcfile2:$line2
--gdb_test "continue" ".*set breakpoint 1 here.*" "continue to bar (1)"
-+gdb_test "continue" "set breakpoint 1 here.*" "continue to bar (1)"
- gdb_test "backtrace" "#0  bar.*#1  .*func1.*#2  .*main.*" \
-     "backtrace from bar (1)"
- gdb_test "up" "#1  .*func1.*" "up from bar (1)"
--gdb_test "info frame" ".*inlined into frame.*" "func1 inlined (1)"
-+gdb_test "info frame" "inlined into frame.*" "func1 inlined (1)"
--gdb_test "continue" ".*set breakpoint 1 here.*" "continue to bar (2)"
-+gdb_test "continue" "set breakpoint 1 here.*" "continue to bar (2)"
- gdb_test "backtrace" "#0  bar.*#1  .*func1.*#2  .*func2.*#3  .*main.*" \
-     "backtrace from bar (2)"
- gdb_test "up" "#1  .*func1.*" "up from bar (2)"
--gdb_test "info frame" ".*inlined into frame.*" "func1 inlined (2)"
-+gdb_test "info frame" "inlined into frame.*" "func1 inlined (2)"
- gdb_test "up" "#2  .*func2.*" "up from func1 (2)"
--gdb_test "info frame" ".*inlined into frame.*" "func2 inlined (2)"
-+gdb_test "info frame" "inlined into frame.*" "func2 inlined (2)"
--gdb_test "continue" ".*set breakpoint 2 here.*" "continue to marker"
-+gdb_test "continue" "set breakpoint 2 here.*" "continue to marker"
- gdb_test "backtrace" "#0  marker.*#1  .*main.*" "backtrace from marker"
--gdb_test "info frame" ".*called by frame.*" "marker not inlined"
-+gdb_test "info frame" "\n called by frame.*" "marker not inlined"
- # Next, check that we can next over inlined functions.  We should not end up
- # inside any of them.
-@@ -201,7 +201,7 @@ set line3 [gdb_get_line_number "set brea
+--- gdb-6.8.91.20090917.orig/gdb/testsuite/gdb.opt/inline-cmds.exp     2009-06-28 02:20:24.000000000 +0200
++++ gdb-6.8.91.20090917/gdb/testsuite/gdb.opt/inline-cmds.exp  2009-09-17 12:49:01.000000000 +0200
+@@ -230,7 +230,7 @@ set line3 [gdb_get_line_number "set brea
  gdb_breakpoint $line3
  gdb_continue_to_breakpoint "consecutive func1"
  
@@ -137,7 +67,7 @@ Index: gdb-6.8.50.20090302/gdb/testsuite/gdb.opt/inline-cmds.exp
  set msg "next to second func1"
  gdb_test_multiple "next" $msg {
      -re ".*func1 .*second call.*$gdb_prompt $" {
-@@ -224,16 +224,16 @@ set line4 [gdb_get_line_number "set brea
+@@ -253,16 +253,16 @@ set line4 [gdb_get_line_number "set brea
  gdb_breakpoint $line4
  gdb_continue_to_breakpoint "func1 then func3"
  
@@ -158,7 +88,7 @@ Index: gdb-6.8.50.20090302/gdb/testsuite/gdb.opt/inline-cmds.exp
  gdb_test "finish" "func1 \\\(\\\);" "finish from marker to func1"
  
  gdb_test "step" "bar \\\(\\\);" "step into func1 for finish"
-@@ -268,12 +268,12 @@ gdb_test "step" "noinline \\\(\\\) at .*
+@@ -297,12 +297,12 @@ gdb_test "step" "noinline \\\(\\\) at .*
  gdb_test "bt" "#0  noinline.*#1  .*outer_inline1.*#2  .*outer_inline2.*#3  main.*" "backtrace at noinline from outer_inline1"
  gdb_test "step" "inlined_fn \\\(\\\) at .*" "enter inlined_fn from noinline"
  gdb_test "bt" "#0  inlined_fn.*#1  noinline.*#2  .*outer_inline1.*#3  .*outer_inline2.*#4  main.*" "backtrace at inlined_fn from noinline"
@@ -180,10 +110,10 @@ Index: gdb-6.8.50.20090302/gdb/testsuite/gdb.opt/inline-cmds.exp
 +gdb_test "info frame" "inlined into frame.*" "outer_inline2 inlined"
 +gdb_test "fini" "" "up from outer_inline2"
 +gdb_test "info frame" " in main \[^\n\]*\n source language.*" "main not inlined"
-Index: gdb-6.8.50.20090302/gdb/testsuite/gdb.opt/inline-locals.c
+Index: gdb-6.8.91.20090917/gdb/testsuite/gdb.opt/inline-locals.c
 ===================================================================
---- gdb-6.8.50.20090302.orig/gdb/testsuite/gdb.opt/inline-locals.c     2009-03-06 19:07:30.000000000 +0100
-+++ gdb-6.8.50.20090302/gdb/testsuite/gdb.opt/inline-locals.c  2009-03-06 19:07:30.000000000 +0100
+--- gdb-6.8.91.20090917.orig/gdb/testsuite/gdb.opt/inline-locals.c     2009-06-28 02:20:24.000000000 +0200
++++ gdb-6.8.91.20090917/gdb/testsuite/gdb.opt/inline-locals.c  2009-09-17 12:49:01.000000000 +0200
 @@ -13,11 +13,16 @@
     You should have received a copy of the GNU General Public License
     along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
@@ -203,21 +133,10 @@ Index: gdb-6.8.50.20090302/gdb/testsuite/gdb.opt/inline-locals.c
  
  inline int func1(int arg1)
  {
-Index: gdb-6.8.50.20090302/gdb/testsuite/gdb.opt/inline-locals.exp
+Index: gdb-6.8.91.20090917/gdb/testsuite/gdb.opt/inline-locals.exp
 ===================================================================
---- gdb-6.8.50.20090302.orig/gdb/testsuite/gdb.opt/inline-locals.exp   2009-03-06 19:07:30.000000000 +0100
-+++ gdb-6.8.50.20090302/gdb/testsuite/gdb.opt/inline-locals.exp        2009-03-06 19:07:30.000000000 +0100
-@@ -43,8 +43,8 @@ if { [skip_inline_var_tests] } {
- set no_frames [skip_inline_frame_tests]
--set line1 [gdb_get_line_number "set breakpoint 1 here" ${fullsrcfile2}]
--gdb_breakpoint $srcfile2:$line1
-+set line1 [gdb_get_line_number "set breakpoint 1 here" ${srcfile}]
-+gdb_breakpoint $srcfile:$line1
- gdb_test "continue" ".*set breakpoint 1 here.*" "continue to bar (1)"
+--- gdb-6.8.91.20090917.orig/gdb/testsuite/gdb.opt/inline-locals.exp   2009-06-30 17:50:27.000000000 +0200
++++ gdb-6.8.91.20090917/gdb/testsuite/gdb.opt/inline-locals.exp        2009-09-17 12:49:01.000000000 +0200
 @@ -77,6 +77,9 @@ if { ! $no_frames } {
  
  # Make sure that locals on the stack are found.  This is an array to
@@ -236,11 +155,11 @@ Index: gdb-6.8.50.20090302/gdb/testsuite/gdb.opt/inline-locals.exp
 +    setup_kfail *-*-* "gcc/debug.optimization"
 +}
  gdb_test "print array\[0\]" "\\\$$decimal = 184" "print local (3)"
-Index: gdb-6.8.50.20090302/gdb/frame.c
+Index: gdb-6.8.91.20090917/gdb/frame.c
 ===================================================================
---- gdb-6.8.50.20090302.orig/gdb/frame.c       2009-03-06 19:07:30.000000000 +0100
-+++ gdb-6.8.50.20090302/gdb/frame.c    2009-03-06 19:07:30.000000000 +0100
-@@ -269,7 +269,7 @@ fprint_frame (struct ui_file *file, stru
+--- gdb-6.8.91.20090917.orig/gdb/frame.c       2009-09-17 12:48:49.000000000 +0200
++++ gdb-6.8.91.20090917/gdb/frame.c    2009-09-17 12:49:01.000000000 +0200
+@@ -310,7 +310,7 @@ fprint_frame (struct ui_file *file, stru
  static struct frame_info *
  skip_inlined_frames (struct frame_info *frame)
  {
@@ -249,7 +168,7 @@ Index: gdb-6.8.50.20090302/gdb/frame.c
      frame = get_prev_frame (frame);
  
    return frame;
-@@ -1670,6 +1670,7 @@ get_frame_address_in_block (struct frame
+@@ -1778,6 +1778,7 @@ get_frame_address_in_block (struct frame
  {
    /* A draft address.  */
    CORE_ADDR pc = get_frame_pc (this_frame);
@@ -257,7 +176,7 @@ Index: gdb-6.8.50.20090302/gdb/frame.c
  
    struct frame_info *next_frame = this_frame->next;
  
-@@ -1712,6 +1713,9 @@ get_frame_address_in_block (struct frame
+@@ -1820,6 +1821,9 @@ get_frame_address_in_block (struct frame
       while in an inlined function, then the code address of the
       "calling" normal function should not be adjusted either.  */
  
@@ -267,7 +186,7 @@ Index: gdb-6.8.50.20090302/gdb/frame.c
    while (get_frame_type (next_frame) == INLINE_FRAME)
      next_frame = next_frame->next;
  
-@@ -1743,7 +1747,7 @@ find_frame_sal (struct frame_info *frame
+@@ -1851,7 +1855,7 @@ find_frame_sal (struct frame_info *frame
        sym = inline_skipped_symbol (inferior_ptid);
  
        init_sal (sal);
@@ -276,19 +195,19 @@ Index: gdb-6.8.50.20090302/gdb/frame.c
        {
          sal->symtab = SYMBOL_SYMTAB (sym);
          sal->line = SYMBOL_LINE (sym);
-Index: gdb-6.8.50.20090302/gdb/breakpoint.c
+Index: gdb-6.8.91.20090917/gdb/breakpoint.c
 ===================================================================
---- gdb-6.8.50.20090302.orig/gdb/breakpoint.c  2009-03-06 19:07:30.000000000 +0100
-+++ gdb-6.8.50.20090302/gdb/breakpoint.c       2009-03-06 19:07:30.000000000 +0100
-@@ -57,6 +57,7 @@
- #include "top.h"
- #include "wrapper.h"
- #include "valprint.h"
+--- gdb-6.8.91.20090917.orig/gdb/breakpoint.c  2009-09-17 12:48:51.000000000 +0200
++++ gdb-6.8.91.20090917/gdb/breakpoint.c       2009-09-17 12:49:12.000000000 +0200
+@@ -62,6 +62,7 @@
+ #include "jit.h"
+ #include "xml-syscall.h"
+ #include "parser-defs.h"
 +#include "inline-frame.h"
  
- #include "mi/mi-common.h"
-@@ -2902,10 +2903,24 @@ bpstat_check_breakpoint_conditions (bpst
+ /* readline include files */
+ #include "readline/readline.h"
+@@ -3220,10 +3221,24 @@ bpstat_check_breakpoint_conditions (bpst
    const struct bp_location *bl = bs->breakpoint_at;
    struct breakpoint *b = bl->owner;
  
@@ -317,7 +236,7 @@ Index: gdb-6.8.50.20090302/gdb/breakpoint.c
      {
        int value_is_zero = 0;
        
-@@ -3044,6 +3059,12 @@ bpstat_stop_status (CORE_ADDR bp_addr, p
+@@ -3383,6 +3398,12 @@ bpstat_stop_status (CORE_ADDR bp_addr, p
            bs->print = 0;
          }
        bs->commands = copy_command_lines (bs->commands);
@@ -330,7 +249,7 @@ Index: gdb-6.8.50.20090302/gdb/breakpoint.c
        }
  
      /* Print nothing for this entry if we dont stop or if we dont print.  */
-@@ -5168,9 +5189,9 @@ set_momentary_breakpoint (struct symtab_
+@@ -5572,9 +5593,9 @@ set_momentary_breakpoint (struct gdbarch
  {
    struct breakpoint *b;
  
@@ -341,13 +260,13 @@ Index: gdb-6.8.50.20090302/gdb/breakpoint.c
 +     shortcut the case of returning _from_ an inline frame we still may be
 +     returning from non-inlined frame _to_ an inlined frame.  */
  
-   b = set_raw_breakpoint (sal, type);
+   b = set_raw_breakpoint (gdbarch, sal, type);
    b->enable_state = bp_enabled;
-Index: gdb-6.8.50.20090302/gdb/inline-frame.c
+Index: gdb-6.8.91.20090917/gdb/inline-frame.c
 ===================================================================
---- gdb-6.8.50.20090302.orig/gdb/inline-frame.c        2009-03-06 19:07:30.000000000 +0100
-+++ gdb-6.8.50.20090302/gdb/inline-frame.c     2009-03-06 19:07:30.000000000 +0100
-@@ -183,6 +183,12 @@ inline_frame_sniffer (const struct frame
+--- gdb-6.8.91.20090917.orig/gdb/inline-frame.c        2009-09-13 18:28:28.000000000 +0200
++++ gdb-6.8.91.20090917/gdb/inline-frame.c     2009-09-17 12:49:01.000000000 +0200
+@@ -199,6 +199,12 @@ inline_frame_sniffer (const struct frame
    if (frame_block == NULL)
      return 0;
  
@@ -360,7 +279,7 @@ Index: gdb-6.8.50.20090302/gdb/inline-frame.c
    /* Calculate DEPTH, the number of inlined functions at this
       location.  */
    depth = 0;
-@@ -192,6 +198,10 @@ inline_frame_sniffer (const struct frame
+@@ -208,6 +214,10 @@ inline_frame_sniffer (const struct frame
        if (block_inlined_p (cur_block))
        depth++;
  
@@ -371,7 +290,7 @@ Index: gdb-6.8.50.20090302/gdb/inline-frame.c
        cur_block = BLOCK_SUPERBLOCK (cur_block);
      }
  
-@@ -275,7 +285,6 @@ skip_inline_frames (ptid_t ptid)
+@@ -291,7 +301,6 @@ skip_inline_frames (ptid_t ptid)
  {
    CORE_ADDR this_pc;
    struct block *frame_block, *cur_block;
@@ -379,7 +298,7 @@ Index: gdb-6.8.50.20090302/gdb/inline-frame.c
    int skip_count = 0;
    struct inline_state *state;
  
-@@ -296,10 +305,7 @@ skip_inline_frames (ptid_t ptid)
+@@ -312,10 +321,7 @@ skip_inline_frames (ptid_t ptid)
                 of BLOCK_START.  */
              if (BLOCK_START (cur_block) == this_pc
                  || block_starting_point_at (this_pc, cur_block))
@@ -391,7 +310,7 @@ Index: gdb-6.8.50.20090302/gdb/inline-frame.c
              else
                break;
            }
-@@ -311,7 +317,6 @@ skip_inline_frames (ptid_t ptid)
+@@ -327,7 +333,6 @@ skip_inline_frames (ptid_t ptid)
    state = allocate_inline_frame_state (ptid);
    state->skipped_frames = skip_count;
    state->saved_pc = this_pc;
@@ -399,7 +318,7 @@ Index: gdb-6.8.50.20090302/gdb/inline-frame.c
  
    if (skip_count != 0)
      reinit_frame_cache ();
-@@ -329,6 +334,23 @@ step_into_inline_frame (ptid_t ptid)
+@@ -345,6 +350,23 @@ step_into_inline_frame (ptid_t ptid)
    reinit_frame_cache ();
  }
  
@@ -423,10 +342,10 @@ Index: gdb-6.8.50.20090302/gdb/inline-frame.c
  /* Return the number of hidden functions inlined into the current
     frame.  */
  
-Index: gdb-6.8.50.20090302/gdb/testsuite/gdb.opt/inline-markers.c
+Index: gdb-6.8.91.20090917/gdb/testsuite/gdb.opt/inline-markers.c
 ===================================================================
---- gdb-6.8.50.20090302.orig/gdb/testsuite/gdb.opt/inline-markers.c    2009-03-06 19:07:30.000000000 +0100
-+++ gdb-6.8.50.20090302/gdb/testsuite/gdb.opt/inline-markers.c 2009-03-06 19:07:30.000000000 +0100
+--- gdb-6.8.91.20090917.orig/gdb/testsuite/gdb.opt/inline-markers.c    2009-06-28 02:20:24.000000000 +0200
++++ gdb-6.8.91.20090917/gdb/testsuite/gdb.opt/inline-markers.c 2009-09-17 12:49:01.000000000 +0200
 @@ -15,11 +15,6 @@
  
  extern int x, y;
@@ -439,11 +358,11 @@ Index: gdb-6.8.50.20090302/gdb/testsuite/gdb.opt/inline-markers.c
  void marker(void)
  {
    x += y; /* set breakpoint 2 here */
-Index: gdb-6.8.50.20090302/gdb/gdbthread.h
+Index: gdb-6.8.91.20090917/gdb/gdbthread.h
 ===================================================================
---- gdb-6.8.50.20090302.orig/gdb/gdbthread.h   2009-03-06 19:07:30.000000000 +0100
-+++ gdb-6.8.50.20090302/gdb/gdbthread.h        2009-03-06 19:07:30.000000000 +0100
-@@ -180,6 +180,12 @@ struct thread_info
+--- gdb-6.8.91.20090917.orig/gdb/gdbthread.h   2009-09-17 12:47:07.000000000 +0200
++++ gdb-6.8.91.20090917/gdb/gdbthread.h        2009-09-17 12:49:01.000000000 +0200
+@@ -191,6 +191,12 @@ struct thread_info
  
    /* Private data used by the target vector implementation.  */
    struct private_thread_info *private;
@@ -456,11 +375,11 @@ Index: gdb-6.8.50.20090302/gdb/gdbthread.h
  };
  
  /* Create an empty thread list, or empty the existing one.  */
-Index: gdb-6.8.50.20090302/gdb/infcmd.c
+Index: gdb-6.8.91.20090917/gdb/infcmd.c
 ===================================================================
---- gdb-6.8.50.20090302.orig/gdb/infcmd.c      2009-03-06 19:07:30.000000000 +0100
-+++ gdb-6.8.50.20090302/gdb/infcmd.c   2009-03-06 19:07:30.000000000 +0100
-@@ -1391,11 +1391,11 @@ finish_command_continuation (void *arg)
+--- gdb-6.8.91.20090917.orig/gdb/infcmd.c      2009-09-17 12:47:07.000000000 +0200
++++ gdb-6.8.91.20090917/gdb/infcmd.c   2009-09-17 12:49:01.000000000 +0200
+@@ -1434,11 +1434,11 @@ finish_command_continuation (void *arg)
        struct type *value_type;
  
        value_type = TYPE_TARGET_TYPE (SYMBOL_TYPE (a->function));
@@ -474,9 +393,9 @@ Index: gdb-6.8.50.20090302/gdb/infcmd.c
        print_return_value (SYMBOL_TYPE (a->function), value_type);
      }
  
-@@ -1499,6 +1499,16 @@ finish_forward (struct symbol *function,
-   old_chain = make_cleanup_delete_breakpoint (breakpoint);
+@@ -1546,6 +1546,16 @@ finish_forward (struct symbol *function,
+   tp->initiating_frame = get_frame_id (frame);
+   make_cleanup (delete_longjmp_breakpoint_cleanup, &thread);
  
 +  /* We should _always_ set CURRENT_PC_IS_NOTCURRENT here to always see the
 +     calling line with the message `Value returned is ...'.  Currently it is
@@ -489,9 +408,9 @@ Index: gdb-6.8.50.20090302/gdb/infcmd.c
 +    tp->current_pc_is_notcurrent = 1;
 +
    tp->proceed_to_finish = 1;    /* We want stop_registers, please...  */
-   make_cleanup_restore_integer (&suppress_stop_observer);
-   suppress_stop_observer = 1;
-@@ -1522,7 +1532,9 @@ finish_forward (struct symbol *function,
+   proceed ((CORE_ADDR) -1, TARGET_SIGNAL_DEFAULT, 0);
+@@ -1567,7 +1577,9 @@ finish_forward (struct symbol *function,
  static void
  finish_command (char *arg, int from_tty)
  {
@@ -502,7 +421,7 @@ Index: gdb-6.8.50.20090302/gdb/infcmd.c
    struct symbol *function;
  
    int async_exec = 0;
-@@ -1553,46 +1565,63 @@ finish_command (char *arg, int from_tty)
+@@ -1598,45 +1610,63 @@ finish_command (char *arg, int from_tty)
    if (!target_has_execution)
      error (_("The program is not running."));
  
@@ -523,16 +442,15 @@ Index: gdb-6.8.50.20090302/gdb/infcmd.c
 -      == INLINE_FRAME)
 +  if (get_frame_type (current_frame) == INLINE_FRAME)
      {
-       struct thread_info *tp = inferior_thread ();
--
 -      /* Claim we are stepping in the calling frame.  An empty step
 -       range means that we will stop once we aren't in a function
 -       called by that frame.  We don't use the magic "1" value for
 -       step_range_end, because then infrun will think this is nexti,
 -       and not step over the rest of this inlined function call.  */
+       struct thread_info *tp = inferior_thread ();
        struct symtab_and_line empty_sal;
 -      init_sal (&empty_sal);
--      set_step_info (tp, frame, empty_sal);
+-      set_step_info (frame, empty_sal);
 -      tp->step_range_start = tp->step_range_end = get_frame_pc (frame);
 -      tp->step_over_calls = STEP_OVER_ALL;
 +      struct block *frame_block;
@@ -544,8 +462,8 @@ Index: gdb-6.8.50.20090302/gdb/infcmd.c
          printf_filtered (_("Run till exit from "));
 -        print_stack_frame (get_selected_frame (NULL), 1, LOCATION);
 +        print_stack_frame (current_frame, 1, LOCATION);
-       }
++      }
++
 +      /* Even just a single stepi would get us out of the caller function PC
 +       range.  */
 +
@@ -561,15 +479,15 @@ Index: gdb-6.8.50.20090302/gdb/infcmd.c
 +        tp->current_pc_is_notcurrent = 1;
 +        normal_stop ();
 +        return;
-+      }
-+
+       }
 +      /* Claim we are stepping in the calling frame.  An empty step
 +       range means that we will stop once we aren't in a function
 +       called by that frame.  We don't use the magic "1" value for
 +       step_range_end, because then infrun will think this is nexti,
 +       and not step over the rest of this inlined function call.  */
 +      init_sal (&empty_sal);
-+      set_step_info (tp, prev_frame, empty_sal);
++      set_step_info (prev_frame, empty_sal);
 +      tp->step_range_start = tp->step_range_end = get_frame_pc (prev_frame);
 +      tp->step_over_calls = STEP_OVER_ALL;
 +
@@ -584,7 +502,7 @@ Index: gdb-6.8.50.20090302/gdb/infcmd.c
  
    /* Print info on the selected frame, including level number but not
       source.  */
-@@ -1606,10 +1635,14 @@ finish_command (char *arg, int from_tty)
+@@ -1650,10 +1680,14 @@ finish_command (char *arg, int from_tty)
        print_stack_frame (get_selected_frame (NULL), 1, LOCATION);
      }
  
@@ -600,52 +518,22 @@ Index: gdb-6.8.50.20090302/gdb/infcmd.c
  }
  \f
  
-Index: gdb-6.8.50.20090302/gdb/infrun.c
-===================================================================
---- gdb-6.8.50.20090302.orig/gdb/infrun.c      2009-03-06 19:07:30.000000000 +0100
-+++ gdb-6.8.50.20090302/gdb/infrun.c   2009-03-06 19:07:30.000000000 +0100
-@@ -1152,8 +1152,6 @@ a command like `return' or `jump' to con
-           step = 0;
-       }
--      clear_inline_frame_state (resume_ptid);
--
-       if (debug_displaced
-           && use_displaced_stepping (gdbarch)
-           && tp->trap_expected)
-@@ -1205,6 +1203,8 @@ clear_proceed_status_thread (struct thre
-   /* Discard any remaining commands or status from previous stop.  */
-   bpstat_clear (&tp->stop_bpstat);
-+
-+  tp->current_pc_is_notcurrent = 0;
- }
- static int
-Index: gdb-6.8.50.20090302/gdb/target.c
+Index: gdb-6.8.91.20090917/gdb/target.c
 ===================================================================
---- gdb-6.8.50.20090302.orig/gdb/target.c      2009-03-06 19:07:26.000000000 +0100
-+++ gdb-6.8.50.20090302/gdb/target.c   2009-03-06 19:07:30.000000000 +0100
-@@ -41,6 +41,7 @@
- #include "target-descriptions.h"
- #include "gdbthread.h"
- #include "solib.h"
-+#include "inline-frame.h"
- static void target_info (char *, int);
-@@ -1925,6 +1926,7 @@ target_resume (ptid_t ptid, int step, en
+--- gdb-6.8.91.20090917.orig/gdb/target.c      2009-09-17 12:48:49.000000000 +0200
++++ gdb-6.8.91.20090917/gdb/target.c   2009-09-17 12:49:01.000000000 +0200
+@@ -2187,6 +2187,7 @@ target_resume (ptid_t ptid, int step, en
  {
    struct target_ops *t;
  
 +  clear_inline_frame_state (ptid);
-   dcache_invalidate (target_dcache);
+   target_dcache_invalidate ();
  
    for (t = current_target.beneath; t != NULL; t = t->beneath)
-Index: gdb-6.8.50.20090302/gdb/inline-frame.h
+Index: gdb-6.8.91.20090917/gdb/inline-frame.h
 ===================================================================
---- gdb-6.8.50.20090302.orig/gdb/inline-frame.h        2009-03-06 19:07:30.000000000 +0100
-+++ gdb-6.8.50.20090302/gdb/inline-frame.h     2009-03-06 19:07:30.000000000 +0100
+--- gdb-6.8.91.20090917.orig/gdb/inline-frame.h        2009-06-28 02:20:22.000000000 +0200
++++ gdb-6.8.91.20090917/gdb/inline-frame.h     2009-09-17 12:49:01.000000000 +0200
 @@ -43,6 +43,10 @@ void clear_inline_frame_state (ptid_t pt
  
  void step_into_inline_frame (ptid_t ptid);
@@ -657,41 +545,19 @@ Index: gdb-6.8.50.20090302/gdb/inline-frame.h
  /* Return the number of hidden functions inlined into the current
     frame.  */
  
-Index: gdb-6.8.50.20090302/gdb/infcall.c
-===================================================================
---- gdb-6.8.50.20090302.orig/gdb/infcall.c     2009-03-06 19:07:30.000000000 +0100
-+++ gdb-6.8.50.20090302/gdb/infcall.c  2009-03-06 19:07:30.000000000 +0100
-@@ -898,8 +898,15 @@ The program being debugged exited while 
-         if (unwind_on_signal_p)
-           {
--            /* The user wants the context restored.  Calling error will
--               run inf_status_cleanup, which does all the work.  */
-+            /* The user wants the context restored. */
-+
-+            /* We must get back to the frame we were before the
-+               dummy call.  */
-+            dummy_frame_pop (dummy_id);
-+
-+            /* We also need to restore inferior status to that before the
-+               dummy call.  */
-+            restore_inferior_status (inf_status);
-             /* FIXME: Insert a bunch of wrap_here; name can be very
-                long if it's a C++ name with arguments and stuff.  */
-Index: gdb-6.8.50.20090302/gdb/dwarf2read.c
+Index: gdb-6.8.91.20090917/gdb/dwarf2read.c
 ===================================================================
---- gdb-6.8.50.20090302.orig/gdb/dwarf2read.c  2009-03-06 19:07:30.000000000 +0100
-+++ gdb-6.8.50.20090302/gdb/dwarf2read.c       2009-03-06 19:07:40.000000000 +0100
-@@ -3463,6 +3463,7 @@ read_func_scope (struct die_info *die, s
+--- gdb-6.8.91.20090917.orig/gdb/dwarf2read.c  2009-09-17 12:48:51.000000000 +0200
++++ gdb-6.8.91.20090917/gdb/dwarf2read.c       2009-09-17 12:49:01.000000000 +0200
+@@ -4128,6 +4128,7 @@ read_func_scope (struct die_info *die, s
+   struct block *block;
    unsigned die_children = 0;
-   struct attribute *call_line, *call_file;
    int inlined_func = (die->tag == DW_TAG_inlined_subroutine);
 +  struct type *type;
  
    if (inlined_func)
      {
-@@ -3504,7 +3505,10 @@ read_func_scope (struct die_info *die, s
+@@ -4169,7 +4170,10 @@ read_func_scope (struct die_info *die, s
    add_to_cu_func_list (name, lowpc, highpc, cu);
  
    new = push_context (0, lowpc);
@@ -703,11 +569,3 @@ Index: gdb-6.8.50.20090302/gdb/dwarf2read.c
  
    /* If there is a location expression for DW_AT_frame_base, record
       it.  */
-@@ -8746,6 +8750,7 @@ read_type_die (struct die_info *die, str
-       break;
-     case DW_TAG_subprogram:
-     case DW_TAG_subroutine_type:
-+    case DW_TAG_inlined_subroutine:
-       this_type = read_subroutine_type (die, cu);
-       break;
-     case DW_TAG_array_type:
diff --git a/gdb-6.8-inlining.patch b/gdb-6.8-inlining.patch
deleted file mode 100644 (file)
index c13bead..0000000
+++ /dev/null
@@ -1,3268 +0,0 @@
-http://sourceware.org/ml/gdb-patches/2008-07/msg00442.html
-with pre-applied and post-unapplied (the patch is currently 2008-12-06 not
-applied upstream)
-http://sourceware.org/ml/gdb-patches/2008-07/msg00317.html
-
-Removed dwarf_expr_frame_base NULL check duplicity with *-vla.patch.
-
-Index: gdb-6.8.50.20090302/gdb/NEWS
-===================================================================
---- gdb-6.8.50.20090302.orig/gdb/NEWS  2009-03-21 21:06:02.000000000 +0100
-+++ gdb-6.8.50.20090302/gdb/NEWS       2009-03-21 21:06:16.000000000 +0100
-@@ -1,6 +1,11 @@
-               What has changed in GDB?
-            (Organized release by release)
-+*** Fedora changes
-+
-+* Inlined functions are now supported.  They show up in backtraces, and
-+the "step", "next", and "finish" commands handle them automatically.
-+
- *** Changes since GDB 6.8
- * GDB now has support for multi-byte and wide character sets on the
-Index: gdb-6.8.50.20090302/gdb/block.c
-===================================================================
---- gdb-6.8.50.20090302.orig/gdb/block.c       2009-03-21 21:06:02.000000000 +0100
-+++ gdb-6.8.50.20090302/gdb/block.c    2009-03-21 21:06:16.000000000 +0100
-@@ -47,8 +47,16 @@ contained_in (const struct block *a, con
- {
-   if (!a || !b)
-     return 0;
--  return BLOCK_START (a) >= BLOCK_START (b)
--    && BLOCK_END (a) <= BLOCK_END (b);
-+
-+  do
-+    {
-+      if (a == b)
-+      return 1;
-+      a = BLOCK_SUPERBLOCK (a);
-+    }
-+  while (a != NULL);
-+
-+  return 0;
- }
-@@ -60,12 +68,21 @@ contained_in (const struct block *a, con
- struct symbol *
- block_linkage_function (const struct block *bl)
- {
--  while (BLOCK_FUNCTION (bl) == 0 && BLOCK_SUPERBLOCK (bl) != 0)
-+  while ((BLOCK_FUNCTION (bl) == NULL || block_inlined_p (bl))
-+       && BLOCK_SUPERBLOCK (bl) != NULL)
-     bl = BLOCK_SUPERBLOCK (bl);
-   return BLOCK_FUNCTION (bl);
- }
-+/* Return one if BL represents an inlined function.  */
-+
-+int
-+block_inlined_p (const struct block *bl)
-+{
-+  return BLOCK_FUNCTION (bl) != NULL && SYMBOL_INLINED (BLOCK_FUNCTION (bl));
-+}
-+
- /* Return the blockvector immediately containing the innermost lexical
-    block containing the specified pc value and section, or 0 if there
-    is none.  PBLOCK is a pointer to the block.  If PBLOCK is NULL, we
-Index: gdb-6.8.50.20090302/gdb/block.h
-===================================================================
---- gdb-6.8.50.20090302.orig/gdb/block.h       2009-01-03 06:57:50.000000000 +0100
-+++ gdb-6.8.50.20090302/gdb/block.h    2009-03-21 21:06:16.000000000 +0100
-@@ -65,7 +65,7 @@ struct block
-   CORE_ADDR endaddr;
-   /* The symbol that names this block, if the block is the body of a
--     function; otherwise, zero.  */
-+     function (real or inlined); otherwise, zero.  */
-   struct symbol *function;
-@@ -134,6 +134,8 @@ enum { GLOBAL_BLOCK = 0, STATIC_BLOCK = 
- extern struct symbol *block_linkage_function (const struct block *);
-+extern int block_inlined_p (const struct block *block);
-+
- extern int contained_in (const struct block *, const struct block *);
- extern struct blockvector *blockvector_for_pc (CORE_ADDR, struct block **);
-Index: gdb-6.8.50.20090302/gdb/blockframe.c
-===================================================================
---- gdb-6.8.50.20090302.orig/gdb/blockframe.c  2009-01-03 06:57:50.000000000 +0100
-+++ gdb-6.8.50.20090302/gdb/blockframe.c       2009-03-21 21:06:16.000000000 +0100
-@@ -36,6 +36,7 @@
- #include "command.h"
- #include "gdbcmd.h"
- #include "block.h"
-+#include "inline-frame.h"
- /* Prototypes for exported functions. */
-@@ -61,11 +62,29 @@ struct block *
- get_frame_block (struct frame_info *frame, CORE_ADDR *addr_in_block)
- {
-   const CORE_ADDR pc = get_frame_address_in_block (frame);
-+  struct frame_info *next_frame;
-+  struct block *bl;
-+  int inline_count;
-   if (addr_in_block)
-     *addr_in_block = pc;
--  return block_for_pc (pc);
-+  bl = block_for_pc (pc);
-+  if (bl == NULL)
-+    return NULL;
-+
-+  inline_count = frame_inlined_callees (frame);
-+
-+  while (inline_count > 0)
-+    {
-+      if (block_inlined_p (bl))
-+      inline_count--;
-+
-+      bl = BLOCK_SUPERBLOCK (bl);
-+      gdb_assert (bl != NULL);
-+    }
-+
-+  return bl;
- }
- CORE_ADDR
-@@ -104,9 +123,14 @@ struct symbol *
- get_frame_function (struct frame_info *frame)
- {
-   struct block *bl = get_frame_block (frame, 0);
--  if (bl == 0)
--    return 0;
--  return block_linkage_function (bl);
-+
-+  if (bl == NULL)
-+    return NULL;
-+
-+  while (BLOCK_FUNCTION (bl) == NULL && BLOCK_SUPERBLOCK (bl) != NULL)
-+    bl = BLOCK_SUPERBLOCK (bl);
-+
-+  return BLOCK_FUNCTION (bl);
- }
\f
-@@ -350,8 +374,8 @@ block_innermost_frame (struct block *blo
-   frame = get_current_frame ();
-   while (frame != NULL)
-     {
--      calling_pc = get_frame_address_in_block (frame);
--      if (calling_pc >= start && calling_pc < end)
-+      struct block *frame_block = get_frame_block (frame, NULL);
-+      if (frame_block != NULL && contained_in (frame_block, block))
-       return frame;
-       frame = get_prev_frame (frame);
-Index: gdb-6.8.50.20090302/gdb/breakpoint.c
-===================================================================
---- gdb-6.8.50.20090302.orig/gdb/breakpoint.c  2009-03-21 21:06:05.000000000 +0100
-+++ gdb-6.8.50.20090302/gdb/breakpoint.c       2009-03-21 21:06:16.000000000 +0100
-@@ -2641,19 +2641,21 @@ watchpoint_check (void *p)
-     within_current_scope = 1;
-   else
-     {
--      /* There is no current frame at this moment.  If we're going to have
--         any chance of handling watchpoints on local variables, we'll need
--         the frame chain (so we can determine if we're in scope).  */
--      reinit_frame_cache ();
-       fr = frame_find_by_id (b->watchpoint_frame);
-       within_current_scope = (fr != NULL);
-       /* If we've gotten confused in the unwinder, we might have
-        returned a frame that can't describe this variable.  */
--      if (within_current_scope
--        && (block_linkage_function (b->exp_valid_block)
--            != get_frame_function (fr)))
--      within_current_scope = 0;
-+      if (within_current_scope)
-+      {
-+        struct symbol *function;
-+
-+        function = get_frame_function (fr);
-+        if (function == NULL
-+            || !contained_in (b->exp_valid_block,
-+                              SYMBOL_BLOCK_VALUE (function)))
-+          within_current_scope = 0;
-+      }
-       /* in_function_epilogue_p() returns a non-zero value if we're still
-        in the function but the stack frame has already been invalidated.
-@@ -2665,10 +2667,9 @@ watchpoint_check (void *p)
-        that the watchpoint frame couldn't be found by frame_find_by_id()
-        because the current PC is currently in an epilogue.  Calling
-        gdbarch_in_function_epilogue_p() also when fr == NULL fixes that. */
--      if ((!within_current_scope || fr == get_current_frame ())
--          && gdbarch_in_function_epilogue_p (current_gdbarch, read_pc ()))
-+      if (gdbarch_in_function_epilogue_p (current_gdbarch, read_pc ()))
-       return WP_VALUE_NOT_CHANGED;
--      if (fr && within_current_scope)
-+      if (within_current_scope)
-       /* If we end up stopping, the current frame will get selected
-          in normal_stop.  So this call to select_frame won't affect
-          the user.  */
-@@ -2902,7 +2903,7 @@ bpstat_check_breakpoint_conditions (bpst
-   struct breakpoint *b = bl->owner;
-   if (frame_id_p (b->frame_id)
--      && !frame_id_eq (b->frame_id, get_frame_id (get_current_frame ())))
-+      && !frame_id_eq (b->frame_id, get_stack_frame_id (get_current_frame ())))
-     bs->stop = 0;
-   else if (bs->stop)
-     {
-@@ -2917,8 +2918,12 @@ bpstat_check_breakpoint_conditions (bpst
-       
-       if (bl->cond && bl->owner->disposition != disp_del_at_next_stop)
-       {
--        /* Need to select the frame, with all that implies
--           so that the conditions will have the right context.  */
-+        /* Need to select the frame, with all that implies so that
-+           the conditions will have the right context.  Because we
-+           use the frame, we will not see an inlined function's
-+           variables when we arrive at a breakpoint at the start
-+           of the inlined function; the current frame will be the
-+           call site.  */
-         select_frame (get_current_frame ());
-         value_is_zero
-           = catch_errors (breakpoint_cond_eval, (bl->cond),
-@@ -5163,6 +5168,11 @@ set_momentary_breakpoint (struct symtab_
-                         enum bptype type)
- {
-   struct breakpoint *b;
-+
-+  /* If FRAME_ID is valid, it should be a real frame, not an inlined
-+     one.  */
-+  gdb_assert (!frame_id_inlined_p (frame_id));
-+
-   b = set_raw_breakpoint (sal, type);
-   b->enable_state = bp_enabled;
-   b->disposition = disp_donttouch;
-@@ -6203,7 +6213,6 @@ watch_command_1 (char *arg, int accessfl
-   struct block *exp_valid_block;
-   struct value *val, *mark, *val_chain;
-   struct frame_info *frame;
--  struct frame_info *prev_frame = NULL;
-   char *exp_start = NULL;
-   char *exp_end = NULL;
-   char *tok, *id_tok_start, *end_tok;
-@@ -6364,34 +6373,34 @@ watch_command_1 (char *arg, int accessfl
-     bp_type = bp_watchpoint;
-   frame = block_innermost_frame (exp_valid_block);
--  if (frame)
--    prev_frame = get_prev_frame (frame);
--  else
--    prev_frame = NULL;
-   /* If the expression is "local", then set up a "watchpoint scope"
-      breakpoint at the point where we've left the scope of the watchpoint
-      expression.  Create the scope breakpoint before the watchpoint, so
-      that we will encounter it first in bpstat_stop_status.  */
--  if (innermost_block && prev_frame)
-+  if (innermost_block && frame)
-     {
--      scope_breakpoint = create_internal_breakpoint (get_frame_pc (prev_frame),
--                                                   bp_watchpoint_scope);
-+      if (frame_id_p (frame_unwind_id (frame)))
-+      {
-+        scope_breakpoint
-+          = create_internal_breakpoint (frame_pc_unwind (frame),
-+                                        bp_watchpoint_scope);
--      scope_breakpoint->enable_state = bp_enabled;
-+        scope_breakpoint->enable_state = bp_enabled;
--      /* Automatically delete the breakpoint when it hits.  */
--      scope_breakpoint->disposition = disp_del;
-+        /* Automatically delete the breakpoint when it hits.  */
-+        scope_breakpoint->disposition = disp_del;
--      /* Only break in the proper frame (help with recursion).  */
--      scope_breakpoint->frame_id = get_frame_id (prev_frame);
-+        /* Only break in the proper frame (help with recursion).  */
-+        scope_breakpoint->frame_id = frame_unwind_id (frame);
--      /* Set the address at which we will stop.  */
--      scope_breakpoint->loc->requested_address
--      = get_frame_pc (prev_frame);
--      scope_breakpoint->loc->address
--      = adjust_breakpoint_address (scope_breakpoint->loc->requested_address,
--                                   scope_breakpoint->type);
-+        /* Set the address at which we will stop.  */
-+        scope_breakpoint->loc->requested_address
-+          = frame_pc_unwind (frame);
-+        scope_breakpoint->loc->address
-+          = adjust_breakpoint_address (scope_breakpoint->loc->requested_address,
-+                                       scope_breakpoint->type);
-+      }
-     }
-   /* Now set up the breakpoint.  */
-@@ -6572,7 +6581,6 @@ until_break_command (char *arg, int from
-   struct symtabs_and_lines sals;
-   struct symtab_and_line sal;
-   struct frame_info *frame = get_selected_frame (NULL);
--  struct frame_info *prev_frame = get_prev_frame (frame);
-   struct breakpoint *breakpoint;
-   struct breakpoint *breakpoint2 = NULL;
-   struct cleanup *old_chain;
-@@ -6605,20 +6613,22 @@ until_break_command (char *arg, int from
-        we don't specify a frame at which we need to stop.  */
-     breakpoint = set_momentary_breakpoint (sal, null_frame_id, bp_until);
-   else
--    /* Otherwise, specify the current frame, because we want to stop only
-+    /* Otherwise, specify the selected frame, because we want to stop only
-        at the very same frame.  */
--    breakpoint = set_momentary_breakpoint (sal, get_frame_id (frame),
-+    breakpoint = set_momentary_breakpoint (sal, get_stack_frame_id (frame),
-                                          bp_until);
-   old_chain = make_cleanup_delete_breakpoint (breakpoint);
-   /* Keep within the current frame, or in frames called by the current
-      one.  */
--  if (prev_frame)
-+
-+  if (frame_id_p (frame_unwind_id (frame)))
-     {
--      sal = find_pc_line (get_frame_pc (prev_frame), 0);
--      sal.pc = get_frame_pc (prev_frame);
--      breakpoint2 = set_momentary_breakpoint (sal, get_frame_id (prev_frame),
-+      sal = find_pc_line (frame_pc_unwind (frame), 0);
-+      sal.pc = frame_pc_unwind (frame);
-+      breakpoint2 = set_momentary_breakpoint (sal,
-+                                            frame_unwind_id (frame),
-                                             bp_until);
-       make_cleanup_delete_breakpoint (breakpoint2);
-     }
-Index: gdb-6.8.50.20090302/gdb/buildsym.c
-===================================================================
---- gdb-6.8.50.20090302.orig/gdb/buildsym.c    2009-03-21 21:06:02.000000000 +0100
-+++ gdb-6.8.50.20090302/gdb/buildsym.c 2009-03-21 21:06:16.000000000 +0100
-@@ -1155,6 +1155,12 @@ end_symtab (CORE_ADDR end_addr, struct o
-         struct symbol *sym;
-         struct dict_iterator iter;
-+        /* Inlined functions may have symbols not in the global or static
-+           symbol lists.  */
-+        if (BLOCK_FUNCTION (block) != NULL)
-+          if (SYMBOL_SYMTAB (BLOCK_FUNCTION (block)) == NULL)
-+            SYMBOL_SYMTAB (BLOCK_FUNCTION (block)) = symtab;
-+
-         for (sym = dict_iterator_first (BLOCK_DICT (block), &iter);
-              sym != NULL;
-              sym = dict_iterator_next (&iter))
-Index: gdb-6.8.50.20090302/gdb/doc/gdb.texinfo
-===================================================================
---- gdb-6.8.50.20090302.orig/gdb/doc/gdb.texinfo       2009-03-21 21:06:05.000000000 +0100
-+++ gdb-6.8.50.20090302/gdb/doc/gdb.texinfo    2009-03-21 21:06:16.000000000 +0100
-@@ -137,6 +137,7 @@ software in general.  We will miss him.
- * Stack::                       Examining the stack
- * Source::                      Examining source files
- * Data::                        Examining data
-+* Optimized Code::              Debugging optimized code
- * Macros::                      Preprocessor Macros
- * Tracepoints::                 Debugging remote targets non-intrusively
- * Overlays::                    Debugging programs that use overlays
-@@ -1824,7 +1825,7 @@ To request debugging information, specif
- the compiler.
- Programs that are to be shipped to your customers are compiled with
--optimizations, using the @samp{-O} compiler option.  However, many
-+optimizations, using the @samp{-O} compiler option.  However, some
- compilers are unable to handle the @samp{-g} and @samp{-O} options
- together.  Using those compilers, you cannot generate optimized
- executables containing debugging information.
-@@ -1833,22 +1834,7 @@ executables containing debugging informa
- without @samp{-O}, making it possible to debug optimized code.  We
- recommend that you @emph{always} use @samp{-g} whenever you compile a
- program.  You may think your program is correct, but there is no sense
--in pushing your luck.
--
--@cindex optimized code, debugging
--@cindex debugging optimized code
--When you debug a program compiled with @samp{-g -O}, remember that the
--optimizer is rearranging your code; the debugger shows you what is
--really there.  Do not be too surprised when the execution path does not
--exactly match your source file!  An extreme example: if you define a
--variable, but never use it, @value{GDBN} never sees that
--variable---because the compiler optimizes it out of existence.
--
--Some things do not work as well with @samp{-g -O} as with just
--@samp{-g}, particularly on machines with instruction scheduling.  If in
--doubt, recompile with @samp{-g} alone, and if this fixes the problem,
--please report it to us as a bug (including a test case!).
--@xref{Variables}, for more information about debugging optimized code.
-+in pushing your luck.  For more information, see @ref{Optimized Code}.
- Older versions of the @sc{gnu} C compiler permitted a variant option
- @w{@samp{-gg}} for debugging information.  @value{GDBN} no longer supports this
-@@ -8406,6 +8392,107 @@ $1 = 1
- $2 = (void *) 0x8049560
- @end smallexample
-+@node Optimized Code
-+@chapter Debugging Optimized Code
-+@cindex optimized code, debugging
-+@cindex debugging optimized code
-+
-+Almost all compilers support optimization.  With optimization
-+disabled, the compiler generates assembly code that corresponds
-+directly to your source code, in a simplistic way.  As the compiler
-+applies more powerful optimizations, the generated assembly code
-+diverges from your original source code.  With help from debugging
-+information generated by the compiler, @value{GDBN} can map from
-+the running program back to constructs from your original source.
-+
-+@value{GDBN} is more accurate with optimization disabled.  If you
-+can recompile without optimization, it is easier to follow the
-+progress of your program during debugging.  But, there are many cases
-+where you may need to debug an optimized version.
-+
-+When you debug a program compiled with @samp{-g -O}, remember that the
-+optimizer has rearranged your code; the debugger shows you what is
-+really there.  Do not be too surprised when the execution path does not
-+exactly match your source file!  An extreme example: if you define a
-+variable, but never use it, @value{GDBN} never sees that
-+variable---because the compiler optimizes it out of existence.
-+
-+Some things do not work as well with @samp{-g -O} as with just
-+@samp{-g}, particularly on machines with instruction scheduling.  If in
-+doubt, recompile with @samp{-g} alone, and if this fixes the problem,
-+please report it to us as a bug (including a test case!).
-+@xref{Variables}, for more information about debugging optimized code.
-+
-+@menu
-+* Inline Functions::            How @value{GDBN} presents inlining
-+@end menu
-+
-+@node Inline Functions
-+@section Inline Functions
-+@cindex inline functions, debugging
-+
-+@dfn{Inlining} is an optimization that inserts a copy of the function
-+body directly at each call site, instead of jumping to a shared
-+routine.  @value{GDBN} displays inlined functions just like
-+non-inlined functions.  They appear in backtraces.  You can view their
-+arguments and local variables, step into them with @code{step}, skip
-+them with @code{next}, and escape from them with @code{finish}.
-+You can check whether a function was inlined by using the
-+@code{info frame} command.
-+
-+For @value{GDBN} to support inlined functions, the compiler must
-+record information about inlining in the debug information ---
-+@value{NGCC} using the @sc{dwarf 2} format does this, and several
-+other compilers do also.  @value{GDBN} only supports inlined functions
-+when using @sc{dwarf 2}.  Versions of @value{NGCC} before 4.1
-+do not emit two required attributes (@samp{DW_AT_call_file} and
-+@samp{DW_AT_call_line}); @value{GDBN} does not display inlined
-+function calls with earlier versions of @value{NGCC}.  It instead
-+displays the arguments and local variables of inlined functions as
-+local variables in the caller.
-+
-+The body of an inlined function is directly included at its call site;
-+unlike a non-inlined function, there are no instructions devoted to
-+the call.  @value{GDBN} still pretends that the call site and the
-+start of the inlined function are different instructions.  Stepping to
-+the call site shows the call site, and then stepping again shows
-+the first line of the inlined function, even though no additional
-+instructions are executed.
-+
-+This makes source-level debugging much clearer; you can see both the
-+context of the call and then the effect of the call.  Only stepping by
-+a single instruction using @code{stepi} or @code{nexti} does not do
-+this; single instruction steps always show the inlined body.
-+
-+There are some ways that @value{GDBN} does not pretend that inlined
-+function calls are the same as normal calls:
-+
-+@itemize @bullet
-+@item
-+You cannot set breakpoints on inlined functions.  @value{GDBN}
-+either reports that there is no symbol with that name, or else sets the
-+breakpoint only on non-inlined copies of the function.  This limitation
-+will be removed in a future version of @value{GDBN}; until then,
-+set a breakpoint by line number on the first line of the inlined
-+function instead.
-+
-+@item
-+Setting breakpoints at the call site of an inlined function may not
-+work, because the call site does not contain any code.  @value{GDBN}
-+may incorrectly move the breakpoint to the next line of the enclosing
-+function, after the call.  This limitation will be removed in a future
-+version of @value{GDBN}; until then, set a breakpoint on an earlier line
-+or inside the inlined function instead.
-+
-+@item
-+@value{GDBN} cannot locate the return value of inlined calls after
-+using the @code{finish} command.  This is a limitation of compiler-generated
-+debugging information; after @code{finish}, you can step to the next line
-+and print a variable where your program stored the return value.
-+
-+@end itemize
-+
-+
- @node Macros
- @chapter C Preprocessor Macros
-Index: gdb-6.8.50.20090302/gdb/dwarf2loc.c
-===================================================================
---- gdb-6.8.50.20090302.orig/gdb/dwarf2loc.c   2009-03-21 21:06:02.000000000 +0100
-+++ gdb-6.8.50.20090302/gdb/dwarf2loc.c        2009-03-21 21:06:16.000000000 +0100
-@@ -31,6 +31,7 @@
- #include "regcache.h"
- #include "objfiles.h"
- #include "exceptions.h"
-+#include "block.h"
- #include "elf/dwarf2.h"
- #include "dwarf2expr.h"
-@@ -150,7 +151,10 @@ dwarf_expr_frame_base (void *baton, gdb_
-   struct symbol *framefunc;
-   struct dwarf_expr_baton *debaton = (struct dwarf_expr_baton *) baton;
--  framefunc = get_frame_function (debaton->frame);
-+  /* Use block_linkage_function, which returns a real (not inlined)
-+     function, instead of get_frame_function, which may return an
-+     inlined function.  */
-+  framefunc = block_linkage_function (get_frame_block (debaton->frame, NULL));
-   /* If we found a frame-relative symbol then it was certainly within
-      some function associated with a frame. If we can't find the frame,
-Index: gdb-6.8.50.20090302/gdb/dwarf2read.c
-===================================================================
---- gdb-6.8.50.20090302.orig/gdb/dwarf2read.c  2009-03-21 21:06:04.000000000 +0100
-+++ gdb-6.8.50.20090302/gdb/dwarf2read.c       2009-03-21 21:06:16.000000000 +0100
-@@ -50,6 +50,7 @@
- #include "c-lang.h"
- #include "typeprint.h"
- #include "top.h"
-+#include "block.h"
- #include <fcntl.h>
- #include "gdb_string.h"
-@@ -2984,12 +2985,8 @@ process_die (struct die_info *die, struc
-       read_file_scope (die, cu);
-       break;
-     case DW_TAG_subprogram:
--      read_func_scope (die, cu);
--      break;
-     case DW_TAG_inlined_subroutine:
--      /* FIXME:  These are ignored for now.
--         They could be used to set breakpoints on all inlined instances
--         of a function and make GDB `next' properly over inlined functions.  */
-+      read_func_scope (die, cu);
-       break;
-     case DW_TAG_lexical_block:
-     case DW_TAG_try_block:
-@@ -3464,6 +3461,22 @@ read_func_scope (struct die_info *die, s
-   CORE_ADDR baseaddr;
-   struct block *block;
-   unsigned die_children = 0;
-+  struct attribute *call_line, *call_file;
-+  int inlined_func = (die->tag == DW_TAG_inlined_subroutine);
-+
-+  if (inlined_func)
-+    {
-+      /* If we do not have call site information, we can't show the
-+       caller of this inlined function.  That's too confusing, so
-+       only use the scope for local variables.  */
-+      call_line = dwarf2_attr (die, DW_AT_call_line, cu);
-+      call_file = dwarf2_attr (die, DW_AT_call_file, cu);
-+      if (call_line == NULL || call_file == NULL)
-+      {
-+        read_lexical_block_scope (die, cu);
-+        return;
-+      }
-+    }
-   baseaddr = ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile));
-@@ -7524,6 +7537,9 @@ die_specification (struct die_info *die,
-                                            *spec_cu);
-   if (spec_attr == NULL)
-+    spec_attr = dwarf2_attr (die, DW_AT_abstract_origin, *spec_cu);
-+
-+  if (spec_attr == NULL)
-     return NULL;
-   else
-     return follow_die_ref (die, spec_attr, spec_cu);
-@@ -8207,6 +8223,7 @@ new_symbol (struct die_info *die, struct
-   struct attribute *attr = NULL;
-   struct attribute *attr2 = NULL;
-   CORE_ADDR baseaddr;
-+  int inlined_func = (die->tag == DW_TAG_inlined_subroutine);
-   baseaddr = ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile));
-@@ -8257,13 +8274,17 @@ new_symbol (struct die_info *die, struct
-       SYMBOL_TYPE (sym) = type;
-       else
-       SYMBOL_TYPE (sym) = die_type (die, cu);
--      attr = dwarf2_attr (die, DW_AT_decl_line, cu);
-+      attr = dwarf2_attr (die,
-+                        inlined_func ? DW_AT_call_line : DW_AT_decl_line,
-+                        cu);
-       if (attr)
-       {
-         SYMBOL_LINE (sym) = DW_UNSND (attr);
-       }
--      attr = dwarf2_attr (die, DW_AT_decl_file, cu);
-+      attr = dwarf2_attr (die,
-+                        inlined_func ? DW_AT_call_file : DW_AT_decl_file,
-+                        cu);
-       if (attr)
-       {
-         int file_index = DW_UNSND (attr);
-@@ -8310,6 +8331,14 @@ new_symbol (struct die_info *die, struct
-             add_symbol_to_list (sym, cu->list_in_scope);
-           }
-         break;
-+      case DW_TAG_inlined_subroutine:
-+        /* SYMBOL_BLOCK_VALUE (sym) will be filled in later by
-+           finish_block.  */
-+        SYMBOL_CLASS (sym) = LOC_BLOCK;
-+        SYMBOL_INLINED (sym) = 1;
-+        /* Do not add the symbol to any lists.  It will be found via
-+           BLOCK_FUNCTION from the blockvector.  */
-+        break;
-       case DW_TAG_variable:
-         /* Compilation with minimal debug info may result in variables
-            with missing type entries. Change the misleading `void' type
-@@ -8365,7 +8394,14 @@ new_symbol (struct die_info *die, struct
-           }
-         break;
-       case DW_TAG_formal_parameter:
--        SYMBOL_IS_ARGUMENT (sym) = 1;
-+        /* If we are inside a function, mark this as an argument.  If
-+           not, we might be looking at an argument to an inlined function
-+           when we do not have enough information to show inlined frames;
-+           pretend it's a local variable in that case so that the user can
-+           still see it.  */
-+        if (context_stack_depth > 0
-+            && context_stack[context_stack_depth - 1].name != NULL)
-+          SYMBOL_IS_ARGUMENT (sym) = 1;
-         attr = dwarf2_attr (die, DW_AT_location, cu);
-         if (attr)
-           {
-Index: gdb-6.8.50.20090302/gdb/frame-unwind.c
-===================================================================
---- gdb-6.8.50.20090302.orig/gdb/frame-unwind.c        2009-01-03 06:57:51.000000000 +0100
-+++ gdb-6.8.50.20090302/gdb/frame-unwind.c     2009-03-21 21:06:16.000000000 +0100
-@@ -21,6 +21,7 @@
- #include "frame.h"
- #include "frame-unwind.h"
- #include "dummy-frame.h"
-+#include "inline-frame.h"
- #include "value.h"
- #include "regcache.h"
-@@ -51,8 +52,10 @@ frame_unwind_init (struct obstack *obsta
-      can't override this.  */
-   table->list = OBSTACK_ZALLOC (obstack, struct frame_unwind_table_entry);
-   table->list->unwinder = dummy_frame_unwind;
-+  table->list->next = OBSTACK_ZALLOC (obstack, struct frame_unwind_table_entry);
-+  table->list->next->unwinder = inline_frame_unwind;
-   /* The insertion point for OSABI sniffers.  */
--  table->osabi_head = &table->list->next;
-+  table->osabi_head = &table->list->next->next;
-   return table;
- }
-Index: gdb-6.8.50.20090302/gdb/frame.c
-===================================================================
---- gdb-6.8.50.20090302.orig/gdb/frame.c       2009-03-21 21:06:03.000000000 +0100
-+++ gdb-6.8.50.20090302/gdb/frame.c    2009-03-21 21:06:16.000000000 +0100
-@@ -41,8 +41,14 @@
- #include "objfiles.h"
- #include "exceptions.h"
- #include "gdbthread.h"
-+#include "block.h"
-+#include "inline-frame.h"
- static struct frame_info *get_prev_frame_1 (struct frame_info *this_frame);
-+static struct frame_info *get_prev_frame_raw (struct frame_info *this_frame);
-+
-+static void deprecated_update_frame_pc_hack (struct frame_info *frame,
-+                                           CORE_ADDR pc);
- /* We keep a cache of stack frames, each of which is a "struct
-    frame_info".  The innermost one gets allocated (in
-@@ -183,6 +189,8 @@ fprint_frame_id (struct ui_file *file, s
-   fprint_field (file, "code", id.code_addr_p, id.code_addr);
-   fprintf_unfiltered (file, ",");
-   fprint_field (file, "special", id.special_addr_p, id.special_addr);
-+  if (id.inline_depth)
-+    fprintf_unfiltered (file, ",inlined=%d", id.inline_depth);
-   fprintf_unfiltered (file, "}");
- }
-@@ -197,6 +205,12 @@ fprint_frame_type (struct ui_file *file,
-     case DUMMY_FRAME:
-       fprintf_unfiltered (file, "DUMMY_FRAME");
-       return;
-+    case INLINE_FRAME:
-+      fprintf_unfiltered (file, "INLINE_FRAME");
-+      return;
-+    case SENTINEL_FRAME:
-+      fprintf_unfiltered (file, "SENTINEL_FRAME");
-+      return;
-     case SIGTRAMP_FRAME:
-       fprintf_unfiltered (file, "SIGTRAMP_FRAME");
-       return;
-@@ -249,6 +263,18 @@ fprint_frame (struct ui_file *file, stru
-   fprintf_unfiltered (file, "}");
- }
-+/* Given FRAME, return the enclosing normal frame for inlined
-+   function frames.  Otherwise return the original frame.  */
-+
-+static struct frame_info *
-+skip_inlined_frames (struct frame_info *frame)
-+{
-+  while (get_frame_type (frame) == INLINE_FRAME)
-+    frame = get_prev_frame (frame);
-+
-+  return frame;
-+}
-+
- /* Return a frame uniq ID that can be used to, later, re-find the
-    frame.  */
-@@ -281,13 +307,21 @@ get_frame_id (struct frame_info *fi)
- }
- struct frame_id
-+get_stack_frame_id (struct frame_info *next_frame)
-+{
-+  return get_frame_id (skip_inlined_frames (next_frame));
-+}
-+
-+struct frame_id
- frame_unwind_id (struct frame_info *next_frame)
- {
-   /* Use prev_frame, and not get_prev_frame.  The latter will truncate
-      the frame chain, leading to this function unintentionally
-      returning a null_frame_id (e.g., when a caller requests the frame
-      ID of "main()"s caller.  */
--  return get_frame_id (get_prev_frame_1 (next_frame));
-+
-+  next_frame = skip_inlined_frames (next_frame);
-+  return get_frame_id (skip_inlined_frames (get_prev_frame_1 (next_frame)));
- }
- const struct frame_id null_frame_id; /* All zeros.  */
-@@ -342,6 +376,15 @@ frame_id_p (struct frame_id l)
- }
- int
-+frame_id_inlined_p (struct frame_id l)
-+{
-+  if (!frame_id_p (l))
-+    return 0;
-+
-+  return (l.inline_depth != 0);
-+}
-+
-+int
- frame_id_eq (struct frame_id l, struct frame_id r)
- {
-   int eq;
-@@ -352,21 +395,22 @@ frame_id_eq (struct frame_id l, struct f
-   else if (l.stack_addr != r.stack_addr)
-     /* If .stack addresses are different, the frames are different.  */
-     eq = 0;
--  else if (!l.code_addr_p || !r.code_addr_p)
--    /* An invalid code addr is a wild card, always succeed.  */
--    eq = 1;
--  else if (l.code_addr != r.code_addr)
--    /* If .code addresses are different, the frames are different.  */
-+  else if (l.code_addr_p && r.code_addr_p && l.code_addr != r.code_addr)
-+    /* An invalid code addr is a wild card.  If .code addresses are
-+       different, the frames are different.  */
-     eq = 0;
--  else if (!l.special_addr_p || !r.special_addr_p)
--    /* An invalid special addr is a wild card (or unused), always succeed.  */
--    eq = 1;
--  else if (l.special_addr == r.special_addr)
-+  else if (l.special_addr_p && r.special_addr_p
-+         && l.special_addr != r.special_addr)
-+    /* An invalid special addr is a wild card (or unused).  Otherwise
-+       if special addresses are different, the frames are different.  */
-+    eq = 0;
-+  else if (l.inline_depth != r.inline_depth)
-+    /* If inline depths are different, the frames must be different.  */
-+    eq = 0;
-+  else
-     /* Frames are equal.  */
-     eq = 1;
--  else
--    /* No luck.  */
--    eq = 0;
-+
-   if (frame_debug)
-     {
-       fprintf_unfiltered (gdb_stdlog, "{ frame_id_eq (l=");
-@@ -411,6 +455,29 @@ frame_id_inner (struct gdbarch *gdbarch,
-   if (!l.stack_addr_p || !r.stack_addr_p)
-     /* Like NaN, any operation involving an invalid ID always fails.  */
-     inner = 0;
-+  else if (l.inline_depth > r.inline_depth
-+         && l.stack_addr == r.stack_addr
-+         && l.code_addr_p == r.code_addr_p
-+         && l.special_addr_p == r.special_addr_p
-+         && l.special_addr == r.special_addr)
-+    {
-+      /* Same function, different inlined functions.  */
-+      struct block *lb, *rb;
-+
-+      gdb_assert (l.code_addr_p && r.code_addr_p);
-+
-+      lb = block_for_pc (l.code_addr);
-+      rb = block_for_pc (r.code_addr);
-+
-+      if (lb == NULL || rb == NULL)
-+      /* Something's gone wrong.  */
-+      inner = 0;
-+      else
-+      /* This will return true if LB and RB are the same block, or
-+         if the block with the smaller depth lexically encloses the
-+         block with the greater depth.  */
-+      inner = contained_in (lb, rb);
-+    }
-   else
-     /* Only return non-zero when strictly inner than.  Note that, per
-        comment in "frame.h", there is some fuzz here.  Frameless
-@@ -463,8 +530,8 @@ frame_find_by_id (struct frame_id id)
-   return NULL;
- }
--CORE_ADDR
--frame_pc_unwind (struct frame_info *this_frame)
-+static CORE_ADDR
-+frame_unwind_pc (struct frame_info *this_frame)
- {
-   if (!this_frame->prev_pc.p)
-     {
-@@ -503,6 +570,12 @@ frame_pc_unwind (struct frame_info *this
- }
- CORE_ADDR
-+frame_pc_unwind (struct frame_info *this_frame)
-+{
-+  return frame_unwind_pc (skip_inlined_frames (this_frame));
-+}
-+
-+CORE_ADDR
- get_frame_func (struct frame_info *this_frame)
- {
-   struct frame_info *next_frame = this_frame->next;
-@@ -1226,7 +1299,6 @@ frame_register_unwind_location (struct f
- static struct frame_info *
- get_prev_frame_1 (struct frame_info *this_frame)
- {
--  struct frame_info *prev_frame;
-   struct frame_id this_id;
-   struct gdbarch *gdbarch;
-@@ -1266,6 +1338,14 @@ get_prev_frame_1 (struct frame_info *thi
-   this_frame->prev_p = 1;
-   this_frame->stop_reason = UNWIND_NO_REASON;
-+  /* If we are unwinding from an inline frame, all of the below tests
-+     were already performed when we unwound from the next non-inline
-+     frame.  We must skip them, since we can not get THIS_FRAME's ID
-+     until we have unwound all the way down to the previous non-inline
-+     frame.  */
-+  if (get_frame_type (this_frame) == INLINE_FRAME)
-+    return get_prev_frame_raw (this_frame);
-+
-   /* Check that this frame's ID was valid.  If it wasn't, don't try to
-      unwind to the prev frame.  Be careful to not apply this test to
-      the sentinel frame.  */
-@@ -1333,7 +1413,8 @@ get_prev_frame_1 (struct frame_info *thi
-   if (this_frame->level > 0
-       && gdbarch_pc_regnum (gdbarch) >= 0
-       && get_frame_type (this_frame) == NORMAL_FRAME
--      && get_frame_type (this_frame->next) == NORMAL_FRAME)
-+      && (get_frame_type (this_frame->next) == NORMAL_FRAME
-+        || get_frame_type (this_frame->next) == INLINE_FRAME))
-     {
-       int optimized, realnum, nrealnum;
-       enum lval_type lval, nlval;
-@@ -1362,6 +1443,17 @@ get_prev_frame_1 (struct frame_info *thi
-       }
-     }
-+  return get_prev_frame_raw (this_frame);
-+}
-+
-+/* Construct a new "struct frame_info" and link it previous to
-+   this_frame.  */
-+
-+static struct frame_info *
-+get_prev_frame_raw (struct frame_info *this_frame)
-+{
-+  struct frame_info *prev_frame;
-+
-   /* Allocate the new frame but do not wire it in to the frame chain.
-      Some (bad) code in INIT_FRAME_EXTRA_INFO tries to look along
-      frame->next to pull some fancy tricks (of course such code is, by
-@@ -1484,7 +1576,7 @@ get_prev_frame (struct frame_info *this_
-      the main function when we created the dummy frame, the dummy frame will 
-      point inside the main function.  */
-   if (this_frame->level >= 0
--      && get_frame_type (this_frame) != DUMMY_FRAME
-+      && get_frame_type (this_frame) == NORMAL_FRAME
-       && !backtrace_past_main
-       && inside_main_func (this_frame))
-     /* Don't unwind past main().  Note, this is done _before_ the
-@@ -1529,8 +1621,9 @@ get_prev_frame (struct frame_info *this_
-      from main returns directly to the caller of main.  Since we don't
-      stop at main, we should at least stop at the entry point of the
-      application.  */
--  if (!backtrace_past_entry
--      && get_frame_type (this_frame) != DUMMY_FRAME && this_frame->level >= 0
-+  if (this_frame->level >= 0
-+      && get_frame_type (this_frame) == NORMAL_FRAME
-+      && !backtrace_past_entry
-       && inside_entry_func (this_frame))
-     {
-       frame_debug_got_null_frame (this_frame, "inside entry func");
-@@ -1541,7 +1634,8 @@ get_prev_frame (struct frame_info *this_
-      like a SIGSEGV or a dummy frame, and hence that NORMAL frames
-      will never unwind a zero PC.  */
-   if (this_frame->level > 0
--      && get_frame_type (this_frame) == NORMAL_FRAME
-+      && (get_frame_type (this_frame) == NORMAL_FRAME
-+        || get_frame_type (this_frame) == INLINE_FRAME)
-       && get_frame_type (get_next_frame (this_frame)) == NORMAL_FRAME
-       && get_frame_pc (this_frame) == 0)
-     {
-@@ -1566,7 +1660,7 @@ CORE_ADDR
- get_frame_pc (struct frame_info *frame)
- {
-   gdb_assert (frame->next != NULL);
--  return frame_pc_unwind (frame->next);
-+  return frame_unwind_pc (frame->next);
- }
- /* Return an address that falls within THIS_FRAME's code block.  */
-@@ -1611,17 +1705,58 @@ get_frame_address_in_block (struct frame
-      We check the type of NEXT_FRAME first, since it is already
-      known; frame type is determined by the unwinder, and since
-      we have THIS_FRAME we've already selected an unwinder for
--     NEXT_FRAME.  */
-+     NEXT_FRAME.
-+
-+     If the next frame is inlined, we need to keep going until we find
-+     the real function - for instance, if a signal handler is invoked
-+     while in an inlined function, then the code address of the
-+     "calling" normal function should not be adjusted either.  */
-+
-+  while (get_frame_type (next_frame) == INLINE_FRAME)
-+    next_frame = next_frame->next;
-+
-   if (get_frame_type (next_frame) == NORMAL_FRAME
--      && get_frame_type (this_frame) == NORMAL_FRAME)
-+      && (get_frame_type (this_frame) == NORMAL_FRAME
-+        || get_frame_type (this_frame) == INLINE_FRAME))
-     return pc - 1;
-   return pc;
- }
--static int
--pc_notcurrent (struct frame_info *frame)
-+void
-+find_frame_sal (struct frame_info *frame, struct symtab_and_line *sal)
- {
-+  struct frame_info *next_frame;
-+  int notcurrent;
-+
-+  /* If the next frame represents an inlined function call, this frame's
-+     sal is the "call site" of that inlined function, which can not
-+     be inferred from get_frame_pc.  */
-+  next_frame = get_next_frame (frame);
-+  if (frame_inlined_callees (frame) > 0)
-+    {
-+      struct symbol *sym;
-+
-+      if (next_frame)
-+      sym = get_frame_function (next_frame);
-+      else
-+      sym = inline_skipped_symbol (inferior_ptid);
-+
-+      init_sal (sal);
-+      if (SYMBOL_LINE (sym) != 0)
-+      {
-+        sal->symtab = SYMBOL_SYMTAB (sym);
-+        sal->line = SYMBOL_LINE (sym);
-+      }
-+      else
-+      /* If the symbol does not have a location, we don't know where
-+         the call site is.  Do not pretend to.  This is jarring, but
-+         we can't do much better.  */
-+      sal->pc = get_frame_pc (frame);
-+
-+      return;
-+    }
-+
-   /* If FRAME is not the innermost frame, that normally means that
-      FRAME->pc points at the return instruction (which is *after* the
-      call instruction), and we want to get the line containing the
-@@ -1631,15 +1766,8 @@ pc_notcurrent (struct frame_info *frame)
-      PC and such a PC indicates the current (rather than next)
-      instruction/line, consequently, for such cases, want to get the
-      line containing fi->pc.  */
--  struct frame_info *next = get_next_frame (frame);
--  int notcurrent = (next != NULL && get_frame_type (next) == NORMAL_FRAME);
--  return notcurrent;
--}
--
--void
--find_frame_sal (struct frame_info *frame, struct symtab_and_line *sal)
--{
--  (*sal) = find_pc_line (get_frame_pc (frame), pc_notcurrent (frame));
-+  notcurrent = (get_frame_pc (frame) != get_frame_address_in_block (frame));
-+  (*sal) = find_pc_line (get_frame_pc (frame), notcurrent);
- }
- /* Per "frame.h", return the ``address'' of the frame.  Code should
-Index: gdb-6.8.50.20090302/gdb/frame.h
-===================================================================
---- gdb-6.8.50.20090302.orig/gdb/frame.h       2009-02-05 18:28:20.000000000 +0100
-+++ gdb-6.8.50.20090302/gdb/frame.h    2009-03-21 21:06:16.000000000 +0100
-@@ -34,6 +34,9 @@
-    frame_unwind_WHAT...(): Unwind THIS frame's WHAT from the NEXT
-    frame.
-+   get_stack_frame_WHAT...(): Get WHAT for THIS frame, but if THIS is
-+   inlined, skip to the containing stack frame.
-+
-    put_frame_WHAT...(): Put a value into this frame (unsafe, need to
-    invalidate the frame / regcache afterwards) (better name more
-    strongly hinting at its unsafeness)
-@@ -101,6 +104,10 @@ struct frame_id
-      Typically, it is set to the address of the entry point of the
-      frame's function (as returned by get_frame_func).
-+     For inlined functions (INLINE_DEPTH != 0), this is the address of
-+     the first executed instruction in the block corresponding to the
-+     inlined function.
-+
-      This field is valid only if code_addr_p is true.  Otherwise, this
-      frame is considered to have a wildcard code address, i.e. one that
-      matches every address value in frame comparisons.  */
-@@ -122,6 +129,10 @@ struct frame_id
-   unsigned int stack_addr_p : 1;
-   unsigned int code_addr_p : 1;
-   unsigned int special_addr_p : 1;
-+
-+  /* The inline depth of this frame.  A frame representing a "called"
-+     inlined function will have this set to a nonzero value.  */
-+  int inline_depth;
- };
- /* Methods for constructing and comparing Frame IDs.  */
-@@ -157,6 +168,10 @@ extern struct frame_id frame_id_build_wi
-    non-zero .base).  */
- extern int frame_id_p (struct frame_id l);
-+/* Returns non-zero when L is a valid frame representing an inlined
-+   function.  */
-+extern int frame_id_inlined_p (struct frame_id l);
-+
- /* Returns non-zero when L and R identify the same frame, or, if
-    either L or R have a zero .func, then the same frame base.  */
- extern int frame_id_eq (struct frame_id l, struct frame_id r);
-@@ -177,6 +192,9 @@ enum frame_type
-   /* A fake frame, created by GDB when performing an inferior function
-      call.  */
-   DUMMY_FRAME,
-+  /* A frame representing an inlined function, associated with an
-+     upcoming (next, inner, younger) NORMAL_FRAME.  */
-+  INLINE_FRAME,
-   /* In a signal handler, various OSs handle this in various ways.
-      The main thing is that the frame may be far from normal.  */
-   SIGTRAMP_FRAME,
-@@ -345,6 +363,7 @@ extern CORE_ADDR get_frame_base (struct 
-    instead, since that avoids the bug.  */
- extern struct frame_id get_frame_id (struct frame_info *fi);
-+extern struct frame_id get_stack_frame_id (struct frame_info *fi);
- extern struct frame_id frame_unwind_id (struct frame_info *next_frame);
- /* Assuming that a frame is `normal', return its base-address, or 0 if
-Index: gdb-6.8.50.20090302/gdb/gdbthread.h
-===================================================================
---- gdb-6.8.50.20090302.orig/gdb/gdbthread.h   2009-03-21 21:06:02.000000000 +0100
-+++ gdb-6.8.50.20090302/gdb/gdbthread.h        2009-03-21 21:06:16.000000000 +0100
-@@ -83,6 +83,13 @@ struct thread_info
-      This is how we know when we step into a subroutine call, and how
-      to set the frame for the breakpoint used to step out.  */
-   struct frame_id step_frame_id;
-+
-+  /* Similarly, the frame ID of the underlying stack frame (skipping any
-+     inlined frames).  */
-+  struct frame_id step_stack_frame_id;
-+
-+  /* The source file and line at the beginning of the current step
-+     operation.  Only valid when step_frame_id is set.  */
-   int current_line;
-   struct symtab *current_symtab;
-Index: gdb-6.8.50.20090302/gdb/infcall.c
-===================================================================
---- gdb-6.8.50.20090302.orig/gdb/infcall.c     2009-03-21 21:06:02.000000000 +0100
-+++ gdb-6.8.50.20090302/gdb/infcall.c  2009-03-21 21:06:16.000000000 +0100
-@@ -898,15 +898,8 @@ The program being debugged exited while 
-         if (unwind_on_signal_p)
-           {
--            /* The user wants the context restored. */
--
--            /* We must get back to the frame we were before the
--               dummy call.  */
--            dummy_frame_pop (dummy_id);
--
--            /* We also need to restore inferior status to that before the
--               dummy call.  */
--            restore_inferior_status (inf_status);
-+            /* The user wants the context restored.  Calling error will
-+               run inf_status_cleanup, which does all the work.  */
-             /* FIXME: Insert a bunch of wrap_here; name can be very
-                long if it's a C++ name with arguments and stuff.  */
-Index: gdb-6.8.50.20090302/gdb/infcmd.c
-===================================================================
---- gdb-6.8.50.20090302.orig/gdb/infcmd.c      2009-03-21 21:06:02.000000000 +0100
-+++ gdb-6.8.50.20090302/gdb/infcmd.c   2009-03-21 21:06:16.000000000 +0100
-@@ -52,6 +52,7 @@
- #include "cli/cli-decode.h"
- #include "gdbthread.h"
- #include "valprint.h"
-+#include "inline-frame.h"
- /* Functions exported for general use, in inferior.h: */
-@@ -744,6 +745,17 @@ Can't resume all threads and specify pro
-   continue_1 (all_threads);
- }
\f
-+/* Record the starting point of a "step" or "next" command.  */
-+
-+static void
-+set_step_frame (struct thread_info *tp)
-+{
-+  struct symtab_and_line sal;
-+
-+  find_frame_sal (get_current_frame (), &sal);
-+  set_step_info (tp, get_current_frame (), sal);
-+}
-+
- /* Step until outside of current statement.  */
- static void
-@@ -921,6 +933,20 @@ step_once (int skip_subroutines, int sin
-        THREAD is set.  */
-       struct thread_info *tp = inferior_thread ();
-       clear_proceed_status ();
-+      set_step_frame (tp);
-+
-+      /* Step at an inlined function behaves like "down".  */
-+      if (!skip_subroutines && !single_inst
-+        && inline_skipped_frames (inferior_ptid))
-+      {
-+        step_into_inline_frame (inferior_ptid);
-+        if (count > 1)
-+          step_once (skip_subroutines, single_inst, count - 1, thread);
-+        else
-+          /* Pretend that we've stopped.  */
-+          normal_stop ();
-+        return;
-+      }
-       frame = get_current_frame ();
-       tp->step_frame_id = get_frame_id (frame);
-@@ -1173,6 +1199,7 @@ until_next_command (int from_tty)
-   clear_proceed_status ();
-   frame = get_current_frame ();
-+  set_step_frame (tp);
-   /* Step until either exited from this function or greater
-      than the current line (if in symbolic section) or pc (if
-@@ -1200,7 +1227,6 @@ until_next_command (int from_tty)
-     }
-   tp->step_over_calls = STEP_OVER_ALL;
--  tp->step_frame_id = get_frame_id (frame);
-   tp->step_multi = 0;         /* Only one call to proceed */
-@@ -1533,6 +1559,37 @@ finish_command (char *arg, int from_tty)
-   clear_proceed_status ();
-+  /* Finishing from an inline frame is completely different.  We don't
-+     try to show the "return value" - no way to locate it.  So we do
-+     not need a completion.  */
-+  if (get_frame_type (get_selected_frame (_("No selected frame.")))
-+      == INLINE_FRAME)
-+    {
-+      struct thread_info *tp = inferior_thread ();
-+
-+      /* Claim we are stepping in the calling frame.  An empty step
-+       range means that we will stop once we aren't in a function
-+       called by that frame.  We don't use the magic "1" value for
-+       step_range_end, because then infrun will think this is nexti,
-+       and not step over the rest of this inlined function call.  */
-+      struct symtab_and_line empty_sal;
-+      init_sal (&empty_sal);
-+      set_step_info (tp, frame, empty_sal);
-+      tp->step_range_start = tp->step_range_end = get_frame_pc (frame);
-+      tp->step_over_calls = STEP_OVER_ALL;
-+
-+      /* Print info on the selected frame, including level number but not
-+       source.  */
-+      if (from_tty)
-+      {
-+        printf_filtered (_("Run till exit from "));
-+        print_stack_frame (get_selected_frame (NULL), 1, LOCATION);
-+      }
-+
-+      proceed ((CORE_ADDR) -1, TARGET_SIGNAL_DEFAULT, 1);
-+      return;
-+    }
-+
-   /* Find the function we will return from.  */
-   function = find_pc_function (get_frame_pc (get_selected_frame (NULL)));
-Index: gdb-6.8.50.20090302/gdb/inferior.h
-===================================================================
---- gdb-6.8.50.20090302.orig/gdb/inferior.h    2009-03-21 21:06:02.000000000 +0100
-+++ gdb-6.8.50.20090302/gdb/inferior.h 2009-03-21 21:06:16.000000000 +0100
-@@ -259,6 +259,9 @@ extern void error_is_running (void);
- /* Calls error_is_running if the current thread is running.  */
- extern void ensure_not_running (void);
-+void set_step_info (struct thread_info *tp, struct frame_info *frame,
-+                  struct symtab_and_line sal);
-+
- /* From infcmd.c */
- extern void tty_command (char *, int);
-Index: gdb-6.8.50.20090302/gdb/infrun.c
-===================================================================
---- gdb-6.8.50.20090302.orig/gdb/infrun.c      2009-03-21 21:06:04.000000000 +0100
-+++ gdb-6.8.50.20090302/gdb/infrun.c   2009-03-21 21:06:16.000000000 +0100
-@@ -48,6 +48,7 @@
- #include "gdb_assert.h"
- #include "mi/mi-common.h"
- #include "event-top.h"
-+#include "inline-frame.h"
- /* Prototypes for local functions */
-@@ -205,7 +206,7 @@ static unsigned char *signal_program;
- /* Value to pass to target_resume() to cause all threads to resume */
--#define RESUME_ALL (pid_to_ptid (-1))
-+#define RESUME_ALL minus_one_ptid
- /* Command list pointer for the "stop" placeholder.  */
-@@ -1151,6 +1152,8 @@ a command like `return' or `jump' to con
-           step = 0;
-       }
-+      clear_inline_frame_state (resume_ptid);
-+
-       if (debug_displaced
-           && use_displaced_stepping (gdbarch)
-           && tp->trap_expected)
-@@ -1192,6 +1195,7 @@ clear_proceed_status_thread (struct thre
-   tp->step_range_start = 0;
-   tp->step_range_end = 0;
-   tp->step_frame_id = null_frame_id;
-+  tp->step_stack_frame_id = null_frame_id;
-   tp->step_over_calls = STEP_OVER_UNDEBUGGABLE;
-   tp->stop_requested = 0;
-@@ -1536,6 +1540,9 @@ init_wait_for_inferior (void)
-   init_infwait_state ();
-   displaced_step_clear ();
-+
-+  /* Discard any skipped inlined frames.  */
-+  clear_inline_frame_state (minus_one_ptid);
- }
\f
-@@ -1591,7 +1598,7 @@ struct execution_control_state
-   int wait_some_more;
- };
--void init_execution_control_state (struct execution_control_state *ecs);
-+static void init_execution_control_state (struct execution_control_state *ecs);
- void handle_inferior_event (struct execution_control_state *ecs);
-@@ -1975,10 +1982,21 @@ fetch_inferior_event (void *client_data)
-     display_gdb_prompt (0);
- }
-+/* Record the frame and location we're currently stepping through.  */
-+void
-+set_step_info (struct thread_info *tp, struct frame_info *frame,
-+             struct symtab_and_line sal)
-+{
-+  tp->step_frame_id = get_frame_id (frame);
-+  tp->step_stack_frame_id = get_stack_frame_id (frame);
-+  tp->current_symtab = sal.symtab;
-+  tp->current_line = sal.line;
-+}
-+
- /* Prepare an execution control state for looping through a
-    wait_for_inferior-type loop.  */
--void
-+static void
- init_execution_control_state (struct execution_control_state *ecs)
- {
-   ecs->random_signal = 0;
-@@ -1989,16 +2007,10 @@ init_execution_control_state (struct exe
- void
- init_thread_stepping_state (struct thread_info *tss)
- {
--  struct symtab_and_line sal;
--
-   tss->stepping_over_breakpoint = 0;
-   tss->step_after_step_resume_breakpoint = 0;
-   tss->stepping_through_solib_after_catch = 0;
-   tss->stepping_through_solib_catchpoints = NULL;
--
--  sal = find_pc_line (tss->prev_pc, 0);
--  tss->current_line = sal.line;
--  tss->current_symtab = sal.symtab;
- }
- /* Return the cached copy of the last pid/waitstatus returned by
-@@ -2212,6 +2224,22 @@ deal_with_syscall_event (struct executio
-     }
- }
-+static int
-+stepped_in_from (struct frame_info *frame, struct frame_id step_frame_id)
-+{
-+  for (frame = get_prev_frame (frame);
-+       frame != NULL;
-+       frame = get_prev_frame (frame))
-+    {
-+      if (frame_id_eq (get_frame_id (frame), step_frame_id))
-+      return 1;
-+      if (get_frame_type (frame) != INLINE_FRAME)
-+      break;
-+    }
-+
-+  return 0;
-+}
-+
- /* Given an execution control state that has been freshly filled in
-    by an event from the inferior, figure out what it means and take
-    appropriate action.  */
-@@ -2906,6 +2934,12 @@ targets should add new threads to the th
-   ecs->random_signal = 0;
-   stopped_by_random_signal = 0;
-+  /* Hide inlined functions starting here, unless we just performed stepi or
-+     nexti.  After stepi and nexti, always show the innermost frame (not any
-+     inline function call sites).  */
-+  if (ecs->event_thread->step_range_end != 1)
-+    skip_inline_frames (ecs->ptid);
-+
-   if (ecs->event_thread->stop_signal == TARGET_SIGNAL_TRAP
-       && ecs->event_thread->trap_expected
-       && gdbarch_single_step_through_delay_p (current_gdbarch)
-@@ -3138,8 +3172,8 @@ process_event_stop_test:
-         && ecs->event_thread->stop_signal != TARGET_SIGNAL_0
-         && (ecs->event_thread->step_range_start <= stop_pc
-             && stop_pc < ecs->event_thread->step_range_end)
--        && frame_id_eq (get_frame_id (get_current_frame ()),
--                        ecs->event_thread->step_frame_id)
-+        && frame_id_eq (get_stack_frame_id (get_current_frame ()),
-+                        ecs->event_thread->step_stack_frame_id)
-         && ecs->event_thread->step_resume_breakpoint == NULL)
-       {
-         /* The inferior is about to take a signal that will take it
-@@ -3525,10 +3559,10 @@ infrun: BPSTAT_WHAT_SET_LONGJMP_RESUME (
-      NOTE: frame_id_eq will never report two invalid frame IDs as
-      being equal, so to get into this block, both the current and
-      previous frame must have valid frame IDs.  */
--  if (!frame_id_eq (get_frame_id (get_current_frame ()),
--                  ecs->event_thread->step_frame_id)
-+  if (!frame_id_eq (get_stack_frame_id (get_current_frame ()),
-+                  ecs->event_thread->step_stack_frame_id)
-       && (frame_id_eq (frame_unwind_id (get_current_frame ()),
--                     ecs->event_thread->step_frame_id)
-+                     ecs->event_thread->step_stack_frame_id)
-         || execution_direction == EXEC_REVERSE))
-     {
-       CORE_ADDR real_stop_pc;
-@@ -3771,6 +3805,82 @@ infrun: BPSTAT_WHAT_SET_LONGJMP_RESUME (
-       return;
-     }
-+  /* Look for "calls" to inlined functions, part one.  If the inline
-+     frame machinery detected some skipped call sites, we have entered
-+     a new inline function.  */
-+
-+  if (frame_id_eq (get_frame_id (get_current_frame ()),
-+                 ecs->event_thread->step_frame_id)
-+      && inline_skipped_frames (ecs->ptid))
-+    {
-+      struct symtab_and_line call_sal;
-+
-+      if (debug_infrun)
-+      fprintf_unfiltered (gdb_stdlog,
-+                          "infrun: stepped into inlined function\n");
-+
-+      find_frame_sal (get_current_frame (), &call_sal);
-+
-+      if (ecs->event_thread->step_over_calls != STEP_OVER_ALL)
-+      {
-+        /* For "step", we're going to stop.  But if the call site
-+           for this inlined function is on the same source line as
-+           we were previously stepping, go down into the function
-+           first.  Otherwise stop at the call site.  */
-+
-+        if (call_sal.line == ecs->event_thread->current_line
-+            && call_sal.symtab == ecs->event_thread->current_symtab)
-+          step_into_inline_frame (ecs->ptid);
-+
-+        ecs->event_thread->stop_step = 1;
-+        print_stop_reason (END_STEPPING_RANGE, 0);
-+        stop_stepping (ecs);
-+        return;
-+      }
-+      else
-+      {
-+        /* For "next", we should stop at the call site if it is on a
-+           different source line.  Otherwise continue through the
-+           inlined function.  */
-+        if (call_sal.line == ecs->event_thread->current_line
-+            && call_sal.symtab == ecs->event_thread->current_symtab)
-+          keep_going (ecs);
-+        else
-+          {
-+            ecs->event_thread->stop_step = 1;
-+            print_stop_reason (END_STEPPING_RANGE, 0);
-+            stop_stepping (ecs);
-+          }
-+        return;
-+      }
-+    }
-+
-+  /* Look for "calls" to inlined functions, part two.  If we are still
-+     in the same real function we were stepping through, but we have
-+     to go further up to find the exact frame ID, we are stepping
-+     through a more inlined call beyond its call site.  */
-+
-+  if (get_frame_type (get_current_frame ()) == INLINE_FRAME
-+      && !frame_id_eq (get_frame_id (get_current_frame ()),
-+                     ecs->event_thread->step_frame_id)
-+      && stepped_in_from (get_current_frame (),
-+                        ecs->event_thread->step_frame_id))
-+    {
-+      if (debug_infrun)
-+      fprintf_unfiltered (gdb_stdlog,
-+                          "infrun: stepping through inlined function\n");
-+
-+      if (ecs->event_thread->step_over_calls == STEP_OVER_ALL)
-+      keep_going (ecs);
-+      else
-+      {
-+        ecs->event_thread->stop_step = 1;
-+        print_stop_reason (END_STEPPING_RANGE, 0);
-+        stop_stepping (ecs);
-+      }
-+      return;
-+    }
-+
-   if ((stop_pc == stop_pc_sal.pc)
-       && (ecs->event_thread->current_line != stop_pc_sal.line
-         || ecs->event_thread->current_symtab != stop_pc_sal.symtab))
-@@ -3796,9 +3906,7 @@ infrun: BPSTAT_WHAT_SET_LONGJMP_RESUME (
-   ecs->event_thread->step_range_start = stop_pc_sal.pc;
-   ecs->event_thread->step_range_end = stop_pc_sal.end;
--  ecs->event_thread->step_frame_id = get_frame_id (get_current_frame ());
--  ecs->event_thread->current_line = stop_pc_sal.line;
--  ecs->event_thread->current_symtab = stop_pc_sal.symtab;
-+  set_step_info (ecs->event_thread, get_current_frame (), stop_pc_sal);
-   if (debug_infrun)
-      fprintf_unfiltered (gdb_stdlog, "infrun: keep going\n");
-@@ -5050,6 +5158,7 @@ struct inferior_status
-   CORE_ADDR step_range_start;
-   CORE_ADDR step_range_end;
-   struct frame_id step_frame_id;
-+  struct frame_id step_stack_frame_id;
-   enum step_over_calls_kind step_over_calls;
-   CORE_ADDR step_resume_break_address;
-   int stop_after_trap;
-@@ -5079,6 +5188,7 @@ save_inferior_status (void)
-   inf_status->step_range_start = tp->step_range_start;
-   inf_status->step_range_end = tp->step_range_end;
-   inf_status->step_frame_id = tp->step_frame_id;
-+  inf_status->step_stack_frame_id = tp->step_stack_frame_id;
-   inf_status->step_over_calls = tp->step_over_calls;
-   inf_status->stop_after_trap = stop_after_trap;
-   inf_status->stop_soon = inf->stop_soon;
-@@ -5132,6 +5242,7 @@ restore_inferior_status (struct inferior
-   tp->step_range_start = inf_status->step_range_start;
-   tp->step_range_end = inf_status->step_range_end;
-   tp->step_frame_id = inf_status->step_frame_id;
-+  tp->step_stack_frame_id = inf_status->step_stack_frame_id;
-   tp->step_over_calls = inf_status->step_over_calls;
-   stop_after_trap = inf_status->stop_after_trap;
-   inf->stop_soon = inf_status->stop_soon;
-Index: gdb-6.8.50.20090302/gdb/inline-frame.c
-===================================================================
---- /dev/null  1970-01-01 00:00:00.000000000 +0000
-+++ gdb-6.8.50.20090302/gdb/inline-frame.c     2009-03-21 21:06:16.000000000 +0100
-@@ -0,0 +1,382 @@
-+/* Inline frame unwinder for GDB.
-+
-+   Copyright (C) 2008 Free Software Foundation, Inc.
-+
-+   This file is part of GDB.
-+
-+   This program is free software; you can redistribute it and/or modify
-+   it under the terms of the GNU General Public License as published by
-+   the Free Software Foundation; either version 3 of the License, or
-+   (at your option) any later version.
-+
-+   This program is distributed in the hope that it will be useful,
-+   but WITHOUT ANY WARRANTY; without even the implied warranty of
-+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-+   GNU General Public License for more details.
-+
-+   You should have received a copy of the GNU General Public License
-+   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
-+
-+#include "defs.h"
-+#include "addrmap.h"
-+#include "block.h"
-+#include "frame-unwind.h"
-+#include "inferior.h"
-+#include "symtab.h"
-+#include "vec.h"
-+
-+#include "gdb_assert.h"
-+
-+/* We need to save a few variables for every thread stopped at the
-+   virtual call site of an inlined function.  If there was always a
-+   "struct thread_info", we could hang it off that; in the mean time,
-+   keep our own list.  */
-+struct inline_state
-+{
-+  /* The thread this data relates to.  It should be a currently
-+     stopped thread; we assume thread IDs never change while the
-+     thread is stopped.  */
-+  ptid_t ptid;
-+
-+  /* The number of inlined functions we are skipping.  Each of these
-+     functions can be stepped in to.  */
-+  int skipped_frames;
-+
-+  /* Only valid if SKIPPED_FRAMES is non-zero.  This is the PC used
-+     when calculating SKIPPED_FRAMES; used to check whether we have
-+     moved to a new location by user request.  If so, we invalidate
-+     any skipped frames.  */
-+  CORE_ADDR saved_pc;
-+
-+  /* Only valid if SKIPPED_FRAMES is non-zero.  This is the symbol
-+     of the outermost skipped inline function.  It's used to find the
-+     call site of the current frame.  */
-+  struct symbol *skipped_symbol;
-+};
-+
-+typedef struct inline_state inline_state_s;
-+DEF_VEC_O(inline_state_s);
-+
-+static VEC(inline_state_s) *inline_states;
-+
-+/* Locate saved inlined frame state for PTID, if it exists.  */
-+
-+static struct inline_state *
-+find_inline_frame_state (ptid_t ptid)
-+{
-+  struct inline_state *state;
-+  int ix;
-+
-+  for (ix = 0; VEC_iterate (inline_state_s, inline_states, ix, state); ix++)
-+    {
-+      if (ptid_equal (state->ptid, ptid))
-+      return state;
-+    }
-+
-+  return NULL;
-+}
-+
-+/* Allocate saved inlined frame state for PTID.  */
-+
-+static struct inline_state *
-+allocate_inline_frame_state (ptid_t ptid)
-+{
-+  struct inline_state *state;
-+
-+  state = VEC_safe_push (inline_state_s, inline_states, NULL);
-+  memset (state, 0, sizeof (*state));
-+  state->ptid = ptid;
-+
-+  return state;
-+}
-+
-+/* Forget about any hidden inlined functions in PTID, which is new or
-+   about to be resumed.  If PTID is minus_one_ptid, forget about all
-+   hidden inlined functions.  */
-+
-+void
-+clear_inline_frame_state (ptid_t ptid)
-+{
-+  struct inline_state *state;
-+  int ix;
-+
-+  if (ptid_equal (ptid, minus_one_ptid))
-+    {
-+      VEC_free (inline_state_s, inline_states);
-+      return;
-+    }
-+
-+  for (ix = 0; VEC_iterate (inline_state_s, inline_states, ix, state); ix++)
-+    if (ptid_equal (state->ptid, ptid))
-+      {
-+      VEC_unordered_remove (inline_state_s, inline_states, ix);
-+      return;
-+      }
-+}
-+
-+static void
-+inline_frame_this_id (struct frame_info *this_frame,
-+                    void **this_cache,
-+                    struct frame_id *this_id)
-+{
-+  struct symbol *func;
-+
-+  /* In order to have a stable frame ID for a given inline function,
-+     we must get the stack / special addresses from the underlying
-+     real frame's this_id method.  So we must call get_prev_frame.
-+     Because we are inlined into some function, there must be previous
-+     frames, so this is safe - as long as we're careful not to
-+     create any cycles.  */
-+  *this_id = get_frame_id (get_prev_frame (this_frame));
-+
-+  /* We need a valid frame ID, so we need to be based on a valid
-+     frame.  FSF submission NOTE: this would be a good assertion to
-+     apply to all frames, all the time.  That would fix the ambiguity
-+     of null_frame_id (between "no/any frame" and "the outermost
-+     frame").  This will take work.  */
-+  gdb_assert (frame_id_p (*this_id));
-+
-+  /* Future work NOTE: Alexandre Oliva applied a patch to GCC 4.3
-+     which generates DW_AT_entry_pc for inlined functions when
-+     possible.  If this attribute is available, we should use it
-+     in the frame ID (and eventually, to set breakpoints).  */
-+  func = get_frame_function (this_frame);
-+  gdb_assert (func != NULL);
-+  (*this_id).code_addr = BLOCK_START (SYMBOL_BLOCK_VALUE (func));
-+  (*this_id).inline_depth++;
-+}
-+
-+static struct value *
-+inline_frame_prev_register (struct frame_info *this_frame, void **this_cache,
-+                          int regnum)
-+{
-+  /* Use get_frame_register_value instead of
-+     frame_unwind_got_register, to avoid requiring this frame's ID.
-+     This frame's ID depends on the previous frame's ID (unusual), and
-+     the previous frame's ID depends on this frame's unwound
-+     registers.  If unwinding registers from this frame called
-+     get_frame_id, there would be a loop.
-+
-+     Do not copy this code into any other unwinder!  Inlined functions
-+     are special; other unwinders must not have a dependency on the
-+     previous frame's ID, and therefore can and should use
-+     frame_unwind_got_register instead.  */
-+  return get_frame_register_value (this_frame, regnum);
-+}
-+
-+/* Check whether we are at an inlining site that does not already
-+   have an associated frame.  */
-+
-+static int
-+inline_frame_sniffer (const struct frame_unwind *self,
-+                    struct frame_info *this_frame,
-+                    void **this_cache)
-+{
-+  CORE_ADDR this_pc;
-+  struct block *frame_block, *cur_block;
-+  int depth;
-+  struct frame_info *next_frame;
-+  struct inline_state *state = find_inline_frame_state (inferior_ptid);
-+
-+  this_pc = get_frame_address_in_block (this_frame);
-+  frame_block = block_for_pc (this_pc);
-+  if (frame_block == NULL)
-+    return 0;
-+
-+  /* Calculate DEPTH, the number of inlined functions at this
-+     location.  */
-+  depth = 0;
-+  cur_block = frame_block;
-+  while (BLOCK_SUPERBLOCK (cur_block))
-+    {
-+      if (block_inlined_p (cur_block))
-+      depth++;
-+
-+      cur_block = BLOCK_SUPERBLOCK (cur_block);
-+    }
-+
-+  /* Check how many inlined functions already have frames.  */
-+  for (next_frame = get_next_frame (this_frame);
-+       next_frame && get_frame_type (next_frame) == INLINE_FRAME;
-+       next_frame = get_next_frame (next_frame))
-+    {
-+      gdb_assert (depth > 0);
-+      depth--;
-+    }
-+
-+  /* If this is the topmost frame, or all frames above us are inlined,
-+     then check whether we were requested to skip some frames (so they
-+     can be stepped into later).  */
-+  if (state != NULL && state->skipped_frames > 0 && next_frame == NULL)
-+    {
-+      if (this_pc != state->saved_pc)
-+      state->skipped_frames = 0;
-+      else
-+      {
-+        gdb_assert (depth >= state->skipped_frames);
-+        depth -= state->skipped_frames;
-+      }
-+    }
-+
-+  /* If all the inlined functions here already have frames, then pass
-+     to the normal unwinder for this PC.  */
-+  if (depth == 0)
-+    return 0;
-+
-+  /* If the next frame is an inlined function, but not the outermost, then
-+     we are the next outer.  If it is not an inlined function, then we
-+     are the innermost inlined function of a different real frame.  */
-+  return 1;
-+}
-+
-+const struct frame_unwind inline_frame_unwinder = {
-+  INLINE_FRAME,
-+  inline_frame_this_id,
-+  inline_frame_prev_register,
-+  NULL,
-+  inline_frame_sniffer
-+};
-+
-+const struct frame_unwind *const inline_frame_unwind = &inline_frame_unwinder;
-+
-+/* Return non-zero if BLOCK, an inlined function block containing PC,
-+   has a group of contiguous instructions starting at PC (but not
-+   before it).  */
-+
-+static int
-+block_starting_point_at (CORE_ADDR pc, struct block *block)
-+{
-+  struct blockvector *bv;
-+  struct block *new_block;
-+
-+  bv = blockvector_for_pc (pc, NULL);
-+  if (BLOCKVECTOR_MAP (bv) == NULL)
-+    return 0;
-+
-+  new_block = addrmap_find (BLOCKVECTOR_MAP (bv), pc - 1);
-+  if (new_block == NULL)
-+    return 1;
-+
-+  if (new_block == block || contained_in (new_block, block))
-+    return 0;
-+
-+  /* The immediately preceeding address belongs to a different block,
-+     which is not a child of this one.  Treat this as an entrance into
-+     BLOCK.  */
-+  return 1;
-+}
-+
-+/* Skip all inlined functions whose call sites are at the current PC.
-+   Frames for the hidden functions will not appear in the backtrace until the
-+   user steps into them.  */
-+
-+void
-+skip_inline_frames (ptid_t ptid)
-+{
-+  CORE_ADDR this_pc;
-+  struct block *frame_block, *cur_block;
-+  struct symbol *last_sym = NULL;
-+  int skip_count = 0;
-+  struct inline_state *state;
-+
-+  /* This function is called right after reinitializing the frame
-+     cache.  We try not to do more unwinding than absolutely
-+     necessary, for performance.  */
-+  this_pc = get_frame_pc (get_current_frame ());
-+  frame_block = block_for_pc (this_pc);
-+
-+  if (frame_block != NULL)
-+    {
-+      cur_block = frame_block;
-+      while (BLOCK_SUPERBLOCK (cur_block))
-+      {
-+        if (block_inlined_p (cur_block))
-+          {
-+            /* See comments in inline_frame_this_id about this use
-+               of BLOCK_START.  */
-+            if (BLOCK_START (cur_block) == this_pc
-+                || block_starting_point_at (this_pc, cur_block))
-+              {
-+                skip_count++;
-+                last_sym = BLOCK_FUNCTION (cur_block);
-+              }
-+            else
-+              break;
-+          }
-+        cur_block = BLOCK_SUPERBLOCK (cur_block);
-+      }
-+    }
-+
-+  gdb_assert (find_inline_frame_state (ptid) == NULL);
-+  state = allocate_inline_frame_state (ptid);
-+  state->skipped_frames = skip_count;
-+  state->saved_pc = this_pc;
-+  state->skipped_symbol = last_sym;
-+
-+  if (skip_count != 0)
-+    reinit_frame_cache ();
-+}
-+
-+/* Step into an inlined function by unhiding it.  */
-+
-+void
-+step_into_inline_frame (ptid_t ptid)
-+{
-+  struct inline_state *state = find_inline_frame_state (ptid);
-+
-+  gdb_assert (state != NULL && state->skipped_frames > 0);
-+  state->skipped_frames--;
-+  reinit_frame_cache ();
-+}
-+
-+/* Return the number of hidden functions inlined into the current
-+   frame.  */
-+
-+int
-+inline_skipped_frames (ptid_t ptid)
-+{
-+  struct inline_state *state = find_inline_frame_state (ptid);
-+
-+  if (state == NULL)
-+    return 0;
-+  else
-+    return state->skipped_frames;
-+}
-+
-+/* If one or more inlined functions are hidden, return the symbol for
-+   the function inlined into the current frame.  */
-+
-+struct symbol *
-+inline_skipped_symbol (ptid_t ptid)
-+{
-+  struct inline_state *state = find_inline_frame_state (ptid);
-+
-+  gdb_assert (state != NULL);
-+  return state->skipped_symbol;
-+}
-+
-+/* Return the number of functions inlined into THIS_FRAME.  Some of
-+   the callees may not have associated frames (see
-+   skip_inline_frames).  */
-+
-+int
-+frame_inlined_callees (struct frame_info *this_frame)
-+{
-+  struct frame_info *next_frame;
-+  int inline_count = 0;
-+
-+  /* First count how many inlined functions at this PC have frames
-+     above FRAME (are inlined into FRAME).  */
-+  for (next_frame = get_next_frame (this_frame);
-+       next_frame && get_frame_type (next_frame) == INLINE_FRAME;
-+       next_frame = get_next_frame (next_frame))
-+    inline_count++;
-+
-+  /* Simulate some most-inner inlined frames which were suppressed, so
-+     they can be stepped into later.  If we are unwinding already
-+     outer frames from some non-inlined frame this does not apply.  */
-+  if (next_frame == NULL)
-+    inline_count += inline_skipped_frames (inferior_ptid);
-+
-+  return inline_count;
-+}
-Index: gdb-6.8.50.20090302/gdb/inline-frame.h
-===================================================================
---- /dev/null  1970-01-01 00:00:00.000000000 +0000
-+++ gdb-6.8.50.20090302/gdb/inline-frame.h     2009-03-21 21:06:16.000000000 +0100
-@@ -0,0 +1,62 @@
-+/* Definitions for inline frame support.
-+
-+   Copyright (C) 2008 Free Software Foundation, Inc.
-+
-+   This file is part of GDB.
-+
-+   This program is free software; you can redistribute it and/or modify
-+   it under the terms of the GNU General Public License as published by
-+   the Free Software Foundation; either version 3 of the License, or
-+   (at your option) any later version.
-+
-+   This program is distributed in the hope that it will be useful,
-+   but WITHOUT ANY WARRANTY; without even the implied warranty of
-+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-+   GNU General Public License for more details.
-+
-+   You should have received a copy of the GNU General Public License
-+   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
-+
-+#if !defined (INLINE_FRAME_H)
-+#define INLINE_FRAME_H 1
-+
-+struct frame_info;
-+struct frame_unwind;
-+
-+/* The inline frame unwinder.  */
-+
-+extern const struct frame_unwind *const inline_frame_unwind;
-+
-+/* Skip all inlined functions whose call sites are at the current PC.
-+   Frames for the hidden functions will not appear in the backtrace until the
-+   user steps into them.  */
-+
-+void skip_inline_frames (ptid_t ptid);
-+
-+/* Forget about any hidden inlined functions in PTID, which is new or
-+   about to be resumed.  If PTID is minus_one_ptid, forget about all
-+   hidden inlined functions.  */
-+
-+void clear_inline_frame_state (ptid_t ptid);
-+
-+/* Step into an inlined function by unhiding it.  */
-+
-+void step_into_inline_frame (ptid_t ptid);
-+
-+/* Return the number of hidden functions inlined into the current
-+   frame.  */
-+
-+int inline_skipped_frames (ptid_t ptid);
-+
-+/* If one or more inlined functions are hidden, return the symbol for
-+   the function inlined into the current frame.  */
-+
-+struct symbol *inline_skipped_symbol (ptid_t ptid);
-+
-+/* Return the number of functions inlined into THIS_FRAME.  Some of
-+   the callees may not have associated frames (see
-+   skip_inline_frames).  */
-+
-+int frame_inlined_callees (struct frame_info *this_frame);
-+
-+#endif /* !defined (INLINE_FRAME_H) */
-Index: gdb-6.8.50.20090302/gdb/minsyms.c
-===================================================================
---- gdb-6.8.50.20090302.orig/gdb/minsyms.c     2009-03-21 21:06:03.000000000 +0100
-+++ gdb-6.8.50.20090302/gdb/minsyms.c  2009-03-21 21:06:16.000000000 +0100
-@@ -795,7 +795,7 @@ prim_record_minimal_symbol_and_info (con
-   if (msym_bunch_index == BUNCH_SIZE)
-     {
--      new = (struct msym_bunch *) xmalloc (sizeof (struct msym_bunch));
-+      new = XCALLOC (1, struct msym_bunch);
-       msym_bunch_index = 0;
-       new->next = msym_bunch;
-       msym_bunch = new;
-Index: gdb-6.8.50.20090302/gdb/s390-tdep.c
-===================================================================
---- gdb-6.8.50.20090302.orig/gdb/s390-tdep.c   2009-02-22 02:02:19.000000000 +0100
-+++ gdb-6.8.50.20090302/gdb/s390-tdep.c        2009-03-21 21:06:16.000000000 +0100
-@@ -1182,6 +1182,7 @@ s390_prologue_frame_unwind_cache (struct
-   CORE_ADDR prev_sp;
-   int frame_pointer;
-   int size;
-+  struct frame_info *next_frame;
-   /* Try to find the function start address.  If we can't find it, we don't
-      bother searching for it -- with modern compilers this would be mostly
-@@ -1215,7 +1216,10 @@ s390_prologue_frame_unwind_cache (struct
-       /* FIXME: cagney/2004-05-01: This sanity check shouldn't be
-        needed, instead the code should simpliy rely on its
-        analysis.  */
--      if (get_next_frame (this_frame)
-+      next_frame = get_next_frame (this_frame);
-+      while (next_frame && get_frame_type (next_frame) == INLINE_FRAME)
-+      next_frame = get_next_frame (next_frame);
-+      if (next_frame
-         && get_frame_type (get_next_frame (this_frame)) == NORMAL_FRAME)
-       return 0;
-@@ -1261,8 +1265,11 @@ s390_prologue_frame_unwind_cache (struct
-      This can only happen in an innermost frame.  */
-   /* FIXME: cagney/2004-05-01: This sanity check shouldn't be needed,
-      instead the code should simpliy rely on its analysis.  */
-+  next_frame = get_next_frame (this_frame);
-+  while (next_frame && get_frame_type (next_frame) == INLINE_FRAME)
-+    next_frame = get_next_frame (next_frame);
-   if (size > 0
--      && (!get_next_frame (this_frame)
-+      && (next_frame == NULL
-         || get_frame_type (get_next_frame (this_frame)) != NORMAL_FRAME))
-     {
-       /* See the comment in s390_in_function_epilogue_p on why this is
-Index: gdb-6.8.50.20090302/gdb/stack.c
-===================================================================
---- gdb-6.8.50.20090302.orig/gdb/stack.c       2009-03-21 21:06:02.000000000 +0100
-+++ gdb-6.8.50.20090302/gdb/stack.c    2009-03-21 21:06:16.000000000 +0100
-@@ -45,6 +45,7 @@
- #include "valprint.h"
- #include "gdbthread.h"
- #include "cp-support.h"
-+#include "inline-frame.h"
- #include "gdb_assert.h"
- #include <ctype.h>
-@@ -98,6 +99,30 @@ print_stack_frame_stub (void *args)
-   return 0;
- }
-+/* Return 1 if we should display the address in addition to the location,
-+   because we are in the middle of a statement.  */
-+
-+static int
-+frame_show_address (struct frame_info *frame,
-+                  struct symtab_and_line sal)
-+{
-+  /* If there is a line number, but no PC, then there is no location
-+     information associated with this sal.  The only way that should
-+     happen is for the call sites of inlined functions (SAL comes from
-+     find_frame_sal).  Otherwise, we would have some PC range if the
-+     SAL came from a line table.  */
-+  if (sal.line != 0 && sal.pc == 0 && sal.end == 0)
-+    {
-+      if (get_next_frame (frame) == NULL)
-+      gdb_assert (inline_skipped_frames (inferior_ptid) > 0);
-+      else
-+      gdb_assert (get_frame_type (get_next_frame (frame)) == INLINE_FRAME);
-+      return 0;
-+    }
-+
-+  return get_frame_pc (frame) != sal.pc;
-+}
-+
- /* Show or print a stack frame FRAME briefly.  The output is format
-    according to PRINT_LEVEL and PRINT_WHAT printing the frame's
-    relative level, function name, argument list, and file name and
-@@ -538,7 +563,7 @@ print_frame_info (struct frame_info *fra
-     {
-       int done = 0;
-       int mid_statement = ((print_what == SRC_LINE)
--                         && (get_frame_pc (frame) != sal.pc));
-+                         && frame_show_address (frame, sal));
-       if (annotation_level)
-       done = identify_source_line (sal.symtab, sal.line, mid_statement,
-@@ -591,7 +616,7 @@ find_frame_funname (struct frame_info *f
-   *funname = NULL;
-   *funlang = language_unknown;
--  func = find_pc_function (get_frame_address_in_block (frame));
-+  func = get_frame_function (frame);
-   if (func)
-     {
-       /* In certain pathological cases, the symtabs give the wrong
-@@ -612,8 +637,13 @@ find_frame_funname (struct frame_info *f
-          changed (and we'll create a find_pc_minimal_function or some
-          such).  */
--      struct minimal_symbol *msymbol =
--      lookup_minimal_symbol_by_pc (get_frame_address_in_block (frame));
-+      struct minimal_symbol *msymbol = NULL;
-+
-+      /* Don't attempt to do this for inlined functions, which do not
-+       have a corresponding minimal symbol.  */
-+      if (!block_inlined_p (SYMBOL_BLOCK_VALUE (func)))
-+      msymbol
-+        = lookup_minimal_symbol_by_pc (get_frame_address_in_block (frame));
-       if (msymbol != NULL
-         && (SYMBOL_VALUE_ADDRESS (msymbol)
-@@ -687,7 +717,7 @@ print_frame (struct frame_info *frame, i
-     }
-   get_user_print_options (&opts);
-   if (opts.addressprint)
--    if (get_frame_pc (frame) != sal.pc || !sal.symtab
-+    if (frame_show_address (frame, sal) || !sal.symtab
-       || print_what == LOC_AND_ADDRESS)
-       {
-       annotate_frame_address ();
-@@ -867,8 +897,16 @@ parse_frame_specification_1 (const char 
-       {
-         if (frame_id_eq (id, get_frame_id (fid)))
-           {
--            while (frame_id_eq (id, frame_unwind_id (fid)))
--              fid = get_prev_frame (fid);
-+            struct frame_info *prev_frame;
-+
-+            while (1)
-+              {
-+                prev_frame = get_prev_frame (fid);
-+                if (!prev_frame
-+                    || !frame_id_eq (id, get_frame_id (prev_frame)))
-+                  break;
-+                fid = prev_frame;
-+              }
-             return fid;
-           }
-       }
-@@ -1002,8 +1040,10 @@ frame_info (char *addr_exp, int from_tty
-       printf_filtered (_(" Outermost frame: %s\n"),
-                        frame_stop_reason_string (reason));
-     }
--
--  if (calling_frame_info)
-+  else if (get_frame_type (fi) == INLINE_FRAME)
-+    printf_filtered (" inlined into frame %d",
-+                   frame_relative_level (get_prev_frame (fi)));
-+  else
-     {
-       printf_filtered (" called by frame at ");
-       fputs_filtered (paddress (get_frame_base (calling_frame_info)),
-@@ -1465,7 +1505,9 @@ print_frame_local_vars (struct frame_inf
-       if (print_block_frame_locals (block, frame, num_tabs, stream))
-       values_printed = 1;
-       /* After handling the function's top-level block, stop.  Don't
--         continue to its superblock, the block of per-file symbols.  */
-+         continue to its superblock, the block of per-file symbols.
-+         Also do not continue to the containing function of an inlined
-+         function.  */
-       if (BLOCK_FUNCTION (block))
-       break;
-       block = BLOCK_SUPERBLOCK (block);
-@@ -1536,7 +1578,9 @@ print_frame_label_vars (struct frame_inf
-       return;
-       /* After handling the function's top-level block, stop.  Don't
--         continue to its superblock, the block of per-file symbols.  */
-+         continue to its superblock, the block of per-file symbols.
-+         Also do not continue to the containing function of an inlined
-+         function.  */
-       if (BLOCK_FUNCTION (block))
-       break;
-       block = BLOCK_SUPERBLOCK (block);
-@@ -1806,6 +1850,9 @@ return_command (char *retval_exp, int fr
-   thisframe = get_selected_frame ("No selected frame.");
-   thisfun = get_frame_function (thisframe);
-+  if (get_frame_type (get_current_frame ()) == INLINE_FRAME)
-+    error (_("Can not force return from an inlined function."));
-+
-   /* Compute the return value.  If the computation triggers an error,
-      let it bail.  If the return type can't be handled, set
-      RETURN_VALUE to NULL, and QUERY_PREFIX to an informational
-Index: gdb-6.8.50.20090302/gdb/symtab.c
-===================================================================
---- gdb-6.8.50.20090302.orig/gdb/symtab.c      2009-03-21 21:06:03.000000000 +0100
-+++ gdb-6.8.50.20090302/gdb/symtab.c   2009-03-21 21:06:49.000000000 +0100
-@@ -1417,11 +1417,14 @@ lookup_symbol_aux_local (const char *nam
-       sym = lookup_symbol_aux_block (name, linkage_name, block_iterator, domain);
-       if (sym != NULL)
-       return sym;
-+
-+      if (BLOCK_FUNCTION (block) != NULL && block_inlined_p (block))
-+      break;
-     
-       block_iterator = BLOCK_SUPERBLOCK (block_iterator);
-     }
--  /* We've reached the global block without finding a result.  */
-+  /* We've reached the edge of the function without finding a result.  */
-   return NULL;
- }
-@@ -2678,6 +2681,7 @@ find_function_start_sal (struct symbol *
-   CORE_ADDR pc;
-   struct symtab_and_line sal;
-+  struct block *b, *function_block;
-   pc = BLOCK_START (block);
-   fixup_symbol_section (sym, objfile);
-@@ -2716,6 +2720,25 @@ find_function_start_sal (struct symbol *
-   sal.pc = pc;
-+  /* Check if we are now inside an inlined function.  If we can,
-+     use the call site of the function instead.  */
-+  b = block_for_pc_sect (sal.pc, SYMBOL_OBJ_SECTION (sym));
-+  function_block = NULL;
-+  while (b != NULL)
-+    {
-+      if (BLOCK_FUNCTION (b) != NULL && block_inlined_p (b))
-+      function_block = b;
-+      else if (BLOCK_FUNCTION (b) != NULL)
-+      break;
-+      b = BLOCK_SUPERBLOCK (b);
-+    }
-+  if (function_block != NULL
-+      && SYMBOL_LINE (BLOCK_FUNCTION (function_block)) != 0)
-+    {
-+      sal.line = SYMBOL_LINE (BLOCK_FUNCTION (function_block));
-+      sal.symtab = SYMBOL_SYMTAB (BLOCK_FUNCTION (function_block));
-+    }
-+
-   return sal;
- }
-@@ -3738,6 +3761,24 @@ add_macro_name (const char *name, const 
-                           datum->text, datum->word);
- }
-+static void
-+completion_list_add_fields (struct symbol *sym, char *sym_text,
-+                          int sym_text_len, char *text, char *word)
-+{
-+  if (SYMBOL_CLASS (sym) == LOC_TYPEDEF)
-+    {
-+      struct type *t = SYMBOL_TYPE (sym);
-+      enum type_code c = TYPE_CODE (t);
-+      int j;
-+
-+      if (c == TYPE_CODE_UNION || c == TYPE_CODE_STRUCT)
-+      for (j = TYPE_N_BASECLASSES (t); j < TYPE_NFIELDS (t); j++)
-+        if (TYPE_FIELD_NAME (t, j))
-+          completion_list_add_name (TYPE_FIELD_NAME (t, j),
-+                                    sym_text, sym_text_len, text, word);
-+    }
-+}
-+
- char **
- default_make_symbol_completion_list (char *text, char *word)
- {
-@@ -3750,9 +3791,9 @@ default_make_symbol_completion_list (cha
-   struct partial_symtab *ps;
-   struct minimal_symbol *msymbol;
-   struct objfile *objfile;
--  struct block *b, *surrounding_static_block = 0;
-+  struct block *b;
-+  const struct block *surrounding_static_block, *surrounding_global_block;
-   struct dict_iterator iter;
--  int j;
-   struct partial_symbol **psym;
-   /* The symbol we are completing on.  Points in same buffer as text.  */
-   char *sym_text;
-@@ -3862,41 +3903,43 @@ default_make_symbol_completion_list (cha
-   }
-   /* Search upwards from currently selected frame (so that we can
--     complete on local vars.  */
-+     complete on local vars).  Also catch fields of types defined in
-+     this places which match our text string.  Only complete on types
-+     visible from current context. */
-+
-+  b = get_selected_block (0);
-+  surrounding_static_block = block_static_block (b);
-+  surrounding_global_block = block_global_block (b);
-+  if (surrounding_static_block != NULL)
-+    while (b != surrounding_static_block)
-+      {
-+      QUIT;
--  for (b = get_selected_block (0); b != NULL; b = BLOCK_SUPERBLOCK (b))
--    {
--      if (!BLOCK_SUPERBLOCK (b))
--      {
--        surrounding_static_block = b;         /* For elmin of dups */
--      }
-+      ALL_BLOCK_SYMBOLS (b, iter, sym)
-+        {
-+          COMPLETION_LIST_ADD_SYMBOL (sym, sym_text, sym_text_len, text,
-+                                      word);
-+          completion_list_add_fields (sym, sym_text, sym_text_len, text,
-+                                      word);
-+        }
--      /* Also catch fields of types defined in this places which match our
--         text string.  Only complete on types visible from current context. */
-+      /* Stop when we encounter an enclosing function.  Do not stop for
-+         non-inlined functions - the locals of the enclosing function
-+         are in scope for a nested function.  */
-+      if (BLOCK_FUNCTION (b) != NULL && block_inlined_p (b))
-+        break;
-+      b = BLOCK_SUPERBLOCK (b);
-+      }
--      ALL_BLOCK_SYMBOLS (b, iter, sym)
--      {
--        QUIT;
--        COMPLETION_LIST_ADD_SYMBOL (sym, sym_text, sym_text_len, text, word);
--        if (SYMBOL_CLASS (sym) == LOC_TYPEDEF)
--          {
--            struct type *t = SYMBOL_TYPE (sym);
--            enum type_code c = TYPE_CODE (t);
-+  /* Add fields from the file's types; symbols will be added below.  */
--            if (c == TYPE_CODE_UNION || c == TYPE_CODE_STRUCT)
--              {
--                for (j = TYPE_N_BASECLASSES (t); j < TYPE_NFIELDS (t); j++)
--                  {
--                    if (TYPE_FIELD_NAME (t, j))
--                      {
--                        completion_list_add_name (TYPE_FIELD_NAME (t, j),
--                                      sym_text, sym_text_len, text, word);
--                      }
--                  }
--              }
--          }
--      }
--    }
-+  if (surrounding_static_block != NULL)
-+    ALL_BLOCK_SYMBOLS (surrounding_static_block, iter, sym)
-+      completion_list_add_fields (sym, sym_text, sym_text_len, text, word);
-+
-+  if (surrounding_global_block != NULL)
-+      ALL_BLOCK_SYMBOLS (surrounding_global_block, iter, sym)
-+      completion_list_add_fields (sym, sym_text, sym_text_len, text, word);
-   /* Go through the symtabs and check the externs and statics for
-      symbols which match.  */
-@@ -3915,9 +3958,6 @@ default_make_symbol_completion_list (cha
-   {
-     QUIT;
-     b = BLOCKVECTOR_BLOCK (BLOCKVECTOR (s), STATIC_BLOCK);
--    /* Don't do this block twice.  */
--    if (b == surrounding_static_block)
--      continue;
-     ALL_BLOCK_SYMBOLS (b, iter, sym)
-       {
-       COMPLETION_LIST_ADD_SYMBOL (sym, sym_text, sym_text_len, text, word);
-@@ -4384,6 +4424,25 @@ skip_prologue_using_sal (CORE_ADDR func_
-            line mark the prologue -> body transition.  */
-         if (sal.line >= prologue_sal.line)
-           break;
-+
-+        /* The line number is smaller.  Check that it's from the
-+           same function, not something inlined.  If it's inlined,
-+           then there is no point comparing the line numbers.  */
-+        bl = block_for_pc (prologue_sal.end);
-+        while (bl)
-+          {
-+            if (block_inlined_p (bl))
-+              break;
-+            if (BLOCK_FUNCTION (bl))
-+              {
-+                bl = NULL;
-+                break;
-+              }
-+            bl = BLOCK_SUPERBLOCK (bl);
-+          }
-+        if (bl != NULL)
-+          break;
-+
-         /* The case in which compiler's optimizer/scheduler has
-            moved instructions into the prologue.  We look ahead in
-            the function looking for address ranges whose
-Index: gdb-6.8.50.20090302/gdb/symtab.h
-===================================================================
---- gdb-6.8.50.20090302.orig/gdb/symtab.h      2009-03-21 21:06:02.000000000 +0100
-+++ gdb-6.8.50.20090302/gdb/symtab.h   2009-03-21 21:06:16.000000000 +0100
-@@ -556,9 +556,18 @@ struct symbol
-   unsigned is_argument : 1;
--  /* Line number of definition.  FIXME:  Should we really make the assumption
--     that nobody will try to debug files longer than 64K lines?  What about
--     machine generated programs? */
-+  /* Whether this is an inlined function (class LOC_BLOCK only).  */
-+  unsigned is_inlined : 1;
-+
-+  /* Line number of this symbol's definition, except for inlined
-+     functions.  For an inlined function (class LOC_BLOCK and
-+     SYMBOL_INLINED set) this is the line number of the function's call
-+     site.  Inlined function symbols are not definitions, and they are
-+     never found by symbol table lookup.
-+
-+     FIXME: Should we really make the assumption that nobody will try
-+     to debug files longer than 64K lines?  What about machine
-+     generated programs?  */
-   unsigned short line;
-@@ -589,6 +598,7 @@ struct symbol
- #define SYMBOL_DOMAIN(symbol) (symbol)->domain
- #define SYMBOL_CLASS(symbol)          (symbol)->aclass
- #define SYMBOL_IS_ARGUMENT(symbol)    (symbol)->is_argument
-+#define SYMBOL_INLINED(symbol)                (symbol)->is_inlined
- #define SYMBOL_TYPE(symbol)           (symbol)->type
- #define SYMBOL_LINE(symbol)           (symbol)->line
- #define SYMBOL_SYMTAB(symbol)         (symbol)->symtab
-Index: gdb-6.8.50.20090302/gdb/testsuite/gdb.base/break.exp
-===================================================================
---- gdb-6.8.50.20090302.orig/gdb/testsuite/gdb.base/break.exp  2009-01-19 20:05:01.000000000 +0100
-+++ gdb-6.8.50.20090302/gdb/testsuite/gdb.base/break.exp       2009-03-21 21:06:16.000000000 +0100
-@@ -880,6 +880,13 @@ gdb_expect {
-         # marker4() is defined at line 46 when compiled with -DPROTOTYPES
-       pass "run until breakpoint set at small function, optimized file (line bp_location14)"
-     }
-+    -re "Breakpoint $decimal, factorial \\(.*\\) .*\{\r\n$gdb_prompt" {
-+      # GCC 4.3 emits bad line number information - see gcc/36748.
-+      if { [test_compiler_info "gcc-4-3-*"] } {
-+          setup_xfail *-*-*
-+      }
-+      fail "run until breakpoint set at small function, optimized file"
-+    }
-     -re ".*$gdb_prompt " {
-       fail "run until breakpoint set at small function, optimized file"
-     }
-Index: gdb-6.8.50.20090302/gdb/testsuite/gdb.cp/annota2.exp
-===================================================================
---- gdb-6.8.50.20090302.orig/gdb/testsuite/gdb.cp/annota2.exp  2009-01-03 06:58:04.000000000 +0100
-+++ gdb-6.8.50.20090302/gdb/testsuite/gdb.cp/annota2.exp       2009-03-21 21:06:16.000000000 +0100
-@@ -119,10 +119,11 @@ gdb_expect {
- # continue until exit
- # this will test:
- # annotate-exited
-+# `a.x is 1' is asynchronous regarding to `frames-invalid'.
- #
- send_gdb "continue\n"
- gdb_expect {
--  -re "\r\n\032\032post-prompt\r\nContinuing.\r\n\r\n\032\032starting\r\n\r\n\032\032frames-invalid\r\na.x is 1\r\n\r\n\032\032exited 0\r\n\r\nProgram exited normally.\r\n\r\n\032\032stopped\r\n$gdb_prompt$" \
-+  -re "\r\n\032\032post-prompt\r\nContinuing.\r\n\r\n\032\032starting\r\n(\r\n\032\032frames-invalid\r\n)*a.x is 1\r\n(\r\n\032\032frames-invalid\r\n)*\r\n\032\032exited 0\r\n\r\nProgram exited normally.\r\n\r\n\032\032stopped\r\n$gdb_prompt$" \
-         { pass "continue until exit" }
-   -re ".*$gdb_prompt$"     { fail "continue to exit" }
-   timeout                 { fail "continue to exit (timeout)" }
-Index: gdb-6.8.50.20090302/gdb/testsuite/gdb.opt/inline-bt.c
-===================================================================
---- /dev/null  1970-01-01 00:00:00.000000000 +0000
-+++ gdb-6.8.50.20090302/gdb/testsuite/gdb.opt/inline-bt.c      2009-03-21 21:06:16.000000000 +0100
-@@ -0,0 +1,47 @@
-+/* Copyright (C) 2008 Free Software Foundation, Inc.
-+
-+   This program is free software; you can redistribute it and/or modify
-+   it under the terms of the GNU General Public License as published by
-+   the Free Software Foundation; either version 3 of the License, or
-+   (at your option) any later version.
-+
-+   This program is distributed in the hope that it will be useful,
-+   but WITHOUT ANY WARRANTY; without even the implied warranty of
-+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-+   GNU General Public License for more details.
-+
-+   You should have received a copy of the GNU General Public License
-+   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
-+
-+int x, y;
-+volatile int result;
-+
-+void bar(void);
-+
-+inline int func1(void)
-+{
-+  bar ();
-+  return x * y;
-+}
-+
-+inline int func2(void)
-+{
-+  return x * func1 ();
-+}
-+
-+int main (void)
-+{
-+  int val;
-+
-+  x = 7;
-+  y = 8;
-+  bar ();
-+
-+  val = func1 ();
-+  result = val;
-+
-+  val = func2 ();
-+  result = val;
-+
-+  return 0;
-+}
-Index: gdb-6.8.50.20090302/gdb/testsuite/gdb.opt/inline-bt.exp
-===================================================================
---- /dev/null  1970-01-01 00:00:00.000000000 +0000
-+++ gdb-6.8.50.20090302/gdb/testsuite/gdb.opt/inline-bt.exp    2009-03-21 21:06:17.000000000 +0100
-@@ -0,0 +1,63 @@
-+# Copyright 2008 Free Software Foundation, Inc.
-+
-+# This program is free software; you can redistribute it and/or modify
-+# it under the terms of the GNU General Public License as published by
-+# the Free Software Foundation; either version 3 of the License, or
-+# (at your option) any later version.
-+#
-+# This program is distributed in the hope that it will be useful,
-+# but WITHOUT ANY WARRANTY; without even the implied warranty of
-+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-+# GNU General Public License for more details.
-+#
-+# You should have received a copy of the GNU General Public License
-+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
-+
-+set testfile "inline-bt"
-+set srcfile ${testfile}.c
-+set srcfile2 "inline-markers.c"
-+set fullsrcfile "${srcdir}/${subdir}/${srcfile}"
-+set fullsrcfile2 "${srcdir}/${subdir}/${srcfile2}"
-+set sources [list ${fullsrcfile} ${fullsrcfile2}]
-+set binfile ${objdir}/${subdir}/${testfile}
-+
-+if  { [gdb_compile ${sources} ${binfile} \
-+         executable {debug optimize=-O2}] != "" } {
-+    untested inline-bt.exp
-+    return -1
-+}
-+
-+gdb_exit
-+gdb_start
-+gdb_reinitialize_dir $srcdir/$subdir
-+gdb_load ${binfile}
-+
-+runto_main
-+
-+get_compiler_info $binfile
-+get_debug_format
-+if { [skip_inline_frame_tests] } {
-+    untested inline-bt.exp
-+    return
-+}
-+
-+set line1 [gdb_get_line_number "set breakpoint 1 here" ${fullsrcfile2}]
-+gdb_breakpoint $srcfile2:$line1
-+
-+gdb_test "continue" ".*set breakpoint 1 here.*" "continue to bar (1)"
-+gdb_test "backtrace" "#0  bar.*#1  .*main.*" "backtrace from bar (1)"
-+gdb_test "info frame" ".*called by frame.*" "bar not inlined"
-+
-+gdb_test "continue" ".*set breakpoint 1 here.*" "continue to bar (2)"
-+gdb_test "backtrace" "#0  bar.*#1  .*func1.*#2  .*main.*" \
-+    "backtrace from bar (2)"
-+gdb_test "up" "#1  .*func1.*" "up from bar (2)"
-+gdb_test "info frame" ".*inlined into frame.*" "func1 inlined (2)"
-+
-+gdb_test "continue" ".*set breakpoint 1 here.*" "continue to bar (3)"
-+gdb_test "backtrace" "#0  bar.*#1  .*func1.*#2  .*func2.*#3  .*main.*" \
-+    "backtrace from bar (3)"
-+gdb_test "up" "#1  .*func1.*" "up from bar (3)"
-+gdb_test "info frame" ".*inlined into frame.*" "func1 inlined (3)"
-+gdb_test "up" "#2  .*func2.*" "up from func1 (3)"
-+gdb_test "info frame" ".*inlined into frame.*" "func2 inlined (3)"
-Index: gdb-6.8.50.20090302/gdb/testsuite/gdb.opt/inline-cmds.c
-===================================================================
---- /dev/null  1970-01-01 00:00:00.000000000 +0000
-+++ gdb-6.8.50.20090302/gdb/testsuite/gdb.opt/inline-cmds.c    2009-03-21 21:06:17.000000000 +0100
-@@ -0,0 +1,85 @@
-+/* Copyright (C) 2008 Free Software Foundation, Inc.
-+
-+   This program is free software; you can redistribute it and/or modify
-+   it under the terms of the GNU General Public License as published by
-+   the Free Software Foundation; either version 3 of the License, or
-+   (at your option) any later version.
-+
-+   This program is distributed in the hope that it will be useful,
-+   but WITHOUT ANY WARRANTY; without even the implied warranty of
-+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-+   GNU General Public License for more details.
-+
-+   You should have received a copy of the GNU General Public License
-+   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
-+
-+int x, y;
-+volatile int result;
-+
-+void bar(void);
-+void marker(void);
-+void noinline(void);
-+
-+inline int func1(void)
-+{
-+  bar ();
-+  return x * y;
-+}
-+
-+inline int func2(void)
-+{
-+  return x * func1 ();
-+}
-+
-+inline void func3(void)
-+{
-+  bar ();
-+}
-+
-+inline void outer_inline1(void)
-+{
-+  noinline ();
-+}
-+
-+inline void outer_inline2(void)
-+{
-+  outer_inline1 ();
-+}
-+
-+int main (void)
-+{ /* start of main */
-+  int val;
-+
-+  x = 7;
-+  y = 8;
-+
-+  result = func1 ();
-+  result = func2 ();
-+  marker ();
-+
-+  result = 0;
-+  result = 0; /* set breakpoint 3 here */
-+
-+  func1 (); /* first call */
-+  func1 (); /* second call */
-+  marker ();
-+
-+  result = 0;
-+  result = 0; /* set breakpoint 4 here */
-+
-+  func1 ();
-+  func3 ();
-+  marker ();
-+
-+  result = 0;
-+  result = 0; /* set breakpoint 5 here */
-+
-+  marker ();
-+  func1 ();
-+  func3 ();
-+  marker ();  /* set breakpoint 6 here */
-+
-+  outer_inline2 ();
-+
-+  return 0;
-+}
-Index: gdb-6.8.50.20090302/gdb/testsuite/gdb.opt/inline-cmds.exp
-===================================================================
---- /dev/null  1970-01-01 00:00:00.000000000 +0000
-+++ gdb-6.8.50.20090302/gdb/testsuite/gdb.opt/inline-cmds.exp  2009-03-21 21:06:17.000000000 +0100
-@@ -0,0 +1,279 @@
-+# Copyright 2008 Free Software Foundation, Inc.
-+
-+# This program is free software; you can redistribute it and/or modify
-+# it under the terms of the GNU General Public License as published by
-+# the Free Software Foundation; either version 3 of the License, or
-+# (at your option) any later version.
-+#
-+# This program is distributed in the hope that it will be useful,
-+# but WITHOUT ANY WARRANTY; without even the implied warranty of
-+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-+# GNU General Public License for more details.
-+#
-+# You should have received a copy of the GNU General Public License
-+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
-+
-+set testfile "inline-cmds"
-+set srcfile "${testfile}.c"
-+set srcfile2 "inline-markers.c"
-+set fullsrcfile "${srcdir}/${subdir}/${srcfile}"
-+set fullsrcfile2 "${srcdir}/${subdir}/${srcfile2}"
-+set sources [list ${fullsrcfile} ${fullsrcfile2}]
-+set binfile ${objdir}/${subdir}/${testfile}
-+
-+if  { [gdb_compile $sources ${binfile} \
-+         executable {debug optimize=-O2}] != "" } {
-+    untested inline-cmds.exp
-+    return -1
-+}
-+
-+gdb_exit
-+gdb_start
-+gdb_reinitialize_dir $srcdir/$subdir
-+gdb_load ${binfile}
-+
-+gdb_test "set listsize 1" ""
-+
-+runto_main
-+
-+get_compiler_info $binfile
-+get_debug_format
-+if { [skip_inline_frame_tests] } {
-+    untested inline-cmds.exp
-+    return
-+}
-+
-+# First, check that the things we expected to be inlined really were,
-+# and those that shouldn't be weren't.
-+set line1 [gdb_get_line_number "set breakpoint 1 here" ${fullsrcfile2}]
-+gdb_breakpoint $srcfile2:$line1
-+set line2 [gdb_get_line_number "set breakpoint 2 here" ${fullsrcfile2}]
-+gdb_breakpoint $srcfile2:$line2
-+
-+gdb_test "continue" ".*set breakpoint 1 here.*" "continue to bar (1)"
-+gdb_test "backtrace" "#0  bar.*#1  .*func1.*#2  .*main.*" \
-+    "backtrace from bar (1)"
-+gdb_test "up" "#1  .*func1.*" "up from bar (1)"
-+gdb_test "info frame" ".*inlined into frame.*" "func1 inlined (1)"
-+
-+gdb_test "continue" ".*set breakpoint 1 here.*" "continue to bar (2)"
-+gdb_test "backtrace" "#0  bar.*#1  .*func1.*#2  .*func2.*#3  .*main.*" \
-+    "backtrace from bar (2)"
-+gdb_test "up" "#1  .*func1.*" "up from bar (2)"
-+gdb_test "info frame" ".*inlined into frame.*" "func1 inlined (2)"
-+gdb_test "up" "#2  .*func2.*" "up from func1 (2)"
-+gdb_test "info frame" ".*inlined into frame.*" "func2 inlined (2)"
-+
-+gdb_test "continue" ".*set breakpoint 2 here.*" "continue to marker"
-+gdb_test "backtrace" "#0  marker.*#1  .*main.*" "backtrace from marker"
-+gdb_test "info frame" ".*called by frame.*" "marker not inlined"
-+
-+# Next, check that we can next over inlined functions.  We should not end up
-+# inside any of them.
-+delete_breakpoints
-+runto_main
-+
-+# The lines before the first inlined call.
-+set first "x = 7|y = 8"
-+
-+# Some extra lines that end up in our stepping due to code motion.
-+set opt "start of main|result = 0"
-+
-+# We start this test with a "list" instead of a "next", in case the
-+# first non-prologue instruction in main comes from the inlined function.
-+set msg "next over inlined functions"
-+gdb_test_multiple "list" $msg {
-+    -re "($first|result = func1|result = func2|$opt).*$gdb_prompt $" {
-+      send_gdb "next\r"
-+      exp_continue
-+    }
-+    -re "marker \\\(\\\);\r\n$gdb_prompt $" {
-+      pass $msg
-+    }
-+}
-+
-+# Check that when next shows the call of func1, it has not happened yet.
-+runto_main
-+
-+# Like the return value of gdb_test: -1 something is wrong, 0 passed, 1 failed.
-+set bt_test -1
-+set x_test -1
-+
-+set msg "next past inlined func1"
-+gdb_test_multiple "list" $msg {
-+    -re "($first|$opt).*$gdb_prompt $" {
-+      send_gdb "next\r"
-+      exp_continue
-+    }
-+    -re "result = func1 \\\(\\\);\r\n$gdb_prompt $" {
-+      # Check whether x has been set.  If 0, we may be doing something
-+      # else associated with this line besides the inlined call - e.g.
-+      # loading the address of result.  If 7, we may be at the call site.
-+      # If 15, though, we are past the call and back at the store to
-+      # result - that's bad, we should have stepped out of func1 and
-+      # kept stepping until the line changed.
-+      set x_val -1
-+      gdb_test_multiple "print x" "" {
-+          -re "\\\$$decimal = (\[0-9\]*)\r\n$gdb_prompt $" {
-+              set x_val $expect_out(1,string)
-+          }
-+          -re "$gdb_prompt $" { }
-+      }
-+      if { $x_val == 0 || $x_val == 7 } {
-+          if { $x_test != 1 } {
-+              set x_test 0
-+          }
-+      } else {
-+          set x_test 1
-+      }
-+
-+      # func1 should not show up on backtraces yet.
-+      if { $bt_test != 1 } {
-+          set bt_test [gdb_test "backtrace" "#0  \[^#]*main.*" ""]
-+      }
-+
-+      send_gdb "next\r"
-+      exp_continue
-+    }
-+
-+    -re "result = func2 \\\(\\\);\r\n$gdb_prompt $" {
-+      pass $msg
-+    }
-+}
-+
-+if { $x_test == 0 } {
-+    pass "print x before func1"
-+} else {
-+    fail "print x before func1"
-+}
-+
-+if { $bt_test == 0 } {
-+    pass "backtrace does not include func1"
-+} else {
-+    fail "backtrace does not include func1"
-+}
-+
-+# Next, check that we can single step into inlined functions.  We should always
-+# "stop" at the call sites before entering them.
-+runto_main
-+
-+set msg "step into func1"
-+set saw_call_site 0
-+gdb_test_multiple "list" $msg {
-+    -re "($first|$opt).*$gdb_prompt $" {
-+      send_gdb "step\r"
-+      exp_continue
-+    }
-+    -re "result = func1.*$gdb_prompt $" {
-+      set saw_call_site 1
-+      send_gdb "step\r"
-+      exp_continue
-+    }
-+    -re "func1 \\\(\\\) at .*\r\n$decimal.*bar \\\(\\\);\r\n$gdb_prompt $" {
-+      if { $saw_call_site } {
-+          pass $msg
-+      } else {
-+          fail $msg
-+      }
-+    }
-+}
-+
-+# Check finish out of an inlined function.
-+set msg "finish from func1"
-+gdb_test_multiple "finish" $msg {
-+    -re "result = func1 \\\(\\\);\r\n$gdb_prompt $" {
-+      pass $msg
-+    }
-+    -re "($first|$opt).*$gdb_prompt $" {
-+      # Whoops.  We finished, but ended up back at an earlier line.  Keep
-+      # trying.
-+      send_gdb "step\r"
-+      exp_continue
-+    }
-+    -re "func1 \\\(\\\) at .*\r\n$decimal.*bar \\\(\\\);\r\n$gdb_prompt $" {
-+      send_gdb "finish\r"
-+      exp_continue
-+    }
-+}
-+
-+# Test some corner cases involving consecutive inlined functions.
-+set line3 [gdb_get_line_number "set breakpoint 3 here"]
-+gdb_breakpoint $line3
-+gdb_continue_to_breakpoint "consecutive func1"
-+
-+gdb_test "next" ".*func1 .*first call.*" "next to first func1"
-+set msg "next to second func1"
-+gdb_test_multiple "next" $msg {
-+    -re ".*func1 .*second call.*$gdb_prompt $" {
-+      pass $msg
-+    }
-+    -re ".*marker .*$gdb_prompt $" {
-+      # This assembles to two consecutive call instructions.
-+      # Both appear to be at the same line, because they're
-+      # in the body of the same inlined function.  This is
-+      # reasonable for the line table.  GDB should take the
-+      # containing block and/or function into account when
-+      # deciding how far to step.  The single line table entry
-+      # is actually two consecutive instances of the same line.
-+      kfail gdb/NNNN $msg
-+    }
-+}
-+
-+# It is easier when the two inlined functions are not on the same line.
-+set line4 [gdb_get_line_number "set breakpoint 4 here"]
-+gdb_breakpoint $line4
-+gdb_continue_to_breakpoint "func1 then func3"
-+
-+gdb_test "next" ".*func1 \\\(\\\);" "next to func1 before func3"
-+gdb_test "next" ".*func3 \\\(\\\);" "next to func3"
-+
-+# Test finishing out of one thing and into another.
-+set line5 [gdb_get_line_number "set breakpoint 5 here"]
-+gdb_breakpoint $line5
-+gdb_continue_to_breakpoint "finish into func1"
-+
-+gdb_test "next" ".*marker \\\(\\\);" "next to finish marker"
-+gdb_test "step" ".*set breakpoint 2 here.*" "step into finish marker"
-+gdb_test "finish" "func1 \\\(\\\);" "finish from marker to func1"
-+
-+gdb_test "step" "bar \\\(\\\);" "step into func1 for finish"
-+gdb_test "finish" "func3 \\\(\\\);" "finish from func1 to func3"
-+
-+# Test a deeper call stack.
-+set line6 [gdb_get_line_number "set breakpoint 6 here"]
-+gdb_breakpoint $line6
-+gdb_continue_to_breakpoint "before the outer_inline call"
-+gdb_test "step" "marker \\\(\\\) at .*" "reach 1 the outer_inline call"
-+gdb_test "finish" "main \\\(\\\) at .*outer_inline2 \\\(\\\);" "reach outer_inline2"
-+gdb_test "bt" "#0  main.*" "backtrace at main of outer_inline"
-+gdb_test "step" "outer_inline2 \\\(\\\) at .*" "enter outer_inline2"
-+gdb_test "bt" "#0  outer_inline2.*#1  main.*" "backtrace at outer_inline2"
-+gdb_test "step" "outer_inline1 \\\(\\\) at .*" "enter outer_inline1 from outer_inline2"
-+
-+set msg "backtrace at outer_inline1"
-+gdb_test_multiple "bt" $msg {
-+    -re "#0  outer_inline1.*#1  outer_inline2.*#2  main.*$gdb_prompt $" {
-+      pass $msg
-+    }
-+    -re "#0  $hex in outer_inline1.*#1  outer_inline2.*#2  main.*$gdb_prompt $" {
-+      # Binutils PR gas/6717.  Gas moves .loc past .p2align and the
-+      # leading nop of the inlined call appears to be on the same line
-+      # as main's call to marker.
-+      xfail $msg
-+      gdb_test "step" "noinline \\\(\\\);" "step to call of noinline"
-+    }
-+}
-+
-+gdb_test "step" "noinline \\\(\\\) at .*" "enter noinline from outer_inline1"
-+gdb_test "bt" "#0  noinline.*#1  .*outer_inline1.*#2  .*outer_inline2.*#3  main.*" "backtrace at noinline from outer_inline1"
-+gdb_test "step" "inlined_fn \\\(\\\) at .*" "enter inlined_fn from noinline"
-+gdb_test "bt" "#0  inlined_fn.*#1  noinline.*#2  .*outer_inline1.*#3  .*outer_inline2.*#4  main.*" "backtrace at inlined_fn from noinline"
-+gdb_test "info frame" ".*inlined into frame.*" "inlined_fn from noinline inlined"
-+gdb_test "up" "#1  noinline.*" "up to noinline"
-+gdb_test "info frame" ".*\n called by frame.*" "noinline from outer_inline1 not inlined"
-+gdb_test "up" "#2  .*outer_inline1.*" "up to outer_inline1"
-+gdb_test "info frame" ".*inlined into frame.*" "outer_inline1 inlined"
-+gdb_test "up" "#3  .*outer_inline2.*" "up to outer_inline2"
-+gdb_test "info frame" ".*inlined into frame.*" "outer_inline2 inlined"
-+gdb_test "up" "#4  main.*" "up from outer_inline2"
-+gdb_test "info frame" ".*\n caller of frame.*" "main not inlined"
-Index: gdb-6.8.50.20090302/gdb/testsuite/gdb.opt/inline-locals.c
-===================================================================
---- /dev/null  1970-01-01 00:00:00.000000000 +0000
-+++ gdb-6.8.50.20090302/gdb/testsuite/gdb.opt/inline-locals.c  2009-03-21 21:06:17.000000000 +0100
-@@ -0,0 +1,52 @@
-+/* Copyright (C) 2008 Free Software Foundation, Inc.
-+
-+   This program is free software; you can redistribute it and/or modify
-+   it under the terms of the GNU General Public License as published by
-+   the Free Software Foundation; either version 3 of the License, or
-+   (at your option) any later version.
-+
-+   This program is distributed in the hope that it will be useful,
-+   but WITHOUT ANY WARRANTY; without even the implied warranty of
-+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-+   GNU General Public License for more details.
-+
-+   You should have received a copy of the GNU General Public License
-+   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
-+
-+int x, y;
-+volatile int result;
-+volatile int *array_p;
-+
-+void bar(void);
-+
-+inline int func1(int arg1)
-+{
-+  int array[64];
-+  array_p = array;
-+  array[0] = result;
-+  array[1] = arg1;
-+  bar ();
-+  return x * y + array_p[0] * arg1;
-+}
-+
-+inline int func2(int arg2)
-+{
-+  return x * func1 (arg2);
-+}
-+
-+int main (void)
-+{
-+  int val;
-+
-+  x = 7;
-+  y = 8;
-+  bar ();
-+
-+  val = func1 (result);
-+  result = val;
-+
-+  val = func2 (result);
-+  result = val;
-+
-+  return 0;
-+}
-Index: gdb-6.8.50.20090302/gdb/testsuite/gdb.opt/inline-locals.exp
-===================================================================
---- /dev/null  1970-01-01 00:00:00.000000000 +0000
-+++ gdb-6.8.50.20090302/gdb/testsuite/gdb.opt/inline-locals.exp        2009-03-21 21:06:17.000000000 +0100
-@@ -0,0 +1,118 @@
-+# Copyright 2008 Free Software Foundation, Inc.
-+
-+# This program is free software; you can redistribute it and/or modify
-+# it under the terms of the GNU General Public License as published by
-+# the Free Software Foundation; either version 3 of the License, or
-+# (at your option) any later version.
-+#
-+# This program is distributed in the hope that it will be useful,
-+# but WITHOUT ANY WARRANTY; without even the implied warranty of
-+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-+# GNU General Public License for more details.
-+#
-+# You should have received a copy of the GNU General Public License
-+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
-+
-+set testfile "inline-locals"
-+set srcfile ${testfile}.c
-+set srcfile2 "inline-markers.c"
-+set fullsrcfile "${srcdir}/${subdir}/${srcfile}"
-+set fullsrcfile2 "${srcdir}/${subdir}/${srcfile2}"
-+set sources [list ${fullsrcfile} ${fullsrcfile2}]
-+set binfile ${objdir}/${subdir}/${testfile}
-+
-+if  { [gdb_compile ${sources} ${binfile} \
-+         executable {debug optimize=-O2}] != "" } {
-+    untested inline-locals.exp
-+    return -1
-+}
-+
-+gdb_exit
-+gdb_start
-+gdb_reinitialize_dir $srcdir/$subdir
-+gdb_load ${binfile}
-+
-+runto_main
-+
-+get_compiler_info $binfile
-+get_debug_format
-+if { [skip_inline_var_tests] } {
-+    untested inline-bt.exp
-+    return
-+}
-+
-+set no_frames [skip_inline_frame_tests]
-+
-+set line1 [gdb_get_line_number "set breakpoint 1 here" ${fullsrcfile2}]
-+gdb_breakpoint $srcfile2:$line1
-+
-+gdb_test "continue" ".*set breakpoint 1 here.*" "continue to bar (1)"
-+
-+gdb_test "continue" ".*set breakpoint 1 here.*" "continue to bar (2)"
-+
-+if { ! $no_frames } {
-+    gdb_test "backtrace" "#0  bar.*#1  .*func1.*#2  .*main.*" \
-+      "backtrace from bar (2)"
-+    gdb_test "up" "#1  .*func1 .* at .*" "up from bar (2)"
-+    gdb_test "info frame" ".*inlined into frame.*" "func1 inlined (2)"
-+    gdb_test "info locals" "array = {.*}" "info locals above bar (2)"
-+
-+    set msg "info args above bar (2)"
-+    gdb_test_multiple "info args" $msg {
-+      -re "arg1 = $decimal\r\n$gdb_prompt $" {
-+          pass $msg
-+      }
-+      -re "arg1 = <value optimized out>\r\n$gdb_prompt $" {
-+          # GCC 4.3 loses location information for arg1.  GCC 4.2 is OK.
-+          if { [test_compiler_info "gcc-4-3-*"] } {
-+              setup_xfail *-*-*
-+          }
-+          fail $msg
-+      }
-+    }
-+} else {
-+    gdb_test "up" "#1  .*main .* at .*" "up from bar (2)"
-+    gdb_test "info locals" ".*arg1 = 0.*" "info locals above bar (2)"
-+}
-+
-+# Make sure that locals on the stack are found.  This is an array to
-+# prevent it from living in a register.
-+gdb_test "print array\[0\]" "\\\$$decimal = 0" "print local (2)"
-+
-+if { ! $no_frames } {
-+    # Verify that we do not print out variables from the inlined
-+    # function's caller.
-+    gdb_test "print val" "No symbol \"val\" in current context\\." \
-+      "print out of scope local"
-+}
-+
-+# Repeat the tests from a depth of two inlined functions, and with a
-+# more interesting value in the local array.
-+gdb_test "continue" ".*set breakpoint 1 here.*" "continue to bar (3)"
-+if { ! $no_frames } {
-+    gdb_test "backtrace" "#0  bar.*#1  .*func1.*#2  .*func2.*#3  .*main.*" \
-+      "backtrace from bar (3)"
-+    gdb_test "up" "#1  .*func1 .* at .*" "up from bar (3)"
-+    gdb_test "info frame" ".*inlined into frame.*" "func1 inlined (3)"
-+    gdb_test "info locals" "array = {.*}" "info locals above bar (3)"
-+
-+    set msg "info args above bar (3)"
-+    gdb_test_multiple "info args" $msg {
-+      -re "arg1 = $decimal\r\n$gdb_prompt $" {
-+          pass $msg
-+      }
-+      -re "arg1 = <value optimized out>\r\n$gdb_prompt $" {
-+          # GCC 4.3 loses location information for arg1.  GCC 4.2 is OK.
-+          if { [test_compiler_info "gcc-4-3-*"] } {
-+              setup_xfail *-*-*
-+          }
-+          fail $msg
-+      }
-+    }
-+} else {
-+    gdb_test "up" "#1  .*main .* at .*" "up from bar (3)"
-+    gdb_test "info locals" ".*arg1 = 1.*" "info locals above bar (3a)"
-+    gdb_test "info locals" ".*arg2 = 184.*" "info locals above bar (3b)"
-+}
-+
-+gdb_test "print array\[0\]" "\\\$$decimal = 184" "print local (3)"
-Index: gdb-6.8.50.20090302/gdb/testsuite/gdb.opt/inline-markers.c
-===================================================================
---- /dev/null  1970-01-01 00:00:00.000000000 +0000
-+++ gdb-6.8.50.20090302/gdb/testsuite/gdb.opt/inline-markers.c 2009-03-21 21:06:17.000000000 +0100
-@@ -0,0 +1,36 @@
-+/* Copyright (C) 2008 Free Software Foundation, Inc.
-+
-+   This program is free software; you can redistribute it and/or modify
-+   it under the terms of the GNU General Public License as published by
-+   the Free Software Foundation; either version 3 of the License, or
-+   (at your option) any later version.
-+
-+   This program is distributed in the hope that it will be useful,
-+   but WITHOUT ANY WARRANTY; without even the implied warranty of
-+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-+   GNU General Public License for more details.
-+
-+   You should have received a copy of the GNU General Public License
-+   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
-+
-+extern int x, y;
-+
-+void bar(void)
-+{
-+  x += y; /* set breakpoint 1 here */
-+}
-+
-+void marker(void)
-+{
-+  x += y; /* set breakpoint 2 here */
-+}
-+
-+inline void inlined_fn(void)
-+{
-+  x += y;
-+}
-+
-+void noinline(void)
-+{
-+  inlined_fn (); /* inlined */
-+}
-Index: gdb-6.8.50.20090302/gdb/testsuite/lib/gdb.exp
-===================================================================
---- gdb-6.8.50.20090302.orig/gdb/testsuite/lib/gdb.exp 2009-03-21 21:06:04.000000000 +0100
-+++ gdb-6.8.50.20090302/gdb/testsuite/lib/gdb.exp      2009-03-21 21:06:17.000000000 +0100
-@@ -1474,6 +1474,37 @@ proc skip_hp_tests {} {
-     return $skip_hp
- }
-+# Return whether we should skip tests for showing inlined functions in
-+# backtraces.  Requires get_compiler_info and get_debug_format.
-+
-+proc skip_inline_frame_tests {} {
-+    # GDB only recognizes inlining information in DWARF 2 (DWARF 3).
-+    if { ! [test_debug_format "DWARF 2"] } {
-+      return 1
-+    }
-+
-+    # GCC before 4.1 does not emit DW_AT_call_file / DW_AT_call_line.
-+    if { ([test_compiler_info "gcc-2-*"]
-+        || [test_compiler_info "gcc-3-*"]
-+        || [test_compiler_info "gcc-4-0-*"]) } {
-+      return 1
-+    }
-+
-+    return 0
-+}
-+
-+# Return whether we should skip tests for showing variables from
-+# inlined functions.  Requires get_compiler_info and get_debug_format.
-+
-+proc skip_inline_var_tests {} {
-+    # GDB only recognizes inlining information in DWARF 2 (DWARF 3).
-+    if { ! [test_debug_format "DWARF 2"] } {
-+      return 1
-+    }
-+
-+    return 0
-+}
-+
- set compiler_info             "unknown"
- set gcc_compiled              0
- set hp_cc_compiler            0
-Index: gdb-6.8.50.20090302/gdb/valops.c
-===================================================================
---- gdb-6.8.50.20090302.orig/gdb/valops.c      2009-03-21 21:06:03.000000000 +0100
-+++ gdb-6.8.50.20090302/gdb/valops.c   2009-03-21 21:06:17.000000000 +0100
-@@ -1072,7 +1072,7 @@ value_of_variable (struct symbol *var, s
-       frame = block_innermost_frame (b);
-       if (!frame)
-       {
--        if (BLOCK_FUNCTION (b)
-+        if (BLOCK_FUNCTION (b) && !block_inlined_p (b)
-             && SYMBOL_PRINT_NAME (BLOCK_FUNCTION (b)))
-           error (_("No frame is currently executing in block %s."),
-                  SYMBOL_PRINT_NAME (BLOCK_FUNCTION (b)));
-Index: gdb-6.8.50.20090302/gdb/Makefile.in
-===================================================================
---- gdb-6.8.50.20090302.orig/gdb/Makefile.in   2009-03-21 21:06:04.000000000 +0100
-+++ gdb-6.8.50.20090302/gdb/Makefile.in        2009-03-21 21:06:17.000000000 +0100
-@@ -667,6 +667,7 @@ SFILES = ada-exp.y ada-lang.c ada-typepr
-       inf-loop.c \
-       infcall.c \
-       infcmd.c inflow.c infrun.c \
-+      inline-frame.c \
-       interps.c \
-       jv-exp.y jv-lang.c jv-valprint.c jv-typeprint.c \
-       language.c linespec.c \
-@@ -839,6 +840,7 @@ COMMON_OBS = $(DEPFILES) $(CONFIG_OBS) $
-       user-regs.o \
-       frame.o frame-unwind.o doublest.o \
-       frame-base.o \
-+      inline-frame.o \
-       gnu-v2-abi.o gnu-v3-abi.o cp-abi.o cp-support.o \
-       cp-namespace.o \
-       reggroups.o regset.o \
-Index: gdb-6.8.50.20090302/gdb/testsuite/gdb.opt/Makefile.in
-===================================================================
---- gdb-6.8.50.20090302.orig/gdb/testsuite/gdb.opt/Makefile.in 2008-04-18 01:06:54.000000000 +0200
-+++ gdb-6.8.50.20090302/gdb/testsuite/gdb.opt/Makefile.in      2009-03-21 21:06:17.000000000 +0100
-@@ -1,7 +1,7 @@
- VPATH = @srcdir@
- srcdir = @srcdir@
--EXECUTABLES = hello/hello
-+EXECUTABLES = clobbered-registers-O2 inline-bt inline-cmds inline-locals
- MISCELLANEOUS =
index bbc7ff90c76d796a49862ccb2f1556508f1df2b3..c33021234f209a0fe6e2bc6f72032ea04749dfb0 100644 (file)
@@ -2,3731 +2,30 @@ http://sourceware.org/gdb/wiki/ProjectArcher
 http://sourceware.org/gdb/wiki/ArcherBranchManagement
 
 GIT snapshot:
-commit e734ed95d296a3342d4147873c4641cea6c4d7fe
+commit 7cb860f03e2437c97239334ebe240d06f45723e0
 
 branch `archer' - the merge of branches:
-archer-jankratochvil-merge-expr
-       archer-keiths-expr-cumulative
-               (archer-swagiaal-using-directive)
-archer-jankratochvil-misc
-archer-jankratochvil-python
-       archer-jankratochvil-type-refcount
-       archer-tromey-python
-archer-jankratochvil-vla
-       archer-jankratochvil-type-refcount
-archer-pmuldoon-exception-rewind-master
-archer-sergio-catch-syscall
-archer-tromey-charset
+archer-tromey-call-frame-cfa
 archer-tromey-delayed-symfile
+archer-tromey-dw-op-value
+archer-jankratochvil-vla
+archer-jankratochvil-misc
+archer-keiths-expr-cumulative
+archer-tromey-python
+archer-jankratochvil-fortran-module
+archer-jankratochvil-watchpoint
+archer-jankratochvil-bp_location-accel
+archer-pmuldoon-next-over-throw
 
 
-diff --git a/bfd/po/es.po b/bfd/po/es.po
-index 9f2ec21..e4410d7 100644
---- a/bfd/po/es.po
-+++ b/bfd/po/es.po
-@@ -1,13 +1,14 @@
--# Mensajes en español para bfd 2.17.90.
--# Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
--# Cristian Othón Martínez Vera <cfuga@itam.mx>, 2002, 2003, 2004, 2005, 2006, 2007
-+# Mensajes en español para bfd 2.18.90.
-+# Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
-+# This file is distributed under the same license as the binutils package.
-+# Cristian Othón Martínez Vera <cfuga@itam.mx>, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
- #
- msgid ""
- msgstr ""
--"Project-Id-Version: bfd 2.17.90\n"
--"Report-Msgid-Bugs-To: \n"
--"POT-Creation-Date: 2007-08-06 16:21-0400\n"
--"PO-Revision-Date: 2007-09-08 08:57-0500\n"
-+"Project-Id-Version: bfd 2.18.90\n"
-+"Report-Msgid-Bugs-To: bug-binutils@gnu.org\n"
-+"POT-Creation-Date: 2008-09-09 15:56+0930\n"
-+"PO-Revision-Date: 2009-03-03 22:20-0600\n"
- "Last-Translator: Cristian Othón Martínez Vera <cfuga@itam.mx>\n"
- "Language-Team: Spanish <es@li.org>\n"
- "MIME-Version: 1.0\n"
-@@ -31,143 +32,143 @@ msgstr "%B: Tipo de reubicaci
- msgid "%B: Bad relocation record imported: %d"
- msgstr "%B: Registro de reubicación importado erróneo: %d"
--#: aoutx.h:1268 aoutx.h:1602
-+#: aoutx.h:1268 aoutx.h:1604
- #, c-format
- msgid "%s: can not represent section `%s' in a.out object file format"
- msgstr "%s: no se puede representar la sección `%s' en el fichero objeto de formato a.out"
--#: aoutx.h:1568
-+#: aoutx.h:1570
- #, c-format
- msgid "%s: can not represent section for symbol `%s' in a.out object file format"
- msgstr "%s: no se puede representar la sección para el símbolo `%s' en el fichero objeto de formato a.out"
--#: aoutx.h:1570
-+#: aoutx.h:1572
- msgid "*unknown*"
- msgstr "*desconocido*"
--#: aoutx.h:3987 aoutx.h:4313
-+#: aoutx.h:3989 aoutx.h:4315
- msgid "%P: %B: unexpected relocation type\n"
- msgstr "%P: %B: tipo de reubicación inesperado\n"
--#: aoutx.h:5347
-+#: aoutx.h:5349
- #, c-format
- msgid "%s: relocatable link from %s to %s not supported"
- msgstr "%s: no se admite el enlace reubicable de %s a %s"
--#: archive.c:1766
-+#: archive.c:2046
- msgid "Warning: writing archive was slow: rewriting timestamp\n"
- msgstr "Aviso: la escritura del fichero fue lenta: se reescribe la marca de tiempo\n"
- # ¡Uff! Si utilizáramos file=archivo, esta traducción sería imposible. cfuga
--#: archive.c:2029
-+#: archive.c:2309
- msgid "Reading archive file mod timestamp"
- msgstr "Se lee el archivo de la modificación de marca de tiempo del fichero"
--#: archive.c:2053
-+#: archive.c:2333
- msgid "Writing updated armap timestamp"
- msgstr "Se escribe la marca de tiempo actualizada de armap"
--#: bfd.c:289
-+#: bfd.c:368
- msgid "No error"
- msgstr "No hay error"
--#: bfd.c:290
-+#: bfd.c:369
- msgid "System call error"
- msgstr "Error en la llamada al sistema"
--#: bfd.c:291
-+#: bfd.c:370
- msgid "Invalid bfd target"
- msgstr "Objetivo bfd inválido"
--#: bfd.c:292
-+#: bfd.c:371
- msgid "File in wrong format"
- msgstr "Fichero en formato erróneo"
--#: bfd.c:293
-+#: bfd.c:372
- msgid "Archive object file in wrong format"
- msgstr "Archivo de ficheros objeto en formato erróneo"
--#: bfd.c:294
-+#: bfd.c:373
- msgid "Invalid operation"
- msgstr "Operación inválida"
--#: bfd.c:295
-+#: bfd.c:374
- msgid "Memory exhausted"
- msgstr "Memoria agotada"
--#: bfd.c:296
-+#: bfd.c:375
- msgid "No symbols"
- msgstr "No hay símbolos"
--#: bfd.c:297
-+#: bfd.c:376
- msgid "Archive has no index; run ranlib to add one"
- msgstr "El archivo no tiene índice; ejecute ranlib para agregar uno"
--#: bfd.c:298
-+#: bfd.c:377
- msgid "No more archived files"
- msgstr "No hay más ficheros archivados"
--#: bfd.c:299
-+#: bfd.c:378
- msgid "Malformed archive"
- msgstr "Archivo malformado"
--#: bfd.c:300
-+#: bfd.c:379
- msgid "File format not recognized"
- msgstr "No se reconoce el formato del fichero"
--#: bfd.c:301
-+#: bfd.c:380
- msgid "File format is ambiguous"
- msgstr "El formato del fichero es ambiguo"
--#: bfd.c:302
-+#: bfd.c:381
- msgid "Section has no contents"
- msgstr "La sección no tiene contenidos"
--#: bfd.c:303
-+#: bfd.c:382
- msgid "Nonrepresentable section on output"
- msgstr "Sección no representable en la salida"
--#: bfd.c:304
-+#: bfd.c:383
- msgid "Symbol needs debug section which does not exist"
- msgstr "Un símbolo requiere de una sección de depuración, la cual no existe"
--#: bfd.c:305
-+#: bfd.c:384
- msgid "Bad value"
- msgstr "Valor erróneo"
--#: bfd.c:306
-+#: bfd.c:385
- msgid "File truncated"
- msgstr "Fichero truncado"
--#: bfd.c:307
-+#: bfd.c:386
- msgid "File too big"
- msgstr "Fichero demasiado grande"
--#: bfd.c:308
-+#: bfd.c:387
- #, c-format
- msgid "Error reading %s: %s"
- msgstr "Error al leer %s: %s"
--#: bfd.c:309
-+#: bfd.c:388
- msgid "#<Invalid error code>"
- msgstr "#<Código de error inválido>"
--#: bfd.c:830
-+#: bfd.c:912
- #, c-format
- msgid "BFD %s assertion fail %s:%d"
- msgstr "falló la aseveración BFD %s %s:%d"
--#: bfd.c:842
-+#: bfd.c:924
- #, c-format
- msgid "BFD %s internal error, aborting at %s line %d in %s\n"
- msgstr "error interno de BFD %s, se aborta en %s línea %d en %s\n"
--#: bfd.c:846
-+#: bfd.c:928
- #, c-format
- msgid "BFD %s internal error, aborting at %s line %d\n"
- msgstr "error interno de BFD %s, se aborta en %s línea %d\n"
--#: bfd.c:848
-+#: bfd.c:930
- msgid "Please report this bug.\n"
- msgstr "Por favor reporte este bicho.\n"
-@@ -186,14 +187,10 @@ msgstr "no se mapea: no se estableci
- msgid "Warning: Writing section `%s' to huge (ie negative) file offset 0x%lx."
- msgstr "Aviso: Se escribe la sección `%s' a un desplazamiento de fichero grande (pe negativo) 0x%lx."
--#: cache.c:238
-+#: cache.c:222
- msgid "reopening %B: %s\n"
- msgstr "se reabre %B: %s\n"
--#: coff64-rs6000.c:2126 coff-rs6000.c:3624
--msgid "%B: symbol `%s' has unrecognized smclas %d"
--msgstr "%B: el símbolo `%s' tiene smclas %d que no se reconoce"
--
- #: coff-alpha.c:490
- msgid ""
- "%B: Cannot handle compressed Alpha binaries.\n"
-@@ -206,7 +203,7 @@ msgstr ""
- msgid "%B: unknown/unsupported relocation type %d"
- msgstr "%B: tipo de reubicación %d desconocida/no admitida"
--#: coff-alpha.c:899 coff-alpha.c:936 coff-alpha.c:2024 coff-mips.c:1002
-+#: coff-alpha.c:899 coff-alpha.c:936 coff-alpha.c:2024 coff-mips.c:1003
- msgid "GP relative relocation used when GP not defined"
- msgstr "se usó una reubicación GP relativa cuando GP no estaba definido"
-@@ -222,22 +219,22 @@ msgstr "%B: tipo de reubicaci
- msgid "%B: unsupported relocation: ALPHA_R_GPRELLOW"
- msgstr "%B: tipo de reubicación no admitida: ALPHA_R_GPRELLOW"
--#: coff-alpha.c:1574 elf32-m32r.c:2487 elf64-alpha.c:3953 elf64-alpha.c:4106
--#: elf32-ia64.c:4675 elf64-ia64.c:4675
-+#: coff-alpha.c:1574 elf32-m32r.c:2487 elf64-alpha.c:3970 elf64-alpha.c:4125
-+#: elf32-ia64.c:4465 elf64-ia64.c:4465
- msgid "%B: unknown relocation type %d"
- msgstr "%B: tipo de reubicación %d desconocido"
--#: coff-arm.c:1036
-+#: coff-arm.c:1039
- #, c-format
- msgid "%B: unable to find THUMB glue '%s' for `%s'"
- msgstr "%B: no se puede encontrar el pegamento THUMB '%s' para `%s'"
--#: coff-arm.c:1065
-+#: coff-arm.c:1068
- #, c-format
- msgid "%B: unable to find ARM glue '%s' for `%s'"
- msgstr "%B: no se puede encontrar el pegamento ARM '%s' para `%s'"
--#: coff-arm.c:1367 elf32-arm.c:4167
-+#: coff-arm.c:1370 elf32-arm.c:5453
- #, c-format
- msgid ""
- "%B(%s): warning: interworking not enabled.\n"
-@@ -246,7 +243,7 @@ msgstr ""
- "%B(%s): aviso: no se activó la interoperabilidad.\n"
- "  primer suceso: %B: llamada arm a thumb"
--#: coff-arm.c:1457
-+#: coff-arm.c:1460
- #, c-format
- msgid ""
- "%B(%s): warning: interworking not enabled.\n"
-@@ -257,188 +254,118 @@ msgstr ""
- "  primer suceso: %B: llamada arm a thumb\n"
- "  considere reenlazar con --support-old-code activado"
--#: coff-arm.c:1750 cofflink.c:3018 coff-tic80.c:695
-+#: coff-arm.c:1755 coff-tic80.c:695 cofflink.c:3018
- msgid "%B: bad reloc address 0x%lx in section `%A'"
- msgstr "%B: dirección de reubicación 0x%lx errónea en la sección `%A'"
--#: coff-arm.c:2075
-+#: coff-arm.c:2080
- msgid "%B: illegal symbol index in reloc: %d"
- msgstr "%B: índice de símbolos ilegal en la reubicación: %d"
--#: coff-arm.c:2206
-+#: coff-arm.c:2211
- #, c-format
- msgid "ERROR: %B is compiled for APCS-%d, whereas %B is compiled for APCS-%d"
- msgstr "ERROR: %B está compilado para APCS-%d, mientras que %B está compilado para APCS-%d"
--#: coff-arm.c:2222 elf32-arm.c:7072
-+#: coff-arm.c:2227 elf32-arm.c:8563
- #, c-format
- msgid "ERROR: %B passes floats in float registers, whereas %B passes them in integer registers"
- msgstr "ERROR: %B pasa números de coma flotante en registros de coma flotante, mientras que %B los pasa en registros enteros"
--#: coff-arm.c:2225 elf32-arm.c:7076
-+#: coff-arm.c:2230 elf32-arm.c:8567
- #, c-format
- msgid "ERROR: %B passes floats in integer registers, whereas %B passes them in float registers"
- msgstr "ERROR: %B pasa números de coma flotante en registros enteros, mientras que %B los pasa en registros de coma flotante"
--#: coff-arm.c:2239
-+#: coff-arm.c:2244
- #, c-format
- msgid "ERROR: %B is compiled as position independent code, whereas target %B is absolute position"
- msgstr "ERROR: %B está compilado como código independiente de posición, mientras que el objetivo %B es de posición absoluta"
--#: coff-arm.c:2242
-+#: coff-arm.c:2247
- #, c-format
- msgid "ERROR: %B is compiled as absolute position code, whereas target %B is position independent"
- msgstr "ERROR: %B está compilado como código de posición absoluta, mientras que el objetivo %B es independiente de posición"
--#: coff-arm.c:2270 elf32-arm.c:7141
-+#: coff-arm.c:2275 elf32-arm.c:8632
- #, c-format
- msgid "Warning: %B supports interworking, whereas %B does not"
- msgstr "Aviso: %B admite interoperabilidad, mientras que %B no"
--#: coff-arm.c:2273 elf32-arm.c:7147
-+#: coff-arm.c:2278 elf32-arm.c:8638
- #, c-format
- msgid "Warning: %B does not support interworking, whereas %B does"
- msgstr "Aviso: %B no admite interoperabilidad, mientras que %B sí"
--#: coff-arm.c:2297
-+#: coff-arm.c:2302
- #, c-format
- msgid "private flags = %x:"
- msgstr "opciones privadas = %x:"
--#: coff-arm.c:2305 elf32-arm.c:7198
-+#: coff-arm.c:2310 elf32-arm.c:8689
- #, c-format
- msgid " [floats passed in float registers]"
- msgstr "[números de coma flotante pasados en registros de coma flotante]"
--#: coff-arm.c:2307
-+#: coff-arm.c:2312
- #, c-format
- msgid " [floats passed in integer registers]"
- msgstr "[números de coma flotante pasados en registros enteros]"
--#: coff-arm.c:2310 elf32-arm.c:7201
-+#: coff-arm.c:2315 elf32-arm.c:8692
- #, c-format
- msgid " [position independent]"
- msgstr "[independiente de posición]"
--#: coff-arm.c:2312
-+#: coff-arm.c:2317
- #, c-format
- msgid " [absolute position]"
- msgstr "[posición absoluta]"
--#: coff-arm.c:2316
-+#: coff-arm.c:2321
- #, c-format
- msgid " [interworking flag not initialised]"
- msgstr "[no se inicializó la opción de interoperabilidad]"
--#: coff-arm.c:2318
-+#: coff-arm.c:2323
- #, c-format
- msgid " [interworking supported]"
- msgstr "[admite interoperabilidad]"
--#: coff-arm.c:2320
-+#: coff-arm.c:2325
- #, c-format
- msgid " [interworking not supported]"
- msgstr "[no admite interoperabilidad]"
--#: coff-arm.c:2366 elf32-arm.c:6578
-+#: coff-arm.c:2371 elf32-arm.c:8050
- #, c-format
- msgid "Warning: Not setting interworking flag of %B since it has already been specified as non-interworking"
- msgstr "Aviso: No se establece la opción de interoperabilidad de %B ya que se había especificado con anterioridad como no interoperable"
--#: coff-arm.c:2370 elf32-arm.c:6582
-+#: coff-arm.c:2375 elf32-arm.c:8054
- #, c-format
- msgid "Warning: Clearing the interworking flag of %B due to outside request"
- msgstr "Aviso: Se limpia la opción de interoperabilidad de %B debido a una petición externa"
--#: coffcode.h:850
--msgid "%B: warning: COMDAT symbol '%s' does not match section name '%s'"
--msgstr "%B: aviso: el símbolo COMDAT '%s' no coincide con el nombre de sección '%s'"
--
--#. Generate a warning message rather using the 'unhandled'
--#. variable as this will allow some .sys files generate by
--#. other toolchains to be processed.  See bugzilla issue 196.
--#: coffcode.h:1062
--msgid "%B: Warning: Ignoring section flag IMAGE_SCN_MEM_NOT_PAGED in section %s"
--msgstr "%B: Aviso: Se descarta la opción de sección IMAGE_SCN_MEM_NOT_PAGED en la sección %s"
--
--#: coffcode.h:1117
--msgid "%B (%s): Section flag %s (0x%x) ignored"
--msgstr "%B (%s): Se descarta la opción de sección %s (0x%x)"
--
--#: coffcode.h:2236
--#, c-format
--msgid "Unrecognized TI COFF target id '0x%x'"
--msgstr "No se reconoce el id de objetivo TI COFF '0x%x'"
--
--#: coffcode.h:2551
--msgid "%B: reloc against a non-existant symbol index: %ld"
--msgstr "%B: reubicación contra un índice símbolo que no existe: %ld"
--
--#: coffcode.h:4296
--msgid "%B: warning: line number table read failed"
--msgstr "%B: aviso: falló la lectura de tabla de números de línea"
--
--#: coffcode.h:4329
--msgid "%B: warning: illegal symbol index %ld in line numbers"
--msgstr "%B: aviso: índice de símbolos %ld ilegal en los números de línea"
--
--#: coffcode.h:4343
--msgid "%B: warning: duplicate line number information for `%s'"
--msgstr "%B: aviso: información duplicada de números de línea para `%s'"
--
--#: coffcode.h:4735
--msgid "%B: Unrecognized storage class %d for %s symbol `%s'"
--msgstr "%B: Clase de almacenamiento %d no reconocida para %s símbolo `%s'"
--
--#: coffcode.h:4861
--msgid "warning: %B: local symbol `%s' has no section"
--msgstr "aviso: %B: el símbolo local `%s' no tiene sección"
--
--#: coffcode.h:4966 coff-i860.c:601 coff-tic54x.c:393
--msgid "%B: warning: illegal symbol index %ld in relocs"
--msgstr "%B: aviso: índice de símbolos %ld ilegal en reubicaciones"
--
--#: coffcode.h:5004
--msgid "%B: illegal relocation type %d at address 0x%lx"
--msgstr "%B: tipo de reubicación %d ilegal en la dirección 0x%lx"
--
--#: coffgen.c:1518
--msgid "%B: bad string table size %lu"
--msgstr "%B: tamaño de tabla de cadenas %lu erróneo"
--
- #: coff-h8300.c:1122
- #, c-format
- msgid "cannot handle R_MEM_INDIRECT reloc when using %s output"
- msgstr "no se puede manejar la reubicación R_MEM_INDIRECT cuando se utiliza la salida %s"
--#: coff-i860.c:143
-+#: coff-i860.c:147
- #, c-format
- msgid "Relocation `%s' not yet implemented\n"
- msgstr "La reubicación `%s' aún no está implementada\n"
--#: coff-i960.c:138 coff-i960.c:501
-+#: coff-i860.c:605 coff-tic54x.c:398 coffcode.h:4975
-+msgid "%B: warning: illegal symbol index %ld in relocs"
-+msgstr "%B: aviso: índice de símbolos %ld ilegal en reubicaciones"
-+
-+#: coff-i960.c:143 coff-i960.c:506
- msgid "uncertain calling convention for non-COFF symbol"
- msgstr "convención de llamada incierta para un símbolo que no es COFF"
--#: cofflink.c:513 elflink.c:4175
--msgid "Warning: type of symbol `%s' changed from %d to %d in %B"
--msgstr "Aviso: el tipo del símbolo `%s' cambió de %d a %d en %B"
--
--#: cofflink.c:2296
--msgid "%B: relocs in section `%A', but it has no contents"
--msgstr "%B: reubicaciones en la sección `%A', pero no tiene contenido"
--
--#: cofflink.c:2627 coffswap.h:824
--#, c-format
--msgid "%s: %s: reloc overflow: 0x%lx > 0xffff"
--msgstr "%s: %s: desbordamiento de reubicación: 0x%lx > 0xffff"
--
--#: cofflink.c:2636 coffswap.h:810
--#, c-format
--msgid "%s: warning: %s: line number overflow: 0x%lx > 0xffff"
--msgstr "%s: aviso: %s: desbordamiento de número de línea: 0x%lx > 0xffff"
--
--#: coff-m68k.c:506 elf32-bfin.c:5434 elf32-m68k.c:2393
-+#: coff-m68k.c:506 elf32-bfin.c:5510 elf32-m68k.c:3938
- msgid "unsupported reloc type"
- msgstr "no se admite el tipo de reubicación"
-@@ -462,31 +389,35 @@ msgstr "La direcci
- msgid "Unrecognized Reloc Type"
- msgstr "Tipo de Reubicación no Reconocida"
--#: coff-mips.c:687 elf32-mips.c:958 elf32-score.c:345 elf64-mips.c:1911
--#: elfn32-mips.c:1752
-+#: coff-mips.c:688 elf32-mips.c:1014 elf32-score.c:345 elf64-mips.c:1991
-+#: elfn32-mips.c:1832
- msgid "GP relative relocation when _gp not defined"
- msgstr "reubicación GP relativa cuando _gp no está definido"
--#: coff-or32.c:228
-+#: coff-or32.c:229
- msgid "Unrecognized reloc"
- msgstr "Reubicación no reconocida"
--#: coff-rs6000.c:2799
-+#: coff-rs6000.c:2803
- #, c-format
- msgid "%s: unsupported relocation type 0x%02x"
- msgstr "%s: no se admite el tipo de reubicación 0x%02x"
--#: coff-rs6000.c:2892
-+#: coff-rs6000.c:2896
- #, c-format
- msgid "%s: TOC reloc at 0x%x to symbol `%s' with no TOC entry"
- msgstr "%s: reubicación de TOC en 0x%x al símbolo `%s' sin entrada TOC"
--#: coff-tic4x.c:191 coff-tic54x.c:299 coff-tic80.c:458
-+#: coff-rs6000.c:3628 coff64-rs6000.c:2130
-+msgid "%B: symbol `%s' has unrecognized smclas %d"
-+msgstr "%B: el símbolo `%s' tiene smclas %d que no se reconoce"
-+
-+#: coff-tic4x.c:195 coff-tic54x.c:299 coff-tic80.c:458
- #, c-format
- msgid "Unrecognized reloc type 0x%x"
- msgstr "Tipo de reubicación 0x%x no reconocida"
--#: coff-tic4x.c:236
-+#: coff-tic4x.c:240
- #, c-format
- msgid "%s: warning: illegal symbol index %ld in relocs"
- msgstr "%s: aviso: íncide de símbolos %ld ilegal en reubicaciones"
-@@ -496,6 +427,76 @@ msgstr "%s: aviso: 
- msgid "ignoring reloc %s\n"
- msgstr "se descarta la reubicación %s\n"
-+#: coffcode.h:850
-+msgid "%B: warning: COMDAT symbol '%s' does not match section name '%s'"
-+msgstr "%B: aviso: el símbolo COMDAT '%s' no coincide con el nombre de sección '%s'"
-+
-+#. Generate a warning message rather using the 'unhandled'
-+#. variable as this will allow some .sys files generate by
-+#. other toolchains to be processed.  See bugzilla issue 196.
-+#: coffcode.h:1062
-+msgid "%B: Warning: Ignoring section flag IMAGE_SCN_MEM_NOT_PAGED in section %s"
-+msgstr "%B: Aviso: Se descarta la opción de sección IMAGE_SCN_MEM_NOT_PAGED en la sección %s"
-+
-+#: coffcode.h:1117
-+msgid "%B (%s): Section flag %s (0x%x) ignored"
-+msgstr "%B (%s): Se descarta la opción de sección %s (0x%x)"
-+
-+#: coffcode.h:2244
-+#, c-format
-+msgid "Unrecognized TI COFF target id '0x%x'"
-+msgstr "No se reconoce el id de objetivo TI COFF '0x%x'"
-+
-+#: coffcode.h:2559
-+msgid "%B: reloc against a non-existant symbol index: %ld"
-+msgstr "%B: reubicación contra un índice símbolo que no existe: %ld"
-+
-+#: coffcode.h:4309
-+msgid "%B: warning: line number table read failed"
-+msgstr "%B: aviso: falló la lectura de tabla de números de línea"
-+
-+#: coffcode.h:4339
-+msgid "%B: warning: illegal symbol index %ld in line numbers"
-+msgstr "%B: aviso: índice de símbolos %ld ilegal en los números de línea"
-+
-+#: coffcode.h:4353
-+msgid "%B: warning: duplicate line number information for `%s'"
-+msgstr "%B: aviso: información duplicada de números de línea para `%s'"
-+
-+#: coffcode.h:4744
-+msgid "%B: Unrecognized storage class %d for %s symbol `%s'"
-+msgstr "%B: Clase de almacenamiento %d no reconocida para %s símbolo `%s'"
-+
-+#: coffcode.h:4870
-+msgid "warning: %B: local symbol `%s' has no section"
-+msgstr "aviso: %B: el símbolo local `%s' no tiene sección"
-+
-+#: coffcode.h:5013
-+msgid "%B: illegal relocation type %d at address 0x%lx"
-+msgstr "%B: tipo de reubicación %d ilegal en la dirección 0x%lx"
-+
-+#: coffgen.c:1518
-+msgid "%B: bad string table size %lu"
-+msgstr "%B: tamaño de tabla de cadenas %lu erróneo"
-+
-+#: cofflink.c:513 elflink.c:4218
-+msgid "Warning: type of symbol `%s' changed from %d to %d in %B"
-+msgstr "Aviso: el tipo del símbolo `%s' cambió de %d a %d en %B"
-+
-+#: cofflink.c:2296
-+msgid "%B: relocs in section `%A', but it has no contents"
-+msgstr "%B: reubicaciones en la sección `%A', pero no tiene contenido"
-+
-+#: cofflink.c:2627 coffswap.h:824
-+#, c-format
-+msgid "%s: %s: reloc overflow: 0x%lx > 0xffff"
-+msgstr "%s: %s: desbordamiento de reubicación: 0x%lx > 0xffff"
-+
-+#: cofflink.c:2636 coffswap.h:810
-+#, c-format
-+msgid "%s: warning: %s: line number overflow: 0x%lx > 0xffff"
-+msgstr "%s: aviso: %s: desbordamiento de número de línea: 0x%lx > 0xffff"
-+
- #: cpu-arm.c:189 cpu-arm.c:200
- msgid "ERROR: %B is compiled for the EP9312, whereas %B is compiled for XScale"
- msgstr "ERROR: %B está compilado para el EP9312, mientras que %B está compilado para XScale"
-@@ -505,66 +506,50 @@ msgstr "ERROR: %B est
- msgid "warning: unable to update contents of %s section in %s"
- msgstr "aviso: no se puede actualizar el contenido de la sección %s en %s"
--#: dwarf2.c:481
--msgid "Dwarf Error: Can't find .debug_str section."
--msgstr "Error de Dwarf: No se puede encontrar la sección .debug_str."
--
--#: dwarf2.c:499
-+#: dwarf2.c:424
- #, c-format
--msgid "Dwarf Error: DW_FORM_strp offset (%lu) greater than or equal to .debug_str size (%lu)."
--msgstr "Error de Dwarf: El desplazamiento DW_FROM_strp (%lu) es más grande o igual que el tamaño de .debug_str (%lu)."
-+msgid "Dwarf Error: Can't find %s section."
-+msgstr "Error de Dwarf: No se puede encontrar la sección %s."
--#: dwarf2.c:592
--msgid "Dwarf Error: Can't find .debug_abbrev section."
--msgstr "Error de Dwarf: No se puede encontrar la sección .debug_abbrev."
-+#: dwarf2.c:452
-+#, c-format
-+msgid "Dwarf Error: unable to decompress %s section."
-+msgstr "Error de Dwarf: no se puede descomprimir la sección %s."
--#: dwarf2.c:607
-+#: dwarf2.c:462
- #, c-format
--msgid "Dwarf Error: Abbrev offset (%lu) greater than or equal to .debug_abbrev size (%lu)."
--msgstr "Error de Dwarf: El desplazamiento de abreviatura (%lu) es más grande o igual que el tamaño de .debug_abbrev (%lu)."
-+msgid "Dwarf Error: Offset (%lu) greater than or equal to %s size (%lu)."
-+msgstr "Error de Dwarf: El desplazamiento (%lu) es mayor que o igual que el tamaño de %s (%lu)."
--#: dwarf2.c:822
-+#: dwarf2.c:849
- #, c-format
- msgid "Dwarf Error: Invalid or unhandled FORM value: %u."
- msgstr "Error de Dwarf: Valor de FORM inválido o no manejado: %u."
--#: dwarf2.c:1025
-+#: dwarf2.c:1063
- msgid "Dwarf Error: mangled line number section (bad file number)."
- msgstr "Error de Dwarf: sección de números de línea revuelta (número erróneo de fichero)."
--#: dwarf2.c:1137
--msgid "Dwarf Error: Can't find .debug_line section."
--msgstr "Error de Dwarf: No se puede encontrar lan sección .debug_line."
--
--#: dwarf2.c:1154
--#, c-format
--msgid "Dwarf Error: Line offset (%lu) greater than or equal to .debug_line size (%lu)."
--msgstr "Error de Dwarf: El desplazamiento de línea (%lu) es más grande o igual que el tamaño de .debug_line (%lu)."
--
--#: dwarf2.c:1380
-+#: dwarf2.c:1393
- msgid "Dwarf Error: mangled line number section."
- msgstr "Error de Dwarf: sección de números de línea revuelta."
--#: dwarf2.c:1568
--msgid "Dwarf Error: Can't find .debug_ranges section."
--msgstr "Error de Dwarf: No se puede encontrar lan sección .debug_ranges."
--
--#: dwarf2.c:1731 dwarf2.c:1847 dwarf2.c:2119
-+#: dwarf2.c:1726 dwarf2.c:1842 dwarf2.c:2114
- #, c-format
- msgid "Dwarf Error: Could not find abbrev number %u."
- msgstr "Error de Dwarf: No se puede encontrar el número de abreviatura %u."
--#: dwarf2.c:2080
-+#: dwarf2.c:2075
- #, c-format
- msgid "Dwarf Error: found dwarf version '%u', this reader only handles version 2 information."
- msgstr "Error de Dwarf: se encontró la versión de dwarf '%u', este lector solamente maneja información de la versión 2."
--#: dwarf2.c:2087
-+#: dwarf2.c:2082
- #, c-format
- msgid "Dwarf Error: found address size '%u', this reader can not handle sizes greater than '%u'."
- msgstr "Error de Dwarf: se encontró el tamaño de dirección '%u', este lector no puede manejar tamaños más grandes que '%u'."
--#: dwarf2.c:2110
-+#: dwarf2.c:2105
- #, c-format
- msgid "Dwarf Error: Bad abbrev number: %u."
- msgstr "Error de Dwarf: Número de abreviación erróneo: %u."
-@@ -646,35 +631,271 @@ msgstr ""
- "\n"
- "      Tipo: %s"
--#: elf32-arm.c:2524
-+#: elf-attrs.c:582
-+msgid "ERROR: %B: Must be processed by '%s' toolchain"
-+msgstr "ERROR: %B: Se debe procesar por la cadena de compilación '%s'"
-+
-+#: elf-attrs.c:602 elf-attrs.c:621
-+msgid "ERROR: %B: Incompatible object tag '%s':%d"
-+msgstr "ERROR: %B: Etiqueta de objeto '%s' incompatible:%d"
-+
-+#: elf-eh-frame.c:866
-+msgid "%P: error in %B(%A); no .eh_frame_hdr table will be created.\n"
-+msgstr "%P: error en %B(%A); no se creará la tabla .eh_frame_hdr.\n"
-+
-+#: elf-eh-frame.c:1102
-+msgid "%P: fde encoding in %B(%A) prevents .eh_frame_hdr table being created.\n"
-+msgstr "%P: la codificación fde en %B(%A) previene la creación de la tabla .eh_frame_hdr.\n"
-+
-+#: elf-hppa.h:2241 elf-m10300.c:1546 elf32-arm.c:7954 elf32-i386.c:3582
-+#: elf32-m32r.c:2598 elf32-m68k.c:3516 elf32-ppc.c:7223 elf32-s390.c:3058
-+#: elf32-sh.c:3438 elf32-xtensa.c:3021 elf64-ppc.c:11528 elf64-s390.c:3019
-+#: elf64-sh64.c:1648 elf64-x86-64.c:3239 elfxx-sparc.c:3336
-+msgid "%B(%A+0x%lx): unresolvable %s relocation against symbol `%s'"
-+msgstr "%B(%A+0x%lx): reubicación %s sin resolución contra el símbolo `%s'"
-+
-+#: elf-hppa.h:2266 elf-hppa.h:2280
-+msgid "%B(%A): warning: unresolvable relocation against symbol `%s'"
-+msgstr "%B(%A): aviso: reubicación sin resolución contra el símbolo `%s'"
-+
-+#: elf-m10200.c:456 elf-m10300.c:1609 elf32-avr.c:1250 elf32-bfin.c:3214
-+#: elf32-cr16.c:959 elf32-cr16c.c:790 elf32-cris.c:1538 elf32-crx.c:933
-+#: elf32-d10v.c:516 elf32-fr30.c:616 elf32-frv.c:4114 elf32-h8300.c:516
-+#: elf32-i860.c:1218 elf32-ip2k.c:1499 elf32-iq2000.c:691 elf32-m32c.c:560
-+#: elf32-m32r.c:3124 elf32-m68hc1x.c:1135 elf32-mep.c:541 elf32-msp430.c:493
-+#: elf32-mt.c:402 elf32-openrisc.c:411 elf32-score.c:2451 elf32-spu.c:4132
-+#: elf32-v850.c:1703 elf32-xstormy16.c:948 elf64-mmix.c:1533
-+msgid "internal error: out of range error"
-+msgstr "error interno: error fuera de rango"
-+
-+#: elf-m10200.c:460 elf-m10300.c:1613 elf32-avr.c:1254 elf32-bfin.c:3218
-+#: elf32-cr16.c:963 elf32-cr16c.c:794 elf32-cris.c:1542 elf32-crx.c:937
-+#: elf32-d10v.c:520 elf32-fr30.c:620 elf32-frv.c:4118 elf32-h8300.c:520
-+#: elf32-i860.c:1222 elf32-iq2000.c:695 elf32-m32c.c:564 elf32-m32r.c:3128
-+#: elf32-m68hc1x.c:1139 elf32-mep.c:545 elf32-msp430.c:497
-+#: elf32-openrisc.c:415 elf32-score.c:2455 elf32-spu.c:4136 elf32-v850.c:1707
-+#: elf32-xstormy16.c:952 elf64-mmix.c:1537 elfxx-mips.c:9065
-+msgid "internal error: unsupported relocation error"
-+msgstr "error interno: error de reubicación no admitida"
-+
-+#: elf-m10200.c:464 elf32-cr16.c:967 elf32-cr16c.c:798 elf32-crx.c:941
-+#: elf32-d10v.c:524 elf32-h8300.c:524 elf32-m32r.c:3132 elf32-m68hc1x.c:1143
-+#: elf32-score.c:2459 elf32-spu.c:4140
-+msgid "internal error: dangerous error"
-+msgstr "error interno: error peligroso"
-+
-+#: elf-m10200.c:468 elf-m10300.c:1626 elf32-avr.c:1262 elf32-bfin.c:3226
-+#: elf32-cr16.c:971 elf32-cr16c.c:802 elf32-cris.c:1550 elf32-crx.c:945
-+#: elf32-d10v.c:528 elf32-fr30.c:628 elf32-frv.c:4126 elf32-h8300.c:528
-+#: elf32-i860.c:1230 elf32-ip2k.c:1514 elf32-iq2000.c:703 elf32-m32c.c:572
-+#: elf32-m32r.c:3136 elf32-m68hc1x.c:1147 elf32-mep.c:553 elf32-msp430.c:505
-+#: elf32-mt.c:410 elf32-openrisc.c:423 elf32-score.c:2463 elf32-spu.c:4144
-+#: elf32-v850.c:1727 elf32-xstormy16.c:960 elf64-mmix.c:1545
-+msgid "internal error: unknown error"
-+msgstr "error interno: error desconocido"
-+
-+#: elf-m10300.c:1618
-+msgid "error: inappropriate relocation type for shared library (did you forget -fpic?)"
-+msgstr "error: tipo de reubicación inapropiada para la biblioteca compartida (¿olvidó -fpic?)"
-+
-+#: elf-m10300.c:1621
-+msgid "internal error: suspicious relocation type used in shared library"
-+msgstr "error interno: se usó un tipo de reubicación sospechosa en una biblioteca compartida"
-+
-+#: elf-m10300.c:4397 elf32-arm.c:9578 elf32-cris.c:2403 elf32-hppa.c:1921
-+#: elf32-i370.c:506 elf32-i386.c:1807 elf32-m32r.c:1931 elf32-m68k.c:2787
-+#: elf32-ppc.c:4693 elf32-s390.c:1687 elf32-sh.c:2583 elf32-vax.c:1055
-+#: elf64-ppc.c:6075 elf64-s390.c:1662 elf64-sh64.c:3432 elf64-x86-64.c:1641
-+#: elfxx-sparc.c:1828
-+#, c-format
-+msgid "dynamic variable `%s' is zero size"
-+msgstr "la variable dinámica `%s' es de tamaño cero"
-+
-+#: elf.c:328
-+msgid "%B: invalid string offset %u >= %lu for section `%s'"
-+msgstr "%B: desplazamiento de cadena inválido %u >= %lu para la sección `%s'"
-+
-+#: elf.c:438
-+msgid "%B symbol number %lu references nonexistent SHT_SYMTAB_SHNDX section"
-+msgstr "%B el número de símbolo %lu hace referencia a la sección inexistente SHT_SYMTAB_SHNDX"
-+
-+#: elf.c:594
-+msgid "%B: Corrupt size field in group section header: 0x%lx"
-+msgstr "%B: Tamaño de campo corrupto en el encabezado de la sección de grupo: 0x%lx"
-+
-+#: elf.c:630
-+msgid "%B: invalid SHT_GROUP entry"
-+msgstr "%B: entrada SHT_GROUP inválida"
-+
-+#: elf.c:700
-+msgid "%B: no group info for section %A"
-+msgstr "%B: no hay información de grupo para la sección %A"
-+
-+#: elf.c:729 elf.c:2976 elflink.c:9746
-+msgid "%B: warning: sh_link not set for section `%A'"
-+msgstr "%B: aviso: no se estableción sh_link para la sección `%A'"
-+
-+#: elf.c:748
-+msgid "%B: sh_link [%d] in section `%A' is incorrect"
-+msgstr "%B: sh_link [%d] en la sección `%A', es incorrecto"
-+
-+#: elf.c:783
-+msgid "%B: unknown [%d] section `%s' in group [%s]"
-+msgstr "%B: sección [%d] desconocida `%s' en el grupo [%s]"
-+
-+#: elf.c:1159
-+#, c-format
-+msgid ""
-+"\n"
-+"Program Header:\n"
-+msgstr ""
-+"\n"
-+"Encabezado del Programa:\n"
-+
-+#: elf.c:1201
-+#, c-format
-+msgid ""
-+"\n"
-+"Dynamic Section:\n"
-+msgstr ""
-+"\n"
-+"Sección Dinámica:\n"
-+
-+#: elf.c:1337
-+#, c-format
-+msgid ""
-+"\n"
-+"Version definitions:\n"
-+msgstr ""
-+"\n"
-+"Definiciones de versión:\n"
-+
-+#: elf.c:1362
-+#, c-format
-+msgid ""
-+"\n"
-+"Version References:\n"
-+msgstr ""
-+"\n"
-+"Referencias de Versión:\n"
-+
-+#: elf.c:1367
-+#, c-format
-+msgid "  required from %s:\n"
-+msgstr "  requerido desde %s:\n"
-+
-+#: elf.c:1755
-+msgid "%B: invalid link %lu for reloc section %s (index %u)"
-+msgstr "%B: enlace %lu inválido para la sección de reubicación %s (índice %u)"
-+
-+#: elf.c:1924
-+msgid "%B: don't know how to handle allocated, application specific section `%s' [0x%8x]"
-+msgstr "%B: no se sabe cómo manejar lo reservado, aplicación específica de la sección `%s' [0x%8x]"
-+
-+#: elf.c:1936
-+msgid "%B: don't know how to handle processor specific section `%s' [0x%8x]"
-+msgstr "%B: no se sabe cómo manejar la sección específica de procesador `%s' [0x%8x]"
-+
-+#: elf.c:1947
-+msgid "%B: don't know how to handle OS specific section `%s' [0x%8x]"
-+msgstr "%B: no se sabe cómo manejar la sección específica de SO `%s' [0x%8x]"
-+
-+#: elf.c:1957
-+msgid "%B: don't know how to handle section `%s' [0x%8x]"
-+msgstr "%B: no se sabe cómo manejar la sección `%s' [0x%8x]"
-+
-+#: elf.c:2555
-+#, c-format
-+msgid "warning: section `%A' type changed to PROGBITS"
-+msgstr "aviso: el tipo de la sección `%A' cambió a PROGBITS"
-+
-+#: elf.c:2933
-+msgid "%B: sh_link of section `%A' points to discarded section `%A' of `%B'"
-+msgstr "%B: sh_link de la sección `%A' apunta a la sección descartada `%A' de `%B'"
-+
-+#: elf.c:2956
-+msgid "%B: sh_link of section `%A' points to removed section `%A' of `%B'"
-+msgstr "%B: sh_link de la sección `%A' apunta a la sección descartada `%A' de `%B'"
-+
-+#: elf.c:4300
-+msgid "%B: The first section in the PT_DYNAMIC segment is not the .dynamic section"
-+msgstr "%B: La primera sección en el segmento PT_DYNAMIC no es la sección .dynamic"
-+
-+#: elf.c:4327
-+msgid "%B: Not enough room for program headers, try linking with -N"
-+msgstr "%B: No hay suficiente espacio para los encabezados del programa, pruebe enlazar con -N"
-+
-+#: elf.c:4404
-+msgid "%B: section %A vma 0x%lx overlaps previous sections"
-+msgstr "%B: la sección %A vma 0x%lx traslapa las secciones anteriores"
-+
-+#: elf.c:4499
-+msgid "%B: section `%A' can't be allocated in segment %d"
-+msgstr "%B: la sección `%A' no se puede asignar en el segmento %d"
-+
-+#: elf.c:4549
-+msgid "%B: warning: allocated section `%s' not in segment"
-+msgstr "%B: aviso: la sección asignada `%s' no está en el segmento"
-+
-+#: elf.c:5064
-+msgid "%B: symbol `%s' required but not present"
-+msgstr "%B: se requiere el símbolo `%s' pero no está presente"
-+
-+#: elf.c:5403
-+msgid "%B: warning: Empty loadable segment detected, is this intentional ?\n"
-+msgstr "%B: aviso: Se detectó un segmento cargable vacío, ¿ esto es intencional ?\n"
-+
-+#: elf.c:6366
-+#, c-format
-+msgid "Unable to find equivalent output section for symbol '%s' from section '%s'"
-+msgstr "No se puede encontrar la sección de salida equivalente para el símbolo '%s' de la sección '%s'"
-+
-+#: elf.c:7346
-+msgid "%B: unsupported relocation type %s"
-+msgstr "%B: no se admite el tipo de reubicación %s"
-+
-+#: elf32-arm.c:2846 elf32-arm.c:2878
-+msgid ""
-+"%B(%s): warning: interworking not enabled.\n"
-+"  first occurrence: %B: Thumb call to ARM"
-+msgstr ""
-+"%B(%s): aviso: no se activó la interoperabilidad.\n"
-+"  primer suceso: %B: llamada Thumb para ARM"
-+
-+#: elf32-arm.c:3041
-+#, c-format
-+msgid "%s: cannot create stub entry %s"
-+msgstr "%s: no se puede crear la entrada de cabo %s"
-+
-+#: elf32-arm.c:3825
- #, c-format
- msgid "unable to find THUMB glue '%s' for '%s'"
- msgstr "no se puede encontrar el pegamento THUMB '%s' para `%s'"
--#: elf32-arm.c:2557
-+#: elf32-arm.c:3859
- #, c-format
- msgid "unable to find ARM glue '%s' for '%s'"
- msgstr "no se puede encontrar el pegamento ARM '%s' para `%s'"
--#: elf32-arm.c:3127
-+#: elf32-arm.c:4463
- msgid "%B: BE8 images only valid in big-endian mode."
- msgstr "%B: las imágenes BE8 sólo son válidas en modo big-endian."
- #. Give a warning, but do as the user requests anyway.
--#: elf32-arm.c:3331
-+#: elf32-arm.c:4678
- msgid "%B: warning: selected VFP11 erratum workaround is not necessary for target architecture"
- msgstr "%B: aviso: no se necesita la alternativa para evita la errata del VFP11 seleccionado para la arquitectura objetivo"
--#: elf32-arm.c:3865 elf32-arm.c:3885
-+#: elf32-arm.c:5212 elf32-arm.c:5232
- msgid "%B: unable to find VFP11 veneer `%s'"
- msgstr "%B: no se puede encontrar la chapa de VFP11 `%s'"
--#: elf32-arm.c:3930
-+#: elf32-arm.c:5278
- #, c-format
- msgid "Invalid TARGET2 relocation type '%s'."
- msgstr "Tipo de reubicación TARGET2 '%s' inválido."
--#: elf32-arm.c:4071
-+#: elf32-arm.c:5362
- msgid ""
- "%B(%s): warning: interworking not enabled.\n"
- "  first occurrence: %B: thumb call to arm"
-@@ -682,374 +903,326 @@ msgstr ""
- "%s(%s): aviso: no se activó la interoperabilidad.\n"
- "  primer suceso: %B: llamada thumb para arm"
--#: elf32-arm.c:4759
-+#: elf32-arm.c:6094
- msgid "\\%B: Warning: Arm BLX instruction targets Arm function '%s'."
- msgstr "\\%B: Aviso: La instrucción Arm BLX apunta a la función Arm '%s'."
--#: elf32-arm.c:5059
-+#: elf32-arm.c:6418
- msgid "%B: Warning: Thumb BLX instruction targets thumb function '%s'."
- msgstr "%B: Aviso: La instrucción Thumb BLX apunta a la función thumb '%s'."
--#: elf32-arm.c:5689
-+#: elf32-arm.c:7095
- msgid "%B(%A+0x%lx): R_ARM_TLS_LE32 relocation not permitted in shared object"
- msgstr "%B(%A+0x%lx): la reubicación R_ARM_TLS_LE32 no se permite en objetos compartidos"
--#: elf32-arm.c:5890
-+#: elf32-arm.c:7310
- msgid "%B(%A+0x%lx): Only ADD or SUB instructions are allowed for ALU group relocations"
- msgstr "%B(%A+0x%lx): Sólo se permiten las instrucciones ADD o SUB para la reubicación de grupo ALU"
--#: elf32-arm.c:5930 elf32-arm.c:6017 elf32-arm.c:6100 elf32-arm.c:6185
-+#: elf32-arm.c:7350 elf32-arm.c:7437 elf32-arm.c:7520 elf32-arm.c:7605
- msgid "%B(%A+0x%lx): Overflow whilst splitting 0x%lx for group relocation %s"
- msgstr "%B(%A+0x%lx): Desborde al dividirse 0x%lx para la reubicación de grupo %s"
--#: elf32-arm.c:6369 elf32-sh.c:3304 elf64-sh64.c:1556
-+#: elf32-arm.c:7812 elf32-sh.c:3334 elf64-sh64.c:1556
- msgid "%B(%A+0x%lx): %s relocation against SEC_MERGE section"
- msgstr "%B(%A+0x%lx): reubicación %s contra la sección SEC_MERGE"
--#: elf32-arm.c:6458 elf64-ppc.c:9973
-+#: elf32-arm.c:7930 elf32-xtensa.c:2759 elf64-ppc.c:10374
- msgid "%B(%A+0x%lx): %s used with TLS symbol %s"
- msgstr "%B(%A+0x%lx): se usó %s con el símbolo TLS %s"
--#: elf32-arm.c:6459 elf64-ppc.c:9974
-+#: elf32-arm.c:7931 elf32-xtensa.c:2760 elf64-ppc.c:10375
- msgid "%B(%A+0x%lx): %s used with non-TLS symbol %s"
- msgstr "%B(%A+0x%lx): se usó %s con el símbolo %s que no es TLS"
--#: elf32-arm.c:6482 elf32-i386.c:3310 elf32-m32r.c:2598 elf32-m68k.c:1982
--#: elf32-ppc.c:6796 elf32-s390.c:3048 elf32-sh.c:3408 elf32-xtensa.c:2290
--#: elf64-ppc.c:11138 elf64-s390.c:3009 elf64-sh64.c:1648 elf64-x86-64.c:3002
--#: elf-hppa.h:2194 elf-m10300.c:1460 elfxx-sparc.c:3256
--msgid "%B(%A+0x%lx): unresolvable %s relocation against symbol `%s'"
--msgstr "%B(%A+0x%lx): reubicación %s sin resolución contra el símbolo `%s'"
--
--#: elf32-arm.c:6516
-+#: elf32-arm.c:7988
- msgid "out of range"
- msgstr "fuera de rango"
--#: elf32-arm.c:6520
-+#: elf32-arm.c:7992
- msgid "unsupported relocation"
- msgstr "no se admite la reubicación"
--#: elf32-arm.c:6528
-+#: elf32-arm.c:8000
- msgid "unknown error"
- msgstr "error desconocido"
--#: elf32-arm.c:6628
-+#: elf32-arm.c:8099
- msgid "Warning: Clearing the interworking flag of %B because non-interworking code in %B has been linked with it"
- msgstr "Aviso: Se limpia la opción de interoperación en %B porque se ha enlazado con él código no interoperable en %B"
--#: elf32-arm.c:6730
-+#: elf32-arm.c:8205
- msgid "ERROR: %B uses VFP register arguments, %B does not"
- msgstr "ERROR: %B utiliza argumentos de registro VFP, mientras que %B no"
--#: elf32-arm.c:6780
-+#: elf32-arm.c:8254
- msgid "ERROR: %B: Conflicting architecture profiles %c/%c"
- msgstr "ERROR: %B: Perfiles de arquitecturas en conflicto %c/%c"
--#: elf32-arm.c:6795
-+#: elf32-arm.c:8274
- msgid "Warning: %B: Conflicting platform configuration"
- msgstr "Aviso: %B: Configuración de plataformas en conflicto"
--#: elf32-arm.c:6804
-+#: elf32-arm.c:8283
- msgid "ERROR: %B: Conflicting use of R9"
- msgstr "ERROR: %B: Uso en conflicto de R9"
--#: elf32-arm.c:6816
-+#: elf32-arm.c:8295
- msgid "ERROR: %B: SB relative addressing conflicts with use of R9"
- msgstr "ERROR: %B: El direccionamiento relativo a SB tiene conflictos con el uso de R9"
--#: elf32-arm.c:6838
--msgid "ERROR: %B: Conflicting definitions of wchar_t"
--msgstr "ERROR: %B: Definiciones en conflicto de wchar_t"
-+#: elf32-arm.c:8318
-+msgid "warning: %B uses %u-byte wchar_t yet the output is to use %u-byte wchar_t; use of wchar_t values across objects may fail"
-+msgstr "aviso: %B usa wchar_t de %u bytes aunque la salida usa wchar_t de %u bytes; el uso de valores wchar_t entre objetos puede fallar"
--#: elf32-arm.c:6867
-+#: elf32-arm.c:8347
- msgid "warning: %B uses %s enums yet the output is to use %s enums; use of enum values across objects may fail"
- msgstr "aviso: %B usa %s enums aunque la salida usa %s enums; el uso de valores enum entre objetos puede fallar"
--#: elf32-arm.c:6880
-+#: elf32-arm.c:8360
- msgid "ERROR: %B uses iWMMXt register arguments, %B does not"
- msgstr "ERROR: %B utiliza argumentos de registro iWMMXt, mientras que %B no"
--#: elf32-arm.c:6920
-+#: elf32-arm.c:8400
- msgid "Warning: %B: Unknown EABI object attribute %d"
- msgstr "Aviso: %B: Atributo de objeto EABI %d desconocido"
--#: elf32-arm.c:7045
-+#: elf32-arm.c:8460
-+msgid "ERROR: %B is already in final BE8 format"
-+msgstr "ERROR: %B ya está en el formato BE8 final"
-+
-+#: elf32-arm.c:8536
- msgid "ERROR: Source object %B has EABI version %d, but target %B has EABI version %d"
- msgstr "ERROR: El objeto fuente %B tiene EABI versión %d, pero el objetivo %B tiene EABI versión %d"
--#: elf32-arm.c:7061
-+#: elf32-arm.c:8552
- msgid "ERROR: %B is compiled for APCS-%d, whereas target %B uses APCS-%d"
- msgstr "ERROR: %B está compilado para APCS-%d mientras que el objetivo %B usa APCS-%d"
--#: elf32-arm.c:7086
-+#: elf32-arm.c:8577
- msgid "ERROR: %B uses VFP instructions, whereas %B does not"
- msgstr "ERROR: %B utiliza instrucciones VFP, mientras que %B no"
--#: elf32-arm.c:7090
-+#: elf32-arm.c:8581
- msgid "ERROR: %B uses FPA instructions, whereas %B does not"
- msgstr "ERROR: %B utiliza instrucciones FPA, mientras que %B no"
--#: elf32-arm.c:7100
-+#: elf32-arm.c:8591
- msgid "ERROR: %B uses Maverick instructions, whereas %B does not"
- msgstr "ERROR: %B utiliza instrucciones Maverick, mientras que %B no"
--#: elf32-arm.c:7104
-+#: elf32-arm.c:8595
- msgid "ERROR: %B does not use Maverick instructions, whereas %B does"
- msgstr "ERROR: %B no utiliza instrucciones Maverick, mientras que %B sí"
--#: elf32-arm.c:7123
-+#: elf32-arm.c:8614
- msgid "ERROR: %B uses software FP, whereas %B uses hardware FP"
- msgstr "ERROR: %B utiliza FP de software, mientras que %B utiliza FP de hardware"
--#: elf32-arm.c:7127
-+#: elf32-arm.c:8618
- msgid "ERROR: %B uses hardware FP, whereas %B uses software FP"
- msgstr "ERROR: %B utiliza FP de hardware, mientras que %B utiliza FP de software"
- #. Ignore init flag - it may not be set, despite the flags field
- #. containing valid data.
- #. Ignore init flag - it may not be set, despite the flags field containing valid data.
--#: elf32-arm.c:7174 elf32-bfin.c:4795 elf32-cris.c:3234 elf32-m68hc1x.c:1277
--#: elf32-m68k.c:620 elf32-score.c:3753 elf32-vax.c:538 elfxx-mips.c:11331
-+#: elf32-arm.c:8665 elf32-bfin.c:4899 elf32-cris.c:3235 elf32-m68hc1x.c:1279
-+#: elf32-m68k.c:774 elf32-score.c:3750 elf32-vax.c:538 elfxx-mips.c:12699
- #, c-format
- msgid "private flags = %lx:"
- msgstr "opciones privadas = %lx:"
--#: elf32-arm.c:7183
-+#: elf32-arm.c:8674
- #, c-format
- msgid " [interworking enabled]"
- msgstr " [interoperabilidad activada]"
--#: elf32-arm.c:7191
-+#: elf32-arm.c:8682
- #, c-format
- msgid " [VFP float format]"
- msgstr " [formato de coma flotante VFP]"
--#: elf32-arm.c:7193
-+#: elf32-arm.c:8684
- #, c-format
- msgid " [Maverick float format]"
- msgstr " [formato de coma flotante Maverick]"
--#: elf32-arm.c:7195
-+#: elf32-arm.c:8686
- #, c-format
- msgid " [FPA float format]"
- msgstr " [formato de coma flotante FPA]"
--#: elf32-arm.c:7204
-+#: elf32-arm.c:8695
- #, c-format
- msgid " [new ABI]"
- msgstr " [ABI nuevo]"
--#: elf32-arm.c:7207
-+#: elf32-arm.c:8698
- #, c-format
- msgid " [old ABI]"
- msgstr " [ABI antiguo]"
--#: elf32-arm.c:7210
-+#: elf32-arm.c:8701
- #, c-format
- msgid " [software FP]"
- msgstr " [FP por software]"
--#: elf32-arm.c:7219
-+#: elf32-arm.c:8710
- #, c-format
- msgid " [Version1 EABI]"
- msgstr " [EABI Version1]"
--#: elf32-arm.c:7222 elf32-arm.c:7233
-+#: elf32-arm.c:8713 elf32-arm.c:8724
- #, c-format
- msgid " [sorted symbol table]"
- msgstr " [tabla de símbolos ordenados]"
--#: elf32-arm.c:7224 elf32-arm.c:7235
-+#: elf32-arm.c:8715 elf32-arm.c:8726
- #, c-format
- msgid " [unsorted symbol table]"
- msgstr " [tabla de símbolos sin ordenar]"
--#: elf32-arm.c:7230
-+#: elf32-arm.c:8721
- #, c-format
- msgid " [Version2 EABI]"
- msgstr " [EABI Version2]"
--#: elf32-arm.c:7238
-+#: elf32-arm.c:8729
- #, c-format
- msgid " [dynamic symbols use segment index]"
- msgstr " [los símbolos dinámicos utilizan índices de segmento]"
--#: elf32-arm.c:7241
-+#: elf32-arm.c:8732
- #, c-format
- msgid " [mapping symbols precede others]"
- msgstr " [el mapeo de símbolos precede a otros]"
--#: elf32-arm.c:7248
-+#: elf32-arm.c:8739
- #, c-format
- msgid " [Version3 EABI]"
- msgstr " [EABI Version3]"
--#: elf32-arm.c:7252
-+#: elf32-arm.c:8743
- #, c-format
- msgid " [Version4 EABI]"
- msgstr " [EABI Version4]"
--#: elf32-arm.c:7256
-+#: elf32-arm.c:8747
- #, c-format
- msgid " [Version5 EABI]"
- msgstr " [EABI Version5]"
--#: elf32-arm.c:7259
-+#: elf32-arm.c:8750
- #, c-format
- msgid " [BE8]"
- msgstr " [BE8]"
--#: elf32-arm.c:7262
-+#: elf32-arm.c:8753
- #, c-format
- msgid " [LE8]"
- msgstr " [LE8]"
--#: elf32-arm.c:7268
-+#: elf32-arm.c:8759
- #, c-format
- msgid " <EABI version unrecognised>"
- msgstr " <versión de EABI no reconocida>"
--#: elf32-arm.c:7275
-+#: elf32-arm.c:8766
- #, c-format
- msgid " [relocatable executable]"
- msgstr " [ejecutable reubicable]"
--#: elf32-arm.c:7278
-+#: elf32-arm.c:8769
- #, c-format
- msgid " [has entry point]"
- msgstr " [tiene punto de entrada]"
--#: elf32-arm.c:7283
-+#: elf32-arm.c:8774
- #, c-format
- msgid "<Unrecognised flag bits set>"
- msgstr "<Conjunto de bits de opción sin reconocer>"
--#: elf32-arm.c:7522 elf32-i386.c:961 elf32-s390.c:1003 elf32-xtensa.c:814
--#: elf64-s390.c:958 elf64-x86-64.c:773 elfxx-sparc.c:1115
-+#: elf32-arm.c:9013 elf32-i386.c:1236 elf32-s390.c:1006 elf32-xtensa.c:999
-+#: elf64-s390.c:961 elf64-x86-64.c:1016 elfxx-sparc.c:1127
- msgid "%B: bad symbol index: %d"
- msgstr "%B: índice de símbolos erróneo: %d"
--#: elf32-arm.c:8080 elf32-cris.c:2400 elf32-hppa.c:1906 elf32-i370.c:506
--#: elf32-i386.c:1522 elf32-m32r.c:1931 elf32-m68k.c:1331 elf32-ppc.c:4314
--#: elf32-s390.c:1679 elf32-sh.c:2584 elf32-vax.c:1050 elf64-ppc.c:5898
--#: elf64-s390.c:1654 elf64-sh64.c:3438 elf64-x86-64.c:1382 elf-m10300.c:4207
--#: elfxx-sparc.c:1797
--#, c-format
--msgid "dynamic variable `%s' is zero size"
--msgstr "la variable dinámica `%s' es de tamaño cero"
--
--#: elf32-arm.c:8603
-+#: elf32-arm.c:10125
- #, c-format
- msgid "Errors encountered processing file %s"
- msgstr "Se encontraron errores al procesar el fichero %s"
--#: elf32-arm.c:9839 elf32-arm.c:9861
-+#: elf32-arm.c:11526 elf32-arm.c:11548
- msgid "%B: error: VFP11 veneer out of range"
- msgstr "%B: error: la chapa VFP11 está fuera de rango"
--#: elf32-avr.c:1253 elf32-bfin.c:2795 elf32-cr16.c:887 elf32-cr16c.c:790
--#: elf32-cris.c:1538 elf32-crx.c:933 elf32-d10v.c:517 elf32-fr30.c:616
--#: elf32-frv.c:4129 elf32-h8300.c:516 elf32-i860.c:1218 elf32-ip2k.c:1499
--#: elf32-iq2000.c:647 elf32-m32c.c:560 elf32-m32r.c:3124 elf32-m68hc1x.c:1133
--#: elf32-mep.c:642 elf32-msp430.c:497 elf32-mt.c:402 elf32-openrisc.c:411
--#: elf32-score.c:2456 elf32-spu.c:2813 elf32-v850.c:1701 elf32-xstormy16.c:946
--#: elf64-mmix.c:1533 elf-m10200.c:456 elf-m10300.c:1523
--msgid "internal error: out of range error"
--msgstr "error interno: error fuera de rango"
--
--#: elf32-avr.c:1257 elf32-bfin.c:2799 elf32-cr16.c:891 elf32-cr16c.c:794
--#: elf32-cris.c:1542 elf32-crx.c:937 elf32-d10v.c:521 elf32-fr30.c:620
--#: elf32-frv.c:4133 elf32-h8300.c:520 elf32-i860.c:1222 elf32-iq2000.c:651
--#: elf32-m32c.c:564 elf32-m32r.c:3128 elf32-m68hc1x.c:1137 elf32-mep.c:646
--#: elf32-msp430.c:501 elf32-openrisc.c:415 elf32-score.c:2460 elf32-spu.c:2817
--#: elf32-v850.c:1705 elf32-xstormy16.c:950 elf64-mmix.c:1537 elf-m10200.c:460
--#: elf-m10300.c:1527 elfxx-mips.c:8025
--msgid "internal error: unsupported relocation error"
--msgstr "error interno: error de reubicación no admitida"
--
--#: elf32-avr.c:1261 elf32-bfin.c:2803 elf32-cris.c:1546 elf32-fr30.c:624
--#: elf32-frv.c:4137 elf32-i860.c:1226 elf32-ip2k.c:1510 elf32-iq2000.c:655
--#: elf32-m32c.c:568 elf32-mep.c:650 elf32-msp430.c:505 elf32-mt.c:406
--#: elf32-openrisc.c:419 elf32-v850.c:1709 elf32-xstormy16.c:954
-+#: elf32-avr.c:1258 elf32-bfin.c:3222 elf32-cris.c:1546 elf32-fr30.c:624
-+#: elf32-frv.c:4122 elf32-i860.c:1226 elf32-ip2k.c:1510 elf32-iq2000.c:699
-+#: elf32-m32c.c:568 elf32-mep.c:549 elf32-msp430.c:501 elf32-mt.c:406
-+#: elf32-openrisc.c:419 elf32-v850.c:1711 elf32-xstormy16.c:956
- #: elf64-mmix.c:1541
- msgid "internal error: dangerous relocation"
- msgstr "error interno: reubicación peligrosa"
--#: elf32-avr.c:1265 elf32-bfin.c:2807 elf32-cr16.c:899 elf32-cr16c.c:802
--#: elf32-cris.c:1550 elf32-crx.c:945 elf32-d10v.c:529 elf32-fr30.c:628
--#: elf32-frv.c:4141 elf32-h8300.c:528 elf32-i860.c:1230 elf32-ip2k.c:1514
--#: elf32-iq2000.c:659 elf32-m32c.c:572 elf32-m32r.c:3136 elf32-m68hc1x.c:1145
--#: elf32-mep.c:654 elf32-msp430.c:509 elf32-mt.c:410 elf32-openrisc.c:423
--#: elf32-score.c:2468 elf32-spu.c:2825 elf32-v850.c:1725 elf32-xstormy16.c:958
--#: elf64-mmix.c:1545 elf-m10200.c:468 elf-m10300.c:1540
--msgid "internal error: unknown error"
--msgstr "error interno: error desconocido"
--
--#: elf32-avr.c:2369 elf32-hppa.c:595 elf32-m68hc1x.c:164 elf64-ppc.c:3802
-+#: elf32-avr.c:2396 elf32-hppa.c:605 elf32-m68hc1x.c:164 elf64-ppc.c:3983
- msgid "%B: cannot create stub entry %s"
- msgstr "%B: no se puede crear la entrada de cabo %s"
--#: elf32-bfin.c:2274
-+#: elf32-bfin.c:1585
-+msgid "%B(%A+0x%lx): unresolvable relocation against symbol `%s'"
-+msgstr "%B(%A+0x%lx): reubicación sin resolución contra el símbolo `%s'"
-+
-+#: elf32-bfin.c:1618 elf32-i386.c:3623 elf32-m68k.c:3557 elf32-s390.c:3110
-+#: elf64-s390.c:3071 elf64-x86-64.c:3278
-+msgid "%B(%A+0x%lx): reloc against `%s': error %d"
-+msgstr "%B(%A+0x%lx): reubicación contra `%s': error %d"
-+
-+#: elf32-bfin.c:2711
- msgid "%B: relocation at `%A+0x%x' references symbol `%s' with nonzero addend"
- msgstr "%B: la reubicación en `%A+0x%x' referencía al símbolo `%s' con adición que no es cero"
--#: elf32-bfin.c:2288 elf32-frv.c:2919
-+#: elf32-bfin.c:2725 elf32-frv.c:2904
- msgid "relocation references symbol not defined in the module"
- msgstr "la reubicación referencía un símbolo que no está definido en el módulo"
--#: elf32-bfin.c:2385
-+#: elf32-bfin.c:2822
- msgid "R_BFIN_FUNCDESC references dynamic symbol with nonzero addend"
- msgstr "R_BFIN_FUNCDESC referencía un símbolo dinámico con adición que no es cero"
--#: elf32-bfin.c:2424 elf32-bfin.c:2547 elf32-frv.c:3656 elf32-frv.c:3777
-+#: elf32-bfin.c:2861 elf32-bfin.c:2987 elf32-frv.c:3641 elf32-frv.c:3762
- msgid "cannot emit fixups in read-only section"
- msgstr "no se pueden emitir composturas en la sección de sólo lectura"
--#: elf32-bfin.c:2452 elf32-bfin.c:2587 elf32-frv.c:3687 elf32-frv.c:3821
-+#: elf32-bfin.c:2889 elf32-bfin.c:3036 elf32-frv.c:3672 elf32-frv.c:3806
- msgid "cannot emit dynamic relocations in read-only section"
--msgstr "no se pueden emitri reubicaciones dinámicas en la sección de sólo lectura"
-+msgstr "no se pueden emitir reubicaciones dinámicas en la sección de sólo lectura"
--#: elf32-bfin.c:2505
-+#: elf32-bfin.c:2945
- msgid "R_BFIN_FUNCDESC_VALUE references dynamic symbol with nonzero addend"
- msgstr "R_BFIN_FUNCDESC_VALUE referencía un símbolo dinámico con adición que no es cero"
--#: elf32-bfin.c:2673
-+#: elf32-bfin.c:3126
- msgid "relocations between different segments are not supported"
- msgstr "no se admiten las reubicaciones entre segmentos diferentes"
--#: elf32-bfin.c:2674
-+#: elf32-bfin.c:3127
- msgid "warning: relocation references a different segment"
- msgstr "aviso: la reubicación referencía un segmento diferente"
--#: elf32-bfin.c:3083
--msgid "%B(%A+0x%lx): unresolvable relocation against symbol `%s'"
--msgstr "%B(%A+0x%lx): reubicación sin resolución contra el símbolo `%s'"
--
--#: elf32-bfin.c:3116 elf32-i386.c:3351 elf32-m68k.c:2023 elf32-s390.c:3100
--#: elf64-s390.c:3061 elf64-x86-64.c:3041
--msgid "%B(%A+0x%lx): reloc against `%s': error %d"
--msgstr "%B(%A+0x%lx): reubicación contra `%s': error %d"
--
--#: elf32-bfin.c:4687 elf32-frv.c:6423
-+#: elf32-bfin.c:4791 elf32-frv.c:6404
- msgid "%B: unsupported relocation type %i"
- msgstr "%B: no se admite el tipo de reubicación %i"
--#: elf32-bfin.c:4868 elf32-frv.c:6831
-+#: elf32-bfin.c:4944 elf32-frv.c:6812
- #, c-format
- msgid "%s: cannot link non-fdpic object file into fdpic executable"
- msgstr "%s: no se puede enlazar el fichero objeto que no es fdpic en un ejecutable fdpic"
--#: elf32-bfin.c:4872 elf32-frv.c:6835
-+#: elf32-bfin.c:4948 elf32-frv.c:6816
- #, c-format
- msgid "%s: cannot link fdpic object file into non-fdpic executable"
- msgstr "%s: no se puede enlazar el fichero objeto fdpic en un ejecutable que no es fdpic"
--#: elf32-cr16.c:895 elf32-cr16c.c:798 elf32-crx.c:941 elf32-d10v.c:525
--#: elf32-h8300.c:524 elf32-m32r.c:3132 elf32-m68hc1x.c:1141 elf32-score.c:2464
--#: elf32-spu.c:2821 elf-m10200.c:464
--msgid "internal error: dangerous error"
--msgstr "error interno: error peligroso"
--
- #: elf32-cris.c:1060
- msgid "%B, section %A: unresolvable relocation %s against symbol `%s'"
- msgstr "%B, sección %A: reubicación %s sin resolución contra el símbolo `%s'"
-@@ -1086,7 +1259,7 @@ msgstr "%B, secci
- msgid "%B: Internal inconsistency; no relocation section %s"
- msgstr "%B: Inconsistencia interna; no se encuentra la sección de reubicación %s"
--#: elf32-cris.c:2511
-+#: elf32-cris.c:2510
- msgid ""
- "%B, section %A:\n"
- "  v10/v32 compatible object %s must not contain a PIC relocation"
-@@ -1094,7 +1267,7 @@ msgstr ""
- "%B, sección %A:\n"
- "  el objeto %s compatible con v10/v32 no debe contener una reubicación PIC"
--#: elf32-cris.c:2698 elf32-cris.c:2766
-+#: elf32-cris.c:2697 elf32-cris.c:2765
- msgid ""
- "%B, section %A:\n"
- "  relocation %s should not be used in a shared object; recompile with -fPIC"
-@@ -1102,129 +1275,129 @@ msgstr ""
- "%B, sección %A:\n"
- "  la reubicación %s no se debe usar en un objeto compartido; recompile con -fPIC"
--#: elf32-cris.c:3183
-+#: elf32-cris.c:3184
- msgid "Unexpected machine number"
- msgstr "Número de máquina inesperado"
--#: elf32-cris.c:3237
-+#: elf32-cris.c:3238
- #, c-format
- msgid " [symbols have a _ prefix]"
- msgstr " [los símbolos tiene un prefijo _]"
--#: elf32-cris.c:3240
-+#: elf32-cris.c:3241
- #, c-format
- msgid " [v10 and v32]"
- msgstr " [v10 y v32]"
--#: elf32-cris.c:3243
-+#: elf32-cris.c:3244
- #, c-format
- msgid " [v32]"
- msgstr " [v32]"
--#: elf32-cris.c:3288
-+#: elf32-cris.c:3289
- msgid "%B: uses _-prefixed symbols, but writing file with non-prefixed symbols"
- msgstr "%B: utiliza símbolos con prefijo _, pero escribe el fichero con símbolos sin prefijo"
--#: elf32-cris.c:3289
-+#: elf32-cris.c:3290
- msgid "%B: uses non-prefixed symbols, but writing file with _-prefixed symbols"
- msgstr "%B: utiliza símbolos sin prefijo, pero escribe el fichero con símbolos con prefijo _"
--#: elf32-cris.c:3308
-+#: elf32-cris.c:3309
- msgid "%B contains CRIS v32 code, incompatible with previous objects"
- msgstr "%B contiene código CRIS v32, incompatible con objetos previos"
--#: elf32-cris.c:3310
-+#: elf32-cris.c:3311
- msgid "%B contains non-CRIS-v32 code, incompatible with previous objects"
- msgstr "%B contiene código que no es CRIS v32, incompatible con objetos previos"
--#: elf32-frv.c:1523 elf32-frv.c:1672
-+#: elf32-frv.c:1507 elf32-frv.c:1656
- msgid "relocation requires zero addend"
- msgstr "la reubicación requiere una adición cero"
--#: elf32-frv.c:2906
-+#: elf32-frv.c:2891
- msgid "%B(%A+0x%x): relocation to `%s+%x' may have caused the error above"
- msgstr "%B(%A+0x%x): la reubicación a `%s+%x' tal vez causó el error anterior"
--#: elf32-frv.c:2995
-+#: elf32-frv.c:2980
- msgid "R_FRV_GETTLSOFF not applied to a call instruction"
- msgstr "no se aplicó R_FRV_GETTLSOFF a una instrucción call"
--#: elf32-frv.c:3037
-+#: elf32-frv.c:3022
- msgid "R_FRV_GOTTLSDESC12 not applied to an lddi instruction"
- msgstr "no se aplicó R_FRV_GOTTLSDESC12 a una instrucción lddi"
--#: elf32-frv.c:3108
-+#: elf32-frv.c:3093
- msgid "R_FRV_GOTTLSDESCHI not applied to a sethi instruction"
- msgstr "no se aplicó R_FRV_GOTTLSDESCHI a una instrucción sethi"
--#: elf32-frv.c:3145
-+#: elf32-frv.c:3130
- msgid "R_FRV_GOTTLSDESCLO not applied to a setlo or setlos instruction"
- msgstr "no se aplicó R_FRV_GOTTLSDESCLO a una instrucción setlo o setlos"
--#: elf32-frv.c:3193
-+#: elf32-frv.c:3178
- msgid "R_FRV_TLSDESC_RELAX not applied to an ldd instruction"
- msgstr "no se aplicó R_FRV_GOTTLSDESC_RELAX a una instrucción ldd"
--#: elf32-frv.c:3277
-+#: elf32-frv.c:3262
- msgid "R_FRV_GETTLSOFF_RELAX not applied to a calll instruction"
- msgstr "no se aplicó R_FRV_GETTLSOFF_RELAX a una instrucción calll"
--#: elf32-frv.c:3332
-+#: elf32-frv.c:3317
- msgid "R_FRV_GOTTLSOFF12 not applied to an ldi instruction"
- msgstr "no se aplicó R_FRV_GOTTLSOFF12 a una instrucción ldi"
--#: elf32-frv.c:3362
-+#: elf32-frv.c:3347
- msgid "R_FRV_GOTTLSOFFHI not applied to a sethi instruction"
- msgstr "no se aplicó R_FRV_GOTTLSOFFHI a una instrucción sethi"
--#: elf32-frv.c:3391
-+#: elf32-frv.c:3376
- msgid "R_FRV_GOTTLSOFFLO not applied to a setlo or setlos instruction"
- msgstr "no se aplicó R_FRV_GOTTLSOFFLO a una instrucción setlo o setlos"
--#: elf32-frv.c:3422
-+#: elf32-frv.c:3407
- msgid "R_FRV_TLSOFF_RELAX not applied to an ld instruction"
- msgstr "no se aplicó R_FRV_TLSOFF_RELAX a una instrucción ld"
--#: elf32-frv.c:3467
-+#: elf32-frv.c:3452
- msgid "R_FRV_TLSMOFFHI not applied to a sethi instruction"
- msgstr "no se aplicó R_FRV_TLSMOFFHI a una instrucción sethi"
--#: elf32-frv.c:3494
-+#: elf32-frv.c:3479
- msgid "R_FRV_TLSMOFFLO not applied to a setlo or setlos instruction"
- msgstr "no se aplicó R_FRV_TLSMOFFLO a una instrucción setlo o setlos"
--#: elf32-frv.c:3615
-+#: elf32-frv.c:3600
- msgid "R_FRV_FUNCDESC references dynamic symbol with nonzero addend"
- msgstr "R_FRV_FUNCDESC referencía un símbolo dinámico con adición que no es cero"
--#: elf32-frv.c:3735
-+#: elf32-frv.c:3720
- msgid "R_FRV_FUNCDESC_VALUE references dynamic symbol with nonzero addend"
- msgstr "R_FRV_FUNCDESC_VALUE referencía un símbolo dinámico con adición que no es cero"
--#: elf32-frv.c:3992 elf32-frv.c:4148
-+#: elf32-frv.c:3977 elf32-frv.c:4133
- msgid "%B(%A+0x%lx): reloc against `%s': %s"
- msgstr "%B(%A+0x%lx): reubicación contra `%s': %s"
--#: elf32-frv.c:3994 elf32-frv.c:3998
-+#: elf32-frv.c:3979 elf32-frv.c:3983
- msgid "relocation references a different segment"
- msgstr "la reubicación referencía un segmento diferente"
--#: elf32-frv.c:6745
-+#: elf32-frv.c:6726
- #, c-format
- msgid "%s: compiled with %s and linked with modules that use non-pic relocations"
- msgstr "%s: compilado con %s y enlazado con módulos que usan reubicaciones que no son pic"
--#: elf32-frv.c:6798 elf32-iq2000.c:808 elf32-m32c.c:819
-+#: elf32-frv.c:6779 elf32-iq2000.c:852 elf32-m32c.c:814
- #, c-format
- msgid "%s: compiled with %s and linked with modules compiled with %s"
- msgstr "%s: compilado con %s y enlazado con módulos compilados con %s"
--#: elf32-frv.c:6810
-+#: elf32-frv.c:6791
- #, c-format
- msgid "%s: uses different unknown e_flags (0x%lx) fields than previous modules (0x%lx)"
- msgstr "%s: usa campos e_flags desconocidos (0x%lx) diferentes a aquéllos de los módulos previos (0x%lx)"
--#: elf32-frv.c:6860 elf32-iq2000.c:845 elf32-m32c.c:855 elf32-mt.c:587
-+#: elf32-frv.c:6841 elf32-iq2000.c:889 elf32-m32c.c:850 elf32-mt.c:583
- #, c-format
- msgid "private flags = 0x%lx:"
- msgstr "opciones privadas = 0x%lx:"
-@@ -1233,55 +1406,79 @@ msgstr "opciones privadas = 0x%lx:"
- msgid "%B: Relocations in generic ELF (EM: %d)"
- msgstr "%B: Reubicaciones en ELF genérico (EM: %d)"
--#: elf32-hppa.c:844 elf32-hppa.c:3577
-+#: elf32-hppa.c:854 elf32-hppa.c:3600
- msgid "%B(%A+0x%lx): cannot reach %s, recompile with -ffunction-sections"
- msgstr "%B(%A+0x%lx): no se puede alcanzar %s, recompile con -ffuntion-sections"
--#: elf32-hppa.c:1253
-+#: elf32-hppa.c:1263
- msgid "%B: relocation %s can not be used when making a shared object; recompile with -fPIC"
- msgstr "%B: no se puede usar la reubicación %s cuando se hace un objeto compartido; recompile con -fPIC"
--#: elf32-hppa.c:1506
-+#: elf32-hppa.c:1518
- #, c-format
- msgid "Could not find relocation section for %s"
- msgstr "No se puede encontrar la sección de reubicación para %s"
--#: elf32-hppa.c:2795
-+#: elf32-hppa.c:2810
- msgid "%B: duplicate export stub %s"
- msgstr "%B: cabo de exportación %s duplicado"
--#: elf32-hppa.c:3413
-+#: elf32-hppa.c:3436
- msgid "%B(%A+0x%lx): %s fixup for insn 0x%x is not supported in a non-shared link"
- msgstr "%B(%A+0x%lx): la compostura %s para la insn 0x%x no se admite en un enlazado que no es compartido"
--#: elf32-hppa.c:4267
-+#: elf32-hppa.c:4290
- msgid "%B(%A+0x%lx): cannot handle %s for %s"
- msgstr "%B(%A+0x%lx): no se puede manejar %s para %s"
--#: elf32-hppa.c:4574
-+#: elf32-hppa.c:4597
- msgid ".got section not immediately after .plt section"
- msgstr "la sección .got no está inmediatamente después de la sección .plt"
--#: elf32-i386.c:364 elf32-ppc.c:1616 elf32-s390.c:379 elf64-ppc.c:2148
--#: elf64-s390.c:403 elf64-x86-64.c:221
-+#: elf32-i386.c:362 elf32-ppc.c:1616 elf32-s390.c:379 elf64-ppc.c:2153
-+#: elf64-s390.c:403 elf64-x86-64.c:222
- msgid "%B: invalid relocation type %d"
- msgstr "%B: tipo de reubicación %d inválido"
--#: elf32-i386.c:1085 elf32-s390.c:1185 elf32-sh.c:5063 elf64-s390.c:1149
--#: elfxx-sparc.c:1243
-+#: elf32-i386.c:1183 elf64-x86-64.c:964
-+msgid "%B: TLS transition from %s to %s against `%s' at 0x%lx in section `%A' failed"
-+msgstr "%B: falló la transición TLS de %s para %s contra `%s' en 0x%lx en la sección `%A'"
-+
-+#: elf32-i386.c:1364 elf32-s390.c:1188 elf32-sh.c:5098 elf32-xtensa.c:1162
-+#: elf64-s390.c:1152 elfxx-sparc.c:1263
- msgid "%B: `%s' accessed both as normal and thread local symbol"
- msgstr "%B: se accesó `%s' como un símbolo normal y un símbolo local de hilo"
--#: elf32-i386.c:1200 elf32-s390.c:1294 elf64-ppc.c:4864 elf64-s390.c:1261
--#: elf64-x86-64.c:1051
-+#: elf32-i386.c:1479 elf32-s390.c:1297 elf64-ppc.c:5046 elf64-s390.c:1264
-+#: elf64-x86-64.c:1299
- msgid "%B: bad relocation section name `%s'"
- msgstr "%B: nombre de sección de reubicación `%s' erróneo"
--#: elf32-i386.c:2257
-+#: elf32-i386.c:2598
- msgid "%B: unrecognized relocation (0x%x) in section `%A'"
- msgstr "%B: no se reconoce la dirección de reubicación (0x%lx) en la sección `%A'"
--#: elf32-i386.c:2479
-+#: elf32-i386.c:2822 elf64-x86-64.c:2660
-+msgid "hidden symbol"
-+msgstr "símbolo oculto"
-+
-+#: elf32-i386.c:2825 elf64-x86-64.c:2663
-+msgid "internal symbol"
-+msgstr "símbolo interno"
-+
-+#: elf32-i386.c:2828 elf64-x86-64.c:2666
-+msgid "protected symbol"
-+msgstr "símbolos protegido"
-+
-+#: elf32-i386.c:2831 elf64-x86-64.c:2669
-+msgid "symbol"
-+msgstr "símbolo"
-+
-+#: elf32-i386.c:2836
-+msgid "%B: relocation R_386_GOTOFF against undefined %s `%s' can not be used when making a shared object"
-+msgstr "%B: no se puede usar la reubicación R_386_GOTOFF contra %s indefinida `%s' cuando se hace un objeto compartido"
-+
-+#: elf32-i386.c:2846
- msgid "%B: relocation R_386_GOTOFF against protected function `%s' can not be used when making a shared object"
- msgstr "%B: no se puede usar la reubicación R_386_GOTOFF contra la función protegida `%s' cuando se hace un objeto compartido"
-@@ -1308,7 +1505,7 @@ msgstr "enlazador ip2k: instrucci
- msgid "unsupported relocation between data/insn address spaces"
- msgstr "no se admite la reubicación entre espacios de direcciones datos/insn"
--#: elf32-iq2000.c:821 elf32-m32c.c:831
-+#: elf32-iq2000.c:865 elf32-m32c.c:826
- #, c-format
- msgid "%s: uses different e_flags (0x%lx) fields than previous modules (0x%lx)"
- msgstr "%s: usa campos de e_flags diferentes (0x%lx) que los módulos previos (0x%lx)"
-@@ -1345,86 +1542,94 @@ msgstr ": instrucciones m32rx"
- msgid ": m32r2 instructions"
- msgstr ": instrucciones m32r2"
--#: elf32-m68hc1x.c:1045
-+#: elf32-m68hc1x.c:1047
- #, c-format
- msgid "Reference to the far symbol `%s' using a wrong relocation may result in incorrect execution"
- msgstr "El referenciar al símbolo far `%s' usando una reubicación incorrecta puede resultar en una ejecución incorrecta"
--#: elf32-m68hc1x.c:1068
-+#: elf32-m68hc1x.c:1070
- #, c-format
- msgid "banked address [%lx:%04lx] (%lx) is not in the same bank as current banked address [%lx:%04lx] (%lx)"
- msgstr "la dirección almacenada [%lx:%04lx] (%lx) no está en el mismo banco que la dirección almacenada actual [%lx:%04lx] (%lx)"
--#: elf32-m68hc1x.c:1087
-+#: elf32-m68hc1x.c:1089
- #, c-format
- msgid "reference to a banked address [%lx:%04lx] in the normal address space at %04lx"
- msgstr "referencia a una dirección almacenada [%lx:%04lx] en el espacio normal de direcciones en %04lx"
--#: elf32-m68hc1x.c:1220
-+#: elf32-m68hc1x.c:1222
- msgid "%B: linking files compiled for 16-bit integers (-mshort) and others for 32-bit integers"
- msgstr "%B: se enlazan ficheros compilados con enteros de 16-bit (-mshort) y otros con enteros de 32-bit"
--#: elf32-m68hc1x.c:1227
-+#: elf32-m68hc1x.c:1229
- msgid "%B: linking files compiled for 32-bit double (-fshort-double) and others for 64-bit double"
- msgstr "%B: se enlazan ficheros compilados con dobles de 32-bit (-fshort-double) y otros con dobles de 64-bit"
--#: elf32-m68hc1x.c:1236
-+#: elf32-m68hc1x.c:1238
- msgid "%B: linking files compiled for HCS12 with others compiled for HC12"
- msgstr "%B: se enlazan ficheros compilados para HCS12, con otros compilados para HC12"
--#: elf32-m68hc1x.c:1252 elf32-ppc.c:3734 elf64-sparc.c:697 elfxx-mips.c:11292
-+#: elf32-m68hc1x.c:1254 elf32-ppc.c:4046 elf64-sparc.c:697 elfxx-mips.c:12561
- msgid "%B: uses different e_flags (0x%lx) fields than previous modules (0x%lx)"
- msgstr "%B: usa campos de e_flags diferentes (0x%lx) que los módulos previos (0x%lx)"
--#: elf32-m68hc1x.c:1280
-+#: elf32-m68hc1x.c:1282
- #, c-format
- msgid "[abi=32-bit int, "
- msgstr "[abi=int de 32-bit, "
--#: elf32-m68hc1x.c:1282
-+#: elf32-m68hc1x.c:1284
- #, c-format
- msgid "[abi=16-bit int, "
- msgstr "[abi=int de 16-bit, "
--#: elf32-m68hc1x.c:1285
-+#: elf32-m68hc1x.c:1287
- #, c-format
- msgid "64-bit double, "
- msgstr "doble de 64-bit, "
--#: elf32-m68hc1x.c:1287
-+#: elf32-m68hc1x.c:1289
- #, c-format
- msgid "32-bit double, "
- msgstr "doble de 32-bit, "
--#: elf32-m68hc1x.c:1290
-+#: elf32-m68hc1x.c:1292
- #, c-format
- msgid "cpu=HC11]"
- msgstr "cpu=HC11]"
--#: elf32-m68hc1x.c:1292
-+#: elf32-m68hc1x.c:1294
- #, c-format
- msgid "cpu=HCS12]"
- msgstr "cpu=HCS12]"
--#: elf32-m68hc1x.c:1294
-+#: elf32-m68hc1x.c:1296
- #, c-format
- msgid "cpu=HC12]"
- msgstr "cpu=HC12]"
--#: elf32-m68hc1x.c:1297
-+#: elf32-m68hc1x.c:1299
- #, c-format
- msgid " [memory=bank-model]"
- msgstr " [memoria=modelo de bancos]"
--#: elf32-m68hc1x.c:1299
-+#: elf32-m68hc1x.c:1301
- #, c-format
- msgid " [memory=flat]"
- msgstr " [memoria=plana]"
--#: elf32-m68k.c:635 elf32-m68k.c:636
-+#: elf32-m68k.c:789 elf32-m68k.c:790
- msgid "unknown"
- msgstr "desconocido"
-+#: elf32-m68k.c:1216
-+msgid "%B: GOT overflow: Number of R_68K_GOT8O relocations > %d"
-+msgstr "%B: desbordamiento de GOT: Número de reubicaciones R_68K_GOT80 > %d"
-+
-+#: elf32-m68k.c:1221
-+msgid "%B: GOT overflow: Number of R_68K_GOT8O and R_68K_GOT16O relocations > %d"
-+msgstr "%B desbordamiento de GOT: Número de reubicaciones R_68K_GOT80 Y R_68K_GOT160 > %d"
-+
- #: elf32-mcore.c:99 elf32-mcore.c:442
- msgid "%B: Relocation %s (%d) is not currently supported.\n"
- msgstr "%B: La reubicación %s (%d) actualmente no se admite.\n"
-@@ -1433,24 +1638,24 @@ msgstr "%B: La reubicaci
- msgid "%B: Unknown relocation type %d\n"
- msgstr "%B: Tipo de reubicación %d desconocido\n"
--#: elf32-mep.c:812
-+#: elf32-mep.c:654
- msgid "%B and %B are for different cores"
- msgstr "%B y %B son para núcleos diferentes"
--#: elf32-mep.c:829
-+#: elf32-mep.c:671
- msgid "%B and %B are for different configurations"
- msgstr "%B y %B son para configuraciones diferentes"
--#: elf32-mep.c:867
-+#: elf32-mep.c:709
- #, c-format
- msgid "private flags = 0x%lx"
- msgstr "opciones privadas = 0x%lx"
--#: elf32-mips.c:989 elf64-mips.c:1976 elfn32-mips.c:1808
-+#: elf32-mips.c:1045 elf64-mips.c:2056 elfn32-mips.c:1888
- msgid "literal relocation occurs for an external symbol"
- msgstr "la reubicación literal sucede para un símbolo externo"
--#: elf32-mips.c:1029 elf32-score.c:484 elf64-mips.c:2019 elfn32-mips.c:1849
-+#: elf32-mips.c:1085 elf32-score.c:484 elf64-mips.c:2099 elfn32-mips.c:1929
- msgid "32bits gp relative relocation occurs for an external symbol"
- msgstr "la reubicación gp relativa de 32bits sucede para un símbolo externo"
-@@ -1459,162 +1664,143 @@ msgstr "la reubicaci
- msgid "generic linker can't handle %s"
- msgstr "el enlazador genérico no puede manejar %s"
--#: elf32-ppc.c:2163
-+#: elf32-ppc.c:2161
- msgid "corrupt or empty %s section in %B"
- msgstr "sección %s corrupta o vacía en %B"
--#: elf32-ppc.c:2170
-+#: elf32-ppc.c:2168
- msgid "unable to read in %s section from %B"
- msgstr "no se puede leer en la sección %s desde %B"
--#: elf32-ppc.c:2176
-+#: elf32-ppc.c:2174
- msgid "corrupt %s section in %B"
- msgstr "sección %s corrupta en %B"
--#: elf32-ppc.c:2219
-+#: elf32-ppc.c:2217
- msgid "warning: unable to set size of %s section in %B"
- msgstr "aviso: no se puede establecer el tamaño de la sección %s en %B"
--#: elf32-ppc.c:2267
-+#: elf32-ppc.c:2265
- msgid "failed to allocate space for new APUinfo section."
- msgstr "no se puede reservar espacio para la nueva sección APUinfo."
--#: elf32-ppc.c:2286
-+#: elf32-ppc.c:2284
- msgid "failed to compute new APUinfo section."
- msgstr "no se puede calcular la nueva sección APUinfo."
--#: elf32-ppc.c:2289
-+#: elf32-ppc.c:2287
- msgid "failed to install new APUinfo section."
- msgstr "no se puede instalar la nueva sección APUinfo."
--#: elf32-ppc.c:3022
-+#: elf32-ppc.c:3263
- msgid "%B: relocation %s cannot be used when making a shared object"
- msgstr "%B: no se puede usar la reubicación %s cuando se hace un objeto compartido"
- #. It does not make sense to have a procedure linkage
- #. table entry for a local symbol.
--#: elf32-ppc.c:3292
-+#: elf32-ppc.c:3534
- msgid "%B(%A+0x%lx): %s reloc against local symbol"
- msgstr "%B(%A+0x%lx): reubicación %s contra un símbolo local"
--#: elf32-ppc.c:3633 elf32-ppc.c:3637 elfxx-mips.c:11036 elfxx-mips.c:11055
--#: elfxx-mips.c:11070
-+#: elf32-ppc.c:3885 elf32-ppc.c:3900 elfxx-mips.c:12268 elfxx-mips.c:12294
-+#: elfxx-mips.c:12316 elfxx-mips.c:12342
- msgid "Warning: %B uses hard float, %B uses soft float"
- msgstr "Aviso: %B usa coma flotante hard, %B usa coma flotante soft"
--#: elf32-ppc.c:3640 elf32-ppc.c:3644 elfxx-mips.c:11017 elfxx-mips.c:11021
-+#: elf32-ppc.c:3888 elf32-ppc.c:3892
-+msgid "Warning: %B uses double-precision hard float, %B uses single-precision hard float"
-+msgstr "Aviso: %B usa coma flotante hard de doble precisión, %B usa coma flotante hard de precisión simple"
-+
-+#: elf32-ppc.c:3896
-+msgid "Warning: %B uses soft float, %B uses single-precision hard float"
-+msgstr "Aviso: %B usa coma flotante soft, %B usa coma flotante hard de precisión simple"
-+
-+#: elf32-ppc.c:3903 elf32-ppc.c:3907 elfxx-mips.c:12248 elfxx-mips.c:12252
- msgid "Warning: %B uses unknown floating point ABI %d"
- msgstr "Aviso: %B usa la ABI de coma flotante desconocida %d"
--#: elf32-ppc.c:3699
-+#: elf32-ppc.c:3949 elf32-ppc.c:3953
-+msgid "Warning: %B uses unknown vector ABI %d"
-+msgstr "Aviso: %B usa la ABI de vector desconocida %d"
-+
-+#: elf32-ppc.c:3957
-+msgid "Warning: %B uses vector ABI \"%s\", %B uses \"%s\""
-+msgstr "Aviso: %B usa la ABI de vector \"%s\", %B usa \"%s\""
-+
-+#: elf32-ppc.c:4011
- msgid "%B: compiled with -mrelocatable and linked with modules compiled normally"
- msgstr "%B: compilado con -mrelocatable y enlazado con módulos compilados de forma normal"
--#: elf32-ppc.c:3707
-+#: elf32-ppc.c:4019
- msgid "%B: compiled normally and linked with modules compiled with -mrelocatable"
- msgstr "%B: compilado de forma normal y enlazado con módulos compilados con -mrelocatable"
--#: elf32-ppc.c:3793
-+#: elf32-ppc.c:4105
- msgid "Using bss-plt due to %B"
- msgstr "Se usa bss-plt debido a %B"
--#: elf32-ppc.c:6002 elf64-ppc.c:10490
-+#: elf32-ppc.c:6418 elf64-ppc.c:10881
- msgid "%B: unknown relocation type %d for symbol %s"
- msgstr "%B: tipo de reubicación %d desconocido para el símbolo %s"
--#: elf32-ppc.c:6252
-+#: elf32-ppc.c:6668
- msgid "%B(%A+0x%lx): non-zero addend on %s reloc against `%s'"
- msgstr "%B(%A+0x%lx): adición que no es cero en la reubicación %s contra `%s'"
--#: elf32-ppc.c:6597 elf32-ppc.c:6623 elf32-ppc.c:6682
-+#: elf32-ppc.c:7024 elf32-ppc.c:7050 elf32-ppc.c:7109
- msgid "%B: the target (%s) of a %s relocation is in the wrong output section (%s)"
- msgstr "%B: el objetivo (%s) de una reubicación %s está en la sección de salida errónea (%s)"
--#: elf32-ppc.c:6737
-+#: elf32-ppc.c:7164
- msgid "%B: relocation %s is not yet supported for symbol %s."
- msgstr "%B: la reubicación %s aún no se admite para el símbolo %s."
--#: elf32-ppc.c:6845 elf64-ppc.c:11185
-+#: elf32-ppc.c:7272 elf64-ppc.c:11575
- msgid "%B(%A+0x%lx): %s reloc against `%s': error %d"
- msgstr "%B(%A+0x%lx): reubicación %s contra `%s': error %d"
--#: elf32-s390.c:2238 elf64-s390.c:2212
-+#: elf32-s390.c:2246 elf64-s390.c:2220
- msgid "%B(%A+0x%lx): invalid instruction for TLS relocation %s"
- msgstr "%B(%A+0x%lx): instrucción inválida para la reubicación TLS %s"
--#: elf32-score.c:1418 elfxx-mips.c:2699
-+#: elf32-score.c:1415 elfxx-mips.c:3273
- msgid "not enough GOT space for local GOT entries"
- msgstr "no hay suficiente espacio GOT para entradas GOT locales"
--#: elf32-score.c:2550
-+#: elf32-score.c:2545
- #, c-format
- msgid "%s: Malformed reloc detected for section %s"
- msgstr "%s: Se detectó una reubicación malformada para la sección %s"
--#: elf32-score.c:2601
-+#: elf32-score.c:2596
- msgid "%B: CALL15 reloc at 0x%lx not against global symbol"
- msgstr "%B: la reubicación CALL15 en 0x%lx no es contra un símbolo global"
--#: elf32-score.c:3756
-+#: elf32-score.c:3753
- #, c-format
- msgid " [pic]"
- msgstr " [pic]"
--#: elf32-score.c:3760
-+#: elf32-score.c:3757
- #, c-format
- msgid " [fix dep]"
- msgstr " [fix dep]"
--#: elf32-score.c:3802 elfxx-mips.c:11201
-+#: elf32-score.c:3799
- msgid "%B: warning: linking PIC files with non-PIC files"
- msgstr "%B: aviso: se enlazan ficheros PIC con ficheros que no son PIC"
--#: elf32-sh64.c:222 elf64-sh64.c:2350
--#, c-format
--msgid "%s: compiled as 32-bit object and %s is 64-bit"
--msgstr "%s: compilado como un objeto de 32-bit y %s es de 64-bit"
--
--#: elf32-sh64.c:225 elf64-sh64.c:2353
--#, c-format
--msgid "%s: compiled as 64-bit object and %s is 32-bit"
--msgstr "%s: compilado como un objeto de 64-bit y %s es de 32-bit"
--
--#: elf32-sh64.c:227 elf64-sh64.c:2355
--#, c-format
--msgid "%s: object size does not match that of target %s"
--msgstr "%s: el tamaño del objeto no coincide con el tamaño del objetivo %s"
--
--#: elf32-sh64.c:450 elf64-sh64.c:2894
--#, c-format
--msgid "%s: encountered datalabel symbol in input"
--msgstr "%s: se encontró un símbolo datalabel en la entrada"
--
--#: elf32-sh64.c:527
--msgid "PTB mismatch: a SHmedia address (bit 0 == 1)"
--msgstr "No coincide PTB: una dirección SHmedia (bit 0 == 1)"
--
--#: elf32-sh64.c:530
--msgid "PTA mismatch: a SHcompact address (bit 0 == 0)"
--msgstr "No coincide PTA: una dirección SHcompact (bit 0 == 0)"
--
--#: elf32-sh64.c:548
--#, c-format
--msgid "%s: GAS error: unexpected PTB insn with R_SH_PT_16"
--msgstr "%s: error de GAS: instrucción PTB inesperada con R_SH_PT_16"
--
--#: elf32-sh64.c:597
--msgid "%B: error: unaligned relocation type %d at %08x reloc %p\n"
--msgstr "%B: error: tipo de reubicación %d sin alinear en %08x reubicación %p\n"
-+#: elf32-sh-symbian.c:130
-+msgid "%B: IMPORT AS directive for %s conceals previous IMPORT AS"
-+msgstr "%B: la directiva IMPORT AS para %s oculta un IMPORT AS previo"
--#: elf32-sh64.c:673
--#, c-format
--msgid "%s: could not write out added .cranges entries"
--msgstr "%s: no se pueden escribir las entradas .cranges agregadas"
-+#: elf32-sh-symbian.c:383
-+msgid "%B: Unrecognised .directive command: %s"
-+msgstr "%B: Orden .directive no reconocida: %s"
--#: elf32-sh64.c:733
--#, c-format
--msgid "%s: could not write out sorted .cranges entries"
--msgstr "%s: no se pueden escribir las entradas .cranges ordenadas"
-+#: elf32-sh-symbian.c:504
-+msgid "%B: Failed to add renamed symbol %s"
-+msgstr "%B: Falló al agregar el símbolo renombrado %s"
- #: elf32-sh.c:533
- msgid "%B: 0x%lx: warning: bad R_SH_USES offset"
-@@ -1648,41 +1834,76 @@ msgstr "%B: 0x%lx: aviso: cuenta err
- msgid "%B: 0x%lx: fatal: reloc overflow while relaxing"
- msgstr "%B: 0x%lx: fatal: desbordamiento de reubicación durante la relajación"
--#: elf32-sh.c:3249 elf64-sh64.c:1526
-+#: elf32-sh.c:3279 elf64-sh64.c:1526
- msgid "Unexpected STO_SH5_ISA32 on local symbol is not handled"
- msgstr "No se maneja un STO_SH5_ISA32 inesperado en un símbolo local"
--#: elf32-sh.c:3486
-+#: elf32-sh.c:3516
- msgid "%B: 0x%lx: fatal: unaligned branch target for relax-support relocation"
- msgstr "%B: 0x%lx: fatal: objetivo de ramificación sin alineación para la reubicación de soporte de relajamiento"
--#: elf32-sh.c:3519 elf32-sh.c:3534
-+#: elf32-sh.c:3549 elf32-sh.c:3564
- msgid "%B: 0x%lx: fatal: unaligned %s relocation 0x%lx"
- msgstr "%B: 0x%lx: fatal: reubicación %s sin alineación 0x%lx"
--#: elf32-sh.c:3548
-+#: elf32-sh.c:3578
- msgid "%B: 0x%lx: fatal: R_SH_PSHA relocation %d not in range -32..32"
- msgstr "%B: 0x%lx: fatal: la reubicación R_SH_PSHA %d no está en el rango -32..32"
--#: elf32-sh.c:3562
-+#: elf32-sh.c:3592
- msgid "%B: 0x%lx: fatal: R_SH_PSHL relocation %d not in range -32..32"
- msgstr "%B: 0x%lx: fatal: la reubicación R_SH_PSHL %d no está en el rango -32..32"
--#: elf32-sh.c:5275 elf64-alpha.c:4533
-+#: elf32-sh.c:5310 elf64-alpha.c:4552
- msgid "%B: TLS local exec code cannot be linked into shared objects"
- msgstr "%B: el código de ejecución local TLS no se puede enlazar en objetos compartidos"
--#: elf32-sh-symbian.c:130
--msgid "%B: IMPORT AS directive for %s conceals previous IMPORT AS"
--msgstr "%B: la directiva IMPORT AS para %s oculta un IMPORT AS previo"
-+#: elf32-sh64.c:222 elf64-sh64.c:2345
-+#, c-format
-+msgid "%s: compiled as 32-bit object and %s is 64-bit"
-+msgstr "%s: compilado como un objeto de 32-bit y %s es de 64-bit"
--#: elf32-sh-symbian.c:383
--msgid "%B: Unrecognised .directive command: %s"
--msgstr "%B: Orden .directive no reconocida: %s"
-+#: elf32-sh64.c:225 elf64-sh64.c:2348
-+#, c-format
-+msgid "%s: compiled as 64-bit object and %s is 32-bit"
-+msgstr "%s: compilado como un objeto de 64-bit y %s es de 32-bit"
--#: elf32-sh-symbian.c:504
--msgid "%B: Failed to add renamed symbol %s"
--msgstr "%B: Falló al agregar el símbolo renombrado %s"
-+#: elf32-sh64.c:227 elf64-sh64.c:2350
-+#, c-format
-+msgid "%s: object size does not match that of target %s"
-+msgstr "%s: el tamaño del objeto no coincide con el tamaño del objetivo %s"
-+
-+#: elf32-sh64.c:450 elf64-sh64.c:2888
-+#, c-format
-+msgid "%s: encountered datalabel symbol in input"
-+msgstr "%s: se encontró un símbolo datalabel en la entrada"
-+
-+#: elf32-sh64.c:527
-+msgid "PTB mismatch: a SHmedia address (bit 0 == 1)"
-+msgstr "No coincide PTB: una dirección SHmedia (bit 0 == 1)"
-+
-+#: elf32-sh64.c:530
-+msgid "PTA mismatch: a SHcompact address (bit 0 == 0)"
-+msgstr "No coincide PTA: una dirección SHcompact (bit 0 == 0)"
-+
-+#: elf32-sh64.c:548
-+#, c-format
-+msgid "%s: GAS error: unexpected PTB insn with R_SH_PT_16"
-+msgstr "%s: error de GAS: instrucción PTB inesperada con R_SH_PT_16"
-+
-+#: elf32-sh64.c:597
-+msgid "%B: error: unaligned relocation type %d at %08x reloc %p\n"
-+msgstr "%B: error: tipo de reubicación %d sin alinear en %08x reubicación %p\n"
-+
-+#: elf32-sh64.c:673
-+#, c-format
-+msgid "%s: could not write out added .cranges entries"
-+msgstr "%s: no se pueden escribir las entradas .cranges agregadas"
-+
-+#: elf32-sh64.c:733
-+#, c-format
-+msgid "%s: could not write out sorted .cranges entries"
-+msgstr "%s: no se pueden escribir las entradas .cranges ordenadas"
- #: elf32-sparc.c:89
- msgid "%B: compiled for a 64 bit system and target is 32 bit"
-@@ -1692,69 +1913,103 @@ msgstr "%B: compilado para un sistema de 64 bit y el objetivo es de 32 bit"
- msgid "%B: linking little endian files with big endian files"
- msgstr "%B: se enlazan ficheros little endian con ficheros big endian"
--#: elf32-spu.c:995
-+#: elf32-spu.c:607
-+msgid "%X%P: overlay sections %A and %A do not start at the same address.\n"
-+msgstr "%X%P: las secciones de sobreescritura %A y %A no inician en la misma dirección.\n"
-+
-+#: elf32-spu.c:805
- msgid "warning: call to non-function symbol %s defined in %B"
- msgstr "aviso: se llama al símbolo %s que no es función, definido en %B"
--#: elf32-spu.c:1315
-+#: elf32-spu.c:1406
- msgid "%B is not allowed to define %s"
- msgstr "%B no se permite para definir %s"
--#: elf32-spu.c:1352
-+#: elf32-spu.c:1453
- #, c-format
- msgid "%s in overlay section"
- msgstr "%s en la sección de sobreescritura"
--#: elf32-spu.c:1363
-+#: elf32-spu.c:1469
- msgid "overlay stub relocation overflow"
- msgstr "desbordamiento del segmento de reubicación de sobreescritura"
--#: elf32-spu.c:1820
-+#: elf32-spu.c:1478 elf64-ppc.c:10078
-+msgid "stubs don't match calculated size"
-+msgstr "los cabos no coinciden con el tamaño calculado"
-+
-+#: elf32-spu.c:1976
- #, c-format
- msgid "warning: %s overlaps %s\n"
- msgstr "aviso: %s sobreescribe %s\n"
--#: elf32-spu.c:1836
-+#: elf32-spu.c:1992
- #, c-format
- msgid "warning: %s exceeds section size\n"
- msgstr "aviso: %s excede el tamaño de la sección\n"
--#: elf32-spu.c:1867
-+#: elf32-spu.c:2023
- msgid "%A:0x%v not found in function table\n"
- msgstr "%A:0x%v no se encuentra en la tabla de función\n"
--#: elf32-spu.c:1958
--msgid "%B(%A+0x%v): call to non-code section %B(%A), stack analysis incomplete\n"
--msgstr "%B(%A+0x%v): se llama a la sección %B(%A) que no es de código, análisis de pila incompleto\n"
-+#: elf32-spu.c:2165
-+msgid "%B(%A+0x%v): call to non-code section %B(%A), analysis incomplete\n"
-+msgstr "%B(%A+0x%v): se llama a la sección %B(%A) que no es de código, análisis incompleto\n"
--#: elf32-spu.c:2079
-+#: elf32-spu.c:2339
- #, c-format
- msgid "%A link_order not found\n"
- msgstr "no se encontró link_order %A\n"
--#: elf32-spu.c:2358
-+#: elf32-spu.c:2706
- #, c-format
- msgid "Stack analysis will ignore the call from %s to %s\n"
- msgstr "El análisis de pila descartará la llamada de %s a %s\n"
--#: elf32-spu.c:2513
-+#: elf32-spu.c:3348
-+msgid "  %s: 0x%v\n"
-+msgstr "  %s: 0x%v\n"
-+
-+#: elf32-spu.c:3349
- msgid "%s: 0x%v 0x%v\n"
- msgstr "%s: 0x%v 0x%v\n"
--#: elf32-spu.c:2517
-+#: elf32-spu.c:3354
- msgid "  calls:\n"
- msgstr "  llama:\n"
--#: elf32-spu.c:2524
-+#: elf32-spu.c:3362
- #, c-format
- msgid "   %s%s %s\n"
- msgstr "   %s%s %s\n"
--#: elf32-spu.c:2585
-+#: elf32-spu.c:3564
-+#, c-format
-+msgid "%s duplicated in %s\n"
-+msgstr "%s duplicado en %s\n"
-+
-+#: elf32-spu.c:3568
-+#, c-format
-+msgid "%s duplicated\n"
-+msgstr "%s duplicado\n"
-+
-+#: elf32-spu.c:3575
-+msgid "sorry, no support for duplicate object files in auto-overlay script\n"
-+msgstr "perdón, no se admiten ficheros objeto duplicados en el guión de sobreescritura automática\n"
-+
-+#: elf32-spu.c:3605
-+msgid "non-overlay size of 0x%v plus maximum overlay size of 0x%v exceeds local store\n"
-+msgstr "eltamaño 0x%v que no es de sobreescritura mas el tamaño de sobreescritura máximo de 0x%v excede el almacenamiento local\n"
-+
-+#: elf32-spu.c:3741
-+msgid "%B:%A%s exceeds overlay size\n"
-+msgstr "%B:%A%s excede el tamaño de sobreescritura\n"
-+
-+#: elf32-spu.c:3862
- msgid "Stack size for call graph root nodes.\n"
- msgstr "Tamaño de la pila para los nodos raíz del grafo de llamadas.\n"
--#: elf32-spu.c:2586
-+#: elf32-spu.c:3863
- msgid ""
- "\n"
- "Stack size for functions.  Annotations: '*' max stack, 't' tail call\n"
-@@ -1762,80 +2017,76 @@ msgstr ""
- "\n"
- "Tamaño de la pila para funciones. Anotaciones: '*' max de pila, 't' llamada cola\n"
--#: elf32-spu.c:2615
--msgid "  %s: 0x%v\n"
--msgstr "  %s: 0x%v\n"
--
--#: elf32-spu.c:2625
-+#: elf32-spu.c:3871
- msgid "Maximum stack required is 0x%v\n"
- msgstr "La pila máxima requerida es 0x%v\n"
--#: elf32-spu.c:2751
-+#: elf32-spu.c:4067
- msgid "%B(%s+0x%lx): unresolvable %s relocation against symbol `%s'"
- msgstr "%B(%s+0x%lx): reubicación %s sin resolución contra el símbolo `%s'"
--#: elf32-v850.c:163
-+#: elf32-v850.c:165
- #, c-format
- msgid "Variable `%s' cannot occupy in multiple small data regions"
- msgstr "La variable `%s' no puede ocupar múltiples regiones de datos small"
--#: elf32-v850.c:166
-+#: elf32-v850.c:168
- #, c-format
- msgid "Variable `%s' can only be in one of the small, zero, and tiny data regions"
- msgstr "La variable `%s' solamente puede estar en una de las regiones de datos small, cero, y tiny"
--#: elf32-v850.c:169
-+#: elf32-v850.c:171
- #, c-format
- msgid "Variable `%s' cannot be in both small and zero data regions simultaneously"
- msgstr "La variable `%s' no puede estar simultáneamente en las regiones de datos small y cero"
--#: elf32-v850.c:172
-+#: elf32-v850.c:174
- #, c-format
- msgid "Variable `%s' cannot be in both small and tiny data regions simultaneously"
- msgstr "La variable `%s' no puede estar simultáneamente en las regiones de datos small y tiny"
--#: elf32-v850.c:175
-+#: elf32-v850.c:177
- #, c-format
- msgid "Variable `%s' cannot be in both zero and tiny data regions simultaneously"
- msgstr "La variable `%s' no puede estar simultáneamente en las regiones de datos cero y tiny"
--#: elf32-v850.c:478
-+#: elf32-v850.c:480
- #, c-format
- msgid "FAILED to find previous HI16 reloc\n"
- msgstr "FALLO para encontrar la reubicación HI16 previa\n"
--#: elf32-v850.c:1713
-+#: elf32-v850.c:1715
- msgid "could not locate special linker symbol __gp"
- msgstr "no se puede localizar el símbolo especial del enlazador __gp"
--#: elf32-v850.c:1717
-+#: elf32-v850.c:1719
- msgid "could not locate special linker symbol __ep"
- msgstr "no se puede localizar el símbolo especial del enlazador __ep"
--#: elf32-v850.c:1721
-+#: elf32-v850.c:1723
- msgid "could not locate special linker symbol __ctbp"
- msgstr "no se puede localizar el símbolo especial del enlazador __ctbp"
--#: elf32-v850.c:1871
-+#: elf32-v850.c:1873
- msgid "%B: Architecture mismatch with previous modules"
- msgstr "%B: No coincide la arquitectura con los módulos previos"
--#: elf32-v850.c:1890
-+#: elf32-v850.c:1892
- #, c-format
- msgid "private flags = %lx: "
- msgstr "opciones privadas = %lx: "
--#: elf32-v850.c:1895
-+#: elf32-v850.c:1897
- #, c-format
- msgid "v850 architecture"
- msgstr "arquitectura v850"
--#: elf32-v850.c:1896
-+#: elf32-v850.c:1898
- #, c-format
- msgid "v850e architecture"
- msgstr "arquitectura v850e"
--#: elf32-v850.c:1897
-+#: elf32-v850.c:1899
- #, c-format
- msgid "v850e1 architecture"
- msgstr "arquitectura v850e1"
-@@ -1860,114 +2111,118 @@ msgstr " [flotante-g]"
- msgid "%s: warning: GOT addend of %ld to `%s' does not match previous GOT addend of %ld"
- msgstr "%s: aviso: la adición GOT de %ld a `%s' no coincide con la adición previa GOT de %ld"
--#: elf32-vax.c:1584
-+#: elf32-vax.c:1589
- #, c-format
- msgid "%s: warning: PLT addend of %d to `%s' from %s section ignored"
- msgstr "%s: aviso: se descarta la adición PLT de %d a `%s' de la sección %s"
--#: elf32-vax.c:1721
-+#: elf32-vax.c:1726
- #, c-format
- msgid "%s: warning: %s relocation against symbol `%s' from %s section"
- msgstr "%s: aviso: reubicación %s contra el símbolo `%s' de la sección %s"
--#: elf32-vax.c:1727
-+#: elf32-vax.c:1732
- #, c-format
- msgid "%s: warning: %s relocation to 0x%x from %s section"
- msgstr "%s: aviso: reubicación %s a 0x%x de la sección %s"
--#: elf32-xstormy16.c:451 elf32-ia64.c:2962 elf64-ia64.c:2962
-+#: elf32-xstormy16.c:451 elf32-ia64.c:2794 elf64-ia64.c:2794
- msgid "non-zero addend in @fptr reloc"
- msgstr "adición que no es cero en la reubicación @fptr"
--#: elf32-xtensa.c:733
-+#: elf32-xtensa.c:911
- msgid "%B(%A): invalid property table"
- msgstr "%B(%A): tabla de propiedades inválida"
--#: elf32-xtensa.c:2177
-+#: elf32-xtensa.c:2734
- msgid "%B(%A+0x%lx): relocation offset out of range (size=0x%x)"
- msgstr "%B(%A+0x%lx): desplazamiento de reubicación fuera de rango (tamaño=0x%x)"
--#: elf32-xtensa.c:2234
-+#: elf32-xtensa.c:2813 elf32-xtensa.c:2934
- msgid "dynamic relocation in read-only section"
- msgstr "reubicación dinámica en la sección de sólo lectura"
--#: elf32-xtensa.c:2407
-+#: elf32-xtensa.c:2910
-+msgid "TLS relocation invalid without dynamic sections"
-+msgstr "reubicación TLS inválida sin secciones dinámicas"
-+
-+#: elf32-xtensa.c:3127
- msgid "internal inconsistency in size of .got.loc section"
- msgstr "inconsistencia interna en el tamaño de la sección .got.loc"
--#: elf32-xtensa.c:2714
-+#: elf32-xtensa.c:3437
- msgid "%B: incompatible machine type. Output is 0x%x. Input is 0x%x"
- msgstr "%B: tipo de máquina incompatible. La salida es 0x%x. La entrada es 0x%x"
--#: elf32-xtensa.c:3920 elf32-xtensa.c:3928
-+#: elf32-xtensa.c:4666 elf32-xtensa.c:4674
- msgid "Attempt to convert L32R/CALLX to CALL failed"
- msgstr "Falló el intento de convertir L32R/CALLX a CALL"
--#: elf32-xtensa.c:5522 elf32-xtensa.c:5598 elf32-xtensa.c:6714
-+#: elf32-xtensa.c:6276 elf32-xtensa.c:6352 elf32-xtensa.c:7468
- msgid "%B(%A+0x%lx): could not decode instruction; possible configuration mismatch"
- msgstr "%B(%A+0x%lx): no se puede decodificar la instrucción; posible falta de coincidencia de la configuración"
--#: elf32-xtensa.c:6454
-+#: elf32-xtensa.c:7208
- msgid "%B(%A+0x%lx): could not decode instruction for XTENSA_ASM_SIMPLIFY relocation; possible configuration mismatch"
- msgstr "%B(%A+0x%lx): no se puede decodificar la instrucción para la reubicación XTENSA_ASM_SIMPLIFY; posible falta de coincidencia de la configuración"
--#: elf32-xtensa.c:8166
-+#: elf32-xtensa.c:8969
- msgid "invalid relocation address"
- msgstr "dirección de reubicación inválida"
--#: elf32-xtensa.c:8215
-+#: elf32-xtensa.c:9018
- msgid "overflow after relaxation"
- msgstr "desbordamiento después de la relajación"
--#: elf32-xtensa.c:9341
-+#: elf32-xtensa.c:10154
- msgid "%B(%A+0x%lx): unexpected fix for %s relocation"
- msgstr "%B(%A+0x%lx): compostura inesperada para la reubicación %s"
--#: elf64-alpha.c:453
-+#: elf64-alpha.c:452
- msgid "GPDISP relocation did not find ldah and lda instructions"
- msgstr "la reubicación GPDISP no encontró las instrucciones ldah y lda"
--#: elf64-alpha.c:2404
-+#: elf64-alpha.c:2416
- msgid "%B: .got subsegment exceeds 64K (size %d)"
- msgstr "%B: el subsegmento .got excede los 64K (tamaño %d)"
--#: elf64-alpha.c:4277 elf64-alpha.c:4289
-+#: elf64-alpha.c:4296 elf64-alpha.c:4308
- msgid "%B: gp-relative relocation against dynamic symbol %s"
- msgstr "%B: reubicación gp relativa contra el símbolo dinámico %s"
--#: elf64-alpha.c:4315 elf64-alpha.c:4450
-+#: elf64-alpha.c:4334 elf64-alpha.c:4469
- msgid "%B: pc-relative relocation against dynamic symbol %s"
- msgstr "%B: reubicación relativa al pc contra el símbolo dinámico %s"
--#: elf64-alpha.c:4343
-+#: elf64-alpha.c:4362
- msgid "%B: change in gp: BRSGP %s"
- msgstr "%B: cambio en gp: BRSGP %s"
--#: elf64-alpha.c:4368
-+#: elf64-alpha.c:4387
- msgid "<unknown>"
- msgstr "<desconocido>"
--#: elf64-alpha.c:4373
-+#: elf64-alpha.c:4392
- msgid "%B: !samegp reloc against symbol without .prologue: %s"
- msgstr "%B: reubicación !samegp contra un símbolo sin .prologue: %s"
--#: elf64-alpha.c:4425
-+#: elf64-alpha.c:4444
- msgid "%B: unhandled dynamic relocation against %s"
- msgstr "%B: reubicación dinámica sin manejar contra %s"
--#: elf64-alpha.c:4457
-+#: elf64-alpha.c:4476
- msgid "%B: pc-relative relocation against undefined weak symbol %s"
- msgstr "%B: reubicación relativa al pc contra el símbolo débil sin definir %s"
--#: elf64-alpha.c:4517
-+#: elf64-alpha.c:4536
- msgid "%B: dtp-relative relocation against dynamic symbol %s"
- msgstr "%B: reubicación relativa a dtp contra el símbolo dinámico %s"
--#: elf64-alpha.c:4540
-+#: elf64-alpha.c:4559
- msgid "%B: tp-relative relocation against dynamic symbol %s"
- msgstr "%B: reubicación relativa a tp contra el símbolo dinámico %s"
--#: elf64-hppa.c:2040
-+#: elf64-hppa.c:2071
- #, c-format
- msgid "stub entry for %s cannot load .plt, dp offset = %ld"
- msgstr "la entrada de cabo para %s no puede cargar .plt, desplazamiento dp = %ld"
-@@ -2011,16 +2266,16 @@ msgstr "%s: la directiva LOCAL s
- msgid "%s: LOCAL directive: Register $%ld is not a local register.  First global register is $%ld."
- msgstr "%s: directiva LOCAL: El registro $%ld no es un registro local.  El primer registro global es $%ld."
--#: elf64-mmix.c:2202
-+#: elf64-mmix.c:2201
- #, c-format
- msgid "%s: Error: multiple definition of `%s'; start of %s is set in a earlier linked file\n"
- msgstr "%s: Error: definición múltiple de `%s'; el inicio de %s está definido en un fichero enlazado con anterioridad\n"
--#: elf64-mmix.c:2260
-+#: elf64-mmix.c:2259
- msgid "Register section has contents\n"
- msgstr "La sección de registros no tiene contenido\n"
--#: elf64-mmix.c:2452
-+#: elf64-mmix.c:2451
- #, c-format
- msgid ""
- "Internal inconsistency: remaining %u != max %u.\n"
-@@ -2029,69 +2284,65 @@ msgstr ""
- "Inconsistencia interna: %u restante != %u máximo.\n"
- "  Por favor reporte este bicho."
--#: elf64-ppc.c:2569 libbfd.c:950
-+#: elf64-ppc.c:2561 libbfd.c:978
- msgid "%B: compiled for a big endian system and target is little endian"
- msgstr "%B: compilado para un sistema big endian y el objetivo es little endian"
--#: elf64-ppc.c:2572 libbfd.c:952
-+#: elf64-ppc.c:2564 libbfd.c:980
- msgid "%B: compiled for a little endian system and target is big endian"
- msgstr "%B: compilado para un sistema little endian y el objetivo es big endian"
--#: elf64-ppc.c:5888
-+#: elf64-ppc.c:6065
- #, c-format
- msgid "copy reloc against `%s' requires lazy plt linking; avoid setting LD_BIND_NOW=1 or upgrade gcc"
- msgstr "la reubicación de copia contra `%s' requiere de enlazado plt suelto; evite establecer LD_BIND_NOW=1 o actualice gcc"
--#: elf64-ppc.c:6316
-+#: elf64-ppc.c:6486
- msgid "dynreloc miscount for %B, section %A"
- msgstr "cuenta errónea de la reubicación dinámica de %B, sección %A"
--#: elf64-ppc.c:6420
-+#: elf64-ppc.c:6570
- msgid "%B: .opd is not a regular array of opd entries"
- msgstr "%B: .opd no es una matriz regular de entradas opd"
--#: elf64-ppc.c:6429
-+#: elf64-ppc.c:6579
- msgid "%B: unexpected reloc type %u in .opd section"
- msgstr "%B: tipo de reubicación %u inesperado en la sección .opd"
--#: elf64-ppc.c:6450
-+#: elf64-ppc.c:6600
- msgid "%B: undefined sym `%s' in .opd section"
- msgstr "%B: símbolo `%s' indefinido en la sección .opd"
--#: elf64-ppc.c:7157 elf64-ppc.c:7537
-+#: elf64-ppc.c:7377 elf64-ppc.c:7754
- #, c-format
- msgid "%s defined in removed toc entry"
- msgstr "se definió %s en la entrada toc eliminada"
--#: elf64-ppc.c:8272
-+#: elf64-ppc.c:8581
- #, c-format
- msgid "long branch stub `%s' offset overflow"
- msgstr "desbordamiento del desplazamiento de stub de ramificación long `%s'"
--#: elf64-ppc.c:8347
-+#: elf64-ppc.c:8640
- #, c-format
- msgid "can't find branch stub `%s'"
- msgstr "no se puede encontrar la ramificación de cabo `%s'"
--#: elf64-ppc.c:8413 elf64-ppc.c:8489
-+#: elf64-ppc.c:8702 elf64-ppc.c:8822
- #, c-format
- msgid "linkage table error against `%s'"
- msgstr "error de la tabla de enlazado contra `%s'"
--#: elf64-ppc.c:8618
-+#: elf64-ppc.c:8978
- #, c-format
- msgid "can't build branch stub `%s'"
- msgstr "no se puede construir la ramificación de cabos `%s'"
--#: elf64-ppc.c:9070
-+#: elf64-ppc.c:9451
- msgid "%B section %A exceeds stub group size"
- msgstr "%B sección %A excede el tamaño de grupo de stub"
--#: elf64-ppc.c:9682
--msgid "stubs don't match calculated size"
--msgstr "los cabos no coinciden con el tamaño calculado"
--
--#: elf64-ppc.c:9694
-+#: elf64-ppc.c:10090
- #, c-format
- msgid ""
- "linker stubs in %u group%s\n"
-@@ -2108,19 +2359,19 @@ msgstr ""
- "  ajuste toc long %lu\n"
- "  llamada plt     %lu"
--#: elf64-ppc.c:10378
-+#: elf64-ppc.c:10769
- msgid "%B(%A+0x%lx): automatic multiple TOCs not supported using your crt files; recompile with -mminimal-toc or upgrade gcc"
- msgstr "%B(%A+0x%lx): no se admiten los TOCs múltiples automáticos, utilizando sus ficheros crt; recompile con -mminimal-toc o actualice gcc"
--#: elf64-ppc.c:10386
-+#: elf64-ppc.c:10777
- msgid "%B(%A+0x%lx): sibling call optimization to `%s' does not allow automatic multiple TOCs; recompile with -mminimal-toc or -fno-optimize-sibling-calls, or make `%s' extern"
- msgstr "%B(%A+0x%lx): la optimización de llamada hermana a `%s' no permite TOCs múltiples automáticos; recompile con -mminimal-toc ó -fno-optimize-sibling-calls, o vuelva `%s' externa"
--#: elf64-ppc.c:11037
-+#: elf64-ppc.c:11427
- msgid "%B: relocation %s is not supported for symbol %s."
- msgstr "%B: no se admite la reubicación %s para el símbolo %s."
--#: elf64-ppc.c:11119
-+#: elf64-ppc.c:11509
- msgid "%B: error: relocation %s not a multiple of %d"
- msgstr "%B: error: la reubicación %s no es un múltiplo de %d"
-@@ -2149,194 +2400,48 @@ msgstr "El s
- msgid "%B: linking UltraSPARC specific with HAL specific code"
- msgstr "%B: se enlaza código específico de UltraSPARC con código específico de HAL"
--#: elf64-x86-64.c:799 elf64-x86-64.c:959 elf64-x86-64.c:2360
-+#: elf64-x86-64.c:1047 elf64-x86-64.c:1207 elfxx-mips.c:7834
- msgid "%B: relocation %s against `%s' can not be used when making a shared object; recompile with -fPIC"
- msgstr "%B: no se puede usar la reubicación %s contra `%s' cuando se hace un objeto compartido; recompile con -fPIC"
--#: elf64-x86-64.c:890
--msgid "%B: %s' accessed both as normal and thread local symbol"
--msgstr "%B: se accesó `%s' como un símbolo normal y como un símbolo local de hilo"
-+#: elf64-x86-64.c:1138
-+msgid "%B: '%s' accessed both as normal and thread local symbol"
-+msgstr "%B: se accedió a '%s' como un símbolo normal y como un símbolo local de hilo"
--#: elf64-x86-64.c:2272
-+#: elf64-x86-64.c:2559
- msgid "%B: relocation R_X86_64_GOTOFF64 against protected function `%s' can not be used when making a shared object"
- msgstr "%B: no se puede usar la reubicación R_X86_64_GOTOFF contra la función protegida `%s' cuando se hace un objeto compartido"
--#: elf64-x86-64.c:2356
--msgid "%B: relocation R_X86_64_PC32 against protected function `%s' can not be used when making a shared object"
--msgstr "%B: no se puede usar la reubicación R_X86_64_PC32 contra la función protegida `%' cuando se hace un objeto compartido"
-+#: elf64-x86-64.c:2670
-+msgid "; recompile with -fPIC"
-+msgstr "; recompile con -fPIC"
--#: elf-attrs.c:582
--msgid "ERROR: %B: Must be processed by '%s' toolchain"
--msgstr "ERROR: %B: Se debe procesar por la cadena de compilación '%s'"
--
--#: elf-attrs.c:602 elf-attrs.c:621
--msgid "ERROR: %B: Incompatible object tag '%s':%d"
--msgstr "ERROR: %B: Etiqueta de objeto '%s' incompatible:%d"
--
--#: elf.c:312
--msgid "%B: invalid string offset %u >= %lu for section `%s'"
--msgstr "%B: desplazamiento de cadena inválido %u >= %lu para la sección `%s'"
--
--#: elf.c:414
--msgid "%B symbol number %lu references nonexistent SHT_SYMTAB_SHNDX section"
--msgstr "%B el número de símbolo %lu hace referencia a la sección inexistente SHT_SYMTAB_SHNDX"
--
--#: elf.c:567
--msgid "%B: Corrupt size field in group section header: 0x%lx"
--msgstr "%B: Tamaño de campo corrupto en el encabezado de la sección de grupo: 0x%lx"
-+#: elf64-x86-64.c:2675
-+msgid "%B: relocation %s against %s `%s' can not be used when making a shared object%s"
-+msgstr "%B: no se puede usar la reubicación %s contra %s `%s' cuando se hace un objeto compartido%s"
--#: elf.c:603
--msgid "%B: invalid SHT_GROUP entry"
--msgstr "%B: entrada SHT_GROUP inválida"
--
--#: elf.c:673
--msgid "%B: no group info for section %A"
--msgstr "%B: no hay información de grupo para la sección %A"
-+#: elf64-x86-64.c:2677
-+msgid "%B: relocation %s against undefined %s `%s' can not be used when making a shared object%s"
-+msgstr "%B: no se puede usar la reubicación %s contra %s sin definir `%s' cuando se hace un objeto compartido%s"
--#: elf.c:703 elf.c:2886 elflink.c:9858
--msgid "%B: warning: sh_link not set for section `%A'"
--msgstr "%B: aviso: no se estableción sh_link para la sección `%A'"
--
--#: elf.c:719
--msgid "%B: sh_link [%d] in section `%A' is incorrect"
--msgstr "%B: sh_link [%d] en la sección `%A', es incorrecto"
--
--#: elf.c:754
--msgid "%B: unknown [%d] section `%s' in group [%s]"
--msgstr "%B: sección [%d] desconocida `%s' en el grupo [%s]"
--
--#: elf.c:1108
--#, c-format
--msgid ""
--"\n"
--"Program Header:\n"
--msgstr ""
--"\n"
--"Encabezado del Programa:\n"
--
--#: elf.c:1150
--#, c-format
--msgid ""
--"\n"
--"Dynamic Section:\n"
--msgstr ""
--"\n"
--"Sección Dinámica:\n"
--
--#: elf.c:1276
--#, c-format
--msgid ""
--"\n"
--"Version definitions:\n"
--msgstr ""
--"\n"
--"Definiciones de versión:\n"
--
--#: elf.c:1301
--#, c-format
--msgid ""
--"\n"
--"Version References:\n"
--msgstr ""
--"\n"
--"Referencias de Versión:\n"
--
--#: elf.c:1306
--#, c-format
--msgid "  required from %s:\n"
--msgstr "  requerido desde %s:\n"
--
--#: elf.c:1690
--msgid "%B: invalid link %lu for reloc section %s (index %u)"
--msgstr "%B: enlace %lu inválido para la sección de reubicación %s (índice %u)"
--
--#: elf.c:1858
--msgid "%B: don't know how to handle allocated, application specific section `%s' [0x%8x]"
--msgstr "%B: no se sabe cómo manejar lo reservado, aplicación específica de la sección `%s' [0x%8x]"
--
--#: elf.c:1870
--msgid "%B: don't know how to handle processor specific section `%s' [0x%8x]"
--msgstr "%B: no se sabe cómo manejar la sección específica de procesador `%s' [0x%8x]"
--
--#: elf.c:1881
--msgid "%B: don't know how to handle OS specific section `%s' [0x%8x]"
--msgstr "%B: no se sabe cómo manejar la sección específica de SO `%s' [0x%8x]"
--
--#: elf.c:1891
--msgid "%B: don't know how to handle section `%s' [0x%8x]"
--msgstr "%B: no se sabe cómo manejar la sección `%s' [0x%8x]"
--
--#: elf.c:2843
--msgid "%B: sh_link of section `%A' points to discarded section `%A' of `%B'"
--msgstr "%B: sh_link de la sección `%A' apunta a la sección descartada `%A' de `%B'"
--
--#: elf.c:2866
--msgid "%B: sh_link of section `%A' points to removed section `%A' of `%B'"
--msgstr "%B: sh_link de la sección `%A' apunta a la sección descartada `%A' de `%B'"
--
--#: elf.c:4142
--msgid "%B: The first section in the PT_DYNAMIC segment is not the .dynamic section"
--msgstr "%B: La primera sección en el segmento PT_DYNAMIC no es la sección .dynamic"
--
--#: elf.c:4165
--msgid "%B: Not enough room for program headers, try linking with -N"
--msgstr "%B: No hay suficiente espacio para los encabezados del programa, pruebe enlazar con -N"
--
--#: elf.c:4243
--msgid "%B: section %A lma 0x%lx overlaps previous sections"
--msgstr "%B: la sección %A lma 0x%lx traslapa las secciones anteriores"
--
--#: elf.c:4341
--msgid "%B: section `%A' can't be allocated in segment %d"
--msgstr "%B: la sección `%A' no se puede asignar en el segmento %d"
--
--#: elf.c:4390
--msgid "%B: warning: allocated section `%s' not in segment"
--msgstr "%B: aviso: la sección asignada `%s' no está en el segmento"
--
--#: elf.c:4886
--msgid "%B: symbol `%s' required but not present"
--msgstr "%B: se requiere el símbolo `%s' pero no está presente"
--
--#: elf.c:5199
--msgid "%B: warning: Empty loadable segment detected, is this intentional ?\n"
--msgstr "%B: aviso: Se detectó un segmento cargable vacío, ¿ esto es intencional ?\n"
--
--#: elf.c:6105
--#, c-format
--msgid "Unable to find equivalent output section for symbol '%s' from section '%s'"
--msgstr "No se puede encontrar la sección de salida equivalente para el símbolo '%s' de la sección '%s'"
--
--#: elf.c:7079
--msgid "%B: unsupported relocation type %s"
--msgstr "%B: no se admite el tipo de reubicación %s"
--
--#: elfcode.h:813
-+#: elfcode.h:795
- #, c-format
- msgid "warning: %s has a corrupt string table index - ignoring"
- msgstr "aviso: %s tiene un índice de tablas de cadenas corrupto - se descarta"
--#: elfcode.h:1226
-+#: elfcode.h:1201
- #, c-format
- msgid "%s: version count (%ld) does not match symbol count (%ld)"
- msgstr "%s: la cuenta de versión (%ld) no coincide con la cuenta de símbolos (%ld)"
--#: elfcode.h:1459
-+#: elfcode.h:1435
- #, c-format
- msgid "%s(%s): relocation %d has invalid symbol index %ld"
- msgstr "%s(%s): la reubicación %d tiene un índice de símbolo %ld inválido"
--#: elf-eh-frame.c:823
--msgid "%P: fde encoding in %B(%A) prevents .eh_frame_hdr table being created.\n"
--msgstr "%P: la codificación fde en %B(%A) previene la creación de la tabla .eh_frame_hdr.\n"
--
--#: elf-eh-frame.c:974
--msgid "%P: error in %B(%A); no .eh_frame_hdr table will be created.\n"
--msgstr "%P: error en %B(%A); no se creará la tabla .eh_frame_hdr.\n"
--
--#: elf-hppa.h:2219 elf-hppa.h:2233
--msgid "%B(%A): warning: unresolvable relocation against symbol `%s'"
--msgstr "%B(%A): aviso: reubicación sin resolución contra el símbolo `%s'"
-+#: elfcore.h:251
-+msgid "Warning: %B is truncated: expected core file size >= %lu, found: %lu."
-+msgstr "Aviso: se truncó %B: se esperaba el tamaño de fichero core >= %lu, se encontró: %lu."
- #: elflink.c:1028
- msgid "%s: TLS definition in %B section %A mismatches non-TLS definition in %B section %A"
-@@ -2358,282 +2463,295 @@ msgstr "%s: la referencia TLS en %B no coincide con la definici
- msgid "%B: unexpected redefinition of indirect versioned symbol `%s'"
- msgstr "%B: redefinición inesperada del símbolo con versión indirecta `%s'"
--#: elflink.c:1974
-+#: elflink.c:1982
- msgid "%B: version node not found for symbol %s"
- msgstr "%B: no se encuentra la versión del nodo para el símbolo %s"
--#: elflink.c:2122
-+#: elflink.c:2130
- msgid "%B: bad reloc symbol index (0x%lx >= 0x%lx) for offset 0x%lx in section `%A'"
- msgstr "%B: índice de símbolos de reubicación inválido (0x%lx >= 0x%lx) erróneo para el desplazamiento 0x%lx en la sección `%A'"
--#: elflink.c:2314
-+#: elflink.c:2327
- msgid "%B: relocation size mismatch in %B section %A"
- msgstr "%B: el tamaño de reubicación no coincide en %B sección %A"
--#: elflink.c:2616
-+#: elflink.c:2629
- #, c-format
- msgid "warning: type and size of dynamic symbol `%s' are not defined"
- msgstr "aviso: el tipo y tamaño del símbolo dinámico `%s' no están definidos"
--#: elflink.c:3910
-+#: elflink.c:3953
- msgid "%B: %s: invalid version %u (max %d)"
- msgstr "%B: %s: versión %u inválida (máximo %d)"
--#: elflink.c:3946
-+#: elflink.c:3989
- msgid "%B: %s: invalid needed version %d"
- msgstr "%B: %s: versión requerida %d inválida"
--#: elflink.c:4129
-+#: elflink.c:4172
- msgid "Warning: alignment %u of common symbol `%s' in %B is greater than the alignment (%u) of its section %A"
- msgstr "Aviso: la alineación %u del símbolo común `%s' en %B es más grande que la alineación (%u) de su sección %A"
--#: elflink.c:4135
-+#: elflink.c:4178
- msgid "Warning: alignment %u of symbol `%s' in %B is smaller than %u in %B"
- msgstr "Aviso: la alineación %u del símbolo `%s' en %B es más pequeña que %u en %B"
--#: elflink.c:4150
-+#: elflink.c:4193
- msgid "Warning: size of symbol `%s' changed from %lu in %B to %lu in %B"
- msgstr "Aviso: el tamaño del símbolo `%s' cambió de %lu en %B a %lu en %B"
--#: elflink.c:4326
-+#: elflink.c:4371
- #, c-format
- msgid "%s: invalid DSO for symbol `%s' definition"
- msgstr "%s: DSO inválido para la definición del símbolo `%s'"
--#: elflink.c:5552
-+#: elflink.c:5621
- #, c-format
- msgid "%s: undefined version: %s"
- msgstr "%s: versión sin definir: %s"
--#: elflink.c:5620
-+#: elflink.c:5689
- msgid "%B: .preinit_array section is not allowed in DSO"
- msgstr "%B: no se permite la sección .preinit_array en DSO"
--#: elflink.c:7359
-+#: elflink.c:7414
- #, c-format
- msgid "undefined %s reference in complex symbol: %s"
- msgstr "referencia %s indefinida en el símbolo complejo: %s"
--#: elflink.c:7514
-+#: elflink.c:7568
- #, c-format
- msgid "unknown operator '%c' in complex symbol"
- msgstr "operador desconocido '%c' en el símbolo complejo"
--#: elflink.c:8053 elflink.c:8070 elflink.c:8107 elflink.c:8124
-+#: elflink.c:7904 elflink.c:7921 elflink.c:7958 elflink.c:7975
- msgid "%B: Unable to sort relocs - they are in more than one size"
- msgstr "%B: No se pueden ordenar las reubicaciones - son de tamaños diferentes"
--#: elflink.c:8084 elflink.c:8138
-+#: elflink.c:7935 elflink.c:7989
- msgid "%B: Unable to sort relocs - they are of an unknown size"
- msgstr "%B: No se pueden ordenar las reubicaciones - son de tamaño desconocido"
--#: elflink.c:8187
-+#: elflink.c:8038
- msgid "Not enough memory to sort relocations"
- msgstr "No hay suficiente memoria para ordenar las reubicaciones"
--#: elflink.c:8374
-+#: elflink.c:8227
- msgid "%B: Too many sections: %d (>= %d)"
- msgstr "%B: Demasiadas secciones:  %d (>= %d)"
--#: elflink.c:8608
-+#: elflink.c:8461
- msgid "%B: %s symbol `%s' in %B is referenced by DSO"
- msgstr "%B: el símbolo %s `%s' en %B está referenciado por DSO"
--#: elflink.c:8691
-+#: elflink.c:8544
- msgid "%B: could not find output section %A for input section %A"
- msgstr "%B: no se puede encontrar la sección de salida %A para la sección de entrada %A"
--#: elflink.c:8788
-+#: elflink.c:8655
- msgid "%B: %s symbol `%s' isn't defined"
- msgstr "%B: el símbolo %s `%s' no está definido"
--#: elflink.c:9284
-+#: elflink.c:9141
- msgid "error: %B contains a reloc (0x%s) for section %A that references a non-existent global symbol"
- msgstr "error: %B contiene una reubicación (0x%s) para la sección %A que refiere a un símbolo global que no existe"
--#: elflink.c:9318
-+#: elflink.c:9205
- msgid "%X`%s' referenced in section `%A' of %B: defined in discarded section `%A' of %B\n"
- msgstr "%X`%s' referido en la sección `%A' de %B: se definió en la sección descartada `%A' de %B\n"
--#: elflink.c:9936
-+#: elflink.c:9825
- msgid "%A has both ordered [`%A' in %B] and unordered [`%A' in %B] sections"
- msgstr "%A tiene tanto secciones ordenadas [`%A' en %B] como desordenadas [`%A' en %B]"
--#: elflink.c:9941
-+#: elflink.c:9830
- #, c-format
- msgid "%A has both ordered and unordered sections"
- msgstr "%A tiene tanto secciones ordenadas como desordenadas"
--#: elflink.c:10828 elflink.c:10872
-+#: elflink.c:10715 elflink.c:10759
- msgid "%B: could not find output section %s"
- msgstr "%B: no se puede encontrar la sección de salida %s"
--#: elflink.c:10833
-+#: elflink.c:10720
- #, c-format
- msgid "warning: %s section has zero size"
- msgstr "aviso: la sección %s es de tamaño cero"
--#: elflink.c:10937
-+#: elflink.c:10824
- msgid "%P: warning: creating a DT_TEXTREL in a shared object.\n"
- msgstr "%P: aviso: se crea un DT_TEXTREL en un objeto compartido.\n"
--#: elflink.c:11305
-+#: elflink.c:11006
-+msgid "%P%X: can not read symbols: %E\n"
-+msgstr "%P%X: no se pueden leer símbolos: %E\n"
-+
-+#: elflink.c:11313
- msgid "Removing unused section '%s' in file '%B'"
- msgstr "Se elimina la sección sin uso '%s' en el fichero '%B'"
--#: elflink.c:11496
-+#: elflink.c:11525
- msgid "Warning: gc-sections option ignored"
- msgstr "Aviso: se descarta la opción gc-sections"
--#: elflink.c:11987
--msgid "%P%X: can not read symbols: %E\n"
--msgstr "%P%X: no se pueden leer símbolos: %E\n"
--
--#: elflink.c:12129
-+#: elflink.c:12056
- msgid "%B: ignoring duplicate section `%A'"
- msgstr "%B: se descarta la sección duplicada `%A'"
--#: elflink.c:12136 elflink.c:12143
-+#: elflink.c:12063 elflink.c:12070
- msgid "%B: duplicate section `%A' has different size"
- msgstr "%B: la sección duplicada `%A' tiene tamaño diferente"
--#: elflink.c:12151 elflink.c:12156
-+#: elflink.c:12078 elflink.c:12083
- msgid "%B: warning: could not read contents of section `%A'"
- msgstr "%B: aviso: no se puede leer el contenido de la sección `%A'"
--#: elflink.c:12160
-+#: elflink.c:12087
- msgid "%B: warning: duplicate section `%A' has different contents"
- msgstr "%B: aviso: la sección duplicada `%A' tiene contenido diferente"
--#: elflink.c:12239 linker.c:3081
-+#: elflink.c:12166 linker.c:3080
- msgid "%F%P: already_linked_table: %E"
- msgstr "%F%P: already_linked_table: %E"
--#: elf-m10300.c:1532
--msgid "error: inappropriate relocation type for shared library (did you forget -fpic?)"
--msgstr "error: tipo de reubicación inapropiada para la biblioteca compartida (¿olvidó -fpic?)"
--
--#: elf-m10300.c:1535
--msgid "internal error: suspicious relocation type used in shared library"
--msgstr "error interno: se usó un tipo de reubicación sospechosa en una biblioteca compartida"
--
--#: elfxx-mips.c:990
-+#: elfxx-mips.c:1197
- msgid "static procedure (no name)"
- msgstr "procedimiento estático (sin nombre)"
--#: elfxx-mips.c:4663
-+#: elfxx-mips.c:5562
- msgid "%B: %A+0x%lx: jump to stub routine which is not jal"
- msgstr "%B: %A+0x%lx: salto a una rutina cabo la cual no es jal"
--#: elfxx-mips.c:5326 elfxx-mips.c:5546
-+#: elfxx-mips.c:6206 elfxx-mips.c:6427
- msgid "%B: Warning: bad `%s' option size %u smaller than its header"
- msgstr "%B: Aviso: el tamaño de opción `%s' %u erróneo es más pequeño que su encabezado"
--#: elfxx-mips.c:6405
-+#: elfxx-mips.c:7174 elfxx-mips.c:7299
-+msgid "%B: Warning: cannot determine the target function for stub section `%s'"
-+msgstr "%B: Aviso: no se puede determinar la función objetivo para la sección de cabo `%s'"
-+
-+#: elfxx-mips.c:7428
- msgid "%B: Malformed reloc detected for section %s"
- msgstr "%B: Se detectó una reubicación malformada para la sección %s"
--#: elfxx-mips.c:6447
-+#: elfxx-mips.c:7468
- msgid "%B: GOT reloc at 0x%lx not expected in executables"
- msgstr "%B: no se esperaba la reubicación GOT en 0x%lx en ejecutables"
--#: elfxx-mips.c:6517
-+#: elfxx-mips.c:7566
- msgid "%B: CALL16 reloc at 0x%lx not against global symbol"
- msgstr "%B: la reubicación CALL16 en 0x%lx no es contra un símbolo global"
--#: elfxx-mips.c:7880
-+#: elfxx-mips.c:8244
-+#, c-format
-+msgid "non-dynamic relocations refer to dynamic symbol %s"
-+msgstr "reubicaciones que no son dinámicas se refieren al símbolo dinámico %s"
-+
-+#: elfxx-mips.c:8947
- msgid "%B: Can't find matching LO16 reloc against `%s' for %s at 0x%lx in section `%A'"
- msgstr "%B: No se puede encontrar una reubicación LO16 coincidente contra `%s' para %s en 0x%lx en la sección `%A'"
--#: elfxx-mips.c:8046
-+#: elfxx-mips.c:9086
- msgid "small-data section exceeds 64KB; lower small-data size limit (see option -G)"
- msgstr "la sección small-data excede los 64KB; disminuya el límite de tamaño de small-data (vea la opción -G)"
--#: elfxx-mips.c:10661
-+#: elfxx-mips.c:11887
- #, c-format
- msgid "%s: illegal section name `%s'"
- msgstr "%s: nombre de sección `%s' ilegal"
--#: elfxx-mips.c:11031 elfxx-mips.c:11050
-+#: elfxx-mips.c:12262 elfxx-mips.c:12288
- msgid "Warning: %B uses -msingle-float, %B uses -mdouble-float"
- msgstr "Aviso: %B usa -msingle-float, %B usa -mdouble-float"
--#: elfxx-mips.c:11106
-+#: elfxx-mips.c:12274 elfxx-mips.c:12330
-+msgid "Warning: %B uses -msingle-float, %B uses -mips32r2 -mfp64"
-+msgstr "Aviso: %B usa -msingle-float, %B usa -mips32r2 -mfp64"
-+
-+#: elfxx-mips.c:12300 elfxx-mips.c:12336
-+msgid "Warning: %B uses -mdouble-float, %B uses -mips32r2 -mfp64"
-+msgstr "Aviso: %B usa -mdouble-float, %B usa -mips32r2 -mfp64"
-+
-+#: elfxx-mips.c:12378
- msgid "%B: endianness incompatible with that of the selected emulation"
- msgstr "%B: la endianez es incompatible con aquella de la emulación seleccionada"
--#: elfxx-mips.c:11118
-+#: elfxx-mips.c:12389
- msgid "%B: ABI is incompatible with that of the selected emulation"
- msgstr "%B: la ABI es incompatible con aquella de la emulación seleccionada"
--#: elfxx-mips.c:11218
-+#: elfxx-mips.c:12470
-+msgid "%B: warning: linking abicalls files with non-abicalls files"
-+msgstr "%B: aviso: se enlazan ficheros de llamadas abi con ficheros que no son de llamadas abi"
-+
-+#: elfxx-mips.c:12487
- msgid "%B: linking 32-bit code with 64-bit code"
- msgstr "%B: se enlaza código de 32-bit con código de 64-bit"
--#: elfxx-mips.c:11246
-+#: elfxx-mips.c:12515
- msgid "%B: linking %s module with previous %s modules"
- msgstr "%B: se enlaza el módulo %s con módulos %s previos"
--#: elfxx-mips.c:11269
-+#: elfxx-mips.c:12538
- msgid "%B: ABI mismatch: linking %s module with previous %s modules"
- msgstr "%B: no coincide el ABI: se enlaza el módulo %s con módulos %s previos"
--#: elfxx-mips.c:11334
-+#: elfxx-mips.c:12702
- #, c-format
- msgid " [abi=O32]"
- msgstr " [abi=O32]"
--#: elfxx-mips.c:11336
-+#: elfxx-mips.c:12704
- #, c-format
- msgid " [abi=O64]"
- msgstr " [abi=O64]"
--#: elfxx-mips.c:11338
-+#: elfxx-mips.c:12706
- #, c-format
- msgid " [abi=EABI32]"
- msgstr " [abi=EABI32]"
--#: elfxx-mips.c:11340
-+#: elfxx-mips.c:12708
- #, c-format
- msgid " [abi=EABI64]"
- msgstr " [abi=EABI64]"
--#: elfxx-mips.c:11342
-+#: elfxx-mips.c:12710
- #, c-format
- msgid " [abi unknown]"
- msgstr " [abi desconocido]"
--#: elfxx-mips.c:11344
-+#: elfxx-mips.c:12712
- #, c-format
- msgid " [abi=N32]"
- msgstr " [abi=N32]"
--#: elfxx-mips.c:11346
-+#: elfxx-mips.c:12714
- #, c-format
- msgid " [abi=64]"
- msgstr " [abi=64]"
--#: elfxx-mips.c:11348
-+#: elfxx-mips.c:12716
- #, c-format
- msgid " [no abi set]"
- msgstr " [no hay conjunto abi]"
--#: elfxx-mips.c:11369
-+#: elfxx-mips.c:12737
- #, c-format
- msgid " [unknown ISA]"
- msgstr " [ISA desconocido]"
--#: elfxx-mips.c:11380
-+#: elfxx-mips.c:12748
- #, c-format
- msgid " [not 32bitmode]"
- msgstr " [no es modo 32bit]"
--#: elfxx-sparc.c:430
-+#: elfxx-sparc.c:440
- #, c-format
- msgid "invalid relocation type %d"
- msgstr "tipo de reubicación %d inválido"
--#: elfxx-sparc.c:2901
-+#: elfxx-sparc.c:2976
- msgid "%B: probably compiled without -fPIC?"
- msgstr "%B: ¿Compilado probablemente sin -fPIC?"
-@@ -2720,34 +2838,34 @@ msgstr "%B: longitud de secci
- msgid "%s: address 0x%s out of range for Intel Hex file"
- msgstr "%s: la dirección 0x%s está fuera de rango en el fichero Hexadecimal de Intel"
--#: libbfd.c:980
-+#: libbfd.c:1008
- #, c-format
- msgid "Deprecated %s called at %s line %d in %s\n"
- msgstr "Se llamó a %s que es obsoleto en %s línea %d en %s\n"
--#: libbfd.c:983
-+#: libbfd.c:1011
- #, c-format
- msgid "Deprecated %s called\n"
- msgstr "Se llamó a %s que es obsoleto\n"
--#: linker.c:1875
-+#: linker.c:1874
- msgid "%B: indirect symbol `%s' to `%s' is a loop"
- msgstr "%B: el símbolo indirecto `%s' para `%s' es un ciclo"
--#: linker.c:2741
-+#: linker.c:2740
- #, c-format
- msgid "Attempt to do relocatable link with %s input and %s output"
- msgstr "Se intentó hacer un enlace reubicable con entrada %s y salida %s"
--#: linker.c:3048
-+#: linker.c:3047
- msgid "%B: warning: ignoring duplicate section `%A'\n"
- msgstr "%B: aviso: se descarta la sección duplicada `%A'\n"
--#: linker.c:3062
-+#: linker.c:3061
- msgid "%B: warning: duplicate section `%A' has different size\n"
- msgstr "%B: aviso: la sección duplicada `%A' es de tamaño diferente\n"
--#: merge.c:820
-+#: merge.c:828
- #, c-format
- msgid "%s: access beyond end of merged section (%ld)"
- msgstr "%s: acceso más allá del final de la sección mezclada (%ld)"
-@@ -2887,6 +3005,26 @@ msgstr "%s: no se puede representar la secci
- msgid "Unhandled OSF/1 core file section type %d\n"
- msgstr "Tipo de sección de fichero núcleo OSF/1 %d sin manejar\n"
-+#: pe-mips.c:607
-+msgid "%B: `ld -r' not supported with PE MIPS objects\n"
-+msgstr "%B: `ld -r' no se admite con objetos PE MIPS\n"
-+
-+#. OK, at this point the following variables are set up:
-+#. src = VMA of the memory we're fixing up
-+#. mem = pointer to memory we're fixing up
-+#. val = VMA of what we need to refer to.
-+#: pe-mips.c:723
-+msgid "%B: unimplemented %s\n"
-+msgstr "%B: %s sin implementar\n"
-+
-+#: pe-mips.c:749
-+msgid "%B: jump too far away\n"
-+msgstr "%B: salto demasiado lejos\n"
-+
-+#: pe-mips.c:775
-+msgid "%B: bad pair/reflo after refhi\n"
-+msgstr "%B: pair/reflo erróneo después de refhi\n"
-+
- #. XXX code yet to be written.
- #: peicode.h:759
- msgid "%B: Unhandled import type; %x"
-@@ -2916,26 +3054,6 @@ msgstr "%B: el tama
- msgid "%B: string not null terminated in ILF object file."
- msgstr "%B: cadena no terminada en null en el fichero objeto ILF."
--#: pe-mips.c:606
--msgid "%B: `ld -r' not supported with PE MIPS objects\n"
--msgstr "%B: `ld -r' no se admite con objetos PE MIPS\n"
--
--#. OK, at this point the following variables are set up:
--#. src = VMA of the memory we're fixing up
--#. mem = pointer to memory we're fixing up
--#. val = VMA of what we need to refer to.
--#: pe-mips.c:722
--msgid "%B: unimplemented %s\n"
--msgstr "%B: %s sin implementar\n"
--
--#: pe-mips.c:748
--msgid "%B: jump too far away\n"
--msgstr "%B: salto demasiado lejos\n"
--
--#: pe-mips.c:774
--msgid "%B: bad pair/reflo after refhi\n"
--msgstr "%B: pair/reflo erróneo después de refhi\n"
--
- #: ppcboot.c:414
- #, c-format
- msgid ""
-@@ -2950,22 +3068,22 @@ msgstr ""
- msgid "Entry offset        = 0x%.8lx (%ld)\n"
- msgstr "Desplazamiento de entrada = 0x%.8lx (%ld)\n"
--#: ppcboot.c:416
-+#: ppcboot.c:417
- #, c-format
- msgid "Length              = 0x%.8lx (%ld)\n"
- msgstr "Longitud                  = 0x%.8lx (%ld)\n"
--#: ppcboot.c:419
-+#: ppcboot.c:421
- #, c-format
- msgid "Flag field          = 0x%.2x\n"
- msgstr "Campo de opciones         = 0x%.2x\n"
--#: ppcboot.c:425
-+#: ppcboot.c:427
- #, c-format
- msgid "Partition name      = \"%s\"\n"
- msgstr "Nombre de la partición    = \"%s\"\n"
--#: ppcboot.c:444
-+#: ppcboot.c:446
- #, c-format
- msgid ""
- "\n"
-@@ -2974,22 +3092,22 @@ msgstr ""
- "\n"
- "Partición[%d] inicio = { 0x%.2x, 0x%.2x, 0x%.2x, 0x%.2x }\n"
--#: ppcboot.c:450
-+#: ppcboot.c:452
- #, c-format
- msgid "Partition[%d] end    = { 0x%.2x, 0x%.2x, 0x%.2x, 0x%.2x }\n"
- msgstr "Partición[%d] fin    = { 0x%.2x, 0x%.2x, 0x%.2x, 0x%.2x }\n"
--#: ppcboot.c:456
-+#: ppcboot.c:458
- #, c-format
- msgid "Partition[%d] sector = 0x%.8lx (%ld)\n"
- msgstr "Partición[%d] sector = 0x%.8lx (%ld)\n"
--#: ppcboot.c:457
-+#: ppcboot.c:460
- #, c-format
- msgid "Partition[%d] length = 0x%.8lx (%ld)\n"
- msgstr "Partición[%d] longitud = 0x%.8lx (%ld)\n"
--#: som.c:5088
-+#: som.c:5137
- #, c-format
- msgid ""
- "\n"
-@@ -2998,7 +3116,7 @@ msgstr ""
- "\n"
- "Encabezado Auxiliar de Ejecución\n"
--#: som.c:5349
-+#: som.c:5440
- msgid "som_sizeof_headers unimplemented"
- msgstr "som_sizeof_headers sin implementar"
-@@ -3006,11 +3124,15 @@ msgstr "som_sizeof_headers sin implementar"
- msgid "%B:%d: Unexpected character `%s' in S-record file\n"
- msgstr "%B:%d: Caractér `%s' inesperado en el fichero S-record\n"
-+#: srec.c:567 srec.c:600
-+msgid "%B:%d: Bad checksum in S-record file\n"
-+msgstr "%B:%d: Suma de comprobación errónea en el fichero S-record\n"
-+
- #: stabs.c:279
- msgid "%B(%A+0x%lx): Stabs entry has invalid string index."
- msgstr "%B(%A+0x%lx): La entrada de cabos tiene una cadena índice inválida."
--#: syms.c:1057
-+#: syms.c:1067
- msgid "Unsupported .stab relocation"
- msgstr "No se admite la reubicación .stab"
-@@ -3047,20 +3169,20 @@ msgstr "Desbordamiento de la pila (%d) en _bfd_vms_push"
- msgid "Stack underflow in _bfd_vms_pop"
- msgstr "Desbordamiento por debajo de la pila en _bfd_vms_pop"
--#: vms-misc.c:803
-+#: vms-misc.c:808
- msgid "_bfd_vms_output_counted called with zero bytes"
- msgstr "se llamó _bfd_vms_output_counted con cero bytes"
--#: vms-misc.c:808
-+#: vms-misc.c:813
- msgid "_bfd_vms_output_counted called with too many bytes"
- msgstr "se llamó _bfd_vms_output_counted con demasiados bytes"
--#: vms-misc.c:926
-+#: vms-misc.c:931
- #, c-format
- msgid "Symbol %s replaced by %s\n"
- msgstr "El símbolo %s fue reemplazado por %s\n"
--#: vms-misc.c:985
-+#: vms-misc.c:990
- #, c-format
- msgid "failed to enter %s"
- msgstr "falló la introducción de %s"
-@@ -3256,73 +3378,77 @@ msgstr "%s: reubicaci
- msgid "%s: `%s' in loader reloc but not loader sym"
- msgstr "%s: `%s' en la reubicación del cargador pero no es un símbolo del cargador"
--#: elf32-ia64.c:1169 elf64-ia64.c:1169
-+#: elf32-ia64.c:1037 elf64-ia64.c:1037
- msgid "%B: Can't relax br at 0x%lx in section `%A'. Please use brl or indirect branch."
- msgstr "%B: No se puede relajar br en 0x%lx en la sección `%A'. Por favor use brl o ramificación indirecta."
--#: elf32-ia64.c:2910 elf64-ia64.c:2910
-+#: elf32-ia64.c:2742 elf64-ia64.c:2742
- msgid "@pltoff reloc against local symbol"
- msgstr "reubicación @pltoff contra un símbolo local"
--#: elf32-ia64.c:4523 elf64-ia64.c:4523
-+#: elf32-ia64.c:4317 elf64-ia64.c:4317
- #, c-format
- msgid "%s: short data segment overflowed (0x%lx >= 0x400000)"
- msgstr "%s: segmento de datos short desbordado (0x%lx >= 0x400000)"
--#: elf32-ia64.c:4534 elf64-ia64.c:4534
-+#: elf32-ia64.c:4328 elf64-ia64.c:4328
- #, c-format
- msgid "%s: __gp does not cover short data segment"
- msgstr "%s: __gp no cubre el segmento de datos short"
--#: elf32-ia64.c:4808 elf64-ia64.c:4808
-+#: elf32-ia64.c:4598 elf64-ia64.c:4598
- msgid "%B: non-pic code with imm relocation against dynamic symbol `%s'"
- msgstr "%B: código que no es pic con reubicación imm contra el símbolo dinámico %s"
--#: elf32-ia64.c:4875 elf64-ia64.c:4875
-+#: elf32-ia64.c:4665 elf64-ia64.c:4665
- msgid "%B: @gprel relocation against dynamic symbol %s"
- msgstr "%B: reubicación @gprel contra el símbolo dinámico %s"
--#: elf32-ia64.c:4938 elf64-ia64.c:4938
-+#: elf32-ia64.c:4728 elf64-ia64.c:4728
- msgid "%B: linking non-pic code in a position independent executable"
- msgstr "%B: se enlaza código que no es pic en un ejecutable independiente de posición"
--#: elf32-ia64.c:5075 elf64-ia64.c:5075
-+#: elf32-ia64.c:4865 elf64-ia64.c:4865
- msgid "%B: @internal branch to dynamic symbol %s"
- msgstr "%B: ramificación @internal al símbolo dinámico %s"
--#: elf32-ia64.c:5077 elf64-ia64.c:5077
-+#: elf32-ia64.c:4867 elf64-ia64.c:4867
- msgid "%B: speculation fixup to dynamic symbol %s"
- msgstr "%B: compostura de especulación al símbolo dinámico %s"
--#: elf32-ia64.c:5079 elf64-ia64.c:5079
-+#: elf32-ia64.c:4869 elf64-ia64.c:4869
- msgid "%B: @pcrel relocation against dynamic symbol %s"
- msgstr "%B: reubicación @pcrel contra el símbolo dinámico %s"
--#: elf32-ia64.c:5279 elf64-ia64.c:5279
-+#: elf32-ia64.c:5066 elf64-ia64.c:5066
- msgid "unsupported reloc"
- msgstr "no se admite la reubicación"
--#: elf32-ia64.c:5312 elf64-ia64.c:5312
-+#: elf32-ia64.c:5104 elf64-ia64.c:5104
-+msgid "%B: missing TLS section for relocation %s against `%s' at 0x%lx in section `%A'."
-+msgstr "%B: falta la sección TLS para la reubicación %s contra `%s' en 0x%lx en la sección `%A'."
-+
-+#: elf32-ia64.c:5119 elf64-ia64.c:5119
- msgid "%B: Can't relax br (%s) to `%s' at 0x%lx in section `%A' with size 0x%lx (> 0x1000000)."
- msgstr "%B: No se puede relajar br (%s) a `%s' en 0x%lx en la sección `%A' con tamaño 0x%lx (> 0x1000000)."
--#: elf32-ia64.c:5573 elf64-ia64.c:5573
-+#: elf32-ia64.c:5375 elf64-ia64.c:5375
- msgid "%B: linking trap-on-NULL-dereference with non-trapping files"
- msgstr "%B: se enlaza deferencias-captura-en-NULL con ficheros que no son de captura"
--#: elf32-ia64.c:5582 elf64-ia64.c:5582
-+#: elf32-ia64.c:5384 elf64-ia64.c:5384
- msgid "%B: linking big-endian files with little-endian files"
- msgstr "%B: se enlazan ficheros big-endian con ficheros little-endian"
--#: elf32-ia64.c:5591 elf64-ia64.c:5591
-+#: elf32-ia64.c:5393 elf64-ia64.c:5393
- msgid "%B: linking 64-bit files with 32-bit files"
- msgstr "%B: se enlazan ficheros de 64-bit con ficheros de 32-bit"
--#: elf32-ia64.c:5600 elf64-ia64.c:5600
-+#: elf32-ia64.c:5402 elf64-ia64.c:5402
- msgid "%B: linking constant-gp files with non-constant-gp files"
- msgstr "%B: se enlazan ficheros de gp constante con ficheros con gp no constante"
--#: elf32-ia64.c:5610 elf64-ia64.c:5610
-+#: elf32-ia64.c:5412 elf64-ia64.c:5412
- msgid "%B: linking auto-pic files with non-auto-pic files"
- msgstr "%B: se enlazan ficheros de pic automático con ficheros sin pic automático"
-@@ -3602,12 +3728,14 @@ msgstr ""
- "\n"
- "Tabla [Puntero a Ordinal/Nombre]\n"
--#: peigen.c:1610 pepigen.c:1610 pex64igen.c:1610
-+#: peigen.c:1617 peigen.c:1796 pepigen.c:1617 pepigen.c:1796 pex64igen.c:1617
-+#: pex64igen.c:1796
- #, c-format
- msgid "Warning, .pdata section size (%ld) is not a multiple of %d\n"
- msgstr "Aviso, el tamaño de la sección .pdata (%ld) no es un múltiplo de %d\n"
--#: peigen.c:1614 pepigen.c:1614 pex64igen.c:1614
-+#: peigen.c:1621 peigen.c:1800 pepigen.c:1621 pepigen.c:1800 pex64igen.c:1621
-+#: pex64igen.c:1800
- #, c-format
- msgid ""
- "\n"
-@@ -3616,12 +3744,12 @@ msgstr ""
- "\n"
- "La Tabla de Funciones (se interpretaron los contenidos de la sección .pdata)\n"
--#: peigen.c:1617 pepigen.c:1617 pex64igen.c:1617
-+#: peigen.c:1624 pepigen.c:1624 pex64igen.c:1624
- #, c-format
- msgid " vma:\t\t\tBegin Address    End Address      Unwind Info\n"
- msgstr " vma:\t\t\tDirección Inicio Dirección Fin    Información Desenvuelta\n"
--#: peigen.c:1619 pepigen.c:1619 pex64igen.c:1619
-+#: peigen.c:1626 pepigen.c:1626 pex64igen.c:1626
- #, c-format
- msgid ""
- " vma:\t\tBegin    End      EH       EH       PrologEnd  Exception\n"
-@@ -3630,22 +3758,31 @@ msgstr ""
- " vma:\t\tInicio   Fin      EH       EH       FinPrólogo Excepción\n"
- "     \t\tDirecc   Direcc   Asa      Datos    Dirección  Máscara\n"
--#: peigen.c:1689 pepigen.c:1689 pex64igen.c:1689
-+#: peigen.c:1696 pepigen.c:1696 pex64igen.c:1696
- #, c-format
- msgid " Register save millicode"
- msgstr " Registro para guardar milicódigo"
--#: peigen.c:1692 pepigen.c:1692 pex64igen.c:1692
-+#: peigen.c:1699 pepigen.c:1699 pex64igen.c:1699
- #, c-format
- msgid " Register restore millicode"
- msgstr " Registro para restaurar milicódigo"
--#: peigen.c:1695 pepigen.c:1695 pex64igen.c:1695
-+#: peigen.c:1702 pepigen.c:1702 pex64igen.c:1702
- #, c-format
- msgid " Glue code sequence"
- msgstr " Secuencia de código pegamento"
--#: peigen.c:1745 pepigen.c:1745 pex64igen.c:1745
-+#: peigen.c:1802 pepigen.c:1802 pex64igen.c:1802
-+#, c-format
-+msgid ""
-+" vma:\t\tBegin    Prolog   Function Flags    Exception EH\n"
-+"     \t\tAddress  Length   Length   32b exc  Handler   Data\n"
-+msgstr ""
-+" vma:\t\tInicio   Prólogo  Función  Opciones Excepción EH\n"
-+"     \t\tDirecc   Longitud Longitud 32b exc  Manejador Datos\n"
-+
-+#: peigen.c:1933 pepigen.c:1933 pex64igen.c:1933
- #, c-format
- msgid ""
- "\n"
-@@ -3656,7 +3793,7 @@ msgstr ""
- "\n"
- "Reubicaciones de Fichero Base PE (se interpretaron los contenidos de la sección .reloc)\n"
--#: peigen.c:1775 pepigen.c:1775 pex64igen.c:1775
-+#: peigen.c:1963 pepigen.c:1963 pex64igen.c:1963
- #, c-format
- msgid ""
- "\n"
-@@ -3665,7 +3802,7 @@ msgstr ""
- "\n"
- "Dirección Virtual: %08lx Tamaño del trozo %ld (0x%lx) Número de composturas %ld\n"
--#: peigen.c:1788 pepigen.c:1788 pex64igen.c:1788
-+#: peigen.c:1976 pepigen.c:1976 pex64igen.c:1976
- #, c-format
- msgid "\treloc %4d offset %4x [%4lx] %s"
- msgstr "\treubicación %4d desplazamiento %4x [%4lx] %s"
-@@ -3673,7 +3810,7 @@ msgstr "\treubicaci
- #. The MS dumpbin program reportedly ands with 0xff0f before
- #. printing the characteristics field.  Not sure why.  No reason to
- #. emulate it here.
--#: peigen.c:1827 pepigen.c:1827 pex64igen.c:1827
-+#: peigen.c:2015 pepigen.c:2015 pex64igen.c:2015
- #, c-format
- msgid ""
- "\n"
-@@ -3682,26 +3819,47 @@ msgstr ""
- "\n"
- "Características 0x%x\n"
--#: peigen.c:2088 pepigen.c:2088 pex64igen.c:2088
-+#: peigen.c:2289 pepigen.c:2289 pex64igen.c:2289
- msgid "%B: unable to fill in DataDictionary[1] because .idata$2 is missing"
- msgstr "%B: no se puede llenar DataDictionary[1] porque falta .idata$2"
--#: peigen.c:2106 pepigen.c:2106 pex64igen.c:2106
-+#: peigen.c:2307 pepigen.c:2307 pex64igen.c:2307
- msgid "%B: unable to fill in DataDictionary[1] because .idata$4 is missing"
- msgstr "%B: no se puede llenar DataDictionary[1] porque falta .idata$4"
--#: peigen.c:2125 pepigen.c:2125 pex64igen.c:2125
-+#: peigen.c:2326 pepigen.c:2326 pex64igen.c:2326
- msgid "%B: unable to fill in DataDictionary[12] because .idata$5 is missing"
- msgstr "%B: no se puede llenar DataDictionary[12] porque falta .idata$5"
--#: peigen.c:2143 pepigen.c:2143 pex64igen.c:2143
-+#: peigen.c:2344 pepigen.c:2344 pex64igen.c:2344
- msgid "%B: unable to fill in DataDictionary[PE_IMPORT_ADDRESS_TABLE (12)] because .idata$6 is missing"
- msgstr "%B: no se puede llenar DataDictionary[PE_IMPORT_ADDRESS_TABLE (12)] porque falta .idata$6"
--#: peigen.c:2163 pepigen.c:2163 pex64igen.c:2163
-+#: peigen.c:2364 pepigen.c:2364 pex64igen.c:2364
- msgid "%B: unable to fill in DataDictionary[9] because __tls_used is missing"
- msgstr "%B: no se puede llenar DataDictionary[9] porque falta __tls_used"
-+#~ msgid "Dwarf Error: DW_FORM_strp offset (%lu) greater than or equal to .debug_str size (%lu)."
-+#~ msgstr "Error de Dwarf: El desplazamiento DW_FROM_strp (%lu) es más grande o igual que el tamaño de .debug_str (%lu)."
-+
-+#~ msgid "Dwarf Error: Can't find .debug_abbrev section."
-+#~ msgstr "Error de Dwarf: No se puede encontrar la sección .debug_abbrev."
-+
-+#~ msgid "Dwarf Error: Abbrev offset (%lu) greater than or equal to .debug_abbrev size (%lu)."
-+#~ msgstr "Error de Dwarf: El desplazamiento de abreviatura (%lu) es más grande o igual que el tamaño de .debug_abbrev (%lu)."
-+
-+#~ msgid "Dwarf Error: Can't find .debug_line section."
-+#~ msgstr "Error de Dwarf: No se puede encontrar lan sección .debug_line."
-+
-+#~ msgid "Dwarf Error: Can't find .debug_ranges section."
-+#~ msgstr "Error de Dwarf: No se puede encontrar lan sección .debug_ranges."
-+
-+#~ msgid "ERROR: %B: Conflicting definitions of wchar_t"
-+#~ msgstr "ERROR: %B: Definiciones en conflicto de wchar_t"
-+
-+#~ msgid "%B: relocation R_X86_64_PC32 against protected function `%s' can not be used when making a shared object"
-+#~ msgstr "%B: no se puede usar la reubicación R_X86_64_PC32 contra la función protegida `%' cuando se hace un objeto compartido"
-+
- #~ msgid "ERROR: %B: Conflicting enum sizes"
- #~ msgstr "ERROR: %B: Tamaños de enum en conflicto"
-@@ -3846,9 +4004,6 @@ msgstr "%B: no se puede llenar DataDictionary[9] porque falta __tls_used"
- #~ msgid "local symbols in discarded section %s"
- #~ msgstr "símbolos locales en la sección descartada %s"
--#~ msgid "%s: linking abicalls files with non-abicalls files"
--#~ msgstr "%s: se enlazan ficheros de llamadas abi con ficheros que no son de llamadas abi"
--
- #~ msgid "%s: ISA mismatch (-mips%d) with previous modules (-mips%d)"
- #~ msgstr "%s: no coincide el ISA (-mips%d) con módulos previos (-mips%d)"
 diff --git a/gdb/Makefile.in b/gdb/Makefile.in
-index 74aa72e..c84a4ac 100644
+index f5e1dde..73ee55c 100644
 --- a/gdb/Makefile.in
 +++ b/gdb/Makefile.in
-@@ -167,11 +167,20 @@ INTL_CFLAGS = @INCINTL@
+@@ -169,6 +169,10 @@ TARGET_SYSTEM_ROOT_DEFINE = @TARGET_SYSTEM_ROOT_DEFINE@
+ # Did the user give us a --with-gdb-datadir option?
+ GDB_DATADIR_PATH = @GDB_DATADIR_PATH@
  
- # Where is the ICONV library?  This can be empty if libc has iconv.
- LIBICONV = @LIBICONV@
-+LIBICONV_INCLUDE = @LIBICONV_INCLUDE@
-+LIBICONV_LIBDIR = @LIBICONV_LIBDIR@
- # Did the user give us a --with-sysroot option?
- TARGET_SYSTEM_ROOT = @TARGET_SYSTEM_ROOT@
- TARGET_SYSTEM_ROOT_DEFINE = @TARGET_SYSTEM_ROOT_DEFINE@
-+# Did the user give us a --with-gdb-datadir option?
-+GDB_DATADIR_PATH = @GDB_DATADIR_PATH@
-+
 +# The argument to --with-pythondir.  If not given, this is
 +# GDB_DATADIR_PATH/python.
 +pythondir = @pythondir@
@@ -3734,232 +33,141 @@ index 74aa72e..c84a4ac 100644
  # Helper code from gnulib.
  LIBGNU = gnulib/libgnu.a
  INCGNU = -I$(srcdir)/gnulib -Ignulib
-@@ -270,12 +279,34 @@ SUBDIR_TUI_CFLAGS= \
+@@ -267,21 +271,37 @@ SUBDIR_TUI_CFLAGS= \
  #
  SUBDIR_PYTHON_OBS = \
        python.o \
-+      python-block.o \
-+      python-breakpoint.o \
-       python-cmd.o \
-+      python-frame.o \
-+      python-function.o \
-+      python-hooks.o \
-+      python-membuf.o \
-+      python-objfile.o \
-+      python-param.o \
-+      python-symbol.o \
-+      python-symtab.o \
-+      python-type.o \
-       python-utils.o \
-       python-value.o
++      py-block.o \
++      py-breakpoint.o \
+       py-cmd.o \
+       py-frame.o \
+       py-function.o \
++      py-hooks.o \
++      py-inferior.o \
++      py-infthread.o \
+       py-objfile.o \
++      py-param.o \
+       py-prettyprint.o \
++      py-symbol.o \
++      py-symtab.o \
+       py-type.o \
+       py-utils.o \
+       py-value.o
  SUBDIR_PYTHON_SRCS = \
        python/python.c \
-+      python/python-block.c \
-+      python/python-breakpoint.c \
-       python/python-cmd.c \
-+      python/python-frame.c \
-+      python/python-function.c \
-+      python/python-hooks.c \
-+      python/python-membuf.c \
-+      python/python-objfile.c \
-+      python/python-param.c \
-+      python/python-symbol.c \
-+      python/python-symtab.c \
-+      python/python-type.c \
-       python/python-utils.c \
-       python/python-value.c
- SUBDIR_PYTHON_DEPS =
-@@ -390,7 +421,8 @@ INTERNAL_CFLAGS_BASE = \
-       $(CFLAGS) $(GLOBAL_CFLAGS) $(PROFILE_CFLAGS) \
-       $(GDB_CFLAGS) $(OPCODES_CFLAGS) $(READLINE_CFLAGS) \
-       $(BFD_CFLAGS) $(INCLUDE_CFLAGS) $(LIBDECNUMBER_CFLAGS) \
--      $(INTL_CFLAGS) $(INCGNU) $(ENABLE_CFLAGS) $(INTERNAL_CPPFLAGS)
-+      $(INTL_CFLAGS) $(INCGNU) $(ENABLE_CFLAGS) $(INTERNAL_CPPFLAGS) \
-+      $(LIBICONV_INCLUDE)
- INTERNAL_WARN_CFLAGS = $(INTERNAL_CFLAGS_BASE) $(GDB_WARN_CFLAGS)
- INTERNAL_CFLAGS = $(INTERNAL_WARN_CFLAGS) $(GDB_WERROR_CFLAGS)
-@@ -402,7 +434,7 @@ LDFLAGS = @LDFLAGS@
- # I think it's perfectly reasonable for a user to set -pg in CFLAGS
- # and have it work; that's why CFLAGS is here.
- # PROFILE_CFLAGS is _not_ included, however, because we use monstartup.
--INTERNAL_LDFLAGS = $(CFLAGS) $(GLOBAL_CFLAGS) $(MH_LDFLAGS) $(LDFLAGS) $(CONFIG_LDFLAGS)
-+INTERNAL_LDFLAGS = $(CFLAGS) $(GLOBAL_CFLAGS) $(MH_LDFLAGS) $(LDFLAGS) $(CONFIG_LDFLAGS) $(LIBICONV_LIBDIR)
- # If your system is missing alloca(), or, more likely, it's there but
- # it doesn't work, then refer to libiberty.
-@@ -663,6 +695,7 @@ SFILES = ada-exp.y ada-lang.c ada-typeprint.c ada-valprint.c ada-tasks.c \
-       valarith.c valops.c valprint.c value.c varobj.c vec.c \
-       wrapper.c \
-       xml-tdesc.c xml-support.c \
-+      xml-syscall.c \
-       inferior.c
- LINTFILES = $(SFILES) $(YYFILES) $(CONFIG_SRCS) init.c
-@@ -733,7 +766,8 @@ config/sparc/nm-sol2.h config/nm-linux.h config/mips/nm-irix5.h    \
- config/rs6000/nm-rs6000.h top.h bsd-kvm.h gdb-stabs.h reggroups.h \
++      python/py-block.c \
++      python/py-breakpoint.c \
+       python/py-cmd.c \
+       python/py-frame.c \
+       python/py-function.c \
++      python/py-hooks.c \
++      python/py-inferior.c \
++      python/py-infthread.c \
+       python/py-objfile.c \
++      python/py-param.c \
+       python/py-prettyprint.c \
++      python/py-symbol.c \
++      python/py-symtab.c \
+       python/py-type.c \
+       python/py-utils.c \
+       python/py-value.c
+@@ -750,7 +770,7 @@ config/rs6000/nm-rs6000.h top.h bsd-kvm.h gdb-stabs.h reggroups.h \
  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
-+sentinel-frame.h bcache.h symfile.h windows-tdep.h linux-tdep.h xml-syscall.h \
-+python/python.h python/python-internal.h
+ sentinel-frame.h bcache.h symfile.h windows-tdep.h linux-tdep.h \
+-gdb_usleep.h jit.h xml-syscall.h ada-operator.inc
++gdb_usleep.h jit.h xml-syscall.h ada-operator.inc python/python.h python/python-internal.h
  
  # Header files that already have srcdir in them, or which are in objdir.
  
-@@ -812,10 +846,16 @@ COMMON_OBS = $(DEPFILES) $(CONFIG_OBS) $(YYOBJ) \
-       trad-frame.o \
-       tramp-frame.o \
-       solib.o solib-null.o \
--      prologue-value.o memory-map.o xml-support.o \
-+      prologue-value.o memory-map.o xml-support.o xml-syscall.o \
-       target-descriptions.o target-memory.o xml-tdesc.o xml-builtin.o \
-       inferior.o osdata.o
-+# Definitions for the syscall's XML files and dir
-+XML_SYSCALLS_DIR = syscalls/
-+XML_SYSCALLS_FILES = gdb-syscalls.dtd \
-+                   ppc-linux.xml ppc64-linux.xml \
-+                   i386-linux.xml amd64-linux.xml
-+
- TSOBS = inflow.o
- SUBDIRS = @subdirs@
-@@ -849,11 +889,38 @@ generated_files = config.h observer.h observer.inc ada-lex.c \
+@@ -874,7 +894,7 @@ generated_files = config.h observer.h observer.inc ada-lex.c \
        $(COMPILE) $<
        $(POSTCOMPILE)
  
--all: gdb$(EXEEXT) $(CONFIG_ALL)
-+all: gdb$(EXEEXT) $(CONFIG_ALL) .gdbinit xml-syscall-copy
+-all: gdb$(EXEEXT) $(CONFIG_ALL) xml-syscall-copy
++all: gdb$(EXEEXT) $(CONFIG_ALL) xml-syscall-copy .gdbinit
        @$(MAKE) $(FLAGS_TO_PASS) DO=all "DODIRS=`echo $(SUBDIRS) | sed 's/testsuite//'`" subdir_do
  .PHONY: all-tui
  all-tui: $(TUI)$(EXEEXT)
-+xml-syscall-copy:
-+      if [ "`cd $(srcdir) && pwd`" != "`pwd`" ] ; then \
-+        mkdir -p ./$(XML_SYSCALLS_DIR) ; \
-+        list='$(XML_SYSCALLS_FILES)' ; \
-+        for file in $$list ; do \
-+          f=$(srcdir)/$(XML_SYSCALLS_DIR)/$$file ; \
-+          if test -f $$f ; then \
-+            $(INSTALL_DATA) $$f \
-+                ./$(XML_SYSCALLS_DIR) ; \
-+          fi ; \
-+        done ; \
-+      fi ;
-+
-+# This target is responsible for properly installing the syscalls'
-+# XML files in the system.
-+xml-syscall-install:
-+      $(SHELL) $(srcdir)/../mkinstalldirs \
-+              $(DESTDIR)$(GDB_DATADIR_PATH)/$(XML_SYSCALLS_DIR) ; \
-+      list='$(XML_SYSCALLS_FILES)' ; \
-+      for file in $$list ; do \
-+        f=$(srcdir)/$(XML_SYSCALLS_DIR)/$$file ; \
-+        if test -f $$f ; then \
-+          $(INSTALL_DATA) $$f \
-+              $(DESTDIR)$(GDB_DATADIR_PATH)/$(XML_SYSCALLS_DIR) ; \
-+        fi ; \
-+      done ;
-+
- installcheck:
- # The check target can not use subdir_do, because subdir_do does not
-@@ -907,8 +974,11 @@ gdb.z:gdb.1
- # source file and doesn't care about rebuilding or just wants to save the
- # time it takes for make to check that all is up to date.
- # install-only is intended to address that need.
--install: all install-only
--install-only: $(CONFIG_INSTALL)
-+install: all install-only 
-+
-+# The "install-only" target also installs the syscalls' XML files in
-+# the system.
-+install-only: $(CONFIG_INSTALL) xml-syscall-install
-       transformed_name=`t='$(program_transform_name)'; \
-                         echo gdb | sed -e "$$t"` ; \
-               if test "x$$transformed_name" = x; then \
-@@ -1202,6 +1272,12 @@ stamp-h: config.in config.status
+@@ -1264,6 +1284,12 @@ stamp-h: $(srcdir)/config.in config.status
          CONFIG_LINKS= \
          $(SHELL) config.status
  
-+.gdbinit: gdbinit.in config.status
++.gdbinit: $(srcdir)/gdbinit.in config.status
 +      CONFIG_FILES=".gdbinit:gdbinit.in" \
 +        CONFIG_COMMANDS= \
 +        CONFIG_HEADERS= \
 +        $(SHELL) config.status
 +
- config.status: configure configure.tgt configure.host
+ config.status: $(srcdir)/configure configure.tgt configure.host
        $(SHELL) config.status --recheck
  
-@@ -1845,10 +1921,54 @@ python.o: $(srcdir)/python/python.c
+@@ -1963,6 +1989,14 @@ python.o: $(srcdir)/python/python.c
        $(COMPILE) $(PYTHON_CFLAGS) $(srcdir)/python/python.c
        $(POSTCOMPILE)
  
-+python-block.o: $(srcdir)/python/python-block.c
-+      $(COMPILE) $(PYTHON_CFLAGS) $(srcdir)/python/python-block.c
++py-block.o: $(srcdir)/python/py-block.c
++      $(COMPILE) $(PYTHON_CFLAGS) $(srcdir)/python/py-block.c
 +      $(POSTCOMPILE)
 +
-+python-breakpoint.o: $(srcdir)/python/python-breakpoint.c
-+      $(COMPILE) $(PYTHON_CFLAGS) $(srcdir)/python/python-breakpoint.c
++py-breakpoint.o: $(srcdir)/python/py-breakpoint.c
++      $(COMPILE) $(PYTHON_CFLAGS) $(srcdir)/python/py-breakpoint.c
 +      $(POSTCOMPILE)
 +
- python-cmd.o: $(srcdir)/python/python-cmd.c
-       $(COMPILE) $(PYTHON_CFLAGS) $(srcdir)/python/python-cmd.c
+ py-cmd.o: $(srcdir)/python/py-cmd.c
+       $(COMPILE) $(PYTHON_CFLAGS) $(srcdir)/python/py-cmd.c
+       $(POSTCOMPILE)
+@@ -1975,14 +2009,38 @@ py-function.o: $(srcdir)/python/py-function.c
+       $(COMPILE) $(PYTHON_CFLAGS) $(srcdir)/python/py-function.c
        $(POSTCOMPILE)
  
-+python-frame.o: $(srcdir)/python/python-frame.c
-+      $(COMPILE) $(PYTHON_CFLAGS) $(srcdir)/python/python-frame.c
-+      $(POSTCOMPILE)
-+
-+python-function.o: $(srcdir)/python/python-function.c
-+      $(COMPILE) $(PYTHON_CFLAGS) $(srcdir)/python/python-function.c
-+      $(POSTCOMPILE)
-+
-+python-hooks.o: $(srcdir)/python/python-hooks.c
-+      $(COMPILE) $(PYTHON_CFLAGS) $(srcdir)/python/python-hooks.c
-+      $(POSTCOMPILE)
-+
-+python-membuf.o: $(srcdir)/python/python-membuf.c
-+      $(COMPILE) $(PYTHON_CFLAGS) $(srcdir)/python/python-membuf.c
++py-hooks.o: $(srcdir)/python/py-hooks.c
++      $(COMPILE) $(PYTHON_CFLAGS) $(srcdir)/python/py-hooks.c
 +      $(POSTCOMPILE)
 +
-+python-objfile.o: $(srcdir)/python/python-objfile.c
-+      $(COMPILE) $(PYTHON_CFLAGS) $(srcdir)/python/python-objfile.c
++py-inferior.o: $(srcdir)/python/py-inferior.c
++      $(COMPILE) $(PYTHON_CFLAGS) $(srcdir)/python/py-inferior.c
 +      $(POSTCOMPILE)
 +
-+python-param.o: $(srcdir)/python/python-param.c
-+      $(COMPILE) $(PYTHON_CFLAGS) $(srcdir)/python/python-param.c
++py-infthread.o: $(srcdir)/python/py-infthread.c
++      $(COMPILE) $(PYTHON_CFLAGS) $(srcdir)/python/py-infthread.c
 +      $(POSTCOMPILE)
 +
-+python-symbol.o: $(srcdir)/python/python-symbol.c
-+      $(COMPILE) $(PYTHON_CFLAGS) $(srcdir)/python/python-symbol.c
+ py-objfile.o: $(srcdir)/python/py-objfile.c
+       $(COMPILE) $(PYTHON_CFLAGS) $(srcdir)/python/py-objfile.c
+       $(POSTCOMPILE)
++py-param.o: $(srcdir)/python/py-param.c
++      $(COMPILE) $(PYTHON_CFLAGS) $(srcdir)/python/py-param.c
 +      $(POSTCOMPILE)
 +
-+python-symtab.o: $(srcdir)/python/python-symtab.c
-+      $(COMPILE) $(PYTHON_CFLAGS) $(srcdir)/python/python-symtab.c
+ py-prettyprint.o: $(srcdir)/python/py-prettyprint.c
+       $(COMPILE) $(PYTHON_CFLAGS) $(srcdir)/python/py-prettyprint.c
+       $(POSTCOMPILE)
++py-symbol.o: $(srcdir)/python/py-symbol.c
++      $(COMPILE) $(PYTHON_CFLAGS) $(srcdir)/python/py-symbol.c
 +      $(POSTCOMPILE)
 +
-+python-type.o: $(srcdir)/python/python-type.c
-+      $(COMPILE) $(PYTHON_CFLAGS) $(srcdir)/python/python-type.c
++py-symtab.o: $(srcdir)/python/py-symtab.c
++      $(COMPILE) $(PYTHON_CFLAGS) $(srcdir)/python/py-symtab.c
 +      $(POSTCOMPILE)
 +
- python-utils.o: $(srcdir)/python/python-utils.c
-       $(COMPILE) $(PYTHON_CFLAGS) $(srcdir)/python/python-utils.c
+ py-type.o: $(srcdir)/python/py-type.c
+       $(COMPILE) $(PYTHON_CFLAGS) $(srcdir)/python/py-type.c
        $(POSTCOMPILE)
-@@ -1857,6 +1977,38 @@ python-value.o: $(srcdir)/python/python-value.c
-       $(COMPILE) $(PYTHON_CFLAGS) $(srcdir)/python/python-value.c
+@@ -1995,6 +2053,36 @@ py-value.o: $(srcdir)/python/py-value.c
+       $(COMPILE) $(PYTHON_CFLAGS) $(srcdir)/python/py-value.c
        $(POSTCOMPILE)
  
 +# All python library files, with the "python/lib" stripped off.
 +# Note that we should only install files in the "gdb" module.
-+PY_FILES = gdb/FrameIterator.py gdb/command/alias.py \
++PY_FILES = gdb/FrameIterator.py gdb/FrameWrapper.py gdb/command/alias.py \
 +    gdb/command/backtrace.py gdb/command/require.py \
-+    gdb/command/pahole.py gdb/command/__init__.py \
++    gdb/command/pahole.py gdb/command/upto.py gdb/command/__init__.py \
 +    gdb/command/ignore_errors.py gdb/command/save_breakpoints.py \
-+    gdb/libstdcxx/v6/printers.py gdb/libstdcxx/v6/__init__.py \
-+    gdb/libstdcxx/__init__.py gdb/function/caller_is.py \
-+    gdb/function/in_scope.py gdb/function/__init__.py gdb/backtrace.py \
-+    gdb/__init__.py
++    gdb/function/caller_is.py gdb/function/in_scope.py \
++    gdb/function/__init__.py gdb/backtrace.py gdb/__init__.py
 +
 +# Install the Python library.  Python library files go under
 +# $(pythondir).
@@ -3986,616 +194,353 @@ index 74aa72e..c84a4ac 100644
  # Dependency tracking.  Most of this is conditional on GNU Make being
  # found by configure; if GNU Make is not found, we fall back to a
 diff --git a/gdb/NEWS b/gdb/NEWS
-index 9078412..3f084e7 100644
+index 4fc6dcd..6744b23 100644
 --- a/gdb/NEWS
 +++ b/gdb/NEWS
-@@ -3,6 +3,13 @@
- *** Changes since GDB 6.8
-+* GDB now has support for multi-byte and wide character sets on the
-+target.  Strings whose character type is wchar_t, char16_t, or
-+char32_t are now correctly printed.  GDB supports wide- and unicode-
-+literals in C, that is, L'x', L"string", u'x', u"string", U'x', and
-+U"string" syntax.  And, GDB allows the "%ls" and "%lc" formats in
-+`printf'.
-+
- * GDB now supports automatic retrieval of shared library files from
- remote targets.  To use this feature, specify a system root that begins
- with the `remote:' prefix, either via the `set sysroot' command or via
-@@ -182,6 +189,11 @@ set target-async
-   with GDB while the target is running.  "show target-async" displays the
-   current state of asynchronous execution of the target.
-+set target-wide-charset
-+show target-wide-charset
-+  The target-wide-charset is the name of the character set that GDB
-+  uses when printing characters whose type is wchar_t.
-+
- set tcp auto-retry (on|off)
- show tcp auto-retry
- set tcp connect-timeout
-diff --git a/gdb/acinclude.m4 b/gdb/acinclude.m4
-index 81b5d47..c2bd043 100644
---- a/gdb/acinclude.m4
-+++ b/gdb/acinclude.m4
-@@ -29,6 +29,9 @@ sinclude([../config/depstand.m4])
- dnl For AM_LC_MESSAGES
- sinclude([../config/lcmessage.m4])
-+dnl For AM_LANGINFO_CODESET.
-+sinclude([../config/codeset.m4])
+@@ -462,6 +462,13 @@ x86/x86_64 Darwin         i[34567]86-*-darwin*
+ x86_64 MinGW                  x86_64-*-mingw*
++* New native configurations
 +
- #
- # Sometimes the native compiler is a bogus stub for gcc or /usr/ucb/cc. This
- # makes configure think it's cross compiling. If --target wasn't used, then
-@@ -174,8 +177,8 @@ AC_DEFUN([AM_ICONV],
-   AC_ARG_WITH([libiconv-prefix],
- [  --with-libiconv-prefix=DIR  search for libiconv in DIR/include and DIR/lib], [
-     for dir in `echo "$withval" | tr : ' '`; do
--      if test -d $dir/include; then CPPFLAGS="$CPPFLAGS -I$dir/include"; fi
--      if test -d $dir/lib; then LDFLAGS="$LDFLAGS -L$dir/lib"; fi
-+      if test -d $dir/include; then LIBICONV_INCLUDE="-I$dir/include"; CPPFLAGS="$CPPFLAGS -I$dir/include"; fi
-+      if test -d $dir/lib; then LIBICONV_LIBDIR="-L$dir/lib"; LDFLAGS="$LDFLAGS -L$dir/lib"; fi
-     done
-    ])
-@@ -230,6 +233,8 @@ size_t iconv();
-     LIBICONV="-liconv"
-   fi
-   AC_SUBST(LIBICONV)
-+  AC_SUBST(LIBICONV_INCLUDE)
-+  AC_SUBST(LIBICONV_LIBDIR)
- ])
++x86/x86_64 Darwin             i[34567]86-*-darwin*
++
++info os processes
++  Show operating system information about processes.
++
+ * New targets
  
- dnl written by Guido Draheim <guidod@gmx.de>, original by Alexandre Oliva 
+ Lattice Mico32                  lm32-*
 diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c
-index 671cb35..edcee3f 100644
+index 9b5d2c6..61676a9 100644
 --- a/gdb/ada-lang.c
 +++ b/gdb/ada-lang.c
-@@ -486,7 +486,7 @@ coerce_unspec_val_to_type (struct value *val, struct type *type)
-       set_value_component_location (result, val);
-       set_value_bitsize (result, value_bitsize (val));
-       set_value_bitpos (result, value_bitpos (val));
--      VALUE_ADDRESS (result) += value_offset (val);
-+      set_value_address (result, value_address (val));
-       if (value_lazy (val)
-           || TYPE_LENGTH (type) > TYPE_LENGTH (value_type (val)))
-         set_value_lazy (result, 1);
-@@ -1328,7 +1328,7 @@ thin_data_pntr (struct value *val)
-                        value_copy (val));
-   else
-     return value_from_longest (desc_data_type (thin_descriptor_type (type)),
--                               VALUE_ADDRESS (val) + value_offset (val));
-+                               value_address (val));
- }
- /* True iff TYPE indicates a "thick" array pointer type.  */
-@@ -1393,7 +1393,7 @@ desc_bounds (struct value *arr)
-       if (TYPE_CODE (type) == TYPE_CODE_PTR)
-         addr = value_as_long (arr);
-       else
--        addr = VALUE_ADDRESS (arr) + value_offset (arr);
-+        addr = value_address (arr);
-       return
-         value_from_longest (lookup_pointer_type (bounds_type),
-@@ -1666,8 +1666,8 @@ ada_type_of_array (struct value *arr, int bounds)
+@@ -1621,7 +1621,7 @@ ada_type_of_array (struct value *arr, int bounds)
          return NULL;
        while (arity > 0)
          {
--          struct type *range_type = alloc_type (objf);
--          struct type *array_type = alloc_type (objf);
-+          struct type *range_type = alloc_type (objf, NULL);
-+          struct type *array_type = alloc_type (objf, NULL);
+-          struct type *range_type = alloc_type_copy (value_type (arr));
++        struct type *range_type = alloc_type_copy (value_type (arr));
+           struct type *array_type = alloc_type_copy (value_type (arr));
            struct value *low = desc_one_bound (descriptor, arity, 0);
            struct value *high = desc_one_bound (descriptor, arity, 1);
-           arity -= 1;
-@@ -1774,9 +1774,9 @@ packed_array_type (struct type *type, long *elt_bits)
-   if (TYPE_CODE (type) != TYPE_CODE_ARRAY)
-     return type;
--  new_type = alloc_type (TYPE_OBJFILE (type));
-   new_elt_type = packed_array_type (ada_check_typedef (TYPE_TARGET_TYPE (type)),
-                                     elt_bits);
-+  new_type = alloc_type (TYPE_OBJFILE (type), new_elt_type);
-   create_array_type (new_type, new_elt_type, TYPE_INDEX_TYPE (type));
-   TYPE_FIELD_BITSIZE (new_type, 0) = *elt_bits;
-   TYPE_NAME (new_type) = ada_type_name (type);
-@@ -1831,6 +1831,7 @@ decode_packed_array_type (struct type *type)
-       return NULL;
-     }
-   shadow_type = SYMBOL_TYPE (sym);
-+  CHECK_TYPEDEF (shadow_type);
-   if (TYPE_CODE (shadow_type) != TYPE_CODE_ARRAY)
-     {
-@@ -2005,10 +2006,9 @@ ada_value_primitive_packed_val (struct value *obj, const gdb_byte *valaddr,
-     }
-   else if (VALUE_LVAL (obj) == lval_memory && value_lazy (obj))
-     {
--      v = value_at (type,
--                    VALUE_ADDRESS (obj) + value_offset (obj) + offset);
-+      v = value_at (type, value_address (obj) + offset);
-       bytes = (unsigned char *) alloca (len);
--      read_memory (VALUE_ADDRESS (v), bytes, len);
-+      read_memory (value_address (v), bytes, len);
-     }
-   else
-     {
-@@ -2018,15 +2018,18 @@ ada_value_primitive_packed_val (struct value *obj, const gdb_byte *valaddr,
+@@ -4727,14 +4727,10 @@ ada_lookup_symbol (const char *name, const struct block *block0,
  
-   if (obj != NULL)
-     {
-+      CORE_ADDR new_addr;
-+
-       set_value_component_location (v, obj);
--      VALUE_ADDRESS (v) += value_offset (obj) + offset;
-+      new_addr = value_address (obj) + offset;
-       set_value_bitpos (v, bit_offset + value_bitpos (obj));
-       set_value_bitsize (v, bit_size);
-       if (value_bitpos (v) >= HOST_CHAR_BIT)
-         {
--          VALUE_ADDRESS (v) += 1;
-+          new_addr++;
-           set_value_bitpos (v, value_bitpos (v) - HOST_CHAR_BIT);
-         }
-+      set_value_address (v, new_addr);
-     }
-   else
-     set_value_bitsize (v, bit_size);
-@@ -2218,7 +2221,7 @@ ada_value_assign (struct value *toval, struct value *fromval)
-       int from_size;
-       char *buffer = (char *) alloca (len);
-       struct value *val;
--      CORE_ADDR to_addr = VALUE_ADDRESS (toval) + value_offset (toval);
-+      CORE_ADDR to_addr = value_address (toval);
-       if (TYPE_CODE (type) == TYPE_CODE_FLT)
-         fromval = value_cast (type, fromval);
-@@ -2259,8 +2262,7 @@ value_assign_to_component (struct value *container, struct value *component,
-                          struct value *val)
+ static struct symbol *
+ ada_lookup_symbol_nonlocal (const char *name,
+-                            const char *linkage_name,
+                             const struct block *block,
+                             const domain_enum domain)
  {
-   LONGEST offset_in_container =
--    (LONGEST)  (VALUE_ADDRESS (component) + value_offset (component)
--              - VALUE_ADDRESS (container) - value_offset (container));
-+    (LONGEST)  (value_address (component) - value_address (container));
-   int bit_offset_in_container = 
-     value_bitpos (component) - value_bitpos (container);
-   int bits;
-@@ -3788,7 +3790,7 @@ parse_old_style_renaming (struct type *type,
- /* Return an lvalue containing the value VAL.  This is the identity on
-    lvalues, and otherwise has the side-effect of pushing a copy of VAL 
-    on the stack, using and updating *SP as the stack pointer, and 
--   returning an lvalue whose VALUE_ADDRESS points to the copy.  */
-+   returning an lvalue whose value_address points to the copy.  */
- static struct value *
- ensure_lval (struct value *val, CORE_ADDR *sp)
-@@ -3802,12 +3804,12 @@ ensure_lval (struct value *val, CORE_ADDR *sp)
-        indicated. */
-       if (gdbarch_inner_than (current_gdbarch, 1, 2))
-       {
--        /* Stack grows downward.  Align SP and VALUE_ADDRESS (val) after
-+        /* Stack grows downward.  Align SP and value_address (val) after
-            reserving sufficient space. */
-         *sp -= len;
-         if (gdbarch_frame_align_p (current_gdbarch))
-           *sp = gdbarch_frame_align (current_gdbarch, *sp);
--        VALUE_ADDRESS (val) = *sp;
-+        set_value_address (val, *sp);
-       }
-       else
-       {
-@@ -3815,14 +3817,14 @@ ensure_lval (struct value *val, CORE_ADDR *sp)
-            then again, re-align the frame. */
-         if (gdbarch_frame_align_p (current_gdbarch))
-           *sp = gdbarch_frame_align (current_gdbarch, *sp);
--        VALUE_ADDRESS (val) = *sp;
-+        set_value_address (val, *sp);
-         *sp += len;
-         if (gdbarch_frame_align_p (current_gdbarch))
-           *sp = gdbarch_frame_align (current_gdbarch, *sp);
-       }
-       VALUE_LVAL (val) = lval_memory;
--      write_memory (VALUE_ADDRESS (val), value_contents_raw (val), len);
-+      write_memory (value_address (val), value_contents_raw (val), len);
-     }
+-  if (linkage_name == NULL)
+-    linkage_name = name;
+-  return ada_lookup_symbol (linkage_name, block_static_block (block), domain,
+-                            NULL);
++  return ada_lookup_symbol (name, block_static_block (block), domain, NULL);
+ }
  
-   return val;
-@@ -3911,12 +3913,12 @@ make_array_descriptor (struct type *type, struct value *arr, CORE_ADDR *sp)
-   bounds = ensure_lval (bounds, sp);
-   modify_general_field (value_contents_writeable (descriptor),
--                        VALUE_ADDRESS (ensure_lval (arr, sp)),
-+                        value_address (ensure_lval (arr, sp)),
-                         fat_pntr_data_bitpos (desc_type),
-                         fat_pntr_data_bitsize (desc_type));
-   modify_general_field (value_contents_writeable (descriptor),
--                        VALUE_ADDRESS (bounds),
-+                        value_address (bounds),
-                         fat_pntr_bounds_bitpos (desc_type),
-                         fat_pntr_bounds_bitsize (desc_type));
-@@ -6790,7 +6792,7 @@ variant_field_index (struct type *type)
- static struct type *
- empty_record (struct objfile *objfile)
- {
--  struct type *type = alloc_type (objfile);
-+  struct type *type = alloc_type (objfile, NULL);
-   TYPE_CODE (type) = TYPE_CODE_STRUCT;
-   TYPE_NFIELDS (type) = 0;
-   TYPE_FIELDS (type) = NULL;
-@@ -6847,7 +6849,7 @@ ada_template_to_fixed_record_type_1 (struct type *type,
-         nfields++;
-     }
  
--  rtype = alloc_type (TYPE_OBJFILE (type));
-+  rtype = alloc_type (TYPE_OBJFILE (type), NULL);
-   TYPE_CODE (rtype) = TYPE_CODE_STRUCT;
-   INIT_CPLUS_SPECIFIC (rtype);
-   TYPE_NFIELDS (rtype) = nfields;
-@@ -7034,7 +7036,8 @@ template_to_static_fixed_type (struct type *type0)
-         new_type = static_unwrap_type (field_type);
-       if (type == type0 && new_type != field_type)
-         {
--          TYPE_TARGET_TYPE (type0) = type = alloc_type (TYPE_OBJFILE (type0));
-+          TYPE_TARGET_TYPE (type0) = type = alloc_type (TYPE_OBJFILE (type0),
-+                                                      NULL);
-           TYPE_CODE (type) = TYPE_CODE (type0);
-           INIT_CPLUS_SPECIFIC (type);
-           TYPE_NFIELDS (type) = nfields;
-@@ -7079,7 +7082,7 @@ to_record_with_fixed_variant_part (struct type *type, const gdb_byte *valaddr,
-   else
-     dval = dval0;
--  rtype = alloc_type (TYPE_OBJFILE (type));
-+  rtype = alloc_type (TYPE_OBJFILE (type), NULL);
-   TYPE_CODE (rtype) = TYPE_CODE_STRUCT;
-   INIT_CPLUS_SPECIFIC (rtype);
-   TYPE_NFIELDS (rtype) = nfields;
-@@ -7251,7 +7254,7 @@ to_fixed_array_type (struct type *type0, struct value *dval,
-       if (elt_type0 == elt_type)
-         result = type0;
-       else
--        result = create_array_type (alloc_type (TYPE_OBJFILE (type0)),
-+        result = create_array_type (alloc_type (TYPE_OBJFILE (type0), NULL),
-                                     elt_type, TYPE_INDEX_TYPE (type0));
+@@ -10839,6 +10835,40 @@ ada_operator_length (struct expression *exp, int pc, int *oplenp, int *argsp)
      }
-   else
-@@ -7281,7 +7284,7 @@ to_fixed_array_type (struct type *type0, struct value *dval,
-           struct type *range_type =
-             to_fixed_range_type (TYPE_FIELD_NAME (index_type_desc, i),
-                                  dval, TYPE_OBJFILE (type0));
--          result = create_array_type (alloc_type (TYPE_OBJFILE (type0)),
-+          result = create_array_type (alloc_type (TYPE_OBJFILE (type0), NULL),
-                                       result, range_type);
-         }
-       if (!ignore_too_big && TYPE_LENGTH (result) > varsize_limit)
-@@ -7523,7 +7526,7 @@ static struct value *
- ada_to_fixed_value (struct value *val)
- {
-   return ada_to_fixed_value_create (value_type (val),
--                                    VALUE_ADDRESS (val) + value_offset (val),
-+                                    value_address (val),
-                                     val);
  }
  
-@@ -7869,7 +7872,7 @@ unwrap_value (struct value *val)
-       return
-         coerce_unspec_val_to_type
-         (val, ada_to_fixed_type (raw_real_type, 0,
--                                 VALUE_ADDRESS (val) + value_offset (val),
-+                                 value_address (val),
-                                  NULL, 1));
-     }
++/* Implementation of the exp_descriptor method operator_check.  */
++
++static int
++ada_operator_check (struct expression *exp, int pos,
++                  int (*type_func) (struct type *type, void *data),
++                  int (*objfile_func) (struct objfile *objfile, void *data),
++                  void *data)
++{
++  const union exp_element *const elts = exp->elts;
++  struct type *type = NULL;
++
++  switch (elts[pos].opcode)
++    {
++      case UNOP_IN_RANGE:
++      case UNOP_QUAL:
++      type = elts[pos + 1].type;
++      break;
++
++      default:
++      return operator_check_standard (exp, pos, type_func, objfile_func,
++                                      data);
++    }
++
++  /* Invoke callbacks for TYPE and OBJFILE if they were set as non-NULL.  */
++
++  if (type && type_func && (*type_func) (type, data))
++    return 1;
++  if (type && TYPE_OBJFILE (type) && objfile_func
++      && (*objfile_func) (TYPE_OBJFILE (type), data))
++    return 1;
++
++  return 0;
++}
++
+ static char *
+ ada_op_name (enum exp_opcode opcode)
+ {
+@@ -11227,6 +11257,7 @@ parse (void)
+ static const struct exp_descriptor ada_exp_descriptor = {
+   ada_print_subexp,
+   ada_operator_length,
++  ada_operator_check,
+   ada_op_name,
+   ada_dump_subexp_body,
+   ada_evaluate_subexp
+diff --git a/gdb/amd64-linux-nat.c b/gdb/amd64-linux-nat.c
+index 7d8461c..a6d35d7 100644
+--- a/gdb/amd64-linux-nat.c
++++ b/gdb/amd64-linux-nat.c
+@@ -270,6 +270,8 @@ amd64_linux_dr_get (ptid_t ptid, int regnum)
+   return value;
  }
-@@ -9546,7 +9549,7 @@ to_fixed_range_type (char *name, struct value *dval, struct objfile *objfile)
-       if (L < INT_MIN || U > INT_MAX)
-       return raw_type;
-       else
--      return create_range_type (alloc_type (objfile), raw_type, 
-+      return create_range_type (alloc_type (objfile, NULL), raw_type, 
-                                 discrete_type_low_bound (raw_type),
-                                 discrete_type_high_bound (raw_type));
-     }
-@@ -9611,7 +9614,7 @@ to_fixed_range_type (char *name, struct value *dval, struct objfile *objfile)
-       if (objfile == NULL)
-         objfile = TYPE_OBJFILE (base_type);
--      type = create_range_type (alloc_type (objfile), base_type, L, U);
-+      type = create_range_type (alloc_type (objfile, NULL), base_type, L, U);
-       TYPE_NAME (type) = name;
-       return type;
-     }
-@@ -11009,9 +11012,9 @@ ada_language_arch_info (struct gdbarch *gdbarch,
- /* Not really used, but needed in the ada_language_defn.  */
  
++/* Set debug register REGNUM to VALUE in only the one LWP of PTID.  */
++
  static void
--emit_char (int c, struct ui_file *stream, int quoter)
-+emit_char (int c, struct type *type, struct ui_file *stream, int quoter)
+ amd64_linux_dr_set (ptid_t ptid, int regnum, unsigned long value)
  {
--  ada_emit_char (c, stream, quoter, 1);
-+  ada_emit_char (c, type, stream, quoter, 1);
+@@ -286,6 +288,8 @@ amd64_linux_dr_set (ptid_t ptid, int regnum, unsigned long value)
+     perror_with_name (_("Couldn't write debug register"));
  }
  
- static int
-diff --git a/gdb/ada-lang.h b/gdb/ada-lang.h
-index c7cc62a..fac027b 100644
---- a/gdb/ada-lang.h
-+++ b/gdb/ada-lang.h
-@@ -257,12 +257,12 @@ extern int ada_value_print (struct value *, struct ui_file *,
-                                 /* Defined in ada-lang.c */
--extern void ada_emit_char (int, struct ui_file *, int, int);
-+extern void ada_emit_char (int, struct type *, struct ui_file *, int, int);
--extern void ada_printchar (int, struct ui_file *);
-+extern void ada_printchar (int, struct type *, struct ui_file *);
--extern void ada_printstr (struct ui_file *, const gdb_byte *,
--                        unsigned int, int, int,
-+extern void ada_printstr (struct ui_file *, struct type *, const gdb_byte *,
-+                        unsigned int, int,
-                         const struct value_print_options *);
- struct value *ada_convert_actual (struct value *actual,
-diff --git a/gdb/ada-tasks.c b/gdb/ada-tasks.c
-index 61ed06e..8b1639e 100644
---- a/gdb/ada-tasks.c
-+++ b/gdb/ada-tasks.c
-@@ -293,7 +293,7 @@ read_fat_string_value (char *dest, struct value *val, int max_len)
-   /* Extract LEN characters from the fat string.  */
-   array_val = value_ind (value_field (val, array_fieldno));
--  read_memory (VALUE_ADDRESS (array_val), dest, len);
-+  read_memory (value_address (array_val), dest, len);
-   /* Add the NUL character to close the string.  */
-   dest[len] = '\0';
-diff --git a/gdb/ada-typeprint.c b/gdb/ada-typeprint.c
-index f00824a..ef665c4 100644
---- a/gdb/ada-typeprint.c
-+++ b/gdb/ada-typeprint.c
-@@ -357,16 +357,17 @@ print_array_type (struct type *type, struct ui_file *stream, int show,
-   bitsize = 0;
-   fprintf_filtered (stream, "array (");
-+  if (type == NULL)
-+    {
-+      fprintf_filtered (stream, _("<undecipherable array type>"));
-+      return;
-+    }
++/* Set DR_CONTROL to ADDR in all LWPs of LWP_LIST.  */
 +
-   n_indices = -1;
-   if (show < 0)
-     fprintf_filtered (stream, "...");
-   else
-     {
--      if (type == NULL)
--        {
--          fprintf_filtered (stream, _("<undecipherable array type>"));
--          return;
--        }
-       if (ada_is_simple_array_type (type))
-       {
-         struct type *range_desc_type =
-diff --git a/gdb/ada-valprint.c b/gdb/ada-valprint.c
-index 9647971..cfa94a2 100644
---- a/gdb/ada-valprint.c
-+++ b/gdb/ada-valprint.c
-@@ -269,7 +269,8 @@ printable_val_type (struct type *type, const gdb_byte *valaddr)
-    (1 or 2) of the character.  */
- void
--ada_emit_char (int c, struct ui_file *stream, int quoter, int type_len)
-+ada_emit_char (int c, struct type *type, struct ui_file *stream,
-+             int quoter, int type_len)
+ static void
+ amd64_linux_dr_set_control (unsigned long control)
  {
-   if (type_len != 2)
-     type_len = 1;
-@@ -366,10 +367,10 @@ ada_print_floating (const gdb_byte *valaddr, struct type *type,
+@@ -297,6 +301,8 @@ amd64_linux_dr_set_control (unsigned long control)
+     amd64_linux_dr_set (ptid, DR_CONTROL, control);
  }
  
- void
--ada_printchar (int c, struct ui_file *stream)
-+ada_printchar (int c, struct type *type, struct ui_file *stream)
++/* Set address REGNUM (zero based) to ADDR in all LWPs of LWP_LIST.  */
++
+ static void
+ amd64_linux_dr_set_addr (int regnum, CORE_ADDR addr)
  {
-   fputs_filtered ("'", stream);
--  ada_emit_char (c, stream, '\'', 1);
-+  ada_emit_char (c, type, stream, '\'', 1);
-   fputs_filtered ("'", stream);
+@@ -310,18 +316,55 @@ amd64_linux_dr_set_addr (int regnum, CORE_ADDR addr)
+     amd64_linux_dr_set (ptid, DR_FIRSTADDR + regnum, addr);
  }
  
-@@ -411,7 +412,7 @@ ada_print_scalar (struct type *type, LONGEST val, struct ui_file *stream)
-       break;
-     case TYPE_CODE_CHAR:
--      LA_PRINT_CHAR ((unsigned char) val, stream);
-+      LA_PRINT_CHAR ((unsigned char) val, type, stream);
-       break;
-     case TYPE_CODE_BOOL:
-@@ -454,7 +455,7 @@ ada_print_scalar (struct type *type, LONGEST val, struct ui_file *stream)
-  */
++/* Set address REGNUM (zero based) to zero in all LWPs of LWP_LIST.  */
++
  static void
--printstr (struct ui_file *stream, const gdb_byte *string,
-+printstr (struct ui_file *stream, struct type *elttype, const gdb_byte *string,
-         unsigned int length, int force_ellipses, int type_len,
-         const struct value_print_options *options)
+ amd64_linux_dr_reset_addr (int regnum)
  {
-@@ -506,7 +507,7 @@ printstr (struct ui_file *stream, const gdb_byte *string,
-             in_quotes = 0;
-           }
-         fputs_filtered ("'", stream);
--        ada_emit_char (char_at (string, i, type_len), stream, '\'',
-+        ada_emit_char (char_at (string, i, type_len), elttype, stream, '\'',
-                        type_len);
-         fputs_filtered ("'", stream);
-         fprintf_filtered (stream, _(" <repeats %u times>"), reps);
-@@ -524,7 +525,7 @@ printstr (struct ui_file *stream, const gdb_byte *string,
-               fputs_filtered ("\"", stream);
-             in_quotes = 1;
-           }
--        ada_emit_char (char_at (string, i, type_len), stream, '"',
-+        ada_emit_char (char_at (string, i, type_len), elttype, stream, '"',
-                        type_len);
-         things_printed += 1;
-       }
-@@ -544,11 +545,12 @@ printstr (struct ui_file *stream, const gdb_byte *string,
+   amd64_linux_dr_set_addr (regnum, 0);
  }
  
- void
--ada_printstr (struct ui_file *stream, const gdb_byte *string,
--            unsigned int length, int width, int force_ellipses,
-+ada_printstr (struct ui_file *stream, struct type *type, const gdb_byte *string,
-+            unsigned int length, int force_ellipses,
-             const struct value_print_options *options)
++/* Get DR_STATUS from only the one LWP of INFERIOR_PTID.  */
++
+ static unsigned long
+ amd64_linux_dr_get_status (void)
  {
--  printstr (stream, string, length, force_ellipses, width, options);
-+  printstr (stream, type, string, length, force_ellipses, TYPE_LENGTH (type),
-+          options);
+   return amd64_linux_dr_get (inferior_ptid, DR_STATUS);
  }
  
-@@ -637,7 +639,7 @@ ada_val_print_array (struct type *type, const gdb_byte *valaddr,
-           len = temp_len;
-         }
--      printstr (stream, valaddr, len, 0, eltlen, options);
-+      printstr (stream, elttype, valaddr, len, 0, eltlen, options);
-       result = len;
-     }
-   else
-@@ -688,7 +690,7 @@ ada_val_print_1 (struct type *type, const gdb_byte *valaddr0,
-       }
-       else
-       retn = ada_val_print_1 (value_type (val), value_contents (val), 0,
--                              VALUE_ADDRESS (val), stream, recurse, options);
-+                              value_address (val), stream, recurse, options);
-       value_free_to_mark (mark);
-       return retn;
-     }
-@@ -817,7 +819,7 @@ ada_val_print_1 (struct type *type, const gdb_byte *valaddr0,
-               {
-                 fputs_filtered (" ", stream);
-                 ada_printchar ((unsigned char) unpack_long (type, valaddr),
--                               stream);
-+                               type, stream);
-               }
-           }
-         return 0;
-@@ -904,7 +906,7 @@ ada_val_print_1 (struct type *type, const gdb_byte *valaddr0,
-                                 deref_val_int));
-               val_print (value_type (deref_val),
-                          value_contents (deref_val), 0,
--                         VALUE_ADDRESS (deref_val), stream, recurse + 1,
-+                         value_address (deref_val), stream, recurse + 1,
-                        options, current_language);
-             }
-           else
-@@ -944,7 +946,7 @@ ada_value_print (struct value *val0, struct ui_file *stream,
-                const struct value_print_options *options)
++/* Unset VALUE bits in DR_STATUS in all LWPs of LWP_LIST.  */
++
++static void
++amd64_linux_dr_unset_status (unsigned long mask)
++{
++  struct lwp_info *lp;
++  ptid_t ptid;
++
++  ALL_LWPS (lp, ptid)
++    {
++      unsigned long value;
++      
++      value = amd64_linux_dr_get (ptid, DR_STATUS);
++      value &= ~mask;
++      amd64_linux_dr_set (ptid, DR_STATUS, value);
++    }
++}
++
++/* See i386_dr_low_type.detach.  Do not use wrappers amd64_linux_dr_set_control
++   or amd64_linux_dr_reset_addr as they would modify the register cache
++   (amd64_linux_dr).  */
++
++static void
++amd64_linux_dr_detach (void)
++{
++  int regnum;
++
++  amd64_linux_dr_set (inferior_ptid, DR_CONTROL, 0);
++  amd64_linux_dr_unset_status (~0UL);
++  for (regnum = DR_FIRSTADDR; regnum <= DR_LASTADDR; regnum++)
++    amd64_linux_dr_set (inferior_ptid, regnum, 0);
++}
++
+ static void
+ amd64_linux_new_thread (ptid_t ptid)
  {
-   const gdb_byte *valaddr = value_contents (val0);
--  CORE_ADDR address = VALUE_ADDRESS (val0) + value_offset (val0);
-+  CORE_ADDR address = value_address (val0);
-   struct type *type =
-     ada_to_fixed_type (value_type (val0), valaddr, address, NULL, 1);
-   struct value *val =
-diff --git a/gdb/auxv.c b/gdb/auxv.c
-index 5007cd0..3a51ec5 100644
---- a/gdb/auxv.c
-+++ b/gdb/auxv.c
-@@ -205,6 +205,7 @@ fprint_target_auxv (struct ui_file *file, struct target_ops *ops)
-         TAG (AT_UCACHEBSIZE, _("Unified cache block size"), dec);
-         TAG (AT_IGNOREPPC, _("Entry should be ignored"), dec);
-         TAG (AT_BASE_PLATFORM, _("String identifying base platform"), str);
-+        TAG (AT_RANDOM, _("Address of 16 random bytes"), hex);
-         TAG (AT_EXECFN, _("File name of executable"), str);
-         TAG (AT_SECURE, _("Boolean, was exec setuid-like?"), dec);
-         TAG (AT_SYSINFO, _("Special system info/entry points"), hex);
-@@ -247,7 +248,8 @@ fprint_target_auxv (struct ui_file *file, struct target_ops *ops)
-           get_user_print_options (&opts);
-           if (opts.addressprint)
-             fprintf_filtered (file, "0x%s", paddr_nz (val));
--          val_print_string (val, -1, 1, file, &opts);
-+          val_print_string (builtin_type (target_gdbarch)->builtin_char,
-+                            val, -1, file, &opts);
-           fprintf_filtered (file, "\n");
-         }
-         break;
+@@ -672,6 +715,8 @@ _initialize_amd64_linux_nat (void)
+   i386_dr_low.set_addr = amd64_linux_dr_set_addr;
+   i386_dr_low.reset_addr = amd64_linux_dr_reset_addr;
+   i386_dr_low.get_status = amd64_linux_dr_get_status;
++  i386_dr_low.unset_status = amd64_linux_dr_unset_status;
++  i386_dr_low.detach = amd64_linux_dr_detach;
+   i386_set_debug_register_length (8);
+   /* Override the GNU/Linux inferior startup hook.  */
 diff --git a/gdb/block.c b/gdb/block.c
-index 8f0140c..d451769 100644
+index 97ea67a..b20beeb 100644
 --- a/gdb/block.c
 +++ b/gdb/block.c
-@@ -207,24 +207,16 @@ block_set_scope (struct block *block, const char *scope,
+@@ -227,8 +227,9 @@ block_set_scope (struct block *block, const char *scope,
+   BLOCK_NAMESPACE (block)->scope = scope;
  }
  
- /* This returns the first using directives associated to BLOCK, if
+-/* This returns the using directives list associated with BLOCK, if
 -   any.  */
--
--/* FIXME: carlton/2003-04-23: This uses the fact that we currently
--   only have using directives in static blocks, because we only
--   generate using directives from anonymous namespaces.  Eventually,
--   when we support using directives everywhere, we'll want to replace
--   this by some iterator functions.  */
++/* This returns the first using directives associated with BLOCK, if
 +   any.  Each BLOCK_NAMESPACE()->USING already contains all the namespaces
 +   imported at that code point - even those from its parent blocks.  */
  
  struct using_direct *
  block_using (const struct block *block)
- {
--  const struct block *static_block = block_static_block (block);
--
--  if (static_block == NULL
--      || BLOCK_NAMESPACE (static_block) == NULL)
-+  if (block == NULL || BLOCK_NAMESPACE (block) == NULL)
-     return NULL;
-   else
--    return BLOCK_NAMESPACE (static_block)->using;
-+    return BLOCK_NAMESPACE (block)->using;
- }
- /* Set BLOCK's using member to USING; if needed, allocate memory via
-diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c
-index b23b294..531c43d 100644
---- a/gdb/breakpoint.c
-+++ b/gdb/breakpoint.c
-@@ -191,6 +191,8 @@ static int is_hardware_watchpoint (struct breakpoint *bpt);
- static void insert_breakpoint_locations (void);
+@@ -318,6 +319,25 @@ allocate_block (struct obstack *obstack)
+   BLOCK_SUPERBLOCK (bl) = NULL;
+   BLOCK_DICT (bl) = NULL;
+   BLOCK_NAMESPACE (bl) = NULL;
++  BLOCK_FORTRAN_USE (bl) = NULL;
  
-+static int syscall_catchpoint_p (struct breakpoint *b);
-+
- static const char *
- bpdisp_text (enum bpdisp disp)
- {
-@@ -341,6 +343,18 @@ set_breakpoint_count (int num)
-                  value_from_longest (builtin_type_int32, (LONGEST) num));
+   return bl;
  }
-+/* Used in run_command to reset syscall catchpoints fields.  */
 +
-+void
-+clear_syscall_catchpoints_info (void)
++/* Return OBJFILE in which BLOCK is located or NULL if we cannot find it for
++   whatever reason.  */
++
++struct objfile *
++block_objfile (const struct block *block)
 +{
-+  struct breakpoint *b;
++  struct symbol *func;
 +
-+  ALL_BREAKPOINTS (b)
-+    if (syscall_catchpoint_p (b))
-+      b->syscall_number = UNKNOWN_SYSCALL;
-+}
++  if (block == NULL)
++    return NULL;
 +
- /* Used in run_command to zero the hit count when a new run starts. */
- void
-@@ -523,6 +537,53 @@ get_number_or_range (char **pp)
++  func = block_linkage_function (block);
++  if (func == NULL)
++    return NULL;
++
++  return SYMBOL_SYMTAB (func)->objfile;
++}
+diff --git a/gdb/block.h b/gdb/block.h
+index 53e7371..d373f8a 100644
+--- a/gdb/block.h
++++ b/gdb/block.h
+@@ -96,6 +96,15 @@ struct block
+     cplus_specific;
+   }
+   language_specific;
++
++  /* FIXME: It should be in the LANGUAGE_SPECIFIC region but the
++     BLOCK_NAMESPACE accessor is not protected by the C language check.  */
++
++  struct
++    {
++      struct fortran_using *use;
++    }
++  fortran_specific;
+ };
+ #define BLOCK_START(bl)               (bl)->startaddr
+@@ -104,6 +113,7 @@ struct block
+ #define BLOCK_SUPERBLOCK(bl)  (bl)->superblock
+ #define BLOCK_DICT(bl)                (bl)->dict
+ #define BLOCK_NAMESPACE(bl)   (bl)->language_specific.cplus_specific.namespace
++#define BLOCK_FORTRAN_USE(bl) (bl)->fortran_specific.use
+ /* Macro to loop through all symbols in a block BL, in no particular
+    order.  ITER helps keep track of the iteration, and should be a
+@@ -166,4 +176,6 @@ extern const struct block *block_global_block (const struct block *block);
+ extern struct block *allocate_block (struct obstack *obstack);
++extern struct objfile *block_objfile (const struct block *block);
++
+ #endif /* BLOCK_H */
+diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c
+index 811cdfb..b0bf314 100644
+--- a/gdb/breakpoint.c
++++ b/gdb/breakpoint.c
+@@ -61,6 +61,7 @@
+ #include "valprint.h"
+ #include "jit.h"
+ #include "xml-syscall.h"
++#include "parser-defs.h"
+ /* readline include files */
+ #include "readline/readline.h"
+@@ -112,8 +113,6 @@ struct breakpoint *set_raw_breakpoint (struct gdbarch *gdbarch,
+                                             struct symtab_and_line,
+                                             enum bptype);
+-static void check_duplicates (struct breakpoint *);
+-
+ static void breakpoint_adjustment_warning (CORE_ADDR, CORE_ADDR, int, int);
+ static CORE_ADDR adjust_breakpoint_address (struct gdbarch *gdbarch,
+@@ -337,14 +336,14 @@ static int executing_startup;
+            B ? (TMP=B->next, 1): 0;   \
+            B = TMP)
+-/* Similar iterators for the low-level breakpoints.  */
+-
+-#define ALL_BP_LOCATIONS(B)  for (B = bp_location_chain; B; B = B->global_next)
++/* Similar iterator for the low-level breakpoints.  SAFE variant is not
++   provided so update_global_location_list must not be called while executing
++   the block of ALL_BP_LOCATIONS.  */
+-#define ALL_BP_LOCATIONS_SAFE(B,TMP)  \
+-      for (B = bp_location_chain;     \
+-           B ? (TMP=B->global_next, 1): 0;    \
+-           B = TMP)
++#define ALL_BP_LOCATIONS(B,BP_TMP)                                    \
++      for (BP_TMP = bp_location;                                      \
++           BP_TMP < bp_location + bp_location_count && (B = *BP_TMP); \
++           BP_TMP++)
+ /* Iterator for tracepoints only.  */
+@@ -356,10 +355,31 @@ static int executing_startup;
+ struct breakpoint *breakpoint_chain;
+-struct bp_location *bp_location_chain;
++/* Array is sorted by bp_location_compare - primarily by the ADDRESS.  */
++
++static struct bp_location **bp_location;
++
++/* Number of elements of BP_LOCATION.  */
++
++static unsigned bp_location_count;
++
++/* Maximum alignment offset between bp_target_info.PLACED_ADDRESS and ADDRESS
++   for the current elements of BP_LOCATION which get a valid result from
++   bp_location_has_shadow.  You can use it for roughly limiting the subrange of
++   BP_LOCATION to scan for shadow bytes for an address you need to read.  */
++
++static CORE_ADDR bp_location_placed_address_before_address_max;
++
++/* Maximum offset plus alignment between
++   bp_target_info.PLACED_ADDRESS + bp_target_info.SHADOW_LEN and ADDRESS for
++   the current elements of BP_LOCATION which get a valid result from
++   bp_location_has_shadow.  You can use it for roughly limiting the subrange of
++   BP_LOCATION to scan for shadow bytes for an address you need to read.  */
++
++static CORE_ADDR bp_location_shadow_len_after_address_max;
+ /* The locations that no longer correspond to any breakpoint,
+-   unlinked from bp_location_chain, but for which a hit
++   unlinked from bp_location array, but for which a hit
+    may still be reported by a target.  */
+ VEC(bp_location_p) *moribund_locations = NULL;
  
+@@ -582,6 +602,53 @@ get_breakpoint (int num)
+ }
  
  \f
 +/* Set break condition of breakpoint B to EXP.  */
@@ -4629,7 +574,7 @@ index b23b294..531c43d 100644
 +
 +      /* I don't know if it matters whether this is the string the user
 +       typed in or the decompiled expression.  */
-+      b->cond_string = savestring (arg, strlen (arg));
++      b->cond_string = xstrdup (arg);
 +      b->condition_not_parsed = 0;
 +      for (loc = b->loc; loc; loc = loc->next)
 +      {
@@ -4648,7 +593,7 @@ index b23b294..531c43d 100644
  /* condition N EXP -- set break condition of breakpoint N to EXP.  */
  
  static void
-@@ -543,42 +604,7 @@ condition_command (char *arg, int from_tty)
+@@ -602,42 +669,7 @@ condition_command (char *arg, int from_tty)
    ALL_BREAKPOINTS (b)
      if (b->number == bnum)
        {
@@ -4675,7 +620,7 @@ index b23b294..531c43d 100644
 -          arg = p;
 -          /* I don't know if it matters whether this is the string the user
 -             typed in or the decompiled expression.  */
--          b->cond_string = savestring (arg, strlen (arg));
+-          b->cond_string = xstrdup (arg);
 -          b->condition_not_parsed = 0;
 -          for (loc = b->loc; loc; loc = loc->next)
 -            {
@@ -4692,872 +637,1298 @@ index b23b294..531c43d 100644
        return;
        }
  
-@@ -961,7 +987,7 @@ update_watchpoint (struct breakpoint *b, int reparse)
-                 int len, type;
-                 struct bp_location *loc, **tmp;
--                addr = VALUE_ADDRESS (v) + value_offset (v);
-+                addr = value_address (v);
-                 len = TYPE_LENGTH (value_type (v));
-                 type = hw_write;
-                 if (b->type == bp_read_watchpoint)
-@@ -3948,8 +3974,8 @@ check_duplicates_for (CORE_ADDR address, struct obj_section *section)
-     }
-   /* If we found a permanent breakpoint at this address, go over the
--     list again and declare all the other breakpoints there to be the
--     duplicates.  */
-+     list again and declare all the other breakpoints there (except
-+     other permanent breakpoints) to be the duplicates.  */
-   if (perm_bp)
-     {
-       perm_bp->duplicate = 0;
-@@ -3963,7 +3989,8 @@ check_duplicates_for (CORE_ADDR address, struct obj_section *section)
-       ALL_BP_LOCATIONS (b)
-       if (b != perm_bp)
-         {
--          if (b->owner->enable_state != bp_disabled
-+          if (b->owner->enable_state != bp_permanent
-+              && b->owner->enable_state != bp_disabled
-               && b->owner->enable_state != bp_call_disabled
-               && b->enabled && !b->shlib_disabled             
-               && b->address == address        /* address / overlay match */
-@@ -4134,6 +4161,8 @@ set_raw_breakpoint_without_location (enum bptype bptype)
-   b->frame_id = null_frame_id;
-   b->forked_inferior_pid = null_ptid;
-   b->exec_pathname = NULL;
-+  b->syscalls_to_be_caught = NULL;
-+  b->syscall_number = UNKNOWN_SYSCALL;
-   b->ops = NULL;
-   b->condition_not_parsed = 0;
-@@ -4660,7 +4689,241 @@ static struct breakpoint_ops catch_vfork_breakpoint_ops =
-   print_mention_catch_vfork
- };
--/* Create a new breakpoint of the bp_catchpoint kind and return it.
-+/* We keep a count of the number of times the user has requested a
-+   particular syscall to be tracked, and pass this information to the
-+   target.  This lets capable targets implement filtering directly.  */
-+
-+/* Number of times that "any" syscall is requested.  */
-+static int any_syscall_count;
-+
-+/* Count of each system call.  */
-+static int *syscalls_counts;
-+
-+/* Number of system entries in SYSCALLS_COUNTS.  */
-+static int syscalls_size;
-+
-+/* This counts all syscall catch requests, so we can readily determine
-+   if any catching is necessary.  */
-+static int total_syscalls_count;
-+
-+/* Implement the "insert" breakpoint_ops method for syscall
-+   catchpoints.  */
-+
-+static void
-+insert_catch_syscall (struct breakpoint *b)
-+{
-+  ++total_syscalls_count;
-+  if (!b->syscalls_to_be_caught)
-+    ++any_syscall_count;
-+  else
-+    {
-+      struct syscall_filter *iter;
-+      for (iter = b->syscalls_to_be_caught; iter; iter = iter->next)
-+      {
-+        if (iter->syscall >= syscalls_size)
-+          {
-+            syscalls_counts = xrealloc (syscalls_counts,
-+                                        (iter->syscall + 1) * sizeof (int));
-+            memset (&syscalls_counts[syscalls_size], 0,
-+                    (iter->syscall + 1 - syscalls_size) * sizeof (int));
-+          }
-+        ++syscalls_counts[iter->syscall];
-+      }
-+    }
-+
-+  target_set_syscall_catchpoint (PIDGET (inferior_ptid),
-+                               total_syscalls_count != 0,
-+                               any_syscall_count,
-+                               syscalls_size,
-+                               syscalls_counts);
-+}
-+
-+/* Implement the "remove" breakpoint_ops method for syscall
-+   catchpoints.  */
-+
-+static int
-+remove_catch_syscall (struct breakpoint *b)
-+{
-+  --total_syscalls_count;
-+  if (!b->syscalls_to_be_caught)
-+    --any_syscall_count;
-+  else
-+    {
-+      struct syscall_filter *iter;
-+      for (iter = b->syscalls_to_be_caught; iter; iter = iter->next)
-+      {
-+        if (iter->syscall >= syscalls_size)
-+          {
-+            /* Shouldn't happen.  */
-+            continue;
-+          }
-+        --syscalls_counts[iter->syscall];
-+      }
-+    }
-+
-+  return target_set_syscall_catchpoint (PIDGET (inferior_ptid),
-+                                      total_syscalls_count != 0,
-+                                      any_syscall_count,
-+                                      syscalls_size,
-+                                      syscalls_counts);
-+}
+@@ -735,35 +767,88 @@ commands_from_control_command (char *arg, struct command_line *cmd)
+       }
+   error (_("No breakpoint number %d."), bnum);
+ }
+-\f
 +
-+/* Implement the "breakpoint_hit" breakpoint_ops method for syscall
-+   catchpoints.  */
++/* Return non-zero if BL->TARGET_INFO contains valid information.  */
 +
 +static int
-+breakpoint_hit_catch_syscall (struct breakpoint *b)
++bp_location_has_shadow (struct bp_location *bl)
 +{
-+  /* We must check if we are catching specific syscalls in this breakpoint.
-+     If we are, then we must guarantee that the called syscall is the same
-+     syscall we are catching.  */
-+  int syscall_number = 0;
-+
-+  if (!inferior_has_called_syscall (inferior_ptid, &syscall_number))
++  if (bl->loc_type != bp_loc_software_breakpoint)
++    return 0;
++  if (!bl->inserted)
++    return 0;
++  if (bl->target_info.shadow_len == 0)
++    /* bp isn't valid, or doesn't shadow memory.  */
 +    return 0;
-+
-+  /* Now, checking if the syscall is the same.  */
-+  if (b->syscalls_to_be_caught)
-+    {
-+      struct syscall_filter *iter;
-+      for (iter = b->syscalls_to_be_caught; iter; iter = iter->next)
-+      if (syscall_number == iter->syscall)
-+        break;
-+      /* Not the same.  */
-+      if (!iter)
-+      return 0;
-+    }
-+
-+  /* It's the same syscall.  We can update the breakpoint struct
-+     with the correct information.  */
-+  b->syscall_number = syscall_number;
-+
 +  return 1;
 +}
 +
-+/* Implement the "print_it" breakpoint_ops method for syscall
-+   catchpoints.  */
-+
-+static enum print_stop_action
-+print_it_catch_syscall (struct breakpoint *b)
-+{
-+  /* These are needed because we want to know in which state a
-+     syscall is.  It can be in the TARGET_WAITKIND_SYSCALL_ENTRY
-+     or TARGET_WAITKIND_SYSCALL_RETURN, and depending on it we
-+     must print "called syscall" or "returned from syscall".  */
-+  ptid_t ptid;
-+  struct target_waitstatus last;
-+  struct syscall s;
-+  struct cleanup *old_chain;
-+  char *syscall_id;
-+
-+  gdbarch_get_syscall_by_number (current_gdbarch, b->syscall_number, &s);
-+
-+  get_last_target_status (&ptid, &last);
-+
-+  annotate_catchpoint (b->number);
-+
-+  if (s.name == NULL)
-+    syscall_id = xstrprintf ("%d", b->syscall_number);
-+  else
-+    syscall_id = xstrprintf ("'%s'", s.name);
-+
-+  old_chain = make_cleanup (xfree, syscall_id);
-+
-+  if (last.kind == TARGET_WAITKIND_SYSCALL_ENTRY)
-+    printf_filtered (_("\nCatchpoint %d (call to syscall %s), "),
-+                     b->number, syscall_id);
-+  else
-+    printf_filtered (_("\nCatchpoint %d (returned from syscall %s), "),
-+                     b->number, syscall_id);
-+
-+  do_cleanups (old_chain);
-+
-+  return PRINT_SRC_AND_LOC;
-+}
-+
-+/* Implement the "print_one" breakpoint_ops method for syscall
-+   catchpoints.  */
+ /* Update BUF, which is LEN bytes read from the target address MEMADDR,
+-   by replacing any memory breakpoints with their shadowed contents.  */
++   by replacing any memory breakpoints with their shadowed contents.
 +
-+static void
-+print_one_catch_syscall (struct breakpoint *b, CORE_ADDR *last_addr)
-+{
-+  struct value_print_options opts;
-+  struct syscall s;
++   The range of shadowed area by each bp_location is:
++     b->address - bp_location_placed_address_before_address_max
++     up to b->address + bp_location_shadow_len_after_address_max
++   The range we were requested to resolve shadows for is:
++     memaddr ... memaddr + le
++   Thus the safe cutoff boundaries for performance optimization are
++     memaddr + len <= b->address - bp_location_placed_address_before_address_max
++   and:
++     b->address + bp_location_shadow_len_after_address_max <= memaddr  */
+ void
+ breakpoint_restore_shadows (gdb_byte *buf, ULONGEST memaddr, LONGEST len)
+ {
+-  struct bp_location *b;
+-  CORE_ADDR bp_addr = 0;
+-  int bp_size = 0;
+-  int bptoffset = 0;
++  /* Left boundary, right boundary and media element of our binary search.  */
++  unsigned bc_l, bc_r, bc;
 +
-+  gdbarch_get_syscall_by_number (current_gdbarch, b->syscall_number, &s);
++  /* Find BC_L which is a leftmost element which may affect BUF content.  It is
++     safe to report lower value but a failure to report higher one.  */
 +
-+  get_user_print_options (&opts);
-+  /* Field 4, the address, is omitted (which makes the columns
-+     not line up too nicely with the headers, but the effect
-+     is relatively readable).  */
-+  if (opts.addressprint)
-+    ui_out_field_skip (uiout, "addr");
-+  annotate_field (5);
-+  ui_out_text (uiout, "syscall \"");
-+  if (b->syscall_number != UNKNOWN_SYSCALL)
++  bc_l = 0;
++  bc_r = bp_location_count;
++  while (bc_l + 1 < bc_r)
 +    {
-+      if (s.name)
-+        ui_out_field_string (uiout, "what", s.name);
-+      else
-+        ui_out_field_int (uiout, "what", b->syscall_number);
-+    }
-+  else
-+    ui_out_field_string (uiout, "what", "<any syscall>");
-+  ui_out_text (uiout, "\" ");
-+}
-+
-+/* Implement the "print_mention" breakpoint_ops method for syscall
-+   catchpoints.  */
++      struct bp_location *b;
+-  ALL_BP_LOCATIONS (b)
++      bc = (bc_l + bc_r) / 2;
++      b = bp_location[bc];
 +
-+static void
-+print_mention_catch_syscall (struct breakpoint *b)
-+{
-+  if (b->syscalls_to_be_caught)
-+    {
-+      struct syscall_filter *iter;
-+      printf_filtered (_("Catchpoint %d (syscall(s)"), b->number);
-+      for (iter = b->syscalls_to_be_caught; iter; iter = iter->next)
-+        {
-+          struct syscall s;
-+          gdbarch_get_syscall_by_number (current_gdbarch, iter->syscall, &s);
-+            
-+          if (s.name)
-+            printf_filtered (" '%s'", s.name);
-+          else
-+            printf_filtered (" %d", iter->syscall);
-+        }
-+      printf_filtered (")");
++      if (b->address + bp_location_shadow_len_after_address_max >= b->address
++        && b->address + bp_location_shadow_len_after_address_max <= memaddr)
++      bc_l = bc;
++      else
++      bc_r = bc;
 +    }
-+  else
-+    printf_filtered (_("Catchpoint %d (any syscall)"),
-+                     b->number);
-+}
-+
-+/* The breakpoint_ops structure to be used in syscall catchpoints.  */
 +
-+static struct breakpoint_ops catch_syscall_breakpoint_ops =
-+{
-+  insert_catch_syscall,
-+  remove_catch_syscall,
-+  breakpoint_hit_catch_syscall,
-+  print_it_catch_syscall,
-+  print_one_catch_syscall,
-+  print_mention_catch_syscall
-+};
++  /* Now do full processing of the found relevant range of elements.  */
 +
-+/* Returns non-zero if 'b' is a syscall catchpoint.  */
++  for (bc = bc_l; bc < bp_location_count; bc++)
+   {
++    struct bp_location *b = bp_location[bc];
++    CORE_ADDR bp_addr = 0;
++    int bp_size = 0;
++    int bptoffset = 0;
++
+     if (b->owner->type == bp_none)
+       warning (_("reading through apparently deleted breakpoint #%d?"),
+               b->owner->number);
+-    if (b->loc_type != bp_loc_software_breakpoint)
+-      continue;
+-    if (!b->inserted)
++    /* Performance optimization: any futher element can no longer affect BUF
++       content.  */
++
++    if (b->address >= bp_location_placed_address_before_address_max
++        && memaddr + len <= b->address
++                          - bp_location_placed_address_before_address_max)
++      break;
 +
-+static int
-+syscall_catchpoint_p (struct breakpoint *b)
-+{
-+  return (b->ops == &catch_syscall_breakpoint_ops);
-+}
-+
-+/* Create a new breakpoint of the bp_catchpoint kind and return it,
-+   but does NOT mention it nor update the global location list.
-+   This is useful if you need to fill more fields in the
-+   struct breakpoint before calling mention.
-  
-    If TEMPFLAG is non-zero, then make the breakpoint temporary.
-    If COND_STRING is not NULL, then store it in the breakpoint.
-@@ -4668,16 +4931,13 @@ static struct breakpoint_ops catch_vfork_breakpoint_ops =
-    to the catchpoint.  */
- static struct breakpoint *
--create_catchpoint (int tempflag, char *cond_string,
--                   struct breakpoint_ops *ops)
-+create_catchpoint_without_mention (int tempflag, char *cond_string,
-+                                   struct breakpoint_ops *ops)
++    if (!bp_location_has_shadow (b))
+       continue;
++
+     /* Addresses and length of the part of the breakpoint that
+        we need to copy.  */
+     bp_addr = b->target_info.placed_address;
+     bp_size = b->target_info.shadow_len;
+-    if (bp_size == 0)
+-      /* bp isn't valid, or doesn't shadow memory.  */
+-      continue;
+     if (bp_addr + bp_size <= memaddr)
+       /* The breakpoint is entirely before the chunk of memory we
+@@ -912,7 +997,7 @@ update_watchpoint (struct breakpoint *b, int reparse)
+   struct bp_location *loc;
+   bpstat bs;
+-  /* We don't free locations.  They are stored in bp_location_chain and
++  /* We don't free locations.  They are stored in bp_location array and
+      update_global_locations will eventually delete them and remove
+      breakpoints if needed.  */
+   b->loc = NULL;
+@@ -1347,7 +1432,7 @@ static void
+ insert_breakpoint_locations (void)
  {
-   struct symtab_and_line sal;
-   struct breakpoint *b;
+   struct breakpoint *bpt;
+-  struct bp_location *b, *temp;
++  struct bp_location *b, **bp_tmp;
+   int error = 0;
+   int val = 0;
+   int disabled_breaks = 0;
+@@ -1360,7 +1445,7 @@ insert_breakpoint_locations (void)
+      there was an error.  */
+   fprintf_unfiltered (tmp_error_stream, "Warning:\n");
+       
+-  ALL_BP_LOCATIONS_SAFE (b, temp)
++  ALL_BP_LOCATIONS (b, bp_tmp)
+     {
+       if (!should_be_inserted (b) || b->inserted)
+       continue;
+@@ -1434,10 +1519,10 @@ You may have requested too many hardware breakpoints/watchpoints.\n");
+ int
+ remove_breakpoints (void)
+ {
+-  struct bp_location *b;
++  struct bp_location *b, **bp_tmp;
+   int val = 0;
  
-   init_sal (&sal);
--  sal.pc = 0;
--  sal.symtab = NULL;
--  sal.line = 0;
+-  ALL_BP_LOCATIONS (b)
++  ALL_BP_LOCATIONS (b, bp_tmp)
+   {
+     if (b->inserted)
+       val |= remove_breakpoint (b, mark_uninserted);
+@@ -1448,10 +1533,10 @@ remove_breakpoints (void)
+ int
+ remove_hw_watchpoints (void)
+ {
+-  struct bp_location *b;
++  struct bp_location *b, **bp_tmp;
+   int val = 0;
  
-   b = set_raw_breakpoint (sal, bp_catchpoint);
-   set_breakpoint_count (breakpoint_count + 1);
-@@ -4691,6 +4951,23 @@ create_catchpoint (int tempflag, char *cond_string,
-   b->disposition = tempflag ? disp_del : disp_donttouch;
-   b->ops = ops;
+-  ALL_BP_LOCATIONS (b)
++  ALL_BP_LOCATIONS (b, bp_tmp)
+   {
+     if (b->inserted && b->loc_type == bp_loc_hardware_watchpoint)
+       val |= remove_breakpoint (b, mark_uninserted);
+@@ -1462,7 +1547,7 @@ remove_hw_watchpoints (void)
+ int
+ reattach_breakpoints (int pid)
+ {
+-  struct bp_location *b;
++  struct bp_location *b, **bp_tmp;
+   int val;
+   struct cleanup *old_chain = save_inferior_ptid ();
+   struct ui_file *tmp_error_stream = mem_fileopen ();
+@@ -1471,7 +1556,7 @@ reattach_breakpoints (int pid)
+   make_cleanup_ui_file_delete (tmp_error_stream);
+   inferior_ptid = pid_to_ptid (pid);
+-  ALL_BP_LOCATIONS (b)
++  ALL_BP_LOCATIONS (b, bp_tmp)
+   {
+     if (b->inserted)
+       {
+@@ -1569,12 +1654,42 @@ create_longjmp_master_breakpoint (char *func_name)
+   update_global_location_list (1);
+ }
  
-+  return b;
-+}
-+
-+/* Create a new breakpoint of the bp_catchpoint kind and return it.
-+ 
-+   If TEMPFLAG is non-zero, then make the breakpoint temporary.
-+   If COND_STRING is not NULL, then store it in the breakpoint.
-+   OPS, if not NULL, is the breakpoint_ops structure associated
-+   to the catchpoint.  */
++/* Install a master breakpoint on the unwinder's debug hook.  */
 +
-+static struct breakpoint *
-+create_catchpoint (int tempflag, char *cond_string,
-+                   struct breakpoint_ops *ops)
++void
++create_exception_master_breakpoint (void)
 +{
-+  struct breakpoint *b =
-+    create_catchpoint_without_mention (tempflag, cond_string, ops);
++  struct objfile *objfile;
 +
-   mention (b);
-   update_global_location_list (1);
-@@ -4775,6 +5052,23 @@ static struct breakpoint_ops catch_exec_breakpoint_ops =
-   print_mention_catch_exec
- };
-+static void
-+create_syscall_event_catchpoint (int tempflag, struct syscall_filter *filter,
-+                                 struct breakpoint_ops *ops)
-+{
-+  struct breakpoint *b =
-+    create_catchpoint_without_mention (tempflag, NULL, ops);
++  ALL_OBJFILES (objfile)
++    {
++      struct minimal_symbol *debug_hook;
 +
-+  b->syscalls_to_be_caught = filter;
-+  /* We still don't know the syscall that will be caught :-).  */
-+  b->syscall_number = UNKNOWN_SYSCALL;
++      debug_hook = lookup_minimal_symbol_text ("_Unwind_DebugHook", objfile);
++      if (debug_hook != NULL)
++      {
++        CORE_ADDR pc;
++        struct breakpoint *b;
++
++        pc = find_function_start_pc (get_objfile_arch (objfile),
++                                     SYMBOL_VALUE_ADDRESS (debug_hook),
++                                     SYMBOL_OBJ_SECTION (debug_hook));
++        b = create_internal_breakpoint (get_objfile_arch (objfile),
++                                        pc, bp_exception_master);
++        b->addr_string = xstrdup ("_Unwind_DebugHook");
++        b->enable_state = bp_disabled;
++      }
++    }
 +
-+  /* Now, we have to mention the breakpoint and update the global
-+     location list.  */
-+  mention (b);
 +  update_global_location_list (1);
 +}
 +
- static int
hw_breakpoint_used_count (void)
+ void
update_breakpoints_after_exec (void)
  {
-@@ -5188,7 +5482,6 @@ expand_line_sal_maybe (struct symtab_and_line sal)
-   struct symtabs_and_lines expanded;
-   CORE_ADDR original_pc = sal.pc;
-   char *original_function = NULL;
--  int found;
-   int i;
+   struct breakpoint *b;
+   struct breakpoint *temp;
+-  struct bp_location *bploc;
++  struct bp_location *bploc, **bplocp_tmp;
+   /* We're about to delete breakpoints from GDB's lists.  If the
+      INSERTED flag is true, GDB will try to lift the breakpoints by
+@@ -1584,7 +1699,7 @@ update_breakpoints_after_exec (void)
+      breakpoints out as soon as it detects an exec.  We don't do that
+      here instead, because there may be other attempts to delete
+      breakpoints after detecting an exec and before reaching here.  */
+-  ALL_BP_LOCATIONS (bploc)
++  ALL_BP_LOCATIONS (bploc, bplocp_tmp)
+     gdb_assert (!bploc->inserted);
+   ALL_BREAKPOINTS_SAFE (b, temp)
+@@ -1606,7 +1721,7 @@ update_breakpoints_after_exec (void)
+     /* Thread event breakpoints must be set anew after an exec(),
+        as must overlay event and longjmp master breakpoints.  */
+     if (b->type == bp_thread_event || b->type == bp_overlay_event
+-      || b->type == bp_longjmp_master)
++      || b->type == bp_longjmp_master || b->type == bp_exception_master)
+       {
+       delete_breakpoint (b);
+       continue;
+@@ -1621,7 +1736,8 @@ update_breakpoints_after_exec (void)
  
-   /* If we have explicit pc, don't expand.
-@@ -5264,14 +5557,42 @@ expand_line_sal_maybe (struct symtab_and_line sal)
+     /* Longjmp and longjmp-resume breakpoints are also meaningless
+        after an exec.  */
+-    if (b->type == bp_longjmp || b->type == bp_longjmp_resume)
++    if (b->type == bp_longjmp || b->type == bp_longjmp_resume
++      || b->type == bp_exception || b->type == bp_exception_resume)
+       {
+       delete_breakpoint (b);
+       continue;
+@@ -1682,12 +1798,13 @@ update_breakpoints_after_exec (void)
+   create_longjmp_master_breakpoint ("_longjmp");
+   create_longjmp_master_breakpoint ("siglongjmp");
+   create_longjmp_master_breakpoint ("_siglongjmp");
++  create_exception_master_breakpoint ();
+ }
  
-   if (original_pc)
-     {
--      found = 0;
-+      /* Find all the other PCs for a line of code with multiple instances
-+       (locations).  If the instruction is in the middle of an instruction
-+       block for source line GDB cannot safely find the same instruction in
-+       the other compiled instances of the same source line because the other
-+       instances may have been compiled completely differently.
-+
-+       The testcase gdb.cp/expand-sals.exp shows that breaking at the return
-+       address in a caller of the current frame works for the current
-+       instance but the breakpoint cannot catch the point (instruction) where
-+       the callee returns in the other compiled instances of this source line.
-+
-+       The current implementation will place the breakpoint at the expected
-+       returning address of the current instance of the caller.  But the
-+       other instances will get the breakpoint at the first instruction of
-+       the source line - therefore before the call would be made.  Another
-+       possibility would be to place the breakpoint in the other instances at
-+       the start of the next source line.
-+
-+       A possible heuristics would compare the instructions length of each of
-+       the instances of the current source line and if it matches it would
-+       place the breakpoint at the same offset.  Unfortunately a mistaken
-+       guess would possibly crash the inferior.  */
-+
-+      CORE_ADDR best = -1;
-+
-+      /* Find the nearest preceding PC and set it to ORIGINAL_PC.  */
-       for (i = 0; i < expanded.nelts; ++i)
--      if (expanded.sals[i].pc == original_pc)
--        {
--          found = 1;
--          break;
--        }
--      gdb_assert (found);
-+      if (expanded.sals[i].pc <= original_pc
-+          && (best == -1 || expanded.sals[best].pc < expanded.sals[i].pc))
-+        best = i;
-+
-+      if (best == -1)
-+      error (_("Cannot find the best address for %s out of the %d locations"),
-+             paddr (original_pc), expanded.nelts);
-+
-+      expanded.sals[best].pc = original_pc;
-     }
+ int
+ detach_breakpoints (int pid)
+ {
+-  struct bp_location *b;
++  struct bp_location *b, **bp_tmp;
+   int val = 0;
+   struct cleanup *old_chain = save_inferior_ptid ();
+@@ -1696,11 +1813,12 @@ detach_breakpoints (int pid)
  
-   return expanded;
-@@ -5310,8 +5631,6 @@ create_breakpoints (struct symtabs_and_lines sals, char **addr_string,
-                        cond_string, type, disposition,
-                        thread, ignore_count, ops, from_tty, enabled);
+   /* Set inferior_ptid; remove_breakpoint uses this global.  */
+   inferior_ptid = pid_to_ptid (pid);
+-  ALL_BP_LOCATIONS (b)
++  ALL_BP_LOCATIONS (b, bp_tmp)
+   {
+     if (b->inserted)
+       val |= remove_breakpoint (b, mark_inserted);
+   }
++  val |= target_detach_watchpoints ();
+   do_cleanups (old_chain);
+   return val;
+ }
+@@ -1793,12 +1911,14 @@ remove_breakpoint (struct bp_location *b, insertion_state_t is)
+       return val;
+       b->inserted = (is == mark_inserted);
      }
--
--  update_global_location_list (1);
+-  else if (b->loc_type == bp_loc_hardware_watchpoint)
++  /* bp_loc_hardware_watchpoint with mark_inserted is being handled by
++     target_detach_watchpoints.  */
++  else if (b->loc_type == bp_loc_hardware_watchpoint && is == mark_uninserted)
+     {
+       struct value *v;
+       struct value *n;
+-      b->inserted = (is == mark_inserted);
++      b->inserted = 0;
+       val = target_remove_watchpoint (b->address, b->length, 
+                                     b->watchpoint_type);
+@@ -1827,9 +1947,9 @@ remove_breakpoint (struct bp_location *b, insertion_state_t is)
+ void
+ mark_breakpoints_out (void)
+ {
+-  struct bp_location *bpt;
++  struct bp_location *bpt, **bptp_tmp;
+-  ALL_BP_LOCATIONS (bpt)
++  ALL_BP_LOCATIONS (bpt, bptp_tmp)
+     bpt->inserted = 0;
  }
  
- /* Parse ARG which is assumed to be a SAL specification possibly
-@@ -5637,7 +5956,6 @@ break_command_really (char *arg, char *cond_string, int thread,
-       b->ops = ops;
-       b->enable_state = enabled ? bp_enabled : bp_disabled;
+@@ -1849,7 +1969,7 @@ void
+ breakpoint_init_inferior (enum inf_context context)
+ {
+   struct breakpoint *b, *temp;
+-  struct bp_location *bpt;
++  struct bp_location *bpt, **bptp_tmp;
+   int ix;
  
--      update_global_location_list (1);
-       mention (b);
-     }
+   /* If breakpoint locations are shared across processes, then there's
+@@ -1857,7 +1977,7 @@ breakpoint_init_inferior (enum inf_context context)
+   if (gdbarch_has_global_breakpoints (target_gdbarch))
+     return;
+-  ALL_BP_LOCATIONS (bpt)
++  ALL_BP_LOCATIONS (bpt, bptp_tmp)
+     if (bpt->owner->enable_state != bp_permanent)
+       bpt->inserted = 0;
+@@ -1918,10 +2038,10 @@ breakpoint_init_inferior (enum inf_context context)
+ enum breakpoint_here
+ breakpoint_here_p (CORE_ADDR pc)
+ {
+-  const struct bp_location *bpt;
++  struct bp_location *bpt, **bptp_tmp;
+   int any_breakpoint_here = 0;
+-  ALL_BP_LOCATIONS (bpt)
++  ALL_BP_LOCATIONS (bpt, bptp_tmp)
+     {
+       if (bpt->loc_type != bp_loc_software_breakpoint
+         && bpt->loc_type != bp_loc_hardware_breakpoint)
+@@ -1961,16 +2081,16 @@ moribund_breakpoint_here_p (CORE_ADDR pc)
+ }
+ /* Returns non-zero if there's a breakpoint inserted at PC, which is
+-   inserted using regular breakpoint_chain/bp_location_chain mechanism.
++   inserted using regular breakpoint_chain / bp_location array mechanism.
+    This does not check for single-step breakpoints, which are
+    inserted and removed using direct target manipulation.  */
+ int
+ regular_breakpoint_inserted_here_p (CORE_ADDR pc)
+ {
+-  const struct bp_location *bpt;
++  struct bp_location *bpt, **bptp_tmp;
+-  ALL_BP_LOCATIONS (bpt)
++  ALL_BP_LOCATIONS (bpt, bptp_tmp)
+     {
+       if (bpt->loc_type != bp_loc_software_breakpoint
+         && bpt->loc_type != bp_loc_hardware_breakpoint)
+@@ -2011,10 +2131,10 @@ breakpoint_inserted_here_p (CORE_ADDR pc)
+ int
+ software_breakpoint_inserted_here_p (CORE_ADDR pc)
+ {
+-  const struct bp_location *bpt;
++  struct bp_location *bpt, **bptp_tmp;
+   int any_breakpoint_here = 0;
+-  ALL_BP_LOCATIONS (bpt)
++  ALL_BP_LOCATIONS (bpt, bptp_tmp)
+     {
+       if (bpt->loc_type != bp_loc_software_breakpoint)
+       continue;
+@@ -2044,12 +2164,12 @@ software_breakpoint_inserted_here_p (CORE_ADDR pc)
+ int
+ breakpoint_thread_match (CORE_ADDR pc, ptid_t ptid)
+ {
+-  const struct bp_location *bpt;
++  struct bp_location *bpt, **bptp_tmp;
+   /* The thread and task IDs associated to PTID, computed lazily.  */
+   int thread = -1;
+   int task = 0;
    
-@@ -5649,6 +5967,11 @@ break_command_really (char *arg, char *cond_string, int thread,
-   discard_cleanups (breakpoint_chain);
-   /* But cleanup everything else. */
-   do_cleanups (old_chain);
+-  ALL_BP_LOCATIONS (bpt)
++  ALL_BP_LOCATIONS (bpt, bptp_tmp)
+     {
+       if (bpt->loc_type != bp_loc_software_breakpoint
+         && bpt->loc_type != bp_loc_hardware_breakpoint)
+@@ -2503,6 +2623,12 @@ print_it_typical (bpstat bs)
+       result = PRINT_NOTHING;
+       break;
++    case bp_exception_master:
++      /* These should never be enabled.  */
++      printf_filtered (_("Exception Master Breakpoint: gdb should not stop!\n"));
++      result = PRINT_NOTHING;
++      break;
 +
-+  /* Have already BREAKPOINT_CHAIN discarded as we may get an exception while
-+     inserting the breakpoints which would double-free the resources both by
-+     BREAKPOINT_CHAIN now and during DELETE_BREAKPOINT in the future.  */
-+  update_global_location_list (1);
+     case bp_watchpoint:
+     case bp_hardware_watchpoint:
+       annotate_watchpoint (b->number);
+@@ -2590,6 +2716,8 @@ print_it_typical (bpstat bs)
+     case bp_none:
+     case bp_longjmp:
+     case bp_longjmp_resume:
++    case bp_exception:
++    case bp_exception_resume:
+     case bp_step_resume:
+     case bp_watchpoint_scope:
+     case bp_call_dummy:
+@@ -2973,8 +3101,12 @@ bpstat_check_location (const struct bp_location *bl, CORE_ADDR bp_addr)
+ /* If BS refers to a watchpoint, determine if the watched values
+    has actually changed, and we should stop.  If not, set BS->stop
+-   to 0.  */
+-static void
++   to 0.
++   Return 0 for watchpoints which could not be the cause of this trap.
++   In such case PRINT_IT will be print_it_noop and STOP will be 0.
++   Otherwise return 1 but in such case it is not guaranteed whether this
++   breakpoint did or did not trigger this trap.  */
++static int
+ bpstat_check_watchpoint (bpstat bs)
+ {
+   const struct bp_location *bl = bs->breakpoint_at;
+@@ -3063,8 +3195,10 @@ bpstat_check_watchpoint (bpstat bs)
+            anything for this watchpoint.  */
+         bs->print_it = print_it_noop;
+         bs->stop = 0;
++        return 0;
+       }
+     }
++  return 1;
  }
  
- /* Set a breakpoint. 
-@@ -6131,7 +6454,7 @@ can_use_hardware_watchpoint (struct value *v)
-                 || (TYPE_CODE (vtype) != TYPE_CODE_STRUCT
-                     && TYPE_CODE (vtype) != TYPE_CODE_ARRAY))
-               {
--                CORE_ADDR vaddr = VALUE_ADDRESS (v) + value_offset (v);
-+                CORE_ADDR vaddr = value_address (v);
-                 int       len   = TYPE_LENGTH (value_type (v));
  
-                 if (!TARGET_REGION_OK_FOR_HW_WATCHPOINT (vaddr, len))
-@@ -6668,6 +6991,122 @@ catch_ada_exception_command (char *arg, int from_tty,
-                                    from_tty);
- }
+@@ -3157,17 +3291,19 @@ bpstat
+ bpstat_stop_status (CORE_ADDR bp_addr, ptid_t ptid)
+ {
+   struct breakpoint *b = NULL;
+-  const struct bp_location *bl;
++  struct bp_location *bl, **blp_tmp;
+   struct bp_location *loc;
+   /* Root of the chain of bpstat's */
+   struct bpstats root_bs[1];
+   /* Pointer to the last thing in the chain currently.  */
+   bpstat bs = root_bs;
+   int ix;
+-  int need_remove_insert;
++  int need_remove_insert, update_locations = 0;
  
-+/* Cleanup function for a syscall filter list.  */
-+static void
-+clean_up_filters (void *arg)
-+{
-+  struct syscall_filter *iter = *(struct syscall_filter **) arg;
-+  while (iter)
-+    {
-+      struct syscall_filter *next = iter->next;
-+      xfree (iter);
-+      iter = next;
-+    }
-+}
-+
-+/* Splits the argument using space as delimiter.  Returns an xmalloc'd
-+   filter list, or NULL if no filtering is required.  */
-+static struct syscall_filter *
-+catch_syscall_split_args (char *arg)
-+{
-+  struct syscall_filter *result = NULL;
-+  struct cleanup *cleanup = make_cleanup (clean_up_filters, &result);
+-  ALL_BP_LOCATIONS (bl)
++  ALL_BP_LOCATIONS (bl, blp_tmp)
+   {
++    bpstat bs_prev = bs;
++
+     b = bl->owner;
+     gdb_assert (b);
+     if (!breakpoint_enabled (b) && b->enable_state != bp_permanent)
+@@ -3188,6 +3324,7 @@ bpstat_stop_status (CORE_ADDR bp_addr, ptid_t ptid)
+     /* Come here if it's a watchpoint, or if the break address matches */
+     bs = bpstat_alloc (bl, bs);       /* Alloc a bpstat to explain stop */
++    gdb_assert (bs_prev->next == bs);
+     /* Assume we stop.  Should we find watchpoint that is not actually
+        triggered, or if condition of breakpoint is false, we'll reset
+@@ -3195,12 +3332,21 @@ bpstat_stop_status (CORE_ADDR bp_addr, ptid_t ptid)
+     bs->stop = 1;
+     bs->print = 1;
+-    bpstat_check_watchpoint (bs);
+-    if (!bs->stop)
+-      continue;
++    if (!bpstat_check_watchpoint (bs))
++      {
++      /* Ensure bpstat_explains_signal stays false if this BL could not be
++         the cause of this trap.  */
++
++      gdb_assert (bs->print_it == print_it_noop);
++      gdb_assert (!bs->stop);
++      xfree (bs);
++      bs = bs_prev;
++      bs->next = NULL;
++      continue;
++      }
+     if (b->type == bp_thread_event || b->type == bp_overlay_event
+-      || b->type == bp_longjmp_master)
++      || b->type == bp_longjmp_master || b->type == bp_exception_master)
+       /* We do not stop for these.  */
+       bs->stop = 0;
+     else
+@@ -3208,14 +3354,15 @@ bpstat_stop_status (CORE_ADDR bp_addr, ptid_t ptid)
+   
+     if (bs->stop)
+       {
+-      ++(b->hit_count);
++      if (b->enable_state != bp_disabled)
++        ++(b->hit_count);
+       /* We will stop here */
+       if (b->disposition == disp_disable)
+         {
+           if (b->enable_state != bp_permanent)
+             b->enable_state = bp_disabled;
+-          update_global_location_list (0);
++          update_locations = 1;
+         }
+       if (b->silent)
+         bs->print = 0;
+@@ -3235,6 +3382,10 @@ bpstat_stop_status (CORE_ADDR bp_addr, ptid_t ptid)
+       bs->print_it = print_it_noop;
+   }
++  /* Delay this call which would break the ALL_BP_LOCATIONS iteration above.  */
++  if (update_locations)
++    update_global_location_list (0);
 +
-+  while (*arg != '\0')
-+    {
-+      int i, syscall_number;
-+      char *endptr;
-+      char cur_name[128];
-+      struct syscall_filter *new_filter;
-+      struct syscall s;
-+
-+      /* Skip whitespace.  */
-+      while (isspace (*arg))
-+        arg++;
-+
-+      for (i = 0; arg[i] && !isspace (arg[i]); ++i)
-+      cur_name[i] = arg[i];
-+      cur_name[i] = '\0';
-+      arg += i;
-+
-+      /* Check if the user provided a syscall name or a number.  */
-+      syscall_number = (int) strtol (cur_name, &endptr, 10);
-+      if (*endptr == '\0')
-+        {
-+          gdbarch_get_syscall_by_number (current_gdbarch,
-+                                         syscall_number, &s);
-+
-+          if (s.name == NULL)
-+            /* We can issue just a warning, but still create the catchpoint.
-+               This is because, even not knowing the syscall name that
-+               this number represents, we can still try to catch the syscall
-+               number.  */
-+            warning (_("The number '%d' does not represent a known syscall."),
-+                     syscall_number);
-+        }
-+      else
-+        {
-+          /* We have a name.  Let's check if it's valid and convert it
-+             to a number.  */
-+          gdbarch_get_syscall_by_name (current_gdbarch, cur_name, &s);
-+
-+          if (s.number == UNKNOWN_SYSCALL)
-+            /* Here we have to issue an error instead of a warning, because
-+               GDB cannot do anything useful if there's no syscall number to
-+               be caught.  */
-+            error (_("Unknown syscall name '%s'."), cur_name);
-+        }
-+
-+      /* Ok, it's valid.  */
-+      new_filter = XNEW (struct syscall_filter);
-+      new_filter->syscall = s.number;
-+      new_filter->next = result;
-+      result = new_filter;
-+    }
+   for (ix = 0; VEC_iterate (bp_location_p, moribund_locations, ix, loc); ++ix)
+     {
+       if (loc->address == bp_addr)
+@@ -3412,6 +3563,7 @@ bpstat_what (bpstat bs)
+   struct bpstat_what retval;
+   retval.call_dummy = 0;
++  retval.is_longjmp = 0;
+   for (; bs != NULL; bs = bs->next)
+     {
+       enum class bs_class = no_effect;
+@@ -3458,10 +3610,15 @@ bpstat_what (bpstat bs)
+           bs_class = no_effect;
+         break;
+       case bp_longjmp:
++      case bp_exception:
+         bs_class = long_jump;
++        retval.is_longjmp = bs->breakpoint_at->owner->type == bp_longjmp;
+         break;
+       case bp_longjmp_resume:
++      case bp_exception_resume:
+         bs_class = long_resume;
++        retval.is_longjmp
++          = bs->breakpoint_at->owner->type == bp_longjmp_resume;
+         break;
+       case bp_step_resume:
+         if (bs->stop)
+@@ -3484,6 +3641,7 @@ bpstat_what (bpstat bs)
+       case bp_thread_event:
+       case bp_overlay_event:
+       case bp_longjmp_master:
++      case bp_exception_master:
+         bs_class = bp_nostop;
+         break;
+       case bp_catchpoint:
+@@ -3605,6 +3763,8 @@ print_one_breakpoint_location (struct breakpoint *b,
+     {bp_access_watchpoint, "acc watchpoint"},
+     {bp_longjmp, "longjmp"},
+     {bp_longjmp_resume, "longjmp resume"},
++    {bp_exception, "exception"},
++    {bp_exception_resume, "exception resume"},
+     {bp_step_resume, "step resume"},
+     {bp_watchpoint_scope, "watchpoint scope"},
+     {bp_call_dummy, "call dummy"},
+@@ -3612,6 +3772,7 @@ print_one_breakpoint_location (struct breakpoint *b,
+     {bp_thread_event, "thread events"},
+     {bp_overlay_event, "overlay events"},
+     {bp_longjmp_master, "longjmp master"},
++    {bp_exception_master, "exception master"},
+     {bp_catchpoint, "catchpoint"},
+     {bp_tracepoint, "tracepoint"},
+     {bp_jit_event, "jit events"},
+@@ -3735,6 +3896,8 @@ print_one_breakpoint_location (struct breakpoint *b,
+       case bp_finish:
+       case bp_longjmp:
+       case bp_longjmp_resume:
++      case bp_exception:
++      case bp_exception_resume:
+       case bp_step_resume:
+       case bp_watchpoint_scope:
+       case bp_call_dummy:
+@@ -3742,6 +3905,7 @@ print_one_breakpoint_location (struct breakpoint *b,
+       case bp_thread_event:
+       case bp_overlay_event:
+       case bp_longjmp_master:
++      case bp_exception_master:
+       case bp_tracepoint:
+       case bp_jit_event:
+       if (opts.addressprint)
+@@ -4197,9 +4361,8 @@ set_default_breakpoint (int valid, CORE_ADDR addr, struct symtab *symtab,
+    (or use it for any other purpose either).
+    More specifically, each of the following breakpoint types will always
+-   have a zero valued address and we don't want check_duplicates() to mark
+-   breakpoints of any of these types to be a duplicate of an actual
+-   breakpoint at address zero:
++   have a zero valued address and we don't want to mark breakpoints of any of
++   these types to be a duplicate of an actual breakpoint at address zero:
+       bp_watchpoint
+       bp_hardware_watchpoint
+@@ -4219,88 +4382,6 @@ breakpoint_address_is_meaningful (struct breakpoint *bpt)
+         && type != bp_catchpoint);
+ }
+-/* Rescan breakpoints at the same address and section as BPT,
+-   marking the first one as "first" and any others as "duplicates".
+-   This is so that the bpt instruction is only inserted once.
+-   If we have a permanent breakpoint at the same place as BPT, make
+-   that one the official one, and the rest as duplicates.  */
+-
+-static void
+-check_duplicates_for (CORE_ADDR address, struct obj_section *section)
+-{
+-  struct bp_location *b;
+-  int count = 0;
+-  struct bp_location *perm_bp = 0;
+-
+-  ALL_BP_LOCATIONS (b)
+-    if (b->owner->enable_state != bp_disabled
+-      && b->owner->enable_state != bp_call_disabled
+-      && b->owner->enable_state != bp_startup_disabled
+-      && b->enabled
+-      && !b->shlib_disabled
+-      && b->address == address        /* address / overlay match */
+-      && (!overlay_debugging || b->section == section)
+-      && breakpoint_address_is_meaningful (b->owner))
+-    {
+-      /* Have we found a permanent breakpoint?  */
+-      if (b->owner->enable_state == bp_permanent)
+-      {
+-        perm_bp = b;
+-        break;
+-      }
+-      
+-      count++;
+-      b->duplicate = count > 1;
+-    }
+-
+-  /* If we found a permanent breakpoint at this address, go over the
+-     list again and declare all the other breakpoints there (except
+-     other permanent breakpoints) to be the duplicates.  */
+-  if (perm_bp)
+-    {
+-      perm_bp->duplicate = 0;
+-
+-      /* Permanent breakpoint should always be inserted.  */
+-      if (! perm_bp->inserted)
+-      internal_error (__FILE__, __LINE__,
+-                      _("allegedly permanent breakpoint is not "
+-                      "actually inserted"));
+-
+-      ALL_BP_LOCATIONS (b)
+-      if (b != perm_bp)
+-        {
+-          if (b->owner->enable_state != bp_permanent
+-              && b->owner->enable_state != bp_disabled
+-              && b->owner->enable_state != bp_call_disabled
+-              && b->owner->enable_state != bp_startup_disabled
+-              && b->enabled && !b->shlib_disabled             
+-              && b->address == address        /* address / overlay match */
+-              && (!overlay_debugging || b->section == section)
+-              && breakpoint_address_is_meaningful (b->owner))
+-            {
+-              if (b->inserted)
+-                internal_error (__FILE__, __LINE__,
+-                                _("another breakpoint was inserted on top of "
+-                                "a permanent breakpoint"));
+-
+-              b->duplicate = 1;
+-            }
+-        }
+-    }
+-}
+-
+-static void
+-check_duplicates (struct breakpoint *bpt)
+-{
+-  struct bp_location *bl = bpt->loc;
+-
+-  if (! breakpoint_address_is_meaningful (bpt))
+-    return;
+-
+-  for (; bl; bl = bl->next)
+-    check_duplicates_for (bl->address, bl->section);    
+-}
+-
+ static void
+ breakpoint_adjustment_warning (CORE_ADDR from_addr, CORE_ADDR to_addr,
+                                int bnum, int have_bnum)
+@@ -4382,6 +4463,8 @@ allocate_bp_location (struct breakpoint *bpt)
+     case bp_finish:
+     case bp_longjmp:
+     case bp_longjmp_resume:
++    case bp_exception:
++    case bp_exception_resume:
+     case bp_step_resume:
+     case bp_watchpoint_scope:
+     case bp_call_dummy:
+@@ -4390,6 +4473,7 @@ allocate_bp_location (struct breakpoint *bpt)
+     case bp_overlay_event:
+     case bp_jit_event:
+     case bp_longjmp_master:
++    case bp_exception_master:
+       loc->loc_type = bp_loc_software_breakpoint;
+       break;
+     case bp_hardware_breakpoint:
+@@ -4568,8 +4652,7 @@ make_breakpoint_permanent (struct breakpoint *b)
+ }
+ /* Call this routine when stepping and nexting to enable a breakpoint
+-   if we do a longjmp() in THREAD.  When we hit that breakpoint, call
+-   set_longjmp_resume_breakpoint() to figure out where we are going. */
++   if we do a longjmp() or 'throw' in THREAD.  */
+ void
+ set_longjmp_breakpoint (int thread)
+@@ -4581,10 +4664,10 @@ set_longjmp_breakpoint (int thread)
+      longjmp "master" breakpoints.  Here, we simply create momentary
+      clones of those and enable them for the requested thread.  */
+   ALL_BREAKPOINTS_SAFE (b, temp)
+-    if (b->type == bp_longjmp_master)
++    if (b->type == bp_longjmp_master || b->type == bp_exception_master)
+       {
+       struct breakpoint *clone = clone_momentary_breakpoint (b);
+-      clone->type = bp_longjmp;
++      clone->type = b->type == bp_longjmp_master ? bp_longjmp : bp_exception;
+       clone->thread = thread;
+       }
+ }
+@@ -4596,7 +4679,7 @@ delete_longjmp_breakpoint (int thread)
+   struct breakpoint *b, *temp;
+   ALL_BREAKPOINTS_SAFE (b, temp)
+-    if (b->type == bp_longjmp)
++    if (b->type == bp_longjmp || b->type == bp_exception)
+       {
+       if (b->thread == thread)
+         delete_breakpoint (b);
+@@ -4710,9 +4793,9 @@ create_solib_event_breakpoint (struct gdbarch *gdbarch, CORE_ADDR address)
+ void
+ disable_breakpoints_in_shlibs (void)
+ {
+-  struct bp_location *loc;
++  struct bp_location *loc, **locp_tmp;
+-  ALL_BP_LOCATIONS (loc)
++  ALL_BP_LOCATIONS (loc, locp_tmp)
+   {
+     struct breakpoint *b = loc->owner;
+     /* We apply the check to all breakpoints, including disabled
+@@ -4742,7 +4825,7 @@ disable_breakpoints_in_shlibs (void)
+ static void
+ disable_breakpoints_in_unloaded_shlib (struct so_list *solib)
+ {
+-  struct bp_location *loc;
++  struct bp_location *loc, **locp_tmp;
+   int disabled_shlib_breaks = 0;
+   /* SunOS a.out shared libraries are always mapped, so do not
+@@ -4753,7 +4836,7 @@ disable_breakpoints_in_unloaded_shlib (struct so_list *solib)
+       && bfd_get_flavour (exec_bfd) == bfd_target_aout_flavour)
+     return;
+-  ALL_BP_LOCATIONS (loc)
++  ALL_BP_LOCATIONS (loc, locp_tmp)
+   {
+     struct breakpoint *b = loc->owner;
+     if ((loc->loc_type == bp_loc_hardware_breakpoint
+@@ -5648,6 +5731,8 @@ mention (struct breakpoint *b)
+       case bp_finish:
+       case bp_longjmp:
+       case bp_longjmp_resume:
++      case bp_exception:
++      case bp_exception_resume:
+       case bp_step_resume:
+       case bp_call_dummy:
+       case bp_watchpoint_scope:
+@@ -5656,6 +5741,7 @@ mention (struct breakpoint *b)
+       case bp_overlay_event:
+       case bp_jit_event:
+       case bp_longjmp_master:
++      case bp_exception_master:
+       break;
+       }
+@@ -6958,6 +7044,7 @@ struct until_break_command_continuation_args
+ {
+   struct breakpoint *breakpoint;
+   struct breakpoint *breakpoint2;
++  int thread_num;
+ };
+ /* This function is called by fetch_inferior_event via the
+@@ -6972,6 +7059,7 @@ until_break_command_continuation (void *arg)
+   delete_breakpoint (a->breakpoint);
+   if (a->breakpoint2)
+     delete_breakpoint (a->breakpoint2);
++  delete_longjmp_breakpoint (a->thread_num);
+ }
+ void
+@@ -6983,6 +7071,8 @@ until_break_command (char *arg, int from_tty, int anywhere)
+   struct breakpoint *breakpoint;
+   struct breakpoint *breakpoint2 = NULL;
+   struct cleanup *old_chain;
++  int thread;
++  struct thread_info *tp;
+   clear_proceed_status ();
+@@ -7021,6 +7111,9 @@ until_break_command (char *arg, int from_tty, int anywhere)
+   old_chain = make_cleanup_delete_breakpoint (breakpoint);
++  tp = inferior_thread ();
++  thread = tp->num;
 +
-+  discard_cleanups (cleanup);
-+  return result;
-+}
+   /* Keep within the current frame, or in frames called by the current
+      one.  */
+@@ -7033,6 +7126,10 @@ until_break_command (char *arg, int from_tty, int anywhere)
+                                             frame_unwind_caller_id (frame),
+                                             bp_until);
+       make_cleanup_delete_breakpoint (breakpoint2);
 +
-+/* Implement the "catch syscall" command.  */
++      set_longjmp_breakpoint (thread);
++      tp->initiating_frame = frame_unwind_caller_id (frame);
++      make_cleanup (delete_longjmp_breakpoint_cleanup, &thread);
+     }
+   proceed (-1, TARGET_SIGNAL_DEFAULT, 0);
+@@ -7049,6 +7146,7 @@ until_break_command (char *arg, int from_tty, int anywhere)
+       args->breakpoint = breakpoint;
+       args->breakpoint2 = breakpoint2;
++      args->thread_num = thread;
+       discard_cleanups (old_chain);
+       add_continuation (inferior_thread (),
+@@ -7758,6 +7856,82 @@ do_vec_free (void *p)
+     VEC_free (bp_location_p, *vec);
+ }
++/* A comparison function for bp_location A and B being interfaced to qsort.
++   Sort elements primarily by their ADDRESS (no matter what does
++   breakpoint_address_is_meaningful say for its OWNER), secondarily by ordering
++   first bp_permanent OWNERed elements and terciarily just ensuring the array
++   is sorted stable way despite qsort being an instable algorithm.  */
 +
-+static void
-+catch_syscall_command_1 (char *arg, int from_tty, struct cmd_list_element *command)
++static int
++bp_location_compare (struct bp_location *a, struct bp_location *b)
 +{
-+  int tempflag;
-+  struct syscall_filter *filter;
-+  struct syscall s;
-+
-+  /* Checking if the feature if supported.  */
-+  if (gdbarch_get_syscall_number_p (current_gdbarch) == 0)
-+    error (_("The feature 'catch syscall' is not supported on \
-+this architeture yet."));
++  int a_perm = a->owner->enable_state == bp_permanent;
++  int b_perm = b->owner->enable_state == bp_permanent;
 +
-+  tempflag = get_cmd_context (command) == CATCH_TEMPORARY;
++  if (a->address != b->address)
++    return (a->address > b->address) - (a->address < b->address);
 +
-+  ep_skip_leading_whitespace (&arg);
++  /* Sort permanent breakpoints first.  */
++  if (a_perm != b_perm)
++    return (a_perm < b_perm) - (a_perm > b_perm);
 +
-+  /* We need to do this first "dummy" translation in order
-+     to get the syscall XML file loaded or, most important,
-+     to display a warning to the user if there's no XML file
-+     for his/her architecture.  */
-+  gdbarch_get_syscall_by_number (current_gdbarch, 0, &s);
++  /* Make the user-visible order stable across GDB runs.  Locations of the same
++     breakpoint can be sorted in arbitrary order.  */
 +
-+  /* The allowed syntax is:
-+     catch syscall
-+     catch syscall <name | number> [<name | number> ... <name | number>]
++  if (a->owner->number != b->owner->number)
++    return (a->owner->number > b->owner->number)
++           - (a->owner->number < b->owner->number);
 +
-+     Let's check if there's a syscall name.  */
-+
-+  if (arg != NULL)
-+    filter = catch_syscall_split_args (arg);
-+  else
-+    filter = NULL;
-+
-+  create_syscall_event_catchpoint (tempflag, filter,
-+                                 &catch_syscall_breakpoint_ops);
++  return (a > b) - (a < b);
 +}
 +
- /* Implement the "catch assert" command.  */
- static void
-@@ -7134,6 +7573,7 @@ delete_breakpoint (struct breakpoint *bpt)
-     xfree (bpt->source_file);
-   if (bpt->exec_pathname != NULL)
-     xfree (bpt->exec_pathname);
-+  clean_up_filters (&bpt->syscalls_to_be_caught);
-   /* Be sure no bpstat's are pointing at it after it's been freed.  */
-   /* FIXME, how can we find all bpstat's?
-@@ -8041,6 +8481,56 @@ single_step_breakpoint_inserted_here_p (CORE_ADDR pc)
-   return 0;
- }
-+/* Returns 0 if 'bp' is NOT a syscall catchpoint,
-+   non-zero otherwise.  */
++/* Interface bp_location_compare as the COMPAR parameter of qsort function.  */
++
 +static int
-+is_syscall_catchpoint_enabled (struct breakpoint *bp)
++bp_location_compare_for_qsort (const void *ap, const void *bp)
 +{
-+  if (syscall_catchpoint_p (bp)
-+      && bp->enable_state != bp_disabled
-+      && bp->enable_state != bp_call_disabled)
-+    return 1;
-+  else
-+    return 0;
-+}
++  struct bp_location *a = *(void **) ap;
++  struct bp_location *b = *(void **) bp;
 +
-+int
-+catch_syscall_enabled (void)
-+{
-+  return total_syscalls_count != 0;
++  return bp_location_compare (a, b);
 +}
 +
-+int
-+catching_syscall_number (int syscall_number)
++/* Set bp_location_placed_address_before_address_max and
++   bp_location_shadow_len_after_address_max according to the current content of
++   the bp_location array.  */
++
++static void
++bp_location_target_extensions_update (void)
 +{
-+  struct breakpoint *bp;
++  struct bp_location *bl, **blp_tmp;
 +
-+  ALL_BREAKPOINTS (bp)
-+    if (is_syscall_catchpoint_enabled (bp))
-+      {
-+      if (bp->syscalls_to_be_caught)
-+        {
-+          struct syscall_filter *iter;
-+          for (iter = bp->syscalls_to_be_caught; iter; iter = iter->next)
-+            if (syscall_number == iter->syscall)
-+              return 1;
-+        }
-+      else
-+        return 1;
-+      }
++  bp_location_placed_address_before_address_max = 0;
++  bp_location_shadow_len_after_address_max = 0;
 +
-+  return 0;
-+}
++  ALL_BP_LOCATIONS (bl, blp_tmp)
++    {
++      CORE_ADDR start, end, addr;
 +
-+/* Complete syscall names.  Used by "catch syscall".  */
-+static char **
-+catch_syscall_completer (struct cmd_list_element *self, char *text, char *word)
-+{
-+  const char **list =
-+    gdbarch_get_syscall_names (current_gdbarch);
-+  return (list == NULL) ? NULL : complete_on_enum (list, text, word);
-+}
++      if (!bp_location_has_shadow (bl))
++      continue;
 +
\f
- /* This help string is used for the break, hbreak, tbreak and thbreak commands.
-    It is defined as a macro to prevent duplication.
-@@ -8073,6 +8563,8 @@ static void
- add_catch_command (char *name, char *docstring,
-                  void (*sfunc) (char *args, int from_tty,
-                                 struct cmd_list_element *command),
-+                 char **(*completion_function) (struct cmd_list_element *self,
-+                                                char *text, char *word),
-                  void *user_data_catch,
-                  void *user_data_tcatch)
- {
-@@ -8082,11 +8574,13 @@ add_catch_command (char *name, char *docstring,
-                    &catch_cmdlist);
-   set_cmd_sfunc (command, sfunc);
-   set_cmd_context (command, user_data_catch);
-+  set_cmd_completer (command, completion_function);
-   command = add_cmd (name, class_breakpoint, NULL, docstring,
-                    &tcatch_cmdlist);
-   set_cmd_sfunc (command, sfunc);
-   set_cmd_context (command, user_data_tcatch);
-+  set_cmd_completer (command, completion_function);
- }
- void
-@@ -8361,36 +8855,50 @@ Set temporary catchpoints to catch events."),
- Catch an exception, when caught.\n\
- With an argument, catch only exceptions with the given name."),
-                    catch_catch_command,
-+                     NULL,
-                    CATCH_PERMANENT,
-                    CATCH_TEMPORARY);
-   add_catch_command ("throw", _("\
- Catch an exception, when thrown.\n\
- With an argument, catch only exceptions with the given name."),
-                    catch_throw_command,
-+                     NULL,
-                    CATCH_PERMANENT,
-                    CATCH_TEMPORARY);
-   add_catch_command ("fork", _("Catch calls to fork."),
-                    catch_fork_command_1,
-+                     NULL,
-                    (void *) (uintptr_t) catch_fork_permanent,
-                    (void *) (uintptr_t) catch_fork_temporary);
-   add_catch_command ("vfork", _("Catch calls to vfork."),
-                    catch_fork_command_1,
-+                     NULL,
-                    (void *) (uintptr_t) catch_vfork_permanent,
-                    (void *) (uintptr_t) catch_vfork_temporary);
-   add_catch_command ("exec", _("Catch calls to exec."),
-                    catch_exec_command_1,
-+                     NULL,
-                    CATCH_PERMANENT,
-                    CATCH_TEMPORARY);
-+  add_catch_command ("syscall", _("\
-+Catch system calls.\n\
-+With an argument, catch only that syscall."),
-+                         catch_syscall_command_1,
-+                         catch_syscall_completer,
-+                         CATCH_PERMANENT,
-+                         CATCH_TEMPORARY);
-   add_catch_command ("exception", _("\
- Catch Ada exceptions, when raised.\n\
- With an argument, catch only exceptions with the given name."),
-                    catch_ada_exception_command,
-+                     NULL,
-                    CATCH_PERMANENT,
-                    CATCH_TEMPORARY);
-   add_catch_command ("assert", _("\
- Catch failed Ada assertions, when raised.\n\
- With an argument, catch only exceptions with the given name."),
-                    catch_assert_command,
-+                     NULL,
-                    CATCH_PERMANENT,
-                    CATCH_TEMPORARY);
-diff --git a/gdb/breakpoint.h b/gdb/breakpoint.h
-index 94287de..8552e1b 100644
---- a/gdb/breakpoint.h
-+++ b/gdb/breakpoint.h
-@@ -33,7 +33,8 @@ struct block;
- #define       BREAKPOINT_MAX  16
\f
--/* Type of breakpoint. */
++      start = bl->target_info.placed_address;
++      end = start + bl->target_info.shadow_len;
 +
-+/* Type of breakpoint.  */
- /* FIXME In the future, we should fold all other breakpoint-like things into
-    here.  This includes:
-@@ -337,6 +338,17 @@ enum watchpoint_triggered
-   watch_triggered_yes  
- };
-+/* A syscall filter is represented as a linked list of syscall
-+   numbers.  */
-+struct syscall_filter
-+{
-+  /* The system call to accept.  */
-+  int syscall;
++      gdb_assert (bl->address >= start);
++      addr = bl->address - start;
++      if (addr > bp_location_placed_address_before_address_max)
++      bp_location_placed_address_before_address_max = addr;
 +
-+  /* The next filter.  */
-+  struct syscall_filter *next;
-+};
++      /* Zero SHADOW_LEN would not pass bp_location_has_shadow.  */
 +
- typedef struct bp_location *bp_location_p;
- DEF_VEC_P(bp_location_p);
-@@ -442,6 +454,20 @@ struct breakpoint
-        triggered.  */
-     char *exec_pathname;
-+    /* Syscall number used for the 'catch syscall' feature.
-+       If no syscall has been called, its value is UNKNOWN_SYSCALL.
-+       Otherwise, it holds the system call number in the target.
++      gdb_assert (bl->address < end);
++      addr = end - bl->address;
++      if (addr > bp_location_shadow_len_after_address_max)
++      bp_location_shadow_len_after_address_max = addr;
++    }
++}
++
+ /* If SHOULD_INSERT is false, do not insert any breakpoint locations
+    into the inferior, only remove already-inserted locations that no
+    longer should be inserted.  Functions that delete a breakpoint or
+@@ -7777,49 +7951,66 @@ static void
+ update_global_location_list (int should_insert)
+ {
+   struct breakpoint *b;
+-  struct bp_location **next = &bp_location_chain;
+-  struct bp_location *loc;
+-  struct bp_location *loc2;
+-  VEC(bp_location_p) *old_locations = NULL;
+-  int ret;
+-  int ix;
++  struct bp_location **locp, *loc;
+   struct cleanup *cleanups;
+-  cleanups = make_cleanup (do_vec_free, &old_locations);
+-  /* Store old locations for future reference.  */
+-  for (loc = bp_location_chain; loc; loc = loc->global_next)
+-    VEC_safe_push (bp_location_p, old_locations, loc);
++  /* The first bp_location being the only one non-DUPLICATE for the current run
++     of the same ADDRESS.  */
++  struct bp_location *loc_first;
++
++  /* Saved former bp_location array which we compare against the newly built
++     bp_location from the current state of ALL_BREAKPOINTS.  */
++  struct bp_location **old_location, **old_locp;
++  unsigned old_location_count;
++
++  old_location = bp_location;
++  old_location_count = bp_location_count;
++  bp_location = NULL;
++  bp_location_count = 0;
++  cleanups = make_cleanup (xfree, old_location);
+-  bp_location_chain = NULL;
+   ALL_BREAKPOINTS (b)
+-    {
+-      for (loc = b->loc; loc; loc = loc->next)
+-      {
+-        *next = loc;
+-        next = &(loc->global_next);
+-        *next = NULL;
+-      }
+-    }
++    for (loc = b->loc; loc; loc = loc->next)
++      bp_location_count++;
 +
-+       This field is only valid immediately after this catchpoint has
-+       triggered.  */
-+    int syscall_number;
++  bp_location = xmalloc (sizeof (*bp_location) * bp_location_count);
++  locp = bp_location;
++  ALL_BREAKPOINTS (b)
++    for (loc = b->loc; loc; loc = loc->next)
++      *locp++ = loc;
++  qsort (bp_location, bp_location_count, sizeof (*bp_location),
++       bp_location_compare_for_qsort);
++
++  bp_location_target_extensions_update ();
+   /* Identify bp_location instances that are no longer present in the new
+      list, and therefore should be freed.  Note that it's not necessary that
+      those locations should be removed from inferior -- if there's another
+      location at the same address (previously marked as duplicate),
+-     we don't need to remove/insert the location.  */
+-  for (ix = 0; VEC_iterate(bp_location_p, old_locations, ix, loc); ++ix)
++     we don't need to remove/insert the location.
++     
++     LOCP is kept in sync with OLD_LOCP, each pointing to the current and
++     former bp_location array state respectively.  */
 +
-+    /* Syscall numbers used for the 'catch syscall' feature.
-+       If no syscall has been specified for filtering, its value is NULL.
-+       Otherwise, it holds a list of all syscalls to be caught.
-+       The list elements are allocated with xmalloc.  */
-+    struct syscall_filter *syscalls_to_be_caught;
++  locp = bp_location;
++  for (old_locp = old_location; old_locp < old_location + old_location_count;
++       old_locp++)
+     {
+-      /* Tells if 'loc' is found amoung the new locations.  If not, we
++      struct bp_location *old_loc = *old_locp;
++
++      /* Tells if 'old_loc' is found amoung the new locations.  If not, we
+        have to free it.  */
+-      int found_object = 0;
++      int found_object;
+       /* Tells if the location should remain inserted in the target.  */
+       int keep_in_target = 0;
+       int removed = 0;
+-      for (loc2 = bp_location_chain; loc2; loc2 = loc2->global_next)
+-      if (loc2 == loc)
+-        {
+-          found_object = 1;
+-          break;
+-        }
 +
-     /* Methods associated with this breakpoint.  */
-     struct breakpoint_ops *ops;
-@@ -783,6 +809,8 @@ extern void enable_watchpoints_after_interactive_call_stop (void);
- extern enum command_control_type commands_from_control_command
-   (char *arg, struct command_line *cmd);
++      /* 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
++           && bp_location_compare (*locp, old_loc) < 0)
++      locp++;
++      found_object = locp < bp_location + bp_location_count && *locp == old_loc;
+       /* If this location is no longer present, and inserted, look if there's
+        maybe a new location at the same address.  If so, mark that one 
+@@ -7827,11 +8018,11 @@ update_global_location_list (int should_insert)
+        don't have a time window where a breakpoint at certain location is not
+        inserted.  */
+-      if (loc->inserted)
++      if (old_loc->inserted)
+       {
+         /* If the location is inserted now, we might have to remove it.  */
  
-+extern void clear_syscall_catchpoints_info (void);
+-        if (found_object && should_be_inserted (loc))
++        if (found_object && should_be_inserted (old_loc))
+           {
+             /* The location is still present in the location list, and still
+                should be inserted.  Don't do anything.  */
+@@ -7842,37 +8033,46 @@ update_global_location_list (int should_insert)
+             /* The location is either no longer present, or got disabled.
+                See if there's another location at the same address, in which 
+                case we don't need to remove this one from the target.  */
+-            if (breakpoint_address_is_meaningful (loc->owner))
+-              for (loc2 = bp_location_chain; loc2; loc2 = loc2->global_next)
+-                {
+-                  /* For the sake of should_insert_location.  The
+-                     call to check_duplicates will fix up this later.  */
+-                  loc2->duplicate = 0;
+-                  if (should_be_inserted (loc2)
+-                      && loc2 != loc && loc2->address == loc->address)
+-                    {           
+-                      loc2->inserted = 1;
+-                      loc2->target_info = loc->target_info;
+-                      keep_in_target = 1;
+-                      break;
+-                    }
+-                }
++
++            if (breakpoint_address_is_meaningful (old_loc->owner))
++              {
++                struct bp_location **loc2p;
 +
- extern void clear_breakpoint_hit_counts (void);
++                for (loc2p = locp;
++                     loc2p < bp_location + bp_location_count
++                     && (*loc2p)->address == old_loc->address;
++                     loc2p++)
++                  {
++                    struct bp_location *loc2 = *loc2p;
++
++                    /* For the sake of should_be_inserted.
++                       Duplicates check below will fix up this later.  */
++                    loc2->duplicate = 0;
++                    if (loc2 != old_loc && should_be_inserted (loc2))
++                      {                 
++                        loc2->inserted = 1;
++                        loc2->target_info = old_loc->target_info;
++                        keep_in_target = 1;
++                        break;
++                      }
++                  }
++              }
+           }
  
- extern int get_number (char **);
-@@ -857,7 +885,19 @@ extern int breakpoints_always_inserted_mode (void);
-    in our opinion won't ever trigger.  */
- extern void breakpoint_retire_moribund (void);
+         if (!keep_in_target)
+           {
+-            if (remove_breakpoint (loc, mark_uninserted))
++            if (remove_breakpoint (old_loc, mark_uninserted))
+               {
+                 /* This is just about all we can do.  We could keep this
+                    location on the global list, and try to remove it next
+                    time, but there's no particular reason why we will
+                    succeed next time.  
+                    
+-                   Note that at this point, loc->owner is still valid,
++                   Note that at this point, old_loc->owner is still valid,
+                    as delete_breakpoint frees the breakpoint only
+                    after calling us.  */
+                 printf_filtered (_("warning: Error removing breakpoint %d\n"), 
+-                                 loc->owner->number);
++                                 old_loc->owner->number);
+               }
+             removed = 1;
+           }
+@@ -7894,19 +8094,59 @@ update_global_location_list (int should_insert)
+                longer need to keep this breakpoint.  This is just a
+                heuristic, but if it's wrong, we'll report unexpected SIGTRAP,
+                which is usability issue, but not a correctness problem.  */
+-            loc->events_till_retirement = 3 * (thread_count () + 1);
+-            loc->owner = NULL;
++            old_loc->events_till_retirement = 3 * (thread_count () + 1);
++            old_loc->owner = NULL;
+-            VEC_safe_push (bp_location_p, moribund_locations, loc);
++            VEC_safe_push (bp_location_p, moribund_locations, old_loc);
+           }
+         else
+-          free_bp_location (loc);
++          free_bp_location (old_loc);
+       }
+     }
  
-+/* Checks if we are catching syscalls or not.
-+   Returns 0 if not, greater than 0 if we are.  */
-+extern int catch_syscall_enabled (void);
+-  ALL_BREAKPOINTS (b)
++  /* Rescan breakpoints at the same address and section,
++     marking the first one as "first" and any others as "duplicates".
++     This is so that the bpt instruction is only inserted once.
++     If we have a permanent breakpoint at the same place as BPT, make
++     that one the official one, and the rest as duplicates.  Permanent
++     breakpoints are sorted first for the same address.  */
 +
-+/* Checks if we are catching syscalls with the specific
-+   syscall_number.  Used for "filtering" the catchpoints.
-+   Returns 0 if not, greater than 0 if we are.  */
-+extern int catching_syscall_number (int syscall_number);
++  loc_first = NULL;
++  ALL_BP_LOCATIONS (loc, locp)
+     {
+-      check_duplicates (b);
++      struct breakpoint *b = loc->owner;
++
++      if (b->enable_state == bp_disabled
++        || b->enable_state == bp_call_disabled
++        || b->enable_state == bp_startup_disabled
++        || !loc->enabled
++        || loc->shlib_disabled
++        || !breakpoint_address_is_meaningful (b))
++      continue;
 +
- /* Tell a breakpoint to be quiet.  */
- extern void make_breakpoint_silent (struct breakpoint *);
-+/* Set break condition of breakpoint B to EXP.  */
-+extern void set_breakpoint_condition (struct breakpoint *b, char *exp, int from_tty);
++      /* Permanent breakpoint should always be inserted.  */
++      if (b->enable_state == bp_permanent && ! loc->inserted)
++      internal_error (__FILE__, __LINE__,
++                      _("allegedly permanent breakpoint is not "
++                      "actually inserted"));
 +
- #endif /* !defined (BREAKPOINT_H) */
-diff --git a/gdb/buildsym.c b/gdb/buildsym.c
-index 55ace15..2722daa 100644
---- a/gdb/buildsym.c
-+++ b/gdb/buildsym.c
-@@ -384,6 +384,8 @@ finish_block (struct symbol *symbol, struct pending **listhead,
-       opblock = pblock;
-     }
-+  block_set_using (block, using_directives, &objfile->objfile_obstack);
++      if (loc_first == NULL
++        /* address / overlay match */
++        || loc->address != loc_first->address
++        || (overlay_debugging && loc->section != loc_first->section))
++      {
++        loc_first = loc;
++        loc->duplicate = 0;
++        continue;
++      }
 +
-   record_pending_block (objfile, block, opblock);
-   return block;
-@@ -815,10 +817,6 @@ start_symtab (char *name, char *dirname, CORE_ADDR start_addr)
-   /* We shouldn't have any address map at this point.  */
-   gdb_assert (! pending_addrmap);
--  /* Set up support for C++ namespace support, in case we need it.  */
--
--  cp_initialize_namespace ();
--
-   /* Initialize the list of sub source files with one entry for this
-      file (the top-level source file).  */
-@@ -1015,8 +1013,6 @@ end_symtab (CORE_ADDR end_addr, struct objfile *objfile, int section)
-       finish_block (0, &global_symbols, 0, last_source_start_addr, end_addr,
-                   objfile);
-       blockvector = make_blockvector (objfile);
--      cp_finalize_namespace (BLOCKVECTOR_BLOCK (blockvector, STATIC_BLOCK),
--                           &objfile->objfile_obstack);
++      loc->duplicate = 1;
++
++      if (loc_first->owner->enable_state == bp_permanent && loc->inserted
++          && b->enable_state != bp_permanent)
++      internal_error (__FILE__, __LINE__,
++                      _("another breakpoint was inserted on top of "
++                      "a permanent breakpoint"));
      }
  
-   /* Read the line table if it has to be read separately.  */
-@@ -1202,10 +1198,12 @@ push_context (int desc, CORE_ADDR valu)
-   new->params = param_symbols;
-   new->old_blocks = pending_blocks;
-   new->start_addr = valu;
-+  new->using_directives = using_directives;
-   new->name = NULL;
+   if (breakpoints_always_inserted_mode () && should_insert
+@@ -8083,6 +8323,7 @@ delete_command (char *arg, int from_tty)
+           && b->type != bp_thread_event
+           && b->type != bp_overlay_event
+           && b->type != bp_longjmp_master
++          && b->type != bp_exception_master
+           && b->number >= 0)
+         {
+           breaks_to_delete = 1;
+@@ -8102,6 +8343,7 @@ delete_command (char *arg, int from_tty)
+               && b->type != bp_jit_event
+               && b->type != bp_overlay_event
+               && b->type != bp_longjmp_master
++              && b->type != bp_exception_master
+               && b->number >= 0)
+             delete_breakpoint (b);
+         }
+@@ -8404,6 +8646,7 @@ breakpoint_re_set_one (void *bint)
+        reset later by breakpoint_re_set.  */
+     case bp_overlay_event:
+     case bp_longjmp_master:
++    case bp_exception_master:
+       delete_breakpoint (b);
+       break;
  
-   local_symbols = NULL;
-   param_symbols = NULL;
-+  using_directives = NULL;
+@@ -8427,6 +8670,8 @@ breakpoint_re_set_one (void *bint)
+     case bp_longjmp:
+     case bp_longjmp_resume:
+     case bp_jit_event:
++    case bp_exception:
++    case bp_exception_resume:
+       break;
+     }
  
-   return new;
+@@ -8462,6 +8707,7 @@ breakpoint_re_set (void)
+   create_longjmp_master_breakpoint ("_longjmp");
+   create_longjmp_master_breakpoint ("siglongjmp");
+   create_longjmp_master_breakpoint ("_siglongjmp");
++  create_exception_master_breakpoint ();
+ }
\f
+ /* Reset the thread number of this breakpoint:
+@@ -9327,6 +9573,22 @@ all_tracepoints ()
+   return tp_vec;
  }
-diff --git a/gdb/buildsym.h b/gdb/buildsym.h
-index bf23ecc..f542aca 100644
---- a/gdb/buildsym.h
-+++ b/gdb/buildsym.h
-@@ -125,6 +125,10 @@ EXTERN struct pending *local_symbols;
- EXTERN struct pending *param_symbols;
  
-+/* using directives local to lexical context */
++/* Call type_mark_used for any TYPEs referenced from this GDB source file.  */
++
++static void
++breakpoint_types_mark_used (void)
++{
++  struct breakpoint *b;
 +
-+EXTERN struct using_direct *using_directives;
++  ALL_BREAKPOINTS (b)
++    {
++      if (b->exp)
++      exp_types_mark_used (b->exp);
++      if (b->val)
++      type_mark_used (value_type (b->val));
++    }
++}
 +
- /* Stack representing unclosed lexical contexts (that will become
-    blocks, eventually).  */
\f
+ /* This help string is used for the break, hbreak, tbreak and thbreak commands.
+    It is defined as a macro to prevent duplication.
+@@ -9850,4 +10112,5 @@ inferior in all-stop mode, gdb behaves as if always-inserted mode is off."),
+   automatic_hardware_breakpoints = 1;
  
-@@ -138,6 +142,10 @@ struct context_stack
+   observer_attach_about_to_proceed (breakpoint_about_to_proceed);
++  observer_attach_mark_used (breakpoint_types_mark_used);
+ }
+diff --git a/gdb/breakpoint.h b/gdb/breakpoint.h
+index ba499c6..80f702f 100644
+--- a/gdb/breakpoint.h
++++ b/gdb/breakpoint.h
+@@ -56,6 +56,13 @@ enum bptype
+     bp_longjmp,                       /* secret breakpoint to find longjmp() */
+     bp_longjmp_resume,                /* secret breakpoint to escape longjmp() */
++    /* An internal breakpoint that is installed on the unwinder's
++       debug hook.  */
++    bp_exception,
++    /* An internal breakpoint that is set at the point where an
++       exception will land.  */
++    bp_exception_resume,
++
+     /* Used by wait_for_inferior for stepping over subroutine calls, for
+        stepping over signal handlers, and for skipping prologues.  */
+     bp_step_resume,
+@@ -118,6 +125,9 @@ enum bptype
+     bp_longjmp_master,
++    /* Like bp_longjmp_master, but for exceptions.  */
++    bp_exception_master,
++
+     bp_catchpoint,
+     bp_tracepoint,
+@@ -228,10 +238,6 @@ struct bp_location
+      the same parent breakpoint.  */
+   struct bp_location *next;
+-  /* Pointer to the next breakpoint location, in a global
+-     list of all breakpoint locations.  */
+-  struct bp_location *global_next;
+- 
+   /* Type of this breakpoint location.  */
+   enum bp_loc_type loc_type;
+@@ -583,6 +589,10 @@ struct bpstat_what
+        continuing from a call dummy without popping the frame is not a
+        useful one).  */
+     int call_dummy;
++
++    /* Used for BPSTAT_WHAT_SET_LONGJMP_RESUME.  True if we are
++       handling a longjmp, false if we are handling an exception.  */
++    int is_longjmp;
+   };
  
-     struct pending *params;
+ /* The possible return values for print_bpstat, print_it_normal,
+@@ -946,6 +956,9 @@ extern int catching_syscall_number (int syscall_number);
+ /* Tell a breakpoint to be quiet.  */
+ extern void make_breakpoint_silent (struct breakpoint *);
  
-+    /* Pending using directives at the time we entered */
-+
-+    struct using_direct *using_directives;
++/* Set break condition of breakpoint B to EXP.  */
++extern void set_breakpoint_condition (struct breakpoint *b, char *exp, int from_tty);
 +
-     /* Pointer into blocklist as of entry */
+ /* Return a tracepoint with the given number if found.  */
+ extern struct breakpoint *get_tracepoint (int num);
  
-     struct pending_block *old_blocks;
 diff --git a/gdb/c-exp.y b/gdb/c-exp.y
-index d4bbbcc..107452a 100644
+index f8e4f12..5b47e2e 100644
 --- a/gdb/c-exp.y
 +++ b/gdb/c-exp.y
-@@ -119,6 +119,8 @@ static int yylex (void);
+@@ -117,6 +117,8 @@ static int yylex (void);
  
  void yyerror (char *);
  
@@ -5566,46 +1937,33 @@ index d4bbbcc..107452a 100644
  %}
  
  /* Although the yacc "value" of an expression is not used,
-@@ -143,6 +145,7 @@ void yyerror (char *);
-     struct symbol *sym;
-     struct type *tval;
-     struct stoken sval;
-+    struct typed_stoken tsval;
-     struct ttype tsym;
-     struct symtoken ssym;
-     int voidval;
-@@ -150,6 +153,7 @@ void yyerror (char *);
-     enum exp_opcode opcode;
-     struct internalvar *ivar;
-+    struct stoken_vector svec;
-     struct type **tvec;
-     int *ivec;
-   }
-@@ -182,11 +186,13 @@ static int parse_number (char *, int, int, YYSTYPE *);
-    Contexts where this distinction is not important can use the
-    nonterminal "name", which matches either NAME or TYPENAME.  */
--%token <sval> STRING
-+%token <tsval> STRING
-+%token <tsval> CHAR
- %token <ssym> NAME /* BLOCKNAME defined below to give it higher precedence. */
- %token <voidval> COMPLETE
- %token <tsym> TYPENAME
--%type <sval> name string_exp
-+%type <sval> name
-+%type <svec> string_exp
- %type <ssym> name_not_typename
- %type <tsym> typename
-@@ -399,6 +405,38 @@ arglist   :       arglist ',' exp   %prec ABOVE_COMMA
+@@ -157,6 +159,7 @@ void yyerror (char *);
+ %{
+ /* YYSTYPE gets defined by %union */
+ static int parse_number (char *, int, int, YYSTYPE *);
++static struct stoken operator_stoken (const char *);
+ %}
+ %type <voidval> exp exp1 type_exp start variable qualified_name lcurly
+@@ -199,9 +202,12 @@ static int parse_number (char *, int, int, YYSTYPE *);
+ %token <ssym> NAME_OR_INT 
++%token OPERATOR
+ %token STRUCT CLASS UNION ENUM SIZEOF UNSIGNED COLONCOLON
+ %token TEMPLATE
+ %token ERROR
++%token NEW DELETE
++%type <sval> operator
+ /* Special type cases, put in to allow the parser to distinguish different
+    legal basetypes.  */
+@@ -401,6 +407,36 @@ arglist   :       arglist ',' exp   %prec ABOVE_COMMA
                        { arglist_len++; }
        ;
  
-+exp     :       exp '(' nonempty_typelist ')'
++exp     :       exp '(' nonempty_typelist ')' const_or_volatile
 +                      { int i;
-+                        /* What to do about freeing memory if
-+                           there is an error during parsing? */
 +                        write_exp_elt_opcode (TYPE_INSTANCE);
 +                        write_exp_elt_longcst ((LONGEST) $<ivec>3[0]);
 +                        for (i = 0; i < $<ivec>3[0]; ++i)
@@ -5637,118 +1995,23 @@ index d4bbbcc..107452a 100644
  rcurly        :       '}'
                        { $$ = end_arglist () - 1; }
        ;
-@@ -524,6 +562,15 @@ exp       :       INT
-                         write_exp_elt_opcode (OP_LONG); }
-       ;
-+exp   :       CHAR
-+                      {
-+                        struct stoken_vector vec;
-+                        vec.len = 1;
-+                        vec.tokens = &$1;
-+                        write_exp_string_vector ($1.type, &vec);
-+                      }
-+      ;
-+
- exp   :       NAME_OR_INT
-                       { YYSTYPE val;
-                         parse_number ($1.stoken.ptr, $1.stoken.length, 0, &val);
-@@ -572,48 +619,64 @@ string_exp:
-                            string.  Note that we follow the
-                            NUL-termination convention of the
-                            lexer.  */
--                        $$.length = $1.length;
--                        $$.ptr = malloc ($1.length + 1);
--                        memcpy ($$.ptr, $1.ptr, $1.length + 1);
-+                        struct typed_stoken *vec = XNEW (struct typed_stoken);
-+                        $$.len = 1;
-+                        $$.tokens = vec;
-+
-+                        vec->type = $1.type;
-+                        vec->length = $1.length;
-+                        vec->ptr = malloc ($1.length + 1);
-+                        memcpy (vec->ptr, $1.ptr, $1.length + 1);
-                       }
-       |       string_exp STRING
+@@ -703,6 +739,7 @@ variable:  block COLONCOLON name
+ qualified_name:       typebase COLONCOLON name
                        {
-                         /* Note that we NUL-terminate here, but just
-                            for convenience.  */
--                        struct stoken t;
--                        t.length = $1.length + $2.length;
--                        t.ptr = malloc (t.length + 1);
--                        memcpy (t.ptr, $1.ptr, $1.length);
--                        memcpy (t.ptr + $1.length, $2.ptr, $2.length + 1);
--                        free ($1.ptr);
--                        $$ = t;
-+                        char *p;
-+                        ++$$.len;
-+                        $$.tokens = realloc ($$.tokens,
-+                                             $$.len * sizeof (struct typed_stoken));
-+
-+                        p = malloc ($2.length + 1);
-+                        memcpy (p, $2.ptr, $2.length + 1);
-+
-+                        $$.tokens[$$.len - 1].type = $2.type;
-+                        $$.tokens[$$.len - 1].length = $2.length;
-+                        $$.tokens[$$.len - 1].ptr = p;
-                       }
-               ;
- exp   :       string_exp
--                      { /* C strings are converted into array constants with
--                           an explicit null byte added at the end.  Thus
--                           the array upper bound is the string length.
--                           There is no such thing in C as a completely empty
--                           string. */
--                        char *sp = $1.ptr; int count = $1.length;
--                        while (count-- > 0)
-+                      {
-+                        int i;
-+                        enum c_string_type type = C_STRING;
-+
-+                        for (i = 0; i < $1.len; ++i)
-                           {
--                            write_exp_elt_opcode (OP_LONG);
--                            write_exp_elt_type (parse_type->builtin_char);
--                            write_exp_elt_longcst ((LONGEST)(*sp++));
--                            write_exp_elt_opcode (OP_LONG);
-+                            switch ($1.tokens[i].type)
-+                              {
-+                              case C_STRING:
-+                                break;
-+                              case C_WIDE_STRING:
-+                              case C_STRING_16:
-+                              case C_STRING_32:
-+                                if (type != C_STRING
-+                                    && type != $1.tokens[i].type)
-+                                  error ("Undefined string concatenation.");
-+                                type = $1.tokens[i].type;
-+                                break;
-+                              default:
-+                                /* internal error */
-+                                internal_error (__FILE__, __LINE__,
-+                                                "unrecognized type in string concatenation");
-+                              }
-                           }
--                        write_exp_elt_opcode (OP_LONG);
--                        write_exp_elt_type (parse_type->builtin_char);
--                        write_exp_elt_longcst ((LONGEST)'\0');
--                        write_exp_elt_opcode (OP_LONG);
--                        write_exp_elt_opcode (OP_ARRAY);
--                        write_exp_elt_longcst ((LONGEST) 0);
--                        write_exp_elt_longcst ((LONGEST) ($1.length));
--                        write_exp_elt_opcode (OP_ARRAY);
--                        free ($1.ptr);
-+
-+                        write_exp_string_vector (type, &$1);
-+                        for (i = 0; i < $1.len; ++i)
-+                          free ($1.tokens[i].ptr);
-+                        free ($1.tokens);
-                       }
-       ;
-@@ -713,12 +776,13 @@ qualified_name:  typebase COLONCOLON name
+                         struct type *type = $1;
++                        CHECK_TYPEDEF (type);
+                         if (TYPE_CODE (type) != TYPE_CODE_STRUCT
+                             && TYPE_CODE (type) != TYPE_CODE_UNION
+                             && TYPE_CODE (type) != TYPE_CODE_NAMESPACE)
+@@ -718,6 +755,7 @@ qualified_name:    typebase COLONCOLON name
+                       {
+                         struct type *type = $1;
+                         struct stoken tmp_token;
++                        CHECK_TYPEDEF (type);
+                         if (TYPE_CODE (type) != TYPE_CODE_STRUCT
+                             && TYPE_CODE (type) != TYPE_CODE_UNION
+                             && TYPE_CODE (type) != TYPE_CODE_NAMESPACE)
+@@ -740,12 +778,13 @@ qualified_name:  typebase COLONCOLON name
        ;
  
  variable:     qualified_name
@@ -5763,7 +2026,7 @@ index d4bbbcc..107452a 100644
                          sym =
                            lookup_symbol (name, (const struct block *) NULL,
                                           VAR_DOMAIN, (int *) NULL);
-@@ -856,7 +920,7 @@ array_mod: '[' ']'
+@@ -883,7 +922,7 @@ array_mod: '[' ']'
  func_mod:     '(' ')'
                        { $$ = 0; }
        |       '(' nonempty_typelist ')'
@@ -5772,7 +2035,7 @@ index d4bbbcc..107452a 100644
        ;
  
  /* We used to try to recognize pointer to member types here, but
-@@ -1057,12 +1121,15 @@ typename:      TYPENAME
+@@ -1088,12 +1127,15 @@ typename:      TYPENAME
  nonempty_typelist
        :       type
                { $$ = (struct type **) malloc (sizeof (struct type *) * 2);
@@ -5788,292 +2051,188 @@ index d4bbbcc..107452a 100644
                  $$[$<ivec>$[0]] = $3;
                }
        ;
-@@ -1361,6 +1428,263 @@ parse_number (p, len, parsed_float, putithere)
-    return INT;
- }
+@@ -1117,10 +1159,135 @@ const_or_volatile_noopt:      const_and_volatile
+                       { push_type (tp_volatile); }
+       ;
  
-+/* Temporary obstack used for holding strings.  */
-+static struct obstack tempbuf;
-+static int tempbuf_init;
++operator:     OPERATOR NEW
++                      { $$ = operator_stoken (" new"); }
++      |       OPERATOR DELETE
++                      { $$ = operator_stoken (" delete"); }
++      |       OPERATOR NEW '[' ']'
++                      { $$ = operator_stoken (" new[]"); }
++      |       OPERATOR DELETE '[' ']'
++                      { $$ = operator_stoken (" delete[]"); }
++      |       OPERATOR '+'
++                      { $$ = operator_stoken ("+"); }
++      |       OPERATOR '-'
++                      { $$ = operator_stoken ("-"); }
++      |       OPERATOR '*'
++                      { $$ = operator_stoken ("*"); }
++      |       OPERATOR '/'
++                      { $$ = operator_stoken ("/"); }
++      |       OPERATOR '%'
++                      { $$ = operator_stoken ("%"); }
++      |       OPERATOR '^'
++                      { $$ = operator_stoken ("^"); }
++      |       OPERATOR '&'
++                      { $$ = operator_stoken ("&"); }
++      |       OPERATOR '|'
++                      { $$ = operator_stoken ("|"); }
++      |       OPERATOR '~'
++                      { $$ = operator_stoken ("~"); }
++      |       OPERATOR '!'
++                      { $$ = operator_stoken ("!"); }
++      |       OPERATOR '='
++                      { $$ = operator_stoken ("="); }
++      |       OPERATOR '<'
++                      { $$ = operator_stoken ("<"); }
++      |       OPERATOR '>'
++                      { $$ = operator_stoken (">"); }
++      |       OPERATOR ASSIGN_MODIFY
++                      { const char *op = "unknown";
++                        switch ($2)
++                          {
++                          case BINOP_RSH:
++                            op = ">>=";
++                            break;
++                          case BINOP_LSH:
++                            op = "<<=";
++                            break;
++                          case BINOP_ADD:
++                            op = "+=";
++                            break;
++                          case BINOP_SUB:
++                            op = "-=";
++                            break;
++                          case BINOP_MUL:
++                            op = "*=";
++                            break;
++                          case BINOP_DIV:
++                            op = "/=";
++                            break;
++                          case BINOP_REM:
++                            op = "%=";
++                            break;
++                          case BINOP_BITWISE_IOR:
++                            op = "|=";
++                            break;
++                          case BINOP_BITWISE_AND:
++                            op = "&=";
++                            break;
++                          case BINOP_BITWISE_XOR:
++                            op = "^=";
++                            break;
++                          default:
++                            break;
++                          }
++
++                        $$ = operator_stoken (op);
++                      }
++      |       OPERATOR LSH
++                      { $$ = operator_stoken ("<<"); }
++      |       OPERATOR RSH
++                      { $$ = operator_stoken (">>"); }
++      |       OPERATOR EQUAL
++                      { $$ = operator_stoken ("=="); }
++      |       OPERATOR NOTEQUAL
++                      { $$ = operator_stoken ("!="); }
++      |       OPERATOR LEQ
++                      { $$ = operator_stoken ("<="); }
++      |       OPERATOR GEQ
++                      { $$ = operator_stoken (">="); }
++      |       OPERATOR ANDAND
++                      { $$ = operator_stoken ("&&"); }
++      |       OPERATOR OROR
++                      { $$ = operator_stoken ("||"); }
++      |       OPERATOR INCREMENT
++                      { $$ = operator_stoken ("++"); }
++      |       OPERATOR DECREMENT
++                      { $$ = operator_stoken ("--"); }
++      |       OPERATOR ','
++                      { $$ = operator_stoken (","); }
++      |       OPERATOR ARROW_STAR
++                      { $$ = operator_stoken ("->*"); }
++      |       OPERATOR ARROW
++                      { $$ = operator_stoken ("->"); }
++      |       OPERATOR '(' ')'
++                      { $$ = operator_stoken ("()"); }
++      |       OPERATOR '[' ']'
++                      { $$ = operator_stoken ("[]"); }
++      |       OPERATOR ptype
++                      { char *name, *canon;
++                        long length;
++                        struct ui_file *buf = mem_fileopen ();
++
++                        c_print_type ($2, NULL, buf, -1, 0);
++                        name = ui_file_xstrdup (buf, &length);
++                        canon = cp_canonicalize_string (name);
++                        if (canon != NULL)
++                          {
++                            xfree (name);
++                            name = canon;
++                          }
++                        ui_file_delete (buf);
++                        $$ = operator_stoken (name);
++                      }
++      ;
 +
-+/* Parse a C escape sequence.  The initial backslash of the sequence
-+   is at (*PTR)[-1].  *PTR will be updated to point to just after the
-+   last character of the sequence.  If OUTPUT is not NULL, the
-+   translated form of the escape sequence will be written there.  If
-+   OUTPUT is NULL, no output is written and the call will only affect
-+   *PTR.  If an escape sequence is expressed in target bytes, then the
-+   entire sequence will simply be copied to OUTPUT.  Return 1 if any
-+   character was emitted, 0 otherwise.  */
 +
-+int
-+c_parse_escape (char **ptr, struct obstack *output)
++
+ name  :       NAME { $$ = $1.stoken; }
+       |       BLOCKNAME { $$ = $1.stoken; }
+       |       TYPENAME { $$ = $1.stoken; }
+       |       NAME_OR_INT  { $$ = $1.stoken; }
++      |       operator { $$ = $1; }
+       ;
+ name_not_typename :   NAME
+@@ -1136,6 +1303,20 @@ name_not_typename :     NAME
+ %%
++/* Returns a stoken of the operator name given by OP (which does not
++   include the string "operator").  The result is xmalloc'd.  */
++static struct stoken
++operator_stoken (const char *op)
 +{
-+  char *tokptr = *ptr;
-+  int result = 1;
++  static const char *operator_string = "operator";
++  struct stoken st = { NULL, 0 };
++  st.length = strlen (operator_string) + strlen (op);
++  st.ptr = xmalloc (st.length + 1);
++  strcpy (st.ptr, operator_string);
++  strcat (st.ptr, op);
++  return st;
++};
 +
-+  /* Some escape sequences undergo character set conversion.  Those we
-+     translate here.  */
-+  switch (*tokptr)
-+    {
-+      /* Hex escapes do not undergo character set conversion, so keep
-+       the escape sequence for later.  */
-+    case 'x':
-+      if (output)
-+      obstack_grow_str (output, "\\x");
-+      ++tokptr;
-+      if (!isxdigit (*tokptr))
-+      error (_("\\x escape without a following hex digit"));
-+      while (isxdigit (*tokptr))
-+      {
-+        if (output)
-+          obstack_1grow (output, *tokptr);
-+        ++tokptr;
-+      }
-+      break;
-+
-+      /* Octal escapes do not undergo character set conversion, so
-+       keep the escape sequence for later.  */
-+    case '0':
-+    case '1':
-+    case '2':
-+    case '3':
-+    case '4':
-+    case '5':
-+    case '6':
-+    case '7':
-+      if (output)
-+      obstack_grow_str (output, "\\");
-+      while (isdigit (*tokptr) && *tokptr != '8' && *tokptr != '9')
-+      {
-+        if (output)
-+          obstack_1grow (output, *tokptr);
-+        ++tokptr;
-+      }
-+      break;
-+
-+      /* We handle UCNs later.  We could handle them here, but that
-+       would mean a spurious error in the case where the UCN could
-+       be converted to the target charset but not the host
-+       charset.  */
-+    case 'u':
-+    case 'U':
-+      {
-+      char c = *tokptr;
-+      int i, len = c == 'U' ? 8 : 4;
-+      if (output)
-+        {
-+          obstack_1grow (output, '\\');
-+          obstack_1grow (output, *tokptr);
-+        }
-+      ++tokptr;
-+      if (!isxdigit (*tokptr))
-+        error (_("\\%c escape without a following hex digit"), c);
-+      for (i = 0; i < len && isxdigit (*tokptr); ++i)
-+        {
-+          if (output)
-+            obstack_1grow (output, *tokptr);
-+          ++tokptr;
-+        }
-+      }
-+      break;
-+
-+      /* We must pass backslash through so that it does not
-+       cause quoting during the second expansion.  */
-+    case '\\':
-+      if (output)
-+      obstack_grow_str (output, "\\\\");
-+      ++tokptr;
-+      break;
-+
-+      /* Escapes which undergo conversion.  */
-+    case 'a':
-+      if (output)
-+      obstack_1grow (output, '\a');
-+      ++tokptr;
-+      break;
-+    case 'b':
-+      if (output)
-+      obstack_1grow (output, '\b');
-+      ++tokptr;
-+      break;
-+    case 'f':
-+      if (output)
-+      obstack_1grow (output, '\f');
-+      ++tokptr;
-+      break;
-+    case 'n':
-+      if (output)
-+      obstack_1grow (output, '\n');
-+      ++tokptr;
-+      break;
-+    case 'r':
-+      if (output)
-+      obstack_1grow (output, '\r');
-+      ++tokptr;
-+      break;
-+    case 't':
-+      if (output)
-+      obstack_1grow (output, '\t');
-+      ++tokptr;
-+      break;
-+    case 'v':
-+      if (output)
-+      obstack_1grow (output, '\v');
-+      ++tokptr;
-+      break;
-+
-+      /* GCC extension.  */
-+    case 'e':
-+      if (output)
-+      obstack_1grow (output, HOST_ESCAPE_CHAR);
-+      ++tokptr;
-+      break;
-+
-+      /* Backslash-newline expands to nothing at all.  */
-+    case '\n':
-+      ++tokptr;
-+      result = 0;
-+      break;
-+
-+      /* A few escapes just expand to the character itself.  */
-+    case '\'':
-+    case '\"':
-+    case '?':
-+      /* GCC extensions.  */
-+    case '(':
-+    case '{':
-+    case '[':
-+    case '%':
-+      /* Unrecognized escapes turn into the character itself.  */
-+    default:
-+      if (output)
-+      obstack_1grow (output, *tokptr);
-+      ++tokptr;
-+      break;
-+    }
-+  *ptr = tokptr;
-+  return result;
-+}
-+
-+/* Parse a string or character literal from TOKPTR.  The string or
-+   character may be wide or unicode.  *OUTPTR is set to just after the
-+   end of the literal in the input string.  The resulting token is
-+   stored in VALUE.  This returns a token value, either STRING or
-+   CHAR, depending on what was parsed.  *HOST_CHARS is set to the
-+   number of host characters in the literal.  */
-+static int
-+parse_string_or_char (char *tokptr, char **outptr, struct typed_stoken *value,
-+                    int *host_chars)
-+{
-+  int quote, i;
-+  enum c_string_type type;
-+
-+  /* Build the gdb internal form of the input string in tempbuf.  Note
-+     that the buffer is null byte terminated *only* for the
-+     convenience of debugging gdb itself and printing the buffer
-+     contents when the buffer contains no embedded nulls.  Gdb does
-+     not depend upon the buffer being null byte terminated, it uses
-+     the length string instead.  This allows gdb to handle C strings
-+     (as well as strings in other languages) with embedded null
-+     bytes */
-+
-+  if (!tempbuf_init)
-+    tempbuf_init = 1;
-+  else
-+    obstack_free (&tempbuf, NULL);
-+  obstack_init (&tempbuf);
-+
-+  /* Record the string type.  */
-+  if (*tokptr == 'L')
-+    {
-+      type = C_WIDE_STRING;
-+      ++tokptr;
-+    }
-+  else if (*tokptr == 'u')
-+    {
-+      type = C_STRING_16;
-+      ++tokptr;
-+    }
-+  else if (*tokptr == 'U')
-+    {
-+      type = C_STRING_32;
-+      ++tokptr;
-+    }
-+  else
-+    type = C_STRING;
-+
-+  /* Skip the quote.  */
-+  quote = *tokptr;
-+  if (quote == '\'')
-+    type |= C_CHAR;
-+  ++tokptr;
-+
-+  *host_chars = 0;
-+
-+  while (*tokptr)
-+    {
-+      char c = *tokptr;
-+      if (c == '\\')
-+      {
-+        ++tokptr;
-+        *host_chars += c_parse_escape (&tokptr, &tempbuf);
-+      }
-+      else if (c == quote)
-+      break;
-+      else
-+      {
-+        obstack_1grow (&tempbuf, c);
-+        ++tokptr;
-+        /* FIXME: this does the wrong thing with multi-byte host
-+           characters.  We could use mbrlen here, but that would
-+           make "set host-charset" a bit less useful.  */
-+        ++*host_chars;
-+      }
-+    }
-+
-+  if (*tokptr != quote)
-+    {
-+      if (quote == '"')
-+      error ("Unterminated string in expression.");
-+      else
-+      error ("Unmatched single quote.");
-+    }
-+  ++tokptr;
-+
-+  value->type = type;
-+  value->ptr = obstack_base (&tempbuf);
-+  value->length = obstack_object_size (&tempbuf);
-+
-+  *outptr = tokptr;
-+
-+  return quote == '"' ? STRING : CHAR;
-+}
-+
- struct token
- {
-   char *operator;
-@@ -1526,23 +1850,33 @@ static int last_was_structop;
+ /* Take care of parsing a number (anything that starts with a digit).
+    Set yylval and return the token type; update lexptr.
+    LEN is the number of characters in it.  */
+@@ -1714,6 +1895,9 @@ static const struct token ident_tokens[] =
+     {"long", LONG, OP_NULL, 0},
+     {"true", TRUEKEYWORD, OP_NULL, 1},
+     {"int", INT_KEYWORD, OP_NULL, 0},
++    {"new", NEW, OP_NULL, 1},
++    {"delete", DELETE, OP_NULL, 1},
++    {"operator", OPERATOR, OP_NULL, 1},
+     {"and", ANDAND, BINOP_END, 1},
+     {"and_eq", ASSIGN_MODIFY, BINOP_BITWISE_AND, 1},
+@@ -1822,6 +2006,13 @@ static int last_was_structop;
  static int
- yylex ()
+ yylex (void)
  {
 +  /* name_prefix stores the full qualification of a variable that is
 +     specified in the expression. It is used to eleminate confusion 
 +     during lookup.*/
-+  static charname_prefix = NULL;
++  static char *name_prefix = NULL;
 +  static int name_prefix_len = 0;
 +  static int terminate_prefix = 0;
 +  
    int c;
    int namelen;
    unsigned int i;
-   char *tokstart;
--  char *tokptr;
--  int tempbufindex;
--  static char *tempbuf;
--  static int tempbufsize;
--  char * token_string = NULL;
--  int class_prefix = 0;
-   int saw_structop = last_was_structop;
+@@ -1830,9 +2021,19 @@ yylex (void)
    char *copy;
  
    last_was_structop = 0;
@@ -6082,30 +2241,31 @@ index d4bbbcc..107452a 100644
   retry:
 -
 +  
-+  if(terminate_prefix ||
-+     lexptr != name_prefix + name_prefix_len // Some token was skiped so clear name_prefix
-+   ){
-+    name_prefix = NULL;
-+    name_prefix_len = 0;
-+  }
++  if (terminate_prefix
++      || lexptr != name_prefix + name_prefix_len)
++    {
++      /* Some token was skipped, so clear name_prefix. */
++      name_prefix = NULL;
++      name_prefix_len = 0;
++    }
 +    
 +  terminate_prefix = 1;
 +                
    /* Check if this is a macro invocation that we need to expand.  */
    if (! scanning_macro_expansion ())
      {
-@@ -1570,10 +1904,19 @@ yylex ()
-   for (i = 0; i < sizeof tokentab2 / sizeof tokentab2[0]; i++)
-     if (strncmp (tokstart, tokentab2[i].operator, 2) == 0)
-       {
-+      
-+      if(tokentab2[i].token == COLONCOLON){
-+        name_prefix_len += 2;
-+        terminate_prefix = 0;
-+        if(name_prefix == NULL){
-+          name_prefix = lexptr;
-+          }
-+      }
+@@ -1868,10 +2069,19 @@ yylex (void)
+           && parse_language->la_language != language_cplus)
+         break;
++      if (tokentab2[i].token == COLONCOLON)
++        {
++          name_prefix_len += 2;
++          terminate_prefix = 0;
++          if (name_prefix == NULL)
++            name_prefix = lexptr;
++        }
++
        lexptr += 2;
        yylval.opcode = tokentab2[i].opcode;
        if (in_parse_field && tokentab2[i].token == ARROW)
@@ -6114,7 +2274,7 @@ index d4bbbcc..107452a 100644
        return tokentab2[i].token;
        }
  
-@@ -1602,51 +1945,13 @@ yylex ()
+@@ -1900,6 +2110,8 @@ yylex (void)
          return 0;
  
      case ' ':
@@ -6123,145 +2283,7 @@ index d4bbbcc..107452a 100644
      case '\t':
      case '\n':
        lexptr++;
-       goto retry;
--    case '\'':
--      /* We either have a character constant ('0' or '\177' for example)
--       or we have a quoted symbol reference ('foo(int,int)' in C++
--       for example). */
--      lexptr++;
--      c = *lexptr++;
--      if (c == '\\')
--      c = parse_escape (&lexptr);
--      else if (c == '\'')
--      error ("Empty character constant.");
--      else if (! host_char_to_target (c, &c))
--        {
--          int toklen = lexptr - tokstart + 1;
--          char *tok = alloca (toklen + 1);
--          memcpy (tok, tokstart, toklen);
--          tok[toklen] = '\0';
--          error ("There is no character corresponding to %s in the target "
--                 "character set `%s'.", tok, target_charset ());
--        }
--
--      yylval.typed_val_int.val = c;
--      yylval.typed_val_int.type = parse_type->builtin_char;
--
--      c = *lexptr++;
--      if (c != '\'')
--      {
--        namelen = skip_quoted (tokstart) - tokstart;
--        if (namelen > 2)
--          {
--            lexptr = tokstart + namelen;
--            if (lexptr[-1] != '\'')
--              error ("Unmatched single quote.");
--            namelen -= 2;
--            tokstart++;
--            goto tryname;
--          }
--        error ("Invalid character constant.");
--      }
--      return INT;
--
-     case '(':
-       paren_depth++;
-       lexptr++;
-@@ -1764,70 +2069,33 @@ yylex ()
-       lexptr++;
-       return c;
-+    case 'L':
-+    case 'u':
-+    case 'U':
-+      if (tokstart[1] != '"' && tokstart[1] != '\'')
-+      break;
-+      /* Fall through.  */
-+    case '\'':
-     case '"':
--
--      /* Build the gdb internal form of the input string in tempbuf,
--       translating any standard C escape forms seen.  Note that the
--       buffer is null byte terminated *only* for the convenience of
--       debugging gdb itself and printing the buffer contents when
--       the buffer contains no embedded nulls.  Gdb does not depend
--       upon the buffer being null byte terminated, it uses the length
--       string instead.  This allows gdb to handle C strings (as well
--       as strings in other languages) with embedded null bytes */
--
--      tokptr = ++tokstart;
--      tempbufindex = 0;
--
--      do {
--        char *char_start_pos = tokptr;
--
--      /* Grow the static temp buffer if necessary, including allocating
--         the first one on demand. */
--      if (tempbufindex + 1 >= tempbufsize)
--        {
--          tempbuf = (char *) realloc (tempbuf, tempbufsize += 64);
--        }
--      switch (*tokptr)
-+      {
-+      int host_len;
-+      int result = parse_string_or_char (tokstart, &lexptr, &yylval.tsval,
-+                                         &host_len);
-+      if (result == CHAR)
-         {
--        case '\0':
--        case '"':
--          /* Do nothing, loop will terminate. */
--          break;
--        case '\\':
--          tokptr++;
--          c = parse_escape (&tokptr);
--          if (c == -1)
-+          if (host_len == 0)
-+            error ("Empty character constant.");
-+          else if (host_len > 2 && c == '\'')
-             {
--              continue;
-+              ++tokstart;
-+              namelen = lexptr - tokstart - 1;
-+              goto tryname;
-             }
--          tempbuf[tempbufindex++] = c;
--          break;
--        default:
--          c = *tokptr++;
--            if (! host_char_to_target (c, &c))
--              {
--                int len = tokptr - char_start_pos;
--                char *copy = alloca (len + 1);
--                memcpy (copy, char_start_pos, len);
--                copy[len] = '\0';
--
--                error ("There is no character corresponding to `%s' "
--                       "in the target character set `%s'.",
--                       copy, target_charset ());
--              }
--            tempbuf[tempbufindex++] = c;
--          break;
-+          else if (host_len > 1)
-+            error ("Invalid character constant.");
-         }
--      } while ((*tokptr != '"') && (*tokptr != '\0'));
--      if (*tokptr++ != '"')
--      {
--        error ("Unterminated string in expression.");
--      }
--      tempbuf[tempbufindex] = '\0';   /* See note above */
--      yylval.sval.ptr = tempbuf;
--      yylval.sval.length = tempbufindex;
--      lexptr = tokptr;
--      return (STRING);
-+      return result;
-+      }
-     }
-   if (!(c == '_' || c == '$'
-@@ -1836,11 +2104,13 @@ yylex ()
+@@ -2057,11 +2269,13 @@ yylex (void)
      error ("Invalid character '%c' in expression.", c);
  
    /* It's a name.  See how long it is.  */
@@ -6275,7 +2297,7 @@ index d4bbbcc..107452a 100644
        /* Template parameter lists are part of the name.
         FIXME: This mishandles `print $a<4&&$a>3'.  */
  
-@@ -1904,14 +2174,29 @@ yylex ()
+@@ -2125,14 +2339,29 @@ yylex (void)
       currently as names of types; NAME for other symbols.
       The caller is not constrained to care about the distinction.  */
    {
@@ -6285,28 +2307,28 @@ index d4bbbcc..107452a 100644
      int hextype;
  
 -    sym = lookup_symbol (copy, expression_context_block,
-+    if(name_prefix != NULL){
++    if (name_prefix != NULL)
 +      tmp = savestring (name_prefix, name_prefix_len+namelen);
-+    }
 +
 +    sym = lookup_symbol (tmp, expression_context_block,
                         VAR_DOMAIN,
                         parse_language->la_language == language_cplus
                         ? &is_a_field_of_this : (int *) NULL);
 +                       
-+    /* keep this name as prefix for the next name */
-+    if(sym){
-+      if(name_prefix == NULL){
-+        name_prefix = tokstart;
++    /* Keep this name as the prefix for the next name. */
++    if (sym)
++      {
++      if (name_prefix == NULL)
++        name_prefix = tokstart;
++
++      name_prefix_len += namelen;
++      terminate_prefix = 0;
 +      }
-+      name_prefix_len += namelen;
-+      terminate_prefix = 0;
-+    }
 +
      /* Call lookup_symtab, not lookup_partial_symtab, in case there are
         no psymtabs (coff, xcoff, or some future change to blow away the
         psymtabs once once symbols are read).  */
-@@ -1970,6 +2255,7 @@ yylex ()
+@@ -2191,6 +2420,7 @@ yylex (void)
      yylval.ssym.is_a_field_of_this = is_a_field_of_this;
      if (in_parse_field && *lexptr == '\0')
        saw_name_at_eof = 1;
@@ -6315,1069 +2337,100 @@ index d4bbbcc..107452a 100644
    }
  }
 diff --git a/gdb/c-lang.c b/gdb/c-lang.c
-index 8b5410f..188755b 100644
+index d01490c..bc35a3e 100644
 --- a/gdb/c-lang.c
 +++ b/gdb/c-lang.c
-@@ -33,48 +33,304 @@
- #include "demangle.h"
- #include "cp-abi.h"
- #include "cp-support.h"
-+#include "gdb_obstack.h"
-+#include <ctype.h>
-+#include <wchar.h>
-+#include <wctype.h>
+@@ -715,7 +715,7 @@ c_get_string (struct value *value, gdb_byte **buffer, int *length,
+      If length returned from read_string was > 0, return the number of
+      characters read by dividing the number of bytes by width.  */
+   if (*length != 0)
+-     *length = *length / width;
++    *length = *length / width;
  
- extern void _initialize_c_language (void);
--static void c_emit_char (int c, struct ui_file * stream, int quoter);
-+
-+/* Given a C string type, STR_TYPE, return the corresponding target
-+   character set name.  */
-+
-+static const char *
-+charset_for_string_type (enum c_string_type str_type)
-+{
-+  switch (str_type & ~C_CHAR)
-+    {
-+    case C_STRING:
-+      return target_charset ();
-+    case C_WIDE_STRING:
-+      return target_wide_charset ();
-+    case C_STRING_16:
-+      /* FIXME: UCS-2 is not always correct.  */
-+      if (gdbarch_byte_order (current_gdbarch) == BFD_ENDIAN_BIG)
-+      return "UCS-2BE";
-+      else
-+      return "UCS-2LE";
-+    case C_STRING_32:
-+      /* FIXME: UCS-4 is not always correct.  */
-+      if (gdbarch_byte_order (current_gdbarch) == BFD_ENDIAN_BIG)
-+      return "UCS-4BE";
-+      else
-+      return "UCS-4LE";
-+    }
-+  internal_error (__FILE__, __LINE__, "unhandled c_string_type");
-+}
-+
-+/* Classify ELTTYPE according to what kind of character it is.  Return
-+   the enum constant representing the character type.  Also set
-+   *ENCODING to the name of the character set to use when converting
-+   characters of this type to the host character set.  */
-+
-+static enum c_string_type
-+classify_type (struct type *elttype, const char **encoding)
-+{
-+  struct type *saved_type;
-+  enum c_string_type result;
-+
-+  /* We do one or two passes -- one on ELTTYPE, and then maybe a
-+     second one on a typedef target.  */
-+  do
-+    {
-+      char *name = TYPE_NAME (elttype);
-+
-+      if (TYPE_CODE (elttype) == TYPE_CODE_CHAR || !name)
-+      {
-+        result = C_CHAR;
-+        goto done;
-+      }
-+
-+      if (!strcmp (name, "wchar_t"))
-+      {
-+        result = C_WIDE_CHAR;
-+        goto done;
-+      }
-+
-+      if (!strcmp (name, "char16_t"))
-+      {
-+        result = C_CHAR_16;
-+        goto done;
-+      }
-+
-+      if (!strcmp (name, "char32_t"))
-+      {
-+        result = C_CHAR_32;
-+        goto done;
-+      }
-+
-+      saved_type = elttype;
-+      CHECK_TYPEDEF (elttype);
-+    }
-+  while (elttype != saved_type);
-+
-+  /* Punt.  */
-+  result = C_CHAR;
-+
-+ done:
-+  *encoding = charset_for_string_type (result);
-+  return result;
-+}
-+
-+/* Return true if print_wchar can display W without resorting to a
-+   numeric escape, false otherwise.  */
-+
-+static int
-+wchar_printable (wchar_t w)
-+{
-+  return (iswprint (w)
-+        || w == L'\a' || w == L'\b' || w == L'\f' || w == L'\n'
-+        || w == L'\r' || w == L'\t' || w == L'\v');
-+}
-+
-+/* A helper function that converts the contents of STRING to wide
-+   characters and then appends them to OUTPUT.  */
-+
-+static void
-+append_string_as_wide (const char *string, struct obstack *output)
-+{
-+  for (; *string; ++string)
-+    {
-+      wchar_t w = btowc (*string);
-+      obstack_grow (output, &w, sizeof (wchar_t));
-+    }
-+}
-+
-+/* Print a wide character W to OUTPUT.  ORIG is a pointer to the
-+   original (target) bytes representing the character, ORIG_LEN is the
-+   number of valid bytes.  WIDTH is the number of bytes in a base
-+   characters of the type.  OUTPUT is an obstack to which wide
-+   characters are emitted.  QUOTER is a (narrow) character indicating
-+   the style of quotes surrounding the character to be printed.
-+   NEED_ESCAPE is an in/out flag which is used to track numeric
-+   escapes across calls.  */
-+
-+static void
-+print_wchar (wint_t w, const gdb_byte *orig, int orig_len,
-+           int width, struct obstack *output, int quoter,
-+           int *need_escapep)
-+{
-+  int need_escape = *need_escapep;
-+  *need_escapep = 0;
-+  if (iswprint (w) && (!need_escape || (!iswdigit (w)
-+                                      && w != L'8'
-+                                      && w != L'9')))
-+    {
-+      if (w == btowc (quoter) || w == L'\\')
-+      obstack_grow_wstr (output, L"\\");
-+      obstack_grow (output, &w, sizeof (wchar_t));
-+    }
-+  else
-+    {
-+      switch (w)
-+      {
-+      case L'\a':
-+        obstack_grow_wstr (output, L"\\a");
-+        break;
-+      case L'\b':
-+        obstack_grow_wstr (output, L"\\b");
-+        break;
-+      case L'\f':
-+        obstack_grow_wstr (output, L"\\f");
-+        break;
-+      case L'\n':
-+        obstack_grow_wstr (output, L"\\n");
-+        break;
-+      case L'\r':
-+        obstack_grow_wstr (output, L"\\r");
-+        break;
-+      case L'\t':
-+        obstack_grow_wstr (output, L"\\t");
-+        break;
-+      case L'\v':
-+        obstack_grow_wstr (output, L"\\v");
-+        break;
-+      default:
-+        {
-+          int i;
-+
-+          for (i = 0; i + width <= orig_len; i += width)
-+            {
-+              char octal[30];
-+              ULONGEST value = extract_unsigned_integer (&orig[i], width);
-+              sprintf (octal, "\\%lo", (long) value);
-+              append_string_as_wide (octal, output);
-+            }
-+          /* If we somehow have extra bytes, print them now.  */
-+          while (i < orig_len)
-+            {
-+              char octal[5];
-+              sprintf (octal, "\\%.3o", orig[i] & 0xff);
-+              append_string_as_wide (octal, output);
-+              ++i;
-+            }
-+
-+          *need_escapep = 1;
-+        }
-+        break;
-+      }
-+    }
-+}
+   *charset = target_charset ();
  
- /* Print the character C on STREAM as part of the contents of a literal
-    string whose delimiter is QUOTER.  Note that that format for printing
-    characters and strings is language specific. */
+@@ -1038,6 +1038,9 @@ evaluate_subexp_c (struct type *expect_type, struct expression *exp,
+   return evaluate_subexp_standard (expect_type, exp, pos, noside);
+ }
  
- static void
--c_emit_char (int c, struct ui_file *stream, int quoter)
-+c_emit_char (int c, struct type *type, struct ui_file *stream, int quoter)
++\f
++/* Preprocessing and parsing C and C++ expressions.  */
++
\f
+ /* Table mapping opcodes into strings for printing operators
+@@ -1138,6 +1141,7 @@ static const struct exp_descriptor exp_descriptor_c =
  {
--  const char *escape;
--  int host_char;
-+  struct obstack wchar_buf, output;
-+  struct cleanup *cleanups;
-+  const char *encoding;
-+  gdb_byte *buf;
-+  struct wchar_iterator *iter;
-+  int need_escape = 0;
+   print_subexp_standard,
+   operator_length_standard,
++  operator_check_standard,
+   op_name_standard,
+   dump_subexp_body_standard,
+   evaluate_subexp_c
+diff --git a/gdb/c-typeprint.c b/gdb/c-typeprint.c
+index b193080..04cf3bc 100644
+--- a/gdb/c-typeprint.c
++++ b/gdb/c-typeprint.c
+@@ -32,6 +32,7 @@
+ #include "c-lang.h"
+ #include "typeprint.h"
+ #include "cp-abi.h"
++#include "jv-lang.h"
  
--  c &= 0xFF;                  /* Avoid sign bit follies */
-+  classify_type (type, &encoding);
+ #include "gdb_string.h"
+ #include <errno.h>
+@@ -40,8 +41,6 @@ static void cp_type_print_method_args (struct type *mtype, char *prefix,
+                                      char *varstring, int staticp,
+                                      struct ui_file *stream);
  
--  escape = c_target_char_has_backslash_escape (c);
--  if (escape)
--    {
--      if (quoter == '"' && strcmp (escape, "0") == 0)
--      /* Print nulls embedded in double quoted strings as \000 to
--         prevent ambiguity.  */
--      fprintf_filtered (stream, "\\000");
--      else
--      fprintf_filtered (stream, "\\%s", escape);
--    }
--  else if (target_char_to_host (c, &host_char)
--           && host_char_print_literally (host_char))
-+  buf = alloca (TYPE_LENGTH (type));
-+  pack_long (buf, type, c);
-+
-+  iter = make_wchar_iterator (buf, TYPE_LENGTH (type), encoding,
-+                            TYPE_LENGTH (type));
-+  cleanups = make_cleanup_wchar_iterator (iter);
-+
-+  /* This holds the printable form of the wchar_t data.  */
-+  obstack_init (&wchar_buf);
-+  make_cleanup_obstack_free (&wchar_buf);
-+
-+  while (1)
-     {
--      if (host_char == '\\' || host_char == quoter)
--        fputs_filtered ("\\", stream);
--      fprintf_filtered (stream, "%c", host_char);
-+      int num_chars;
-+      wchar_t *chars;
-+      const gdb_byte *buf;
-+      size_t buflen;
-+      int print_escape = 1;
-+      enum wchar_iterate_result result;
-+
-+      num_chars = wchar_iterate (iter, &result, &chars, &buf, &buflen);
-+      if (num_chars < 0)
-+      break;
-+      if (num_chars > 0)
-+      {
-+        /* If all characters are printable, print them.  Otherwise,
-+           we're going to have to print an escape sequence.  We
-+           check all characters because we want to print the target
-+           bytes in the escape sequence, and we don't know character
-+           boundaries there.  */
-+        int i;
-+
-+        print_escape = 0;
-+        for (i = 0; i < num_chars; ++i)
-+          if (!wchar_printable (chars[i]))
-+            {
-+              print_escape = 1;
-+              break;
-+            }
-+
-+        if (!print_escape)
-+          {
-+            for (i = 0; i < num_chars; ++i)
-+              print_wchar (chars[i], buf, buflen, TYPE_LENGTH (type),
-+                           &wchar_buf, quoter, &need_escape);
-+          }
-+      }
-+
-+      /* This handles the NUM_CHARS == 0 case as well.  */
-+      if (print_escape)
-+      print_wchar (WEOF, buf, buflen, TYPE_LENGTH (type), &wchar_buf, quoter,
-+                   &need_escape);
-     }
--  else
--    fprintf_filtered (stream, "\\%.3o", (unsigned int) c);
-+
-+  /* The output in the host encoding.  */
-+  obstack_init (&output);
-+  make_cleanup_obstack_free (&output);
+-static void c_type_print_args (struct type *, struct ui_file *);
+-
+ static void cp_type_print_derivation_info (struct ui_file *, struct type *);
+ static void c_type_print_varspec_prefix (struct type *, struct ui_file *, int,
+@@ -199,6 +198,23 @@ cp_type_print_method_args (struct type *mtype, char *prefix, char *varstring,
+     fprintf_filtered (stream, "void");
+   fprintf_filtered (stream, ")");
 +
-+  convert_between_encodings ("wchar_t", host_charset (),
-+                           obstack_base (&wchar_buf),
-+                           obstack_object_size (&wchar_buf),
-+                           1, &output, translit_char);
-+  obstack_1grow (&output, '\0');
++  /* For non-static methods, read qualifiers from the type of
++     THIS.  */
++  if (!staticp)
++    {
++      struct type *domain;
 +
-+  fputs_filtered (obstack_base (&output), stream);
++      gdb_assert (nargs > 0);
++      gdb_assert (TYPE_CODE (args[0].type) == TYPE_CODE_PTR);
++      domain = TYPE_TARGET_TYPE (args[0].type);
 +
-+  do_cleanups (cleanups);
- }
- void
--c_printchar (int c, struct ui_file *stream)
-+c_printchar (int c, struct type *type, struct ui_file *stream)
- {
-+  enum c_string_type str_type;
-+  const char *encoding;
++      if (TYPE_CONST (domain))
++      fprintf_filtered (stream, " const");
 +
-+  str_type = classify_type (type, &encoding);
-+  switch (str_type)
-+    {
-+    case C_CHAR:
-+      break;
-+    case C_WIDE_CHAR:
-+      fputc_filtered ('L', stream);
-+      break;
-+    case C_CHAR_16:
-+      fputc_filtered ('u', stream);
-+      break;
-+    case C_CHAR_32:
-+      fputc_filtered ('U', stream);
-+      break;
++      if (TYPE_VOLATILE (domain))
++      fprintf_filtered (stream, " volatile");
 +    }
-+
-   fputc_filtered ('\'', stream);
--  LA_EMIT_CHAR (c, stream, '\'');
-+  LA_EMIT_CHAR (c, type, stream, '\'');
-   fputc_filtered ('\'', stream);
  }
  
-@@ -85,87 +341,206 @@ c_printchar (int c, struct ui_file *stream)
-    printing LENGTH characters, or if FORCE_ELLIPSES.  */
  
- void
--c_printstr (struct ui_file *stream, const gdb_byte *string,
--          unsigned int length, int width, int force_ellipses,
-+c_printstr (struct ui_file *stream, struct type *type, const gdb_byte *string,
-+          unsigned int length, int force_ellipses,
-           const struct value_print_options *options)
- {
-   unsigned int i;
-   unsigned int things_printed = 0;
-   int in_quotes = 0;
-   int need_comma = 0;
-+  int width = TYPE_LENGTH (type);
-+  struct obstack wchar_buf, output;
-+  struct cleanup *cleanup;
-+  enum c_string_type str_type;
-+  const char *encoding;
-+  struct wchar_iterator *iter;
-+  int finished = 0;
-+  int need_escape = 0;
-   /* If the string was not truncated due to `set print elements', and
-      the last byte of it is a null, we don't print that, in traditional C
-      style.  */
-   if (!force_ellipses
-       && length > 0
--      && (extract_unsigned_integer (string + (length - 1) * width, width)
--          == '\0'))
-+      && (extract_unsigned_integer (string + (length - 1) * width, width) == 0))
-     length--;
-+  str_type = classify_type (type, &encoding) & ~C_CHAR;
-+  switch (str_type)
-+    {
-+    case C_STRING:
-+      break;
-+    case C_WIDE_STRING:
-+      fputs_filtered ("L", stream);
-+      break;
-+    case C_STRING_16:
-+      fputs_filtered ("u", stream);
-+      break;
-+    case C_STRING_32:
-+      fputs_filtered ("U", stream);
-+      break;
-+    }
-+
-   if (length == 0)
-     {
-       fputs_filtered ("\"\"", stream);
-       return;
-     }
--  for (i = 0; i < length && things_printed < options->print_max; ++i)
-+  if (length == -1)
-+    {
-+      unsigned long current_char = 1;
-+      for (i = 0; current_char; ++i)
-+      {
-+        QUIT;
-+        current_char = extract_unsigned_integer (string + i * width, width);
-+      }
-+      length = i;
-+    }
-+
-+  /* Arrange to iterate over the characters, in wchar_t form.  */
-+  iter = make_wchar_iterator (string, length * width, encoding, width);
-+  cleanup = make_cleanup_wchar_iterator (iter);
-+
-+  /* WCHAR_BUF is the obstack we use to represent the string in
-+     wchar_t form.  */
-+  obstack_init (&wchar_buf);
-+  make_cleanup_obstack_free (&wchar_buf);
-+
-+  while (!finished && things_printed < options->print_max)
-     {
--      /* Position of the character we are examining
--         to see whether it is repeated.  */
--      unsigned int rep1;
--      /* Number of repetitions we have detected so far.  */
--      unsigned int reps;
--      unsigned long current_char;
-+      int num_chars;
-+      enum wchar_iterate_result result;
-+      wchar_t *chars;
-+      const gdb_byte *buf;
-+      size_t buflen;
-       QUIT;
-       if (need_comma)
-       {
--        fputs_filtered (", ", stream);
-+        obstack_grow_wstr (&wchar_buf, L", ");
-         need_comma = 0;
-       }
--      current_char = extract_unsigned_integer (string + i * width, width);
-+      num_chars = wchar_iterate (iter, &result, &chars, &buf, &buflen);
-+      /* We only look at repetitions when we were able to convert a
-+       single character in isolation.  This makes the code simpler
-+       and probably does the sensible thing in the majority of
-+       cases.  */
-+      while (num_chars == 1)
-+      {
-+        /* Count the number of repetitions.  */
-+        unsigned int reps = 0;
-+        wchar_t current_char = chars[0];
-+        const gdb_byte *orig_buf = buf;
-+        int orig_len = buflen;
--      rep1 = i + 1;
--      reps = 1;
--      while (rep1 < length
--           && extract_unsigned_integer (string + rep1 * width, width)
--           == current_char)
-+        if (need_comma)
-+          {
-+            obstack_grow_wstr (&wchar_buf, L", ");
-+            need_comma = 0;
-+          }
-+
-+        while (num_chars == 1 && current_char == chars[0])
-+          {
-+            num_chars = wchar_iterate (iter, &result, &chars, &buf, &buflen);
-+            ++reps;
-+          }
-+
-+        /* Emit CURRENT_CHAR according to the repetition count and
-+           options.  */
-+        if (reps > options->repeat_count_threshold)
-+          {
-+            if (in_quotes)
-+              {
-+                if (options->inspect_it)
-+                  obstack_grow_wstr (&wchar_buf, L"\\\", ");
-+                else
-+                  obstack_grow_wstr (&wchar_buf, L"\", ");
-+                in_quotes = 0;
-+              }
-+            obstack_grow_wstr (&wchar_buf, L"'");
-+            need_escape = 0;
-+            print_wchar (current_char, orig_buf, orig_len, width,
-+                         &wchar_buf, '\'', &need_escape);
-+            obstack_grow_wstr (&wchar_buf, L"'");
-+            {
-+              /* Painful gyrations.  */
-+              int j;
-+              char *s = xstrprintf (_(" <repeats %u times>"), reps);
-+              for (j = 0; s[j]; ++j)
-+                {
-+                  wchar_t w = btowc (s[j]);
-+                  obstack_grow (&wchar_buf, &w, sizeof (wchar_t));
-+                }
-+              xfree (s);
-+            }
-+            things_printed += options->repeat_count_threshold;
-+            need_comma = 1;
-+          }
-+        else
-+          {
-+            /* Saw the character one or more times, but fewer than
-+               the repetition threshold.  */
-+            if (!in_quotes)
-+              {
-+                if (options->inspect_it)
-+                  obstack_grow_wstr (&wchar_buf, L"\\\"");
-+                else
-+                  obstack_grow_wstr (&wchar_buf, L"\"");
-+                in_quotes = 1;
-+                need_escape = 0;
-+              }
-+
-+            while (reps-- > 0)
-+              {
-+                print_wchar (current_char, orig_buf, orig_len, width,
-+                             &wchar_buf, '"', &need_escape);
-+                ++things_printed;
-+              }
-+          }
-+      }
-+
-+      /* NUM_CHARS and the other outputs from wchar_iterate are valid
-+       here regardless of which branch was taken above.  */
-+      if (num_chars < 0)
-       {
--        ++rep1;
--        ++reps;
-+        /* Hit EOF.  */
-+        finished = 1;
-+        break;
-       }
--      if (reps > options->repeat_count_threshold)
-+      switch (result)
-       {
--        if (in_quotes)
-+      case wchar_iterate_invalid:
-+        if (!in_quotes)
-           {
-             if (options->inspect_it)
--              fputs_filtered ("\\\", ", stream);
-+              obstack_grow_wstr (&wchar_buf, L"\\\"");
-             else
--              fputs_filtered ("\", ", stream);
--            in_quotes = 0;
-+              obstack_grow_wstr (&wchar_buf, L"\"");
-+            in_quotes = 1;
-           }
--        LA_PRINT_CHAR (current_char, stream);
--        fprintf_filtered (stream, _(" <repeats %u times>"), reps);
--        i = rep1 - 1;
--        things_printed += options->repeat_count_threshold;
--        need_comma = 1;
--      }
--      else
--      {
--        if (!in_quotes)
-+        need_escape = 0;
-+        print_wchar (WEOF, buf, buflen, width, &wchar_buf, '"', &need_escape);
-+        break;
-+
-+      case wchar_iterate_incomplete:
-+        if (in_quotes)
-           {
-             if (options->inspect_it)
--              fputs_filtered ("\\\"", stream);
-+              obstack_grow_wstr (&wchar_buf, L"\\\",");
-             else
--              fputs_filtered ("\"", stream);
--            in_quotes = 1;
-+              obstack_grow_wstr (&wchar_buf, L"\",");
-+            in_quotes = 0;
-           }
--        LA_EMIT_CHAR (current_char, stream, '"');
--        ++things_printed;
-+        obstack_grow_wstr (&wchar_buf, L" <incomplete sequence ");
-+        print_wchar (WEOF, buf, buflen, width, &wchar_buf, 0, &need_escape);
-+        obstack_grow_wstr (&wchar_buf, L">");
-+        finished = 1;
-+        break;
-       }
-     }
-@@ -173,13 +548,27 @@ c_printstr (struct ui_file *stream, const gdb_byte *string,
-   if (in_quotes)
-     {
-       if (options->inspect_it)
--      fputs_filtered ("\\\"", stream);
-+      obstack_grow_wstr (&wchar_buf, L"\\\"");
-       else
--      fputs_filtered ("\"", stream);
-+      obstack_grow_wstr (&wchar_buf, L"\"");
-     }
--  if (force_ellipses || i < length)
--    fputs_filtered ("...", stream);
-+  if (force_ellipses || !finished)
-+    obstack_grow_wstr (&wchar_buf, L"...");
-+
-+  /* OUTPUT is where we collect `char's for printing.  */
-+  obstack_init (&output);
-+  make_cleanup_obstack_free (&output);
-+
-+  convert_between_encodings ("wchar_t", host_charset (),
-+                           obstack_base (&wchar_buf),
-+                           obstack_object_size (&wchar_buf),
-+                           1, &output, translit_char);
-+  obstack_1grow (&output, '\0');
-+
-+  fputs_filtered (obstack_base (&output), stream);
-+
-+  do_cleanups (cleanup);
- }
- /* Obtain a C string from the inferior storing it in a newly allocated
-@@ -298,7 +687,285 @@ c_get_string (struct value *value, gdb_byte **buffer, int *length,
- }
\f
--/* Preprocessing and parsing C and C++ expressions.  */
-+/* Evaluating C and C++ expressions.  */
-+
-+/* Convert a UCN.  The digits of the UCN start at P and extend no
-+   farther than LIMIT.  DEST_CHARSET is the name of the character set
-+   into which the UCN should be converted.  The results are written to
-+   OUTPUT.  LENGTH is the maximum length of the UCN, either 4 or 8.
-+   Returns a pointer to just after the final digit of the UCN.  */
-+
-+static char *
-+convert_ucn (char *p, char *limit, const char *dest_charset,
-+           struct obstack *output, int length)
-+{
-+  unsigned long result = 0;
-+  gdb_byte data[4];
-+  int i;
-+
-+  for (i = 0; i < length && p < limit && isxdigit (*p); ++i, ++p)
-+    result = (result << 4) + host_hex_value (*p);
-+
-+  for (i = 3; i >= 0; --i)
-+    {
-+      data[i] = result & 0xff;
-+      result >>= 8;
-+    }
-+
-+  convert_between_encodings ("UCS-4BE", dest_charset, data, 4, 4, output,
-+                           translit_none);
-+
-+  return p;
-+}
-+
-+/* Emit a character, VALUE, which was specified numerically, to
-+   OUTPUT.  TYPE is the target character type.  */
-+
-+static void
-+emit_numeric_character (struct type *type, unsigned long value,
-+                      struct obstack *output)
-+{
-+  gdb_byte *buffer;
-+
-+  buffer = alloca (TYPE_LENGTH (type));
-+  pack_long (buffer, type, value);
-+  obstack_grow (output, buffer, TYPE_LENGTH (type));
-+}
-+
-+/* Convert an octal escape sequence.  TYPE is the target character
-+   type.  The digits of the escape sequence begin at P and extend no
-+   farther than LIMIT.  The result is written to OUTPUT.  Returns a
-+   pointer to just after the final digit of the escape sequence.  */
-+
-+static char *
-+convert_octal (struct type *type, char *p, char *limit, struct obstack *output)
-+{
-+  unsigned long value = 0;
-+
-+  while (p < limit && isdigit (*p) && *p != '8' && *p != '9')
-+    {
-+      value = 8 * value + host_hex_value (*p);
-+      ++p;
-+    }
-+
-+  emit_numeric_character (type, value, output);
-+
-+  return p;
-+}
-+
-+/* Convert a hex escape sequence.  TYPE is the target character type.
-+   The digits of the escape sequence begin at P and extend no farther
-+   than LIMIT.  The result is written to OUTPUT.  Returns a pointer to
-+   just after the final digit of the escape sequence.  */
-+
-+static char *
-+convert_hex (struct type *type, char *p, char *limit, struct obstack *output)
-+{
-+  unsigned long value = 0;
-+
-+  while (p < limit && isxdigit (*p))
-+    {
-+      value = 16 * value + host_hex_value (*p);
-+      ++p;
-+    }
-+
-+  emit_numeric_character (type, value, output);
-+
-+  return p;
-+}
-+
-+#define ADVANCE                                       \
-+  do {                                                \
-+    ++p;                                      \
-+    if (p == limit)                           \
-+      error (_("Malformed escape sequence")); \
-+  } while (0)
-+
-+/* Convert an escape sequence to a target format.  TYPE is the target
-+   character type to use, and DEST_CHARSET is the name of the target
-+   character set.  The backslash of the escape sequence is at *P, and
-+   the escape sequence will not extend past LIMIT.  The results are
-+   written to OUTPUT.  Returns a pointer to just past the final
-+   character of the escape sequence.  */
-+
-+static char *
-+convert_escape (struct type *type, const char *dest_charset,
-+              char *p, char *limit, struct obstack *output)
-+{
-+  /* Skip the backslash.  */
-+  ADVANCE;
-+
-+  switch (*p)
-+    {
-+    case '\\':
-+      obstack_1grow (output, '\\');
-+      ++p;
-+      break;
-+
-+    case 'x':
-+      ADVANCE;
-+      if (!isxdigit (*p))
-+      error (_("\\x used with no following hex digits."));
-+      p = convert_hex (type, p, limit, output);
-+      break;
-+
-+    case '0':
-+    case '1':
-+    case '2':
-+    case '3':
-+    case '4':
-+    case '5':
-+    case '6':
-+    case '7':
-+      p = convert_octal (type, p, limit, output);
-+      break;
-+
-+    case 'u':
-+    case 'U':
-+      {
-+      int length = *p == 'u' ? 4 : 8;
-+      ADVANCE;
-+      if (!isxdigit (*p))
-+        error (_("\\u used with no following hex digits"));
-+      p = convert_ucn (p, limit, dest_charset, output, length);
-+      }
-+    }
-+
-+  return p;
-+}
-+
-+/* Given a single string from a (C-specific) OP_STRING list, convert
-+   it to a target string, handling escape sequences specially.  The
-+   output is written to OUTPUT.  DATA is the input string, which has
-+   length LEN.  DEST_CHARSET is the name of the target character set,
-+   and TYPE is the type of target character to use.  */
-+
-+static void
-+parse_one_string (struct obstack *output, char *data, int len,
-+                const char *dest_charset, struct type *type)
-+{
-+  char *limit;
-+
-+  limit = data + len;
-+
-+  while (data < limit)
-+    {
-+      char *p = data;
-+      /* Look for next escape, or the end of the input.  */
-+      while (p < limit && *p != '\\')
-+      ++p;
-+      /* If we saw a run of characters, convert them all.  */
-+      if (p > data)
-+      convert_between_encodings (host_charset (), dest_charset,
-+                                 data, p - data, 1, output, translit_none);
-+      /* If we saw an escape, convert it.  */
-+      if (p < limit)
-+      p = convert_escape (type, dest_charset, p, limit, output);
-+      data = p;
-+    }
-+}
-+
-+/* Expression evaluator for the C language family.  Most operations
-+   are delegated to evaluate_subexp_standard; see that function for a
-+   description of the arguments.  */
-+
-+static struct value *
-+evaluate_subexp_c (struct type *expect_type, struct expression *exp,
-+                 int *pos, enum noside noside)
-+{
-+  enum exp_opcode op = exp->elts[*pos].opcode;
-+
-+  switch (op)
-+    {
-+    case OP_STRING:
-+      {
-+      int oplen, limit;
-+      struct type *type;
-+      struct obstack output;
-+      struct cleanup *cleanup;
-+      struct value *result;
-+      enum c_string_type dest_type;
-+      const char *dest_charset;
-+
-+      obstack_init (&output);
-+      cleanup = make_cleanup_obstack_free (&output);
-+
-+      ++*pos;
-+      oplen = longest_to_int (exp->elts[*pos].longconst);
-+
-+      ++*pos;
-+      limit = *pos + BYTES_TO_EXP_ELEM (oplen + 1);
-+      dest_type
-+        = (enum c_string_type) longest_to_int (exp->elts[*pos].longconst);
-+      switch (dest_type & ~C_CHAR)
-+        {
-+        case C_STRING:
-+          type = language_string_char_type (current_language,
-+                                            current_gdbarch);
-+          break;
-+        case C_WIDE_STRING:
-+          type = lookup_typename ("wchar_t", NULL, 0);
-+          break;
-+        case C_STRING_16:
-+          type = lookup_typename ("char16_t", NULL, 0);
-+          break;
-+        case C_STRING_32:
-+          type = lookup_typename ("char32_t", NULL, 0);
-+          break;
-+        default:
-+          internal_error (__FILE__, __LINE__, "unhandled c_string_type");
-+        }
-+      dest_charset = charset_for_string_type (dest_type);
-+
-+      ++*pos;
-+      while (*pos < limit)
-+        {
-+          int len;
-+
-+          len = longest_to_int (exp->elts[*pos].longconst);
-+
-+          ++*pos;
-+          if (noside != EVAL_SKIP)
-+            parse_one_string (&output, &exp->elts[*pos].string, len,
-+                              dest_charset, type);
-+          *pos += BYTES_TO_EXP_ELEM (len);
-+        }
-+
-+      /* Skip the trailing length and opcode.  */
-+      *pos += 2;
-+
-+      if (noside == EVAL_SKIP)
-+        return NULL;
-+
-+      if ((dest_type & C_CHAR) != 0)
-+        {
-+          LONGEST value;
-+
-+          if (obstack_object_size (&output) != TYPE_LENGTH (type))
-+            error (_("Could not convert character constant to target character set"));
-+          value = unpack_long (type, obstack_base (&output));
-+          result = value_from_longest (type, value);
-+        }
-+      else
-+        {
-+          int i;
-+          /* Write the terminating character.  */
-+          for (i = 0; i < TYPE_LENGTH (type); ++i)
-+            obstack_1grow (&output, 0);
-+          result = value_typed_string (obstack_base (&output),
-+                                       obstack_object_size (&output),
-+                                       type);
-+        }
-+      do_cleanups (cleanup);
-+      return result;
-+      }
-+      break;
-+
-+    default:
-+      break;
-+    }
-+  return evaluate_subexp_standard (expect_type, exp, pos, noside);
-+}
\f
-@@ -396,6 +1063,15 @@ c_language_arch_info (struct gdbarch *gdbarch,
-   lai->bool_type_default = builtin->builtin_int;
- }
-+static const struct exp_descriptor exp_descriptor_c = 
-+{
-+  print_subexp_standard,
-+  operator_length_standard,
-+  op_name_standard,
-+  dump_subexp_body_standard,
-+  evaluate_subexp_c
-+};
-+
- const struct language_defn c_language_defn =
- {
-   "c",                                /* Language name */
-@@ -405,7 +1081,7 @@ const struct language_defn c_language_defn =
-   case_sensitive_on,
-   array_row_major,
-   macro_expansion_c,
--  &exp_descriptor_standard,
-+  &exp_descriptor_c,
-   c_parse,
-   c_error,
-   null_post_parser,
-@@ -524,7 +1200,7 @@ const struct language_defn cplus_language_defn =
-   case_sensitive_on,
-   array_row_major,
-   macro_expansion_c,
--  &exp_descriptor_standard,
-+  &exp_descriptor_c,
-   c_parse,
-   c_error,
-   null_post_parser,
-@@ -562,7 +1238,7 @@ const struct language_defn asm_language_defn =
-   case_sensitive_on,
-   array_row_major,
-   macro_expansion_c,
--  &exp_descriptor_standard,
-+  &exp_descriptor_c,
-   c_parse,
-   c_error,
-   null_post_parser,
-@@ -605,7 +1281,7 @@ const struct language_defn minimal_language_defn =
-   case_sensitive_on,
-   array_row_major,
-   macro_expansion_c,
--  &exp_descriptor_standard,
-+  &exp_descriptor_c,
-   c_parse,
-   c_error,
-   null_post_parser,
-diff --git a/gdb/c-lang.h b/gdb/c-lang.h
-index 06c5767..ba9d996 100644
---- a/gdb/c-lang.h
-+++ b/gdb/c-lang.h
-@@ -29,9 +29,38 @@ struct language_arch_info;
- #include "macroexp.h"
--extern int c_parse (void);    /* Defined in c-exp.y */
--
--extern void c_error (char *); /* Defined in c-exp.y */
-+/* The various kinds of C string and character.  Note that these
-+   values are chosen so that they may be or'd together in certain
-+   ways.  */
-+enum c_string_type
-+  {
-+    /* An ordinary string: "value".  */
-+    C_STRING = 0,
-+    /* A wide string: L"value".  */
-+    C_WIDE_STRING = 1,
-+    /* A 16-bit Unicode string: u"value".  */
-+    C_STRING_16 = 2,
-+    /* A 32-bit Unicode string: U"value".  */
-+    C_STRING_32 = 3,
-+    /* An ordinary char: 'v'.  This can also be or'd with one of the
-+       above to form the corresponding CHAR value from a STRING
-+       value.  */
-+    C_CHAR = 4,
-+    /* A wide char: L'v'.  */
-+    C_WIDE_CHAR = 5,
-+    /* A 16-bit Unicode char: u'v'.  */
-+    C_CHAR_16 = 6,
-+    /* A 32-bit Unicode char: U'v'.  */
-+    C_CHAR_32 = 7
-+  };
-+
-+/* Defined in c-exp.y.  */
-+
-+extern int c_parse (void);
-+
-+extern void c_error (char *);
-+
-+extern int c_parse_escape (char **, struct obstack *);
- /* Defined in c-typeprint.c */
- extern void c_print_type (struct type *, char *, struct ui_file *, int,
-@@ -48,10 +77,10 @@ extern int c_value_print (struct value *, struct ui_file *,
- /* These are in c-lang.c: */
--extern void c_printchar (int, struct ui_file *);
-+extern void c_printchar (int, struct type *, struct ui_file *);
--extern void c_printstr (struct ui_file * stream, const gdb_byte *string,
--                      unsigned int length, int width,
-+extern void c_printstr (struct ui_file * stream, struct type *elttype,
-+                      const gdb_byte *string, unsigned int length,
-                       int force_ellipses,
-                       const struct value_print_options *options);
-diff --git a/gdb/c-typeprint.c b/gdb/c-typeprint.c
-index 0929516..c005fe4 100644
---- a/gdb/c-typeprint.c
-+++ b/gdb/c-typeprint.c
-@@ -40,8 +40,6 @@ static void cp_type_print_method_args (struct type *mtype, char *prefix,
-                                      char *varstring, int staticp,
-                                      struct ui_file *stream);
--static void c_type_print_args (struct type *, struct ui_file *);
--
- static void cp_type_print_derivation_info (struct ui_file *, struct type *);
- static void c_type_print_varspec_prefix (struct type *, struct ui_file *, int,
-@@ -199,6 +197,23 @@ cp_type_print_method_args (struct type *mtype, char *prefix, char *varstring,
-     fprintf_filtered (stream, "void");
-   fprintf_filtered (stream, ")");
-+
-+  /* For non-static methods, read qualifiers from the type of
-+     THIS.  */
-+  if (!staticp)
-+    {
-+      struct type *domain;
-+
-+      gdb_assert (nargs > 0);
-+      gdb_assert (TYPE_CODE (args[0].type) == TYPE_CODE_PTR);
-+      domain = TYPE_TARGET_TYPE (args[0].type);
-+
-+      if (TYPE_CONST (domain))
-+      fprintf_filtered (stream, " const");
-+
-+      if (TYPE_VOLATILE (domain))
-+      fprintf_filtered (stream, " volatile");
-+    }
- }
-@@ -354,10 +369,12 @@ c_type_print_modifier (struct type *type, struct ui_file *stream,
+@@ -355,10 +371,14 @@ c_type_print_modifier (struct type *type, struct ui_file *stream,
  
  /* Print out the arguments of TYPE, which should have TYPE_CODE_METHOD
     or TYPE_CODE_FUNC, to STREAM.  Artificial arguments, such as "this"
 -   in non-static methods, are displayed.  */
 +   in non-static methods, are displayed if SHOW_ARTIFICIAL is
-+   non-zero.  */
++   non-zero. LANGUAGE is the language in which TYPE was defined.  This is
++   a necessary evil since this code is used by the C, C++, and Java
++   backends. */
  
 -static void
 -c_type_print_args (struct type *type, struct ui_file *stream)
 +void
 +c_type_print_args (struct type *type, struct ui_file *stream,
-+                 int show_artificial)
++                 int show_artificial, enum language language)
  {
    int i, len;
    struct field *args;
-@@ -369,6 +386,9 @@ c_type_print_args (struct type *type, struct ui_file *stream)
+@@ -370,13 +390,19 @@ c_type_print_args (struct type *type, struct ui_file *stream)
  
    for (i = 0; i < TYPE_NFIELDS (type); i++)
      {
@@ -7387,7 +2440,18 @@ index 0929516..c005fe4 100644
        if (printed_any)
        {
          fprintf_filtered (stream, ", ");
-@@ -559,7 +579,12 @@ c_type_print_varspec_suffix (struct type *type, struct ui_file *stream,
+         wrap_here ("    ");
+       }
+-      c_print_type (TYPE_FIELD_TYPE (type, i), "", stream, -1, 0);
++      if (language == language_java)
++      java_print_type (TYPE_FIELD_TYPE (type, i), "", stream, -1, 0);
++      else
++      c_print_type (TYPE_FIELD_TYPE (type, i), "", stream, -1, 0);
+       printed_any = 1;
+     }
+@@ -560,7 +586,12 @@ c_type_print_varspec_suffix (struct type *type, struct ui_file *stream,
        fprintf_filtered (stream, ")");
  
        fprintf_filtered (stream, "[");
@@ -7401,251 +2465,207 @@ index 0929516..c005fe4 100644
        && !TYPE_ARRAY_UPPER_BOUND_IS_UNDEFINED (type))
        fprintf_filtered (stream, "%d",
                          (TYPE_LENGTH (type)
-@@ -592,7 +617,7 @@ c_type_print_varspec_suffix (struct type *type, struct ui_file *stream,
+@@ -593,7 +624,7 @@ c_type_print_varspec_suffix (struct type *type, struct ui_file *stream,
        if (passed_a_ptr)
        fprintf_filtered (stream, ")");
        if (!demangled_args)
 -      c_type_print_args (type, stream);
-+      c_type_print_args (type, stream, 1);
++      c_type_print_args (type, stream, 1, language_c);
        c_type_print_varspec_suffix (TYPE_TARGET_TYPE (type), stream, show,
                                   passed_a_ptr, 0);
        break;
-diff --git a/gdb/c-valprint.c b/gdb/c-valprint.c
-index 0b616f7..3433da2 100644
---- a/gdb/c-valprint.c
-+++ b/gdb/c-valprint.c
-@@ -55,6 +55,18 @@ print_function_pointer_address (CORE_ADDR address, struct ui_file *stream,
- }
+diff --git a/gdb/cli/cli-cmds.c b/gdb/cli/cli-cmds.c
+index ce7c2a6..6380fec 100644
+--- a/gdb/cli/cli-cmds.c
++++ b/gdb/cli/cli-cmds.c
+@@ -46,6 +46,8 @@
+ #include "cli/cli-setshow.h"
+ #include "cli/cli-cmds.h"
  
-+/* A helper for textual_element_type.  This checks the name of the
-+   typedef.  This is bogus but it isn't apparent that the compiler
-+   provides us the help we may need.  */
++#include "python/python.h"
 +
-+static int
-+textual_name (const char *name)
-+{
-+  return (!strcmp (name, "wchar_t")
-+        || !strcmp (name, "char16_t")
-+        || !strcmp (name, "char32_t"));
-+}
-+
- /* Apply a heuristic to decide whether an array of TYPE or a pointer
-    to TYPE should be printed as a textual string.  Return non-zero if
-    it should, or zero if it should be treated as an array of integers
-@@ -77,6 +89,15 @@ textual_element_type (struct type *type, char format)
-   /* TYPE_CODE_CHAR is always textual.  */
-   if (TYPE_CODE (true_type) == TYPE_CODE_CHAR)
-     return 1;
-+  /* Any other character-like types must be integral.  */
-+  if (TYPE_CODE (true_type) != TYPE_CODE_INT)
-+    return 0;
-+
-+  /* Check the names of the type and the typedef.  */
-+  if (TYPE_NAME (type) && textual_name (TYPE_NAME (type)))
-+    return 1;
-+  if (TYPE_NAME (true_type) && textual_name (TYPE_NAME (true_type)))
-+    return 1;
+ #ifdef TUI
+ #include "tui/tui.h"          /* For tui_active et.al.   */
+ #endif
+@@ -183,6 +185,7 @@ struct cmd_list_element *showchecklist;
  
-   if (format == 's')
-     {
-@@ -115,7 +136,8 @@ c_val_print (struct type *type, const gdb_byte *valaddr, int embedded_offset,
- {
-   unsigned int i = 0; /* Number of characters printed */
-   unsigned len;
--  struct type *elttype;
-+  struct type *elttype, *unresolved_elttype;
-+  struct type *unresolved_type = type;
-   unsigned eltlen;
-   LONGEST val;
-   CORE_ADDR addr;
-@@ -124,8 +146,9 @@ c_val_print (struct type *type, const gdb_byte *valaddr, int embedded_offset,
-   switch (TYPE_CODE (type))
-     {
-     case TYPE_CODE_ARRAY:
--      elttype = check_typedef (TYPE_TARGET_TYPE (type));
--      if (TYPE_LENGTH (type) > 0 && TYPE_LENGTH (TYPE_TARGET_TYPE (type)) > 0)
-+      unresolved_elttype = TYPE_TARGET_TYPE (type);
-+      elttype = check_typedef (unresolved_elttype);
-+      if (TYPE_LENGTH (type) > 0 && TYPE_LENGTH (unresolved_elttype) > 0)
-       {
-         eltlen = TYPE_LENGTH (elttype);
-         len = TYPE_LENGTH (type) / eltlen;
-@@ -135,7 +158,7 @@ c_val_print (struct type *type, const gdb_byte *valaddr, int embedded_offset,
-           }
+ /* Command tracing state.  */
  
-         /* Print arrays of textual chars with a string syntax.  */
--          if (textual_element_type (elttype, options->format))
-+          if (textual_element_type (unresolved_elttype, options->format))
-           {
-             /* If requested, look for the first null char and only print
-                elements up to it.  */
-@@ -143,15 +166,19 @@ c_val_print (struct type *type, const gdb_byte *valaddr, int embedded_offset,
-               {
-                 unsigned int temp_len;
--                /* Look for a NULL char. */
-                 for (temp_len = 0;
--                     (valaddr + embedded_offset)[temp_len]
--                     && temp_len < len && temp_len < options->print_max;
--                     temp_len++);
-+                     (temp_len < len
-+                      && temp_len < options->print_max
-+                      && extract_unsigned_integer (valaddr + embedded_offset
-+                                                   + temp_len * eltlen,
-+                                                   eltlen) == 0);
-+                     ++temp_len)
-+                  ;
-                 len = temp_len;
-               }
++static int source_python = 0;
+ int source_verbose = 0;
+ int trace_commands = 0;
\f
+@@ -444,6 +447,7 @@ source_script (char *file, int from_tty)
+   struct cleanup *old_cleanups;
+   char *full_pathname = NULL;
+   int fd;
++  int is_python;
  
--            LA_PRINT_STRING (stream, valaddr + embedded_offset, len, eltlen, 0, options);
-+            LA_PRINT_STRING (stream, unresolved_elttype,
-+                             valaddr + embedded_offset, len, 0, options);
-             i = len;
-           }
-         else
-@@ -209,7 +236,8 @@ c_val_print (struct type *type, const gdb_byte *valaddr, int embedded_offset,
-         print_function_pointer_address (addr, stream, options->addressprint);
-         break;
+   if (file == NULL || *file == 0)
+     {
+@@ -476,8 +480,16 @@ source_script (char *file, int from_tty)
        }
--      elttype = check_typedef (TYPE_TARGET_TYPE (type));
-+      unresolved_elttype = TYPE_TARGET_TYPE (type);
-+      elttype = check_typedef (unresolved_elttype);
-       {
-         addr = unpack_pointer (type, valaddr + embedded_offset);
-       print_unpacked_pointer:
-@@ -228,12 +256,11 @@ c_val_print (struct type *type, const gdb_byte *valaddr, int embedded_offset,
+     }
  
-         /* For a pointer to a textual type, also print the string
-            pointed to, unless pointer is null.  */
--        /* FIXME: need to handle wchar_t here... */
++  is_python = source_python;
++  if (strlen (file) > 3 && !strcmp (&file[strlen (file) - 3], ".py"))
++    is_python = 1;
++
+   stream = fdopen (fd, FOPEN_RT);
+-  script_from_file (stream, file);
++
++  if (is_python)
++    source_python_script (stream, file);
++  else
++    script_from_file (stream, file);
  
--        if (textual_element_type (elttype, options->format)
-+        if (textual_element_type (unresolved_elttype, options->format)
-             && addr != 0)
-           {
--            i = val_print_string (addr, -1, TYPE_LENGTH (elttype), stream,
-+            i = val_print_string (unresolved_elttype, addr, -1, stream,
-                                   options);
-           }
-         else if (cp_is_vtbl_member (type))
-@@ -268,7 +295,7 @@ c_val_print (struct type *type, const gdb_byte *valaddr, int embedded_offset,
-                   }
-                 else
-                   {
--                    wtype = TYPE_TARGET_TYPE (type);
-+                    wtype = unresolved_elttype;
-                   }
-                 vt_val = value_at (wtype, vt_address);
-                 common_val_print (vt_val, stream, recurse + 1, options,
-@@ -442,11 +469,11 @@ c_val_print (struct type *type, const gdb_byte *valaddr, int embedded_offset,
-            Since we don't know whether the value is really intended to
-            be used as an integer or a character, print the character
-            equivalent as well.  */
--        if (textual_element_type (type, options->format))
-+        if (textual_element_type (unresolved_type, options->format))
-           {
-             fputs_filtered (" ", stream);
-             LA_PRINT_CHAR ((unsigned char) unpack_long (type, valaddr + embedded_offset),
--                           stream);
-+                           unresolved_type, stream);
-           }
-       }
-       break;
-@@ -468,7 +495,7 @@ c_val_print (struct type *type, const gdb_byte *valaddr, int embedded_offset,
-         else
-           fprintf_filtered (stream, "%d", (int) val);
-         fputs_filtered (" ", stream);
--        LA_PRINT_CHAR ((unsigned char) val, stream);
-+        LA_PRINT_CHAR ((unsigned char) val, unresolved_type, stream);
-       }
-       break;
+   do_cleanups (old_cleanups);
+ }
+@@ -491,15 +503,30 @@ source_verbose_cleanup (void *old_value)
+   xfree (old_value);
+ }
  
-@@ -540,7 +567,7 @@ int
- c_value_print (struct value *val, struct ui_file *stream, 
-              const struct value_print_options *options)
++/* A helper for source_command.  Look for an argument in *ARGS.
++   Update *ARGS by stripping leading whitespace.  If an argument is
++   found, return it (a character).  Otherwise, return 0.  */
++static int
++find_argument (char **args)
++{
++  int result = 0;
++  while (isspace ((*args)[0]))
++    ++*args;
++  if ((*args)[0] == '-' && isalpha ((*args)[1]))
++    {
++      result = (*args)[1];
++      *args += 3;
++    }
++  return result;
++}
++
+ static void
+ source_command (char *args, int from_tty)
  {
--  struct type *type, *real_type;
-+  struct type *type, *real_type, *val_type;
-   int full, top, using_enc;
-   struct value_print_options opts = *options;
-@@ -553,7 +580,11 @@ c_value_print (struct value *val, struct ui_file *stream,
-      C++: if it is a member pointer, we will take care
-      of that when we print it.  */
--  type = check_typedef (value_type (val));
-+  /* Preserve the original type before stripping typedefs.  We prefer
-+     to pass down the original type when possible, but for local
-+     checks it is better to look past the typedefs.  */
-+  val_type = value_type (val);
-+  type = check_typedef (val_type);
-   if (TYPE_CODE (type) == TYPE_CODE_PTR
-       || TYPE_CODE (type) == TYPE_CODE_REF)
-@@ -561,11 +592,12 @@ c_value_print (struct value *val, struct ui_file *stream,
-       /* Hack:  remove (char *) for char strings.  Their
-          type is indicated by the quoted string anyway.
-          (Don't use textual_element_type here; quoted strings
--         are always exactly (char *).  */
--      if (TYPE_CODE (type) == TYPE_CODE_PTR
--        && TYPE_NAME (type) == NULL
--        && TYPE_NAME (TYPE_TARGET_TYPE (type)) != NULL
--        && strcmp (TYPE_NAME (TYPE_TARGET_TYPE (type)), "char") == 0)
-+         are always exactly (char *), (wchar_t *), or the like.  */
-+      if (TYPE_CODE (val_type) == TYPE_CODE_PTR
-+        && TYPE_NAME (val_type) == NULL
-+        && TYPE_NAME (TYPE_TARGET_TYPE (val_type)) != NULL
-+        && (strcmp (TYPE_NAME (TYPE_TARGET_TYPE (val_type)), "char") == 0
-+            || textual_name (TYPE_NAME (TYPE_TARGET_TYPE (val_type)))))
-       {
-         /* Print nothing */
-       }
-@@ -608,6 +640,7 @@ c_value_print (struct value *val, struct ui_file *stream,
-             }
-           type_print (type, "", stream, -1);
-         fprintf_filtered (stream, ") ");
-+        val_type = type;
-       }
-       else
+   struct cleanup *old_cleanups;
+-  char *file = args;
+-  int *old_source_verbose = xmalloc (sizeof(int));
+-  *old_source_verbose = source_verbose;
+-  old_cleanups = make_cleanup (source_verbose_cleanup, old_source_verbose);
++  old_cleanups = make_cleanup_restore_integer (&source_verbose);
++  make_cleanup_restore_integer (&source_python);
+   /* -v causes the source command to run in verbose mode.
+      We still have to be able to handle filenames with spaces in a
+@@ -507,23 +534,28 @@ source_command (char *args, int from_tty)
+   if (args)
+     {
+-      /* Make sure leading white space does not break the comparisons.  */
+-      while (isspace(args[0]))
+-      args++;
+-
+-      /* Is -v the first thing in the string?  */
+-      if (args[0] == '-' && args[1] == 'v' && isspace (args[2]))
++      while (1)
        {
-@@ -635,7 +668,7 @@ c_value_print (struct value *val, struct ui_file *stream,
-         /* Print out object: enclosing type is same as real_type if full */
-         return val_print (value_enclosing_type (val),
-                           value_contents_all (val), 0,
--                          VALUE_ADDRESS (val), stream, 0,
-+                          value_address (val), stream, 0,
-                           &opts, current_language);
-           /* Note: When we look up RTTI entries, we don't get any information on
-              const or volatile attributes */
-@@ -647,14 +680,14 @@ c_value_print (struct value *val, struct ui_file *stream,
-                           TYPE_NAME (value_enclosing_type (val)));
-         return val_print (value_enclosing_type (val),
-                           value_contents_all (val), 0,
--                          VALUE_ADDRESS (val), stream, 0,
-+                          value_address (val), stream, 0,
-                           &opts, current_language);
+-        source_verbose = 1;
+-
+-        /* Trim -v and whitespace from the filename.  */
+-        file = &args[3];
+-        while (isspace (file[0]))
+-          file++;
++        int arg = find_argument (&args);
++        if (!arg)
++          break;
++        switch (arg)
++          {
++          case 'v':
++            source_verbose = 1;
++            break;
++          case 'p':
++            source_python = 1;
++            break;
++          default:
++            error (_("unrecognized option -%c"), arg);
++          }
        }
-       /* Otherwise, we end up at the return outside this "if" */
      }
  
--  return val_print (type, value_contents_all (val),
-+  return val_print (val_type, value_contents_all (val),
-                   value_embedded_offset (val),
--                  VALUE_ADDRESS (val) + value_offset (val),
-+                  value_address (val),
-                   stream, 0, &opts, current_language);
+-  source_script (file, from_tty);
++  source_script (args, from_tty);
++
++  do_cleanups (old_cleanups);
  }
-diff --git a/gdb/charset-list.h b/gdb/charset-list.h
+@@ -1307,7 +1339,9 @@ Read commands from a file named FILE.\n\
+ Optional -v switch (before the filename) causes each command in\n\
+ FILE to be echoed as it is executed.\n\
+ Note that the file \"%s\" is read automatically in this way\n\
+-when GDB is started."), gdbinit);
++when GDB is started.\n\
++Optional -p switch (before the filename) causes FILE to be evaluated\n\
++as Python code."), gdbinit);
+   c = add_cmd ("source", class_support, source_command,
+              source_help_text, &cmdlist);
+   set_cmd_completer (c, filename_completer);
+diff --git a/gdb/coffread.c b/gdb/coffread.c
+index 888f8b4..65494b8 100644
+--- a/gdb/coffread.c
++++ b/gdb/coffread.c
+@@ -346,7 +346,7 @@ coff_alloc_type (int index)
+      We will fill it in later if we find out how.  */
+   if (type == NULL)
+     {
+-      type = alloc_type (current_objfile);
++      type = alloc_type (current_objfile, NULL);
+       *type_addr = type;
+     }
+   return type;
+@@ -2121,6 +2121,7 @@ static struct sym_fns coff_sym_fns =
+   coff_new_init,              /* sym_new_init: init anything gbl to entire symtab */
+   coff_symfile_init,          /* sym_init: read initial info, setup for sym_read() */
+   coff_symfile_read,          /* sym_read: read a symbol file into symtab */
++  NULL,                               /* sym_read_psymbols */
+   coff_symfile_finish,                /* sym_finish: finished with file, cleanup */
+   default_symfile_offsets,    /* sym_offsets:  xlate external to internal form */
+   default_symfile_segments,   /* sym_segments: Get segment information from
+diff --git a/gdb/config.in b/gdb/config.in
+index 4716524..0745c65 100644
+--- a/gdb/config.in
++++ b/gdb/config.in
+@@ -46,11 +46,10 @@
+    language is requested. */
+ #undef ENABLE_NLS
+-/* look for global separate data files in this path [DATADIR/gdb] */
++/* Global directory for GDB data files. */
+ #undef GDB_DATADIR
+-/* Define if the gdb-datadir directory should be relocated when GDB is moved.
+-   */
++/* Define if GDB datadir should be relocated when GDB is moved. */
+ #undef GDB_DATADIR_RELOCATABLE
+ /* Define to be a string naming the default host character set. */
+@@ -647,6 +646,9 @@
+    'ptrdiff_t'. */
+ #undef PTRDIFF_T_SUFFIX
++/* Define to install path for Python sources */
++#undef PYTHONDIR
++
+ /* Relocated directory for source files. */
+ #undef RELOC_SRCDIR
+diff --git a/gdb/config/i386/nm-i386.h b/gdb/config/i386/nm-i386.h
 new file mode 100644
-index 0000000..59c64c5
+index 0000000..5f237cc
 --- /dev/null
-+++ b/gdb/charset-list.h
-@@ -0,0 +1,1190 @@
-+/* List of character set names for GDB.
-+
-+   Copyright (C) 2009 Free Software Foundation, Inc.
++++ b/gdb/config/i386/nm-i386.h
+@@ -0,0 +1,125 @@
++/* Native macro definitions for GDB on an Intel i[3456]86.
++   Copyright 2001, 2004, 2007, 2008, 2009 Free Software Foundation, Inc.
 +
 +   This file is part of GDB.
 +
@@ -7662,3315 +2682,269 @@ index 0000000..59c64c5
 +   You should have received a copy of the GNU General Public License
 +   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 +
-+/* Note that the first entry must always be "auto".
-+   The remaining entries were created by running this script:
-+   
-+   iconv -l | sed -e '/[/]...*$/d' -e 's@^\(.*\)//$@"\1", \\@'
-+   
-+   .. and then removing the final backslash.  It would be nice to
-+   separate narrow and wide character sets, but there is no good way
-+   to do that.  */
-+#define DEFAULT_CHARSET_NAMES \
-+"auto", \
-+"437", \
-+"500", \
-+"500V1", \
-+"850", \
-+"851", \
-+"852", \
-+"855", \
-+"856", \
-+"857", \
-+"860", \
-+"861", \
-+"862", \
-+"863", \
-+"864", \
-+"865", \
-+"866", \
-+"866NAV", \
-+"869", \
-+"874", \
-+"904", \
-+"1026", \
-+"1046", \
-+"1047", \
-+"8859_1", \
-+"8859_2", \
-+"8859_3", \
-+"8859_4", \
-+"8859_5", \
-+"8859_6", \
-+"8859_7", \
-+"8859_8", \
-+"8859_9", \
-+"10646-1:1993", \
-+"ANSI_X3.4-1968", \
-+"ANSI_X3.4-1986", \
-+"ANSI_X3.4", \
-+"ANSI_X3.110-1983", \
-+"ANSI_X3.110", \
-+"ARABIC", \
-+"ARABIC7", \
-+"ARMSCII-8", \
-+"ASCII", \
-+"ASMO-708", \
-+"ASMO_449", \
-+"BALTIC", \
-+"BIG-5", \
-+"BIG-FIVE", \
-+"BIG5-HKSCS", \
-+"BIG5", \
-+"BIG5HKSCS", \
-+"BIGFIVE", \
-+"BRF", \
-+"BS_4730", \
-+"CA", \
-+"CN-BIG5", \
-+"CN-GB", \
-+"CN", \
-+"CP-AR", \
-+"CP-GR", \
-+"CP-HU", \
-+"CP037", \
-+"CP038", \
-+"CP273", \
-+"CP274", \
-+"CP275", \
-+"CP278", \
-+"CP280", \
-+"CP281", \
-+"CP282", \
-+"CP284", \
-+"CP285", \
-+"CP290", \
-+"CP297", \
-+"CP367", \
-+"CP420", \
-+"CP423", \
-+"CP424", \
-+"CP437", \
-+"CP500", \
-+"CP737", \
-+"CP775", \
-+"CP803", \
-+"CP813", \
-+"CP819", \
-+"CP850", \
-+"CP851", \
-+"CP852", \
-+"CP855", \
-+"CP856", \
-+"CP857", \
-+"CP860", \
-+"CP861", \
-+"CP862", \
-+"CP863", \
-+"CP864", \
-+"CP865", \
-+"CP866", \
-+"CP866NAV", \
-+"CP868", \
-+"CP869", \
-+"CP870", \
-+"CP871", \
-+"CP874", \
-+"CP875", \
-+"CP880", \
-+"CP891", \
-+"CP901", \
-+"CP902", \
-+"CP903", \
-+"CP904", \
-+"CP905", \
-+"CP912", \
-+"CP915", \
-+"CP916", \
-+"CP918", \
-+"CP920", \
-+"CP921", \
-+"CP922", \
-+"CP930", \
-+"CP932", \
-+"CP933", \
-+"CP935", \
-+"CP936", \
-+"CP937", \
-+"CP939", \
-+"CP949", \
-+"CP950", \
-+"CP1004", \
-+"CP1008", \
-+"CP1025", \
-+"CP1026", \
-+"CP1046", \
-+"CP1047", \
-+"CP1070", \
-+"CP1079", \
-+"CP1081", \
-+"CP1084", \
-+"CP1089", \
-+"CP1097", \
-+"CP1112", \
-+"CP1122", \
-+"CP1123", \
-+"CP1124", \
-+"CP1125", \
-+"CP1129", \
-+"CP1130", \
-+"CP1132", \
-+"CP1133", \
-+"CP1137", \
-+"CP1140", \
-+"CP1141", \
-+"CP1142", \
-+"CP1143", \
-+"CP1144", \
-+"CP1145", \
-+"CP1146", \
-+"CP1147", \
-+"CP1148", \
-+"CP1149", \
-+"CP1153", \
-+"CP1154", \
-+"CP1155", \
-+"CP1156", \
-+"CP1157", \
-+"CP1158", \
-+"CP1160", \
-+"CP1161", \
-+"CP1162", \
-+"CP1163", \
-+"CP1164", \
-+"CP1166", \
-+"CP1167", \
-+"CP1250", \
-+"CP1251", \
-+"CP1252", \
-+"CP1253", \
-+"CP1254", \
-+"CP1255", \
-+"CP1256", \
-+"CP1257", \
-+"CP1258", \
-+"CP1282", \
-+"CP1361", \
-+"CP1364", \
-+"CP1371", \
-+"CP1388", \
-+"CP1390", \
-+"CP1399", \
-+"CP4517", \
-+"CP4899", \
-+"CP4909", \
-+"CP4971", \
-+"CP5347", \
-+"CP9030", \
-+"CP9066", \
-+"CP9448", \
-+"CP10007", \
-+"CP12712", \
-+"CP16804", \
-+"CPIBM861", \
-+"CSA7-1", \
-+"CSA7-2", \
-+"CSASCII", \
-+"CSA_T500-1983", \
-+"CSA_T500", \
-+"CSA_Z243.4-1985-1", \
-+"CSA_Z243.4-1985-2", \
-+"CSA_Z243.419851", \
-+"CSA_Z243.419852", \
-+"CSDECMCS", \
-+"CSEBCDICATDE", \
-+"CSEBCDICATDEA", \
-+"CSEBCDICCAFR", \
-+"CSEBCDICDKNO", \
-+"CSEBCDICDKNOA", \
-+"CSEBCDICES", \
-+"CSEBCDICESA", \
-+"CSEBCDICESS", \
-+"CSEBCDICFISE", \
-+"CSEBCDICFISEA", \
-+"CSEBCDICFR", \
-+"CSEBCDICIT", \
-+"CSEBCDICPT", \
-+"CSEBCDICUK", \
-+"CSEBCDICUS", \
-+"CSEUCKR", \
-+"CSEUCPKDFMTJAPANESE", \
-+"CSGB2312", \
-+"CSHPROMAN8", \
-+"CSIBM037", \
-+"CSIBM038", \
-+"CSIBM273", \
-+"CSIBM274", \
-+"CSIBM275", \
-+"CSIBM277", \
-+"CSIBM278", \
-+"CSIBM280", \
-+"CSIBM281", \
-+"CSIBM284", \
-+"CSIBM285", \
-+"CSIBM290", \
-+"CSIBM297", \
-+"CSIBM420", \
-+"CSIBM423", \
-+"CSIBM424", \
-+"CSIBM500", \
-+"CSIBM803", \
-+"CSIBM851", \
-+"CSIBM855", \
-+"CSIBM856", \
-+"CSIBM857", \
-+"CSIBM860", \
-+"CSIBM863", \
-+"CSIBM864", \
-+"CSIBM865", \
-+"CSIBM866", \
-+"CSIBM868", \
-+"CSIBM869", \
-+"CSIBM870", \
-+"CSIBM871", \
-+"CSIBM880", \
-+"CSIBM891", \
-+"CSIBM901", \
-+"CSIBM902", \
-+"CSIBM903", \
-+"CSIBM904", \
-+"CSIBM905", \
-+"CSIBM918", \
-+"CSIBM921", \
-+"CSIBM922", \
-+"CSIBM930", \
-+"CSIBM932", \
-+"CSIBM933", \
-+"CSIBM935", \
-+"CSIBM937", \
-+"CSIBM939", \
-+"CSIBM943", \
-+"CSIBM1008", \
-+"CSIBM1025", \
-+"CSIBM1026", \
-+"CSIBM1097", \
-+"CSIBM1112", \
-+"CSIBM1122", \
-+"CSIBM1123", \
-+"CSIBM1124", \
-+"CSIBM1129", \
-+"CSIBM1130", \
-+"CSIBM1132", \
-+"CSIBM1133", \
-+"CSIBM1137", \
-+"CSIBM1140", \
-+"CSIBM1141", \
-+"CSIBM1142", \
-+"CSIBM1143", \
-+"CSIBM1144", \
-+"CSIBM1145", \
-+"CSIBM1146", \
-+"CSIBM1147", \
-+"CSIBM1148", \
-+"CSIBM1149", \
-+"CSIBM1153", \
-+"CSIBM1154", \
-+"CSIBM1155", \
-+"CSIBM1156", \
-+"CSIBM1157", \
-+"CSIBM1158", \
-+"CSIBM1160", \
-+"CSIBM1161", \
-+"CSIBM1163", \
-+"CSIBM1164", \
-+"CSIBM1166", \
-+"CSIBM1167", \
-+"CSIBM1364", \
-+"CSIBM1371", \
-+"CSIBM1388", \
-+"CSIBM1390", \
-+"CSIBM1399", \
-+"CSIBM4517", \
-+"CSIBM4899", \
-+"CSIBM4909", \
-+"CSIBM4971", \
-+"CSIBM5347", \
-+"CSIBM9030", \
-+"CSIBM9066", \
-+"CSIBM9448", \
-+"CSIBM12712", \
-+"CSIBM16804", \
-+"CSIBM11621162", \
-+"CSISO4UNITEDKINGDOM", \
-+"CSISO10SWEDISH", \
-+"CSISO11SWEDISHFORNAMES", \
-+"CSISO14JISC6220RO", \
-+"CSISO15ITALIAN", \
-+"CSISO16PORTUGESE", \
-+"CSISO17SPANISH", \
-+"CSISO18GREEK7OLD", \
-+"CSISO19LATINGREEK", \
-+"CSISO21GERMAN", \
-+"CSISO25FRENCH", \
-+"CSISO27LATINGREEK1", \
-+"CSISO49INIS", \
-+"CSISO50INIS8", \
-+"CSISO51INISCYRILLIC", \
-+"CSISO58GB1988", \
-+"CSISO60DANISHNORWEGIAN", \
-+"CSISO60NORWEGIAN1", \
-+"CSISO61NORWEGIAN2", \
-+"CSISO69FRENCH", \
-+"CSISO84PORTUGUESE2", \
-+"CSISO85SPANISH2", \
-+"CSISO86HUNGARIAN", \
-+"CSISO88GREEK7", \
-+"CSISO89ASMO449", \
-+"CSISO90", \
-+"CSISO92JISC62991984B", \
-+"CSISO99NAPLPS", \
-+"CSISO103T618BIT", \
-+"CSISO111ECMACYRILLIC", \
-+"CSISO121CANADIAN1", \
-+"CSISO122CANADIAN2", \
-+"CSISO139CSN369103", \
-+"CSISO141JUSIB1002", \
-+"CSISO143IECP271", \
-+"CSISO150", \
-+"CSISO150GREEKCCITT", \
-+"CSISO151CUBA", \
-+"CSISO153GOST1976874", \
-+"CSISO646DANISH", \
-+"CSISO2022CN", \
-+"CSISO2022JP", \
-+"CSISO2022JP2", \
-+"CSISO2022KR", \
-+"CSISO2033", \
-+"CSISO5427CYRILLIC", \
-+"CSISO5427CYRILLIC1981", \
-+"CSISO5428GREEK", \
-+"CSISO10367BOX", \
-+"CSISOLATIN1", \
-+"CSISOLATIN2", \
-+"CSISOLATIN3", \
-+"CSISOLATIN4", \
-+"CSISOLATIN5", \
-+"CSISOLATIN6", \
-+"CSISOLATINARABIC", \
-+"CSISOLATINCYRILLIC", \
-+"CSISOLATINGREEK", \
-+"CSISOLATINHEBREW", \
-+"CSKOI8R", \
-+"CSKSC5636", \
-+"CSMACINTOSH", \
-+"CSNATSDANO", \
-+"CSNATSSEFI", \
-+"CSN_369103", \
-+"CSPC8CODEPAGE437", \
-+"CSPC775BALTIC", \
-+"CSPC850MULTILINGUAL", \
-+"CSPC862LATINHEBREW", \
-+"CSPCP852", \
-+"CSSHIFTJIS", \
-+"CSUCS4", \
-+"CSUNICODE", \
-+"CSWINDOWS31J", \
-+"CUBA", \
-+"CWI-2", \
-+"CWI", \
-+"CYRILLIC", \
-+"DE", \
-+"DEC-MCS", \
-+"DEC", \
-+"DECMCS", \
-+"DIN_66003", \
-+"DK", \
-+"DS2089", \
-+"DS_2089", \
-+"E13B", \
-+"EBCDIC-AT-DE-A", \
-+"EBCDIC-AT-DE", \
-+"EBCDIC-BE", \
-+"EBCDIC-BR", \
-+"EBCDIC-CA-FR", \
-+"EBCDIC-CP-AR1", \
-+"EBCDIC-CP-AR2", \
-+"EBCDIC-CP-BE", \
-+"EBCDIC-CP-CA", \
-+"EBCDIC-CP-CH", \
-+"EBCDIC-CP-DK", \
-+"EBCDIC-CP-ES", \
-+"EBCDIC-CP-FI", \
-+"EBCDIC-CP-FR", \
-+"EBCDIC-CP-GB", \
-+"EBCDIC-CP-GR", \
-+"EBCDIC-CP-HE", \
-+"EBCDIC-CP-IS", \
-+"EBCDIC-CP-IT", \
-+"EBCDIC-CP-NL", \
-+"EBCDIC-CP-NO", \
-+"EBCDIC-CP-ROECE", \
-+"EBCDIC-CP-SE", \
-+"EBCDIC-CP-TR", \
-+"EBCDIC-CP-US", \
-+"EBCDIC-CP-WT", \
-+"EBCDIC-CP-YU", \
-+"EBCDIC-CYRILLIC", \
-+"EBCDIC-DK-NO-A", \
-+"EBCDIC-DK-NO", \
-+"EBCDIC-ES-A", \
-+"EBCDIC-ES-S", \
-+"EBCDIC-ES", \
-+"EBCDIC-FI-SE-A", \
-+"EBCDIC-FI-SE", \
-+"EBCDIC-FR", \
-+"EBCDIC-GREEK", \
-+"EBCDIC-INT", \
-+"EBCDIC-INT1", \
-+"EBCDIC-IS-FRISS", \
-+"EBCDIC-IT", \
-+"EBCDIC-JP-E", \
-+"EBCDIC-JP-KANA", \
-+"EBCDIC-PT", \
-+"EBCDIC-UK", \
-+"EBCDIC-US", \
-+"EBCDICATDE", \
-+"EBCDICATDEA", \
-+"EBCDICCAFR", \
-+"EBCDICDKNO", \
-+"EBCDICDKNOA", \
-+"EBCDICES", \
-+"EBCDICESA", \
-+"EBCDICESS", \
-+"EBCDICFISE", \
-+"EBCDICFISEA", \
-+"EBCDICFR", \
-+"EBCDICISFRISS", \
-+"EBCDICIT", \
-+"EBCDICPT", \
-+"EBCDICUK", \
-+"EBCDICUS", \
-+"ECMA-114", \
-+"ECMA-118", \
-+"ECMA-128", \
-+"ECMA-CYRILLIC", \
-+"ECMACYRILLIC", \
-+"ELOT_928", \
-+"ES", \
-+"ES2", \
-+"EUC-CN", \
-+"EUC-JISX0213", \
-+"EUC-JP-MS", \
-+"EUC-JP", \
-+"EUC-KR", \
-+"EUC-TW", \
-+"EUCCN", \
-+"EUCJP-MS", \
-+"EUCJP-OPEN", \
-+"EUCJP-WIN", \
-+"EUCJP", \
-+"EUCKR", \
-+"EUCTW", \
-+"FI", \
-+"FR", \
-+"GB", \
-+"GB2312", \
-+"GB13000", \
-+"GB18030", \
-+"GBK", \
-+"GB_1988-80", \
-+"GB_198880", \
-+"GEORGIAN-ACADEMY", \
-+"GEORGIAN-PS", \
-+"GOST_19768-74", \
-+"GOST_19768", \
-+"GOST_1976874", \
-+"GREEK-CCITT", \
-+"GREEK", \
-+"GREEK7-OLD", \
-+"GREEK7", \
-+"GREEK7OLD", \
-+"GREEK8", \
-+"GREEKCCITT", \
-+"HEBREW", \
-+"HP-GREEK8", \
-+"HP-ROMAN8", \
-+"HP-ROMAN9", \
-+"HP-THAI8", \
-+"HP-TURKISH8", \
-+"HPGREEK8", \
-+"HPROMAN8", \
-+"HPROMAN9", \
-+"HPTHAI8", \
-+"HPTURKISH8", \
-+"HU", \
-+"IBM-803", \
-+"IBM-856", \
-+"IBM-901", \
-+"IBM-902", \
-+"IBM-921", \
-+"IBM-922", \
-+"IBM-930", \
-+"IBM-932", \
-+"IBM-933", \
-+"IBM-935", \
-+"IBM-937", \
-+"IBM-939", \
-+"IBM-943", \
-+"IBM-1008", \
-+"IBM-1025", \
-+"IBM-1046", \
-+"IBM-1047", \
-+"IBM-1097", \
-+"IBM-1112", \
-+"IBM-1122", \
-+"IBM-1123", \
-+"IBM-1124", \
-+"IBM-1129", \
-+"IBM-1130", \
-+"IBM-1132", \
-+"IBM-1133", \
-+"IBM-1137", \
-+"IBM-1140", \
-+"IBM-1141", \
-+"IBM-1142", \
-+"IBM-1143", \
-+"IBM-1144", \
-+"IBM-1145", \
-+"IBM-1146", \
-+"IBM-1147", \
-+"IBM-1148", \
-+"IBM-1149", \
-+"IBM-1153", \
-+"IBM-1154", \
-+"IBM-1155", \
-+"IBM-1156", \
-+"IBM-1157", \
-+"IBM-1158", \
-+"IBM-1160", \
-+"IBM-1161", \
-+"IBM-1162", \
-+"IBM-1163", \
-+"IBM-1164", \
-+"IBM-1166", \
-+"IBM-1167", \
-+"IBM-1364", \
-+"IBM-1371", \
-+"IBM-1388", \
-+"IBM-1390", \
-+"IBM-1399", \
-+"IBM-4517", \
-+"IBM-4899", \
-+"IBM-4909", \
-+"IBM-4971", \
-+"IBM-5347", \
-+"IBM-9030", \
-+"IBM-9066", \
-+"IBM-9448", \
-+"IBM-12712", \
-+"IBM-16804", \
-+"IBM037", \
-+"IBM038", \
-+"IBM256", \
-+"IBM273", \
-+"IBM274", \
-+"IBM275", \
-+"IBM277", \
-+"IBM278", \
-+"IBM280", \
-+"IBM281", \
-+"IBM284", \
-+"IBM285", \
-+"IBM290", \
-+"IBM297", \
-+"IBM367", \
-+"IBM420", \
-+"IBM423", \
-+"IBM424", \
-+"IBM437", \
-+"IBM500", \
-+"IBM775", \
-+"IBM803", \
-+"IBM813", \
-+"IBM819", \
-+"IBM848", \
-+"IBM850", \
-+"IBM851", \
-+"IBM852", \
-+"IBM855", \
-+"IBM856", \
-+"IBM857", \
-+"IBM860", \
-+"IBM861", \
-+"IBM862", \
-+"IBM863", \
-+"IBM864", \
-+"IBM865", \
-+"IBM866", \
-+"IBM866NAV", \
-+"IBM868", \
-+"IBM869", \
-+"IBM870", \
-+"IBM871", \
-+"IBM874", \
-+"IBM875", \
-+"IBM880", \
-+"IBM891", \
-+"IBM901", \
-+"IBM902", \
-+"IBM903", \
-+"IBM904", \
-+"IBM905", \
-+"IBM912", \
-+"IBM915", \
-+"IBM916", \
-+"IBM918", \
-+"IBM920", \
-+"IBM921", \
-+"IBM922", \
-+"IBM930", \
-+"IBM932", \
-+"IBM933", \
-+"IBM935", \
-+"IBM937", \
-+"IBM939", \
-+"IBM943", \
-+"IBM1004", \
-+"IBM1008", \
-+"IBM1025", \
-+"IBM1026", \
-+"IBM1046", \
-+"IBM1047", \
-+"IBM1089", \
-+"IBM1097", \
-+"IBM1112", \
-+"IBM1122", \
-+"IBM1123", \
-+"IBM1124", \
-+"IBM1129", \
-+"IBM1130", \
-+"IBM1132", \
-+"IBM1133", \
-+"IBM1137", \
-+"IBM1140", \
-+"IBM1141", \
-+"IBM1142", \
-+"IBM1143", \
-+"IBM1144", \
-+"IBM1145", \
-+"IBM1146", \
-+"IBM1147", \
-+"IBM1148", \
-+"IBM1149", \
-+"IBM1153", \
-+"IBM1154", \
-+"IBM1155", \
-+"IBM1156", \
-+"IBM1157", \
-+"IBM1158", \
-+"IBM1160", \
-+"IBM1161", \
-+"IBM1162", \
-+"IBM1163", \
-+"IBM1164", \
-+"IBM1166", \
-+"IBM1167", \
-+"IBM1364", \
-+"IBM1371", \
-+"IBM1388", \
-+"IBM1390", \
-+"IBM1399", \
-+"IBM4517", \
-+"IBM4899", \
-+"IBM4909", \
-+"IBM4971", \
-+"IBM5347", \
-+"IBM9030", \
-+"IBM9066", \
-+"IBM9448", \
-+"IBM12712", \
-+"IBM16804", \
-+"IEC_P27-1", \
-+"IEC_P271", \
-+"INIS-8", \
-+"INIS-CYRILLIC", \
-+"INIS", \
-+"INIS8", \
-+"INISCYRILLIC", \
-+"ISIRI-3342", \
-+"ISIRI3342", \
-+"ISO-2022-CN-EXT", \
-+"ISO-2022-CN", \
-+"ISO-2022-JP-2", \
-+"ISO-2022-JP-3", \
-+"ISO-2022-JP", \
-+"ISO-2022-KR", \
-+"ISO-8859-1", \
-+"ISO-8859-2", \
-+"ISO-8859-3", \
-+"ISO-8859-4", \
-+"ISO-8859-5", \
-+"ISO-8859-6", \
-+"ISO-8859-7", \
-+"ISO-8859-8", \
-+"ISO-8859-9", \
-+"ISO-8859-9E", \
-+"ISO-8859-10", \
-+"ISO-8859-11", \
-+"ISO-8859-13", \
-+"ISO-8859-14", \
-+"ISO-8859-15", \
-+"ISO-8859-16", \
-+"ISO-10646", \
-+"ISO-CELTIC", \
-+"ISO-IR-4", \
-+"ISO-IR-6", \
-+"ISO-IR-8-1", \
-+"ISO-IR-9-1", \
-+"ISO-IR-10", \
-+"ISO-IR-11", \
-+"ISO-IR-14", \
-+"ISO-IR-15", \
-+"ISO-IR-16", \
-+"ISO-IR-17", \
-+"ISO-IR-18", \
-+"ISO-IR-19", \
-+"ISO-IR-21", \
-+"ISO-IR-25", \
-+"ISO-IR-27", \
-+"ISO-IR-37", \
-+"ISO-IR-49", \
-+"ISO-IR-50", \
-+"ISO-IR-51", \
-+"ISO-IR-54", \
-+"ISO-IR-55", \
-+"ISO-IR-57", \
-+"ISO-IR-60", \
-+"ISO-IR-61", \
-+"ISO-IR-69", \
-+"ISO-IR-84", \
-+"ISO-IR-85", \
-+"ISO-IR-86", \
-+"ISO-IR-88", \
-+"ISO-IR-89", \
-+"ISO-IR-90", \
-+"ISO-IR-92", \
-+"ISO-IR-98", \
-+"ISO-IR-99", \
-+"ISO-IR-100", \
-+"ISO-IR-101", \
-+"ISO-IR-103", \
-+"ISO-IR-109", \
-+"ISO-IR-110", \
-+"ISO-IR-111", \
-+"ISO-IR-121", \
-+"ISO-IR-122", \
-+"ISO-IR-126", \
-+"ISO-IR-127", \
-+"ISO-IR-138", \
-+"ISO-IR-139", \
-+"ISO-IR-141", \
-+"ISO-IR-143", \
-+"ISO-IR-144", \
-+"ISO-IR-148", \
-+"ISO-IR-150", \
-+"ISO-IR-151", \
-+"ISO-IR-153", \
-+"ISO-IR-155", \
-+"ISO-IR-156", \
-+"ISO-IR-157", \
-+"ISO-IR-166", \
-+"ISO-IR-179", \
-+"ISO-IR-193", \
-+"ISO-IR-197", \
-+"ISO-IR-199", \
-+"ISO-IR-203", \
-+"ISO-IR-209", \
-+"ISO-IR-226", \
-+"ISO646-CA", \
-+"ISO646-CA2", \
-+"ISO646-CN", \
-+"ISO646-CU", \
-+"ISO646-DE", \
-+"ISO646-DK", \
-+"ISO646-ES", \
-+"ISO646-ES2", \
-+"ISO646-FI", \
-+"ISO646-FR", \
-+"ISO646-FR1", \
-+"ISO646-GB", \
-+"ISO646-HU", \
-+"ISO646-IT", \
-+"ISO646-JP-OCR-B", \
-+"ISO646-JP", \
-+"ISO646-KR", \
-+"ISO646-NO", \
-+"ISO646-NO2", \
-+"ISO646-PT", \
-+"ISO646-PT2", \
-+"ISO646-SE", \
-+"ISO646-SE2", \
-+"ISO646-US", \
-+"ISO646-YU", \
-+"ISO2022CN", \
-+"ISO2022CNEXT", \
-+"ISO2022JP", \
-+"ISO2022JP2", \
-+"ISO2022KR", \
-+"ISO6937", \
-+"ISO8859-1", \
-+"ISO8859-2", \
-+"ISO8859-3", \
-+"ISO8859-4", \
-+"ISO8859-5", \
-+"ISO8859-6", \
-+"ISO8859-7", \
-+"ISO8859-8", \
-+"ISO8859-9", \
-+"ISO8859-9E", \
-+"ISO8859-10", \
-+"ISO8859-11", \
-+"ISO8859-13", \
-+"ISO8859-14", \
-+"ISO8859-15", \
-+"ISO8859-16", \
-+"ISO11548-1", \
-+"ISO88591", \
-+"ISO88592", \
-+"ISO88593", \
-+"ISO88594", \
-+"ISO88595", \
-+"ISO88596", \
-+"ISO88597", \
-+"ISO88598", \
-+"ISO88599", \
-+"ISO88599E", \
-+"ISO885910", \
-+"ISO885911", \
-+"ISO885913", \
-+"ISO885914", \
-+"ISO885915", \
-+"ISO885916", \
-+"ISO_646.IRV:1991", \
-+"ISO_2033-1983", \
-+"ISO_2033", \
-+"ISO_5427-EXT", \
-+"ISO_5427", \
-+"ISO_5427:1981", \
-+"ISO_5427EXT", \
-+"ISO_5428", \
-+"ISO_5428:1980", \
-+"ISO_6937-2", \
-+"ISO_6937-2:1983", \
-+"ISO_6937", \
-+"ISO_6937:1992", \
-+"ISO_8859-1", \
-+"ISO_8859-1:1987", \
-+"ISO_8859-2", \
-+"ISO_8859-2:1987", \
-+"ISO_8859-3", \
-+"ISO_8859-3:1988", \
-+"ISO_8859-4", \
-+"ISO_8859-4:1988", \
-+"ISO_8859-5", \
-+"ISO_8859-5:1988", \
-+"ISO_8859-6", \
-+"ISO_8859-6:1987", \
-+"ISO_8859-7", \
-+"ISO_8859-7:1987", \
-+"ISO_8859-7:2003", \
-+"ISO_8859-8", \
-+"ISO_8859-8:1988", \
-+"ISO_8859-9", \
-+"ISO_8859-9:1989", \
-+"ISO_8859-9E", \
-+"ISO_8859-10", \
-+"ISO_8859-10:1992", \
-+"ISO_8859-14", \
-+"ISO_8859-14:1998", \
-+"ISO_8859-15", \
-+"ISO_8859-15:1998", \
-+"ISO_8859-16", \
-+"ISO_8859-16:2001", \
-+"ISO_9036", \
-+"ISO_10367-BOX", \
-+"ISO_10367BOX", \
-+"ISO_11548-1", \
-+"ISO_69372", \
-+"IT", \
-+"JIS_C6220-1969-RO", \
-+"JIS_C6229-1984-B", \
-+"JIS_C62201969RO", \
-+"JIS_C62291984B", \
-+"JOHAB", \
-+"JP-OCR-B", \
-+"JP", \
-+"JS", \
-+"JUS_I.B1.002", \
-+"KOI-7", \
-+"KOI-8", \
-+"KOI8-R", \
-+"KOI8-RU", \
-+"KOI8-T", \
-+"KOI8-U", \
-+"KOI8", \
-+"KOI8R", \
-+"KOI8U", \
-+"KSC5636", \
-+"L1", \
-+"L2", \
-+"L3", \
-+"L4", \
-+"L5", \
-+"L6", \
-+"L7", \
-+"L8", \
-+"L10", \
-+"LATIN-9", \
-+"LATIN-GREEK-1", \
-+"LATIN-GREEK", \
-+"LATIN1", \
-+"LATIN2", \
-+"LATIN3", \
-+"LATIN4", \
-+"LATIN5", \
-+"LATIN6", \
-+"LATIN7", \
-+"LATIN8", \
-+"LATIN10", \
-+"LATINGREEK", \
-+"LATINGREEK1", \
-+"MAC-CENTRALEUROPE", \
-+"MAC-CYRILLIC", \
-+"MAC-IS", \
-+"MAC-SAMI", \
-+"MAC-UK", \
-+"MAC", \
-+"MACCYRILLIC", \
-+"MACINTOSH", \
-+"MACIS", \
-+"MACUK", \
-+"MACUKRAINIAN", \
-+"MIK", \
-+"MS-ANSI", \
-+"MS-ARAB", \
-+"MS-CYRL", \
-+"MS-EE", \
-+"MS-GREEK", \
-+"MS-HEBR", \
-+"MS-MAC-CYRILLIC", \
-+"MS-TURK", \
-+"MS932", \
-+"MS936", \
-+"MSCP949", \
-+"MSCP1361", \
-+"MSMACCYRILLIC", \
-+"MSZ_7795.3", \
-+"MS_KANJI", \
-+"NAPLPS", \
-+"NATS-DANO", \
-+"NATS-SEFI", \
-+"NATSDANO", \
-+"NATSSEFI", \
-+"NC_NC0010", \
-+"NC_NC00-10", \
-+"NC_NC00-10:81", \
-+"NF_Z_62-010", \
-+"NF_Z_62-010_(1973)", \
-+"NF_Z_62-010_1973", \
-+"NF_Z_62010", \
-+"NF_Z_62010_1973", \
-+"NO", \
-+"NO2", \
-+"NS_4551-1", \
-+"NS_4551-2", \
-+"NS_45511", \
-+"NS_45512", \
-+"OS2LATIN1", \
-+"OSF00010001", \
-+"OSF00010002", \
-+"OSF00010003", \
-+"OSF00010004", \
-+"OSF00010005", \
-+"OSF00010006", \
-+"OSF00010007", \
-+"OSF00010008", \
-+"OSF00010009", \
-+"OSF0001000A", \
-+"OSF00010020", \
-+"OSF00010100", \
-+"OSF00010101", \
-+"OSF00010102", \
-+"OSF00010104", \
-+"OSF00010105", \
-+"OSF00010106", \
-+"OSF00030010", \
-+"OSF0004000A", \
-+"OSF0005000A", \
-+"OSF05010001", \
-+"OSF100201A4", \
-+"OSF100201A8", \
-+"OSF100201B5", \
-+"OSF100201F4", \
-+"OSF100203B5", \
-+"OSF1002011C", \
-+"OSF1002011D", \
-+"OSF1002035D", \
-+"OSF1002035E", \
-+"OSF1002035F", \
-+"OSF1002036B", \
-+"OSF1002037B", \
-+"OSF10010001", \
-+"OSF10010004", \
-+"OSF10010006", \
-+"OSF10020025", \
-+"OSF10020111", \
-+"OSF10020115", \
-+"OSF10020116", \
-+"OSF10020118", \
-+"OSF10020122", \
-+"OSF10020129", \
-+"OSF10020352", \
-+"OSF10020354", \
-+"OSF10020357", \
-+"OSF10020359", \
-+"OSF10020360", \
-+"OSF10020364", \
-+"OSF10020365", \
-+"OSF10020366", \
-+"OSF10020367", \
-+"OSF10020370", \
-+"OSF10020387", \
-+"OSF10020388", \
-+"OSF10020396", \
-+"OSF10020402", \
-+"OSF10020417", \
-+"PT", \
-+"PT2", \
-+"PT154", \
-+"R8", \
-+"R9", \
-+"RK1048", \
-+"ROMAN8", \
-+"ROMAN9", \
-+"RUSCII", \
-+"SE", \
-+"SE2", \
-+"SEN_850200_B", \
-+"SEN_850200_C", \
-+"SHIFT-JIS", \
-+"SHIFT_JIS", \
-+"SHIFT_JISX0213", \
-+"SJIS-OPEN", \
-+"SJIS-WIN", \
-+"SJIS", \
-+"SS636127", \
-+"STRK1048-2002", \
-+"ST_SEV_358-88", \
-+"T.61-8BIT", \
-+"T.61", \
-+"T.618BIT", \
-+"TCVN-5712", \
-+"TCVN", \
-+"TCVN5712-1", \
-+"TCVN5712-1:1993", \
-+"THAI8", \
-+"TIS-620", \
-+"TIS620-0", \
-+"TIS620.2529-1", \
-+"TIS620.2533-0", \
-+"TIS620", \
-+"TS-5881", \
-+"TSCII", \
-+"TURKISH8", \
-+"UCS-2", \
-+"UCS-2BE", \
-+"UCS-2LE", \
-+"UCS-4", \
-+"UCS-4BE", \
-+"UCS-4LE", \
-+"UCS2", \
-+"UCS4", \
-+"UHC", \
-+"UJIS", \
-+"UK", \
-+"UNICODE", \
-+"UNICODEBIG", \
-+"UNICODELITTLE", \
-+"US-ASCII", \
-+"US", \
-+"UTF-7", \
-+"UTF-8", \
-+"UTF-16", \
-+"UTF-16BE", \
-+"UTF-16LE", \
-+"UTF-32", \
-+"UTF-32BE", \
-+"UTF-32LE", \
-+"UTF7", \
-+"UTF8", \
-+"UTF16", \
-+"UTF16BE", \
-+"UTF16LE", \
-+"UTF32", \
-+"UTF32BE", \
-+"UTF32LE", \
-+"VISCII", \
-+"WCHAR_T", \
-+"WIN-SAMI-2", \
-+"WINBALTRIM", \
-+"WINDOWS-31J", \
-+"WINDOWS-874", \
-+"WINDOWS-936", \
-+"WINDOWS-1250", \
-+"WINDOWS-1251", \
-+"WINDOWS-1252", \
-+"WINDOWS-1253", \
-+"WINDOWS-1254", \
-+"WINDOWS-1255", \
-+"WINDOWS-1256", \
-+"WINDOWS-1257", \
-+"WINDOWS-1258", \
-+"WINSAMI2", \
-+"WS2", \
-+"YU",
-diff --git a/gdb/charset.c b/gdb/charset.c
-index 32eb9c3..4850fbf 100644
---- a/gdb/charset.c
-+++ b/gdb/charset.c
-@@ -21,6 +21,9 @@
- #include "charset.h"
- #include "gdbcmd.h"
- #include "gdb_assert.h"
-+#include "gdb_obstack.h"
-+#include "charset-list.h"
-+#include "vec.h"
- #include <stddef.h>
- #include "gdb_string.h"
-@@ -33,15 +36,20 @@
\f
- /* How GDB's character set support works
--   GDB has two global settings:
-+   GDB has three global settings:
-    - The `current host character set' is the character set GDB should
-      use in talking to the user, and which (hopefully) the user's
--     terminal knows how to display properly.
-+     terminal knows how to display properly.  Most users should not
-+     change this.
-    - The `current target character set' is the character set the
-      program being debugged uses.
-+   - The `current target wide character set' is the wide character set
-+     the program being debugged uses, that is, the encoding used for
-+     wchar_t.
++#ifndef NM_I386_H
++#define NM_I386_H 1
 +
-    There are commands to set each of these, and mechanisms for
-    choosing reasonable default values.  GDB has a global list of
-    character sets that it can use as its host or target character
-@@ -57,118 +65,37 @@
-      characters the user enters in expressions (mostly host->target
-      conversions),
--   and so on.
--
--   Now, many of these operations are specific to a particular
--   host/target character set pair.  If GDB supports N character sets,
--   there are N^2 possible pairs.  This means that, the larger GDB's
--   repertoire of character sets gets, the more expensive it gets to add
--   new character sets.
--
--   To make sure that GDB can do the right thing for every possible
--   pairing of host and target character set, while still allowing
--   GDB's repertoire to scale, we use a two-tiered approach:
--
--   - We maintain a global table of "translations" --- groups of
--     functions specific to a particular pair of character sets.
--
--   - However, a translation can be incomplete: some functions can be
--     omitted.  Where there is not a translation to specify exactly
--     what function to use, we provide reasonable defaults.  The
--     default behaviors try to use the "iconv" library functions, which
--     support a wide range of character sets.  However, even if iconv
--     is not available, there are fallbacks to support trivial
--     translations: when the host and target character sets are the
--     same.  */
--
--\f
--/* The character set and translation structures.  */
--
--
--/* A character set GDB knows about.  GDB only supports character sets
--   with stateless encodings, in which every character is one byte
--   long.  */
--struct charset {
--
--  /* A singly-linked list of all known charsets.  */
--  struct charset *next;
--
--  /* The name of the character set.  Comparisons on character set
--     names are case-sensitive.  */
--  const char *name;
--
--  /* Non-zero iff this character set can be used as a host character
--     set.  At present, GDB basically assumes that the host character
--     set is a superset of ASCII.  */
--  int valid_host_charset;
--
--  /* Pointers to charset-specific functions that depend only on a
--     single character set, and data pointers to pass to them.  */
--  int (*host_char_print_literally) (void *baton,
--                                    int host_char);
--  void *host_char_print_literally_baton;
--
--  int (*target_char_to_control_char) (void *baton,
--                                      int target_char,
--                                      int *target_ctrl_char);
--  void *target_char_to_control_char_baton;
--};
--
--
--/* A translation from one character set to another.  */
--struct translation {
--
--  /* A singly-linked list of all known translations.  */
--  struct translation *next;
--
--  /* This structure describes functions going from the FROM character
--     set to the TO character set.  Comparisons on character set names
--     are case-sensitive.  */
--  const char *from, *to;
--
--  /* Pointers to translation-specific functions, and data pointers to
--     pass to them.  These pointers can be zero, indicating that GDB
--     should fall back on the default behavior.  We hope the default
--     behavior will be correct for many from/to pairs, reducing the
--     number of translations that need to be registered explicitly.  */
--  
--  /* TARGET_CHAR is in the `from' charset.
--     Returns a string in the `to' charset.  */
--  const char *(*c_target_char_has_backslash_escape) (void *baton,
--                                                     int target_char);
--  void *c_target_char_has_backslash_escape_baton;
--
--  /* HOST_CHAR is in the `from' charset.
--     TARGET_CHAR points to a char in the `to' charset.  */
--  int (*c_parse_backslash) (void *baton, int host_char, int *target_char);
--  void *c_parse_backslash_baton;
--
--  /* This is used for the host_char_to_target and target_char_to_host
--     functions.  */
--  int (*convert_char) (void *baton, int from, int *to);
--  void *convert_char_baton;
--};
--
-+     and so on.
-+     
-+   To avoid excessive code duplication and maintenance efforts,
-+   GDB simply requires a capable iconv function.  Users on platforms
-+   without a suitable iconv can use the GNU iconv library.  */
\f
- /* The global lists of character sets and translations.  */
--#ifndef GDB_DEFAULT_HOST_CHARSET
--#define GDB_DEFAULT_HOST_CHARSET "ISO-8859-1"
--#endif
--
- #ifndef GDB_DEFAULT_TARGET_CHARSET
- #define GDB_DEFAULT_TARGET_CHARSET "ISO-8859-1"
- #endif
--static const char *host_charset_name = GDB_DEFAULT_HOST_CHARSET;
-+#ifndef GDB_DEFAULT_TARGET_WIDE_CHARSET
-+#define GDB_DEFAULT_TARGET_WIDE_CHARSET "UCS-4"
-+#endif
++/* Hardware-assisted breakpoints and watchpoints.  */
 +
-+static const char *auto_host_charset_name = GDB_DEFAULT_HOST_CHARSET;
-+static const char *host_charset_name = "auto";
- static void
- show_host_charset_name (struct ui_file *file, int from_tty,
-                       struct cmd_list_element *c,
-                       const char *value)
- {
--  fprintf_filtered (file, _("The host character set is \"%s\".\n"), value);
-+  if (!strcmp (value, "auto"))
-+    fprintf_filtered (file,
-+                    _("The host character set is \"auto; currently %s\".\n"),
-+                    auto_host_charset_name);
-+  else
-+    fprintf_filtered (file, _("The host character set is \"%s\".\n"), value);
- }
- static const char *target_charset_name = GDB_DEFAULT_TARGET_CHARSET;
-@@ -180,1060 +107,534 @@ show_target_charset_name (struct ui_file *file, int from_tty,
-                   value);
- }
--
--static const char *host_charset_enum[] = 
-+static const char *target_wide_charset_name = GDB_DEFAULT_TARGET_WIDE_CHARSET;
-+static void
-+show_target_wide_charset_name (struct ui_file *file, int from_tty,
-+                             struct cmd_list_element *c, const char *value)
- {
--  "ASCII",
--  "ISO-8859-1",
--  0
--};
-+  fprintf_filtered (file, _("The target wide character set is \"%s\".\n"),
-+                  value);
-+}
--static const char *target_charset_enum[] = 
-+static const char *default_charset_names[] =
- {
--  "ASCII",
--  "ISO-8859-1",
--  "EBCDIC-US",
--  "IBM1047",
-+  DEFAULT_CHARSET_NAMES
-   0
- };
--/* The global list of all the charsets GDB knows about.  */
--static struct charset *all_charsets;
-+static const char **charset_enum;
-+\f
-+/* If the target wide character set has big- or little-endian
-+   variants, these are the corresponding names.  */
-+static const char *target_wide_charset_be_name;
-+static const char *target_wide_charset_le_name;
--static void
--register_charset (struct charset *cs)
--{
--  struct charset **ptr;
--
--  /* Put the new charset on the end, so that the list ends up in the
--     same order as the registrations in the _initialize function.  */
--  for (ptr = &all_charsets; *ptr; ptr = &(*ptr)->next)
--    ;
--
--  cs->next = 0;
--  *ptr = cs;
--}
--
-+/* A helper function for validate which sets the target wide big- and
-+   little-endian character set names, if possible.  */
--static struct charset *
--lookup_charset (const char *name)
-+static void
-+set_be_le_names (void)
- {
--  struct charset *cs;
-+  int i, len;
--  for (cs = all_charsets; cs; cs = cs->next)
--    if (! strcmp (name, cs->name))
--      return cs;
-+  target_wide_charset_le_name = NULL;
-+  target_wide_charset_be_name = NULL;
--  return NULL;
-+  len = strlen (target_wide_charset_name);
-+  for (i = 0; charset_enum[i]; ++i)
-+    {
-+      if (strncmp (target_wide_charset_name, charset_enum[i], len))
-+      continue;
-+      if ((charset_enum[i][len] == 'B'
-+         || charset_enum[i][len] == 'L')
-+        && charset_enum[i][len + 1] == 'E'
-+        && charset_enum[i][len + 2] == '\0')
-+      {
-+        if (charset_enum[i][len] == 'B')
-+          target_wide_charset_be_name = charset_enum[i];
-+        else
-+          target_wide_charset_le_name = charset_enum[i];
-+      }
-+    }
- }
--
--/* The global list of translations.  */
--static struct translation *all_translations;
--
-+/* 'Set charset', 'set host-charset', 'set target-charset', 'set
-+   target-wide-charset', 'set charset' sfunc's.  */
- static void
--register_translation (struct translation *t)
-+validate (void)
- {
--  t->next = all_translations;
--  all_translations = t;
--}
--
--
--static struct translation *
--lookup_translation (const char *from, const char *to)
--{
--  struct translation *t;
--
--  for (t = all_translations; t; t = t->next)
--    if (! strcmp (from, t->from)
--        && ! strcmp (to, t->to))
--      return t;
-+  iconv_t desc;
-+  const char *host_cset = host_charset ();
--  return 0;
--}
--
--
--\f
--/* Constructing charsets.  */
--
--/* Allocate, initialize and return a straightforward charset.
--   Use this function, rather than creating the structures yourself,
--   so that we can add new fields to the structure in the future without
--   having to tweak all the old charset descriptions.  */
--static struct charset *
--simple_charset (const char *name,
--                int valid_host_charset,
--                int (*host_char_print_literally) (void *baton, int host_char),
--                void *host_char_print_literally_baton,
--                int (*target_char_to_control_char) (void *baton,
--                                                    int target_char,
--                                                    int *target_ctrl_char),
--                void *target_char_to_control_char_baton)
--{
--  struct charset *cs = xmalloc (sizeof (*cs));
-+  desc = iconv_open (target_wide_charset_name, host_cset);
-+  if (desc == (iconv_t) -1)
-+    error ("Cannot convert between character sets `%s' and `%s'",
-+         target_wide_charset_name, host_cset);
-+  iconv_close (desc);
--  memset (cs, 0, sizeof (*cs));
--  cs->name = name;
--  cs->valid_host_charset = valid_host_charset;
--  cs->host_char_print_literally = host_char_print_literally;
--  cs->host_char_print_literally_baton = host_char_print_literally_baton;
--  cs->target_char_to_control_char = target_char_to_control_char;
--  cs->target_char_to_control_char_baton = target_char_to_control_char_baton;
-+  desc = iconv_open (target_charset_name, host_cset);
-+  if (desc == (iconv_t) -1)
-+    error ("Cannot convert between character sets `%s' and `%s'",
-+         target_charset_name, host_cset);
-+  iconv_close (desc);
--  return cs;
-+  set_be_le_names ();
- }
--
--\f
--/* ASCII functions.  */
--
--static int
--ascii_print_literally (void *baton, int c)
-+/* This is the sfunc for the 'set charset' command.  */
-+static void
-+set_charset_sfunc (char *charset, int from_tty, struct cmd_list_element *c)
- {
--  c &= 0xff;
--
--  return (0x20 <= c && c <= 0x7e);
-+  /* CAREFUL: set the target charset here as well. */
-+  target_charset_name = host_charset_name;
-+  validate ();
- }
--
--static int
--ascii_to_control (void *baton, int c, int *ctrl_char)
-+/* 'set host-charset' command sfunc.  We need a wrapper here because
-+   the function needs to have a specific signature.  */
-+static void
-+set_host_charset_sfunc (char *charset, int from_tty,
-+                      struct cmd_list_element *c)
- {
--  *ctrl_char = (c & 037);
--  return 1;
-+  validate ();
- }
--\f
--/* ISO-8859 family functions.  */
--
--
--static int
--iso_8859_print_literally (void *baton, int c)
-+/* Wrapper for the 'set target-charset' command.  */
-+static void
-+set_target_charset_sfunc (char *charset, int from_tty,
-+                        struct cmd_list_element *c)
- {
--  c &= 0xff;
--
--  return ((0x20 <= c && c <= 0x7e) /* ascii printables */
--          || (! sevenbit_strings && 0xA0 <= c)); /* iso 8859 printables */
-+  validate ();
- }
--
--static int
--iso_8859_to_control (void *baton, int c, int *ctrl_char)
-+/* Wrapper for the 'set target-wide-charset' command.  */
-+static void
-+set_target_wide_charset_sfunc (char *charset, int from_tty,
-+                             struct cmd_list_element *c)
- {
--  *ctrl_char = (c & 0200) | (c & 037);
--  return 1;
-+  validate ();
- }
--
--/* Construct an ISO-8859-like character set.  */
--static struct charset *
--iso_8859_family_charset (const char *name)
-+/* sfunc for the 'show charset' command.  */
-+static void
-+show_charset (struct ui_file *file, int from_tty, struct cmd_list_element *c,
-+            const char *name)
- {
--  return simple_charset (name, 1,
--                         iso_8859_print_literally, 0,
--                         iso_8859_to_control, 0);
-+  show_host_charset_name (file, from_tty, c, host_charset_name);
-+  show_target_charset_name (file, from_tty, c, target_charset_name);
-+  show_target_wide_charset_name (file, from_tty, c, target_wide_charset_name);
- }
--
\f
--/* EBCDIC family functions.  */
--
--
--static int
--ebcdic_print_literally (void *baton, int c)
--{
--  c &= 0xff;
--
--  return (64 <= c && c <= 254);
--}
--
-+/* Accessor functions.  */
--static int
--ebcdic_to_control (void *baton, int c, int *ctrl_char)
-+const char *
-+host_charset (void)
- {
--  /* There are no control character equivalents in EBCDIC.  Use
--     numeric escapes.  */
--  return 0;
-+  if (!strcmp (host_charset_name, "auto"))
-+    return auto_host_charset_name;
-+  return host_charset_name;
- }
--
--/* Construct an EBCDIC-like character set.  */
--static struct charset *
--ebcdic_family_charset (const char *name)
-+const char *
-+target_charset (void)
- {
--  return simple_charset (name, 0,
--                         ebcdic_print_literally, 0,
--                         ebcdic_to_control, 0);
-+  return target_charset_name;
- }
--                
--
--
--
--\f
--/* Fallback functions using iconv.  */
--
--#if defined(HAVE_ICONV)
--struct cached_iconv {
--  struct charset *from, *to;
--  iconv_t i;
--};
--
--
--/* Make sure the iconv cache *CI contains an iconv descriptor
--   translating from FROM to TO.  If it already does, fine; otherwise,
--   close any existing descriptor, and open up a new one.  On success,
--   return zero; on failure, return -1 and set errno.  */
--static int
--check_iconv_cache (struct cached_iconv *ci,
--                   struct charset *from,
--                   struct charset *to)
-+const char *
-+target_wide_charset (void)
- {
--  iconv_t i;
--
--  /* Does the cached iconv descriptor match the conversion we're trying
--     to do now?  */
--  if (ci->from == from
--      && ci->to == to
--      && ci->i != (iconv_t) 0)
--    return 0;
--
--  /* It doesn't.  If we actually had any iconv descriptor open at
--     all, close it now.  */
--  if (ci->i != (iconv_t) 0)
-+  if (gdbarch_byte_order (current_gdbarch) == BFD_ENDIAN_BIG)
-     {
--      i = ci->i;
--      ci->i = (iconv_t) 0;
--      
--      if (iconv_close (i) == -1)
--        error (_("Error closing `iconv' descriptor for "
--               "`%s'-to-`%s' character conversion: %s"),
--               ci->from->name, ci->to->name, safe_strerror (errno));
-+      if (target_wide_charset_be_name)
-+      return target_wide_charset_be_name;
-     }
--
--  /* Open a new iconv descriptor for the required conversion.  */
--  i = iconv_open (to->name, from->name);
--  if (i == (iconv_t) -1)
--    return -1;
--
--  ci->i = i;
--  ci->from = from;
--  ci->to = to;
--
--  return 0;
--}
--
--
--/* Convert FROM_CHAR using the cached iconv conversion *CI.  Return
--   non-zero if the conversion was successful, zero otherwise.  */
--static int
--cached_iconv_convert (struct cached_iconv *ci, int from_char, int *to_char)
--{
--  char from;
--  ICONV_CONST char *from_ptr = &from;
--  char to, *to_ptr = &to;
--  size_t from_left = sizeof (from), to_left = sizeof (to);
--
--  gdb_assert (ci->i != (iconv_t) 0);
--
--  from = from_char;
--  if (iconv (ci->i, &from_ptr, &from_left, &to_ptr, &to_left)
--      == (size_t) -1)
-+  else
-     {
--      /* These all suggest that the input or output character sets
--         have multi-byte encodings of some characters, which means
--         it's unsuitable for use as a GDB character set.  We should
--         never have selected it.  */
--      gdb_assert (errno != E2BIG && errno != EINVAL);
--
--      /* This suggests a bug in the code managing *CI.  */
--      gdb_assert (errno != EBADF);
--
--      /* This seems to mean that there is no equivalent character in
--         the `to' character set.  */
--      if (errno == EILSEQ)
--        return 0;
--
--      /* Anything else is mysterious.  */
--      internal_error (__FILE__, __LINE__,
--                    _("Error converting character `%d' from `%s' to `%s' "
--                      "character set: %s"),
--                      from_char, ci->from->name, ci->to->name,
--                      safe_strerror (errno));
-+      if (target_wide_charset_le_name)
-+      return target_wide_charset_le_name;
-     }
--  /* If the pointers weren't advanced across the input, that also
--     suggests something was wrong.  */
--  gdb_assert (from_left == 0 && to_left == 0);
--
--  *to_char = (unsigned char) to;
--  return 1;
-+  return target_wide_charset_name;
- }
--
--static void
--register_iconv_charsets (void)
--{
--  /* Here we should check whether various character sets were
--     recognized by the local iconv implementation.
--
--     The first implementation registered a bunch of character sets
--     recognized by iconv, but then we discovered that iconv on Solaris
--     and iconv on GNU/Linux had no character sets in common.  So we
--     replaced them with the hard-coded tables that appear later in the
--     file.  */
--}
--
--#endif /* defined (HAVE_ICONV) */
--
\f
--/* Fallback routines for systems without iconv.  */
-+/* Host character set management.  For the time being, we assume that
-+   the host character set is some superset of ASCII.  */
--#if ! defined (HAVE_ICONV) 
--struct cached_iconv { char nothing; };
--
--static int
--check_iconv_cache (struct cached_iconv *ci,
--                   struct charset *from,
--                   struct charset *to)
-+char
-+host_letter_to_control_character (char c)
- {
--  errno = EINVAL;
--  return -1;
-+  if (c == '?')
-+    return 0177;
-+  return c & 0237;
- }
--static int
--cached_iconv_convert (struct cached_iconv *ci, int from_char, int *to_char)
--{
--  /* This function should never be called.  */
--  gdb_assert (0);
--}
-+/* Convert a host character, C, to its hex value.  C must already have
-+   been validated using isxdigit.  */
--static void
--register_iconv_charsets (void)
--{
--}
--
--#endif /* ! defined(HAVE_ICONV) */
--
--\f
--/* Default trivial conversion functions.  */
--
--static int
--identity_either_char_to_other (void *baton, int either_char, int *other_char)
-+int
-+host_hex_value (char c)
- {
--  *other_char = either_char;
--  return 1;
-+  if (isdigit (c))
-+    return c - '0';
-+  if (c >= 'a' && c <= 'f')
-+    return 10 + c - 'a';
-+  gdb_assert (c >= 'A' && c <= 'F');
-+  return 10 + c - 'A';
- }
--
\f
--/* Default non-trivial conversion functions.  */
--
--
--static char backslashable[] = "abfnrtv";
--static char *backslashed[] = {"a", "b", "f", "n", "r", "t", "v", "0"};
--static char represented[] = "\a\b\f\n\r\t\v";
--
--
--/* Translate TARGET_CHAR into the host character set, and see if it
--   matches any of our standard escape sequences.  */
--static const char *
--default_c_target_char_has_backslash_escape (void *baton, int target_char)
--{
--  int host_char;
--  const char *ix;
--
--  /* If target_char has no equivalent in the host character set,
--     assume it doesn't have a backslashed form.  */
--  if (! target_char_to_host (target_char, &host_char))
--    return NULL;
--
--  ix = strchr (represented, host_char);
--  if (ix)
--    return backslashed[ix - represented];
--  else
--    return NULL;
--}
--
--
--/* Translate the backslash the way we would in the host character set,
--   and then try to translate that into the target character set.  */
--static int
--default_c_parse_backslash (void *baton, int host_char, int *target_char)
--{
--  const char *ix;
--
--  ix = strchr (backslashable, host_char);
--
--  if (! ix)
--    return 0;
--  else
--    return host_char_to_target (represented[ix - backslashable],
--                                target_char);
--}
-+/* Public character management functions.  */
-+/* A cleanup function which is run to close an iconv descriptor.  */
--/* Convert using a cached iconv descriptor.  */
--static int
--iconv_convert (void *baton, int from_char, int *to_char)
-+static void
-+cleanup_iconv (void *p)
- {
--  struct cached_iconv *ci = baton;
--  return cached_iconv_convert (ci, from_char, to_char);
-+  iconv_t *descp = p;
-+  iconv_close (*descp);
- }
-+void
-+convert_between_encodings (const char *from, const char *to,
-+                         const gdb_byte *bytes, unsigned int num_bytes,
-+                         int width, struct obstack *output,
-+                         enum transliterations translit)
-+{
-+  iconv_t desc;
-+  struct cleanup *cleanups;
-+  size_t inleft;
-+  char *inp;
-+  unsigned int space_request;
++/* Targets should define this to use the generic x86 watchpoint support.  */
++#ifdef I386_USE_GENERIC_WATCHPOINTS
 +
-+  /* Often, the host and target charsets will be the same.  */
-+  if (!strcmp (from, to))
-+    {
-+      obstack_grow (output, bytes, num_bytes);
-+      return;
-+    }
--\f
--/* Conversion tables.  */
--
--
--/* I'd much rather fall back on iconv whenever possible.  But the
--   character set names you use with iconv aren't standardized at all,
--   a lot of platforms have really meager character set coverage, etc.
--   I wanted to have at least something we could use to exercise the
--   test suite on all platforms.
--
--   In the long run, we should have a configure-time process explore
--   somehow which character sets the host platform supports, and some
--   arrangement that allows GDB users to use platform-indepedent names
--   for character sets.  */
--
--
--/* We generated these tables using iconv on a GNU/Linux machine.  */
--
--
--static int ascii_to_iso_8859_1_table[] = {
--    0,  1,  2,  3,  4,  5,  6,  7,  8,  9, 10, 11, 12, 13, 14, 15, /* 16 */
--   16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, /* 32 */
--   32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, /* 48 */
--   48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, /* 64 */
--   64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, /* 80 */
--   80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, /* 96 */
--   96, 97, 98, 99,100,101,102,103,104,105,106,107,108,109,110,111, /* 112 */
--  112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127, /* 128 */
--   -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, /* 144 */
--   -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, /* 160 */
--   -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, /* 176 */
--   -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, /* 192 */
--   -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, /* 208 */
--   -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, /* 224 */
--   -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, /* 240 */
--   -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1  /* 256 */
--};
--
--
--static int ascii_to_ebcdic_us_table[] = {
--    0,  1,  2,  3, 55, 45, 46, 47, 22,  5, 37, 11, 12, 13, 14, 15, /* 16 */
--   16, 17, 18, 19, 60, 61, 50, 38, 24, 25, 63, 39, 28, 29, 30, 31, /* 32 */
--   64, 90,127,123, 91,108, 80,125, 77, 93, 92, 78,107, 96, 75, 97, /* 48 */
--  240,241,242,243,244,245,246,247,248,249,122, 94, 76,126,110,111, /* 64 */
--  124,193,194,195,196,197,198,199,200,201,209,210,211,212,213,214, /* 80 */
--  215,216,217,226,227,228,229,230,231,232,233, -1,224, -1, -1,109, /* 96 */
--  121,129,130,131,132,133,134,135,136,137,145,146,147,148,149,150, /* 112 */
--  151,152,153,162,163,164,165,166,167,168,169,192, 79,208,161,  7, /* 128 */
--   -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, /* 144 */
--   -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, /* 160 */
--   -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, /* 176 */
--   -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, /* 192 */
--   -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, /* 208 */
--   -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, /* 224 */
--   -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, /* 240 */
--   -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1  /* 256 */
--};
--
--
--static int ascii_to_ibm1047_table[] = {
--    0,  1,  2,  3, 55, 45, 46, 47, 22,  5, 37, 11, 12, 13, 14, 15, /* 16 */
--   16, 17, 18, 19, 60, 61, 50, 38, 24, 25, 63, 39, 28, 29, 30, 31, /* 32 */
--   64, 90,127,123, 91,108, 80,125, 77, 93, 92, 78,107, 96, 75, 97, /* 48 */
--  240,241,242,243,244,245,246,247,248,249,122, 94, 76,126,110,111, /* 64 */
--  124,193,194,195,196,197,198,199,200,201,209,210,211,212,213,214, /* 80 */
--  215,216,217,226,227,228,229,230,231,232,233,173,224,189, 95,109, /* 96 */
--  121,129,130,131,132,133,134,135,136,137,145,146,147,148,149,150, /* 112 */
--  151,152,153,162,163,164,165,166,167,168,169,192, 79,208,161,  7, /* 128 */
--   -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, /* 144 */
--   -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, /* 160 */
--   -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, /* 176 */
--   -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, /* 192 */
--   -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, /* 208 */
--   -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, /* 224 */
--   -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, /* 240 */
--   -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1  /* 256 */
--};
--
--
--static int iso_8859_1_to_ascii_table[] = {
--    0,  1,  2,  3,  4,  5,  6,  7,  8,  9, 10, 11, 12, 13, 14, 15, /* 16 */
--   16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, /* 32 */
--   32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, /* 48 */
--   48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, /* 64 */
--   64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, /* 80 */
--   80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, /* 96 */
--   96, 97, 98, 99,100,101,102,103,104,105,106,107,108,109,110,111, /* 112 */
--  112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127, /* 128 */
--   -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, /* 144 */
--   -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, /* 160 */
--   -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, /* 176 */
--   -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, /* 192 */
--   -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, /* 208 */
--   -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, /* 224 */
--   -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, /* 240 */
--   -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1  /* 256 */
--};
--
--
--static int iso_8859_1_to_ebcdic_us_table[] = {
--    0,  1,  2,  3, 55, 45, 46, 47, 22,  5, 37, 11, 12, 13, 14, 15, /* 16 */
--   16, 17, 18, 19, 60, 61, 50, 38, 24, 25, 63, 39, 28, 29, 30, 31, /* 32 */
--   64, 90,127,123, 91,108, 80,125, 77, 93, 92, 78,107, 96, 75, 97, /* 48 */
--  240,241,242,243,244,245,246,247,248,249,122, 94, 76,126,110,111, /* 64 */
--  124,193,194,195,196,197,198,199,200,201,209,210,211,212,213,214, /* 80 */
--  215,216,217,226,227,228,229,230,231,232,233, -1,224, -1, -1,109, /* 96 */
--  121,129,130,131,132,133,134,135,136,137,145,146,147,148,149,150, /* 112 */
--  151,152,153,162,163,164,165,166,167,168,169,192, 79,208,161,  7, /* 128 */
--   32, 33, 34, 35, 36, 21,  6, 23, 40, 41, 42, 43, 44,  9, 10, 27, /* 144 */
--   48, 49, 26, 51, 52, 53, 54,  8, 56, 57, 58, 59,  4, 20, 62,255, /* 160 */
--   -1, -1, 74, -1, -1, -1,106, -1, -1, -1, -1, -1, 95, -1, -1, -1, /* 176 */
--   -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, /* 192 */
--   -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, /* 208 */
--   -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, /* 224 */
--   -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, /* 240 */
--   -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1  /* 256 */
--};
--
--
--static int iso_8859_1_to_ibm1047_table[] = {
--    0,  1,  2,  3, 55, 45, 46, 47, 22,  5, 37, 11, 12, 13, 14, 15, /* 16 */
--   16, 17, 18, 19, 60, 61, 50, 38, 24, 25, 63, 39, 28, 29, 30, 31, /* 32 */
--   64, 90,127,123, 91,108, 80,125, 77, 93, 92, 78,107, 96, 75, 97, /* 48 */
--  240,241,242,243,244,245,246,247,248,249,122, 94, 76,126,110,111, /* 64 */
--  124,193,194,195,196,197,198,199,200,201,209,210,211,212,213,214, /* 80 */
--  215,216,217,226,227,228,229,230,231,232,233,173,224,189, 95,109, /* 96 */
--  121,129,130,131,132,133,134,135,136,137,145,146,147,148,149,150, /* 112 */
--  151,152,153,162,163,164,165,166,167,168,169,192, 79,208,161,  7, /* 128 */
--   32, 33, 34, 35, 36, 21,  6, 23, 40, 41, 42, 43, 44,  9, 10, 27, /* 144 */
--   48, 49, 26, 51, 52, 53, 54,  8, 56, 57, 58, 59,  4, 20, 62,255, /* 160 */
--   65,170, 74,177,159,178,106,181,187,180,154,138,176,202,175,188, /* 176 */
--  144,143,234,250,190,160,182,179,157,218,155,139,183,184,185,171, /* 192 */
--  100,101, 98,102, 99,103,158,104,116,113,114,115,120,117,118,119, /* 208 */
--  172,105,237,238,235,239,236,191,128,253,254,251,252,186,174, 89, /* 224 */
--   68, 69, 66, 70, 67, 71,156, 72, 84, 81, 82, 83, 88, 85, 86, 87, /* 240 */
--  140, 73,205,206,203,207,204,225,112,221,222,219,220,141,142,223  /* 256 */
--};
--
--
--static int ebcdic_us_to_ascii_table[] = {
--    0,  1,  2,  3, -1,  9, -1,127, -1, -1, -1, 11, 12, 13, 14, 15, /* 16 */
--   16, 17, 18, 19, -1, -1,  8, -1, 24, 25, -1, -1, 28, 29, 30, 31, /* 32 */
--   -1, -1, -1, -1, -1, 10, 23, 27, -1, -1, -1, -1, -1,  5,  6,  7, /* 48 */
--   -1, -1, 22, -1, -1, -1, -1,  4, -1, -1, -1, -1, 20, 21, -1, 26, /* 64 */
--   32, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 46, 60, 40, 43,124, /* 80 */
--   38, -1, -1, -1, -1, -1, -1, -1, -1, -1, 33, 36, 42, 41, 59, -1, /* 96 */
--   45, 47, -1, -1, -1, -1, -1, -1, -1, -1, -1, 44, 37, 95, 62, 63, /* 112 */
--   -1, -1, -1, -1, -1, -1, -1, -1, -1, 96, 58, 35, 64, 39, 61, 34, /* 128 */
--   -1, 97, 98, 99,100,101,102,103,104,105, -1, -1, -1, -1, -1, -1, /* 144 */
--   -1,106,107,108,109,110,111,112,113,114, -1, -1, -1, -1, -1, -1, /* 160 */
--   -1,126,115,116,117,118,119,120,121,122, -1, -1, -1, -1, -1, -1, /* 176 */
--   -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, /* 192 */
--  123, 65, 66, 67, 68, 69, 70, 71, 72, 73, -1, -1, -1, -1, -1, -1, /* 208 */
--  125, 74, 75, 76, 77, 78, 79, 80, 81, 82, -1, -1, -1, -1, -1, -1, /* 224 */
--   92, -1, 83, 84, 85, 86, 87, 88, 89, 90, -1, -1, -1, -1, -1, -1, /* 240 */
--   48, 49, 50, 51, 52, 53, 54, 55, 56, 57, -1, -1, -1, -1, -1, -1  /* 256 */
--};
--
--
--static int ebcdic_us_to_iso_8859_1_table[] = {
--    0,  1,  2,  3,156,  9,134,127,151,141,142, 11, 12, 13, 14, 15, /* 16 */
--   16, 17, 18, 19,157,133,  8,135, 24, 25,146,143, 28, 29, 30, 31, /* 32 */
--  128,129,130,131,132, 10, 23, 27,136,137,138,139,140,  5,  6,  7, /* 48 */
--  144,145, 22,147,148,149,150,  4,152,153,154,155, 20, 21,158, 26, /* 64 */
--   32, -1, -1, -1, -1, -1, -1, -1, -1, -1,162, 46, 60, 40, 43,124, /* 80 */
--   38, -1, -1, -1, -1, -1, -1, -1, -1, -1, 33, 36, 42, 41, 59,172, /* 96 */
--   45, 47, -1, -1, -1, -1, -1, -1, -1, -1,166, 44, 37, 95, 62, 63, /* 112 */
--   -1, -1, -1, -1, -1, -1, -1, -1, -1, 96, 58, 35, 64, 39, 61, 34, /* 128 */
--   -1, 97, 98, 99,100,101,102,103,104,105, -1, -1, -1, -1, -1, -1, /* 144 */
--   -1,106,107,108,109,110,111,112,113,114, -1, -1, -1, -1, -1, -1, /* 160 */
--   -1,126,115,116,117,118,119,120,121,122, -1, -1, -1, -1, -1, -1, /* 176 */
--   -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, /* 192 */
--  123, 65, 66, 67, 68, 69, 70, 71, 72, 73, -1, -1, -1, -1, -1, -1, /* 208 */
--  125, 74, 75, 76, 77, 78, 79, 80, 81, 82, -1, -1, -1, -1, -1, -1, /* 224 */
--   92, -1, 83, 84, 85, 86, 87, 88, 89, 90, -1, -1, -1, -1, -1, -1, /* 240 */
--   48, 49, 50, 51, 52, 53, 54, 55, 56, 57, -1, -1, -1, -1, -1,159  /* 256 */
--};
--
--
--static int ebcdic_us_to_ibm1047_table[] = {
--    0,  1,  2,  3,  4,  5,  6,  7,  8,  9, 10, 11, 12, 13, 14, 15, /* 16 */
--   16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, /* 32 */
--   32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, /* 48 */
--   48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, /* 64 */
--   64, -1, -1, -1, -1, -1, -1, -1, -1, -1, 74, 75, 76, 77, 78, 79, /* 80 */
--   80, -1, -1, -1, -1, -1, -1, -1, -1, -1, 90, 91, 92, 93, 94,176, /* 96 */
--   96, 97, -1, -1, -1, -1, -1, -1, -1, -1,106,107,108,109,110,111, /* 112 */
--   -1, -1, -1, -1, -1, -1, -1, -1, -1,121,122,123,124,125,126,127, /* 128 */
--   -1,129,130,131,132,133,134,135,136,137, -1, -1, -1, -1, -1, -1, /* 144 */
--   -1,145,146,147,148,149,150,151,152,153, -1, -1, -1, -1, -1, -1, /* 160 */
--   -1,161,162,163,164,165,166,167,168,169, -1, -1, -1, -1, -1, -1, /* 176 */
--   -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, /* 192 */
--  192,193,194,195,196,197,198,199,200,201, -1, -1, -1, -1, -1, -1, /* 208 */
--  208,209,210,211,212,213,214,215,216,217, -1, -1, -1, -1, -1, -1, /* 224 */
--  224, -1,226,227,228,229,230,231,232,233, -1, -1, -1, -1, -1, -1, /* 240 */
--  240,241,242,243,244,245,246,247,248,249, -1, -1, -1, -1, -1,255  /* 256 */
--};
--
--
--static int ibm1047_to_ascii_table[] = {
--    0,  1,  2,  3, -1,  9, -1,127, -1, -1, -1, 11, 12, 13, 14, 15, /* 16 */
--   16, 17, 18, 19, -1, -1,  8, -1, 24, 25, -1, -1, 28, 29, 30, 31, /* 32 */
--   -1, -1, -1, -1, -1, 10, 23, 27, -1, -1, -1, -1, -1,  5,  6,  7, /* 48 */
--   -1, -1, 22, -1, -1, -1, -1,  4, -1, -1, -1, -1, 20, 21, -1, 26, /* 64 */
--   32, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 46, 60, 40, 43,124, /* 80 */
--   38, -1, -1, -1, -1, -1, -1, -1, -1, -1, 33, 36, 42, 41, 59, 94, /* 96 */
--   45, 47, -1, -1, -1, -1, -1, -1, -1, -1, -1, 44, 37, 95, 62, 63, /* 112 */
--   -1, -1, -1, -1, -1, -1, -1, -1, -1, 96, 58, 35, 64, 39, 61, 34, /* 128 */
--   -1, 97, 98, 99,100,101,102,103,104,105, -1, -1, -1, -1, -1, -1, /* 144 */
--   -1,106,107,108,109,110,111,112,113,114, -1, -1, -1, -1, -1, -1, /* 160 */
--   -1,126,115,116,117,118,119,120,121,122, -1, -1, -1, 91, -1, -1, /* 176 */
--   -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 93, -1, -1, /* 192 */
--  123, 65, 66, 67, 68, 69, 70, 71, 72, 73, -1, -1, -1, -1, -1, -1, /* 208 */
--  125, 74, 75, 76, 77, 78, 79, 80, 81, 82, -1, -1, -1, -1, -1, -1, /* 224 */
--   92, -1, 83, 84, 85, 86, 87, 88, 89, 90, -1, -1, -1, -1, -1, -1, /* 240 */
--   48, 49, 50, 51, 52, 53, 54, 55, 56, 57, -1, -1, -1, -1, -1, -1  /* 256 */
--};
--
--
--static int ibm1047_to_iso_8859_1_table[] = {
--    0,  1,  2,  3,156,  9,134,127,151,141,142, 11, 12, 13, 14, 15, /* 16 */
--   16, 17, 18, 19,157,133,  8,135, 24, 25,146,143, 28, 29, 30, 31, /* 32 */
--  128,129,130,131,132, 10, 23, 27,136,137,138,139,140,  5,  6,  7, /* 48 */
--  144,145, 22,147,148,149,150,  4,152,153,154,155, 20, 21,158, 26, /* 64 */
--   32,160,226,228,224,225,227,229,231,241,162, 46, 60, 40, 43,124, /* 80 */
--   38,233,234,235,232,237,238,239,236,223, 33, 36, 42, 41, 59, 94, /* 96 */
--   45, 47,194,196,192,193,195,197,199,209,166, 44, 37, 95, 62, 63, /* 112 */
--  248,201,202,203,200,205,206,207,204, 96, 58, 35, 64, 39, 61, 34, /* 128 */
--  216, 97, 98, 99,100,101,102,103,104,105,171,187,240,253,254,177, /* 144 */
--  176,106,107,108,109,110,111,112,113,114,170,186,230,184,198,164, /* 160 */
--  181,126,115,116,117,118,119,120,121,122,161,191,208, 91,222,174, /* 176 */
--  172,163,165,183,169,167,182,188,189,190,221,168,175, 93,180,215, /* 192 */
--  123, 65, 66, 67, 68, 69, 70, 71, 72, 73,173,244,246,242,243,245, /* 208 */
--  125, 74, 75, 76, 77, 78, 79, 80, 81, 82,185,251,252,249,250,255, /* 224 */
--   92,247, 83, 84, 85, 86, 87, 88, 89, 90,178,212,214,210,211,213, /* 240 */
--   48, 49, 50, 51, 52, 53, 54, 55, 56, 57,179,219,220,217,218,159  /* 256 */
--};
--
--
--static int ibm1047_to_ebcdic_us_table[] = {
--    0,  1,  2,  3,  4,  5,  6,  7,  8,  9, 10, 11, 12, 13, 14, 15, /* 16 */
--   16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, /* 32 */
--   32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, /* 48 */
--   48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, /* 64 */
--   64, -1, -1, -1, -1, -1, -1, -1, -1, -1, 74, 75, 76, 77, 78, 79, /* 80 */
--   80, -1, -1, -1, -1, -1, -1, -1, -1, -1, 90, 91, 92, 93, 94, -1, /* 96 */
--   96, 97, -1, -1, -1, -1, -1, -1, -1, -1,106,107,108,109,110,111, /* 112 */
--   -1, -1, -1, -1, -1, -1, -1, -1, -1,121,122,123,124,125,126,127, /* 128 */
--   -1,129,130,131,132,133,134,135,136,137, -1, -1, -1, -1, -1, -1, /* 144 */
--   -1,145,146,147,148,149,150,151,152,153, -1, -1, -1, -1, -1, -1, /* 160 */
--   -1,161,162,163,164,165,166,167,168,169, -1, -1, -1, -1, -1, -1, /* 176 */
--   95, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, /* 192 */
--  192,193,194,195,196,197,198,199,200,201, -1, -1, -1, -1, -1, -1, /* 208 */
--  208,209,210,211,212,213,214,215,216,217, -1, -1, -1, -1, -1, -1, /* 224 */
--  224, -1,226,227,228,229,230,231,232,233, -1, -1, -1, -1, -1, -1, /* 240 */
--  240,241,242,243,244,245,246,247,248,249, -1, -1, -1, -1, -1,255  /* 256 */
--};
-+  desc = iconv_open (to, from);
-+  if (desc == (iconv_t) -1)
-+    perror_with_name ("Converting character sets");
-+  cleanups = make_cleanup (cleanup_iconv, &desc);
-+  inleft = num_bytes;
-+  inp = (char *) bytes;
--static int
--table_convert_char (void *baton, int from, int *to)
--{
--  int *table = (int *) baton;
-+  space_request = num_bytes;
--  if (0 <= from && from <= 255
--      && table[from] != -1)
-+  while (inleft > 0)
-     {
--      *to = table[from];
--      return 1;
-+      char *outp;
-+      size_t outleft, r;
-+      int old_size;
++/* Add watchpoint methods to the provided target_ops.  Targets which call
++   this should also define I386_WATCHPOINTS_IN_TARGET_VECTOR.  */
++struct target_ops;
++void i386_use_watchpoints (struct target_ops *);
 +
-+      old_size = obstack_object_size (output);
-+      obstack_blank (output, space_request);
++/* Clear the reference counts and forget everything we knew about DRi.  */
++extern void i386_cleanup_dregs (void);
 +
-+      outp = obstack_base (output) + old_size;
-+      outleft = space_request;
++/* Insert a watchpoint to watch a memory region which starts at
++   address ADDR and whose length is LEN bytes.  Watch memory accesses
++   of the type TYPE.  Return 0 on success, -1 on failure.  */
++extern int i386_insert_watchpoint (CORE_ADDR addr, int len, int type);
 +
-+      r = iconv (desc, &inp, &inleft, &outp, &outleft);
++/* Remove a watchpoint that watched the memory region which starts at
++   address ADDR, whose length is LEN bytes, and for accesses of the
++   type TYPE.  Return 0 on success, -1 on failure.  */
++extern int i386_remove_watchpoint (CORE_ADDR addr, int len, int type);
 +
-+      /* Now make sure that the object on the obstack only includes
-+       bytes we have converted.  */
-+      obstack_blank (output, - (int) outleft);
++/* Return non-zero if we can watch a memory region that starts at
++   address ADDR and whose length is LEN bytes.  */
++extern int i386_region_ok_for_watchpoint (CORE_ADDR addr, int len);
 +
-+      if (r == (size_t) -1)
-+      {
-+        switch (errno)
-+          {
-+          case EILSEQ:
-+            {
-+              int i;
++/* Return non-zero if the inferior has some break/watchpoint that
++   triggered.  */
++extern int i386_stopped_by_hwbp (void);
 +
-+              /* Invalid input sequence.  */
-+              if (translit == translit_none)
-+                error (_("Could not convert character to `%s' character set"),
-+                       to);
++/* If the inferior has some break/watchpoint that triggered, set
++   the address associated with that break/watchpoint and return
++   true.  Otherwise, return false.  */
++extern int i386_stopped_data_address (struct target_ops *, CORE_ADDR *);
 +
-+              /* We emit escape sequence for the bytes, skip them,
-+                 and try again.  */
-+              for (i = 0; i < width; ++i)
-+                {
-+                  char octal[5];
++/* Insert a hardware-assisted breakpoint at BP_TGT->placed_address.
++   Return 0 on success, EBUSY on failure.  */
++struct bp_target_info;
++extern int i386_insert_hw_breakpoint (struct bp_target_info *bp_tgt);
 +
-+                  sprintf (octal, "\\%.3o", *inp & 0xff);
-+                  obstack_grow_str (output, octal);
++/* Remove a hardware-assisted breakpoint at BP_TGT->placed_address.
++   Return 0 on success, -1 on failure.  */
++extern int  i386_remove_hw_breakpoint (struct bp_target_info *bp_tgt);
 +
-+                  ++inp;
-+                  --inleft;
-+                }
-+            }
-+            break;
++extern int i386_stopped_by_watchpoint (void);
 +
-+          case E2BIG:
-+            /* We ran out of space in the output buffer.  Make it
-+               bigger next time around.  */
-+            space_request *= 2;
-+            break;
++#ifndef I386_WATCHPOINTS_IN_TARGET_VECTOR
 +
-+          case EINVAL:
-+            /* Incomplete input sequence.  FIXME: ought to report this
-+               to the caller somehow.  */
-+            inleft = 0;
-+            break;
++/* Returns the number of hardware watchpoints of type TYPE that we can
++   set.  Value is positive if we can set CNT watchpoints, zero if
++   setting watchpoints of type TYPE is not supported, and negative if
++   CNT is more than the maximum number of watchpoints of type TYPE
++   that we can support.  TYPE is one of bp_hardware_watchpoint,
++   bp_read_watchpoint, bp_write_watchpoint, or bp_hardware_breakpoint.
++   CNT is the number of such watchpoints used so far (including this
++   one).  OTHERTYPE is non-zero if other types of watchpoints are
++   currently enabled.
 +
-+          default:
-+            perror_with_name ("Internal error while converting character sets");
-+          }
-+      }
-     }
--  else
--    return 0;
--}
--
--static struct translation *
--table_translation (const char *from, const char *to, int *table,
--                   const char *(*c_target_char_has_backslash_escape)
--                   (void *baton, int target_char),
--                   void *c_target_char_has_backslash_escape_baton,
--                   int (*c_parse_backslash) (void *baton,
--                                             int host_char,
--                                             int *target_char),
--                   void *c_parse_backslash_baton)
--{
--  struct translation *t = xmalloc (sizeof (*t));
--
--  memset (t, 0, sizeof (*t));
--  t->from = from;
--  t->to = to;
--  t->c_target_char_has_backslash_escape = c_target_char_has_backslash_escape;
--  t->c_target_char_has_backslash_escape_baton
--    = c_target_char_has_backslash_escape_baton;
--  t->c_parse_backslash = c_parse_backslash;
--  t->c_parse_backslash_baton = c_parse_backslash_baton;
--  t->convert_char = table_convert_char;
--  t->convert_char_baton = (void *) table;
--
--  return t;
-+  do_cleanups (cleanups);
- }
--
--static struct translation *
--simple_table_translation (const char *from, const char *to, int *table)
--{
--  return table_translation (from, to, table, 0, 0, 0, 0);
--}
--
--
\f
--/* Setting and retrieving the host and target charsets.  */
--
--
--/* The current host and target character sets.  */
--static struct charset *current_host_charset, *current_target_charset;
--
--/* The current functions and batons we should use for the functions in
--   charset.h.  */
--
--static const char *(*c_target_char_has_backslash_escape_func)
--     (void *baton, int target_char);
--static void *c_target_char_has_backslash_escape_baton;
--
--static int (*c_parse_backslash_func) (void *baton,
--                                      int host_char,
--                                      int *target_char);
--static void *c_parse_backslash_baton;
--
--static int (*host_char_to_target_func) (void *baton,
--                                        int host_char,
--                                        int *target_char);
--static void *host_char_to_target_baton;
--
--static int (*target_char_to_host_func) (void *baton,
--                                        int target_char,
--                                        int *host_char);
--static void *target_char_to_host_baton;
--
--/* Cached iconv conversions, that might be useful to fallback
--   routines.  */
--static struct cached_iconv cached_iconv_host_to_target;
--static struct cached_iconv cached_iconv_target_to_host;
--
--\f
--/* Charset structures manipulation functions.  */
--
--static struct charset *
--lookup_charset_or_error (const char *name)
-+/* An iterator that returns host wchar_t's from a target string.  */
-+struct wchar_iterator
- {
--  struct charset *cs = lookup_charset (name);
-+  /* The underlying iconv descriptor.  */
-+  iconv_t desc;
--  if (! cs)
--    error (_("GDB doesn't know of any character set named `%s'."), name);
-+  /* The input string.  This is updated as convert characters.  */
-+  char *input;
-+  /* The number of bytes remaining in the input.  */
-+  size_t bytes;
--  return cs;
--}
-+  /* The width of an input character.  */
-+  size_t width;
--static void
--check_valid_host_charset (struct charset *cs)
--{
--  if (! cs->valid_host_charset)
--    error (_("GDB can't use `%s' as its host character set."), cs->name);
--}
-+  /* The output buffer and its size.  */
-+  wchar_t *out;
-+  size_t out_size;
-+};
--/* Set the host and target character sets to HOST and TARGET.  */
--static void
--set_host_and_target_charsets (struct charset *host, struct charset *target)
-+/* Create a new iterator.  */
-+struct wchar_iterator *
-+make_wchar_iterator (const gdb_byte *input, size_t bytes, const char *charset,
-+                   size_t width)
- {
--  struct translation *h2t, *t2h;
--
--  /* If they're not both initialized yet, then just do nothing for
--     now.  As soon as we're done running our initialize function,
--     everything will be initialized.  */
--  if (! host || ! target)
--    {
--      current_host_charset = host;
--      current_target_charset = target;
--      return;
--    }
--
--  h2t = lookup_translation (host->name, target->name);
--  t2h = lookup_translation (target->name, host->name);
--
--  /* If the translations don't provide conversion functions, make sure
--     iconv can back them up.  Do this *before* modifying any state.  */
--  if (host != target)
--    {
--      if (! h2t || ! h2t->convert_char)
--        {
--          if (check_iconv_cache (&cached_iconv_host_to_target, host, target)
--              < 0)
--            error (_("GDB can't convert from the `%s' character set to `%s'."),
--                   host->name, target->name);
--        }
--      if (! t2h || ! t2h->convert_char)
--        {
--          if (check_iconv_cache (&cached_iconv_target_to_host, target, host)
--              < 0)
--            error (_("GDB can't convert from the `%s' character set to `%s'."),
--                   target->name, host->name);
--        }
--    }
--
--  if (t2h && t2h->c_target_char_has_backslash_escape)
--    {
--      c_target_char_has_backslash_escape_func
--        = t2h->c_target_char_has_backslash_escape;
--      c_target_char_has_backslash_escape_baton
--        = t2h->c_target_char_has_backslash_escape_baton;
--    }
--  else
--    c_target_char_has_backslash_escape_func
--      = default_c_target_char_has_backslash_escape;
--
--  if (h2t && h2t->c_parse_backslash)
--    {
--      c_parse_backslash_func = h2t->c_parse_backslash;
--      c_parse_backslash_baton = h2t->c_parse_backslash_baton;
--    }
--  else
--    c_parse_backslash_func = default_c_parse_backslash;
--
--  if (h2t && h2t->convert_char)
--    {
--      host_char_to_target_func = h2t->convert_char;
--      host_char_to_target_baton = h2t->convert_char_baton;
--    }
--  else if (host == target)
--    host_char_to_target_func = identity_either_char_to_other;
--  else
--    {
--      host_char_to_target_func = iconv_convert;
--      host_char_to_target_baton = &cached_iconv_host_to_target;
--    }
-+  struct wchar_iterator *result;
-+  iconv_t desc;
--  if (t2h && t2h->convert_char)
--    {
--      target_char_to_host_func = t2h->convert_char;
--      target_char_to_host_baton = t2h->convert_char_baton;
--    }
--  else if (host == target)
--    target_char_to_host_func = identity_either_char_to_other;
--  else
--    {
--      target_char_to_host_func = iconv_convert;
--      target_char_to_host_baton = &cached_iconv_target_to_host;
--    }
-+  desc = iconv_open ("wchar_t", charset);
-+  if (desc == (iconv_t) -1)
-+    perror_with_name ("Converting character sets");
--  current_host_charset = host;
--  current_target_charset = target;
--}
--
--/* Do the real work of setting the host charset.  */
--static void
--set_host_charset (const char *charset)
--{
--  struct charset *cs = lookup_charset_or_error (charset);
--  check_valid_host_charset (cs);
--  set_host_and_target_charsets (cs, current_target_charset);
--}
-+  result = XNEW (struct wchar_iterator);
-+  result->desc = desc;
-+  result->input = (char *) input;
-+  result->bytes = bytes;
-+  result->width = width;
--/* Do the real work of setting the target charset.  */
--static void
--set_target_charset (const char *charset)
--{
--  struct charset *cs = lookup_charset_or_error (charset);
-+  result->out = XNEW (wchar_t);
-+  result->out_size = 1;
--  set_host_and_target_charsets (current_host_charset, cs);
-+  return result;
- }
--\f
--/* 'Set charset', 'set host-charset', 'set target-charset', 'show
--   charset' sfunc's.  */
--
--/* This is the sfunc for the 'set charset' command.  */
- static void
--set_charset_sfunc (char *charset, int from_tty, struct cmd_list_element *c)
-+do_cleanup_iterator (void *p)
- {
--  struct charset *cs = lookup_charset_or_error (host_charset_name);
--  check_valid_host_charset (cs);
--  /* CAREFUL: set the target charset here as well. */
--  target_charset_name = host_charset_name;
--  set_host_and_target_charsets (cs, cs);
--}
-+  struct wchar_iterator *iter = p;
--/* 'set host-charset' command sfunc.  We need a wrapper here because
--   the function needs to have a specific signature.  */
--static void
--set_host_charset_sfunc (char *charset, int from_tty,
--                        struct cmd_list_element *c)
--{
--  set_host_charset (host_charset_name);
-+  iconv_close (iter->desc);
-+  xfree (iter->out);
-+  xfree (iter);
- }
--/* Wrapper for the 'set target-charset' command.  */
--static void
--set_target_charset_sfunc (char *charset, int from_tty,
--                          struct cmd_list_element *c)
-+struct cleanup *
-+make_cleanup_wchar_iterator (struct wchar_iterator *iter)
- {
--  set_target_charset (target_charset_name);
-+  return make_cleanup (do_cleanup_iterator, iter);
- }
--/* sfunc for the 'show charset' command.  */
--static void
--show_charset (struct ui_file *file, int from_tty, struct cmd_list_element *c,
--            const char *name)
--{
--  if (current_host_charset == current_target_charset)
--    fprintf_filtered (file,
--                    _("The current host and target character set is `%s'.\n"),
--                    host_charset ());
--  else
-+int
-+wchar_iterate (struct wchar_iterator *iter,
-+             enum wchar_iterate_result *out_result,
-+             wchar_t **out_chars,
-+             const gdb_byte **ptr,
-+             size_t *len)
-+{
-+  size_t out_request;
-+
-+  /* Try to convert some characters.  At first we try to convert just
-+     a single character.  The reason for this is that iconv does not
-+     necessarily update its outgoing arguments when it encounters an
-+     invalid input sequence -- but we want to reliably report this to
-+     our caller so it can emit an escape sequence.  */
-+  out_request = 1;
-+  while (iter->bytes > 0)
-     {
--      fprintf_filtered (file, _("The current host character set is `%s'.\n"),
--                      host_charset ());
--      fprintf_filtered (file, _("The current target character set is `%s'.\n"),
--                      target_charset ());
-+      char *outptr = (char *) &iter->out[0];
-+      char *orig_inptr = iter->input;
-+      size_t orig_in = iter->bytes;
-+      size_t out_avail = out_request * sizeof (wchar_t);
-+      size_t num;
-+      wchar_t result;
-+
-+      size_t r = iconv (iter->desc, (char **) &iter->input, &iter->bytes,
-+                      &outptr, &out_avail);
-+      if (r == (size_t) -1)
-+      {
-+        switch (errno)
-+          {
-+          case EILSEQ:
-+            /* Invalid input sequence.  Skip it, and let the caller
-+               know about it.  */
-+            *out_result = wchar_iterate_invalid;
-+            *ptr = iter->input;
-+            *len = iter->width;
-+            iter->input += iter->width;
-+            iter->bytes -= iter->width;
-+            return 0;
++   We always return 1 here because we don't have enough information
++   about possible overlap of addresses that they want to watch.  As an
++   extreme example, consider the case where all the watchpoints watch
++   the same address and the same region length: then we can handle a
++   virtually unlimited number of watchpoints, due to debug register
++   sharing implemented via reference counts in i386-nat.c.  */
 +
-+          case E2BIG:
-+            /* We ran out of space.  We still might have converted a
-+               character; if so, return it.  Otherwise, grow the
-+               buffer and try again.  */
-+            if (out_avail < out_request * sizeof (wchar_t))
-+              break;
++#define TARGET_CAN_USE_HARDWARE_WATCHPOINT(type, cnt, ot) 1
 +
-+            ++out_request;
-+            if (out_request > iter->out_size)
-+              {
-+                iter->out_size = out_request;
-+                iter->out = xrealloc (iter->out,
-+                                      out_request * sizeof (wchar_t));
-+              }
-+            continue;
-+
-+          case EINVAL:
-+            /* Incomplete input sequence.  Let the caller know, and
-+               arrange for future calls to see EOF.  */
-+            *out_result = wchar_iterate_incomplete;
-+            *ptr = iter->input;
-+            *len = iter->bytes;
-+            iter->bytes = 0;
-+            return 0;
++/* Returns non-zero if we can use hardware watchpoints to watch a
++   region whose address is ADDR and whose length is LEN.  */
 +
-+          default:
-+            perror_with_name ("Internal error while converting character sets");
-+          }
-+      }
++#define TARGET_REGION_OK_FOR_HW_WATCHPOINT(addr, len) \
++  i386_region_ok_for_watchpoint (addr, len)
 +
-+      /* We converted something.  */
-+      num = out_request - out_avail / sizeof (wchar_t);
-+      *out_result = wchar_iterate_ok;
-+      *out_chars = iter->out;
-+      *ptr = orig_inptr;
-+      *len = orig_in - iter->bytes;
-+      return num;
-     }
++/* After a watchpoint trap, the PC points to the instruction after the
++   one that caused the trap.  Therefore we don't need to step over it.
++   But we do need to reset the status register to avoid another trap.  */
 +
-+  /* Really done.  */
-+  *out_result = wchar_iterate_eof;
-+  return -1;
- }
\f
--/* Accessor functions.  */
-+/* The charset.c module initialization function.  */
--const char *
--host_charset (void)
--{
--  return current_host_charset->name;
--}
-+extern initialize_file_ftype _initialize_charset; /* -Wmissing-prototype */
--const char *
--target_charset (void)
--{
--  return current_target_charset->name;
--}
-+typedef char *char_ptr;
-+DEF_VEC_P (char_ptr);
-+static VEC (char_ptr) *charsets;
--\f
--/* Public character management functions.  */
-+#ifdef HAVE_ICONVLIST
-+/* A helper function that adds some character sets to the vector of
-+   all character sets.  This is a callback function for iconvlist.  */
--const char *
--c_target_char_has_backslash_escape (int target_char)
-+static int
-+add_one (unsigned int count, const char *const *names, void *data)
- {
--  return ((*c_target_char_has_backslash_escape_func)
--          (c_target_char_has_backslash_escape_baton, target_char));
--}
-+  unsigned int i;
-+  for (i = 0; i < count; ++i)
-+    VEC_safe_push (char_ptr, charsets, xstrdup (names[i]));
--int
--c_parse_backslash (int host_char, int *target_char)
--{
--  return (*c_parse_backslash_func) (c_parse_backslash_baton,
--                                    host_char, target_char);
-+  return 0;
- }
--
--int
--host_char_print_literally (int host_char)
-+static void
-+find_charset_names (void)
- {
--  return ((*current_host_charset->host_char_print_literally)
--          (current_host_charset->host_char_print_literally_baton,
--           host_char));
-+  iconvlist (add_one, NULL);
-+  VEC_safe_push (char_ptr, charsets, NULL);
- }
-+#else
--int
--target_char_to_control_char (int target_char, int *target_ctrl_char)
-+static void
-+find_charset_names (void)
- {
--  return ((*current_target_charset->target_char_to_control_char)
--          (current_target_charset->target_char_to_control_char_baton,
--           target_char, target_ctrl_char));
--}
-+  FILE *in;
-+  in = popen ("iconv -l", "r");
-+  /* It is ok to ignore errors; we'll fall back on a default.  */
-+  if (!in)
-+    return;
--int
--host_char_to_target (int host_char, int *target_char)
--{
--  return ((*host_char_to_target_func)
--          (host_char_to_target_baton, host_char, target_char));
--}
-+  /* POSIX says that iconv -l uses an unspecified format.  We parse
-+     the glibc format; feel free to add others as needed.  */
-+  while (!feof (in))
-+    {
-+      /* The size of buf is chosen arbitrarily.  A character set name
-+       longer than this would not be very nice.  */
-+      char buf[80];
-+      int len;
-+      char *r = fgets (buf, sizeof (buf), in);
-+      if (!r)
-+      break;
-+      len = strlen (r);
-+      if (len <= 3)
-+      continue;
-+      if (buf[len - 2] == '/' && buf[len - 3] == '/')
-+      buf[len - 3] = '\0';
-+      VEC_safe_push (char_ptr, charsets, xstrdup (buf));
-+    }
-+  pclose (in);
--int
--target_char_to_host (int target_char, int *host_char)
--{
--  return ((*target_char_to_host_func)
--          (target_char_to_host_baton, target_char, host_char));
-+  VEC_safe_push (char_ptr, charsets, NULL);
- }
--
--\f
--/* The charset.c module initialization function.  */
--
--extern initialize_file_ftype _initialize_charset; /* -Wmissing-prototype */
-+#endif /* HAVE_ICONVLIST */
- void
- _initialize_charset (void)
- {
-   struct cmd_list_element *new_cmd;
--  /* Register all the character set GDB knows about.
--
--     You should use the same names that iconv does, where possible, to
--     take advantage of the iconv-based default behaviors.
--
--     CAUTION: if you register a character set, you must also register
--     as many translations as are necessary to make that character set
--     interoperate correctly with all the other character sets.  We do
--     provide default behaviors when no translation is available, or
--     when a translation's function pointer for a particular operation
--     is zero.  Hopefully, these defaults will be correct often enough
--     that we won't need to provide too many translations.  */
--  register_charset (simple_charset ("ASCII", 1,
--                                    ascii_print_literally, 0,
--                                    ascii_to_control, 0));
--  register_charset (iso_8859_family_charset ("ISO-8859-1"));
--  register_charset (ebcdic_family_charset ("EBCDIC-US"));
--  register_charset (ebcdic_family_charset ("IBM1047"));
--  register_iconv_charsets ();
--
--  {
--    struct { char *from; char *to; int *table; } tlist[] = {
--      { "ASCII",      "ISO-8859-1", ascii_to_iso_8859_1_table },
--      { "ASCII",      "EBCDIC-US",  ascii_to_ebcdic_us_table },
--      { "ASCII",      "IBM1047",    ascii_to_ibm1047_table },
--      { "ISO-8859-1", "ASCII",      iso_8859_1_to_ascii_table },
--      { "ISO-8859-1", "EBCDIC-US",  iso_8859_1_to_ebcdic_us_table },
--      { "ISO-8859-1", "IBM1047",    iso_8859_1_to_ibm1047_table },
--      { "EBCDIC-US",  "ASCII",      ebcdic_us_to_ascii_table },
--      { "EBCDIC-US",  "ISO-8859-1", ebcdic_us_to_iso_8859_1_table },
--      { "EBCDIC-US",  "IBM1047",    ebcdic_us_to_ibm1047_table },
--      { "IBM1047",    "ASCII",      ibm1047_to_ascii_table },
--      { "IBM1047",    "ISO-8859-1", ibm1047_to_iso_8859_1_table },
--      { "IBM1047",    "EBCDIC-US",  ibm1047_to_ebcdic_us_table }
--    };
--
--    int i;
--
--    for (i = 0; i < (sizeof (tlist) / sizeof (tlist[0])); i++)
--      register_translation (simple_table_translation (tlist[i].from,
--                                                      tlist[i].to,
--                                                      tlist[i].table));
--  }
--
--  set_host_charset (host_charset_name);
--  set_target_charset (target_charset_name);
-+  /* The first element is always "auto"; then we skip it for the
-+     commands where it is not allowed.  */
-+  VEC_safe_push (char_ptr, charsets, "auto");
-+  find_charset_names ();
-+
-+  if (VEC_length (char_ptr, charsets) > 1)
-+    charset_enum = default_charset_names;
-+  else
-+    charset_enum = (const char **) VEC_address (char_ptr, charsets);
++#define HAVE_CONTINUABLE_WATCHPOINT 1
 +
-+#ifdef HAVE_LANGINFO_CODESET
-+  auto_host_charset_name = nl_langinfo (CODESET);
-+  target_charset_name = auto_host_charset_name;
++#define STOPPED_BY_WATCHPOINT(W)       (i386_stopped_by_watchpoint () != 0)
 +
-+  set_be_le_names ();
-+#endif
-   add_setshow_enum_cmd ("charset", class_support,
--                      host_charset_enum, &host_charset_name, _("\
-+                      &charset_enum[1], &host_charset_name, _("\
- Set the host and target character sets."), _("\
- Show the host and target character sets."), _("\
- The `host character set' is the one used by the system GDB is running on.\n\
-@@ -1249,7 +650,7 @@ To see a list of the character sets GDB supports, type `set charset <TAB>'."),
-                       &setlist, &showlist);
-   add_setshow_enum_cmd ("host-charset", class_support,
--                      host_charset_enum, &host_charset_name, _("\
-+                      charset_enum, &host_charset_name, _("\
- Set the host character set."), _("\
- Show the host character set."), _("\
- The `host character set' is the one used by the system GDB is running on.\n\
-@@ -1261,7 +662,7 @@ To see a list of the character sets GDB supports, type `set host-charset <TAB>'.
-                       &setlist, &showlist);
-   add_setshow_enum_cmd ("target-charset", class_support,
--                      target_charset_enum, &target_charset_name, _("\
-+                      &charset_enum[1], &target_charset_name, _("\
- Set the target character set."), _("\
- Show the target character set."), _("\
- The `target character set' is the one used by the program being debugged.\n\
-@@ -1271,4 +672,19 @@ To see a list of the character sets GDB supports, type `set target-charset'<TAB>
-                       set_target_charset_sfunc,
-                       show_target_charset_name,
-                       &setlist, &showlist);
-+
-+  add_setshow_enum_cmd ("target-wide-charset", class_support,
-+                      &charset_enum[1], &target_wide_charset_name,
-+                      _("\
-+Set the target wide character set."), _("\
-+Show the target wide character set."), _("\
-+The `target wide character set' is the one used by the program being debugged.\n\
-+In particular it is the encoding used by `wchar_t'.\n\
-+GDB translates characters and strings between the host and target\n\
-+character sets as needed.\n\
-+To see a list of the character sets GDB supports, type\n\
-+`set target-wide-charset'<TAB>"),
-+                      set_target_wide_charset_sfunc,
-+                      show_target_wide_charset_name,
-+                      &setlist, &showlist);
- }
-diff --git a/gdb/charset.h b/gdb/charset.h
-index 21780b6..2455355 100644
---- a/gdb/charset.h
-+++ b/gdb/charset.h
-@@ -19,6 +19,7 @@
- #ifndef CHARSET_H
- #define CHARSET_H
-+#include <wchar.h>
- /* If the target program uses a different character set than the host,
-    GDB has some support for translating between the two; GDB converts
-@@ -26,82 +27,123 @@
-    them, and converts characters and strings appearing in expressions
-    entered by the user to the target character set.
--   At the moment, GDB only supports single-byte, stateless character
--   sets.  This includes the ISO-8859 family (ASCII extended with
--   accented characters, and (I think) Cyrillic, for European
--   languages), and the EBCDIC family (used on IBM's mainframes).
--   Unfortunately, it excludes many Asian scripts, the fixed- and
--   variable-width Unicode encodings, and other desireable things.
--   Patches are welcome!  (For example, it would be nice if the Java
--   string support could simply get absorbed into some more general
--   multi-byte encoding support.)
--
--   Furthermore, GDB's code pretty much assumes that the host character
--   set is some superset of ASCII; there are plenty if ('0' + n)
--   expressions and the like.
--
--   When the `iconv' library routine supports a character set meeting
--   the requirements above, it's easy to plug an entry into GDB's table
--   that uses iconv to handle the details.  */
-+   GDB's code pretty much assumes that the host character set is some
-+   superset of ASCII; there are plenty if ('0' + n) expressions and
-+   the like.  */
- /* Return the name of the current host/target character set.  The
-    result is owned by the charset module; the caller should not free
-    it.  */
- const char *host_charset (void);
- const char *target_charset (void);
--
--/* In general, the set of C backslash escapes (\n, \f) is specific to
--   the character set.  Not all character sets will have form feed
--   characters, for example.
--
--   The following functions allow GDB to parse and print control
--   characters in a character-set-independent way.  They are both
--   language-specific (to C and C++) and character-set-specific.
--   Putting them here is a compromise.  */
--
--
--/* If the target character TARGET_CHAR have a backslash escape in the
--   C language (i.e., a character like 'n' or 't'), return the host
--   character string that should follow the backslash.  Otherwise,
--   return zero.
--
--   When this function returns non-zero, the string it returns is
--   statically allocated; the caller is not responsible for freeing it.  */
--const char *c_target_char_has_backslash_escape (int target_char);
--
--
--/* If the host character HOST_CHAR is a valid backslash escape in the
--   C language for the target character set, return non-zero, and set
--   *TARGET_CHAR to the target character the backslash escape represents.
--   Otherwise, return zero.  */
--int c_parse_backslash (int host_char, int *target_char);
--
--
--/* Return non-zero if the host character HOST_CHAR can be printed
--   literally --- that is, if it can be readably printed as itself in a
--   character or string constant.  Return zero if it should be printed
--   using some kind of numeric escape, like '\031' in C, '^(25)' in
--   Chill, or #25 in Pascal.  */
--int host_char_print_literally (int host_char);
--
--
--/* If the host character HOST_CHAR has an equivalent in the target
--   character set, set *TARGET_CHAR to that equivalent, and return
--   non-zero.  Otherwise, return zero.  */
--int host_char_to_target (int host_char, int *target_char);
--
--
--/* If the target character TARGET_CHAR has an equivalent in the host
--   character set, set *HOST_CHAR to that equivalent, and return
--   non-zero.  Otherwise, return zero.  */
--int target_char_to_host (int target_char, int *host_char);
--
--
--/* If the target character TARGET_CHAR has a corresponding control
--   character (also in the target character set), set *TARGET_CTRL_CHAR
--   to the control character, and return non-zero.  Otherwise, return
--   zero.  */
--int target_char_to_control_char (int target_char, int *target_ctrl_char);
--
-+const char *target_wide_charset (void);
++#define target_stopped_data_address(target, x) \
++  i386_stopped_data_address(target, x)
 +
-+/* These values are used to specify the type of transliteration done
-+   by convert_between_encodings.  */
-+enum transliterations
-+  {
-+    /* Error on failure to convert.  */
-+    translit_none,
-+    /* Transliterate to host char.  */
-+    translit_char
-+  };
++/* Use these macros for watchpoint insertion/removal.  */
 +
-+/* Convert between two encodings.
-+
-+   FROM is the name of the source encoding.
-+   TO is the name of the target encoding.
-+   BYTES holds the bytes to convert; this is assumed to be characters
-+   in the target encoding.
-+   NUM_BYTES is the number of bytes.
-+   WIDTH is the width of a character from the FROM charset, in bytes.
-+   For a variable width encoding, WIDTH should be the size of a "base
-+   character".
-+   OUTPUT is an obstack where the converted data is written.  The
-+   caller is responsible for initializing the obstack, and for
-+   destroying the obstack should an error occur.
-+   TRANSLIT specifies how invalid conversions should be handled.  */
-+void convert_between_encodings (const char *from, const char *to,
-+                              const gdb_byte *bytes, unsigned int num_bytes,
-+                              int width, struct obstack *output,
-+                              enum transliterations translit);
-+
-+
-+/* These values are used by wchar_iterate to report errors.  */
-+enum wchar_iterate_result
-+  {
-+    /* Ordinary return.  */
-+    wchar_iterate_ok,
-+    /* Invalid input sequence.  */
-+    wchar_iterate_invalid,
-+    /* Incomplete input sequence at the end of the input.  */
-+    wchar_iterate_incomplete,
-+    /* EOF.  */
-+    wchar_iterate_eof
-+  };
++#define target_insert_watchpoint(addr, len, type) \
++  i386_insert_watchpoint (addr, len, type)
 +
-+/* Declaration of the opaque wchar iterator type.  */
-+struct wchar_iterator;
++#define target_remove_watchpoint(addr, len, type) \
++  i386_remove_watchpoint (addr, len, type)
 +
-+/* Create a new character iterator which returns wchar_t's.  INPUT is
-+   the input buffer.  BYTES is the number of bytes in the input
-+   buffer.  CHARSET is the name of the character set in which INPUT is
-+   encoded.  WIDTH is the number of bytes in a base character of
-+   CHARSET.
-+   
-+   This function either returns a new character set iterator, or calls
-+   error.  The result can be freed using a cleanup; see
-+   make_cleanup_wchar_iterator.  */
-+struct wchar_iterator *make_wchar_iterator (const gdb_byte *input, size_t bytes,
-+                                          const char *charset,
-+                                          size_t width);
-+
-+/* Return a new cleanup suitable for destroying the wchar iterator
-+   ITER.  */
-+struct cleanup *make_cleanup_wchar_iterator (struct wchar_iterator *iter);
-+
-+/* Perform a single iteration of a wchar_t iterator.
-+   
-+   Returns the number of characters converted.  A negative result
-+   means that EOF has been reached.  A positive result indicates the
-+   number of valid wchar_ts in the result; *OUT_CHARS is updated to
-+   point to the first valid character.
++#define target_insert_hw_breakpoint(bp_tgt) \
++  i386_insert_hw_breakpoint (bp_tgt)
 +
-+   In all cases aside from EOF, *PTR is set to point to the first
-+   converted target byte.  *LEN is set to the number of bytes
-+   converted.
++#define target_remove_hw_breakpoint(bp_tgt) \
++  i386_remove_hw_breakpoint (bp_tgt)
 +
-+   A zero result means one of several unusual results.  *OUT_RESULT is
-+   set to indicate the type of un-ordinary return.
++#endif /* I386_WATCHPOINTS_IN_TARGET_VECTOR */
 +
-+   wchar_iterate_invalid means that an invalid input character was
-+   seen.  The iterator is advanced by WIDTH (the argument to
-+   make_wchar_iterator) bytes.
++#endif /* I386_USE_GENERIC_WATCHPOINTS */
 +
-+   wchar_iterate_incomplete means that an incomplete character was
-+   seen at the end of the input sequence.
-+   
-+   wchar_iterate_eof means that all bytes were successfully
-+   converted.  The other output arguments are not set.  */
-+int wchar_iterate (struct wchar_iterator *iter,
-+                 enum wchar_iterate_result *out_result,
-+                 wchar_t **out_chars,
-+                 const gdb_byte **ptr, size_t *len);
++#endif /* NM_I386_H */
+diff --git a/gdb/config/i386/nm-linux64.h b/gdb/config/i386/nm-linux64.h
+new file mode 100644
+index 0000000..19d710a
+--- /dev/null
++++ b/gdb/config/i386/nm-linux64.h
+@@ -0,0 +1,54 @@
++/* Native support for GNU/Linux x86-64.
 +
-+\f
++   Copyright 2001, 2002, 2003, 2004, 2005, 2007, 2008, 2009
++   Free Software Foundation, Inc.
 +
-+/* GDB needs to know a few details of its execution character set.
-+   This knowledge is isolated here and in charset.c.  */
++   Contributed by Jiri Smid, SuSE Labs.
 +
-+/* The escape character.  */
-+#define HOST_ESCAPE_CHAR 27
++   This file is part of GDB.
 +
-+/* Convert a letter, like 'c', to its corresponding control
-+   character.  */
-+char host_letter_to_control_character (char c);
++   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.
 +
-+/* Convert a hex digit character to its numeric value.  E.g., 'f' is
-+   converted to 15.  This function assumes that C is a valid hex
-+   digit.  Both upper- and lower-case letters are recognized.  */
-+int host_hex_value (char c);
- #endif /* CHARSET_H */
-diff --git a/gdb/cli/cli-cmds.c b/gdb/cli/cli-cmds.c
-index 4d9c4f3..5fbe398 100644
---- a/gdb/cli/cli-cmds.c
-+++ b/gdb/cli/cli-cmds.c
-@@ -45,6 +45,8 @@
- #include "cli/cli-setshow.h"
- #include "cli/cli-cmds.h"
-+#include "python/python.h"
++   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.
 +
- #ifdef TUI
- #include "tui/tui.h"          /* For tui_active et.al.   */
- #endif
-@@ -178,6 +180,7 @@ struct cmd_list_element *showchecklist;
- /* Command tracing state.  */
-+static int source_python = 0;
- int source_verbose = 0;
- int trace_commands = 0;
\f
-@@ -439,6 +442,7 @@ source_script (char *file, int from_tty)
-   struct cleanup *old_cleanups;
-   char *full_pathname = NULL;
-   int fd;
-+  int is_python;
-   if (file == NULL || *file == 0)
-     {
-@@ -471,8 +475,16 @@ source_script (char *file, int from_tty)
-       }
-     }
-+  is_python = source_python;
-+  if (strlen (file) > 3 && !strcmp (&file[strlen (file) - 3], ".py"))
-+    is_python = 1;
++   You should have received a copy of the GNU General Public License
++   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 +
-   stream = fdopen (fd, FOPEN_RT);
--  script_from_file (stream, file);
++#ifndef NM_LINUX64_H
++#define NM_LINUX64_H
 +
-+  if (is_python)
-+    source_python_script (stream, file);
-+  else
-+    script_from_file (stream, file);
-   do_cleanups (old_cleanups);
- }
-@@ -486,15 +498,30 @@ source_verbose_cleanup (void *old_value)
-   xfree (old_value);
- }
-+/* A helper for source_command.  Look for an argument in *ARGS.
-+   Update *ARGS by stripping leading whitespace.  If an argument is
-+   found, return it (a character).  Otherwise, return 0.  */
-+static int
-+find_argument (char **args)
-+{
-+  int result = 0;
-+  while (isspace ((*args)[0]))
-+    ++*args;
-+  if ((*args)[0] == '-' && isalpha ((*args)[1]))
-+    {
-+      result = (*args)[1];
-+      *args += 3;
-+    }
-+  return result;
-+}
++/* GNU/Linux supports the i386 hardware debugging registers.  */
++#define I386_USE_GENERIC_WATCHPOINTS
++#define I386_WATCHPOINTS_IN_TARGET_VECTOR
 +
- static void
- source_command (char *args, int from_tty)
- {
-   struct cleanup *old_cleanups;
--  char *file = args;
--  int *old_source_verbose = xmalloc (sizeof(int));
--  *old_source_verbose = source_verbose;
--  old_cleanups = make_cleanup (source_verbose_cleanup, old_source_verbose);
-+  old_cleanups = make_cleanup_restore_integer (&source_verbose);
-+  make_cleanup_restore_integer (&source_python);
-   /* -v causes the source command to run in verbose mode.
-      We still have to be able to handle filenames with spaces in a
-@@ -502,23 +529,28 @@ source_command (char *args, int from_tty)
-   if (args)
-     {
--      /* Make sure leading white space does not break the comparisons.  */
--      while (isspace(args[0]))
--      args++;
--
--      /* Is -v the first thing in the string?  */
--      if (args[0] == '-' && args[1] == 'v' && isspace (args[2]))
-+      while (1)
-       {
--        source_verbose = 1;
--
--        /* Trim -v and whitespace from the filename.  */
--        file = &args[3];
--        while (isspace (file[0]))
--          file++;
-+        int arg = find_argument (&args);
-+        if (!arg)
-+          break;
-+        switch (arg)
-+          {
-+          case 'v':
-+            source_verbose = 1;
-+            break;
-+          case 'p':
-+            source_python = 1;
-+            break;
-+          default:
-+            error (_("unrecognized option -%c"), arg);
-+          }
-       }
-     }
--  source_script (file, from_tty);
-+  source_script (args, from_tty);
++#include "i386/nm-i386.h"
++#include "config/nm-linux.h"
 +
-+  do_cleanups (old_cleanups);
- }
-@@ -1282,7 +1314,9 @@ Read commands from a file named FILE.\n\
- Optional -v switch (before the filename) causes each command in\n\
- FILE to be echoed as it is executed.\n\
- Note that the file \"%s\" is read automatically in this way\n\
--when GDB is started."), gdbinit);
-+when GDB is started.\n\
-+Optional -p switch (before the filename) causes FILE to be evaluated\n\
-+as Python code."), gdbinit);
-   c = add_cmd ("source", class_support, source_command,
-              source_help_text, &cmdlist);
-   set_cmd_completer (c, filename_completer);
-diff --git a/gdb/cli/cli-dump.c b/gdb/cli/cli-dump.c
-index ee29f2a..96e6111 100644
---- a/gdb/cli/cli-dump.c
-+++ b/gdb/cli/cli-dump.c
-@@ -296,7 +296,7 @@ dump_value_to_file (char *cmd, char *mode, char *file_format)
-       if (VALUE_LVAL (val))
-       {
--        vaddr = VALUE_ADDRESS (val);
-+        vaddr = value_address (val);
-       }
-       else
-       {
-diff --git a/gdb/coffread.c b/gdb/coffread.c
-index 6059d68..47ee601 100644
---- a/gdb/coffread.c
-+++ b/gdb/coffread.c
-@@ -346,7 +346,7 @@ coff_alloc_type (int index)
-      We will fill it in later if we find out how.  */
-   if (type == NULL)
-     {
--      type = alloc_type (current_objfile);
-+      type = alloc_type (current_objfile, NULL);
-       *type_addr = type;
-     }
-   return type;
-@@ -2101,6 +2101,7 @@ static struct sym_fns coff_sym_fns =
-   coff_new_init,              /* sym_new_init: init anything gbl to entire symtab */
-   coff_symfile_init,          /* sym_init: read initial info, setup for sym_read() */
-   coff_symfile_read,          /* sym_read: read a symbol file into symtab */
-+  NULL,                               /* sym_read_psymbols */
-   coff_symfile_finish,                /* sym_finish: finished with file, cleanup */
-   default_symfile_offsets,    /* sym_offsets:  xlate external to internal form */
-   default_symfile_segments,   /* sym_segments: Get segment information from
-diff --git a/gdb/config.in b/gdb/config.in
-index 6aaf77a..0c8ccab 100644
---- a/gdb/config.in
-+++ b/gdb/config.in
-@@ -42,6 +42,12 @@
-    language is requested. */
- #undef ENABLE_NLS
-+/* Global directory for GDB data files. */
-+#undef GDB_DATADIR
++/* Support for 8-byte wide hardware watchpoints.  */
++#define TARGET_HAS_DR_LEN_8 1
 +
-+/* Define if GDB datadir should be relocated when GDB is moved. */
-+#undef GDB_DATADIR_RELOCATABLE
++/* Provide access to the i386 hardware debugging registers.  */
 +
- /* Define to be a string naming the default host character set. */
- #undef GDB_DEFAULT_HOST_CHARSET
-@@ -169,12 +175,18 @@
- /* Define if you have the iconv() function. */
- #undef HAVE_ICONV
-+/* Define to 1 if you have the `iconvlist' function. */
-+#undef HAVE_ICONVLIST
++extern void amd64_linux_dr_set_control (unsigned long control);
++#define I386_DR_LOW_SET_CONTROL(control) \
++  amd64_linux_dr_set_control (control)
 +
- /* Define if your compiler supports the #include_next directive. */
- #undef HAVE_INCLUDE_NEXT
- /* Define to 1 if you have the <inttypes.h> header file. */
- #undef HAVE_INTTYPES_H
-+/* Define if you have <langinfo.h> and nl_langinfo(CODESET). */
-+#undef HAVE_LANGINFO_CODESET
++extern void amd64_linux_dr_set_addr (int regnum, CORE_ADDR addr);
++#define I386_DR_LOW_SET_ADDR(regnum, addr) \
++  amd64_linux_dr_set_addr (regnum, addr)
 +
- /* Define if your <locale.h> file defines LC_MESSAGES. */
- #undef HAVE_LC_MESSAGES
-@@ -618,6 +630,9 @@
-    'ptrdiff_t'. */
- #undef PTRDIFF_T_SUFFIX
-+/* Define to install path for Python sources */
-+#undef PYTHONDIR
++extern void amd64_linux_dr_reset_addr (int regnum);
++#define I386_DR_LOW_RESET_ADDR(regnum) \
++  amd64_linux_dr_reset_addr (regnum)
++
++extern unsigned long amd64_linux_dr_get_status (void);
++#define I386_DR_LOW_GET_STATUS() \
++  amd64_linux_dr_get_status ()
++
++#endif /* nm-linux64.h */
+diff --git a/gdb/config/mips/nm-irix5.h b/gdb/config/mips/nm-irix5.h
+new file mode 100644
+index 0000000..49ac420
+--- /dev/null
++++ b/gdb/config/mips/nm-irix5.h
+@@ -0,0 +1,44 @@
++/* Definitions for native support of irix5.
++
++   Copyright 1993, 1996, 1998, 1999, 2000, 2007, 2008, 2009
++   Free Software Foundation, Inc.
++
++   This file is part of GDB.
++
++   This program is free software; you can redistribute it and/or modify
++   it under the terms of the GNU General Public License as published by
++   the Free Software Foundation; either version 3 of the License, or
++   (at your option) any later version.
++
++   This program is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++   GNU General Public License for more details.
++
++   You should have received a copy of the GNU General Public License
++   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
++
++#define TARGET_HAS_HARDWARE_WATCHPOINTS
++
++/* TARGET_CAN_USE_HARDWARE_WATCHPOINT is now defined to go through
++   the target vector.  For Irix5, procfs_can_use_hw_watchpoint()
++   should be invoked.  */
++
++/* When a hardware watchpoint fires off the PC will be left at the
++   instruction which caused the watchpoint.  It will be necessary for
++   GDB to step over the watchpoint. */
++
++#define STOPPED_BY_WATCHPOINT(W) \
++     procfs_stopped_by_watchpoint(inferior_ptid)
++extern int procfs_stopped_by_watchpoint (ptid_t);
++
++/* Use these macros for watchpoint insertion/deletion.  */
++/* type can be 0: write watch, 1: read watch, 2: access watch (read/write) */
++#define target_insert_watchpoint(ADDR, LEN, TYPE) \
++     procfs_set_watchpoint (inferior_ptid, ADDR, LEN, TYPE, 0)
++#define target_remove_watchpoint(ADDR, LEN, TYPE) \
++     procfs_set_watchpoint (inferior_ptid, ADDR, 0, 0, 0)
++extern int procfs_set_watchpoint (ptid_t, CORE_ADDR, int, int, int);
++
++#define TARGET_REGION_SIZE_OK_FOR_HW_WATCHPOINT(SIZE) 1
 +
- /* Bug reporting address */
- #undef REPORT_BUGS_TO
 diff --git a/gdb/configure b/gdb/configure
-index 7579c84..3a5b582 100755
+index 99acc2f..a2ea1ae 100755
 --- a/gdb/configure
 +++ b/gdb/configure
-@@ -314,7 +314,7 @@ ac_subdirs_all="$ac_subdirs_all doc testsuite"
- ac_subdirs_all="$ac_subdirs_all gdbtk"
- ac_subdirs_all="$ac_subdirs_all multi-ice"
- ac_subdirs_all="$ac_subdirs_all gdbserver"
--ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS MAINTAINER_MODE_TRUE MAINTAINER_MODE_FALSE MAINT CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT CPP EGREP RANLIB ac_ct_RANLIB build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os am__leading_dot DEPDIR CCDEPMODE MAKE GMAKE_TRUE GMAKE_FALSE SET_MAKE USE_NLS LIBINTL LIBINTL_DEP INCINTL XGETTEXT GMSGFMT POSUB CATALOGS DATADIRNAME INSTOBJEXT GENCAT CATOBJEXT localedir GL_COND_LIBTOOL_TRUE GL_COND_LIBTOOL_FALSE GNULIB_MEMMEM GNULIB_MEMPCPY GNULIB_MEMRCHR GNULIB_STPCPY GNULIB_STPNCPY GNULIB_STRCHRNUL GNULIB_STRDUP GNULIB_STRNDUP GNULIB_STRNLEN GNULIB_STRPBRK GNULIB_STRSEP GNULIB_STRSTR GNULIB_STRCASESTR GNULIB_STRTOK_R GNULIB_MBSLEN GNULIB_MBSNLEN GNULIB_MBSCHR GNULIB_MBSRCHR GNULIB_MBSSTR GNULIB_MBSCASECMP GNULIB_MBSNCASECMP GNULIB_MBSPCASECMP GNULIB_MBSCASESTR GNULIB_MBSCSPN GNULIB_MBSPBRK GNULIB_MBSSPN GNULIB_MBSSEP GNULIB_MBSTOK_R GNULIB_STRERROR GNULIB_STRSIGNAL HAVE_DECL_MEMMEM HAVE_MEMPCPY HAVE_DECL_MEMRCHR HAVE_STPCPY HAVE_STPNCPY HAVE_STRCHRNUL HAVE_DECL_STRDUP HAVE_STRNDUP HAVE_DECL_STRNDUP HAVE_DECL_STRNLEN HAVE_STRPBRK HAVE_STRSEP HAVE_STRCASESTR HAVE_DECL_STRTOK_R HAVE_DECL_STRERROR HAVE_DECL_STRSIGNAL REPLACE_STRERROR REPLACE_STRSIGNAL REPLACE_MEMMEM REPLACE_STRCASESTR REPLACE_STRSTR HAVE_LONG_LONG_INT HAVE_UNSIGNED_LONG_LONG_INT HAVE_INTTYPES_H HAVE_SYS_TYPES_H INCLUDE_NEXT NEXT_STDINT_H HAVE_STDINT_H HAVE_SYS_INTTYPES_H HAVE_SYS_BITYPES_H BITSIZEOF_PTRDIFF_T BITSIZEOF_SIG_ATOMIC_T BITSIZEOF_SIZE_T BITSIZEOF_WCHAR_T BITSIZEOF_WINT_T HAVE_SIGNED_SIG_ATOMIC_T HAVE_SIGNED_WCHAR_T HAVE_SIGNED_WINT_T PTRDIFF_T_SUFFIX SIG_ATOMIC_T_SUFFIX SIZE_T_SUFFIX WCHAR_T_SUFFIX WINT_T_SUFFIX STDINT_H NEXT_STRING_H GNULIB_WCWIDTH HAVE_DECL_WCWIDTH REPLACE_WCWIDTH WCHAR_H HAVE_WCHAR_H NEXT_WCHAR_H LIBGNU_LIBDEPS LIBGNU_LTLIBDEPS GNULIB_STDINT_H PACKAGE INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM mkdir_p AWK AMTAR am__tar am__untar am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH am__fastdepCC_TRUE am__fastdepCC_FALSE subdirs TARGET_OBS PKGVERSION REPORT_BUGS_TO REPORT_BUGS_TEXI LN_S YACC AR ac_ct_AR DLLTOOL ac_ct_DLLTOOL WINDRES ac_ct_WINDRES MIG ac_ct_MIG READLINE READLINE_DEPS READLINE_CFLAGS HAVE_LIBEXPAT LIBEXPAT LTLIBEXPAT PYTHON_CFLAGS ALLOCA CONFIG_LDFLAGS TARGET_SYSTEM_ROOT TARGET_SYSTEM_ROOT_DEFINE WARN_CFLAGS WERROR_CFLAGS SER_HARDWIRE WIN32LIBS LIBGUI GUI_CFLAGS_X WIN32LDAPP TCL_VERSION TCL_PATCH_LEVEL TCL_BIN_DIR TCL_SRC_DIR TCL_LIB_FILE TCL_LIB_FLAG TCL_LIB_SPEC TCL_STUB_LIB_FILE TCL_STUB_LIB_FLAG TCL_STUB_LIB_SPEC TCL_INCLUDE TCL_LIBRARY TCL_DEPS TK_VERSION TK_BIN_DIR TK_SRC_DIR TK_LIB_FILE TK_LIB_FLAG TK_LIB_SPEC TK_STUB_LIB_FILE TK_STUB_LIB_FLAG TK_STUB_LIB_SPEC TK_INCLUDE TK_LIBRARY TK_DEPS TK_XINCLUDES X_CFLAGS X_LDFLAGS X_LIBS GDBTKLIBS GDBTK_CFLAGS GDBTK_SRC_DIR SIM SIM_OBS ENABLE_CFLAGS PROFILE_CFLAGS CONFIG_OBS CONFIG_DEPS CONFIG_SRCS CONFIG_ALL CONFIG_CLEAN CONFIG_INSTALL CONFIG_UNINSTALL target_subdir frags nm_h LIBICONV LIBOBJS LTLIBOBJS gl_LIBOBJS gl_LTLIBOBJS gltests_LIBOBJS gltests_LTLIBOBJS'
-+ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS MAINTAINER_MODE_TRUE MAINTAINER_MODE_FALSE MAINT CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT CPP EGREP RANLIB ac_ct_RANLIB build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os am__leading_dot DEPDIR CCDEPMODE MAKE GMAKE_TRUE GMAKE_FALSE SET_MAKE USE_NLS LIBINTL LIBINTL_DEP INCINTL XGETTEXT GMSGFMT POSUB CATALOGS DATADIRNAME INSTOBJEXT GENCAT CATOBJEXT localedir GL_COND_LIBTOOL_TRUE GL_COND_LIBTOOL_FALSE GNULIB_MEMMEM GNULIB_MEMPCPY GNULIB_MEMRCHR GNULIB_STPCPY GNULIB_STPNCPY GNULIB_STRCHRNUL GNULIB_STRDUP GNULIB_STRNDUP GNULIB_STRNLEN GNULIB_STRPBRK GNULIB_STRSEP GNULIB_STRSTR GNULIB_STRCASESTR GNULIB_STRTOK_R GNULIB_MBSLEN GNULIB_MBSNLEN GNULIB_MBSCHR GNULIB_MBSRCHR GNULIB_MBSSTR GNULIB_MBSCASECMP GNULIB_MBSNCASECMP GNULIB_MBSPCASECMP GNULIB_MBSCASESTR GNULIB_MBSCSPN GNULIB_MBSPBRK GNULIB_MBSSPN GNULIB_MBSSEP GNULIB_MBSTOK_R GNULIB_STRERROR GNULIB_STRSIGNAL HAVE_DECL_MEMMEM HAVE_MEMPCPY HAVE_DECL_MEMRCHR HAVE_STPCPY HAVE_STPNCPY HAVE_STRCHRNUL HAVE_DECL_STRDUP HAVE_STRNDUP HAVE_DECL_STRNDUP HAVE_DECL_STRNLEN HAVE_STRPBRK HAVE_STRSEP HAVE_STRCASESTR HAVE_DECL_STRTOK_R HAVE_DECL_STRERROR HAVE_DECL_STRSIGNAL REPLACE_STRERROR REPLACE_STRSIGNAL REPLACE_MEMMEM REPLACE_STRCASESTR REPLACE_STRSTR HAVE_LONG_LONG_INT HAVE_UNSIGNED_LONG_LONG_INT HAVE_INTTYPES_H HAVE_SYS_TYPES_H INCLUDE_NEXT NEXT_STDINT_H HAVE_STDINT_H HAVE_SYS_INTTYPES_H HAVE_SYS_BITYPES_H BITSIZEOF_PTRDIFF_T BITSIZEOF_SIG_ATOMIC_T BITSIZEOF_SIZE_T BITSIZEOF_WCHAR_T BITSIZEOF_WINT_T HAVE_SIGNED_SIG_ATOMIC_T HAVE_SIGNED_WCHAR_T HAVE_SIGNED_WINT_T PTRDIFF_T_SUFFIX SIG_ATOMIC_T_SUFFIX SIZE_T_SUFFIX WCHAR_T_SUFFIX WINT_T_SUFFIX STDINT_H NEXT_STRING_H GNULIB_WCWIDTH HAVE_DECL_WCWIDTH REPLACE_WCWIDTH WCHAR_H HAVE_WCHAR_H NEXT_WCHAR_H LIBGNU_LIBDEPS LIBGNU_LTLIBDEPS GNULIB_STDINT_H PACKAGE INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM mkdir_p AWK AMTAR am__tar am__untar am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH am__fastdepCC_TRUE am__fastdepCC_FALSE GDB_DATADIR_PATH pythondir subdirs TARGET_OBS PKGVERSION REPORT_BUGS_TO REPORT_BUGS_TEXI LN_S YACC AR ac_ct_AR DLLTOOL ac_ct_DLLTOOL WINDRES ac_ct_WINDRES MIG ac_ct_MIG LIBICONV LIBICONV_INCLUDE LIBICONV_LIBDIR READLINE READLINE_DEPS READLINE_CFLAGS HAVE_LIBEXPAT LIBEXPAT LTLIBEXPAT PYTHON_CFLAGS ALLOCA CONFIG_LDFLAGS TARGET_SYSTEM_ROOT TARGET_SYSTEM_ROOT_DEFINE WARN_CFLAGS WERROR_CFLAGS SER_HARDWIRE WIN32LIBS LIBGUI GUI_CFLAGS_X WIN32LDAPP TCL_VERSION TCL_PATCH_LEVEL TCL_BIN_DIR TCL_SRC_DIR TCL_LIB_FILE TCL_LIB_FLAG TCL_LIB_SPEC TCL_STUB_LIB_FILE TCL_STUB_LIB_FLAG TCL_STUB_LIB_SPEC TCL_INCLUDE TCL_LIBRARY TCL_DEPS TK_VERSION TK_BIN_DIR TK_SRC_DIR TK_LIB_FILE TK_LIB_FLAG TK_LIB_SPEC TK_STUB_LIB_FILE TK_STUB_LIB_FLAG TK_STUB_LIB_SPEC TK_INCLUDE TK_LIBRARY TK_DEPS TK_XINCLUDES X_CFLAGS X_LDFLAGS X_LIBS GDBTKLIBS GDBTK_CFLAGS GDBTK_SRC_DIR SIM SIM_OBS ENABLE_CFLAGS PROFILE_CFLAGS CONFIG_OBS CONFIG_DEPS CONFIG_SRCS CONFIG_ALL CONFIG_CLEAN CONFIG_INSTALL CONFIG_UNINSTALL target_subdir frags nm_h LIBOBJS LTLIBOBJS gl_LIBOBJS gl_LTLIBOBJS gltests_LIBOBJS gltests_LTLIBOBJS'
- ac_subst_files='host_makefile_frag'
- ac_pwd=`pwd`
-@@ -882,9 +882,14 @@ Optional Packages:
-   --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
-   --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
-   --with-separate-debug-dir=path   Look for global separate debug info in this path LIBDIR/debug
+@@ -676,6 +676,8 @@ REPORT_BUGS_TO
+ PKGVERSION
+ TARGET_OBS
+ subdirs
++pythondir
++GDB_DATADIR_PATH
+ GDB_DATADIR
+ DEBUGDIR
+ am__fastdepCC_FALSE
+@@ -883,6 +885,7 @@ enable_dependency_tracking
+ with_separate_debug_dir
+ with_gdb_datadir
+ with_relocated_sources
++with_pythondir
+ enable_targets
+ enable_64_bit_bfd
+ enable_gdbcli
+@@ -1581,6 +1584,10 @@ Optional Packages:
+                           [DATADIR/gdb]
+   --with-relocated-sources=PATH
+                           automatically relocate this path for source files
 +  --with-gdb-datadir      look for global separate data files in this path
 +                          [DATADIR/gdb]
 +  --with-pythondir        install Python data files in this path
 +                          [DATADIR/gdb/python]
-   --with-libunwind            Use libunwind frame unwinding support
-   --with-pkgversion=PKG   Use PKG in the version string in place of "GDB"
-   --with-bugurl=URL       Direct users to URL to report a bug
-+  --with-libiconv-prefix=DIR  search for libiconv in DIR/include and DIR/lib
-   --with-system-readline  use installed readline library
-   --with-expat            include expat support (auto/yes/no)
-   --with-gnu-ld           assume the C compiler uses GNU ld default=no
-@@ -899,7 +904,6 @@ Optional Packages:
-   --with-tcl              directory containing tcl configuration (tclConfig.sh)
-   --with-tk               directory containing tk configuration (tkConfig.sh)
-   --with-x                use the X Window System
--  --with-libiconv-prefix=DIR  search for libiconv in DIR/include and DIR/lib
- Some influential environment variables:
-   CC          C compiler command
-@@ -7130,6 +7134,75 @@ _ACEOF
-   ;;
- esac
+   --with-libunwind        use libunwind frame unwinding support
+   --with-curses           use the curses library instead of the termcap
+                           library
+@@ -6602,6 +6609,73 @@ _ACEOF
+ fi
  
 +# GDB's datadir relocation
 +
 +gdbdatadir=${datadir}/gdb
 +
 +
-+# Check whether --with-gdb-datadir or --without-gdb-datadir was given.
-+if test "${with_gdb_datadir+set}" = set; then
-+  withval="$with_gdb_datadir"
-+  gdbdatadir="${withval}"
-+fi;
++# Check whether --with-gdb-datadir was given.
++if test "${with_gdb_datadir+set}" = set; then :
++  withval=$with_gdb_datadir; gdbdatadir="${withval}"
++fi
++
 +
 +
 +  test "x$prefix" = xNONE && prefix="$ac_default_prefix"
@@ -10998,9 +2972,7 @@ index 7579c84..3a5b582 100755
 +  "${test_prefix}"|"${test_prefix}/"*|\
 +  '${exec_prefix}'|'${exec_prefix}/'*)
 +
-+cat >>confdefs.h <<\_ACEOF
-+#define GDB_DATADIR_RELOCATABLE 1
-+_ACEOF
++$as_echo "#define GDB_DATADIR_RELOCATABLE 1" >>confdefs.h
 +
 +  ;;
 +esac
@@ -11008,13 +2980,13 @@ index 7579c84..3a5b582 100755
 +
 +
 +
-+# Check whether --with-pythondir or --without-pythondir was given.
-+if test "${with_pythondir+set}" = set; then
-+  withval="$with_pythondir"
-+  pythondir="${withval}"
++# Check whether --with-pythondir was given.
++if test "${with_pythondir+set}" = set; then :
++  withval=$with_pythondir; pythondir="${withval}"
 +else
 +  pythondir=no
-+fi;
++fi
++
 +
 +# If the user passed in a path, define it.  Otherwise, compute it at
 +# runtime based on the possibly-relocatable datadir.
@@ -11033,234 +3005,72 @@ index 7579c84..3a5b582 100755
  
  
  subdirs="$subdirs doc testsuite"
-@@ -9989,6 +10062,226 @@ if test "$ac_cv_search_dlgetmodinfo" != no; then
- fi
+@@ -9282,6 +9356,8 @@ $as_echo "#define HAVE_PYTHON 1" >>confdefs.h
+   CONFIG_OBS="$CONFIG_OBS \$(SUBDIR_PYTHON_OBS)"
+   CONFIG_DEPS="$CONFIG_DEPS \$(SUBDIR_PYTHON_DEPS)"
+   CONFIG_SRCS="$CONFIG_SRCS \$(SUBDIR_PYTHON_SRCS)"
++  CONFIG_INSTALL="$CONFIG_INSTALL install-python"
++  CONFIG_UNINSTALL="$CONFIG_UNINSTALL uninstall-python"
+   ENABLE_CFLAGS="$ENABLE_CFLAGS \$(SUBDIR_PYTHON_CFLAGS)"
  
+   # Flags needed to compile Python code (taken from python-config --cflags).
+diff --git a/gdb/configure.ac b/gdb/configure.ac
+index b31d9b7..a1969bc 100644
+--- a/gdb/configure.ac
++++ b/gdb/configure.ac
+@@ -107,6 +107,51 @@ AS_HELP_STRING([--with-relocated-sources=PATH], [automatically relocate this pat
+               [Relocated directory for source files. ])
+ ])
  
++# GDB's datadir relocation
 +
++gdbdatadir=${datadir}/gdb
 +
++AC_ARG_WITH([gdb-datadir],
++  [AS_HELP_STRING([--with-gdb-datadir],
++                  [look for global separate data files in this path [DATADIR/gdb]])], [gdbdatadir="${withval}"])
 +
-+# Check whether --with-libiconv-prefix or --without-libiconv-prefix was given.
-+if test "${with_libiconv_prefix+set}" = set; then
-+  withval="$with_libiconv_prefix"
-+
-+    for dir in `echo "$withval" | tr : ' '`; do
-+      if test -d $dir/include; then LIBICONV_INCLUDE="-I$dir/include"; CPPFLAGS="$CPPFLAGS -I$dir/include"; fi
-+      if test -d $dir/lib; then LIBICONV_LIBDIR="-L$dir/lib"; LDFLAGS="$LDFLAGS -L$dir/lib"; fi
-+    done
-+
-+fi;
-+
-+  echo "$as_me:$LINENO: checking for iconv" >&5
-+echo $ECHO_N "checking for iconv... $ECHO_C" >&6
-+if test "${am_cv_func_iconv+set}" = set; then
-+  echo $ECHO_N "(cached) $ECHO_C" >&6
-+else
-+
-+    am_cv_func_iconv="no, consider installing GNU libiconv"
-+    am_cv_lib_iconv=no
-+    cat >conftest.$ac_ext <<_ACEOF
-+/* confdefs.h.  */
-+_ACEOF
-+cat confdefs.h >>conftest.$ac_ext
-+cat >>conftest.$ac_ext <<_ACEOF
-+/* end confdefs.h.  */
-+#include <stdlib.h>
-+#include <iconv.h>
-+int
-+main ()
-+{
-+iconv_t cd = iconv_open("","");
-+       iconv(cd,NULL,NULL,NULL,NULL);
-+       iconv_close(cd);
-+  ;
-+  return 0;
-+}
-+_ACEOF
-+rm -f conftest.$ac_objext conftest$ac_exeext
-+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-+  (eval $ac_link) 2>conftest.er1
-+  ac_status=$?
-+  grep -v '^ *+' conftest.er1 >conftest.err
-+  rm -f conftest.er1
-+  cat conftest.err >&5
-+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+  (exit $ac_status); } &&
-+       { ac_try='test -z "$ac_c_werror_flag"
-+                       || test ! -s conftest.err'
-+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-+  (eval $ac_try) 2>&5
-+  ac_status=$?
-+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+  (exit $ac_status); }; } &&
-+       { ac_try='test -s conftest$ac_exeext'
-+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-+  (eval $ac_try) 2>&5
-+  ac_status=$?
-+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+  (exit $ac_status); }; }; then
-+  am_cv_func_iconv=yes
-+else
-+  echo "$as_me: failed program was:" >&5
-+sed 's/^/| /' conftest.$ac_ext >&5
++AC_DEFINE_DIR(GDB_DATADIR, gdbdatadir,
++              [Global directory for GDB data files. ])
 +
-+fi
-+rm -f conftest.err conftest.$ac_objext \
-+      conftest$ac_exeext conftest.$ac_ext
-+    if test "$am_cv_func_iconv" != yes; then
-+      am_save_LIBS="$LIBS"
-+      LIBS="$LIBS -liconv"
-+      cat >conftest.$ac_ext <<_ACEOF
-+/* confdefs.h.  */
-+_ACEOF
-+cat confdefs.h >>conftest.$ac_ext
-+cat >>conftest.$ac_ext <<_ACEOF
-+/* end confdefs.h.  */
-+#include <stdlib.h>
-+#include <iconv.h>
-+int
-+main ()
-+{
-+iconv_t cd = iconv_open("","");
-+         iconv(cd,NULL,NULL,NULL,NULL);
-+         iconv_close(cd);
-+  ;
-+  return 0;
-+}
-+_ACEOF
-+rm -f conftest.$ac_objext conftest$ac_exeext
-+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-+  (eval $ac_link) 2>conftest.er1
-+  ac_status=$?
-+  grep -v '^ *+' conftest.er1 >conftest.err
-+  rm -f conftest.er1
-+  cat conftest.err >&5
-+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+  (exit $ac_status); } &&
-+       { ac_try='test -z "$ac_c_werror_flag"
-+                       || test ! -s conftest.err'
-+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-+  (eval $ac_try) 2>&5
-+  ac_status=$?
-+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+  (exit $ac_status); }; } &&
-+       { ac_try='test -s conftest$ac_exeext'
-+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-+  (eval $ac_try) 2>&5
-+  ac_status=$?
-+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+  (exit $ac_status); }; }; then
-+  am_cv_lib_iconv=yes
-+        am_cv_func_iconv=yes
++if test "x$exec_prefix" = xNONE || test "x$exec_prefix" = 'x${prefix}'; then
++  if test "x$prefix" = xNONE; then
++    test_prefix=/usr/local
++  else
++    test_prefix=$prefix
++  fi
 +else
-+  echo "$as_me: failed program was:" >&5
-+sed 's/^/| /' conftest.$ac_ext >&5
-+
-+fi
-+rm -f conftest.err conftest.$ac_objext \
-+      conftest$ac_exeext conftest.$ac_ext
-+      LIBS="$am_save_LIBS"
-+    fi
-+
++  test_prefix=$exec_prefix
 +fi
-+echo "$as_me:$LINENO: result: $am_cv_func_iconv" >&5
-+echo "${ECHO_T}$am_cv_func_iconv" >&6
-+  if test "$am_cv_func_iconv" = yes; then
 +
-+cat >>confdefs.h <<\_ACEOF
-+#define HAVE_ICONV 1
-+_ACEOF
-+
-+    echo "$as_me:$LINENO: checking for iconv declaration" >&5
-+echo $ECHO_N "checking for iconv declaration... $ECHO_C" >&6
-+    if test "${am_cv_proto_iconv+set}" = set; then
-+  echo $ECHO_N "(cached) $ECHO_C" >&6
-+else
-+
-+      cat >conftest.$ac_ext <<_ACEOF
-+/* confdefs.h.  */
-+_ACEOF
-+cat confdefs.h >>conftest.$ac_ext
-+cat >>conftest.$ac_ext <<_ACEOF
-+/* end confdefs.h.  */
-+
-+#include <stdlib.h>
-+#include <iconv.h>
-+extern
-+#ifdef __cplusplus
-+"C"
-+#endif
-+#if defined(__STDC__) || defined(__cplusplus)
-+size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);
-+#else
-+size_t iconv();
-+#endif
++case ${gdbdatadir} in
++  "${test_prefix}"|"${test_prefix}/"*|\
++  '${exec_prefix}'|'${exec_prefix}/'*)
++    AC_DEFINE(GDB_DATADIR_RELOCATABLE, 1, [Define if GDB datadir should be relocated when GDB is moved.])
++  ;;
++esac
++GDB_DATADIR_PATH=${gdbdatadir}
++AC_SUBST(GDB_DATADIR_PATH)
 +
-+int
-+main ()
-+{
++AC_ARG_WITH([pythondir],
++  [AS_HELP_STRING([--with-pythondir],
++                  [install Python data files in this path [DATADIR/gdb/python]])], [pythondir="${withval}"], [pythondir=no])
 +
-+  ;
-+  return 0;
-+}
-+_ACEOF
-+rm -f conftest.$ac_objext
-+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-+  (eval $ac_compile) 2>conftest.er1
-+  ac_status=$?
-+  grep -v '^ *+' conftest.er1 >conftest.err
-+  rm -f conftest.er1
-+  cat conftest.err >&5
-+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+  (exit $ac_status); } &&
-+       { ac_try='test -z "$ac_c_werror_flag"
-+                       || test ! -s conftest.err'
-+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-+  (eval $ac_try) 2>&5
-+  ac_status=$?
-+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+  (exit $ac_status); }; } &&
-+       { ac_try='test -s conftest.$ac_objext'
-+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-+  (eval $ac_try) 2>&5
-+  ac_status=$?
-+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+  (exit $ac_status); }; }; then
-+  am_cv_proto_iconv_arg1=""
++# If the user passed in a path, define it.  Otherwise, compute it at
++# runtime based on the possibly-relocatable datadir.
++if test "$pythondir" = "no"; then
++  pythondir='$(GDB_DATADIR_PATH)/python'
 +else
-+  echo "$as_me: failed program was:" >&5
-+sed 's/^/| /' conftest.$ac_ext >&5
-+
-+am_cv_proto_iconv_arg1="const"
-+fi
-+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-+      am_cv_proto_iconv="extern size_t iconv (iconv_t cd, $am_cv_proto_iconv_arg1 char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);"
++  AC_DEFINE_UNQUOTED(PYTHONDIR, "$pythondir",
++      [Define to install path for Python sources])
 +fi
-+
-+    am_cv_proto_iconv=`echo "$am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'`
-+    echo "$as_me:$LINENO: result: ${ac_t:-
-+         }$am_cv_proto_iconv" >&5
-+echo "${ECHO_T}${ac_t:-
-+         }$am_cv_proto_iconv" >&6
-+
-+cat >>confdefs.h <<_ACEOF
-+#define ICONV_CONST $am_cv_proto_iconv_arg1
-+_ACEOF
-+
-+  fi
-+  LIBICONV=
-+  if test "$am_cv_lib_iconv" = yes; then
-+    LIBICONV="-liconv"
-+  fi
-+
-+
-+
++AC_SUBST(pythondir)
 +
 +
- # On alpha-osf, it appears that libtermcap and libcurses are not compatible.
- # There is a very specific comment in /usr/include/curses.h explaining that
- # termcap routines built into libcurses must not be used.
-@@ -11418,6 +11711,8 @@ _ACEOF
+ AC_CONFIG_SUBDIRS(doc testsuite)
+ # Check whether to support alternative target configurations
+@@ -658,6 +703,8 @@ if test "${have_libpython}" = yes; then
    CONFIG_OBS="$CONFIG_OBS \$(SUBDIR_PYTHON_OBS)"
    CONFIG_DEPS="$CONFIG_DEPS \$(SUBDIR_PYTHON_DEPS)"
    CONFIG_SRCS="$CONFIG_SRCS \$(SUBDIR_PYTHON_SRCS)"
@@ -11269,749 +3079,97 @@ index 7579c84..3a5b582 100755
    ENABLE_CFLAGS="$ENABLE_CFLAGS \$(SUBDIR_PYTHON_CFLAGS)"
  
    # Flags needed to compile Python code (taken from python-config --cflags).
-@@ -15445,10 +15740,11 @@ fi
+diff --git a/gdb/cp-name-parser.y b/gdb/cp-name-parser.y
+index 62800b8..97d587b 100644
+--- a/gdb/cp-name-parser.y
++++ b/gdb/cp-name-parser.y
+@@ -1,7 +1,6 @@
+ /* YACC parser for C++ names, for GDB.
  
+-   Copyright (C) 2003, 2004, 2005, 2007, 2008, 2009
+-   Free Software Foundation, Inc.
++   Copyright (C) 2003, 2004, 2005, 2007, 2008, 2009 Free Software Foundation, Inc.
  
+    Parts of the lexer are based on c-exp.y from GDB.
  
-+
- for ac_func in canonicalize_file_name realpath getrusage getuid \
-                 getgid poll pread64 sbrk setpgid setpgrp setsid \
-               sigaction sigprocmask sigsetmask socketpair syscall \
--              ttrace wborder setlocale
-+              ttrace wborder setlocale iconvlist
- do
- as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
- echo "$as_me:$LINENO: checking for $ac_func" >&5
-@@ -15550,6 +15846,70 @@ fi
- done
+@@ -389,7 +388,7 @@ function
+               |       colon_ext_only function_arglist start_opt
+                       { $$ = fill_comp (DEMANGLE_COMPONENT_TYPED_NAME, $1, $2.comp);
+                         if ($3) $$ = fill_comp (DEMANGLE_COMPONENT_LOCAL_NAME, $$, $3); }
+-
++              |       colon_ext_only
+               |       conversion_op_name start_opt
+                       { $$ = $1.comp;
+                         if ($2) $$ = fill_comp (DEMANGLE_COMPONENT_LOCAL_NAME, $$, $2); }
+diff --git a/gdb/cp-namespace.c b/gdb/cp-namespace.c
+index d2d8f2e..af0ba28 100644
+--- a/gdb/cp-namespace.c
++++ b/gdb/cp-namespace.c
+@@ -36,14 +36,17 @@ static struct using_direct *cp_copy_usings (struct using_direct *using,
+                                           struct obstack *obstack);
  
+ static struct symbol *lookup_namespace_scope (const char *name,
+-                                            const char *linkage_name,
+                                             const struct block *block,
+                                             const domain_enum domain,
+                                             const char *scope,
+                                             int scope_len);
  
-+  echo "$as_me:$LINENO: checking for nl_langinfo and CODESET" >&5
-+echo $ECHO_N "checking for nl_langinfo and CODESET... $ECHO_C" >&6
-+if test "${am_cv_langinfo_codeset+set}" = set; then
-+  echo $ECHO_N "(cached) $ECHO_C" >&6
-+else
-+  cat >conftest.$ac_ext <<_ACEOF
-+/* confdefs.h.  */
-+_ACEOF
-+cat confdefs.h >>conftest.$ac_ext
-+cat >>conftest.$ac_ext <<_ACEOF
-+/* end confdefs.h.  */
-+#include <langinfo.h>
-+int
-+main ()
-+{
-+char* cs = nl_langinfo(CODESET);
-+  ;
-+  return 0;
-+}
-+_ACEOF
-+rm -f conftest.$ac_objext conftest$ac_exeext
-+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-+  (eval $ac_link) 2>conftest.er1
-+  ac_status=$?
-+  grep -v '^ *+' conftest.er1 >conftest.err
-+  rm -f conftest.er1
-+  cat conftest.err >&5
-+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+  (exit $ac_status); } &&
-+       { ac_try='test -z "$ac_c_werror_flag"
-+                       || test ! -s conftest.err'
-+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-+  (eval $ac_try) 2>&5
-+  ac_status=$?
-+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+  (exit $ac_status); }; } &&
-+       { ac_try='test -s conftest$ac_exeext'
-+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-+  (eval $ac_try) 2>&5
-+  ac_status=$?
-+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+  (exit $ac_status); }; }; then
-+  am_cv_langinfo_codeset=yes
-+else
-+  echo "$as_me: failed program was:" >&5
-+sed 's/^/| /' conftest.$ac_ext >&5
-+
-+am_cv_langinfo_codeset=no
-+fi
-+rm -f conftest.err conftest.$ac_objext \
-+      conftest$ac_exeext conftest.$ac_ext
-+
-+fi
-+echo "$as_me:$LINENO: result: $am_cv_langinfo_codeset" >&5
-+echo "${ECHO_T}$am_cv_langinfo_codeset" >&6
-+  if test $am_cv_langinfo_codeset = yes; then
-+
-+cat >>confdefs.h <<\_ACEOF
-+#define HAVE_LANGINFO_CODESET 1
-+_ACEOF
-+
-+  fi
-+
-+
- # Check the return and argument types of ptrace.  No canned test for
- # this, so roll our own.
- gdb_ptrace_headers='
-@@ -20776,230 +21136,11 @@ done
--
- cat >>confdefs.h <<\_ACEOF
--#define GDB_DEFAULT_HOST_CHARSET "ISO-8859-1"
-+#define GDB_DEFAULT_HOST_CHARSET "UTF-8"
- _ACEOF
--
--
--
--# Check whether --with-libiconv-prefix or --without-libiconv-prefix was given.
--if test "${with_libiconv_prefix+set}" = set; then
--  withval="$with_libiconv_prefix"
--
--    for dir in `echo "$withval" | tr : ' '`; do
--      if test -d $dir/include; then CPPFLAGS="$CPPFLAGS -I$dir/include"; fi
--      if test -d $dir/lib; then LDFLAGS="$LDFLAGS -L$dir/lib"; fi
--    done
--
--fi;
--
--  echo "$as_me:$LINENO: checking for iconv" >&5
--echo $ECHO_N "checking for iconv... $ECHO_C" >&6
--if test "${am_cv_func_iconv+set}" = set; then
--  echo $ECHO_N "(cached) $ECHO_C" >&6
--else
--
--    am_cv_func_iconv="no, consider installing GNU libiconv"
--    am_cv_lib_iconv=no
--    cat >conftest.$ac_ext <<_ACEOF
--/* confdefs.h.  */
--_ACEOF
--cat confdefs.h >>conftest.$ac_ext
--cat >>conftest.$ac_ext <<_ACEOF
--/* end confdefs.h.  */
--#include <stdlib.h>
--#include <iconv.h>
--int
--main ()
--{
--iconv_t cd = iconv_open("","");
--       iconv(cd,NULL,NULL,NULL,NULL);
--       iconv_close(cd);
--  ;
--  return 0;
--}
--_ACEOF
--rm -f conftest.$ac_objext conftest$ac_exeext
--if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
--  (eval $ac_link) 2>conftest.er1
--  ac_status=$?
--  grep -v '^ *+' conftest.er1 >conftest.err
--  rm -f conftest.er1
--  cat conftest.err >&5
--  echo "$as_me:$LINENO: \$? = $ac_status" >&5
--  (exit $ac_status); } &&
--       { ac_try='test -z "$ac_c_werror_flag"
--                       || test ! -s conftest.err'
--  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
--  (eval $ac_try) 2>&5
--  ac_status=$?
--  echo "$as_me:$LINENO: \$? = $ac_status" >&5
--  (exit $ac_status); }; } &&
--       { ac_try='test -s conftest$ac_exeext'
--  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
--  (eval $ac_try) 2>&5
--  ac_status=$?
--  echo "$as_me:$LINENO: \$? = $ac_status" >&5
--  (exit $ac_status); }; }; then
--  am_cv_func_iconv=yes
--else
--  echo "$as_me: failed program was:" >&5
--sed 's/^/| /' conftest.$ac_ext >&5
--
--fi
--rm -f conftest.err conftest.$ac_objext \
--      conftest$ac_exeext conftest.$ac_ext
--    if test "$am_cv_func_iconv" != yes; then
--      am_save_LIBS="$LIBS"
--      LIBS="$LIBS -liconv"
--      cat >conftest.$ac_ext <<_ACEOF
--/* confdefs.h.  */
--_ACEOF
--cat confdefs.h >>conftest.$ac_ext
--cat >>conftest.$ac_ext <<_ACEOF
--/* end confdefs.h.  */
--#include <stdlib.h>
--#include <iconv.h>
--int
--main ()
--{
--iconv_t cd = iconv_open("","");
--         iconv(cd,NULL,NULL,NULL,NULL);
--         iconv_close(cd);
--  ;
--  return 0;
--}
--_ACEOF
--rm -f conftest.$ac_objext conftest$ac_exeext
--if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
--  (eval $ac_link) 2>conftest.er1
--  ac_status=$?
--  grep -v '^ *+' conftest.er1 >conftest.err
--  rm -f conftest.er1
--  cat conftest.err >&5
--  echo "$as_me:$LINENO: \$? = $ac_status" >&5
--  (exit $ac_status); } &&
--       { ac_try='test -z "$ac_c_werror_flag"
--                       || test ! -s conftest.err'
--  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
--  (eval $ac_try) 2>&5
--  ac_status=$?
--  echo "$as_me:$LINENO: \$? = $ac_status" >&5
--  (exit $ac_status); }; } &&
--       { ac_try='test -s conftest$ac_exeext'
--  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
--  (eval $ac_try) 2>&5
--  ac_status=$?
--  echo "$as_me:$LINENO: \$? = $ac_status" >&5
--  (exit $ac_status); }; }; then
--  am_cv_lib_iconv=yes
--        am_cv_func_iconv=yes
--else
--  echo "$as_me: failed program was:" >&5
--sed 's/^/| /' conftest.$ac_ext >&5
--
--fi
--rm -f conftest.err conftest.$ac_objext \
--      conftest$ac_exeext conftest.$ac_ext
--      LIBS="$am_save_LIBS"
--    fi
--
--fi
--echo "$as_me:$LINENO: result: $am_cv_func_iconv" >&5
--echo "${ECHO_T}$am_cv_func_iconv" >&6
--  if test "$am_cv_func_iconv" = yes; then
--
--cat >>confdefs.h <<\_ACEOF
--#define HAVE_ICONV 1
--_ACEOF
--
--    echo "$as_me:$LINENO: checking for iconv declaration" >&5
--echo $ECHO_N "checking for iconv declaration... $ECHO_C" >&6
--    if test "${am_cv_proto_iconv+set}" = set; then
--  echo $ECHO_N "(cached) $ECHO_C" >&6
--else
--
--      cat >conftest.$ac_ext <<_ACEOF
--/* confdefs.h.  */
--_ACEOF
--cat confdefs.h >>conftest.$ac_ext
--cat >>conftest.$ac_ext <<_ACEOF
--/* end confdefs.h.  */
--
--#include <stdlib.h>
--#include <iconv.h>
--extern
--#ifdef __cplusplus
--"C"
--#endif
--#if defined(__STDC__) || defined(__cplusplus)
--size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);
--#else
--size_t iconv();
--#endif
--
--int
--main ()
--{
--
--  ;
--  return 0;
--}
--_ACEOF
--rm -f conftest.$ac_objext
--if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
--  (eval $ac_compile) 2>conftest.er1
--  ac_status=$?
--  grep -v '^ *+' conftest.er1 >conftest.err
--  rm -f conftest.er1
--  cat conftest.err >&5
--  echo "$as_me:$LINENO: \$? = $ac_status" >&5
--  (exit $ac_status); } &&
--       { ac_try='test -z "$ac_c_werror_flag"
--                       || test ! -s conftest.err'
--  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
--  (eval $ac_try) 2>&5
--  ac_status=$?
--  echo "$as_me:$LINENO: \$? = $ac_status" >&5
--  (exit $ac_status); }; } &&
--       { ac_try='test -s conftest.$ac_objext'
--  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
--  (eval $ac_try) 2>&5
--  ac_status=$?
--  echo "$as_me:$LINENO: \$? = $ac_status" >&5
--  (exit $ac_status); }; }; then
--  am_cv_proto_iconv_arg1=""
--else
--  echo "$as_me: failed program was:" >&5
--sed 's/^/| /' conftest.$ac_ext >&5
--
--am_cv_proto_iconv_arg1="const"
--fi
--rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
--      am_cv_proto_iconv="extern size_t iconv (iconv_t cd, $am_cv_proto_iconv_arg1 char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);"
--fi
--
--    am_cv_proto_iconv=`echo "$am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'`
--    echo "$as_me:$LINENO: result: ${ac_t:-
--         }$am_cv_proto_iconv" >&5
--echo "${ECHO_T}${ac_t:-
--         }$am_cv_proto_iconv" >&6
--
--cat >>confdefs.h <<_ACEOF
--#define ICONV_CONST $am_cv_proto_iconv_arg1
--_ACEOF
--
--  fi
--  LIBICONV=
--  if test "$am_cv_lib_iconv" = yes; then
--    LIBICONV="-liconv"
--  fi
--
--
--
-                               ac_config_files="$ac_config_files Makefile .gdbinit:gdbinit.in gnulib/Makefile"
-           ac_config_commands="$ac_config_commands default"
- cat >confcache <<\_ACEOF
-@@ -21865,6 +22006,8 @@ s,@AMDEP_FALSE@,$AMDEP_FALSE,;t t
- s,@AMDEPBACKSLASH@,$AMDEPBACKSLASH,;t t
- s,@am__fastdepCC_TRUE@,$am__fastdepCC_TRUE,;t t
- s,@am__fastdepCC_FALSE@,$am__fastdepCC_FALSE,;t t
-+s,@GDB_DATADIR_PATH@,$GDB_DATADIR_PATH,;t t
-+s,@pythondir@,$pythondir,;t t
- s,@subdirs@,$subdirs,;t t
- s,@TARGET_OBS@,$TARGET_OBS,;t t
- s,@PKGVERSION@,$PKGVERSION,;t t
-@@ -21880,6 +22023,9 @@ s,@WINDRES@,$WINDRES,;t t
- s,@ac_ct_WINDRES@,$ac_ct_WINDRES,;t t
- s,@MIG@,$MIG,;t t
- s,@ac_ct_MIG@,$ac_ct_MIG,;t t
-+s,@LIBICONV@,$LIBICONV,;t t
-+s,@LIBICONV_INCLUDE@,$LIBICONV_INCLUDE,;t t
-+s,@LIBICONV_LIBDIR@,$LIBICONV_LIBDIR,;t t
- s,@READLINE@,$READLINE,;t t
- s,@READLINE_DEPS@,$READLINE_DEPS,;t t
- s,@READLINE_CFLAGS@,$READLINE_CFLAGS,;t t
-@@ -21944,7 +22090,6 @@ s,@CONFIG_UNINSTALL@,$CONFIG_UNINSTALL,;t t
- s,@target_subdir@,$target_subdir,;t t
- s,@frags@,$frags,;t t
- s,@nm_h@,$nm_h,;t t
--s,@LIBICONV@,$LIBICONV,;t t
- s,@LIBOBJS@,$LIBOBJS,;t t
- s,@LTLIBOBJS@,$LTLIBOBJS,;t t
- s,@gl_LIBOBJS@,$gl_LIBOBJS,;t t
-diff --git a/gdb/configure.ac b/gdb/configure.ac
-index 3f81ff2..ff76053 100644
---- a/gdb/configure.ac
-+++ b/gdb/configure.ac
-@@ -1,6 +1,6 @@
- dnl Autoconf configure script for GDB, the GNU debugger.
- dnl Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
--dnl 2005, 2006, 2007, 2008
-+dnl 2005, 2006, 2007, 2008, 2009
- dnl Free Software Foundation, Inc.
- dnl
- dnl This file is part of GDB.
-@@ -118,6 +118,51 @@ case ${debugdir} in
-   ;;
- esac
-+# GDB's datadir relocation
-+
-+gdbdatadir=${datadir}/gdb
-+
-+AC_ARG_WITH([gdb-datadir],
-+  [AS_HELP_STRING([--with-gdb-datadir],
-+                  [look for global separate data files in this path [DATADIR/gdb]])], [gdbdatadir="${withval}"])
-+
-+AC_DEFINE_DIR(GDB_DATADIR, gdbdatadir,
-+              [Global directory for GDB data files. ])
-+
-+if test "x$exec_prefix" = xNONE || test "x$exec_prefix" = 'x${prefix}'; then
-+  if test "x$prefix" = xNONE; then
-+    test_prefix=/usr/local
-+  else
-+    test_prefix=$prefix
-+  fi
-+else
-+  test_prefix=$exec_prefix
-+fi
-+
-+case ${gdbdatadir} in
-+  "${test_prefix}"|"${test_prefix}/"*|\
-+  '${exec_prefix}'|'${exec_prefix}/'*)
-+    AC_DEFINE(GDB_DATADIR_RELOCATABLE, 1, [Define if GDB datadir should be relocated when GDB is moved.])
-+  ;;
-+esac
-+GDB_DATADIR_PATH=${gdbdatadir}
-+AC_SUBST(GDB_DATADIR_PATH)
-+
-+AC_ARG_WITH([pythondir],
-+  [AS_HELP_STRING([--with-pythondir],
-+                  [install Python data files in this path [DATADIR/gdb/python]])], [pythondir="${withval}"], [pythondir=no])
-+
-+# If the user passed in a path, define it.  Otherwise, compute it at
-+# runtime based on the possibly-relocatable datadir.
-+if test "$pythondir" = "no"; then
-+  pythondir='$(GDB_DATADIR_PATH)/python'
-+else
-+  AC_DEFINE_UNQUOTED(PYTHONDIR, "$pythondir",
-+      [Define to install path for Python sources])
-+fi
-+AC_SUBST(pythondir)
-+
-+
- AC_CONFIG_SUBDIRS(doc testsuite)
- # Check whether to support alternative target configurations
-@@ -430,6 +475,8 @@ AC_SEARCH_LIBS(zlibVersion, z, [AC_CHECK_HEADERS(zlib.h)])
- # On HP/UX we may need libxpdl for dlgetmodinfo (used by solib-pa64.c).
- AC_SEARCH_LIBS(dlgetmodinfo, [dl xpdl])
-+AM_ICONV
++static struct symbol *cp_lookup_symbol_in_namespace (const char *namespace,
++                                                     const char *name,
++                                                     const struct block *block,
++                                                     const domain_enum domain);
 +
- # On alpha-osf, it appears that libtermcap and libcurses are not compatible.
- # There is a very specific comment in /usr/include/curses.h explaining that
- # termcap routines built into libcurses must not be used.
-@@ -649,6 +696,8 @@ if test "${have_libpython}" = yes; then
-   CONFIG_OBS="$CONFIG_OBS \$(SUBDIR_PYTHON_OBS)"
-   CONFIG_DEPS="$CONFIG_DEPS \$(SUBDIR_PYTHON_DEPS)"
-   CONFIG_SRCS="$CONFIG_SRCS \$(SUBDIR_PYTHON_SRCS)"
-+  CONFIG_INSTALL="$CONFIG_INSTALL install-python"
-+  CONFIG_UNINSTALL="$CONFIG_UNINSTALL uninstall-python"
-   ENABLE_CFLAGS="$ENABLE_CFLAGS \$(SUBDIR_PYTHON_CFLAGS)"
-   # Flags needed to compile Python code (taken from python-config --cflags).
-@@ -776,7 +825,8 @@ AC_FUNC_VFORK
- AC_CHECK_FUNCS([canonicalize_file_name realpath getrusage getuid \
-                 getgid poll pread64 sbrk setpgid setpgrp setsid \
-               sigaction sigprocmask sigsetmask socketpair syscall \
--              ttrace wborder setlocale])
-+              ttrace wborder setlocale iconvlist])
-+AM_LANGINFO_CODESET
- # Check the return and argument types of ptrace.  No canned test for
- # this, so roll our own.
-@@ -1930,17 +1980,10 @@ dnl Check for exe extension set on certain hosts (e.g. Win32)
- AC_EXEEXT
- dnl  Detect the character set used by this host.
--
--dnl  At the moment, we just assume it's ISO-8859-1 (which is a
--dnl  superset of ASCII containing the characters needed for French,
--dnl  German, Spanish, Italian, and possibly others), but if were
--dnl  *were* to support any host character sets other than ISO-8859-1,
--dnl  here's where we'd detect it.
--AC_DEFINE(GDB_DEFAULT_HOST_CHARSET, "ISO-8859-1",
-+dnl  At the moment, we just assume it's UTF-8.
-+AC_DEFINE(GDB_DEFAULT_HOST_CHARSET, "UTF-8",
-           [Define to be a string naming the default host character set.])
--AM_ICONV
--
- AC_OUTPUT(Makefile .gdbinit:gdbinit.in gnulib/Makefile,
- [
- dnl Autoconf doesn't provide a mechanism for modifying definitions 
-diff --git a/gdb/configure.tgt b/gdb/configure.tgt
-index 65c3e25..f0cca7d 100644
---- a/gdb/configure.tgt
-+++ b/gdb/configure.tgt
-@@ -36,7 +36,7 @@ alpha*-*-osf*)
- alpha*-*-linux*)
-       # Target: Little-endian Alpha running Linux
-       gdb_target_obs="alpha-tdep.o alpha-mdebug-tdep.o alpha-linux-tdep.o \
--                      solib.o solib-svr4.o"
-+                      solib.o solib-svr4.o linux-tdep.o"
-       ;;
- alpha*-*-freebsd* | alpha*-*-kfreebsd*-gnu)
-       # Target: FreeBSD/alpha
-@@ -63,7 +63,7 @@ alpha*-*-*)
- am33_2.0*-*-linux*)
-       # Target: Matsushita mn10300 (AM33) running Linux
-       gdb_target_obs="mn10300-tdep.o mn10300-linux-tdep.o corelow.o \
--                      solib.o solib-svr4.o"
-+                      solib.o solib-svr4.o linux-tdep.o"
-       ;;
- arm*-wince-pe | arm*-*-mingw32ce*)
-@@ -128,7 +128,7 @@ hppa*-*-hpux*)
- hppa*-*-linux*)
-       # Target: HP PA-RISC running Linux
-       gdb_target_obs="hppa-tdep.o hppa-linux-tdep.o glibc-tdep.o \
--                      solib.o solib-svr4.o symfile-mem.o"
-+                      solib.o solib-svr4.o symfile-mem.o linux-tdep.o"
-       ;;
- hppa*-*-netbsd*)
-       # Target: NetBSD/hppa
-@@ -218,7 +218,7 @@ i[34567]86-*-*)
- ia64-*-linux*)
-       # Target: Intel IA-64 running GNU/Linux
-       gdb_target_obs="ia64-tdep.o ia64-linux-tdep.o \
--                      solib.o solib-svr4.o symfile-mem.o"
-+                      solib.o solib-svr4.o symfile-mem.o linux-tdep.o"
-       build_gdbserver=yes
-       ;;
- ia64*-*-*)
-@@ -242,7 +242,8 @@ m32c-*-*)
- m32r*-*-linux*)
-       # Target: Renesas M32R running GNU/Linux
-       gdb_target_obs="m32r-tdep.o m32r-linux-tdep.o remote-m32r-sdi.o \
--                      glibc-tdep.o solib.o solib-svr4.o symfile-mem.o"
-+                      glibc-tdep.o solib.o solib-svr4.o symfile-mem.o \
-+                      linux-tdep.o"
-       gdb_sim=../sim/m32r/libsim.a
-       build_gdbserver=yes
-       ;;
-@@ -267,7 +268,7 @@ fido-*-elf*)
- m68*-*-linux*)
-       # Target: Motorola m68k with a.out and ELF
-       gdb_target_obs="m68k-tdep.o m68klinux-tdep.o solib.o solib-svr4.o \
--                      glibc-tdep.o symfile-mem.o"
-+                      glibc-tdep.o symfile-mem.o linux-tdep.o"
-       build_gdbserver=yes
-       ;;
- m68*-*-netbsd* | m68*-*-knetbsd*-gnu)
-@@ -303,7 +304,8 @@ mips*-sgi-irix6*)
- mips*-*-linux*)
-       # Target: Linux/MIPS
-       gdb_target_obs="mips-tdep.o mips-linux-tdep.o glibc-tdep.o \
--                      corelow.o solib.o solib-svr4.o symfile-mem.o"
-+                      corelow.o solib.o solib-svr4.o symfile-mem.o \
-+                      linux-tdep.o"
-       gdb_sim=../sim/mips/libsim.a
-       build_gdbserver=yes
-       ;;
-@@ -354,7 +356,8 @@ powerpc-*-aix* | rs6000-*-*)
- powerpc-*-linux* | powerpc64-*-linux*)
-       # Target: PowerPC running Linux
-       gdb_target_obs="rs6000-tdep.o ppc-linux-tdep.o ppc-sysv-tdep.o \
--                      solib.o solib-svr4.o corelow.o symfile-mem.o"
-+                      solib.o solib-svr4.o corelow.o symfile-mem.o \
-+                      linux-tdep.o"
-       gdb_sim=../sim/ppc/libsim.a
-       build_gdbserver=yes
-       ;;
-@@ -381,7 +384,8 @@ score-*-*)
- sh*-*-linux*)
-       # Target: GNU/Linux Super-H
-       gdb_target_obs="sh-tdep.o sh64-tdep.o sh-linux-tdep.o monitor.o \
--                      dsrec.o solib.o solib-svr4.o symfile-mem.o glibc-tdep.o"
-+                      dsrec.o solib.o solib-svr4.o symfile-mem.o glibc-tdep.o \
-+                      linux-tdep.o"
-       gdb_sim=../sim/sh/libsim.a
-       build_gdbserver=yes
-       ;;
-@@ -409,13 +413,14 @@ sh*)
- sparc-*-linux*)
-       # Target: GNU/Linux SPARC
-       gdb_target_obs="sparc-tdep.o sparc-sol2-tdep.o sol2-tdep.o \
--                      sparc-linux-tdep.o solib.o solib-svr4.o symfile-mem.o"
-+                      sparc-linux-tdep.o solib.o solib-svr4.o symfile-mem.o \
-+                      linux-tdep.o"
-       ;;
- sparc64-*-linux*)
-       # Target: GNU/Linux UltraSPARC
-       gdb_target_obs="sparc64-tdep.o sparc64-sol2-tdep.o sol2-tdep.o \
-                       sparc64-linux-tdep.o sparc-tdep.o sparc-sol2-tdep.o \
--                      sparc-linux-tdep.o solib.o solib-svr4.o"
-+                      sparc-linux-tdep.o solib.o solib-svr4.o linux-tdep.o"
-       build_gdbserver=yes
-       ;;
- sparc*-*-freebsd* | sparc*-*-kfreebsd*-gnu)
-@@ -542,7 +547,8 @@ x86_64-*-openbsd*)
- xtensa*-*-linux*)     gdb_target=linux
-       # Target: GNU/Linux Xtensa
-       gdb_target_obs="xtensa-tdep.o xtensa-config.o xtensa-linux-tdep.o \
--                      solib.o solib-svr4.o corelow.o symfile-mem.o"
-+                      solib.o solib-svr4.o corelow.o symfile-mem.o \
-+                      linux-tdep.o"
-       build_gdbserver=yes
-       ;;
- xtensa*)
-diff --git a/gdb/cp-name-parser.y b/gdb/cp-name-parser.y
-index 5f5ee3a..a8f8f30 100644
---- a/gdb/cp-name-parser.y
-+++ b/gdb/cp-name-parser.y
-@@ -1,7 +1,6 @@
- /* YACC parser for C++ names, for GDB.
--   Copyright (C) 2003, 2004, 2005, 2007, 2008, 2009
--   Free Software Foundation, Inc.
-+   Copyright (C) 2003, 2004, 2005, 2007, 2008, 2009 Free Software Foundation, Inc.
-    Parts of the lexer are based on c-exp.y from GDB.
-@@ -501,7 +500,7 @@ operator   :       OPERATOR NEW
-               |       OPERATOR ARROW
-                       { $$ = make_operator ("->", 2); }
-               |       OPERATOR '(' ')'
--                      { $$ = make_operator ("()", 0); }
-+                      { $$ = make_operator ("()", 2); }
-               |       OPERATOR '[' ']'
-                       { $$ = make_operator ("[]", 2); }
-               ;
-diff --git a/gdb/cp-namespace.c b/gdb/cp-namespace.c
-index c6c5617..eace9c4 100644
---- a/gdb/cp-namespace.c
-+++ b/gdb/cp-namespace.c
-@@ -30,26 +30,13 @@
- #include "dictionary.h"
- #include "command.h"
- #include "frame.h"
-+#include "buildsym.h"
- /* List of using directives that are active in the current file.  */
--static struct using_direct *using_list;
--
--static struct using_direct *cp_add_using (const char *name,
--                                        unsigned int inner_len,
--                                        unsigned int outer_len,
--                                        struct using_direct *next);
--
- static struct using_direct *cp_copy_usings (struct using_direct *using,
-                                           struct obstack *obstack);
--static struct symbol *lookup_namespace_scope (const char *name,
--                                            const char *linkage_name,
--                                            const struct block *block,
--                                            const domain_enum domain,
--                                            const char *scope,
--                                            int scope_len);
--
  static struct symbol *lookup_symbol_file (const char *name,
-                                         const char *linkage_name,
+-                                        const char *linkage_name,
                                          const struct block *block,
-@@ -78,31 +65,6 @@ static struct symbol *lookup_possible_namespace_symbol (const char *name);
- static void maintenance_cplus_namespace (char *args, int from_tty);
--/* Set up support for dealing with C++ namespace info in the current
--   symtab.  */
--
--void cp_initialize_namespace ()
--{
--  using_list = NULL;
--}
--
--/* Add all the using directives we've gathered to the current symtab.
--   STATIC_BLOCK should be the symtab's static block; OBSTACK is used
--   for allocation.  */
--
--void
--cp_finalize_namespace (struct block *static_block,
--                     struct obstack *obstack)
--{
--  if (using_list != NULL)
--    {
--      block_set_using (static_block,
--                     cp_copy_usings (using_list, obstack),
--                     obstack);
--      using_list = NULL;
--    }
--}
--
- /* Check to see if SYMBOL refers to an object contained within an
-    anonymous namespace; if so, add an appropriate using directive.  */
-@@ -136,14 +98,17 @@ cp_scan_for_anonymous_namespaces (const struct symbol *symbol)
-                         "(anonymous namespace)",
-                         ANONYMOUS_NAMESPACE_LEN) == 0)
-           {
-+            int outer_len = (previous_component == 0 ? 0 : previous_component - 2);
-+            char outer[outer_len+1];
-+            
-+            strncpy(outer, name, outer_len);
-+            
-+            outer[outer_len] = '\0';
-             /* We've found a component of the name that's an
+                                         const domain_enum domain,
+                                         int anonymous_namespace);
+@@ -119,7 +122,7 @@ cp_scan_for_anonymous_namespaces (const struct symbol *symbol)
                 anonymous namespace.  So add symbols in it to the
                 namespace given by the previous component if there is
                 one, or to the global namespace if there isn't.  */
--            cp_add_using_directive (name,
--                                    previous_component == 0
--                                    ? 0 : previous_component - 2,
--                                    next_component);
-+            cp_add_using_directive (outer, name, "", "", 0);
+-            cp_add_using_directive (dest, src);
++            cp_add_using_directive (dest, src, "", "", 0);
            }
          /* The "+ 2" is for the "::".  */
          previous_component = next_component + 2;
-@@ -154,32 +119,27 @@ cp_scan_for_anonymous_namespaces (const struct symbol *symbol)
-     }
- }
--/* Add a using directive to using_list.  NAME is the start of a string
--   that should contain the namespaces we want to add as initial
--   substrings, OUTER_LENGTH is the end of the outer namespace, and
--   INNER_LENGTH is the end of the inner namespace.  If the using
--   directive in question has already been added, don't add it
--   twice.  */
-+/* Add a using directive to using_list. If the using directive in question
-+   has already been added, don't add it twice.  */
+@@ -134,7 +137,8 @@ cp_scan_for_anonymous_namespaces (const struct symbol *symbol)
+    has already been added, don't add it twice.  */
  
  void
--cp_add_using_directive (const char *name, unsigned int outer_length,
--                      unsigned int inner_length)
-+cp_add_using_directive (const char *outer, const char *inner, const char* alias,
-+    const char *declaration, const int line_number)
+-cp_add_using_directive (const char *dest, const char *src)
++cp_add_using_directive (const char *dest, const char *src, const char* alias,
++                      const char *declaration, const int line_number)
  {
    struct using_direct *current;
    struct using_direct *new;
-   /* Has it already been added?  */
--  for (current = using_list; current != NULL; current = current->next)
-+  for (current = using_directives; current != NULL; current = current->next)
-     {
--      if ((strncmp (current->inner, name, inner_length) == 0)
--        && (strlen (current->inner) == inner_length)
--        && (strlen (current->outer) == outer_length))
-+      if (strcmp (current->inner, inner) == 0
-+        && strcmp (current->outer, outer) == 0)
+@@ -148,7 +152,8 @@ cp_add_using_directive (const char *dest, const char *src)
        return;
      }
  
--  using_list = cp_add_using (name, inner_length, outer_length,
--                           using_list);
-+  using_directives = cp_add_using (outer, inner, alias, declaration,
-+      line_number,using_directives);
+-  using_directives = cp_add_using (dest, src, using_directives);
++  using_directives = cp_add_using (dest, src, alias, declaration,
++                                 line_number, using_directives);
  }
  
- /* Record the namespace that the function defined by SYMBOL was
-@@ -230,26 +190,31 @@ cp_is_anonymous (const char *namespace)
-         != NULL);
+@@ -201,7 +206,10 @@ cp_is_anonymous (const char *namespace)
  }
  
--/* Create a new struct using direct whose inner namespace is the
--   initial substring of NAME of leng INNER_LEN and whose outer
--   namespace is the initial substring of NAME of length OUTER_LENGTH.
-+/* Create a new struct using direct whose inner namespace is INNER 
-+   and whose outer namespace is OUTER. ALIAS is the name of the imported
-+   namespace in the current scope. If ALIAS is an empty string  then the
+ /* Create a new struct using direct which imports the namespace SRC
+-   into the scope DEST.
++   into the scope DEST.  ALIAS is the name of the imported namespace
++   in the current scope.  If ALIAS is an empty string  then the
 +   namespace is known by its original name.
++
     Set its next member in the linked list to NEXT; allocate all memory
     using xmalloc.  It copies the strings, so NAME can be a temporary
     string.  */
--static struct using_direct *
--cp_add_using (const char *name,
--            unsigned int inner_len,
--            unsigned int outer_len,
-+struct using_direct *
-+cp_add_using (const char *outer,
-+              const char *inner,
+@@ -209,14 +217,21 @@ cp_is_anonymous (const char *namespace)
+ struct using_direct *
+ cp_add_using (const char *dest,
+               const char *src,
 +              const char *alias,
 +              const char *declaration,
 +              const int line_number,
@@ -12019,218 +3177,563 @@ index c6c5617..eace9c4 100644
  {
    struct using_direct *retval;
  
--  gdb_assert (outer_len < inner_len);
--
    retval = xmalloc (sizeof (struct using_direct));
--  retval->inner = savestring (name, inner_len);
--  retval->outer = savestring (name, outer_len);
-+  retval->inner = savestring (inner, strlen(inner));
-+  retval->outer = savestring (outer, strlen(outer));
-+  retval->alias = savestring (alias, strlen(alias));
-+  retval->declaration = savestring (declaration, strlen(declaration));
+-  retval->import_src = savestring (src, strlen(src));
+-  retval->import_dest = savestring (dest, strlen(dest));
++  retval->import_src = savestring (src, strlen (src));
++  retval->import_dest = savestring (dest, strlen (dest));
++  retval->alias = savestring (alias, strlen (alias));
++  retval->declaration = savestring (declaration, strlen (declaration));
 +  retval->line_number = line_number;
-+        
    retval->next = next;
++  retval->searched = 0;
  
    return retval;
-@@ -274,11 +239,17 @@ cp_copy_usings (struct using_direct *using,
-       retval->inner = obsavestring (using->inner, strlen (using->inner),
+ }
+@@ -241,10 +256,18 @@ cp_copy_usings (struct using_direct *using,
+                                   obstack);
+       retval->import_dest = obsavestring (using->import_dest, strlen (using->import_dest),
                                    obstack);
-       retval->outer = obsavestring (using->outer, strlen (using->outer),
--                                  obstack);
-+                                    obstack);
 +      retval->alias = obsavestring (using->alias, strlen (using->alias),
 +                                    obstack);
 +      retval->declaration = obsavestring (using->declaration, strlen (using->declaration),
 +                                    obstack);
        retval->next = cp_copy_usings (using->next, obstack);
  
-       xfree (using->inner);
-       xfree (using->outer);
++      retval->searched = using->searched;
++
+       xfree (using->import_src);
+       xfree (using->import_dest);
 +      xfree (using->alias);
 +      xfree (using->declaration);
        xfree (using);
  
        return retval;
-@@ -299,8 +270,14 @@ cp_lookup_symbol_nonlocal (const char *name,
+@@ -261,12 +284,48 @@ cp_copy_usings (struct using_direct *using,
+ struct symbol *
+ cp_lookup_symbol_nonlocal (const char *name,
+-                         const char *linkage_name,
                           const struct block *block,
                           const domain_enum domain)
  {
 -  return lookup_namespace_scope (name, linkage_name, block, domain,
 -                               block_scope (block), 0);
++  struct symbol *sym; 
++  const char *scope = block_scope (block);
 +
-+  struct symbol* sym = lookup_namespace_scope(name, linkage_name, block,
-+      domain, block_scope(block), 0);
-+
++  sym = lookup_namespace_scope (name, block, domain, scope, 0);
 +  if (sym != NULL)
 +    return sym;
 +
-+  return lookup_symbol_file(name, linkage_name, block, domain, 0);
++  return cp_lookup_symbol_namespace(scope, name, block, domain);
++}
++
++/* Searches for NAME in the current namespace, and by applying relevant import
++   statements belonging to BLOCK and its parents.  SCOPE is the namespace
++   scope of the context in which the search is being evaluated.  */
++
++struct symbol*
++cp_lookup_symbol_namespace (const char *scope,
++                            const char *name,
++                            const struct block *block,
++                            const domain_enum domain)
++{
++  struct symbol *sym;
++
++  /* First, try to find the symbol in the given namespace.  */
++  sym = cp_lookup_symbol_in_namespace (scope, name, block, domain);
++  if ( sym != NULL)
++    return sym;
++    
++  /* Search for name in namespaces imported to this and parent blocks.  */
++  while (block != NULL)
++    {
++      sym = cp_lookup_symbol_imports(scope,name, block, domain,0,1);
++
++      if (sym)
++        return sym;
++
++      block = BLOCK_SUPERBLOCK(block);
++    }
++
++  return NULL;
  }
  
  /* Lookup NAME at namespace scope (or, in C terms, in static and
-@@ -318,7 +295,7 @@ cp_lookup_symbol_nonlocal (const char *name,
+@@ -284,9 +343,8 @@ cp_lookup_symbol_nonlocal (const char *name,
     "A::x", and if that call fails, then the first call looks for
     "x".  */
  
 -static struct symbol *
 +struct symbol *
  lookup_namespace_scope (const char *name,
-                       const char *linkage_name,
+-                      const char *linkage_name,
                        const struct block *block,
-@@ -354,10 +331,43 @@ lookup_namespace_scope (const char *name,
+                       const domain_enum domain,
+                       const char *scope,
+@@ -308,8 +366,7 @@ lookup_namespace_scope (const char *name,
+         new_scope_len += 2;
+       }
+       new_scope_len += cp_find_first_component (scope + new_scope_len);
+-      sym = lookup_namespace_scope (name, linkage_name, block,
+-                                  domain, scope, new_scope_len);
++      sym = lookup_namespace_scope (name, block, domain, scope, new_scope_len);
+       if (sym != NULL)
+       return sym;
+     }
+@@ -320,25 +377,87 @@ lookup_namespace_scope (const char *name,
    namespace = alloca (scope_len + 1);
    strncpy (namespace, scope, scope_len);
    namespace[scope_len] = '\0';
 -  return cp_lookup_symbol_namespace (namespace, name, linkage_name,
-+  return cp_lookup_symbol_namespace_incremental (namespace, name, linkage_name,
-                                    block, domain);
+-                                   block, domain);
++  return cp_lookup_symbol_in_namespace (namespace, name,block, domain);
  }
  
-+/* Searches the for the given NAME in the given NAMESPACE, using import 
-+   statements implied by the given BLOCK, *and its' parents*. */
-+struct symbol *
-+cp_lookup_symbol_namespace_incremental (const char *namespace,
-+                                        const char *name,
-+                                        const char *linkage_name,
-+                                        const struct block *block,
-+                                        const domain_enum domain)
+-/* Look up NAME in the C++ namespace NAMESPACE, applying the using
+-   directives that are active in BLOCK.  Other arguments are as in
++/* Look up NAME in the C++ namespace NAMESPACE. Other arguments are as in
+    cp_lookup_symbol_nonlocal.  */
++static struct symbol *
++cp_lookup_symbol_in_namespace (const char *namespace,
++                             const char *name,
++                             const struct block *block,
++                             const domain_enum domain)
 +{
-+  struct symbol *sym;
-+  const struct block *global_block = block_global_block (block);
-+
-+  /* Check if either no block is specified or it's a global block.  */
-+
-+  if (global_block == NULL)
-+    return NULL;
 +
-+  while (block != global_block)
++  if (namespace[0] == '\0')
 +    {
-+      sym = cp_lookup_symbol_namespace (namespace, name, linkage_name, block, domain);
-+
-+      if (sym != NULL)
-+        return sym;
-+
-+      block = BLOCK_SUPERBLOCK (block);
++      return lookup_symbol_file (name, block,domain, 0);
 +    }
++  else
++    {
++      char *concatenated_name
++      = alloca (strlen (namespace) + 2 + strlen (name) + 1);
++      strcpy (concatenated_name, namespace);
++      strcat (concatenated_name, "::");
++      strcat (concatenated_name, name);
++      return lookup_symbol_file (concatenated_name, block, domain,
++                              cp_is_anonymous (namespace));
++    }
++}
 +
-+  /* We've reached the global block without finding a result.  */
++/* Search for NAME by applying all import statements belonging
++   to BLOCK which are applicable in SCOPE. If DECLARATION_ONLY the search
++   is restricted to using declarations.
++   Example:
 +
-+  return NULL;
-+}
++     namespace A{
++       int x;
++     }
++     using A::x;
 +
++   If SEARCH_PARENTS the search will include imports which are applicable in
++   parents of scopes.
++   Example:
 +
- /* Look up NAME in the C++ namespace NAMESPACE, applying the using
-    directives that are active in BLOCK.  Other arguments are as in
-    cp_lookup_symbol_nonlocal.  */
-@@ -370,7 +380,7 @@ cp_lookup_symbol_namespace (const char *namespace,
-                           const domain_enum domain)
++     namespace A{
++       using namespace X;
++       namespace B{
++         using namespace Y;
++       }
++     }
++
++   If SCOPE is "A::B" and SEARCH_PARENTS is true the imports of namespaces X
++   and Y will be considered. If SEARCH_PARENTS is false only the import of Y
++   is considered.  */
++
+ struct symbol *
+-cp_lookup_symbol_namespace (const char *namespace,
+-                          const char *name,
+-                          const char *linkage_name,
+-                          const struct block *block,
+-                          const domain_enum domain)
++cp_lookup_symbol_imports (const char *scope,
++                            const char *name,
++                            const struct block *block,
++                            const domain_enum domain,
++                            int declaration_only,
++                            int search_parents)
  {
-   const struct using_direct *current;
+-  const struct using_direct *current;
 -  struct symbol *sym;
++  struct using_direct *current;
 +  struct symbol *sym = NULL;
++  int directive_match;
++  int current_line;
++
++  if(!declaration_only)
++    /* First, try to find the symbol in the given namespace.  */
++    sym = cp_lookup_symbol_in_namespace (scope, name, block, domain);
  
-   /* First, go through the using directives.  If any of them add new
+-  /* First, go through the using directives.  If any of them add new
++  if ( sym != NULL)
++    return sym;
++
++  if (has_stack_frames ())
++    current_line = find_pc_line (get_frame_pc (get_selected_frame (NULL)),
++                                              0).line;
++  else
++    current_line = 0;
++
++  /* Go through the using directives.  If any of them add new
       names to the namespace we're searching in, see if we can find a
-@@ -380,15 +390,50 @@ cp_lookup_symbol_namespace (const char *namespace,
+      match by applying them.  */
+@@ -346,39 +465,74 @@ cp_lookup_symbol_namespace (const char *namespace,
         current != NULL;
         current = current->next)
      {
--      if (strcmp (namespace, current->outer) == 0)
-+      
-+      int current_line = find_pc_line (get_frame_pc (get_current_frame ()), 0).line;
-+      
-+      if (strcmp (namespace, current->outer) == 0 && current->line_number < current_line)
+-      if (strcmp (namespace, current->import_dest) == 0)
++  
++      /* If the import destination is the current scope or one of its ancestors then
++         it is applicable.  */
++      directive_match = search_parents ?
++                        strncmp (scope, current->import_dest,
++                                 strlen(current->import_dest)) == 0 :
++                        strcmp (scope, current->import_dest) == 0;
++
++      if (directive_match &&
++          current->line_number < current_line &&
++          !current->searched)
        {
--        sym = cp_lookup_symbol_namespace (current->inner,
+-        sym = cp_lookup_symbol_namespace (current->import_src,
 -                                          name,
 -                                          linkage_name,
 -                                          block,
 -                                          domain);
--        if (sym != NULL)
-+        
++        current->searched = 1;
 +        /* If there is an import of a single declaration, compare the imported
 +           declaration with the sought out name. If there is a match pass
-+           current->inner as NAMESPACE to direct the search towards the
++           current->import_src as NAMESPACE to direct the search towards the
 +           imported namespace.  */
 +        if (strcmp ("", current->declaration) != 0)
 +          {
-+          if(strcmp (name, current->declaration) == 0){
-+            sym = cp_lookup_symbol_namespace (current->inner,
-+                                              name,
-+                                              linkage_name,
-+                                              block,
-+                                              domain);
++          if (strcmp (name, current->declaration) == 0)
++            {
++              sym = cp_lookup_symbol_in_namespace (current->import_src,
++                                                name,
++                                                block,
++                                                domain);
++            }
 +          }
 +         
-+          }
-+        else if(strcmp (name, current->alias) == 0)
++        if (declaration_only)
++            {
++              current->searched = 0;
++              if (sym)
++                {
++                  return sym;
++                } else {
++                  continue;
++                }
++            }
++
++        if (strcmp (name, current->alias) == 0)
 +          /* If the import is creating an alias and the alias matches the
 +             sought name. Pass current->inner as the NAME to direct the
 +             search towards the aliased namespace */
 +          {
-+          sym = cp_lookup_symbol_namespace (namespace,
-+                                            current->inner,
-+                                            linkage_name,
++          sym = cp_lookup_symbol_in_namespace (scope,
++                                            current->import_src,
 +                                            block,
 +                                            domain);
-+        }else if(strcmp ("", current->alias) == 0){
++          } else if (strcmp ("", current->alias) == 0){
 +          /* If this import statement creates no alias, pass current->inner as
 +             NAMESPACE to direct the search towards the imported namespace. */
-+            sym = cp_lookup_symbol_namespace (current->inner,
++            sym = cp_lookup_symbol_imports (current->import_src,
 +                                              name,
-+                                              linkage_name,
 +                                              block,
-+                                              domain);
++                                              domain,
++                                              0,
++                                              0);
 +          }
 +
-+        if (sym != NULL){
-           return sym;
-+        }
++        current->searched = 0;
+         if (sym != NULL)
+-          return sym;
++          {
++            return sym;
++          }
        }
      }
  
-@@ -398,8 +443,10 @@ cp_lookup_symbol_namespace (const char *namespace,
-   
-   if (namespace[0] == '\0')
-     {
+-  /* We didn't find anything by applying any of the using directives
+-     that are still applicable; so let's see if we've got a match
+-     using the current namespace.  */
+-  
+-  if (namespace[0] == '\0')
+-    {
 -      return lookup_symbol_file (name, linkage_name, block,
 -                               domain, 0);
-+      sym = lookup_symbol_file (name, linkage_name,
-+                                     block, domain, 
-+                                     cp_is_anonymous (namespace));
-+      return sym;
-     }
-   else
-     {
-diff --git a/gdb/cp-support.c b/gdb/cp-support.c
-index bf42636..9f04c86 100644
---- a/gdb/cp-support.c
-+++ b/gdb/cp-support.c
-@@ -175,7 +175,8 @@ mangled_name_to_comp (const char *mangled_name, int options,
-   return ret;
- }
+-    }
+-  else
+-    {
+-      char *concatenated_name
+-      = alloca (strlen (namespace) + 2 + strlen (name) + 1);
+-      strcpy (concatenated_name, namespace);
+-      strcat (concatenated_name, "::");
+-      strcat (concatenated_name, name);
+-      sym = lookup_symbol_file (concatenated_name, linkage_name,
+-                              block, domain, 
+-                              cp_is_anonymous (namespace));
+-      return sym;
+-    }
++  return NULL;
+ }
+ /* Look up NAME in BLOCK's static block and in global blocks.  If
+@@ -388,17 +542,15 @@ cp_lookup_symbol_namespace (const char *namespace,
+ static struct symbol *
+ lookup_symbol_file (const char *name,
+-                  const char *linkage_name,
+                   const struct block *block,
+                   const domain_enum domain,
+                   int anonymous_namespace)
+ {
+   struct symbol *sym = NULL;
+-  sym = lookup_symbol_static (name, linkage_name, block, domain);
++  sym = lookup_symbol_static (name, block, domain);
+   if (sym != NULL)
+     return sym;
+-
+   if (anonymous_namespace)
+     {
+       /* Symbols defined in anonymous namespaces have external linkage
+@@ -408,12 +560,11 @@ lookup_symbol_file (const char *name,
+       const struct block *global_block = block_global_block (block);
+       
+       if (global_block != NULL)
+-      sym = lookup_symbol_aux_block (name, linkage_name, global_block,
+-                                     domain);
++      sym = lookup_symbol_aux_block (name, global_block, domain);
+     }
+   else
+     {
+-      sym = lookup_symbol_global (name, linkage_name, block, domain);
++      sym = lookup_symbol_global (name, block, domain);
+     }
+   if (sym != NULL)
+@@ -434,6 +585,7 @@ lookup_symbol_file (const char *name,
+       sym = lookup_possible_namespace_symbol (name);
+       if (sym != NULL)
+       return sym;
++
+     }
+   return NULL;
+@@ -461,9 +613,8 @@ cp_lookup_nested_type (struct type *parent_type,
+          lookup_symbol_namespace works when looking them up.  */
+       const char *parent_name = TYPE_TAG_NAME (parent_type);
+-      struct symbol *sym = cp_lookup_symbol_namespace (parent_name,
++      struct symbol *sym = cp_lookup_symbol_in_namespace (parent_name,
+                                                        nested_name,
+-                                                       NULL,
+                                                        block,
+                                                        VAR_DOMAIN);
+       if (sym == NULL || SYMBOL_CLASS (sym) != LOC_TYPEDEF)
+@@ -709,7 +860,7 @@ check_one_possible_namespace_symbol (const char *name, int len,
+   memcpy (name_copy, name, len);
+   name_copy[len] = '\0';
+-  sym = lookup_block_symbol (block, name_copy, NULL, VAR_DOMAIN);
++  sym = lookup_block_symbol (block, name_copy, VAR_DOMAIN);
+   if (sym == NULL)
+     {
+@@ -749,7 +900,7 @@ lookup_possible_namespace_symbol (const char *name)
+       struct symbol *sym;
+       sym = lookup_block_symbol (get_possible_namespace_block (objfile),
+-                               name, NULL, VAR_DOMAIN);
++                               name, VAR_DOMAIN);
+       if (sym != NULL)
+       return sym;
+diff --git a/gdb/cp-support.c b/gdb/cp-support.c
+index f12d785..23b34c1 100644
+--- a/gdb/cp-support.c
++++ b/gdb/cp-support.c
+@@ -32,6 +32,9 @@
+ #include "block.h"
+ #include "complaints.h"
+ #include "gdbtypes.h"
++#include "exceptions.h"
++#include "expression.h"
++#include "value.h"
+ #include "safe-ctype.h"
+@@ -70,6 +73,18 @@ struct cmd_list_element *maint_cplus_cmd_list = NULL;
+ static void maint_cplus_command (char *arg, int from_tty);
+ static void first_component_command (char *arg, int from_tty);
++/* Operator validation.
++   NOTE: Multi-byte operators (usually the assignment variety operator)
++   must appear before the single byte version, i.e., "+=" before "+".  */
++static const char *operator_tokens[] =
++  {
++    "++", "+=", "+", "->*", "->", "--", "-=", "-", "*=", "*", "/=", "/",
++    "%=", "%", "!=", "==", "!", "&&", "<<=", "<<", ">>=", ">>",
++    "<=", "<", ">=", ">", "~", "&=", "&", "|=", "||", "|", "^=", "^",
++    "=", "()", "[]", ",", "new", "delete"
++    /* new[] and delete[] require special whitespace handling */
++  };
++
+ /* Return 1 if STRING is clearly already in canonical form.  This
+    function is conservative; things which it does not recognize are
+    assumed to be non-canonical, and the parser will sort them out
+@@ -175,7 +190,8 @@ mangled_name_to_comp (const char *mangled_name, int options,
+   return ret;
+ }
 -/* Return the name of the class containing method PHYSNAME.  */
 +/* Return the name of the class or namespace containing
 +   function, method, or variable PHYSNAME.  */
  
  char *
  cp_class_name_from_physname (const char *physname)
+@@ -825,9 +841,9 @@ read_in_psymtabs (const char *func_name)
+     if (ps->readin)
+       continue;
+-    if ((lookup_partial_symbol (ps, func_name, NULL, 1, VAR_DOMAIN)
++    if ((lookup_partial_symbol (ps, func_name, 1, VAR_DOMAIN)
+        != NULL)
+-      || (lookup_partial_symbol (ps, func_name, NULL, 0, VAR_DOMAIN)
++      || (lookup_partial_symbol (ps, func_name, 0, VAR_DOMAIN)
+           != NULL))
+       psymtab_to_symtab (ps);
+   }
+@@ -909,6 +925,107 @@ first_component_command (char *arg, int from_tty)
+ extern initialize_file_ftype _initialize_cp_support; /* -Wmissing-prototypes */
++#define SKIP_SPACE(P)                         \
++  do                                          \
++  {                                           \
++    while (*(P) == ' ' || *(P) == '\t')               \
++      ++(P);                                  \
++  }                                           \
++  while (0)
++
++/* Returns the length of the operator name or 0 if INPUT does not
++   point to a valid C++ operator.  INPUT should start with "operator".  */
++int
++cp_validate_operator (const char *input)
++{
++  int i;
++  char *copy;
++  const char *p;
++  struct expression *expr;
++  struct value *val;
++  struct gdb_exception except;
++  struct cleanup *old_chain;
++
++  p = input;
++
++  if (strncmp (p, "operator", 8) == 0)
++    {
++      int valid = 0;
++      p += 8;
++
++      SKIP_SPACE (p);
++      for (i = 0; i < sizeof (operator_tokens) / sizeof (operator_tokens[0]);
++         ++i)
++      {
++        int length = strlen (operator_tokens[i]);
++        /* By using strncmp here, we MUST have operator_tokens ordered!
++           See additional notes where operator_tokens is defined above.  */
++        if (strncmp (p, operator_tokens[i], length) == 0)
++          {
++            const char *op = p;
++            valid = 1;
++            p += length;
++
++            if (strncmp (op, "new", 3) == 0
++                || strncmp (op, "delete", 6) == 0)
++              {
++
++                /* Special case: new[] and delete[].  We must be careful
++                   to swallow whitespace before/in "[]".  */
++                SKIP_SPACE (p);
++
++                if (*p == '[')
++                  {
++                    ++p;
++                    SKIP_SPACE (p);
++                    if (*p == ']')
++                      ++p;
++                    else
++                      valid = 0;
++                  }
++              }
++
++            if (valid)
++              return (p - input);
++          }
++      }
++
++      /* Check input for a conversion operator.  */
++
++      /* Skip past base typename */
++      while (*p != '*' && *p != '&' && *p != 0 && *p != ' ')
++      ++p;
++      SKIP_SPACE (p);
++
++      /* Add modifiers '*'/'&' */
++      while (*p == '*' || *p == '&')
++      {
++        ++p;
++        SKIP_SPACE (p);
++      }
++
++      /* Check for valid type.  [Remember: input starts with 
++       "operator".]  */
++      copy = savestring (input + 8, p - input - 8);
++      expr = NULL;
++      val = NULL;
++      TRY_CATCH (except, RETURN_MASK_ALL)
++      {
++        expr = parse_expression (copy);
++        val = evaluate_type (expr);
++      }
++
++      xfree (copy);
++      if (expr)
++      xfree (expr);
++
++      if (val != NULL && value_type (val) != NULL)
++      return (p - input);
++    }
++
++  return 0;
++}
++
+ void
+ _initialize_cp_support (void)
+ {
 diff --git a/gdb/cp-support.h b/gdb/cp-support.h
-index 837ca6c..23f8d5b 100644
+index b5a5c5f..3f48f98 100644
 --- a/gdb/cp-support.h
 +++ b/gdb/cp-support.h
-@@ -38,14 +38,28 @@ struct demangle_component;
+@@ -38,15 +38,33 @@ struct demangle_component;
  
  /* This struct is designed to store data from using directives.  It
-    says that names from namespace INNER should be visible within
--   namespace OUTER.  OUTER should always be a strict initial substring
--   of INNER.  These form a linked list; NEXT is the next element of
--   the list.  */
-+   namespace OUTER These form a linked list; NEXT is the next element of
-+   the list. ALIAS is set to a non empty string if the imported namespace
-+   has been aliased.Eg:
+    says that names from namespace IMPORT_SRC should be visible within
+-   namespace IMPORT_DEST. IMPORT_DEST should always be a strict initial
+-   substring of IMPORT_SRC. These form a linked list; NEXT is the next element
+-   of the list.  */
++   namespace IMPORT_DEST.  IMPORT_DEST should always be a strict initial
++   substring of IMPORT_SRC.  These form a linked list; NEXT is the next
++   element of the list.  ALIAS is set to a non empty string if the imported
++   namespace has been aliased.Eg:
 +       namespace C=A::B;
 +   ALIAS = "C"
 +   DECLARATION is the name of the imported declaration, if this import 
@@ -12241,19 +3744,23 @@ index 837ca6c..23f8d5b 100644
  
  struct using_direct
  {
-   char *inner;
-   char *outer;
-+  
+   char *import_src;
+   char *import_dest;
++
 +  char *alias;
-+  
++
 +  char *declaration;
-+  
++
 +  int line_number;
-+  
++
    struct using_direct *next;
++
++  /* Used during import search to temporarly mark this node as searced.  */
++  int searched;
  };
  
-@@ -54,6 +68,7 @@ struct using_direct
+@@ -54,6 +72,7 @@ struct using_direct
  
  extern char *cp_canonicalize_string (const char *string);
  
@@ -12261,217 +3768,62 @@ index 837ca6c..23f8d5b 100644
  extern char *cp_class_name_from_physname (const char *physname);
  
  extern char *method_name_from_physname (const char *physname);
-@@ -76,9 +91,18 @@ extern struct type *cp_lookup_rtti_type (const char *name,
+@@ -72,15 +91,23 @@ extern struct symbol **make_symbol_overload_list (const char *,
+ extern struct type *cp_lookup_rtti_type (const char *name,
+                                        struct block *block);
++extern int cp_validate_operator (const char *input);
++
+ /* Functions/variables from cp-namespace.c.  */
  
  extern int cp_is_anonymous (const char *namespace);
  
--extern void cp_add_using_directive (const char *name,
--                                  unsigned int outer_length,
--                                  unsigned int inner_length);
-+extern void cp_add_using_directive (const char *outer,
-+                                    const char *inner,
+ extern void cp_add_using_directive (const char *dest,
+-                                    const char *src);
++                                    const char *src,
 +                                    const char *alias,
 +                                    const char *declaration,
 +                                    const int line_number);
-+
-+extern struct using_direct *cp_add_using (const char *outer,
-+                                          const char *inner,
+ extern struct using_direct *cp_add_using (const char *dest,
+                                           const char *src,
 +                                          const char *alias,
 +                                          const char *declaration,
 +                                          const int line_number,
-+                                        struct using_direct *next);
+                                         struct using_direct *next);
  
  extern void cp_initialize_namespace (void);
+@@ -97,15 +124,20 @@ extern void cp_set_block_scope (const struct symbol *symbol,
+ extern void cp_scan_for_anonymous_namespaces (const struct symbol *symbol);
  
-@@ -98,6 +122,19 @@ extern struct symbol *cp_lookup_symbol_nonlocal (const char *name,
+ extern struct symbol *cp_lookup_symbol_nonlocal (const char *name,
+-                                               const char *linkage_name,
                                                 const struct block *block,
                                                 const domain_enum domain);
  
-+extern struct symbol *lookup_namespace_scope (const char *name,
-+                                              const char *linkage_name,
-+                                              const struct block *block,
-+                                              const domain_enum domain,
-+                                              const char *scope,
-+                                              int scope_len);
-+
-+extern struct symbol *cp_lookup_symbol_namespace_incremental (const char *namespace,
-+                                                              const char *name,
-+                                                              const char *linkage_name,
-+                                                              const struct block *block,
-+                                                              const domain_enum domain);
++struct symbol *cp_lookup_symbol_imports (const char *scope,
++                                         const char *name,
++                                         const struct block *block,
++                                         const domain_enum domain,
++                                         int declaration_only,
++                                         int search_parents);
 +
  extern struct symbol *cp_lookup_symbol_namespace (const char *namespace,
-                                                 const char *name,
-                                                 const char *linkage_name,
-diff --git a/gdb/cp-valprint.c b/gdb/cp-valprint.c
-index 8b7d868..dcd32cb 100644
---- a/gdb/cp-valprint.c
-+++ b/gdb/cp-valprint.c
-@@ -461,6 +461,7 @@ cp_print_static_field (struct type *type,
-   if (TYPE_CODE (type) == TYPE_CODE_STRUCT)
-     {
-       CORE_ADDR *first_dont_print;
-+      CORE_ADDR addr;
-       int i;
-       first_dont_print
-@@ -470,7 +471,7 @@ cp_print_static_field (struct type *type,
-       while (--i >= 0)
-       {
--        if (VALUE_ADDRESS (val) == first_dont_print[i])
-+        if (value_address (val) == first_dont_print[i])
-           {
-             fputs_filtered ("<same as static member of an already"
-                             " seen type>",
-@@ -479,12 +480,13 @@ cp_print_static_field (struct type *type,
-           }
-       }
--      obstack_grow (&dont_print_statmem_obstack, (char *) &VALUE_ADDRESS (val),
-+      addr = value_address (val);
-+      obstack_grow (&dont_print_statmem_obstack, (char *) &addr,
-                   sizeof (CORE_ADDR));
-       CHECK_TYPEDEF (type);
-       cp_print_value_fields (type, type, value_contents_all (val),
--                           value_embedded_offset (val), VALUE_ADDRESS (val),
-+                           value_embedded_offset (val), value_address (val),
-                            stream, recurse, options, NULL, 1);
-       return;
-     }
-@@ -492,7 +494,7 @@ cp_print_static_field (struct type *type,
-   opts = *options;
-   opts.deref_ref = 0;
-   val_print (type, value_contents_all (val), 
--           value_embedded_offset (val), VALUE_ADDRESS (val),
-+           value_embedded_offset (val), value_address (val),
-            stream, recurse, &opts, current_language);
- }
+-                                                const char *name,
+-                                                const char *linkage_name,
+-                                                const struct block *block,
+-                                                const domain_enum domain);
++                                                  const char *name,
++                                                  const struct block *block,
++                                                  const domain_enum domain);
+ extern struct type *cp_lookup_nested_type (struct type *parent_type,
+                                          const char *nested_name,
 diff --git a/gdb/dbxread.c b/gdb/dbxread.c
-index 115bdef..7f756af 100644
+index 7cb016d..bb9e35a 100644
 --- a/gdb/dbxread.c
 +++ b/gdb/dbxread.c
-@@ -1,6 +1,6 @@
- /* Read dbx symbol tables and convert to internal format, for GDB.
-    Copyright (C) 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995,
--   1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2008.
-+   1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2008, 2009.
-    Free Software Foundation, Inc.
-    This file is part of GDB.
-@@ -1188,6 +1188,8 @@ read_dbx_symtab (struct objfile *objfile)
-   struct internal_nlist nlist;
-   CORE_ADDR text_addr;
-   int text_size;
-+  char *sym_name;
-+  int sym_len;
-   char *namestring;
-   int nsl;
-@@ -1681,6 +1683,28 @@ pos %d"),
-         if (!p)
-           continue;                   /* Not a debugging symbol.   */
-+        sym_len = 0;
-+        if (psymtab_language == language_cplus)
-+          {
-+            char *new_name, *name = alloca (p - namestring + 1);
-+            memcpy (name, namestring, p - namestring);
-+            name[p - namestring] = '\0';
-+            new_name = cp_canonicalize_string (name);
-+            if (new_name != NULL)
-+              {
-+                sym_len = strlen (new_name);
-+                sym_name = obsavestring (new_name, sym_len,
-+                                         &objfile->objfile_obstack);
-+                xfree (new_name);
-+              }
-+          }
-+
-+        if (sym_len == 0)
-+          {
-+            sym_name = namestring;
-+            sym_len = p - namestring;
-+          }
-+
-         /* Main processing section for debugging symbols which
-            the initial read through the symbol tables needs to worry
-            about.  If we reach this point, the symbol which we are
-@@ -1698,7 +1722,7 @@ pos %d"),
-               namestring = gdbarch_static_transform_name (gdbarch,
-                                                           namestring);
--            add_psymbol_to_list (namestring, p - namestring,
-+            add_psymbol_to_list (sym_name, sym_len,
-                                  VAR_DOMAIN, LOC_STATIC,
-                                  &objfile->static_psymbols,
-                                  0, nlist.n_value,
-@@ -1710,7 +1734,7 @@ pos %d"),
-                                        data_sect_index);
-             /* The addresses in these entries are reported to be
-                wrong.  See the code that reads 'G's for symtabs. */
--            add_psymbol_to_list (namestring, p - namestring,
-+            add_psymbol_to_list (sym_name, sym_len,
-                                  VAR_DOMAIN, LOC_STATIC,
-                                  &objfile->global_psymbols,
-                                  0, nlist.n_value,
-@@ -1728,7 +1752,7 @@ pos %d"),
-                 || (p == namestring + 1
-                     && namestring[0] != ' '))
-               {
--                add_psymbol_to_list (namestring, p - namestring,
-+                add_psymbol_to_list (sym_name, sym_len,
-                                      STRUCT_DOMAIN, LOC_TYPEDEF,
-                                      &objfile->static_psymbols,
-                                      nlist.n_value, 0,
-@@ -1736,7 +1760,7 @@ pos %d"),
-                 if (p[2] == 't')
-                   {
-                     /* Also a typedef with the same name.  */
--                    add_psymbol_to_list (namestring, p - namestring,
-+                    add_psymbol_to_list (sym_name, sym_len,
-                                          VAR_DOMAIN, LOC_TYPEDEF,
-                                          &objfile->static_psymbols,
-                                          nlist.n_value, 0,
-@@ -1749,7 +1773,7 @@ pos %d"),
-           case 't':
-             if (p != namestring)      /* a name is there, not just :T... */
-               {
--                add_psymbol_to_list (namestring, p - namestring,
-+                add_psymbol_to_list (sym_name, sym_len,
-                                      VAR_DOMAIN, LOC_TYPEDEF,
-                                      &objfile->static_psymbols,
-                                      nlist.n_value, 0,
-@@ -1829,7 +1853,7 @@ pos %d"),
-           case 'c':
-             /* Constant, e.g. from "const" in Pascal.  */
--            add_psymbol_to_list (namestring, p - namestring,
-+            add_psymbol_to_list (sym_name, sym_len,
-                                  VAR_DOMAIN, LOC_CONST,
-                                  &objfile->static_psymbols, nlist.n_value,
-                                  0, psymtab_language, objfile);
-@@ -1893,7 +1917,7 @@ pos %d"),
-                 pst->textlow = nlist.n_value;
-                 textlow_not_set = 0;
-               }
--            add_psymbol_to_list (namestring, p - namestring,
-+            add_psymbol_to_list (sym_name, sym_len,
-                                  VAR_DOMAIN, LOC_BLOCK,
-                                  &objfile->static_psymbols,
-                                  0, nlist.n_value,
-@@ -1961,7 +1985,7 @@ pos %d"),
-                 pst->textlow = nlist.n_value;
-                 textlow_not_set = 0;
-               }
--            add_psymbol_to_list (namestring, p - namestring,
-+            add_psymbol_to_list (sym_name, sym_len,
-                                  VAR_DOMAIN, LOC_BLOCK,
-                                  &objfile->global_psymbols,
-                                  0, nlist.n_value,
-@@ -3547,6 +3571,7 @@ static struct sym_fns aout_sym_fns =
+@@ -3581,6 +3581,7 @@ static struct sym_fns aout_sym_fns =
    dbx_new_init,               /* sym_new_init: init anything gbl to entire symtab */
    dbx_symfile_init,   /* sym_init: read initial info, setup for sym_read() */
    dbx_symfile_read,           /* sym_read: read a symbol file into symtab */
@@ -12479,50 +3831,11 @@ index 115bdef..7f756af 100644
    dbx_symfile_finish,         /* sym_finish: finished with file, cleanup */
    default_symfile_offsets, /* sym_offsets: parse user's offsets to
                              internal form */
-diff --git a/gdb/defs.h b/gdb/defs.h
-index 845b320..ad6e7d7 100644
---- a/gdb/defs.h
-+++ b/gdb/defs.h
-@@ -151,6 +151,9 @@ extern int dbx_commands;
- /* System root path, used to find libraries etc.  */
- extern char *gdb_sysroot;
-+/* GDB datadir, used to store data files.  */
-+extern char *gdb_datadir;
-+
- /* Search path for separate debug files.  */
- extern char *debug_file_directory;
-@@ -366,6 +369,9 @@ extern struct cleanup *make_cleanup_fclose (FILE *file);
- extern struct cleanup *make_cleanup_bfd_close (bfd *abfd);
-+struct obstack;
-+extern struct cleanup *make_cleanup_obstack_free (struct obstack *obstack);
-+
- extern struct cleanup *make_cleanup_restore_integer (int *variable);
- extern struct cleanup *make_final_cleanup (make_cleanup_ftype *, void *);
-diff --git a/gdb/doc/ChangeLog b/gdb/doc/ChangeLog
-index 9f01b33..154139a 100644
---- a/gdb/doc/ChangeLog
-+++ b/gdb/doc/ChangeLog
-@@ -14,8 +14,8 @@
- 2009-02-14  Vladimir Prus  <vladimir@codesourcery.com>
--        * observer.texi: Add parameter 'print_frame' to normal_stop
--        observer.
-+      * observer.texi: Add parameter 'print_frame' to normal_stop
-+      observer.
- 2009-02-07  Eli Zaretskii  <eliz@gnu.org>
 diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo
-index 10e7388..01a0e41 100644
+index f16b6e2..fe328c7 100644
 --- a/gdb/doc/gdb.texinfo
 +++ b/gdb/doc/gdb.texinfo
-@@ -955,8 +955,10 @@ Connect to process ID @var{number}, as with the @code{attach} command.
+@@ -959,8 +959,10 @@ Connect to process ID @var{number}, as with the @code{attach} command.
  @itemx -x @var{file}
  @cindex @code{--command}
  @cindex @code{-x}
@@ -12535,7 +3848,7 @@ index 10e7388..01a0e41 100644
  
  @item -eval-command @var{command}
  @itemx -ex @var{command}
-@@ -1148,6 +1150,16 @@ for remote debugging.
+@@ -1152,6 +1154,16 @@ for remote debugging.
  Run using @var{device} for your program's standard input and output.
  @c FIXME: kingdon thinks there is more to -tty.  Investigate.
  
@@ -12552,344 +3865,7 @@ index 10e7388..01a0e41 100644
  @c resolve the situation of these eventually
  @item -tui
  @cindex @code{--tui}
-@@ -3636,6 +3648,98 @@ A failed Ada assertion.
- A call to @code{exec}.  This is currently only available for HP-UX
- and @sc{gnu}/Linux.
-+@item syscall
-+@itemx syscall @r{[}@var{name} @r{|} @var{number}@r{]} @r{...}
-+@cindex break on a system call.
-+A call to or return from a @code{syscall}.  If no argument is specified,
-+then it catches a call to or return from any system call.
-+
-+@var{name} can be any valid system call name in the system.  You can
-+use the @value{GDBN} command-line completion facilities to list the
-+available choices.  @xref{Completion,, Command Completion}, for
-+details on how to do this.
-+
-+You may also specify the system call numerically.  This may be useful
-+if @value{GDBN} does not fully support your system's list of system
-+calls.
-+
-+The example below illustrates how this command works if you don't provide
-+arguments to it:
-+
-+@smallexample
-+(@value{GDBP}) catch syscall
-+Catchpoint 1 (syscall)
-+(@value{GDBP}) r
-+Starting program: /tmp/catch-syscall
-+
-+Catchpoint 1 (call to syscall 'close'), 0xffffe424 in __kernel_vsyscall ()
-+(@value{GDBP}) c
-+Continuing.
-+
-+Catchpoint 1 (returned from syscall 'close'), 0xffffe424 in __kernel_vsyscall ()
-+(@value{GDBP})
-+@end smallexample
-+
-+Here is an example of catching a system call by name:
-+
-+@smallexample
-+(@value{GDBP}) catch syscall chroot
-+Catchpoint 1 (syscall(s) 'chroot')
-+(@value{GDBP}) r
-+Starting program: /tmp/catch-syscall
-+
-+Catchpoint 1 (call to syscall 'chroot'), 0xffffe424 in __kernel_vsyscall ()
-+(@value{GDBP}) c
-+Continuing.
-+
-+Catchpoint 1 (returned from syscall 'chroot'), 0xffffe424 in __kernel_vsyscall ()
-+(@value{GDBP})
-+@end smallexample
-+
-+And last but not least, an example of specifying a system call
-+numerically:
-+
-+@smallexample
-+(@value{GDBP}) catch syscall 252
-+Catchpoint 1 (syscall(s) 'exit_group')
-+(@value{GDBP}) r
-+Starting program: /tmp/catch-syscall
-+
-+Catchpoint 1 (call to syscall 'exit_group'), 0xffffe424 in __kernel_vsyscall ()
-+(@value{GDBP}) c
-+Continuing.
-+
-+Program exited normally.
-+(@value{GDBP})
-+@end smallexample
-+
-+If you configure @value{GDBN} using the @samp{--without-expat} option,
-+it will not be able to display syscall names.  Also, if your
-+architecture does not have an XML file describing its system calls,
-+you will not be able to see the syscall names.  In either case, you
-+will see a warning like this:
-+
-+@smallexample
-+(@value{GDBP}) catch syscall
-+warning: Could not open "syscalls/i386-linux.xml"
-+warning: Could not load the syscall XML file 'syscalls/i386-linux.xml'.
-+GDB will not be able to display syscall names.
-+Catchpoint 1 (syscall)
-+(@value{GDBP})
-+@end smallexample
-+
-+Of course, the file name will change depending on your architecture and system.
-+
-+Still using the example above, you can also try to catch a syscall by its
-+number.  In this case, you would see something like:
-+
-+@smallexample
-+(@value{GDBP}) catch syscall 252
-+Catchpoint 1 (syscall(s) 252)
-+@end smallexample
-+
-+Again, in this case @value{GDBN} would not be able to display syscall's names.
-+
- @item fork
- A call to @code{fork}.  This is currently only available for HP-UX
- and @sc{gnu}/Linux.
-@@ -4711,6 +4815,24 @@ the program to report that some thread has stopped before prompting for
- another command.  In background execution, @value{GDBN} immediately gives
- a command prompt so that you can issue other commands while your program runs.
-+You need to explicitly enable asynchronous mode before you can use
-+background execution commands.  You can use these commands to
-+manipulate the asynchronous mode setting:
-+
-+@table @code
-+@kindex set target-async
-+@item set target-async on
-+Enable asynchronous mode.
-+@item set target-async off
-+Disable asynchronous mode.
-+@kindex show target-async
-+@item show target-async
-+Show the current target-async setting.
-+@end table
-+
-+If the target doesn't support async mode, @value{GDBN} issues an error
-+message if you attempt to use the background execution commands.
-+
- To specify background execution, add a @code{&} to the command.  For example,
- the background form of the @code{continue} command is @code{continue&}, or
- just @code{c&}.  The execution commands that accept background execution
-@@ -4776,11 +4898,6 @@ only the current thread.  To stop the whole program in non-stop mode,
- use @code{interrupt -a}.
- @end table
--You may need to explicitly enable async mode before you can use background
--execution commands, with the @code{set target-async 1} command.  If the
--target doesn't support async mode, @value{GDBN} issues an error message
--if you attempt to use the background execution commands.
--
- @node Thread-Specific Breakpoints
- @subsection Thread-Specific Breakpoints
-@@ -6536,6 +6653,12 @@ Without this format, @value{GDBN} displays pointers to and arrays of
- @code{char}, @w{@code{unsigned char}}, and @w{@code{signed char}} as
- strings.  Single-byte members of a vector are displayed as an integer
- array.
-+
-+@item r
-+@cindex raw printing
-+Print using the @samp{raw} formatting.  By default, @value{GDBN} will
-+use a type-specific pretty-printer.  The @samp{r} format bypasses any
-+pretty-printer which might exist for the value's type.
- @end table
- For example, to print the program counter in hex (@pxref{Registers}), type
-@@ -7408,6 +7531,20 @@ On HP-UX systems, if you refer to a function or variable name that
- begins with a dollar sign, @value{GDBN} searches for a user or system
- name first, before it searches for a convenience variable.
-+@cindex convenience functions
-+@value{GDBN} also supplies some @dfn{convenience functions}.  These
-+have a syntax similar to convenience variables.  A convenience
-+function can be used in an expression just like an ordinary function;
-+however, a convenience function is implemented internally to
-+@value{GDBN}.
-+
-+@table @code
-+@item help function
-+@kindex help function
-+@cindex show all convenience functions
-+Print a list of all convenience functions.
-+@end table
-+
- @node Registers
- @section Registers
-@@ -7931,13 +8068,17 @@ support:
- @table @code
- @item set target-charset @var{charset}
- @kindex set target-charset
--Set the current target character set to @var{charset}.  We list the
--character set names @value{GDBN} recognizes below, but if you type
--@code{set target-charset} followed by @key{TAB}@key{TAB}, @value{GDBN} will
--list the target character sets it supports.
--@end table
-+Set the current target character set to @var{charset}.  If you type
-+@code{set target-charset} followed by @key{TAB}@key{TAB}, @value{GDBN}
-+will list the target character sets it supports.
-+
-+@item set target-wide-charset @var{charset}
-+@kindex set target-wide-charset
-+Set the current target wide character set to @var{charset}.  The
-+target wide character set is the character set used by @code{wchar_t}.
-+If you type @code{set target-charset} followed by @key{TAB}@key{TAB},
-+@value{GDBN} will list the target character sets it supports.
--@table @code
- @item set host-charset @var{charset}
- @kindex set host-charset
- Set the current host character set to @var{charset}.
-@@ -7947,10 +8088,9 @@ system it is running on; you can override that default using the
- @code{set host-charset} command.
- @value{GDBN} can only use certain character sets as its host character
--set.  We list the character set names @value{GDBN} recognizes below, and
--indicate which can be host character sets, but if you type
--@code{set target-charset} followed by @key{TAB}@key{TAB}, @value{GDBN} will
--list the host character sets it supports.
-+set.  If you type @code{set target-charset} followed by
-+@key{TAB}@key{TAB}, @value{GDBN} will list the host character sets it
-+supports.
- @item set charset @var{charset}
- @kindex set charset
-@@ -7974,37 +8114,6 @@ Show the name of the current target charset.
- @end table
--@value{GDBN} currently includes support for the following character
--sets:
--
--@table @code
--
--@item ASCII
--@cindex ASCII character set
--Seven-bit U.S. @sc{ascii}.  @value{GDBN} can use this as its host
--character set.
--
--@item ISO-8859-1
--@cindex ISO 8859-1 character set
--@cindex ISO Latin 1 character set
--The ISO Latin 1 character set.  This extends @sc{ascii} with accented
--characters needed for French, German, and Spanish.  @value{GDBN} can use
--this as its host character set.
--
--@item EBCDIC-US
--@itemx IBM1047
--@cindex EBCDIC character set
--@cindex IBM1047 character set
--Variants of the @sc{ebcdic} character set, used on some of IBM's
--mainframe operating systems.  (@sc{gnu}/Linux on the S/390 uses U.S. @sc{ascii}.)
--@value{GDBN} cannot use these as its host character set.
--
--@end table
--
--Note that these are all single-byte character sets.  More work inside
--@value{GDBN} is needed to support multi-byte or variable-width character
--encodings, like the UTF-8 and UCS-2 encodings of Unicode.
--
- Here is an example of @value{GDBN}'s character set support in action.
- Assume that the following source code has been placed in the file
- @file{charset-test.c}:
-@@ -12481,6 +12590,53 @@ returned.  In contrast, the @code{finish} command (@pxref{Continuing
- and Stepping, ,Continuing and Stepping}) resumes execution until the
- selected stack frame returns naturally.
-+@value{GDBN} needs to know how the @var{expression} argument should be set for
-+the inferior.  The concrete registers assignment depends on the OS ABI and the
-+type being returned by the selected stack frame.  For example it is common for
-+OS ABI to return floating point values in FPU registers while integer values in
-+CPU registers.  Still some ABIs return even floating point values in CPU
-+registers.  Larger integer widths (such as @code{long long int}) also have
-+specific placement rules.  @value{GDBN} already knows the OS ABI from its
-+current target so it needs to find out also the type being returned to make the
-+assignment into the right register(s).
-+
-+Normally, the selected stack frame has debug info.  @value{GDBN} will always
-+use the debug info instead of the implicit type of @var{expression} when the
-+debug info is available.  For example, if you type @kbd{return -1}, and the
-+function in the current stack frame is declared to return a @code{long long
-+int}, @value{GDBN} transparently converts the implicit @code{int} value of -1
-+into a @code{long long int}:
-+
-+@smallexample
-+Breakpoint 1, func () at gdb.base/return-nodebug.c:29
-+29        return 31;
-+(@value{GDBP}) return -1
-+Make func return now? (y or n) y
-+#0  0x004004f6 in main () at gdb.base/return-nodebug.c:43
-+43        printf ("result=%lld\n", func ());
-+(@value{GDBP})
-+@end smallexample
-+
-+However, if the selected stack frame does not have a debug info, e.g., if the
-+function was compiled without debug info, @value{GDBN} has to find out the type
-+to return from user.  Specifying a different type by mistake may set the value
-+in different inferior registers than the caller code expects.  For example,
-+typing @kbd{return -1} with its implicit type @code{int} would set only a part
-+of a @code{long long int} result for a debug info less function (on 32-bit
-+architectures).  Therefore the user is required to specify the return type by
-+an appropriate cast explicitly:
-+
-+@smallexample
-+Breakpoint 2, 0x0040050b in func ()
-+(@value{GDBP}) return -1
-+Return value type not available for selected stack frame.
-+Please use an explicit cast of the value to return.
-+(@value{GDBP}) return (long long int) -1
-+Make selected stack frame return now? (y or n) y
-+#0  0x00400526 in main ()
-+(@value{GDBP})
-+@end smallexample
-+
- @node Calling
- @section Calling Program Functions
-@@ -12510,6 +12666,12 @@ It is possible for the function you call via the @code{print} or
- the function, or if you passed it incorrect arguments).  What happens
- in that case is controlled by the @code{set unwindonsignal} command.
-+Similarly, with a C++ program  it is possible for the function you
-+call via the @code{print} or @code{call} command to generate an
-+exception that is not handled due to the constraints of the dummy
-+frame. What happens in that case is controlled by the  
-+@code{set unwind-on-terminating-exception} command.
-+
- @table @code
- @item set unwindonsignal
- @kindex set unwindonsignal
-@@ -12526,6 +12688,23 @@ received.
- @kindex show unwindonsignal
- Show the current setting of stack unwinding in the functions called by
- @value{GDBN}.
-+
-+@item set unwind-on-terminating-exception
-+@kindex set unwind-on-terminating-exception
-+@cindex unwind stack in called functions
-+@cindex call dummy stack unwinding on unhandled exception.
-+Set unwinding of the stack if a C++ exception is raised but unhandled  
-+while in a function that @value{GDBN} called in the program being
-+debugged.  If set to on (the default), @value{GDBN} unwinds the stack
-+it created for the call and restores the context to what it was before
-+the call.  If set to off, @value{GDBN} the exception is delivered to
-+the default C++ exception handler.
-+
-+@item show unwind-on-terminating-exception
-+@kindex show unwind-on-terminating-exception
-+Show the current setting of stack unwinding in the functions called by
-+@value{GDBN}.
-+
- @end table
- @cindex weak alias functions
-@@ -17815,7 +17994,7 @@ command:
+@@ -18650,7 +18662,7 @@ command:
  @table @code
  @kindex source
  @cindex execute commands from a file
@@ -12898,7 +3874,7 @@ index 10e7388..01a0e41 100644
  Execute the command file @var{filename}.
  @end table
  
-@@ -17832,6 +18011,11 @@ If @code{-v}, for verbose mode, is given then @value{GDBN} displays
+@@ -18667,6 +18679,11 @@ If @code{-v}, for verbose mode, is given then @value{GDBN} displays
  each command as it is executed.  The option must be given before
  @var{filename}, and is interpreted as part of the filename anywhere else.
  
@@ -12910,7 +3886,7 @@ index 10e7388..01a0e41 100644
  Commands that would ask for confirmation if used interactively proceed
  without asking when used in a command file.  Many @value{GDBN} commands that
  normally print messages to say what they are doing omit the messages
-@@ -18093,8 +18277,6 @@ containing @code{end}.  For example:
+@@ -18928,8 +18945,6 @@ containing @code{end}.  For example:
  
  @smallexample
  (@value{GDBP}) python
@@ -12919,7 +3895,7 @@ index 10e7388..01a0e41 100644
  >print 23
  >end
  23
-@@ -18107,6 +18289,14 @@ in a Python script.  This can be controlled using @code{maint set
+@@ -18942,6 +18957,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.
@@ -12934,7 +3910,7 @@ index 10e7388..01a0e41 100644
  @end table
  
  @node Python API
-@@ -18114,6 +18304,14 @@ disabled.
+@@ -18949,6 +18972,14 @@ disabled.
  @cindex python api
  @cindex programming in python
  
@@ -12949,61 +3925,47 @@ index 10e7388..01a0e41 100644
  @cindex python stdout
  @cindex python pagination
  At startup, @value{GDBN} overrides Python's @code{sys.stdout} and
-@@ -18125,8 +18323,17 @@ situation, a Python @code{KeyboardInterrupt} exception is thrown.
- @menu
+@@ -18961,13 +18992,17 @@ situation, a Python @code{KeyboardInterrupt} exception is thrown.
  * Basic Python::                Basic Python Functions.
  * Exception Handling::
+ * Auto-loading::                Automatically loading Python code.
 -* Values From Inferior::
-+* Auto-loading::                Automatically loading Python code.
 +* Values From Inferior::      Python representation of values.
-+* Types From Inferior::               Python representation of types.
-+* Pretty Printing::           Pretty-printing values.
+ * Types In Python::           Python representation of types.
+ * Pretty Printing::           Pretty-printing values.
+ * Selecting Pretty-Printers::   How GDB chooses a pretty-printer.
++* Inferiors In Python::               Python representation of inferiors (processes)
 +* Threads In Python::           Accessing inferior threads from Python.
  * Commands In Python::          Implementing new commands in Python.
 +* Parameters In Python::        Adding new @value{GDBN} parameters.
-+* Functions In Python::         Writing new convenience functions.
-+* Objfiles In Python::          Object files.
+ * Functions In Python::         Writing new convenience functions.
+ * Objfiles In Python::          Object files.
 +* Breakpoints In Python::       Manipulating breakpoints using Python.
-+* Frames In Python::            Acessing inferior stack frames from Python.
+ * Frames In Python::            Acessing inferior stack frames from Python.
  @end menu
  
- @node Basic Python
-@@ -18152,10 +18359,30 @@ command as having originated from the user invoking it interactively.
+@@ -18994,6 +19029,12 @@ command as having originated from the user invoking it interactively.
  It must be a boolean value.  If omitted, it defaults to @code{False}.
  @end defun
  
--@findex gdb.get_parameter
--@defun get_parameter parameter
--Return the value of a @value{GDBN} parameter.  @var{parameter} is a
--string naming the parameter to look up; @var{parameter} may contain
-+@findex gdb.current_objfile
-+@defun current_objfile
-+When auto-loading a Python script (@pxref{Auto-loading}), @value{GDBN}
-+sets the ``current objfile'' to the corresponding objfile.  This
-+function returns the current objfile.  If there is no current objfile,
-+this function returns @code{None}.
-+@end defun
-+
 +@findex gdb.breakpoints
 +@defun breakpoints
 +Return a sequence holding all of @value{GDBN}'s breakpoints.
 +@xref{Breakpoints In Python}, for more information.
 +@end defun
 +
-+@findex gdb.objfiles
-+@defun objfiles
-+Return a sequence of all the objfiles current known to @value{GDBN}.
-+@xref{Objfiles In Python}.
-+@end defun
-+
-+@findex gdb.parameter
-+@defun parameter name
-+Return the value of the named @value{GDBN} parameter.  @var{name} is a
-+string naming the parameter to look up; @var{name} may contain
- spaces if the parameter has a multi-part name.  For example,
- @samp{print object} is a valid parameter name.
-@@ -18179,6 +18406,28 @@ If no exception is raised, the return value is always an instance of
+ @findex gdb.parameter
+ @defun parameter parameter
+ Return the value of a @value{GDBN} parameter.  @var{parameter} is a
+@@ -19010,6 +19051,7 @@ a Python value of the appropriate type, and returned.
+ @defun history number
+ Return a value from @value{GDBN}'s value history (@pxref{Value
+ History}).  @var{number} indicates which history element to return.
++
+ If @var{number} is negative, then @value{GDBN} will take its absolute value
+ and count backward from the last element (i.e., the most recent element) to
+ find the value to return.  If @var{number} is zero, then @value{GDBN} will
+@@ -19021,6 +19063,28 @@ If no exception is raised, the return value is always an instance of
  @code{gdb.Value} (@pxref{Values From Inferior}).
  @end defun
  
@@ -13032,65 +3994,10 @@ index 10e7388..01a0e41 100644
  @findex gdb.write
  @defun write string
  Print a string to @value{GDBN}'s paginated standard output stream.
-@@ -18193,6 +18442,66 @@ Flush @value{GDBN}'s paginated standard output stream.  Flushing
+@@ -19035,6 +19099,11 @@ Flush @value{GDBN}'s paginated standard output stream.  Flushing
  function.
  @end defun
  
-+@findex gdb.frames
-+@defun frames
-+Return a tuple of all frame objects.
-+@end defun
-+
-+@findex gdb.newest_frame
-+@defun newest_frame
-+Return the newest frame object.
-+@end defun
-+
-+@findex gdb.selected_frame
-+@defun selected_frame
-+Return the selected frame object.
-+@end defun
-+
-+@findex gdb.frame_stop_reason_string
-+@defun frame_stop_reason_string @var{reason}
-+Return a string explaining the reason why @value{GDBN} stopped unwinding
-+frames, as expressed by the given @var{reason} code (an integer, see the
-+@code{unwind_stop_reason} method in
-+@xref{Frames In Python,,Accessing inferior stack frames from Python}.)
-+@end defun
-+
-+@findex gdb.read_memory
-+@defun read_memory @var{address} @var{length}
-+Read @var{length} bytes of memory from the inferior, starting at @var{address}.
-+Returns a buffer object, which behaves much like an array or a string. It
-+can be modified and given to the @code{gdb.write_memory} function.
-+@end defun
-+
-+@findex gdb.write_memory
-+@defun write_memory @var{address} @var{buffer} @r{[}@var{length}@r{]}
-+Write the contents of @var{buffer} (a Python object which supports the buffer
-+protocol, i.e., a string, an array or the object returned from
-+@code{gdb.read_memory}) to the inferior, starting at @var{address}.  If given,
-+@var{length} determines the number of bytes from @var{buffer} to be written.
-+@end defun
-+
-+@findex gdb.search_memory
-+@defun search_memory @var{address} @var{length} @var{pattern} @r{[}@var{size}@r{]} @r{[}@var{max_count}@r{]}
-+Search a region of the inferior memory starting at @var{address} with the given
-+@var{length}.  @var{pattern} can be a string, a byte array, a buffer object,
-+a number, a @code{gdb.Value} object (@pxref{Values From Inferior}) or a list
-+or tuple with elements in any combination of those types.  If @var{size} is
-+given and is non-zero, it specifies the size in bytes of a Python scalar or
-+@code{gdb.Value} in the search pattern.  If @var{size} is zero or not specified,
-+ it is taken from the value's type in the current language.
-+This is useful when one wants to specify the search
-+pattern as a mixture of types.
-+Note that this means, for example, that in the case of C-like languages
-+a search for an untyped 0x42 will search for @samp{(int) 0x42}
-+which is typically four bytes.  @var{max_count} is the highest number of matches
-+to search for.
-+@end defun
-+
 +@findex gdb.solib_address
 +@defun solib_address @var{address}
 +Return the name of the shared library holding the given address, or None.
@@ -13099,581 +4006,188 @@ index 10e7388..01a0e41 100644
  @node Exception Handling
  @subsubsection Exception Handling
  @cindex python exceptions
-@@ -18224,6 +18533,44 @@ message as its value, and the Python call stack backtrace at the
- Python statement closest to where the @value{GDBN} error occured as the
- traceback.
-+@node Auto-loading
-+@subsubsection Auto-loading
-+
-+When a new object file (@pxref{Objfiles In Python}) is read (for
-+example, due to the @code{file} command, or because the inferior has
-+loaded a shared library), @value{GDBN} will look for a file named by
-+adding @samp{-gdb.py} to the object file's real name (the name formed
-+after following all symlinks and resolving @code{.} and @code{..}
-+components).  If this file exists and is readable, @value{GDBN} will
-+evaluate it as a Python script.
-+
-+If this file does not exist, and if the parameter
-+@code{debug-file-directory} is set, then @value{GDBN} will append the
-+object file's real name to the value of this parameter, and try again.
-+
-+Finally, if this file does not exist, then @value{GDBN} will look in
-+subdirectory of @code{gdb_datadir} (whose value is available from
-+@code{maint show gdb_datadir}).  Specifically, @value{GDBN} will take
-+the value of @code{gdb_datadir}, append @samp{python/auto-load}, and
-+then append the object file's real name.
-+
-+Also, if a separate debug file is used, @value{GDBN} will look for the
-+@samp{-gdb.py} file both in the directory associated with the
-+application and the directory associated with the separate debug file.
-+
-+When reading a @samp{-gdb.py} file, @value{GDBN} sets the ``current
-+objfile''.  This is available via the @code{gdb.current_objfile}
-+function.  This can be useful for registering objfile-specific
-+pretty-printers.
-+
-+This feature is useful for supplying application-specific debugging
-+commands and scripts.  It can be disabled using @code{maint set python
-+auto-load}.
-+
-+@value{GDBN} does not track which files it has already auto-loaded.
-+So, your @samp{-gdb.py} file should take care to ensure that it may be
-+evaluated multiple times without error.
-+
- @node Values From Inferior
- @subsubsection Values From Inferior
- @cindex values from inferior, with Python
-@@ -18258,8 +18605,21 @@ bar = some_val['foo']
- Again, @code{bar} will also be a @code{gdb.Value} object.
--For pointer data types, @code{gdb.Value} provides a method for
--dereferencing the pointer to obtain the object it points to.
-+The following methods are provided:
-+
-+@table @code
-+@defmethod Value address
-+If the @code{gdb.Value} object is addressable, this will return a new
-+@code{gdb.Value} object representing the address.  Otherwise, this
-+will throw an exception.
-+@end defmethod
-+
+@@ -19171,6 +19240,13 @@ The type of this @code{gdb.Value}.  The value of this attribute is a
+ The following methods are provided:
+ @table @code
 +@defmethod Value cast type
 +Cast the @code{gdb.Value} to the type represented by @var{type}, and
 +return a new @code{gdb.Value}.  @var{type} must be a @code{gdb.Type}
 +object.  If the cast cannot be performed for some reason, an exception
 +is thrown.
 +@end defmethod
++
  @defmethod Value dereference
- This method returns a new @code{gdb.Value} object whose contents is
-@@ -18282,7 +18642,7 @@ The result @code{bar} will be a @code{gdb.Value} object holding the
- value pointed to by @code{foo}.
+ For pointer data types, this method returns a new @code{gdb.Value} object
+ whose contents is the object pointed to by the pointer.  For example, if
+@@ -19242,6 +19318,9 @@ module:
+ This function looks up a type by name.  @var{name} is the name of the
+ type to look up.  It must be a string.
++If @var{block} is given, then @var{name} is looked up in that scope.
++Otherwise, it is searched for globally.
++
+ Ordinarily, this function will return an instance of @code{gdb.Type}.
+ If the named type cannot be found, it will throw an exception.
+ @end defun
+@@ -19294,6 +19373,12 @@ This is @code{True} if the field is artificial, usually meaning that
+ it was provided by the compiler and not the user.  This attribute is
+ always provided, and is @code{False} if the field is not artificial.
++@item is_base_class
++This is @code{True} if the field represents a base class of a C@t{++}
++structure.  This attribute is always provided, and is @code{False}
++if the field is not a base class of the type on which @code{fields} was
++called, or if that type was not a C@t{++} class.
++
+ @item bitsize
+ If the field is packed, or is a bitfield, then this will have a
+ non-zero value, which is the size of the field in bits.  Otherwise,
+@@ -19346,7 +19431,7 @@ If the type does not have a target, this method will throw an
+ exception.
  @end defmethod
  
--@defmethod Value string @r{[}encoding @r{[}errors@r{]}@r{]}
-+@defmethod Value string @r{[}encoding@r{]} @r{[}errors@r{]}
- If this @code{gdb.Value} represents a string, then this method
- converts the contents to a Python string.  Otherwise, this method will
- throw an exception.
-@@ -18309,6 +18669,468 @@ The optional @var{errors} argument is the same as the corresponding
- argument to Python's @code{string.decode} method.
+-@defmethod Type template_argument n
++@defmethod Type template_argument n [block]
+ If this @code{gdb.Type} is an instantiation of a template, this will
+ return a new @code{gdb.Type} which represents the type of the
+ @var{n}th template argument.
+@@ -19354,7 +19439,8 @@ return a new @code{gdb.Type} which represents the type of the
+ If this @code{gdb.Type} is not a template type, this will throw an
+ exception.  Ordinarily, only C@t{++} code will have template types.
+-@var{name} is searched for globally.
++If @var{block} is given, then @var{name} is looked up in that scope.
++Otherwise, it is searched for globally.
  @end defmethod
+ @end table
  
-+@defmethod Value type
-+Return the type of this @code{gdb.Value}.  The result is a
-+@code{gdb.Type} object.
-+@end defmethod
-+@end table
+@@ -19708,6 +19794,121 @@ import gdb.libstdcxx.v6
+ gdb.libstdcxx.v6.register_printers (gdb.current_objfile ())
+ @end smallexample
++@node Inferiors In Python
++@subsubsection Inferiors In Python
 +
-+@node Types From Inferior
-+@subsubsection Types From Inferior
++Programs which are being run under @value{GDBN} are called inferiors
++(@pxref{Inferiors}).  Python scripts can access information about and
++manipulate inferiors controlled by @value{GDBN} via objects of the
++@code{gdb.Inferior} class.
 +
-+@cindex gdb.Type
-+@value{GDBN} represents types from the inferior using the class
-+@code{gdb.Type}.
++The following inferior-related functions are available in the @code{gdb}
++module:
++
++@defun inferiors
++Return a tuple containing all inferior objects.
++@end defun
 +
-+The following methods are provided:
++A @code{gdb.Inferior} object has the following attributes:
 +
 +@table @code
-+@defmethod Type Type [name [block]]
-+Construct a new instance of @code{gdb.Type}.
++@defivar Inferior num 
++ID of inferior, as assigned by GDB.
++@end defivar
 +
-+If @var{name} is given, it specifies the name of a type to look up in
-+the inferior.
++@defivar Inferior pid 
++Process ID of the inferior, assigned by the underlying OS.
++@end defivar
 +
-+If @var{block} is given, then @var{name} is looked up in that scope.
-+Otherwise, it is searched for globally.
-+@end defmethod
++@defivar Inferior was_attached
++Boolean signaling whether the inferior was created using `attach', or
++started by @value{GDBN} itself.
++@end defivar
++@end table
 +
-+@defmethod Type code
-+Return the type code for this type.  The type code will be one of the
-+@code{TYPE_CODE_} constants defined below.
++A @code{gdb.Inferior} object has the following methods:
++
++@table @code
++@defmethod Inferior threads 
++This method returns a tuple holding all the threads which are valid
++when it is called.  If there are no valid threads, the method will
++return an empty list.
 +@end defmethod
 +
-+@defmethod Type fields
-+For structure and union types, this method returns the fields.  Range
-+types have two fields, the minimum and maximum values.  Enum types
-+have one field per enum constant.  Function and method types have one
-+field per parameter.  The base types of C++ classes are also
-+represented as fields.  If the type has no fields, or does not fit
-+into one of these categories, an empty sequence will be returned.
++@findex gdb.read_memory
++@defmethod Inferior read_memory @var{address} @var{length}
++Read @var{length} bytes of memory from the inferior, starting at
++@var{address}.  Returns a buffer object, which behaves much like an array
++or a string. It can be modified and given to the @code{gdb.write_memory}
++function.
++@end defmethod
 +
-+Each field is an object, with some pre-defined attributes:
-+@table @code
-+@item bitpos
-+This attribute is not available for @code{static} fields.  For
-+non-@code{static} fields, the value is the bit position of the field.
++@findex gdb.write_memory
++@defmethod Inferior write_memory @var{address} @var{buffer} @r{[}@var{length}@r{]}
++Write the contents of @var{buffer} (a Python object which supports the
++buffer protocol, i.e., a string, an array or the object returned from
++@code{gdb.read_memory}) to the inferior, starting at @var{address}.
++If given, @var{length} determines the number of bytes from @var{buffer} to
++be written.
++@end defmethod
 +
-+@item name
-+The name of the field, or @code{None} for anonymous fields.
++@findex gdb.search_memory
++@defmethod Inferior search_memory @var{address} @var{length} @var{pattern} @r{[}@var{size}@r{]} @r{[}@var{max_count}@r{]}
++Search a region of the inferior memory starting at @var{address} with the
++given @var{length}.  @var{pattern} can be a string, a byte array, a buffer
++object, a number, a @code{gdb.Value} object (@pxref{Values From Inferior})
++or a list or tuple with elements in any combination of those types.  If
++@var{size} is given and is non-zero, it specifies the size in bytes of a
++Python scalar or @code{gdb.Value} in the search pattern.  If @var{size} is
++zero or not specified, it is taken from the value's type in the current
++language.  This is useful when one wants to specify the search pattern as
++a mixture of types.  Note that this means, for example, that in the case of
++C-like languages a search for an untyped 0x42 will search for
++@samp{(int) 0x42} which is typically four bytes.  @var{max_count} is the
++highest number of matches to search for.
++@end defmethod
++@end table
 +
-+@item artificial
-+This is @code{True} if the field is artificial, usually meaning that
-+it was provided by the compiler and not the user.  This attribute is
-+always provided, and is @code{False} if the field is not artificial.
++@node Threads In Python
++@subsubsection Threads In Python
 +
-+@item bitsize
-+If the field is packed, or is a bitfield, then this will have a
-+non-zero value, which is the size of the field in bits.  Otherwise,
-+this will be zero; in this case the field's size is given by its type.
++Python scripts can access information about and manipulate inferior threads
++controlled by @value{GDBN} via objects of the @code{gdb.InferiorThread} class.
 +
-+@item type
-+The type of the field.
-+@end table
-+@end defmethod
++The following inferior-related functions are available in the @code{gdb}
++module:
 +
-+@defmethod Type const
-+Return a new @code{gdb.Type} object which represents a
-+@code{const}-qualified variant of this type.
-+@end defmethod
++@findex gdb.selected_thread
++@defun selected_thread
++This function returns the thread object for the selected thread.  If there
++is no selected thread, this will return @code{None}.
++@end defun
 +
-+@defmethod Type volatile
-+Return a new @code{gdb.Type} object which represents a
-+@code{volatile}-qualified variant of this type.
-+@end defmethod
++A @code{gdb.InferiorThread} object has the following attributes:
 +
-+@defmethod Type unqualified
-+Return a new @code{gdb.Type} object which represents an unqualified
-+variant of this type.  That is, the result is neither @code{const} nor
-+@code{volatile}.
-+@end defmethod
++@table @code
++@defivar InferiorThread num 
++ID of the thread, as assigned by GDB.
++@end defivar
++@end table
 +
-+@defmethod Type reference
-+Return a new @code{gdb.Type} object which represents a reference to this
-+type.
-+@end defmethod
++A @code{gdb.InferiorThread} object has the following methods:
 +
-+@defmethod Type sizeof
-+Return the size of this type, in target @code{char} units.  Usually, a
-+target's @code{char} type will be an 8-bit byte.  However, on some
-+unusual platforms, this type may have a different size.
++@table @code
++@defmethod InferiorThread frames
++Return a tuple containing all frames in the thread.
 +@end defmethod
 +
-+@defmethod Type strip_typedefs
-+Return a new @code{gdb.Type} that represents the real type,
-+after removing all layers of typedefs.
++@defmethod InferiorThread newest_frame
++Return the newest frame thread's stack.
 +@end defmethod
 +
-+@defmethod Type tag
-+Return the tag name for this type.  The tag name is the name after
-+@code{struct}, @code{union}, or @code{enum} in C; not all languages
-+have this concept.  If this type has no tag name, then @code{None} is
-+returned.
++@defmethod InferiorThread switch_to_thread 
++This changes @value{GDBN}'s currently selected thread to the one represented
++by this object.
 +@end defmethod
-+
-+@defmethod Type target
-+Return a new @code{gdb.Type} object which represents the target type
-+of this type.
-+
-+For a pointer type, the target type is the type of the pointed-to
-+object.  For an array type, the target type is the type of the
-+elements of the array.  For a function type, the target type is the
-+type of the return value.  For a complex type, the target type is the
-+type of the elements.  For a typedef, the target type is the aliased
-+type.
-+@end defmethod
-+
-+@defmethod Type template_argument n [block]
-+If this @code{gdb.Type} is a template type, this will return a new
-+@code{gdb.Type} which represents the type of the @var{n}th template
-+argument.
-+
-+If this @code{gdb.Type} is not a template type, this will throw an
-+exception.
-+
-+If @var{block} is given, then @var{name} is looked up in that scope.
-+Otherwise, it is searched for globally.
-+@end defmethod
-+@end table
-+
-+
-+Each type has a code, which indicates what category this type falls
-+into.  The available type categories are represented by constants
-+defined in the @code{gdb} module:
-+
-+@table @code
-+@findex TYPE_CODE_PTR
-+@findex gdb.TYPE_CODE_PTR
-+@item TYPE_CODE_PTR
-+The type is a pointer.
-+
-+@findex TYPE_CODE_ARRAY
-+@findex gdb.TYPE_CODE_ARRAY
-+@item TYPE_CODE_ARRAY
-+The type is an array.
-+
-+@findex TYPE_CODE_STRUCT
-+@findex gdb.TYPE_CODE_STRUCT
-+@item TYPE_CODE_STRUCT
-+The type is a structure.
-+
-+@findex TYPE_CODE_UNION
-+@findex gdb.TYPE_CODE_UNION
-+@item TYPE_CODE_UNION
-+The type is a union.
-+
-+@findex TYPE_CODE_ENUM
-+@findex gdb.TYPE_CODE_ENUM
-+@item TYPE_CODE_ENUM
-+The type is an enum.
-+
-+@findex TYPE_CODE_FLAGS
-+@findex gdb.TYPE_CODE_FLAGS
-+@item TYPE_CODE_FLAGS
-+A bit flags type.
-+@c FIXME: what is this?
-+
-+@findex TYPE_CODE_FUNC
-+@findex gdb.TYPE_CODE_FUNC
-+@item TYPE_CODE_FUNC
-+The type is a function.
-+
-+@findex TYPE_CODE_INT
-+@findex gdb.TYPE_CODE_INT
-+@item TYPE_CODE_INT
-+The type is an integer type.
-+
-+@findex TYPE_CODE_FLT
-+@findex gdb.TYPE_CODE_FLT
-+@item TYPE_CODE_FLT
-+A floating point type.
-+
-+@findex TYPE_CODE_VOID
-+@findex gdb.TYPE_CODE_VOID
-+@item TYPE_CODE_VOID
-+The special type @code{void}.
-+
-+@findex TYPE_CODE_SET
-+@findex gdb.TYPE_CODE_SET
-+@item TYPE_CODE_SET
-+A Pascal set type.
-+
-+@findex TYPE_CODE_RANGE
-+@findex gdb.TYPE_CODE_RANGE
-+@item TYPE_CODE_RANGE
-+A range type, that is, an integer type with bounds.
-+
-+@findex TYPE_CODE_STRING
-+@findex gdb.TYPE_CODE_STRING
-+@item TYPE_CODE_STRING
-+A string type.  Note that this is only used for certain languages with
-+language-defined string types; C strings are not represented this way.
-+
-+@findex TYPE_CODE_BITSTRING
-+@findex gdb.TYPE_CODE_BITSTRING
-+@item TYPE_CODE_BITSTRING
-+A string of bits.
-+
-+@findex TYPE_CODE_ERROR
-+@findex gdb.TYPE_CODE_ERROR
-+@item TYPE_CODE_ERROR
-+An unknown or erroneous type.
-+
-+@findex TYPE_CODE_METHOD
-+@findex gdb.TYPE_CODE_METHOD
-+@item TYPE_CODE_METHOD
-+A C++ method type.
-+
-+@findex TYPE_CODE_METHODPTR
-+@findex gdb.TYPE_CODE_METHODPTR
-+@item TYPE_CODE_METHODPTR
-+A pointer-to-member-function.
-+
-+@findex TYPE_CODE_MEMBERPTR
-+@findex gdb.TYPE_CODE_MEMBERPTR
-+@item TYPE_CODE_MEMBERPTR
-+A pointer-to-member.
-+
-+@findex TYPE_CODE_REF
-+@findex gdb.TYPE_CODE_REF
-+@item TYPE_CODE_REF
-+A reference type.
-+
-+@findex TYPE_CODE_CHAR
-+@findex gdb.TYPE_CODE_CHAR
-+@item TYPE_CODE_CHAR
-+A character type.
-+
-+@findex TYPE_CODE_BOOL
-+@findex gdb.TYPE_CODE_BOOL
-+@item TYPE_CODE_BOOL
-+A boolean type.
-+
-+@findex TYPE_CODE_COMPLEX
-+@findex gdb.TYPE_CODE_COMPLEX
-+@item TYPE_CODE_COMPLEX
-+A complex float type.
-+
-+@findex TYPE_CODE_TYPEDEF
-+@findex gdb.TYPE_CODE_TYPEDEF
-+@item TYPE_CODE_TYPEDEF
-+A typedef to some other type.
-+
-+@findex TYPE_CODE_TEMPLATE
-+@findex gdb.TYPE_CODE_TEMPLATE
-+@item TYPE_CODE_TEMPLATE
-+A C++ template type.  Note that this is not used for a template
-+instantiation; those appear as ordinary struct types.
-+@c FIXME I hope that is true
-+
-+@findex TYPE_CODE_TEMPLATE_ARG
-+@findex gdb.TYPE_CODE_TEMPLATE_ARG
-+@item TYPE_CODE_TEMPLATE_ARG
-+A C++ template argument.
-+@c FIXME: is this ever used?
-+
-+@findex TYPE_CODE_NAMESPACE
-+@findex gdb.TYPE_CODE_NAMESPACE
-+@item TYPE_CODE_NAMESPACE
-+A C++ namespace.
-+
-+@findex TYPE_CODE_DECFLOAT
-+@findex gdb.TYPE_CODE_DECFLOAT
-+@item TYPE_CODE_DECFLOAT
-+A decimal floating point type.
-+
-+@findex TYPE_CODE_INTERNAL_FUNCTION
-+@findex gdb.TYPE_CODE_INTERNAL_FUNCTION
-+@item TYPE_CODE_INTERNAL_FUNCTION
-+A function internal to @value{GDBN}.  This is the type used to represent
-+convenience functions.
-+@end table
-+
-+@node Pretty Printing
-+@subsubsection Pretty Printing
-+
-+@value{GDBN} provides a mechanism to allow pretty-printing of values
-+using Python code.  This mechanism works for both MI and the CLI.
-+
-+A pretty-printer is an object that implements a specific interface.
-+There is no predefined base class for pretty-printers.
-+
-+@defop Operation {pretty printer} __init__ (self, val)
-+When printing a value, @value{GDBN} constructs an instance of the
-+pretty-printer.  @var{val} is the value to be printed, an instance of
-+@code{gdb.Value}.
-+@end defop
-+
-+@defop Operation {pretty printer} children (self)
-+When printing a value, @value{GDBN} will call this method to compute
-+the children of the value passed to the object's constructor.
-+
-+This method must return an object conforming to the Python iterator
-+protocol.  Each element returned by the iterator must be a tuple
-+holding two elements.  The first element is the ``name'' of the child;
-+the second element is the child's value.  The value can be any Python
-+object which is convertible to a @value{GDBN} value.
-+
-+This method is optional.  If it does not exist, @value{GDBN} will act
-+as though the value has no children.
-+@end defop
-+
-+@defop Operation {pretty printer} display_hint (self)
-+This method must return a string.  The CLI may use this to change the
-+formatting of children of a value.  The result will also be supplied
-+to an MI consumer as a @samp{displayhint} attribute of the variable
-+being printed.
-+
-+Some display hints are predefined by @value{GDBN}:
-+
-+@table @samp
-+@item array
-+Indicate that the object being printed is ``array-like''.  The CLI
-+uses this to respect parameters such as @code{set print elements} and
-+@code{set print array}.
-+
-+@item map
-+Indicate that the object being printed is ``map-like'', and that the
-+children of this value can be assumed to alternate between keys and
-+values.
-+
-+@item string
-+Indicate that the object being printed is ``string-like''.  If the
-+printer's @code{to_string} method returns a Python string of some
-+kind, then @value{GDBN} will call its internal language-specific
-+string-printing function to format the string.  For the CLI this means
-+adding quotation marks, possibly escaping some characters, respecting
-+@code{set print elements}, and the like.
-+@end table
-+@end defop
-+
-+@defop Operation {pretty printer} to_string (self)
-+@value{GDBN} will call this method to display the string
-+representation of the value passed to the object's constructor.
-+
-+When printing from the CLI, if the @code{to_string} method exists,
-+then @value{GDBN} will prepend its result to the values returned by
-+@code{children}.
-+
-+If this method returns a string, it is printed verbatim.  Otherwise,
-+the result is converted to a @code{gdb.Value}, following the usual
-+algorithm.  Then @value{GDBN} prints this value; this may possibly
-+result in a call to another pretty-printer.  If the result is not
-+convertible to @code{gdb.Value}, an exception is raised.
-+@end defop
-+
-+@subsubsection Selecting Pretty-Printers
-+
-+The Python list @code{gdb.pretty_printers} contains an array of
-+functions that have been registered via addition as a pretty-printer.
-+Each function will be called with a @code{gdb.Value} to be
-+pretty-printed.  Each @code{gdb.Objfile} also contains a
-+@code{pretty_printers} attribute.  A function on one of these lists
-+takes a single @code{gdb.Value} argument and returns a pretty-printer
-+object conforming to the interface definition above.  If this function
-+cannot create a pretty-printer for the value, it should return
-+@code{None}.
-+
-+@value{GDBN} first checks the @code{pretty_printers} attribute of each
-+@code{gdb.Objfile} and iteratively calls each function in the list for
-+that @code{gdb.Objfile} until it receives a pretty-printer object.
-+After these @code{gdb.Objfile} have been exhausted, it tries the
-+global @code{gdb.pretty-printers} list, again calling each function
-+until an object is returned.
-+
-+The order in which the objfiles are searched is not specified.
-+Functions are always invoked from the head of the
-+@code{gdb.pretty-printers} list, and iterated over sequentially until
-+the end of the list, or a printer object is returned.
-+
-+Here is an example showing how a @code{std::string} printer might be
-+written:
-+
-+@smallexample
-+class StdStringPrinter:
-+    "Print a std::string"
-+
-+    def __init__ (self, val):
-+        self.val = val
-+
-+    def to_string (self):
-+        return self.val['_M_dataplus']['_M_p']
-+@end smallexample
-+
-+And here is an example showing how a lookup function for
-+the printer example above might be written. 
-+
-+@smallexample
-+def str_lookup_function (val):
-+
-+    lookup_tag = val.type ().tag ()
-+    regex = re.compile ("^std::basic_string<char,.*>$")
-+    if lookup_tag == None:
-+        return None
-+    if regex.match (lookup_tag):
-+        return StdStringPrinter (val)
-+    
-+    return None
-+@end smallexample
-+
-+The example lookup function extracts the value's type, and attempts to
-+match it to a type that it can pretty-print.  If it is a type the
-+printer can pretty-print, it will return a printer object.  If not, it
-+returns: @code{None}.
-+
-+We recommend that you put your core pretty-printers into a versioned
-+python package, and then restrict your auto-loaded code to idempotent
-+behavior -- for example, just @code{import}s of your printer modules,
-+followed by a call to a register pretty-printers with the current
-+objfile.  This approach will scale more nicely to multiple inferiors,
-+potentially using different library versions.
-+
-+For example, in addition to the above, this code might appear in
-+@code{gdb.libstdcxx.v6}:
-+
-+@smallexample
-+def register_printers (objfile):
-+    objfile.pretty_printers.add (str_lookup_function)
-+@end smallexample
-+
-+And then the corresponding contents of the auto-load file would be:
-+
-+@smallexample
-+import gdb.libstdcxx.v6
-+gdb.libstdcxx.v6.register_printers (gdb.current_objfile ())
-+@end smallexample
-+
-+@node Threads In Python
-+@subsubsection Threads In Python
-+
-+Python scripts can access information about the inferior's threads
-+using some functions provided by @value{GDBN}.  Like all of
-+@value{GDBN}'s Python additions, these are in the @code{gdb} module:
-+
-+@findex gdb.threads
-+@defun threads
-+This function returns a tuple holding all the thread IDs which are
-+valid when the function is called.  If there are no valid threads,
-+this will return @code{None}.
-+@end defun
-+
-+@findex gdb.current_thread
-+@defun current_thread
-+This function returns the thread ID of the selected thread.  If there
-+is no selected thread, this will return @code{None}.
-+@end defun
-+
-+@findex gdb.switch_to_thread
-+@defun switch_to_thread id
-+This changes @value{GDBN}'s currently selected thread to the thread
-+given by @var{id}.  @var{id} must be a valid thread ID as returned by
-+@code{threads}.  If @var{id} is invalid, this function throws an
-+exception.
-+@end defun
++@end table
 +
  @node Commands In Python
  @subsubsection Commands In Python
  
-@@ -18320,7 +19142,7 @@ You can implement new @value{GDBN} CLI commands in Python.  A CLI
- command is implemented using an instance of the @code{gdb.Command}
- class, most commonly using a subclass.
--@defmethod Command __init__ name @var{command-class} @r{[}@var{completer-class} @var{prefix}@r{]}
-+@defmethod Command __init__ name @var{command_class} @r{[}@var{completer_class}@r{]} @r{[}@var{prefix}@r{]}
- The object initializer for @code{Command} registers the new command
- with @value{GDBN}.  This initializer is normally invoked from the
- subclass' own @code{__init__} method.
-@@ -18332,11 +19154,11 @@ an exception is raised.
- There is no support for multi-line commands.
--@var{command-class} should be one of the @samp{COMMAND_} constants
-+@var{command_class} should be one of the @samp{COMMAND_} constants
- defined below.  This argument tells @value{GDBN} how to categorize the
- new command in the help system.
--@var{completer-class} is an optional argument.  If given, it should be
-+@var{completer_class} is an optional argument.  If given, it should be
- one of the @samp{COMPLETE_} constants defined below.  This argument
- tells @value{GDBN} how to perform completion for this command.  If not
- given, @value{GDBN} will attempt to complete using the object's
-@@ -18563,6 +19385,374 @@ registration of the command with @value{GDBN}.  Depending on how the
+@@ -19960,6 +20161,135 @@ registration of the command with @value{GDBN}.  Depending on how the
  Python code is read into @value{GDBN}, you may need to import the
  @code{gdb} module explicitly.
  
-+
 +@node Parameters In Python
 +@subsubsection Parameters In Python
 +
@@ -13803,92 +4317,13 @@ index 10e7388..01a0e41 100644
 +constants provided when the parameter is created.
 +@end table
 +
-+@node Functions In Python
-+@subsubsection Writing new convenience functions
-+
-+@cindex writing convenience functions
-+@cindex convenience functions in python
-+@cindex python convenience functions
-+@tindex gdb.Function
-+@tindex Function
-+You can implement new convenience functions (@pxref{Convenience Vars})
-+in Python.  A convenience function is an instance of a subclass of the
-+class @code{gdb.Function}.
-+
-+@defmethod Function __init__ name
-+The initializer for @code{Function} registers the new function with
-+@value{GDBN}.  The argument @var{name} is the name of the function,
-+a string.  The function will be visible to the user as a convenience
-+variable of type @code{internal function}, whose name is the same as
-+the given @var{name}.
-+
-+The documentation for the new function is taken from the documentation
-+string for the new class.
-+@end defmethod
-+
-+@defmethod Function invoke @var{*args}
-+When a convenience function is evaluated, its arguments are converted
-+to instances of @code{gdb.Value}, and then the function's
-+@code{invoke} method is called.  Note that @value{GDBN} does not
-+predetermine the arity of convenience functions.  Instead, all
-+available arguments are passed to @code{invoke}, following the
-+standard Python calling convention.  In particular, a convenience
-+function can have default values for parameters without ill effect.
-+
-+The return value of this method is used as its value in the enclosing
-+expression.  If an ordinary Python value is returned, it is converted
-+to a @code{gdb.Value} following the usual rules.
-+@end defmethod
-+
-+The following code snippet shows how a trivial convenience function can
-+be implemented in Python:
-+
-+@smallexample
-+class Greet (gdb.Function):
-+  """Return string to greet someone.
-+Takes a name as argument."""
-+
-+  def __init__ (self):
-+    super (Greet, self).__init__ ("greet")
-+
-+  def invoke (self, name):
-+    return "Hello, %s!" % name.string ()
-+
-+Greet ()
-+@end smallexample
-+
-+The last line instantiates the class, and is necessary to trigger the
-+registration of the function with @value{GDBN}.  Depending on how the
-+Python code is read into @value{GDBN}, you may need to import the
-+@code{gdb} module explicitly.
-+
-+@node Objfiles In Python
-+@subsubsection Objfiles In Python
-+
-+@cindex objfiles in python
-+@cindex python objfiles
-+@tindex gdb.Objfile
-+@tindex Objfile
-+@value{GDBN} loads symbols for an inferior from various
-+symbol-containing files.  These include the primary executable file,
-+any shared libraries used by the inferior, and any separate debug info
-+files.  @value{GDBN} calls these symbol-containing files
-+@dfn{objfiles}.
-+
-+Each objfile is represented by an instance of the @code{gdb.Objfile}
-+class.
-+
-+@defivar Objfile filename
-+The file name of the objfile as a string.
-+@end defivar
-+
-+@defivar Objfile pretty_printers
-+The @code{pretty_printers} attribute is used to look up
-+pretty-printers by type.  This is a dictionary which maps regular
-+expressions (strings) to pretty-printing objects.  @xref{Pretty
-+Printing}, for more information.
-+@end defivar
-+
+ @node Functions In Python
+ @subsubsection Writing new convenience functions
+@@ -20064,6 +20394,82 @@ which is used to format the value.  @xref{Pretty Printing}, for more
+ information.
+ @end defivar
 +@node Breakpoints In Python
 +@subsubsection Manipulating breakpoints using Python
 +
@@ -13965,231 +4400,190 @@ index 10e7388..01a0e41 100644
 +@code{None}.  This attribute is not writable.
 +@end defivar
 +
-+@node Frames In Python
-+@subsubsection Accessing inferior stack frames from Python.
-+
-+@cindex frames in python
-+@tindex gdb.Frame
-+@tindex Frame
-+When the debugged program stops, @value{GDBN} is able to analyse its call
-+stack (@pxref{Frames,,Stack frames}).  The @code{gdb.Frame} class
-+represents a frame in the stack.  You can get a tuple containing all the
-+frames in the stack with the @code{gdb.frames} function, the newest
-+frame with the @code{gdb.newest_frame} function, and the selected frame
-+with the @code{gdb.selected_frame} function
-+(see @xref{Selection,,Selecting a Frame}.)  See
-+@xref{Basic Python,,Basic Python}.
-+
-+A @code{gdb.Frame} object has the following methods:
-+
-+@table @code
-+@defmethod Frame equals @code{frame}
-+Compare frames.
-+@end defmethod
-+
-+@defmethod Frame is_valid
-+Returns true if the @code{gdb.Frame} object is valid, false if not.
-+A frame object can become invalid if the frame it refers to doesn't
-+exist anymore in the inferior.  All @code{gdb.Frame} methods will throw
-+an exception if it is invalid at the time the method call is made.
-+@end defmethod
-+
-+@defmethod Frame name
-+Returns the function name of the frame, or @code{None} if it can't be
-+obtained.
-+@end defmethod
-+
-+@defmethod Frame type
-+Returns the type of the frame. The value can be one of
-+@code{gdb.NORMAL_FRAME}, @code{gdb.DUMMY_FRAME}, @code{gdb.SIGTRAMP_FRAME}
-+or @code{gdb.SENTINEL_FRAME}.
-+@end defmethod
-+
-+@defmethod Frame unwind_stop_reason
-+Return an integer representing the reason why it's not possible to find
-+frames older than this.  Use @code{gdb.frame_stop_reason_string} to convert
-+the value returned by this function to a string.
-+@end defmethod
-+
-+@defmethod Frame pc
-+Returns the frame's resume address.
-+@end defmethod
-+
+ @node Frames In Python
+ @subsubsection Acessing inferior stack frames from Python.
+@@ -20128,6 +20534,14 @@ function to a string.
+ Returns the frame's resume address.
+ @end defmethod
 +@defmethod Frame block
-+Returns the frame's code block. @c (see @xref{Block,,Code Blocks and Scopes}).
-+@end defmethod
-+
-+@defmethod Frame address_in_block
-+Returns an address which falls within the frame's code block.
-+@end defmethod
-+
-+@defmethod Frame older
-+Return the frame immediately older (outer) to this frame.
++Returns the frame's code block. @c (@pxref{Block,,Code Blocks and Scopes}).
 +@end defmethod
 +
-+@defmethod Frame newer
-+Return the frame immediately newer (inner) to this frame.
++@defmethod Frame function
++Returns the symbol for the function corresponding to this frame. @c (@pxref{Symbols In Python}).
 +@end defmethod
 +
+ @defmethod Frame older
+ Return the frame that called this frame.
+ @end defmethod
+@@ -20136,10 +20550,18 @@ Return the frame that called this frame.
+ Return the frame called by this frame.
+ @end defmethod
 +@defmethod Frame find_sal
-+Return the frame's symtab and line object. @c (see @xref{Symtab_and_line,, Symtab and line}).
++Return the frame's symtab and line object. @c (@pxref{Symtab_and_line,, Symtab and line}).
 +@end defmethod
 +
-+@defmethod Frame read_var @var{variable}
-+Return the value of the given variable in this frame.  @code{variable} can be
-+either a string or a @code{gdb.Symbol} object. @c (@pxref{Symbols In Python}).
-+@end defmethod
-+@end table
+ @defmethod Frame read_var variable
+ Return the value of the given variable in this frame.  @var{variable} must
+ be a string.
+ @end defmethod
 +
++@defmethod Frame select
++Set this frame to be the user's selected frame.
++@end defmethod
+ @end table
  @node Interpreters
- @chapter Command Interpreters
- @cindex command interpreters
-@@ -22273,6 +23463,103 @@ Unfreezing a variable does not update it, only subsequent
- (gdb)
- @end smallexample
+diff --git a/gdb/doc/gdbint.texinfo b/gdb/doc/gdbint.texinfo
+index c2be3f7..a7811ab 100644
+--- a/gdb/doc/gdbint.texinfo
++++ b/gdb/doc/gdbint.texinfo
+@@ -2114,6 +2114,18 @@ time, and so we attempt to handle symbols incrementally.  For instance,
+ we create @dfn{partial symbol tables} consisting of only selected
+ symbols, and only expand them to full symbol tables when necessary.
++@menu
++* Symbol Reading::
++* Partial Symbol Tables::
++* Types::
++* Object File Formats::
++* Debugging File Formats::
++* Adding a New Symbol Reader to GDB::
++* Memory Management for Symbol Files::
++* Memory Management for Types::
++@end menu
++
++@node Symbol Reading
+ @section Symbol Reading
+ @cindex symbol reading
+@@ -2206,6 +2218,7 @@ symtab.  Upon return, @code{pst->readin} should have been set to 1, and
+ zero if there were no symbols in that part of the symbol file.
+ @end table
  
-+@subheading The @code{-var-set-visualizer} command
-+@findex -var-set-visualizer
-+@anchor{-var-set-visualizer}
-+
-+@subsubheading Synopsis
-+
-+@smallexample
-+ -var-set-visualizer @var{name} @var{visualizer}
-+@end smallexample
-+
-+@subheading The @code{-var-set-child-range} command
-+@findex -var-set-child-range
-+@anchor{-var-set-child-range}
-+
-+Set a visualizer for the variable object @var{name}.
-+
-+@var{visualizer} is the visualizer to use.  The special value
-+@samp{None} means to disable any visualizer in use.
-+
-+If not @samp{None}, @var{visualizer} must be a Python expression.
-+This expression must evaluate to a callable object which accepts a
-+single argument.  @value{GDBN} will call this object with the value of
-+the varobj @var{name} as an argument.  This function must return an
-+object which conforms to the pretty-printing interface (@pxref{Pretty
-+Printing}).
-+
-+The pre-defined function @code{gdb.default_visualizer} may be used
-+to select a visualizer according to the type of the varobj.  This is
-+called when a varobj is created, and so ordinarily is not needed.
-+
-+@code{gdb.default_visualizer} looks in the global dictionary named
-+@code{gdb.pretty_printers}.
-+
-+This feature is only available if Python support is enabled.
-+
-+@subsubheading Example
-+
-+Resetting the visualizer:
-+
-+@smallexample
-+(gdb)
-+-var-set-visualizer V None
-+^done
-+@end smallexample
-+
-+Reselecting the default (type-based) visualizer:
-+
-+@smallexample
-+(gdb)
-+-var-set-visualizer V gdb.default_visualizer
-+^done
-+@end smallexample
-+
-+Suppose @code{SomeClass} is a visualizer class.  A lambda expression
-+can be used to instantiate this class for a varobj:
-+
-+@smallexample
-+(gdb)
-+-var-set-visualizer V "lambda val: SomeClass()"
-+^done
-+@end smallexample
-+
-+@subsubheading Synopsis
-+
-+@smallexample
-+ -var-set-child-range @var{name} @var{from} @var{to}
-+@end smallexample
-+
-+Select a sub-range of the children of the variable object @var{name};
-+future calls to @code{-var-list-children} will only report the
-+selected range of children.  This allows an MI consumer to avoid
-+inefficiencies if the varobj has very many children.
-+
-+If either @var{from} or @var{to} is less than zero, then sub-range
-+selection is disabled, and @code{-var-list-children} will report all
-+children.
-+
-+Otherwise, @var{from} and @var{to} are indexes into the array of
-+children.  Children starting at @var{from} and stopping jsut before
-+@var{to} will be reported.
-+
-+@subsubheading Example
-+
-+@smallexample
-+(gdb)
-+ -var-list-children n
-+ ^done,numchild=3,children=[@{name="a",numchild=0,type="int"@},
-+ @{name="b",numchild=0,type="int"@},
-+ @{name="c",numchild=0,type="int"@}]
-+(gdb)
-+ -var-set-child-range n 1 2
-+(gdb)
-+ -var-list-children n
-+ ^done,numchild=3,children=[@{name="b",numchild=0,type="int"@},
-+ @{name="c",numchild=0,type="int"@}]
-+@end smallexample
-+
- @c %%%%%%%%%%%%%%%%%%%%%%%%%%%% SECTION %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- @node GDB/MI Data Manipulation
-@@ -23832,6 +25119,10 @@ as possible presense of the @code{frozen} field in the output
- of @code{-varobj-create}.
- @item pending-breakpoints
- Indicates presence of the @option{-f} option to the @code{-break-insert} command.
-+@item python
-+Indicates presence of Python scripting support, Python-based
-+pretty-printing commands, and possible presence of the
-+@samp{display_hint} field in the output of @code{-var-list-children}
- @item thread-info
- Indicates presence of the @code{-thread-info} command.
-@@ -25402,28 +26693,6 @@ data in a @file{gmon.out} file, be sure to move it to a safe location.
- Configuring with @samp{--enable-profiling} arranges for @value{GDBN} to be
- compiled with the @samp{-pg} compiler option.
--@kindex maint set linux-async
--@kindex maint show linux-async
--@cindex asynchronous support
--@item maint set linux-async
--@itemx maint show linux-async
--Control the GNU/Linux native asynchronous support 
--(@pxref{Background Execution}) of @value{GDBN}.
--
--GNU/Linux native asynchronous support will be disabled until you use
--the @samp{maint set linux-async} command to enable it.
--
--@kindex maint set remote-async
--@kindex maint show remote-async
--@cindex asynchronous support
--@item maint set remote-async
--@itemx maint show remote-async
--Control the remote asynchronous support 
--(@pxref{Background Execution}) of @value{GDBN}.
--
--Remote asynchronous support will be disabled until you use
--the @samp{maint set remote-async} command to enable it.
--
- @kindex maint show-debug-regs
- @cindex x86 hardware debug registers
- @item maint show-debug-regs
++@node Partial Symbol Tables
+ @section Partial Symbol Tables
+ @value{GDBN} has three types of symbol tables:
+@@ -2301,6 +2314,7 @@ and all the psymbols themselves are allocated in a pair of large arrays
+ on an obstack, so there is little to be gained by trying to free them
+ unless you want to do a lot more work.
++@node Types
+ @section Types
+ @unnumberedsubsec Fundamental Types (e.g., @code{FT_VOID}, @code{FT_BOOLEAN}).
+@@ -2323,6 +2337,7 @@ types map to one @code{TYPE_CODE_*} type, and are distinguished by
+ other members of the type struct, such as whether the type is signed
+ or unsigned, and how many bits it uses.
++@anchor{Builtin Types}
+ @unnumberedsubsec Builtin Types (e.g., @code{builtin_type_void}, @code{builtin_type_char}).
+ These are instances of type structs that roughly correspond to
+@@ -2337,6 +2352,7 @@ only one instance exists, while @file{c-lang.c} builds as many
+ @code{TYPE_CODE_INT} types as needed, with each one associated with
+ some particular objfile.
++@node Object File Formats
+ @section Object File Formats
+ @cindex object file formats
+@@ -2422,6 +2438,7 @@ SOM, which is a cross-language ABI).
+ The SOM reader is in @file{somread.c}.
++@node Debugging File Formats
+ @section Debugging File Formats
+ This section describes characteristics of debugging information that
+@@ -2493,6 +2510,7 @@ DWARF 3 is an improved version of DWARF 2.
+ @cindex SOM debugging info
+ Like COFF, the SOM definition includes debugging information.
++@node Adding a New Symbol Reader to GDB
+ @section Adding a New Symbol Reader to @value{GDBN}
+ @cindex adding debugging info reader
+@@ -2515,6 +2533,7 @@ will only ever be implemented by one object file format may be called
+ directly.  This interface should be described in a file
+ @file{bfd/lib@var{xyz}.h}, which is included by @value{GDBN}.
++@node Memory Management for Symbol Files
+ @section Memory Management for Symbol Files
+ Most memory associated with a loaded symbol file is stored on
+@@ -2526,10 +2545,45 @@ released when the objfile is unloaded or reloaded.  Therefore one
+ objfile must not reference symbol or type data from another objfile;
+ they could be unloaded at different times.
+-User convenience variables, et cetera, have associated types.  Normally
+-these types live in the associated objfile.  However, when the objfile
+-is unloaded, those types are deep copied to global memory, so that
+-the values of the user variables and history items are not lost.
++@node Memory Management for Types
++@section Memory Management for Types
++@cindex memory management for types
++
++@findex TYPE_OBJFILE
++@code{TYPE_OBJFILE} macro indicates the current memory owner of the type.
++Non-@code{NULL} value indicates it is owned by an objfile (specifically by its
++obstack) and in such case the type remains valid till the objfile is unloaded
++or reloaded.  For such types with an associated objfile no reference counting
++is being made.
++
++User convenience variables, et cetera, have associated types.  Normally these
++types live in the associated objfile.  However, when the objfile is unloaded,
++those types are deep copied to global memory, so that the values of the user
++variables and history items are not lost.  During the copy they will get their
++@code{TYPE_OBJFILE} set to @code{NULL} and become so-called @dfn{reclaimable}
++types.
++
++Types with null @code{TYPE_OBJFILE} can be either permanent types
++(@pxref{Builtin Types}) or reclaimable types which will be deallocated at the
++first idle @value{GDBN} moment if the last object referencing them is removed.
++Permanent types are allocated by the function @code{alloc_type} (and its
++derivations like @code{init_type}) specifying objfile as @code{NULL}.  The
++reclaimable types are created the same way but moreover they need to have
++@code{type_init_group} called to start their tracking as being possibly
++deallocatable.
++
++@findex free_all_types
++When @value{GDBN} gets idle it always calls the @code{free_all_types} function
++which deallocates any unused types.  All types currently not owned by an
++objfile must be marked as used on each @code{free_all_types} call as they would
++get deallocated as unused otherwise.
++
++@code{free_all_types} automatically checks for any cross-type references such
++as through @code{TYPE_TARGET_TYPE}, @code{TYPE_POINTER_TYPE} etc.@: and
++prevents early deallocation for any such existing references.  Reclaimable
++types may reference any other reclaimable types or even permanent types.  But
++permanent types must not reference reclaimable types (nor an objfile associated
++type).
+ @node Language Support
+diff --git a/gdb/doc/observer.texi b/gdb/doc/observer.texi
+index 4984f31..fcf1b5d 100644
+--- a/gdb/doc/observer.texi
++++ b/gdb/doc/observer.texi
+@@ -206,6 +206,11 @@ Either @value{GDBN} detached from the inferior, or the inferior
+ exited.  The argument @var{pid} identifies the inferior.
+ @end deftypefun
++@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.
++@end deftypefun
++
+  @deftypefun void test_notification (int @var{somearg})
+ This observer is used for internal testing.  Do not use.  
+ See testsuite/gdb.gdb/observer.exp.
 diff --git a/gdb/dwarf2-frame.c b/gdb/dwarf2-frame.c
-index ce11d89..eaa6a13 100644
+index 668c434..c29c3a5 100644
 --- a/gdb/dwarf2-frame.c
 +++ b/gdb/dwarf2-frame.c
 @@ -38,6 +38,7 @@
@@ -14200,9 +4594,9 @@ index ce11d89..eaa6a13 100644
  
  struct comp_unit;
  
-@@ -1499,6 +1500,14 @@ dwarf2_frame_find_fde (CORE_ADDR *pc)
-       struct dwarf2_fde *fde;
+@@ -1574,6 +1575,14 @@ dwarf2_frame_find_fde (CORE_ADDR *pc)
        CORE_ADDR offset;
+       CORE_ADDR seek_pc;
  
 +      if (objfile->quick_addrmap)
 +      {
@@ -14212,14 +4606,14 @@ index ce11d89..eaa6a13 100644
 +      /* FIXME: Read-in only .debug_frame/.eh_frame without .debug_info?  */
 +      require_partial_symbols (objfile);
 +
-       fde = objfile_data (objfile, dwarf2_frame_objfile_data);
-       if (fde == NULL)
+       fde_table = objfile_data (objfile, dwarf2_frame_objfile_data);
+       if (fde_table == NULL)
        continue;
 diff --git a/gdb/dwarf2expr.c b/gdb/dwarf2expr.c
-index 75a4ec7..aa8ab33 100644
+index 46bc9d7..e675575 100644
 --- a/gdb/dwarf2expr.c
 +++ b/gdb/dwarf2expr.c
-@@ -752,6 +752,13 @@ execute_stack_op (struct dwarf_expr_context *ctx,
+@@ -848,6 +848,13 @@ execute_stack_op (struct dwarf_expr_context *ctx,
          ctx->initialized = 0;
          goto no_push;
  
@@ -14234,10 +4628,10 @@ index 75a4ec7..aa8ab33 100644
          error (_("Unhandled dwarf expression opcode 0x%x"), op);
        }
 diff --git a/gdb/dwarf2expr.h b/gdb/dwarf2expr.h
-index 7047922..a287b6f 100644
+index a9a8a05..d449012 100644
 --- a/gdb/dwarf2expr.h
 +++ b/gdb/dwarf2expr.h
-@@ -67,10 +67,10 @@ struct dwarf_expr_context
+@@ -102,10 +102,10 @@ struct dwarf_expr_context
       The result must be live until the current expression evaluation
       is complete.  */
    unsigned char *(*get_subr) (void *baton, off_t offset, size_t *length);
@@ -14250,10 +4644,10 @@ index 7047922..a287b6f 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 cad3db8..2251e48 100644
+index 3a81202..85f4487 100644
 --- a/gdb/dwarf2loc.c
 +++ b/gdb/dwarf2loc.c
-@@ -107,6 +107,9 @@ struct dwarf_expr_baton
+@@ -116,6 +116,9 @@ struct dwarf_expr_baton
  {
    struct frame_info *frame;
    struct objfile *objfile;
@@ -14263,12 +4657,12 @@ index cad3db8..2251e48 100644
  };
  
  /* Helper functions for dwarf2_evaluate_loc_desc.  */
-@@ -163,22 +166,32 @@ dwarf_expr_frame_base (void *baton, gdb_byte **start, size_t * length)
+@@ -177,22 +180,33 @@ dwarf_expr_frame_base (void *baton, gdb_byte **start, size_t * length)
        *start = find_location_expression (symbaton, length,
                                         get_frame_address_in_block (frame));
      }
 -  else
-+  else if (SYMBOL_OPS (framefunc) == &dwarf2_locexpr_funcs)
++  else if (SYMBOL_COMPUTED_OPS (framefunc) == &dwarf2_locexpr_funcs)
      {
        struct dwarf2_locexpr_baton *symbaton;
 +
@@ -14283,8 +4677,8 @@ index cad3db8..2251e48 100644
 +      gdb_assert (symbaton != NULL);
 +      *start = symbaton->data;
 +      *length = symbaton->size;
-+    }
-+  else if (SYMBOL_OPS (framefunc) == &dwarf2_missing_funcs)
+     }
++  else if (SYMBOL_COMPUTED_OPS (framefunc) == &dwarf2_missing_funcs)
 +    {
 +      struct dwarf2_locexpr_baton *symbaton;
 +
@@ -14292,11 +4686,12 @@ index cad3db8..2251e48 100644
 +      gdb_assert (symbaton == NULL);
 +      *start = NULL;
 +      *length = 0;    /* unused */
-     }
++    }
 +  else
 +    internal_error (__FILE__, __LINE__,
-+                  _("Unsupported SYMBOL_OPS %p for \"%s\""),
-+                  SYMBOL_OPS (framefunc), SYMBOL_PRINT_NAME (framefunc));
++                  _("Unsupported SYMBOL_COMPUTED_OPS %p for \"%s\""),
++                  SYMBOL_COMPUTED_OPS (framefunc),
++                  SYMBOL_PRINT_NAME (framefunc));
  
    if (*start == NULL)
      error (_("Could not find the frame base for \"%s\"."),
@@ -14304,8 +4699,8 @@ index cad3db8..2251e48 100644
 +         SYMBOL_PRINT_NAME (framefunc));
  }
  
- /* Using the objfile specified in BATON, find the address for the
-@@ -191,6 +204,119 @@ dwarf_expr_tls_address (void *baton, CORE_ADDR offset)
+ /* Helper function for dwarf2_evaluate_loc_desc.  Computes the CFA for
+@@ -215,6 +229,129 @@ dwarf_expr_tls_address (void *baton, CORE_ADDR offset)
    return target_translate_tls_address (debaton->objfile, offset);
  }
  
@@ -14344,7 +4739,7 @@ index cad3db8..2251e48 100644
 +   used to derive other object addresses by DW_OP_push_object_address.
 +
 +   It would be useful to sanity check ADDRESS - such as for some objects with
-+   unset VALUE_ADDRESS - but some valid addresses may be zero (such as first
++   unset value_raw_address - but some valid addresses may be zero (such as first
 +   objects in relocatable .o files).  */
 +
 +void
@@ -14379,17 +4774,18 @@ index cad3db8..2251e48 100644
 +  baton.object_address = object_address;
 +
 +  ctx = new_dwarf_expr_context ();
++  make_cleanup_free_dwarf_expr_context (ctx);
++
 +  ctx->gdbarch = get_objfile_arch (baton.objfile);
 +  ctx->addr_size = dwarf2_per_cu_addr_size (per_cu);
 +  ctx->baton = &baton;
 +  ctx->read_reg = dwarf_expr_read_reg;
 +  ctx->read_mem = dwarf_expr_read_mem;
 +  ctx->get_frame_base = dwarf_expr_frame_base;
++  ctx->get_frame_cfa = dwarf_expr_frame_cfa;
 +  ctx->get_tls_address = dwarf_expr_tls_address;
 +  ctx->get_object_address = dwarf_expr_object_address;
 +
-+  make_cleanup ((make_cleanup_ftype *) free_dwarf_expr_context, ctx);
-+
 +  dwarf_expr_eval (ctx, data, size);
 +
 +  /* It was used only during dwarf_expr_eval.  */
@@ -14412,30 +4808,40 @@ index cad3db8..2251e48 100644
 +                           dlbaton->per_cu);
 +  if (ctx->num_pieces > 0)
 +    error (_("DW_OP_*piece is unsupported for DW_FORM_block"));
-+  else if (ctx->in_reg)
-+    error (_("Register result is unsupported for DW_FORM_block"));
 +
 +  retval = dwarf_expr_fetch (ctx, 0);
 +
++  if (ctx->location == DWARF_VALUE_REGISTER)
++    {
++      /* Inlined dwarf_expr_read_reg as we no longer have the baton. */
++
++      int gdb_regnum = gdbarch_dwarf2_reg_to_regnum (ctx->gdbarch, retval);
++      struct type *type = builtin_type (ctx->gdbarch)->builtin_data_ptr;
++      struct frame_info *frame = get_selected_frame (NULL);
++
++      retval = address_from_register (type, gdb_regnum, frame);
++    }
++
 +  do_cleanups (back_to);
 +
 +  return retval;
 +}
 +
- /* Evaluate a location description, starting at DATA and with length
-    SIZE, to find the current location of variable VAR in the context
-    of FRAME.  */
-@@ -200,8 +326,8 @@ dwarf2_evaluate_loc_desc (struct symbol *var, struct frame_info *frame,
+ struct piece_closure
+ {
+   /* The number of pieces used to describe this variable.  */
+@@ -382,9 +519,8 @@ dwarf2_evaluate_loc_desc (struct symbol *var, struct frame_info *frame,
                          struct dwarf2_per_cu_data *per_cu)
  {
    struct value *retval;
 -  struct dwarf_expr_baton baton;
    struct dwarf_expr_context *ctx;
-+  struct cleanup *back_to = make_cleanup (null_cleanup, 0);
+-  struct cleanup *old_chain;
++  struct cleanup *old_chain = make_cleanup (null_cleanup, 0);
  
    if (size == 0)
      {
-@@ -211,19 +337,8 @@ dwarf2_evaluate_loc_desc (struct symbol *var, struct frame_info *frame,
+@@ -394,22 +530,8 @@ dwarf2_evaluate_loc_desc (struct symbol *var, struct frame_info *frame,
        return retval;
      }
  
@@ -14444,41 +4850,34 @@ index cad3db8..2251e48 100644
 +  ctx = dwarf_expr_prep_ctx (frame, data, size, per_cu);
  
 -  ctx = new_dwarf_expr_context ();
+-  old_chain = make_cleanup_free_dwarf_expr_context (ctx);
+-
 -  ctx->gdbarch = get_objfile_arch (baton.objfile);
 -  ctx->addr_size = dwarf2_per_cu_addr_size (per_cu);
 -  ctx->baton = &baton;
 -  ctx->read_reg = dwarf_expr_read_reg;
 -  ctx->read_mem = dwarf_expr_read_mem;
 -  ctx->get_frame_base = dwarf_expr_frame_base;
+-  ctx->get_frame_cfa = dwarf_expr_frame_cfa;
 -  ctx->get_tls_address = dwarf_expr_tls_address;
 -
 -  dwarf_expr_eval (ctx, data, size);
    if (ctx->num_pieces > 0)
      {
-       int i;
-@@ -261,15 +376,19 @@ dwarf2_evaluate_loc_desc (struct symbol *var, struct frame_info *frame,
-     {
-       CORE_ADDR address = dwarf_expr_fetch (ctx, 0);
-+      /* object_address_set called here is required in ALLOCATE_VALUE's
-+       CHECK_TYPEDEF for the object's possible DW_OP_push_object_address.  */
-+      object_address_set (address);
-+
-       retval = allocate_value (SYMBOL_TYPE (var));
-       VALUE_LVAL (retval) = lval_memory;
-       set_value_lazy (retval, 1);
--      VALUE_ADDRESS (retval) = address;
-+      set_value_address (retval, address);
-     }
-   set_value_initialized (retval, ctx->initialized);
--  free_dwarf_expr_context (ctx);
-+  do_cleanups (back_to);
-   return retval;
- }
-@@ -587,7 +706,7 @@ static int
+       struct piece_closure *c;
+@@ -439,6 +561,11 @@ dwarf2_evaluate_loc_desc (struct symbol *var, struct frame_info *frame,
+           CORE_ADDR address = dwarf_expr_fetch (ctx, 0);
+           int in_stack_memory = dwarf_expr_fetch_in_stack_memory (ctx, 0);
++          /* object_address_set called here is required in ALLOCATE_VALUE's
++             CHECK_TYPEDEF for the object's possible
++             DW_OP_push_object_address.  */
++          object_address_set (address);
++
+           retval = allocate_value (SYMBOL_TYPE (var));
+           VALUE_LVAL (retval) = lval_memory;
+           set_value_lazy (retval, 1);
+@@ -815,7 +942,7 @@ static int
  loclist_describe_location (struct symbol *symbol, struct ui_file *stream)
  {
    /* FIXME: Could print the entire list of locations.  */
@@ -14487,20 +4886,20 @@ index cad3db8..2251e48 100644
    return 1;
  }
  
-@@ -603,16 +722,56 @@ loclist_tracepoint_var_ref (struct symbol * symbol, struct agent_expr * ax,
+@@ -831,16 +958,56 @@ loclist_tracepoint_var_ref (struct symbol *symbol, struct gdbarch *gdbarch,
  
    data = find_location_expression (dlbaton, &size, ax->scope);
    if (data == NULL)
 -    error (_("Variable \"%s\" is not available."), SYMBOL_NATURAL_NAME (symbol));
 +    error (_("Variable \"%s\" is not available."), SYMBOL_PRINT_NAME (symbol));
  
-   dwarf2_tracepoint_var_ref (symbol, ax, value, data, size);
+   dwarf2_tracepoint_var_ref (symbol, gdbarch, ax, value, data, size);
  }
  
 -/* The set of location functions used with the DWARF-2 expression
 -   evaluator and location lists.  */
 +/* The set of location functions used with the DWARF-2 location lists.  */
- const struct symbol_ops dwarf2_loclist_funcs = {
+ const struct symbol_computed_ops dwarf2_loclist_funcs = {
    loclist_read_variable,
    loclist_read_needs_frame,
    loclist_describe_location,
@@ -14530,8 +4929,8 @@ index cad3db8..2251e48 100644
 +}
 +
 +static void
-+missing_tracepoint_var_ref (struct symbol *symbol, struct agent_expr *ax,
-+                          struct axs_value *value)
++missing_tracepoint_var_ref (struct symbol *symbol, struct gdbarch *gdbarch,
++                          struct agent_expr *ax, struct axs_value *value)
 +{
 +  struct dwarf2_loclist_baton *dlbaton = SYMBOL_LOCATION_BATON (symbol);
 +
@@ -14541,21 +4940,21 @@ index cad3db8..2251e48 100644
 +
 +/* The set of location functions used with the DWARF-2 evaluator when we are
 +   unable to resolve the symbols.  */
-+const struct symbol_ops dwarf2_missing_funcs = {
++const struct symbol_computed_ops dwarf2_missing_funcs = {
 +  missing_read_variable,
 +  missing_read_needs_frame,
 +  missing_describe_location,
 +  missing_tracepoint_var_ref
 +};
 diff --git a/gdb/dwarf2loc.h b/gdb/dwarf2loc.h
-index 76577f1..bf46761 100644
+index 0bfcfca..01018d6 100644
 --- a/gdb/dwarf2loc.h
 +++ b/gdb/dwarf2loc.h
 @@ -71,5 +71,11 @@ struct dwarf2_loclist_baton
  
- extern const struct symbol_ops dwarf2_locexpr_funcs;
- extern const struct symbol_ops dwarf2_loclist_funcs;
-+extern const struct symbol_ops dwarf2_missing_funcs;
+ extern const struct symbol_computed_ops dwarf2_locexpr_funcs;
+ extern const struct symbol_computed_ops dwarf2_loclist_funcs;
++extern const struct symbol_computed_ops dwarf2_missing_funcs;
 +
 +extern void object_address_set (CORE_ADDR address);
 +
@@ -14564,30 +4963,23 @@ index 76577f1..bf46761 100644
  
  #endif /* dwarf2loc.h */
 diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c
-index 55868da..71fed38 100644
+index 4cce36b..c2f5f23 100644
 --- a/gdb/dwarf2read.c
 +++ b/gdb/dwarf2read.c
-@@ -1,8 +1,7 @@
- /* DWARF 2 debugging format support for GDB.
-    Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003,
--                 2004, 2005, 2006, 2007, 2008, 2009
--                 Free Software Foundation, Inc.
-+   2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
-    Adapted by Gary Funck (gary@intrepid.com), Intrepid Technology,
-    Inc.  with support from Florida State University (under contract
-@@ -47,6 +46,9 @@
- #include "command.h"
+@@ -48,6 +48,12 @@
  #include "gdbcmd.h"
+ #include "block.h"
  #include "addrmap.h"
 +#include "f-lang.h"
 +#include "c-lang.h"
 +#include "typeprint.h"
++#include "jv-lang.h"
++#include "vec.h"
++#include "block.h"
  
  #include <fcntl.h>
  #include "gdb_string.h"
-@@ -103,7 +105,7 @@ typedef struct pubnames_header
+@@ -93,7 +99,7 @@ typedef struct pubnames_header
  _PUBNAMES_HEADER;
  #define _ACTUAL_PUBNAMES_HEADER_SIZE 13
  
@@ -14596,45 +4988,39 @@ index 55868da..71fed38 100644
     Because of alignment constraints, this structure has padding and cannot
     be mapped directly onto the beginning of the .debug_info section.  */
  typedef struct aranges_header
-@@ -299,9 +301,6 @@ struct dwarf2_cu
-   /* Hash table holding all the loaded partial DIEs.  */
-   htab_t partial_dies;
+@@ -150,7 +156,10 @@ struct dwarf2_section_info
+   asection *asection;
+   gdb_byte *buffer;
+   bfd_size_type size;
+-  int was_mmapped;
++  /* A function to call to deallocate BUFFER.  If NULL, no
++     deallocation is needed.  A pointer to this structure is passed as
++     the only argument.  */
++  void (*destructor) (struct dwarf2_section_info *);
+ };
  
--  /* `.debug_ranges' offset for this `DW_TAG_compile_unit' DIE.  */
--  unsigned int ranges_offset;
--
-   /* Storage for things with the same lifetime as this read-in compilation
-      unit, including partial DIEs.  */
-   struct obstack comp_unit_obstack;
-@@ -349,9 +348,6 @@ struct dwarf2_cu
-      DIEs for namespaces, we don't need to try to infer them
-      from mangled names.  */
-   unsigned int has_namespace_info : 1;
--
--  /* Field `ranges_offset' is filled in; flag as the value may be zero.  */
--  unsigned int has_ranges_offset : 1;
+ struct dwarf2_per_objfile
+@@ -336,6 +345,19 @@ struct dwarf2_cu
+   /* Field `ranges_offset' is filled in; flag as the value may be zero.  */
+   unsigned int has_ranges_offset : 1;
++
++  /* Fields are valid according to the LANGUAGE field.  */
++  union
++    {
++      /* language_fortran */
++      struct
++        {
++        /* Module names imported to the block being currently read in.  */
++        struct fortran_using *use;
++      }
++      fortran;
++    }
++  language_specific;
  };
  
  /* Persistent data held for a compilation unit, even when not
-@@ -451,17 +447,12 @@ struct partial_die_info
-     /* DWARF-2 tag for this DIE.  */
-     ENUM_BITFIELD(dwarf_tag) tag : 16;
--    /* Language code associated with this DIE.  This is only used
--       for the compilation unit DIE.  */
--    unsigned int language : 8;
--
-     /* Assorted flags describing the data found in this DIE.  */
-     unsigned int has_children : 1;
-     unsigned int is_external : 1;
-     unsigned int is_declaration : 1;
-     unsigned int has_type : 1;
-     unsigned int has_specification : 1;
--    unsigned int has_stmt_list : 1;
-     unsigned int has_pc_info : 1;
-     /* Flag set if the SCOPE field of this structure has been
-@@ -472,10 +463,12 @@ struct partial_die_info
+@@ -495,8 +517,7 @@ struct partial_die_info
      unsigned int has_byte_size : 1;
  
      /* The name of this DIE.  Normally the value of DW_AT_name, but
@@ -14642,71 +5028,56 @@ index 55868da..71fed38 100644
 -       other fashion.  */
 +       sometimes a default name for unnamed DIEs.  */
      char *name;
--    char *dirname;
-+
-+    /* The linkage name of this DIE, from DW_AT_MIPS_linkage_name, or
-+       NULL if no linkage name was present.  */
-+    char *linkage_name;
+     char *dirname;
  
-     /* The scope to prepend to our children.  This is generally
-        allocated on the comp_unit_obstack, so will disappear
-@@ -498,9 +491,6 @@ struct partial_die_info
-        DW_AT_extension).  */
-     unsigned int spec_offset;
--    /* If HAS_STMT_LIST, the offset of the Line Number Information data.  */
--    unsigned int line_offset;
--
-     /* Pointers to this DIE's parent, first child, and next sibling,
-        if any.  */
-     struct partial_die_info *die_parent, *die_child, *die_sibling;
-@@ -523,6 +513,15 @@ struct attr_abbrev
-     ENUM_BITFIELD(dwarf_form) form : 16;
+@@ -689,6 +710,11 @@ struct field_info
+     int nfnfields;
    };
  
-+/* Additional GDB-specific attribute forms.  */
-+enum
-+  {
-+    /* A string which has been updated to GDB's internal
-+       representation (e.g. converted to canonical form) and does not
-+       need to be updated again.  */
-+    GDB_FORM_cached_string = 0xff
-+  };
++/* A vector used during linkage name generation.  */
++typedef struct die_info *die_info_p;
++DEF_VEC_P (die_info_p);
++static VEC(die_info_p) *die_list;
 +
- /* Attributes have a name and a value */
- struct attribute
-   {
-@@ -756,7 +755,7 @@ static void dwarf2_create_include_psymtab (char *, struct partial_symtab *,
-                                            struct objfile *);
- static void dwarf2_build_include_psymtabs (struct dwarf2_cu *,
--                                           struct partial_die_info *,
-+                                           struct die_info *,
-                                            struct partial_symtab *);
- static void dwarf2_build_psymtabs_hard (struct objfile *, int);
-@@ -768,6 +767,9 @@ static void scan_partial_symbols (struct partial_die_info *,
+ /* One item on the queue of compilation units to read in full symbols
+    for.  */
+ struct dwarf2_queue_item
+@@ -800,7 +826,10 @@ static void scan_partial_symbols (struct partial_die_info *,
  static void add_partial_symbol (struct partial_die_info *,
                                struct dwarf2_cu *);
  
+-static int pdi_needs_namespace (enum dwarf_tag tag);
 +static gdb_byte *read_comp_unit_head (struct comp_unit_head *, gdb_byte *,
 +                                    bfd *);
 +
- static int pdi_needs_namespace (enum dwarf_tag tag);
++static int die_needs_namespace (struct die_info *, struct dwarf2_cu *);
  
  static void add_partial_namespace (struct partial_die_info *pdi,
-@@ -794,6 +796,10 @@ static void dwarf2_psymtab_to_symtab (struct partial_symtab *);
+                                  CORE_ADDR *lowpc, CORE_ADDR *highpc,
+@@ -825,6 +854,10 @@ static void dwarf2_psymtab_to_symtab (struct partial_symtab *);
  
  static void psymtab_to_symtab_1 (struct partial_symtab *);
  
-+static gdb_byte *dwarf2_read_section_1 (struct objfile *objfile,
-+                                      struct obstack *obstack,
-+                                      asection *sectp);
++static void dwarf2_read_section_1 (struct objfile *objfile,
++                                 struct obstack *obstack,
++                                 struct dwarf2_section_info *info);
 +
- gdb_byte *dwarf2_read_section (struct objfile *, asection *);
  static void dwarf2_read_abbrevs (bfd *abfd, struct dwarf2_cu *cu);
-@@ -929,7 +935,8 @@ static int dwarf2_ranges_read (unsigned, CORE_ADDR *, CORE_ADDR *,
+ static void dwarf2_free_abbrev_table (void *);
+@@ -945,6 +978,11 @@ static struct type *tag_type_to_type (struct die_info *, struct dwarf2_cu *);
+ static struct type *read_type_die (struct die_info *, struct dwarf2_cu *);
++static char *physname_prefix (struct die_info *die, struct dwarf2_cu *);
++
++static void physname_prefix_1 (struct ui_file *, struct die_info *,
++                             struct dwarf2_cu *);
++
+ static char *determine_prefix (struct die_info *die, struct dwarf2_cu *);
+ static char *typename_concat (struct obstack *,
+@@ -964,7 +1002,8 @@ static int dwarf2_ranges_read (unsigned, CORE_ADDR *, CORE_ADDR *,
                               struct dwarf2_cu *, struct partial_symtab *);
  
  static int dwarf2_get_pc_bounds (struct die_info *,
@@ -14716,42 +5087,57 @@ index 55868da..71fed38 100644
  
  static void get_scope_pc_bounds (struct die_info *,
                                 CORE_ADDR *, CORE_ADDR *,
-@@ -962,6 +969,8 @@ static void read_namespace (struct die_info *die, struct dwarf2_cu *);
+@@ -988,17 +1027,25 @@ static void dwarf2_attach_fn_fields_to_type (struct field_info *,
  
- static void read_module (struct die_info *die, struct dwarf2_cu *cu);
+ static void process_structure_scope (struct die_info *, struct dwarf2_cu *);
+-static const char *determine_class_name (struct die_info *die,
+-                                       struct dwarf2_cu *cu);
+-
+ static void read_common_block (struct die_info *, struct dwarf2_cu *);
+ static void read_namespace (struct die_info *die, struct dwarf2_cu *);
  
 +static void read_import_statement (struct die_info *die, struct dwarf2_cu *);
++
+ static void read_module (struct die_info *die, struct dwarf2_cu *cu);
+ static void read_import_statement (struct die_info *die, struct dwarf2_cu *);
++static struct type *read_module_type (struct die_info *die,
++                                    struct dwarf2_cu *cu);
++
++static void read_fortran_imported_module (struct die_info *die,
++                                        struct dwarf2_cu *cu);
++
++static void read_fortran_imported_declaration (struct die_info *die,
++                                             struct dwarf2_cu *cu);
 +
  static const char *namespace_name (struct die_info *die,
                                   int *is_anonymous, struct dwarf2_cu *);
  
-@@ -993,6 +1002,9 @@ static void process_die (struct die_info *, struct dwarf2_cu *);
+@@ -1032,7 +1079,10 @@ static gdb_byte *read_full_die (const struct die_reader_specs *reader,
  
- static char *dwarf2_linkage_name (struct die_info *, struct dwarf2_cu *);
+ static void process_die (struct die_info *, struct dwarf2_cu *);
  
-+static char *dwarf2_canonicalize_name (char *, struct dwarf2_cu *,
-+                                     struct obstack *);
+-static char *dwarf2_linkage_name (struct die_info *, struct dwarf2_cu *);
++static char *dwarf2_physname (struct die_info *, struct dwarf2_cu *);
 +
- static char *dwarf2_name (struct die_info *die, struct dwarf2_cu *);
++static char *fortran_module_linkage_name (struct die_info *die,
++                                        struct dwarf2_cu *cu);
  
- static struct die_info *dwarf2_extension (struct die_info *die,
-@@ -1030,7 +1042,14 @@ static void store_in_ref_table (struct die_info *,
+ static char *dwarf2_canonicalize_name (char *, struct dwarf2_cu *,
+                                      struct obstack *);
+@@ -1076,7 +1126,7 @@ static int is_ref_attr (struct attribute *);
  
  static unsigned int dwarf2_get_ref_die_offset (struct attribute *);
  
 -static int dwarf2_get_attr_constant_value (struct attribute *, int);
-+enum dwarf2_get_attr_constant_value
-+  {
-+    dwarf2_attr_unknown,
-+    dwarf2_attr_const,
-+    dwarf2_attr_block
-+  };
-+static enum dwarf2_get_attr_constant_value dwarf2_get_attr_constant_value
-+  (struct attribute *attr, int *val_return);
++static CORE_ADDR dwarf2_get_attr_constant_value (struct attribute *, CORE_ADDR);
  
- static struct die_info *follow_die_ref (struct die_info *,
-                                       struct attribute *,
-@@ -1085,6 +1104,9 @@ static void age_cached_comp_units (void);
+ static struct die_info *follow_die_ref_or_sig (struct die_info *,
+                                              struct attribute *,
+@@ -1148,6 +1198,9 @@ static void age_cached_comp_units (void);
  
  static void free_one_cached_comp_unit (void *);
  
@@ -14761,10 +5147,12 @@ index 55868da..71fed38 100644
  static struct type *set_die_type (struct die_info *, struct type *,
                                  struct dwarf2_cu *);
  
-@@ -1104,19 +1126,28 @@ static void dwarf2_clear_marks (struct dwarf2_per_cu_data *);
+@@ -1167,22 +1220,31 @@ static void dwarf2_clear_marks (struct dwarf2_per_cu_data *);
  
  static struct type *get_die_type (struct die_info *die, struct dwarf2_cu *cu);
  
++static void destroy_section (struct dwarf2_section_info *info);
++
 +static struct dwarf2_locexpr_baton *dwarf2_attr_to_locexpr_baton
 +  (struct attribute *attr, struct dwarf2_cu *cu);
 +
@@ -14775,9 +5163,8 @@ index 55868da..71fed38 100644
  dwarf2_has_info (struct objfile *objfile)
  {
 -  struct dwarf2_per_objfile *data;
-+  int update_sizes = 0;
-   /* Initialize per-objfile state.  */
+-
+-  /* Initialize per-objfile state.  */
 -  data = obstack_alloc (&objfile->objfile_obstack, sizeof (*data));
 -  memset (data, 0, sizeof (*data));
 -  set_objfile_data (objfile, dwarf2_objfile_data_key, data);
@@ -14785,127 +5172,84 @@ index 55868da..71fed38 100644
 +  dwarf2_per_objfile = objfile_data (objfile, dwarf2_objfile_data_key);
 +  if (!dwarf2_per_objfile)
 +    {
++      /* Initialize per-objfile state.  */
 +      struct dwarf2_per_objfile *data
 +      = obstack_alloc (&objfile->objfile_obstack, sizeof (*data));
 +      memset (data, 0, sizeof (*data));
 +      set_objfile_data (objfile, dwarf2_objfile_data_key, data);
 +      dwarf2_per_objfile = data;
-+      update_sizes = 1;
-+    }
  
-   dwarf_info_section = 0;
-   dwarf_abbrev_section = 0;
-@@ -1127,8 +1158,9 @@ dwarf2_has_info (struct objfile *objfile)
-   dwarf_eh_frame_section = 0;
-   dwarf_ranges_section = 0;
-   dwarf_loc_section = 0;
-+  dwarf_aranges_section = 0;
-   
 -  bfd_map_over_sections (objfile->obfd, dwarf2_locate_sections, NULL);
-+  bfd_map_over_sections (objfile->obfd, dwarf2_locate_sections, &update_sizes);
-   return (dwarf_info_section != NULL && dwarf_abbrev_section != NULL);
+-  return (data->info.asection != NULL && data->abbrev.asection != NULL);
++      bfd_map_over_sections (objfile->obfd, dwarf2_locate_sections, NULL);
++    }
++  return (dwarf2_per_objfile->info.asection != NULL
++        && dwarf2_per_objfile->abbrev.asection != NULL);
+ }
+ /* When loading sections, we can either look for ".<name>", or for
+@@ -1275,10 +1337,13 @@ dwarf2_locate_sections (bfd *abfd, asection *sectp, void *ignore_ptr)
  }
  
-@@ -1149,51 +1181,61 @@ section_is_p (asection *sectp, const char *name)
-    in.  */
+ /* Decompress a section that was compressed using zlib.  Store the
+-   decompressed buffer, and its size, in OUTBUF and OUTSIZE.  */
++   decompressed buffer, and its size, in OUTBUF and OUTSIZE.  The
++   result is allocated on OBSTACK; if OBSTACK is NULL, xmalloc is
++   used.  */
  
  static void
--dwarf2_locate_sections (bfd *abfd, asection *sectp, void *ignore_ptr)
-+dwarf2_locate_sections (bfd *abfd, asection *sectp, void *user_data)
+-zlib_decompress_section (struct objfile *objfile, asection *sectp,
++zlib_decompress_section (struct objfile *objfile, struct obstack *obstack,
++                       asection *sectp,
+                          gdb_byte **outbuf, bfd_size_type *outsize)
  {
-+  int update_sizes = * (int *) user_data;
-   if (section_is_p (sectp, INFO_SECTION))
-     {
--      dwarf2_per_objfile->info_size = bfd_get_section_size (sectp);
-+      if (update_sizes)
-+      dwarf2_per_objfile->info_size = bfd_get_section_size (sectp);
-       dwarf_info_section = sectp;
-     }
-   else if (section_is_p (sectp, ABBREV_SECTION))
-     {
--      dwarf2_per_objfile->abbrev_size = bfd_get_section_size (sectp);
-+      if (update_sizes)
-+      dwarf2_per_objfile->abbrev_size = bfd_get_section_size (sectp);
-       dwarf_abbrev_section = sectp;
-     }
-   else if (section_is_p (sectp, LINE_SECTION))
-     {
--      dwarf2_per_objfile->line_size = bfd_get_section_size (sectp);
-+      if (update_sizes)
-+      dwarf2_per_objfile->line_size = bfd_get_section_size (sectp);
-       dwarf_line_section = sectp;
-     }
-   else if (section_is_p (sectp, PUBNAMES_SECTION))
-     {
--      dwarf2_per_objfile->pubnames_size = bfd_get_section_size (sectp);
-+      if (update_sizes)
-+      dwarf2_per_objfile->pubnames_size = bfd_get_section_size (sectp);
-       dwarf_pubnames_section = sectp;
-     }
-   else if (section_is_p (sectp, ARANGES_SECTION))
-     {
--      dwarf2_per_objfile->aranges_size = bfd_get_section_size (sectp);
-+      if (update_sizes)
-+      dwarf2_per_objfile->aranges_size = bfd_get_section_size (sectp);
-       dwarf_aranges_section = sectp;
-     }
-   else if (section_is_p (sectp, LOC_SECTION))
-     {
--      dwarf2_per_objfile->loc_size = bfd_get_section_size (sectp);
-+      if (update_sizes)
-+      dwarf2_per_objfile->loc_size = bfd_get_section_size (sectp);
-       dwarf_loc_section = sectp;
-     }
-   else if (section_is_p (sectp, MACINFO_SECTION))
-     {
--      dwarf2_per_objfile->macinfo_size = bfd_get_section_size (sectp);
-+      if (update_sizes)
-+      dwarf2_per_objfile->macinfo_size = bfd_get_section_size (sectp);
-       dwarf_macinfo_section = sectp;
-     }
-   else if (section_is_p (sectp, STR_SECTION))
-     {
--      dwarf2_per_objfile->str_size = bfd_get_section_size (sectp);
-+      if (update_sizes)
-+      dwarf2_per_objfile->str_size = bfd_get_section_size (sectp);
-       dwarf_str_section = sectp;
-     }
-   else if (section_is_p (sectp, FRAME_SECTION))
-     {
--      dwarf2_per_objfile->frame_size = bfd_get_section_size (sectp);
-+      if (update_sizes)
-+      dwarf2_per_objfile->frame_size = bfd_get_section_size (sectp);
-       dwarf_frame_section = sectp;
-     }
-   else if (section_is_p (sectp, EH_FRAME_SECTION))
-@@ -1201,13 +1243,15 @@ dwarf2_locate_sections (bfd *abfd, asection *sectp, void *ignore_ptr)
-       flagword aflag = bfd_get_section_flags (ignore_abfd, sectp);
-       if (aflag & SEC_HAS_CONTENTS)
-         {
--          dwarf2_per_objfile->eh_frame_size = bfd_get_section_size (sectp);
-+        if (update_sizes)
-+          dwarf2_per_objfile->eh_frame_size = bfd_get_section_size (sectp);
-           dwarf_eh_frame_section = sectp;
-         }
-     }
-   else if (section_is_p (sectp, RANGES_SECTION))
+   bfd *abfd = objfile->obfd;
+@@ -1295,6 +1360,7 @@ zlib_decompress_section (struct objfile *objfile, asection *sectp,
+   z_stream strm;
+   int rc;
+   int header_size = 12;
++  struct cleanup *old = NULL;
+   if (bfd_seek (abfd, sectp->filepos, SEEK_SET) != 0
+       || bfd_bread (compressed_buffer, compressed_size, abfd) != compressed_size)
+@@ -1324,8 +1390,13 @@ zlib_decompress_section (struct objfile *objfile, asection *sectp,
+   strm.avail_in = compressed_size - header_size;
+   strm.next_in = (Bytef*) compressed_buffer + header_size;
+   strm.avail_out = uncompressed_size;
+-  uncompressed_buffer = obstack_alloc (&objfile->objfile_obstack,
+-                                       uncompressed_size);
++  if (obstack)
++    uncompressed_buffer = obstack_alloc (obstack, uncompressed_size);
++  else
++    {
++      uncompressed_buffer = xmalloc (uncompressed_size);
++      old = make_cleanup (xfree, uncompressed_buffer);
++    }
+   rc = inflateInit (&strm);
+   while (strm.avail_in > 0)
      {
--      dwarf2_per_objfile->ranges_size = bfd_get_section_size (sectp);
-+      if (update_sizes)
-+      dwarf2_per_objfile->ranges_size = bfd_get_section_size (sectp);
-       dwarf_ranges_section = sectp;
-     }
-   
-@@ -1250,6 +1294,86 @@ dwarf2_resize_section (asection *sectp, bfd_size_type new_size)
-                     sectp->name);
+@@ -1346,26 +1417,176 @@ zlib_decompress_section (struct objfile *objfile, asection *sectp,
+     error (_("Dwarf Error: concluding DWARF uncompression in '%s': %d"),
+            bfd_get_filename (abfd), rc);
++  if (old)
++    discard_cleanups (old);
+   do_cleanups (cleanup);
+   *outbuf = uncompressed_buffer;
+   *outsize = uncompressed_size;
+ #endif
  }
  
-+/* A cleanup that frees an obstack.  */
-+static void
-+finalize_obstack (void *o)
+-/* Read the contents of the section SECTP from object file specified by
+-   OBJFILE, store info about the section into INFO.
+-   If the section is compressed, uncompress it before returning.  */
++/* A cleanup that calls destroy_section.  */
+ static void
+-dwarf2_read_section (struct objfile *objfile, struct dwarf2_section_info *info)
++destroy_section_cleanup (void *arg)
 +{
-+  struct obstack *ob = o;
-+  obstack_free (o, 0);
++  destroy_section (arg);
 +}
 +
 +/* Read the .debug_aranges section and construct an address map.  */
@@ -14920,28 +5264,48 @@ index 55868da..71fed38 100644
 +  struct obstack temp_obstack;
 +  struct addrmap *mutable_map;
 +
-+  if (!dwarf_aranges_section)
++  if (!dwarf2_per_objfile->aranges.asection)
 +    return;
 +
 +  baseaddr = ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile));
 +
-+  aranges_buffer = dwarf2_read_section_1 (objfile, NULL, dwarf_aranges_section);
++  dwarf2_read_section_1 (objfile, NULL, &dwarf2_per_objfile->aranges);
++  aranges_buffer = dwarf2_per_objfile->aranges.buffer;
 +  aranges_ptr = aranges_buffer;
-+  old = make_cleanup (xfree, aranges_buffer);
++  old = make_cleanup (destroy_section_cleanup, &dwarf2_per_objfile->aranges);
 +
 +  obstack_init (&temp_obstack);
-+  make_cleanup (finalize_obstack, &temp_obstack);
++  make_cleanup_obstack_free (&temp_obstack);
 +  mutable_map = addrmap_create_mutable (&temp_obstack);
 +
-+  while ((aranges_ptr - aranges_buffer) < dwarf2_per_objfile->aranges_size)
++  while ((aranges_ptr - aranges_buffer) < dwarf2_per_objfile->aranges.size)
 +    {
 +      struct comp_unit_head cu_header;
 +      unsigned int bytes_read, segment_size, delta;
 +      LONGEST info_offset;
 +      struct dwarf2_cu cu;
++      char *end_ptr;
 +
 +      cu_header.initial_length_size = 0;
++      end_ptr = aranges_ptr;
 +      aranges_ptr = read_comp_unit_head (&cu_header, aranges_ptr, abfd);
++      end_ptr += cu_header.initial_length_size + cu_header.length;
++
++      /* Sanity check.  */
++      if (end_ptr - aranges_ptr >= dwarf2_per_objfile->aranges.size)
++      {
++        do_cleanups (old);
++        complaint (&symfile_complaints,
++                   _("aranges entry runs off end of `.debug_aranges' section, ignored"));
++        return;
++      }
++      if (cu_header.addr_size == 0)
++      {
++        do_cleanups (old);
++        complaint (&symfile_complaints,
++                   _("aranges entry has zero addr_size, ignored"));
++        return;
++      }
 +
 +      segment_size = read_1_byte (abfd, aranges_ptr);
 +      aranges_ptr += 1;
@@ -14968,56 +5332,151 @@ index 55868da..71fed38 100644
 +        if (address == 0 && length == 0)
 +          break;
 +
++        if (length == 0)
++          {
++            do_cleanups (old);
++            complaint (&symfile_complaints,
++                       _("aranges entry has zero length, ignored"));
++            return;
++          }
++
 +        address += baseaddr;
 +
-+        addrmap_set_empty (mutable_map, address, address + length, objfile);
++        addrmap_set_empty (mutable_map, address, address + length - 1,
++                           objfile);
 +      }
-+    }
 +
-+  objfile->quick_addrmap = addrmap_create_fixed (mutable_map,
-+                                               &objfile->objfile_obstack);
++      /* Some older versions of GCC incorrectly started the arange
++       with a (0,0) pair.  If we encounter any oddity while reading
++       the section, just abandon the attempt; falling back to the
++       slower code is always safe.  */
++      if (aranges_ptr != end_ptr)
++      {
++        do_cleanups (old);
++        complaint (&symfile_complaints,
++                   _("aranges entry ends early, ignored"));
++        return;
++      }
++    }
++
++  objfile->quick_addrmap = addrmap_create_fixed (mutable_map,
++                                               &objfile->objfile_obstack);
 +  do_cleanups (old);
 +}
 +
++/* Free a section buffer allocated with xmalloc.  */
++
++static void
++xfree_section_buffer (struct dwarf2_section_info *info)
++{
++  xfree (info->buffer);
++}
++
++/* If section described by INFO was mmapped, munmap it now.  */
++
++static void
++munmap_section_buffer (struct dwarf2_section_info *info)
++{
++#ifdef HAVE_MMAP
++  intptr_t begin = (intptr_t) info->buffer;
++  intptr_t map_begin = begin & ~(pagesize - 1);
++  size_t map_length = info->size + begin - map_begin;
++  gdb_assert (munmap ((void *) map_begin, map_length) == 0);
++#else
++  /* Without HAVE_MMAP, we should never be here to begin with.  */
++  gdb_assert (0);
++#endif
++}
++
++/* Read the contents of the section at OFFSET and of size SIZE from
++   the object file specified by OBJFILE into OBSTACK and store it into
++   INFO.  If OBSTACK is NULL, xmalloc is used instead.  If the section
++   is compressed, uncompress it before returning.  */
 +
- /* Build a partial symbol table.  */
++static void
++dwarf2_read_section_1 (struct objfile *objfile,
++                     struct obstack *obstack,
++                     struct dwarf2_section_info *info)
+ {
+   bfd *abfd = objfile->obfd;
+   asection *sectp = info->asection;
+   gdb_byte *buf, *retbuf;
+   unsigned char header[4];
++  struct cleanup *old = NULL;
  
- void
-@@ -1453,22 +1577,24 @@ dwarf2_create_include_psymtab (char *name, struct partial_symtab *pst,
+   info->buffer = NULL;
+-  info->was_mmapped = 0;
++  info->destructor = 0;
  
- /* Read the Line Number Program data and extract the list of files
-    included by the source file represented by PST.  Build an include
--   partial symtab for each of these included files.
--   
--   This procedure assumes that there *is* a Line Number Program in
--   the given CU.  Callers should check that PDI->HAS_STMT_LIST is set
--   before calling this procedure.  */
-+   partial symtab for each of these included files.  */
+   if (info->asection == NULL || info->size == 0)
+     return;
+@@ -1378,7 +1599,7 @@ dwarf2_read_section (struct objfile *objfile, struct dwarf2_section_info *info)
+       /* Upon decompression, update the buffer and its size.  */
+       if (strncmp (header, "ZLIB", sizeof (header)) == 0)
+         {
+-          zlib_decompress_section (objfile, sectp, &info->buffer,
++          zlib_decompress_section (objfile, obstack, sectp, &info->buffer,
+                                  &info->size);
+           return;
+         }
+@@ -1401,7 +1622,7 @@ dwarf2_read_section (struct objfile *objfile, struct dwarf2_section_info *info)
  
- static void
- dwarf2_build_include_psymtabs (struct dwarf2_cu *cu,
--                               struct partial_die_info *pdi,
-+                               struct die_info *die,
-                                struct partial_symtab *pst)
- {
-   struct objfile *objfile = cu->objfile;
-   bfd *abfd = objfile->obfd;
--  struct line_header *lh;
-+  struct line_header *lh = NULL;
-+  struct attribute *attr;
+       if (retbuf != MAP_FAILED)
+       {
+-        info->was_mmapped = 1;
++        info->destructor = munmap_section_buffer;
+         info->buffer = retbuf + (sectp->filepos & (pagesize - 1)) ;
+         return;
+       }
+@@ -1409,8 +1630,15 @@ dwarf2_read_section (struct objfile *objfile, struct dwarf2_section_info *info)
+ #endif
  
--  lh = dwarf_decode_line_header (pdi->line_offset, abfd, cu);
-+  attr = dwarf2_attr (die, DW_AT_stmt_list, cu);
-+  if (attr)
+   /* If we get here, we are a normal, not-compressed section.  */
+-  info->buffer = buf
+-    = obstack_alloc (&objfile->objfile_obstack, info->size);
++  if (obstack)
++    buf = obstack_alloc (obstack, info->size);
++  else
 +    {
-+      unsigned int line_offset = DW_UNSND (attr);
-+      lh = dwarf_decode_line_header (line_offset, abfd, cu);
++      buf = xmalloc (info->size);
++      old = make_cleanup (xfree, buf);
++      info->destructor = xfree_section_buffer;
 +    }
-   if (lh == NULL)
-     return;  /* No linetable, so no includes.  */
++  info->buffer = buf;
+   /* When debugging .o files, we may need to apply relocations; see
+      http://sourceware.org/ml/gdb-patches/2002-04/msg00136.html .
+@@ -1419,6 +1647,8 @@ dwarf2_read_section (struct objfile *objfile, struct dwarf2_section_info *info)
+   retbuf = symfile_relocate_debug_section (abfd, sectp, buf);
+   if (retbuf != NULL)
+     {
++      if (old)
++      discard_cleanups (old);
+       info->buffer = retbuf;
+       return;
+     }
+@@ -1427,6 +1657,19 @@ dwarf2_read_section (struct objfile *objfile, struct dwarf2_section_info *info)
+       || bfd_bread (buf, info->size, abfd) != info->size)
+     error (_("Dwarf Error: Can't read DWARF data from '%s'"),
+          bfd_get_filename (abfd));
++
++  if (old)
++    discard_cleanups (old);
++}
++
++/* Read the contents of the section SECTP from object file specified by
++   OBJFILE, store info about the section into INFO.
++   If the section is compressed, uncompress it before returning.  */
++
++static void
++dwarf2_read_section (struct objfile *objfile, struct dwarf2_section_info *info)
++{
++  dwarf2_read_section_1 (objfile, &objfile->objfile_obstack, info);
+ }
  
-@@ -1477,6 +1603,36 @@ dwarf2_build_include_psymtabs (struct dwarf2_cu *cu,
-   free_line_header (lh);
+ /* Fill in SECTP, BUFP and SIZEP with section info, given OBJFILE and
+@@ -1810,6 +2053,37 @@ lookup_signatured_type (struct objfile *objfile, ULONGEST sig)
+   return entry;
  }
  
 +/* Find the base address of the compilation unit for range lists and
@@ -15050,205 +5509,11 @@ index 55868da..71fed38 100644
 +      }
 +    }
 +}
- /* Build the partial symbol table by doing a quick pass through the
-    .debug_info and .debug_abbrev sections.  */
-@@ -1489,7 +1645,7 @@ dwarf2_build_psymtabs_hard (struct objfile *objfile, int mainline)
-   bfd *abfd = objfile->obfd;
-   gdb_byte *info_ptr;
-   gdb_byte *beg_of_comp_unit;
--  struct partial_die_info comp_unit_die;
-+  struct die_info *comp_unit_die;
-   struct partial_symtab *pst;
-   struct cleanup *back_to;
-   CORE_ADDR baseaddr;
-@@ -1523,9 +1679,12 @@ dwarf2_build_psymtabs_hard (struct objfile *objfile, int mainline)
-     {
-       struct cleanup *back_to_inner;
-       struct dwarf2_cu cu;
--      struct abbrev_info *abbrev;
-       unsigned int bytes_read;
-       struct dwarf2_per_cu_data *this_cu;
-+      int has_children, has_pc_info;
-+      struct attribute *attr;
-+      const char *name;
-+      CORE_ADDR best_lowpc, best_highpc;
-       beg_of_comp_unit = info_ptr;
-@@ -1551,11 +1710,10 @@ dwarf2_build_psymtabs_hard (struct objfile *objfile, int mainline)
-       this_cu = dwarf2_find_comp_unit (cu.header.offset, objfile);
-       /* Read the compilation unit die */
--      abbrev = peek_die_abbrev (info_ptr, &bytes_read, &cu);
--      info_ptr = read_partial_die (&comp_unit_die, abbrev, bytes_read,
--                                 abfd, info_ptr, &cu);
-+      info_ptr = read_full_die (&comp_unit_die, abfd, info_ptr, &cu,
-+                              &has_children);
--      if (comp_unit_die.tag == DW_TAG_partial_unit)
-+      if (comp_unit_die->tag == DW_TAG_partial_unit)
-       {
-         info_ptr = (beg_of_comp_unit + cu.header.length
-                     + cu.header.initial_length_size);
-@@ -1564,20 +1722,27 @@ dwarf2_build_psymtabs_hard (struct objfile *objfile, int mainline)
-       }
-       /* Set the language we're debugging */
--      set_cu_language (comp_unit_die.language, &cu);
-+      attr = dwarf2_attr (comp_unit_die, DW_AT_language, &cu);
-+      if (attr != NULL)
-+      set_cu_language (DW_UNSND (attr), &cu);
-+      else
-+      set_cu_language (language_minimal, &cu);
-       /* Allocate a new partial symbol table structure */
--      pst = start_psymtab_common (objfile, objfile->section_offsets,
--                                comp_unit_die.name ? comp_unit_die.name : "",
-+      attr = dwarf2_attr (comp_unit_die, DW_AT_name, &cu);
-+      if (attr != NULL)
-+      name = DW_STRING (attr);
-+      else
-+      name = "";
-+      pst = start_psymtab_common (objfile, objfile->section_offsets, name,
-                                 /* TEXTLOW and TEXTHIGH are set below.  */
-                                 0,
-                                 objfile->global_psymbols.next,
-                                 objfile->static_psymbols.next);
--      if (comp_unit_die.dirname)
--      pst->dirname = obsavestring (comp_unit_die.dirname,
--                                   strlen (comp_unit_die.dirname),
--                                   &objfile->objfile_obstack);
-+      attr = dwarf2_attr (comp_unit_die, DW_AT_comp_dir, &cu);
-+      if (attr != NULL)
-+      pst->dirname = xstrdup (DW_STRING (attr));
-       pst->read_symtab_private = (char *) this_cu;
-@@ -1607,24 +1772,17 @@ dwarf2_build_psymtabs_hard (struct objfile *objfile, int mainline)
-       /* Possibly set the default values of LOWPC and HIGHPC from
-          `DW_AT_ranges'.  */
--      if (cu.has_ranges_offset)
--      {
--        if (dwarf2_ranges_read (cu.ranges_offset, &comp_unit_die.lowpc,
--                                &comp_unit_die.highpc, &cu, pst))
--          comp_unit_die.has_pc_info = 1;
--      }
--      else if (comp_unit_die.has_pc_info
--             && comp_unit_die.lowpc < comp_unit_die.highpc)
--      /* Store the contiguous range if it is not empty; it can be empty for
--         CUs with no code.  */
--      addrmap_set_empty (objfile->psymtabs_addrmap,
--                         comp_unit_die.lowpc + baseaddr,
--                         comp_unit_die.highpc + baseaddr - 1, pst);
-+      has_pc_info = 0;
-+
-+      if (dwarf2_get_pc_bounds (comp_unit_die, &best_lowpc, &best_highpc, &cu,
-+                              pst))
-+      has_pc_info = 1;
-+      dwarf2_find_base_address (comp_unit_die, &cu);
-       /* Check if comp unit has_children.
-          If so, read the rest of the partial symbols from this comp unit.
-          If not, there's no more debug_info for this comp unit. */
--      if (comp_unit_die.has_children)
-+      if (has_children)
-       {
-         struct partial_die_info *first_die;
-         CORE_ADDR lowpc, highpc;
-@@ -1634,8 +1792,7 @@ dwarf2_build_psymtabs_hard (struct objfile *objfile, int mainline)
-         first_die = load_partial_dies (abfd, info_ptr, 1, &cu);
--        scan_partial_symbols (first_die, &lowpc, &highpc,
--                              ! comp_unit_die.has_pc_info, &cu);
-+        scan_partial_symbols (first_die, &lowpc, &highpc, ! has_pc_info, &cu);
-         /* If we didn't find a lowpc, set it to highpc to avoid
-            complaints from `maint check'.  */
-@@ -1644,14 +1801,14 @@ dwarf2_build_psymtabs_hard (struct objfile *objfile, int mainline)
-         /* If the compilation unit didn't have an explicit address range,
-            then use the information extracted from its child dies.  */
--        if (! comp_unit_die.has_pc_info)
-+        if (! has_pc_info)
-           {
--            comp_unit_die.lowpc = lowpc;
--            comp_unit_die.highpc = highpc;
-+            best_lowpc = lowpc;
-+            best_highpc = highpc;
-           }
-       }
--      pst->textlow = comp_unit_die.lowpc + baseaddr;
--      pst->texthigh = comp_unit_die.highpc + baseaddr;
-+      pst->textlow = best_lowpc + baseaddr;
-+      pst->texthigh = best_highpc + baseaddr;
-       pst->n_global_syms = objfile->global_psymbols.next -
-       (objfile->global_psymbols.list + pst->globals_offset);
-@@ -1667,12 +1824,9 @@ dwarf2_build_psymtabs_hard (struct objfile *objfile, int mainline)
-       info_ptr = beg_of_comp_unit + cu.header.length
-                                   + cu.header.initial_length_size;
--      if (comp_unit_die.has_stmt_list)
--        {
--          /* Get the list of files included in the current compilation unit,
--             and build a psymtab for each of them.  */
--          dwarf2_build_include_psymtabs (&cu, &comp_unit_die, pst);
--        }
-+      /* Get the list of files included in the current compilation unit,
-+       and build a psymtab for each of them.  */
-+      dwarf2_build_include_psymtabs (&cu, comp_unit_die, pst);
-       do_cleanups (back_to_inner);
-     }
-@@ -1690,11 +1844,12 @@ load_comp_unit (struct dwarf2_per_cu_data *this_cu, struct objfile *objfile)
- {
-   bfd *abfd = objfile->obfd;
-   gdb_byte *info_ptr, *beg_of_comp_unit;
--  struct partial_die_info comp_unit_die;
-+  struct die_info *comp_unit_die;
-   struct dwarf2_cu *cu;
--  struct abbrev_info *abbrev;
-   unsigned int bytes_read;
-   struct cleanup *back_to;
-+  struct attribute *attr;
-+  int has_children;
-   info_ptr = dwarf2_per_objfile->info_buffer + this_cu->offset;
-   beg_of_comp_unit = info_ptr;
-@@ -1716,12 +1871,15 @@ load_comp_unit (struct dwarf2_per_cu_data *this_cu, struct objfile *objfile)
-   back_to = make_cleanup (dwarf2_free_abbrev_table, cu);
-   /* Read the compilation unit die.  */
--  abbrev = peek_die_abbrev (info_ptr, &bytes_read, cu);
--  info_ptr = read_partial_die (&comp_unit_die, abbrev, bytes_read,
--                             abfd, info_ptr, cu);
-+  info_ptr = read_full_die (&comp_unit_die, abfd, info_ptr, cu,
-+                          &has_children);
-   /* Set the language we're debugging.  */
--  set_cu_language (comp_unit_die.language, cu);
-+  attr = dwarf2_attr (comp_unit_die, DW_AT_language, cu);
-+  if (attr)
-+    set_cu_language (DW_UNSND (attr), cu);
-+  else
-+    set_cu_language (language_minimal, cu);
-   /* Link this compilation unit into the compilation unit tree.  */
-   this_cu->cu = cu;
-@@ -1731,7 +1889,7 @@ load_comp_unit (struct dwarf2_per_cu_data *this_cu, struct objfile *objfile)
-   /* Check if comp unit has_children.
-      If so, read the rest of the partial symbols from this comp unit.
-      If not, there's no more debug_info for this comp unit. */
--  if (comp_unit_die.has_children)
-+  if (has_children)
-     load_partial_dies (abfd, info_ptr, 0, cu);
-   do_cleanups (back_to);
-@@ -1948,7 +2106,7 @@ partial_die_parent_scope (struct partial_die_info *pdi,
++
+ /* Subroutine of process_type_comp_unit and dwarf2_build_psymtabs_hard
+    to combine the common parts.
+    Process a compilation unit for a psymtab.
+@@ -2359,7 +2633,7 @@ partial_die_parent_scope (struct partial_die_info *pdi,
         ignoring them.  */
        complaint (&symfile_complaints,
                 _("unhandled containing DIE tag %d for DIE at %d"),
@@ -15257,7 +5522,7 @@ index 55868da..71fed38 100644
        parent->scope = grandparent_scope;
      }
  
-@@ -1963,12 +2121,37 @@ partial_die_full_name (struct partial_die_info *pdi,
+@@ -2374,12 +2648,22 @@ partial_die_full_name (struct partial_die_info *pdi,
                       struct dwarf2_cu *cu)
  {
    char *parent_scope;
@@ -15280,204 +5545,239 @@ index 55868da..71fed38 100644
 +  if (parent_scope != NULL)
      return typename_concat (NULL, parent_scope, pdi->name, cu);
 +
-+  if (!cu->has_namespace_info && pdi->linkage_name
-+      && !real_pdi->die_parent)
-+    {
-+      char *actual_scope
-+      = language_class_name_from_physname (cu->language_defn,
-+                                           pdi->linkage_name);
-+      if (actual_scope != NULL)
-+      {
-+        char *actual_name = typename_concat (NULL, actual_scope,
-+                                             pdi->name, cu);
-+        xfree (actual_scope);
-+        return actual_name;
-+      }
-+    }
-+
 +  return NULL;
  }
  
  static void
-@@ -1984,7 +2167,9 @@ add_partial_symbol (struct partial_die_info *pdi, struct dwarf2_cu *cu)
+@@ -2395,12 +2679,9 @@ add_partial_symbol (struct partial_die_info *pdi, struct dwarf2_cu *cu)
  
    baseaddr = ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile));
  
 -  if (pdi_needs_namespace (pdi->tag))
-+  if (pdi->linkage_name != NULL)
-+    actual_name = pdi->linkage_name;
-+  else if (pdi_needs_namespace (pdi->tag))
-     {
-       actual_name = partial_die_full_name (pdi, cu);
-       if (actual_name)
-@@ -2133,9 +2318,8 @@ add_partial_symbol (struct partial_die_info *pdi, struct dwarf2_cu *cu)
-   if (cu->language == language_cplus
-       && cu->has_namespace_info == 0
-       && psym != NULL
+-    {
+-      actual_name = partial_die_full_name (pdi, cu);
+-      if (actual_name)
+-      built_actual_name = 1;
+-    }
++  actual_name = partial_die_full_name (pdi, cu);
++  if (actual_name)
++    built_actual_name = 1;
+   if (actual_name == NULL)
+     actual_name = pdi->name;
+@@ -2491,6 +2772,12 @@ add_partial_symbol (struct partial_die_info *pdi, struct dwarf2_cu *cu)
+                          &objfile->global_psymbols,
+                          0, (CORE_ADDR) 0, cu->language, objfile);
+       break;
++    case DW_TAG_module:
++      add_psymbol_to_list (actual_name, strlen (actual_name),
++                         MODULE_DOMAIN, LOC_STATIC,
++                         &objfile->global_psymbols,
++                         0, (CORE_ADDR) 0, cu->language, objfile);
++      break;
+     case DW_TAG_class_type:
+     case DW_TAG_interface_type:
+     case DW_TAG_structure_type:
+@@ -2532,34 +2819,17 @@ add_partial_symbol (struct partial_die_info *pdi, struct dwarf2_cu *cu)
+       break;
+     }
+-  /* Check to see if we should scan the name for possible namespace
+-     info.  Only do this if this is C++, if we don't have namespace
+-     debugging info in the file, if the psym is of an appropriate type
+-     (otherwise we'll have psym == NULL), and if we actually had a
+-     mangled name to begin with.  */
+-
+-  /* FIXME drow/2004-02-22: Why don't we do this for classes, i.e. the
+-     cases which do not set PSYM above?  */
+-
+-  if (cu->language == language_cplus
+-      && cu->has_namespace_info == 0
+-      && psym != NULL
 -      && SYMBOL_CPLUS_DEMANGLED_NAME (psym) != NULL)
 -    cp_check_possible_namespace_symbols (SYMBOL_CPLUS_DEMANGLED_NAME (psym),
 -                                       objfile);
-+      && pdi->linkage_name != NULL)
-+    cp_check_possible_namespace_symbols (actual_name, objfile);
+-
    if (built_actual_name)
      xfree (actual_name);
-@@ -2158,6 +2342,14 @@ pdi_needs_namespace (enum dwarf_tag tag)
+ }
+-/* Determine whether a die of type TAG living in a C++ class or
+-   namespace needs to have the name of the scope prepended to the
+-   name listed in the die.  */
++/* Determine whether DIE needs to have the name of the scope prepended
++   to the name listed in the die.  */
+ static int
+-pdi_needs_namespace (enum dwarf_tag tag)
++die_needs_namespace (struct die_info *die, struct dwarf2_cu *cu)
+ {
+-  switch (tag)
++  switch (die->tag)
+     {
+     case DW_TAG_namespace:
+     case DW_TAG_typedef:
+@@ -2569,7 +2839,23 @@ pdi_needs_namespace (enum dwarf_tag tag)
      case DW_TAG_union_type:
      case DW_TAG_enumeration_type:
      case DW_TAG_enumerator:
 +    case DW_TAG_subprogram:
-+    case DW_TAG_variable:
-+      return 1;
 +    case DW_TAG_member:
-+      /* The only time we will encounter member variables in this
-+       function is when we are creating a "linkage" name for them;
-+       therefore they must be static members, so they do need a
-+       class prefix.  */
        return 1;
++
++    case DW_TAG_variable:
++      {
++      struct attribute *attr;
++      attr = dwarf2_attr (die, DW_AT_specification, cu);
++      if (attr)
++        return 1;
++      attr = dwarf2_attr (die, DW_AT_external, cu);
++      if (attr == NULL && die->parent->tag != DW_TAG_namespace)
++        return 0;
++      return 1;
++      }
++      break;
++
      default:
        return 0;
-@@ -2290,11 +2482,11 @@ guess_structure_name (struct partial_die_info *struct_pdi,
+     }
+@@ -2602,12 +2888,12 @@ static void
+ add_partial_module (struct partial_die_info *pdi, CORE_ADDR *lowpc,
+                   CORE_ADDR *highpc, int need_pc, struct dwarf2_cu *cu)
+ {
+-  /* Now scan partial symbols in that module.
++  /* Add a symbol for the module.  */
  
-       while (child_pdi != NULL)
-       {
--        if (child_pdi->tag == DW_TAG_subprogram)
-+        if (child_pdi->tag == DW_TAG_subprogram && child_pdi->linkage_name)
-           {
-             char *actual_class_name
-               = language_class_name_from_physname (cu->language_defn,
--                                                   child_pdi->name);
-+                                                   child_pdi->linkage_name);
-             if (actual_class_name != NULL)
-               {
-                 struct_pdi->name
-@@ -2741,7 +2933,6 @@ process_full_comp_unit (struct dwarf2_per_cu_data *per_cu)
-   CORE_ADDR lowpc, highpc;
-   struct symtab *symtab;
-   struct cleanup *back_to;
--  struct attribute *attr;
-   CORE_ADDR baseaddr;
+-     FIXME: Support the separate Fortran module namespaces.  */
++  add_partial_symbol (pdi, cu);
  
-   baseaddr = ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile));
-@@ -2751,30 +2942,7 @@ process_full_comp_unit (struct dwarf2_per_cu_data *per_cu)
+-  if (pdi->has_children)
+-    scan_partial_symbols (pdi->die_child, lowpc, highpc, need_pc, cu);
++  /* Partial symbols in that module are not scanned as they are never globally
++     visible.  They get imported to the specific scopes on the full read.  */
+ }
  
-   cu->list_in_scope = &file_symbols;
+ /* Read a partial die corresponding to a subprogram and create a partial
+@@ -2698,27 +2984,6 @@ guess_structure_name (struct partial_die_info *struct_pdi,
  
--  /* Find the base address of the compilation unit for range lists and
--     location lists.  It will normally be specified by DW_AT_low_pc.
--     In DWARF-3 draft 4, the base address could be overridden by
--     DW_AT_entry_pc.  It's been removed, but GCC still uses this for
--     compilation units with discontinuous ranges.  */
--
--  cu->base_known = 0;
--  cu->base_address = 0;
+       if (real_pdi->die_parent != NULL)
+       return;
 -
--  attr = dwarf2_attr (cu->dies, DW_AT_entry_pc, cu);
--  if (attr)
--    {
--      cu->base_address = DW_ADDR (attr);
--      cu->base_known = 1;
--    }
--  else
--    {
--      attr = dwarf2_attr (cu->dies, DW_AT_low_pc, cu);
--      if (attr)
+-      while (child_pdi != NULL)
 -      {
--        cu->base_address = DW_ADDR (attr);
--        cu->base_known = 1;
+-        if (child_pdi->tag == DW_TAG_subprogram)
+-          {
+-            char *actual_class_name
+-              = language_class_name_from_physname (cu->language_defn,
+-                                                   child_pdi->name);
+-            if (actual_class_name != NULL)
+-              {
+-                struct_pdi->name
+-                  = obsavestring (actual_class_name,
+-                                  strlen (actual_class_name),
+-                                  &cu->comp_unit_obstack);
+-                xfree (actual_class_name);
+-              }
+-            break;
+-          }
+-
+-        child_pdi = child_pdi->die_sibling;
 -      }
--    }
-+  dwarf2_find_base_address (cu->dies, cu);
+     }
+ }
  
-   /* Do line number decoding in read_file_scope () */
-   process_die (cu->dies, cu);
-@@ -2805,6 +2973,7 @@ process_full_comp_unit (struct dwarf2_per_cu_data *per_cu)
- static void
- process_die (struct die_info *die, struct dwarf2_cu *cu)
- {
-+
-   switch (die->tag)
-     {
-     case DW_TAG_padding:
-@@ -2849,6 +3018,7 @@ process_die (struct die_info *die, struct dwarf2_cu *cu)
-     case DW_TAG_base_type:
-     case DW_TAG_subrange_type:
-+    case DW_TAG_typedef:
-       /* Add a typedef symbol for the type definition, if it has a
-          DW_AT_name.  */
-       new_symbol (die, read_type_die (die, cu), cu);
-@@ -2867,14 +3037,12 @@ process_die (struct die_info *die, struct dwarf2_cu *cu)
-       break;
+@@ -3295,6 +3560,14 @@ process_die (struct die_info *die, struct dwarf2_cu *cu)
      case DW_TAG_imported_declaration:
      case DW_TAG_imported_module:
--      /* FIXME: carlton/2002-10-16: Eventually, we should use the
--       information contained in these.  DW_TAG_imported_declaration
--       dies shouldn't have children; DW_TAG_imported_module dies
--       shouldn't in the C++ case, but conceivably could in the
--       Fortran case.  */
        processing_has_namespace_info = 1;
--      complaint (&symfile_complaints, _("unsupported tag: '%s'"),
--               dwarf_tag_name (die->tag));
-+      if (die->child != NULL && (die->tag == DW_TAG_imported_declaration
-+                               || cu->language != language_fortran))
-+      complaint (&symfile_complaints, _("Tag '%s' has unexpected children"),
-+                 dwarf_tag_name (die->tag));
-+      read_import_statement (die, cu);
-       break;
-     default:
-       new_symbol (die, NULL, cu);
-@@ -2904,22 +3072,130 @@ dwarf2_full_name (struct die_info *die, struct dwarf2_cu *cu)
-     return name;
++      if (cu->language == language_fortran)
++      {
++        if (die->tag == DW_TAG_imported_declaration)
++          read_fortran_imported_declaration (die, cu);
++        else
++          read_fortran_imported_module (die, cu);
++        break;
++      }
+       if (die->child != NULL && (die->tag == DW_TAG_imported_declaration
+                                || cu->language != language_fortran))
+       complaint (&symfile_complaints, _("Tag '%s' has unexpected children"),
+@@ -3310,41 +3583,68 @@ process_die (struct die_info *die, struct dwarf2_cu *cu)
+ /* Return the fully qualified name of DIE, based on its DW_AT_name.
+    If scope qualifiers are appropriate they will be added.  The result
+    will be allocated on the objfile_obstack, or NULL if the DIE does
+-   not have a name.  */
++   not have a name.
++
++   The output string will be canonicalized (if C++/Java). */
+ static const char *
+ dwarf2_full_name (struct die_info *die, struct dwarf2_cu *cu)
+ {
+-  struct attribute *attr;
+-  char *prefix, *name;
+-  struct ui_file *buf = NULL;
++  char *name;
+   name = dwarf2_name (die, cu);
+-  if (!name)
+-    return NULL;
  
-   /* If no prefix is necessary for this type of DIE, return the
+   /* These are the only languages we know how to qualify names in.  */
+-  if (cu->language != language_cplus
+-      && cu->language != language_java)
+-    return name;
++  if (name != NULL
++      && (cu->language == language_cplus || cu->language == language_java))
++    {
++      if (die_needs_namespace (die, cu))
++      {
++        long length;
++        char *prefix;
++        struct ui_file *buf;
+-  /* If no prefix is necessary for this type of DIE, return the
 -     unqualified name.  The other three tags listed could be handled
 -     in pdi_needs_namespace, but that requires broader changes.  */
 -  if (!pdi_needs_namespace (die->tag)
 -      && die->tag != DW_TAG_subprogram
 -      && die->tag != DW_TAG_variable
 -      && die->tag != DW_TAG_member)
-+     unqualified name.  */
-+  if (!pdi_needs_namespace (die->tag))
-     return name;
+-    return name;
++        buf = mem_fileopen ();
++        prefix = determine_prefix (die, cu);
++        if (*prefix != '\0')
++          {
++            char *prefixed_name = typename_concat (NULL, prefix, name, cu);
++            fputs_unfiltered (prefixed_name, buf);
++            xfree (prefixed_name);
++          }
++        else
++          fputs_unfiltered (name, buf);
  
-   prefix = determine_prefix (die, cu);
-   if (*prefix != '\0')
+-  prefix = determine_prefix (die, cu);
+-  if (*prefix != '\0')
 -    name = typename_concat (&cu->objfile->objfile_obstack, prefix,
 -                          name, cu);
-+    {
-+      char *prefixed_name = typename_concat (NULL, prefix, name, cu);
-+      buf = mem_fileopen ();
-+      fputs_unfiltered (prefixed_name, buf);
-+      xfree (prefixed_name);
-+    }
-+
-+  if (cu->language == language_cplus && die->tag == DW_TAG_subprogram)
-+    {
-+      struct type *type = read_type_die (die, cu);
++        name = ui_file_obsavestring (buf, &cu->objfile->objfile_obstack,
++                                     &length);
++        ui_file_delete (buf);
 +
-+      if (buf == NULL)
-+      {
-+        buf = mem_fileopen ();
-+        fputs_unfiltered (name, buf);
++        if (cu->language == language_cplus)
++          {
++            char *cname
++              = dwarf2_canonicalize_name (name, cu,
++                                          &cu->objfile->objfile_obstack);
++            if (cname != NULL)
++              name = cname;
++          }
 +      }
-+
-+      c_type_print_args (type, buf, 0);
-+    }
-+
-+  if (buf != NULL)
-+    {
-+      long length;
-+      name = ui_file_obsavestring (buf, &cu->objfile->objfile_obstack,
-+                                 &length);
-+      ui_file_delete (buf);
 +    }
  
    return name;
  }
  
 +/* read the given die's decl_line number. Return -1 if in case of an error */
-+static int dwarf2_read_decl_line (struct die_info *die, struct dwarf2_cu *cu){
++static const int dwarf2_read_decl_line (struct die_info *die, struct dwarf2_cu *cu){
 +  struct attribute *line_attr;
 +
 +  line_attr = dwarf2_attr (die, DW_AT_decl_line, cu);
@@ -15488,16 +5788,16 @@ index 55868da..71fed38 100644
 +  return -1;
 +}
 +
-+/* Read the import statement specified by the given die and record it.  */ 
-+
-+static void
-+read_import_statement (struct die_info *die, struct dwarf2_cu *cu)
-+{
-+  struct attribute *import_attr;
-+  struct die_info *imported_die;
-+  const char *imported_name;
-+  const char *imported_name_prefix;
-+  char *canonical_name;
+ /* Read the import statement specified by the given die and record it.  */
+ static void
+@@ -3354,9 +3654,15 @@ read_import_statement (struct die_info *die, struct dwarf2_cu *cu)
+   struct die_info *imported_die;
+   const char *imported_name;
+   const char *imported_name_prefix;
+-  const char *import_prefix;
+   char *canonical_name;
+-
 +  const char *import_alias;
 +  const char *imported_declaration = "";
 +  const char *import_prefix;
@@ -15506,22 +5806,16 @@ index 55868da..71fed38 100644
 +  
 +  int is_anonymous = 0;
 +  
-+  import_attr = dwarf2_attr (die, DW_AT_import, cu);
-+  if (import_attr == NULL)
-+    {
-+      complaint (&symfile_complaints, _("Tag '%s' has no DW_AT_import"),
-+               dwarf_tag_name (die->tag));
-+      return;
-+    }
-+
-+  imported_die = follow_die_ref (die, import_attr, &cu);
-+  imported_name = namespace_name (imported_die, &is_anonymous, cu);
-+  if (imported_name == NULL)
-+    {
-+      /* C++ imports from std:: DW_TAG_base_type with no DW_AT_name - why?  */
-+      return;
-+    }
-+
+   import_attr = dwarf2_attr (die, DW_AT_import, cu);
+   if (import_attr == NULL)
+     {
+@@ -3404,17 +3710,27 @@ read_import_statement (struct die_info *die, struct dwarf2_cu *cu)
+       return;
+     }
+-  /* FIXME: dwarf2_name (die); for the local name after import.  */
+-
+-  /* Figure out where the statement is being imported to.  */
 +  /* Figure out the local name after import.  */
 +  import_alias = dwarf2_name(die, cu);
 +  if(import_alias == NULL){
@@ -15532,27 +5826,29 @@ index 55868da..71fed38 100644
 +  line_number = dwarf2_read_decl_line(die, cu);
 +  
 +  /* Figure out where the statement is being imported to */
-+  import_prefix = determine_prefix (die, cu);
-+
-+  /*
-+   Figure out what the scope of the imported die is and prepend it
-+   to the name of the imported die
-+   */
-+  imported_name_prefix = determine_prefix (imported_die, cu);
+   import_prefix = determine_prefix (die, cu);
+   /* Figure out what the scope of the imported die is and prepend it
+      to the name of the imported die.  */
+   imported_name_prefix = determine_prefix (imported_die, cu);
+-
+-  if (strlen (imported_name_prefix) > 0)
+-    {
 +  
 +  if(imported_die->tag != DW_TAG_namespace){
 +    imported_declaration = imported_name;
 +    canonical_name = (char*)imported_name_prefix;
 +  }else{
 +    if(strlen (imported_name_prefix) > 0){
-+      canonical_name = alloca (strlen (imported_name_prefix) + 2 + strlen (imported_name) + 1);
-+      strcpy (canonical_name, imported_name_prefix);
-+      strcat (canonical_name, "::");
-+      strcat (canonical_name, imported_name);
-+    }else{
-+      canonical_name = alloca (strlen (imported_name) + 1);
-+      strcpy (canonical_name, imported_name);
-+    }
+       canonical_name = alloca (strlen (imported_name_prefix) + 2 + strlen (imported_name) + 1);
+       strcpy (canonical_name, imported_name_prefix);
+       strcat (canonical_name, "::");
+@@ -3425,8 +3741,14 @@ read_import_statement (struct die_info *die, struct dwarf2_cu *cu)
+       canonical_name = alloca (strlen (imported_name) + 1);
+       strcpy (canonical_name, imported_name);
+     }
+-
+-  using_directives = cp_add_using (import_prefix,canonical_name, using_directives);
 +  }
 +  
 +  using_directives = cp_add_using (import_prefix,
@@ -15561,120 +5857,33 @@ index 55868da..71fed38 100644
 +                                   imported_declaration,
 +                                   line_number,
 +                                   using_directives);
-+}
-+
- static void
- initialize_cu_func_list (struct dwarf2_cu *cu)
- {
-@@ -3076,6 +3352,103 @@ add_to_cu_func_list (const char *name, CORE_ADDR lowpc, CORE_ADDR highpc,
-   cu->last_fn = thisfn;
  }
  
-+static int
-+unsigned_int_compar (const void *ap, const void *bp)
-+{
-+  unsigned int a = *(unsigned int *) ap;
-+  unsigned int b = *(unsigned int *) bp;
-+
-+  return (a > b) - (b > a);
-+}
-+
-+static void explore_abstract_origin(struct die_info *die, struct dwarf2_cu *cu, unsigned* die_children_p){
-+  struct attribute *attr;
-+  unsigned die_children = *die_children_p;
-+  struct die_info *child_die;
-+  
-+  attr = dwarf2_attr (die, DW_AT_abstract_origin, cu);
+ static void
+@@ -3695,6 +4017,14 @@ inherit_abstract_dies (struct die_info *die, struct dwarf2_cu *cu)
+   struct attribute *attr;
+   attr = dwarf2_attr (die, DW_AT_abstract_origin, cu);
 +  
-+  /* GCC currently uses DW_AT_specification to indicate die inheritence
-+     in the case of import statements. The following is to accommodate that */
++  /* GCC 4.3 incorrectly uses DW_AT_specification to indicate die inheritence
++     in the case of import statements. The following is to accommodate 
++     that.  */
 +  if(!attr){
 +    attr = dwarf2_attr (die, DW_AT_specification, cu);
 +  }
 +  
-+  if (attr)
-+    {
-+      /* For the list of CHILD_DIEs.  */
-+      unsigned *offsets;
-+      unsigned *offsets_end, *offsetp;
-+      struct die_info *origin_die, *origin_child_die;
-+      struct cleanup *cleanups;
-+
-+      origin_die = follow_die_ref (die, attr, &cu);
-+      if (die->tag != origin_die->tag)
-+        complaint (&symfile_complaints,
-+                   _("DIE 0x%x and its abstract origin 0x%x have different "
-+                     "tags"),
-+                   die->offset, origin_die->offset);
-+
-+      offsets = xmalloc (sizeof (*offsets) * die_children);
-+      cleanups = make_cleanup (xfree, offsets);
-+
-+      offsets_end = offsets;
-+      child_die = die->child;
-+      while (child_die && child_die->tag)
-+        {
-+          attr = dwarf2_attr (child_die, DW_AT_abstract_origin, cu);
-+          if (!attr)
-+            complaint (&symfile_complaints,
-+                       _("Child DIE 0x%x of DIE 0x%x has missing "
-+                         "DW_AT_abstract_origin"),
-+                       child_die->offset, die->offset);
-+          else
-+            {
-+              struct die_info *child_origin_die;
-+
-+              child_origin_die = follow_die_ref (child_die, attr, &cu);
-+              if (child_die->tag != child_origin_die->tag)
-+                complaint (&symfile_complaints,
-+                           _("Child DIE 0x%x and its abstract origin 0x%x have "
-+                             "different tags"),
-+                           child_die->offset, child_origin_die->offset);
-+              *offsets_end++ = child_origin_die->offset;
-+            }
-+          child_die = sibling_die (child_die);
-+        }
-+      qsort (offsets, offsets_end - offsets, sizeof (*offsets),
-+             unsigned_int_compar);
-+      /* Disabled as excessively expensive - check if we may ever complain.  */
-+      if (0)
-+        {
-+          for (offsetp = offsets + 1; offsetp < offsets_end; offsetp++)
-+            if (offsetp[-1] == *offsetp)
-+              complaint (&symfile_complaints,
-+                         _("Child DIEs of DIE 0x%x duplicitly abstract-origin "
-+                           "referenced DIE 0x%x"),
-+                         die->offset, *offsetp);
-+        }
-+
-+      offsetp = offsets;
-+      origin_child_die = origin_die->child;
-+      while (origin_child_die && origin_child_die->tag)
-+        {
-+          /* Is origin_child_die referenced by any of the DIE children?  */
-+          while (offsetp < offsets_end && *offsetp < origin_child_die->offset)
-+            offsetp++;
-+          if (offsetp >= offsets_end || *offsetp > origin_child_die->offset)
-+            {
-+              /* Found that origin_child_die is really not referenced.  */
-+              process_die (origin_child_die, cu);
-+            }
-+          origin_child_die = sibling_die (origin_child_die);
-+        }
-+
-+      do_cleanups (cleanups);
-+    }
-+  
-+}
-+
- static void
- read_func_scope (struct die_info *die, struct dwarf2_cu *cu)
- {
-@@ -3088,16 +3461,27 @@ read_func_scope (struct die_info *die, struct dwarf2_cu *cu)
+   if (!attr)
+     return;
+@@ -3793,6 +4123,7 @@ read_func_scope (struct die_info *die, struct dwarf2_cu *cu)
    char *name;
    CORE_ADDR baseaddr;
    struct block *block;
 +  unsigned die_children = 0;
+   int inlined_func = (die->tag == DW_TAG_inlined_subroutine);
+   if (inlined_func)
+@@ -3811,13 +4142,23 @@ read_func_scope (struct die_info *die, struct dwarf2_cu *cu)
  
    baseaddr = ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile));
  
@@ -15693,7 +5902,7 @@ index 55868da..71fed38 100644
 +      child_die = sibling_die (child_die);
 +      die_children++;
 +      }
-+    explore_abstract_origin(die, cu, &die_children);
++    inherit_abstract_dies(die, cu);
      return;
 -
 +  }
@@ -15701,109 +5910,48 @@ index 55868da..71fed38 100644
    lowpc += baseaddr;
    highpc += baseaddr;
  
-@@ -3124,16 +3508,91 @@ read_func_scope (struct die_info *die, struct dwarf2_cu *cu)
+@@ -3844,14 +4185,19 @@ read_func_scope (struct die_info *die, struct dwarf2_cu *cu)
  
    cu->list_in_scope = &local_symbols;
  
 -  if (die->child != NULL)
++  switch (cu->language)
+     {
+-      child_die = die->child;
+-      while (child_die && child_die->tag)
+-      {
+-        process_die (child_die, cu);
+-        child_die = sibling_die (child_die);
+-      }
++    case language_fortran:
++      cu->language_specific.fortran.use = NULL;
++      break;
++    }
++
 +  child_die = die->child;
-+  die_children = 0;
 +  while (child_die && child_die->tag)
 +    {
 +      process_die (child_die, cu);
 +      child_die = sibling_die (child_die);
 +      die_children++;
-+    }
-+
-+  attr = dwarf2_attr (die, DW_AT_abstract_origin, cu);
-+  if (attr)
-     {
-+      /* For the list of CHILD_DIEs.  */
-+      unsigned *offsets;
-+      unsigned *offsets_end, *offsetp;
-+      struct die_info *origin_die, *origin_child_die;
-+      struct cleanup *cleanups;
-+
-+      origin_die = follow_die_ref (die, attr, &cu);
-+      if (die->tag != origin_die->tag)
-+      complaint (&symfile_complaints,
-+                 _("DIE 0x%x and its abstract origin 0x%x have different "
-+                   "tags"),
-+                 die->offset, origin_die->offset);
-+
-+      offsets = xmalloc (sizeof (*offsets) * die_children);
-+      cleanups = make_cleanup (xfree, offsets);
-+
-+      offsets_end = offsets;
-       child_die = die->child;
-       while (child_die && child_die->tag)
-       {
--        process_die (child_die, cu);
-+        attr = dwarf2_attr (child_die, DW_AT_abstract_origin, cu);
-+        if (!attr)
-+          complaint (&symfile_complaints,
-+                     _("Child DIE 0x%x of DIE 0x%x has missing "
-+                       "DW_AT_abstract_origin"),
-+                     child_die->offset, die->offset);
-+        else
-+          {
-+            struct die_info *child_origin_die;
-+
-+            child_origin_die = follow_die_ref (child_die, attr, &cu);
-+            if (child_die->tag != child_origin_die->tag)
-+              complaint (&symfile_complaints,
-+                         _("Child DIE 0x%x and its abstract origin 0x%x have "
-+                           "different tags"),
-+                         child_die->offset, child_origin_die->offset);
-+            *offsets_end++ = child_origin_die->offset;
-+          }
-         child_die = sibling_die (child_die);
-       }
-+      qsort (offsets, offsets_end - offsets, sizeof (*offsets),
-+           unsigned_int_compar);
-+      /* Disabled as excessively expensive - check if we may ever complain.  */
-+      if (0)
-+      {
-+        for (offsetp = offsets + 1; offsetp < offsets_end; offsetp++)
-+          if (offsetp[-1] == *offsetp)
-+            complaint (&symfile_complaints,
-+                       _("Child DIEs of DIE 0x%x duplicitly abstract-origin "
-+                         "referenced DIE 0x%x"),
-+                       die->offset, *offsetp);
-+      }
-+
-+      offsetp = offsets;
-+      origin_child_die = origin_die->child;
-+      while (origin_child_die && origin_child_die->tag)
-+              {
-+        /* Is origin_child_die referenced by any of the DIE children?  */
-+        while (offsetp < offsets_end && *offsetp < origin_child_die->offset)
-+          offsetp++;
-+        if (offsetp >= offsets_end || *offsetp > origin_child_die->offset)
-+          {
-+            /* Found that origin_child_die is really not referenced.  */
-+            process_die (origin_child_die, cu);
-+          }
-+        origin_child_die = sibling_die (origin_child_die);
-+      }
-+
-+      do_cleanups (cleanups);
      }
  
-+  explore_abstract_origin(die, cu, &die_children);
+   inherit_abstract_dies (die, cu);
+@@ -3867,6 +4213,13 @@ read_func_scope (struct die_info *die, struct dwarf2_cu *cu)
+                       determine_prefix (die, cu),
+                       processing_has_namespace_info);
++  switch (cu->language)
++    {
++    case language_fortran:
++      BLOCK_FORTRAN_USE (block) = cu->language_specific.fortran.use;
++      break;
++    }
 +
-   new = pop_context ();
-   /* Make a block for the local symbols within.  */
-   block = finish_block (new->name, &local_symbols, new->old_blocks,
-@@ -3154,6 +3613,7 @@ read_func_scope (struct die_info *die, struct dwarf2_cu *cu)
-      back to building a containing block's symbol lists.  */
-   local_symbols = new->locals;
-   param_symbols = new->params;
-+  using_directives = new->using_directives;
-   /* If we've finished processing a top-level function, subsequent
-      symbols go in the file symbol list.  */
-@@ -3180,7 +3640,7 @@ read_lexical_block_scope (struct die_info *die, struct dwarf2_cu *cu)
+   /* If we have address ranges, record them.  */
+   dwarf2_record_block_ranges (die, block, baseaddr, cu);
+   
+@@ -3903,7 +4256,7 @@ read_lexical_block_scope (struct die_info *die, struct dwarf2_cu *cu)
       as multiple lexical blocks?  Handling children in a sane way would
       be nasty.  Might be easier to properly extend generic blocks to 
       describe ranges.  */
@@ -15812,24 +5960,16 @@ index 55868da..71fed38 100644
      return;
    lowpc += baseaddr;
    highpc += baseaddr;
-@@ -3197,7 +3657,7 @@ read_lexical_block_scope (struct die_info *die, struct dwarf2_cu *cu)
+@@ -3920,7 +4273,7 @@ read_lexical_block_scope (struct die_info *die, struct dwarf2_cu *cu)
      }
    new = pop_context ();
  
 -  if (local_symbols != NULL)
-+  if (local_symbols != NULL || using_directives!= NULL )
++  if (local_symbols != NULL || using_directives != NULL)
      {
        struct block *block
          = finish_block (0, &local_symbols, new->old_blocks, new->start_addr,
-@@ -3216,6 +3676,7 @@ read_lexical_block_scope (struct die_info *die, struct dwarf2_cu *cu)
-       dwarf2_record_block_ranges (die, block, baseaddr, cu);
-     }
-   local_symbols = new->locals;
-+  using_directives = new->using_directives;
- }
- /* Get low and high pc attributes from DW_AT_ranges attribute value OFFSET.
-@@ -3351,7 +3812,8 @@ dwarf2_ranges_read (unsigned offset, CORE_ADDR *low_return,
+@@ -4075,7 +4428,8 @@ dwarf2_ranges_read (unsigned offset, CORE_ADDR *low_return,
     discontinuous, i.e. derived from DW_AT_ranges information.  */
  static int
  dwarf2_get_pc_bounds (struct die_info *die, CORE_ADDR *lowpc,
@@ -15839,7 +5979,7 @@ index 55868da..71fed38 100644
  {
    struct attribute *attr;
    CORE_ADDR low = 0;
-@@ -3379,7 +3841,7 @@ dwarf2_get_pc_bounds (struct die_info *die, CORE_ADDR *lowpc,
+@@ -4103,7 +4457,7 @@ dwarf2_get_pc_bounds (struct die_info *die, CORE_ADDR *lowpc,
        {
          /* Value of the DW_AT_ranges attribute is the offset in the
             .debug_ranges section.  */
@@ -15848,7 +5988,7 @@ index 55868da..71fed38 100644
            return 0;
          /* Found discontinuous range of addresses.  */
          ret = -1;
-@@ -3418,7 +3880,7 @@ dwarf2_get_subprogram_pc_bounds (struct die_info *die,
+@@ -4142,7 +4496,7 @@ dwarf2_get_subprogram_pc_bounds (struct die_info *die,
    CORE_ADDR low, high;
    struct die_info *child = die->child;
  
@@ -15857,7 +5997,7 @@ index 55868da..71fed38 100644
      {
        *lowpc = min (*lowpc, low);
        *highpc = max (*highpc, high);
-@@ -3455,7 +3917,7 @@ get_scope_pc_bounds (struct die_info *die,
+@@ -4179,7 +4533,7 @@ get_scope_pc_bounds (struct die_info *die,
    CORE_ADDR best_high = (CORE_ADDR) 0;
    CORE_ADDR current_low, current_high;
  
@@ -15866,39 +6006,25 @@ index 55868da..71fed38 100644
      {
        best_low = current_low;
        best_high = current_high;
-@@ -3750,8 +4212,14 @@ dwarf2_add_field (struct field_info *fip, struct die_info *die,
-       if (fieldname == NULL)
+@@ -4474,7 +4828,7 @@ dwarf2_add_field (struct field_info *fip, struct die_info *die,
        return;
  
--      /* Get physical name.  */
-+      /* Get physical name.  We prefer the linkage name if one was specified,
-+       because this lets GDB find a non-debugging version of the symbol.
-+       Otherwise construct the full name from type information.  Ideally,
-+       when GDB supports canonicalization of C++ symbol names, we will not
-+       need the linkage name for anything.  */
-       physname = dwarf2_linkage_name (die, cu);
-+      if (physname == NULL)
-+      physname = (char *) dwarf2_full_name (die, cu);
+       /* Get physical name.  */
+-      physname = dwarf2_linkage_name (die, cu);
++      physname = dwarf2_physname (die, cu);
  
        /* The name is already allocated along with this objfile, so we don't
         need to duplicate it for the type.  */
-@@ -3881,8 +4349,14 @@ dwarf2_add_member_fn (struct field_info *fip, struct die_info *die,
-   if (fieldname == NULL)
+@@ -4617,7 +4971,7 @@ dwarf2_add_member_fn (struct field_info *fip, struct die_info *die,
      return;
  
--  /* Get the mangled name.  */
-+  /* Get physical name.  We prefer the linkage name if one was specified,
-+     because this lets GDB find a non-debugging version of the symbol.
-+     Otherwise construct the full name from type information.  Ideally,
-+     when GDB supports canonicalization of C++ symbol names, we will not
-+     need the linkage name for anything.  */
-   physname = dwarf2_linkage_name (die, cu);
-+  if (physname == NULL)
-+    physname = (char *) dwarf2_full_name (die, cu);
+   /* Get the mangled name.  */
+-  physname = dwarf2_linkage_name (die, cu);
++  physname = dwarf2_physname (die, cu);
  
    /* Look up member function name in fieldlist.  */
    for (i = 0; i < fip->nfnfields; i++)
-@@ -3926,7 +4400,7 @@ dwarf2_add_member_fn (struct field_info *fip, struct die_info *die,
+@@ -4661,7 +5015,7 @@ dwarf2_add_member_fn (struct field_info *fip, struct die_info *die,
    /* The name is already allocated along with this objfile, so we don't
       need to duplicate it for the type.  */
    fnp->physname = physname ? physname : "";
@@ -15907,7 +6033,33 @@ index 55868da..71fed38 100644
    this_type = read_type_die (die, cu);
    if (this_type && TYPE_CODE (this_type) == TYPE_CODE_FUNC)
      {
-@@ -4110,7 +4584,7 @@ quirk_gcc_member_function_pointer (struct die_info *die, struct dwarf2_cu *cu)
+@@ -4721,18 +5075,18 @@ dwarf2_add_member_fn (struct field_info *fip, struct die_info *die,
+     {
+       /* Support the .debug_loc offsets */
+       if (attr_form_is_block (attr))
+-        {
+-          fnp->voffset = decode_locdesc (DW_BLOCK (attr), cu) + 2;
+-        }
++      {
++        fnp->voffset = decode_locdesc (DW_BLOCK (attr), cu) + 2;
++      }
+       else if (attr_form_is_section_offset (attr))
+-        {
++      {
+         dwarf2_complex_location_expr_complaint ();
+-        }
++      }
+       else
+-        {
++      {
+         dwarf2_invalid_attrib_class_complaint ("DW_AT_vtable_elem_location",
+                                                fieldname);
+-        }
++      }
+    }
+ }
+@@ -4845,7 +5199,7 @@ quirk_gcc_member_function_pointer (struct die_info *die, struct dwarf2_cu *cu)
      return NULL;
  
    domain_type = TYPE_TARGET_TYPE (TYPE_FIELD_TYPE (pfn_type, 0));
@@ -15916,44 +6068,99 @@ index 55868da..71fed38 100644
    smash_to_method_type (type, domain_type, TYPE_TARGET_TYPE (pfn_type),
                        TYPE_FIELDS (pfn_type), TYPE_NFIELDS (pfn_type),
                        TYPE_VARARGS (pfn_type));
-@@ -4147,7 +4621,7 @@ read_structure_type (struct die_info *die, struct dwarf2_cu *cu)
-   if (type)
-     return type;
+@@ -4898,7 +5252,7 @@ read_structure_type (struct die_info *die, struct dwarf2_cu *cu)
+       return set_die_type (die, type, cu);
+     }
  
 -  type = alloc_type (objfile);
 +  type = alloc_type (objfile, NULL);
    INIT_CPLUS_SPECIFIC (type);
    name = dwarf2_name (die, cu);
-   if (name != NULL)
-@@ -4360,7 +4834,7 @@ read_enumeration_type (struct die_info *die, struct dwarf2_cu *cu)
-   struct attribute *attr;
-   const char *name;
+@@ -4907,14 +5261,18 @@ read_structure_type (struct die_info *die, struct dwarf2_cu *cu)
+       if (cu->language == language_cplus
+         || cu->language == language_java)
+       {
+-        const char *new_prefix = determine_class_name (die, cu);
+-        TYPE_TAG_NAME (type) = (char *) new_prefix;
++        TYPE_TAG_NAME (type) = (char *) dwarf2_full_name (die, cu);
++        if (die->tag == DW_TAG_structure_type
++            || die->tag == DW_TAG_class_type)
++          TYPE_NAME (type) = TYPE_TAG_NAME (type);
+       }
+       else
+       {
+         /* The name is already allocated along with this objfile, so
+            we don't need to duplicate it for the type.  */
+-        TYPE_TAG_NAME (type) = name;
++        TYPE_TAG_NAME (type) = (char *) name;
++        if (die->tag == DW_TAG_class_type)
++          TYPE_NAME (type) = TYPE_TAG_NAME (type);
+       }
+     }
+@@ -5124,7 +5482,7 @@ read_enumeration_type (struct die_info *die, struct dwarf2_cu *cu)
+       return set_die_type (die, type, cu);
+     }
  
 -  type = alloc_type (objfile);
 +  type = alloc_type (objfile, NULL);
  
    TYPE_CODE (type) = TYPE_CODE_ENUM;
    name = dwarf2_full_name (die, cu);
-@@ -4410,10 +4884,15 @@ determine_class_name (struct die_info *die, struct dwarf2_cu *cu)
-       {
-         if (child->tag == DW_TAG_subprogram)
-           {
+@@ -5152,51 +5510,6 @@ read_enumeration_type (struct die_info *die, struct dwarf2_cu *cu)
+   return set_die_type (die, type, cu);
+ }
+-/* Determine the name of the type represented by DIE, which should be
+-   a named C++ or Java compound type.  Return the name in question,
+-   allocated on the objfile obstack.  */
+-
+-static const char *
+-determine_class_name (struct die_info *die, struct dwarf2_cu *cu)
+-{
+-  const char *new_prefix = NULL;
+-
+-  /* If we don't have namespace debug info, guess the name by trying
+-     to demangle the names of members, just like we did in
+-     guess_structure_name.  */
+-  if (!processing_has_namespace_info)
+-    {
+-      struct die_info *child;
+-
+-      for (child = die->child;
+-         child != NULL && child->tag != 0;
+-         child = sibling_die (child))
+-      {
+-        if (child->tag == DW_TAG_subprogram)
+-          {
 -            char *phys_prefix
-+            char *phys_prefix;
-+            char *linkage_name = dwarf2_linkage_name (child, cu);
-+
-+            if (linkage_name == NULL)
-+              continue;
-+
-+            phys_prefix
-               = language_class_name_from_physname (cu->language_defn,
+-              = language_class_name_from_physname (cu->language_defn,
 -                                                   dwarf2_linkage_name
 -                                                   (child, cu));
-+                                                   linkage_name);
-             if (phys_prefix != NULL)
-               {
-@@ -4510,6 +4989,29 @@ process_enumeration_scope (struct die_info *die, struct dwarf2_cu *cu)
+-
+-            if (phys_prefix != NULL)
+-              {
+-                new_prefix
+-                  = obsavestring (phys_prefix, strlen (phys_prefix),
+-                                  &cu->objfile->objfile_obstack);
+-                xfree (phys_prefix);
+-                break;
+-              }
+-          }
+-      }
+-    }
+-
+-  if (new_prefix == NULL)
+-    new_prefix = dwarf2_full_name (die, cu);
+-
+-  return new_prefix;
+-}
+-
+ /* Given a pointer to a die which begins an enumeration, process all
+    the dies that define the members of the enumeration, and create the
+    symbol for the enumeration type.
+@@ -5274,6 +5587,29 @@ process_enumeration_scope (struct die_info *die, struct dwarf2_cu *cu)
    new_symbol (die, this_type, cu);
  }
  
@@ -15983,7 +6190,7 @@ index 55868da..71fed38 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.  */
-@@ -4523,7 +5025,7 @@ read_array_type (struct die_info *die, struct dwarf2_cu *cu)
+@@ -5287,7 +5623,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;
@@ -15992,7 +6199,7 @@ index 55868da..71fed38 100644
    struct cleanup *back_to;
    char *name;
  
-@@ -4570,16 +5072,11 @@ read_array_type (struct die_info *die, struct dwarf2_cu *cu)
+@@ -5334,16 +5670,11 @@ read_array_type (struct die_info *die, struct dwarf2_cu *cu)
    type = element_type;
  
    if (read_array_order (die, cu) == DW_ORD_col_major)
@@ -16014,7 +6221,7 @@ index 55868da..71fed38 100644
  
    /* Understand Dwarf2 support for vector types (like they occur on
       the PowerPC w/ AltiVec).  Gcc just adds another attribute to the
-@@ -4646,12 +5143,14 @@ read_set_type (struct die_info *die, struct dwarf2_cu *cu)
+@@ -5410,12 +5741,14 @@ read_set_type (struct die_info *die, struct dwarf2_cu *cu)
    return set_die_type (die, set_type, cu);
  }
  
@@ -16031,7 +6238,29 @@ index 55868da..71fed38 100644
    struct attribute *attr;
    struct symbol *sym;
    CORE_ADDR base = (CORE_ADDR) 0;
-@@ -4676,10 +5175,40 @@ read_common_block (struct die_info *die, struct dwarf2_cu *cu)
+@@ -5425,25 +5758,55 @@ read_common_block (struct die_info *die, struct dwarf2_cu *cu)
+     {
+       /* Support the .debug_loc offsets */
+       if (attr_form_is_block (attr))
+-        {
+-          base = decode_locdesc (DW_BLOCK (attr), cu);
+-        }
++      {
++        base = decode_locdesc (DW_BLOCK (attr), cu);
++      }
+       else if (attr_form_is_section_offset (attr))
+-        {
++      {
+         dwarf2_complex_location_expr_complaint ();
+-        }
++      }
+       else
+-        {
++      {
+         dwarf2_invalid_attrib_class_complaint ("DW_AT_location",
+                                                "common block member");
+-        }
++      }
      }
    if (die->child != NULL)
      {
@@ -16072,8 +6301,8 @@ index 55868da..71fed38 100644
          attr = dwarf2_attr (child_die, DW_AT_data_member_location, cu);
          if (attr)
            {
-@@ -4687,8 +5216,25 @@ read_common_block (struct die_info *die, struct dwarf2_cu *cu)
-               base + decode_locdesc (DW_BLOCK (attr), cu);
+@@ -5461,8 +5824,25 @@ read_common_block (struct die_info *die, struct dwarf2_cu *cu)
+             SYMBOL_VALUE_ADDRESS (sym) = base + byte_offset;
              add_symbol_to_list (sym, &global_symbols);
            }
 +
@@ -16098,27 +6327,184 @@ index 55868da..71fed38 100644
      }
  }
  
-@@ -4756,9 +5302,7 @@ read_namespace (struct die_info *die, struct dwarf2_cu *cu)
+@@ -5530,7 +5910,7 @@ read_namespace (struct die_info *die, struct dwarf2_cu *cu)
        if (is_anonymous)
        {
          const char *previous_prefix = determine_prefix (die, cu);
--        cp_add_using_directive (TYPE_NAME (type),
--                                strlen (previous_prefix),
--                                strlen (TYPE_NAME (type)));
+-        cp_add_using_directive (previous_prefix, TYPE_NAME (type));
 +        cp_add_using_directive (previous_prefix, TYPE_NAME (type), "", "", dwarf2_read_decl_line(die, cu));
        }
      }
  
-@@ -4951,29 +5495,95 @@ read_tag_string_type (struct die_info *die, struct dwarf2_cu *cu)
-   struct objfile *objfile = cu->objfile;
+@@ -5546,20 +5926,155 @@ read_namespace (struct die_info *die, struct dwarf2_cu *cu)
+     }
+ }
+-/* Read a Fortran module.  */
++/* Read a Fortran module as global symbol which can be later looked up by
++   f_lookup_symbol_nonlocal.  */
+ static void
+ read_module (struct die_info *die, struct dwarf2_cu *cu)
+ {
+-  struct die_info *child_die = die->child;
++  struct type *type;
++
++  type = read_module_type (die, cu);
++
++  if (type)
++    new_symbol (die, type, cu);
++}
++
++/* Read a Fortran module as type.
++
++   Modules present only as declarations - being used only for DW_AT_import of
++   DW_TAG_imported_module - are ignored here.  They are read in only in form of
++   the module name by read_fortran_imported_module.  */
++
++static struct type *
++read_module_type (struct die_info *die, struct dwarf2_cu *cu)
++{
++  struct objfile *objfile = cu->objfile;
++  struct die_info *child_die;
++  struct type *type;
++  char *module_name;
++  struct context_stack *new;
++  struct pending *save_file_symbols;
++  struct pending *save_global_symbols;
++  struct pending **save_list_in_scope;
++
++  if (die_is_declaration (die, cu))
++    return NULL;
+-  /* FIXME: Support the separate Fortran module namespaces.  */
++  module_name = dwarf2_name (die, cu);
++  if (!module_name)
++    complaint (&symfile_complaints, _("DW_TAG_module has no name, offset 0x%x"),
++               die->offset);
++  type = init_type (TYPE_CODE_MODULE, 0, 0, module_name, objfile);
++  /* Create a context for reading the module variables.  */
++
++  new = push_context (0, 0);
++
++  save_file_symbols = file_symbols;
++  file_symbols = NULL;
++  save_global_symbols = global_symbols;
++  global_symbols = NULL;
++  save_list_in_scope = cu->list_in_scope;
++
++  /* Process the child DIEs.  */
++
++  child_die = die->child;
+   while (child_die && child_die->tag)
+     {
++      /* Any DW_TAG_subprogram will reset LIST_IN_SCOPE to LOCAL_SYMBOLS.  */
++      cu->list_in_scope = &global_symbols;
++
+       process_die (child_die, cu);
+       child_die = sibling_die (child_die);
+     }
++
++  /* Finish this module and restore the context.  */
++
++  TYPE_MODULE_BLOCK (type) = finish_block (NULL, &global_symbols,
++                                           new->old_blocks, 0, 0, objfile);
++
++  if (file_symbols)
++    complaint (&symfile_complaints, _("DW_TAG_module contains static symbols"));
++  if (local_symbols)
++    complaint (&symfile_complaints, _("DW_TAG_module contains local symbols"));
++  if (param_symbols)
++    complaint (&symfile_complaints, _("DW_TAG_module contains function "
++                                    "parameters"));
++
++  file_symbols = save_file_symbols;
++  global_symbols = save_global_symbols;
++  cu->list_in_scope = save_list_in_scope;
++
++  pop_context ();
++
++  set_die_type (die, type, cu);
++
++  return type;
++}
++
++/* Import a Fortran module.  Only store the module name for its later lookup by
++   f_lookup_symbol_nonlocal.  */
++
++static void
++read_fortran_imported_module (struct die_info *die, struct dwarf2_cu *cu)
++{
++  struct objfile *objfile = cu->objfile;
++  struct attribute *attr;
++  struct die_info *module_die;
++  char *module_name;
++  struct fortran_using *use;
++
++  attr = dwarf2_attr (die, DW_AT_import, cu);
++  if (attr == NULL)
++    return;
++
++  module_die = follow_die_ref (die, attr, &cu);
++  module_name = dwarf2_name (module_die, cu);
++  if (module_name == NULL)
++    {
++      complaint (&symfile_complaints,
++               _("Imported DIE at offset 0x%x has no name"), die->offset);
++      return;
++    }
++
++  /* Fortran does not allow any duplicity between local and any of the imported
++     symbols.  Therefore the order of the USE statements is not portant.
++     gfortran prints:
++     Error: Name 'X' at (1) is an ambiguous reference to 'X' from module 'Y'  */
++
++  use = obstack_alloc (&objfile->objfile_obstack, sizeof (*use)
++                                                + strlen (module_name));
++  strcpy (use->module_name, module_name);
++  gdb_assert (cu->language == language_fortran);
++  use->next = cu->language_specific.fortran.use;
++  cu->language_specific.fortran.use = use;
++}
++
++/* Import a single Fortran declaration and possibly rename it.  */
++
++static void
++read_fortran_imported_declaration (struct die_info *die, struct dwarf2_cu *cu)
++{
++  struct attribute *attr;
++  struct die_info *imported_die;
++  struct symbol *sym;
++  char *rename = dwarf2_name (die, cu);
++
++  attr = dwarf2_attr (die, DW_AT_import, cu);
++  if (attr == NULL)
++    {
++      complaint (&symfile_complaints,
++               _("Fortran DW_TAG_imported_declaration is missing "
++                 "DW_AT_import at offset 0x%x"), die->offset);
++      return;
++    }
++  imported_die = follow_die_ref (die, attr, &cu);
++
++  sym = new_symbol (imported_die, NULL, cu);
++
++  if (sym && rename)
++    (sym)->ginfo.language_specific.cplus_specific.demangled_name = rename;
+ }
+ /* Return the name of the namespace represented by DIE.  Set
+@@ -5724,29 +6239,113 @@ 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;
 -  unsigned int length;
 +  int length;
 +
-+  index_type = builtin_type_int32;
-+  /* RANGE_TYPE is allocated from OBJFILE, not OBJFILE_INTERNAL.  */
-+  range_type = alloc_type (objfile, index_type);
++  index_type = objfile_type (objfile)->builtin_int;
++  /* RANGE_TYPE is allocated from OBJFILE, not as a permanent type.  */
++  range_type = alloc_type (objfile, NULL);
 +  /* LOW_BOUND and HIGH_BOUND are set for real below.  */
 +  range_type = create_range_type (range_type, index_type, 0, -1);
 +
@@ -16130,100 +6516,114 @@ index 55868da..71fed38 100644
 -  if (attr)
 -    {
 -      length = DW_UNSND (attr);
--    }
--  else
--    {
--      /* check for the DW_AT_byte_size attribute */
-+  switch (dwarf2_get_attr_constant_value (attr, &length))
++  if (attr && attr_form_is_block (attr))
 +    {
-+    case dwarf2_attr_const:
-+      /* We currently do not support a constant address where the location
-+       should be read from - DWARF2_ATTR_BLOCK is expected instead.  See
-+       DWARF for the DW_AT_STRING_LENGTH vs. DW_AT_BYTE_SIZE difference.  */
-+      /* PASSTHRU */
-+    case dwarf2_attr_unknown:
++      /* Security check for a size overflow.  */
++      if (DW_BLOCK (attr)->size + 2 < DW_BLOCK (attr)->size)
++      TYPE_HIGH_BOUND (range_type) = 1;
++      /* Extend the DWARF block by a new DW_OP_deref/DW_OP_deref_size
++       instruction as DW_AT_string_length specifies the length location, not
++       its value.  */
++      else
++      {
++        struct dwarf2_locexpr_baton *length_baton = NULL;
++        struct dwarf_block *blk = DW_BLOCK (attr);
++
++        /* Turn any single DW_OP_reg* into DW_OP_breg*(0) but clearing
++           DW_OP_deref* in such case.  */
++
++        if (blk->size == 1 && blk->data[0] >= DW_OP_reg0
++            && blk->data[0] <= DW_OP_reg31)
++          length_baton = dwarf2_attr_to_locexpr_baton (attr, cu);
++        else if (blk->size > 1 && blk->data[0] == DW_OP_regx)
++          {
++            ULONGEST ulongest;
++            gdb_byte *end;
++
++            end = read_uleb128 (&blk->data[1], &blk->data[blk->size],
++                                &ulongest);
++            if (end == &blk->data[blk->size])
++              length_baton = dwarf2_attr_to_locexpr_baton (attr, cu);
++          }
++
++        if (length_baton == NULL)
++          {
++            struct attribute *size_attr;
++
++            length_baton = obstack_alloc (&cu->comp_unit_obstack,
++                                          sizeof (*length_baton));
++            length_baton->per_cu = cu->per_cu;
++            length_baton->size = DW_BLOCK (attr)->size + 2;
++            length_baton->data = obstack_alloc (&cu->comp_unit_obstack,
++                                                length_baton->size);
++            memcpy (length_baton->data, DW_BLOCK (attr)->data,
++                    DW_BLOCK (attr)->size);
++
++            /* DW_AT_BYTE_SIZE existing together with DW_AT_STRING_LENGTH
++               specifies the size of an integer to fetch.  */
++            size_attr = dwarf2_attr (die, DW_AT_byte_size, cu);
++            if (size_attr)
++              {
++                length_baton->data[DW_BLOCK (attr)->size] = DW_OP_deref_size;
++                length_baton->data[DW_BLOCK (attr)->size + 1] =
++                                                         DW_UNSND (size_attr);
++                if (length_baton->data[DW_BLOCK (attr)->size + 1]
++                    != DW_UNSND (size_attr))
++                  complaint (&symfile_complaints,
++                             _("DW_AT_string_length's DW_AT_byte_size "
++                               "integer exceeds the byte size storage"));
++              }
++            else
++              {
++                length_baton->data[DW_BLOCK (attr)->size] = DW_OP_deref;
++                length_baton->data[DW_BLOCK (attr)->size + 1] = DW_OP_nop;
++              }
++          }
++
++        TYPE_RANGE_BOUND_SET_DWARF_BLOCK (range_type, 1);
++        TYPE_FIELD_DWARF_BLOCK (range_type, 1) = length_baton;
++        TYPE_DYNAMIC (range_type) = 1;
++      }
+     }
+   else
+     {
+-      /* check for the DW_AT_byte_size attribute */
++      if (attr && attr_form_is_constant (attr))
++      {
++        /* We currently do not support a constant address where the location
++           should be read from - attr_form_is_block is expected instead.  See
++           DWARF for the DW_AT_STRING_LENGTH vs. DW_AT_BYTE_SIZE difference.
++           */
++        /* PASSTHRU */
++      }
++
        attr = dwarf2_attr (die, DW_AT_byte_size, cu);
 -      if (attr)
 -        {
 -          length = DW_UNSND (attr);
 -        }
--      else
--        {
--          length = 1;
--        }
-+      switch (dwarf2_get_attr_constant_value (attr, &length))
++      if (attr && attr_form_is_block (attr))
 +      {
-+      case dwarf2_attr_unknown:
-+        length = 1;
-+        /* PASSTHRU */
-+      case dwarf2_attr_const:
-+        TYPE_HIGH_BOUND (range_type) = length;
-+        break;
-+      case dwarf2_attr_block:
 +        TYPE_RANGE_BOUND_SET_DWARF_BLOCK (range_type, 1);
 +        TYPE_FIELD_DWARF_BLOCK (range_type, 1) =
 +                                      dwarf2_attr_to_locexpr_baton (attr, cu);
 +        TYPE_DYNAMIC (range_type) = 1;
-+        break;
-+      }
-+      break;
-+    case dwarf2_attr_block:
-+      /* Security check for a size overflow.  */
-+      if (DW_BLOCK (attr)->size + 2 < DW_BLOCK (attr)->size)
-+      {
-+        TYPE_HIGH_BOUND (range_type) = 1;
-+        break;
 +      }
-+      /* Extend the DWARF block by a new DW_OP_deref/DW_OP_deref_size
-+       instruction as DW_AT_string_length specifies the length location, not
-+       its value.  */
-+      {
-+      struct dwarf2_locexpr_baton *length_baton;
-+      struct attribute *size_attr;
-+
-+      length_baton = obstack_alloc (&cu->comp_unit_obstack,
-+                                    sizeof (*length_baton));
-+      length_baton->per_cu = cu->per_cu;
-+      length_baton->data = obstack_alloc (&cu->comp_unit_obstack,
-+                                          DW_BLOCK (attr)->size + 2);
-+      memcpy (length_baton->data, DW_BLOCK (attr)->data,
-+              DW_BLOCK (attr)->size);
-+
-+      /* DW_AT_BYTE_SIZE existing together with DW_AT_STRING_LENGTH specifies
-+         the size of an integer to fetch.  */
-+
-+      size_attr = dwarf2_attr (die, DW_AT_byte_size, cu);
-+      if (size_attr)
-+        {
-+          length_baton->size = DW_BLOCK (attr)->size + 2;
-+          length_baton->data[DW_BLOCK (attr)->size] = DW_OP_deref_size;
-+          length_baton->data[DW_BLOCK (attr)->size + 1]
-+                                                       = DW_UNSND (size_attr);
-+          if (length_baton->data[DW_BLOCK (attr)->size + 1]
-+              != DW_UNSND (size_attr))
-+            complaint (&symfile_complaints,
-+                       _("DW_AT_string_length's DW_AT_byte_size integer "
-+                         "exceeds the byte size storage"));
-+        }
-+      else
-+        {
-+          length_baton->size = DW_BLOCK (attr)->size + 1;
-+          length_baton->data[DW_BLOCK (attr)->size] = DW_OP_deref;
-+        }
-+
-+      TYPE_RANGE_BOUND_SET_DWARF_BLOCK (range_type, 1);
-+      TYPE_FIELD_DWARF_BLOCK (range_type, 1) = length_baton;
-+      TYPE_DYNAMIC (range_type) = 1;
-+      }
-+      break;
++      else if (attr && attr_form_is_constant (attr))
++      TYPE_HIGH_BOUND (range_type) = dwarf2_get_attr_constant_value (attr, 0);
+       else
+-        {
+-          length = 1;
+-        }
++      TYPE_HIGH_BOUND (range_type) = 1;
      }
  
--  index_type = builtin_type_int32;
+-  index_type = objfile_type (objfile)->builtin_int;
 -  range_type = create_range_type (NULL, index_type, 1, length);
-   type = create_string_type (NULL, range_type);
+   char_type = language_string_char_type (cu->language_defn, gdbarch);
+   type = create_string_type (NULL, char_type, range_type);
  
-   return set_die_type (die, type, cu);
-@@ -5067,7 +5677,6 @@ static struct type *
+@@ -5841,7 +6440,6 @@ static struct type *
  read_typedef (struct die_info *die, struct dwarf2_cu *cu)
  {
    struct objfile *objfile = cu->objfile;
@@ -16231,18 +6631,17 @@ index 55868da..71fed38 100644
    const char *name = NULL;
    struct type *this_type;
  
-@@ -5175,8 +5784,8 @@ read_subrange_type (struct die_info *die, struct dwarf2_cu *cu)
+@@ -5949,8 +6547,7 @@ read_subrange_type (struct die_info *die, struct dwarf2_cu *cu)
    struct type *base_type;
    struct type *range_type;
    struct attribute *attr;
 -  int low = 0;
 -  int high = -1;
-+  int low, high, byte_stride_int;
-+  enum dwarf2_get_attr_constant_value high_type;
++  int low;
    char *name;
    
    base_type = die_type (die, cu);
-@@ -5189,42 +5798,90 @@ read_subrange_type (struct die_info *die, struct dwarf2_cu *cu)
+@@ -5963,42 +6560,89 @@ read_subrange_type (struct die_info *die, struct dwarf2_cu *cu)
                     0, NULL, cu->objfile);
      }
  
@@ -16260,34 +6659,36 @@ index 55868da..71fed38 100644
    attr = dwarf2_attr (die, DW_AT_lower_bound, cu);
 -  if (attr)
 -    low = dwarf2_get_attr_constant_value (attr, 0);
-+  switch (dwarf2_get_attr_constant_value (attr, &low))
++  if (attr && attr_form_is_block (attr))
 +    {
-+    case dwarf2_attr_unknown:
-+      if (cu->language == language_fortran)
-+      {
-+        /* FORTRAN implies a lower bound of 1, if not given.  */
-+        low = 1;
-+      }
-+      else
-+        {
-+        /* According to DWARF we should assume the value 0 only for
-+           LANGUAGE_C and LANGUAGE_CPLUS.  */
-+        low = 0;
-+      }
-+      /* PASSTHRU */
-+    case dwarf2_attr_const:
-+      TYPE_LOW_BOUND (range_type) = low;
-+      if (low >= 0)
-+      TYPE_UNSIGNED (range_type) = 1;
-+      break;
-+    case dwarf2_attr_block:
 +      TYPE_RANGE_BOUND_SET_DWARF_BLOCK (range_type, 0);
 +      TYPE_FIELD_DWARF_BLOCK (range_type, 0) = dwarf2_attr_to_locexpr_baton
 +                                                                   (attr, cu);
 +      TYPE_DYNAMIC (range_type) = 1;
 +      /* For setting a default if DW_AT_UPPER_BOUND would be missing.  */
 +      low = 0;
-+      break;
++    }
++  else
++    {
++      if (attr && attr_form_is_constant (attr))
++      low = dwarf2_get_attr_constant_value (attr, 0);
++      else
++      {
++        if (cu->language == language_fortran)
++          {
++            /* FORTRAN implies a lower bound of 1, if not given.  */
++            low = 1;
++          }
++        else
++          {
++            /* According to DWARF we should assume the value 0 only for
++               LANGUAGE_C and LANGUAGE_CPLUS.  */
++            low = 0;
++          }
++      }
++      TYPE_LOW_BOUND (range_type) = low;
++      if (low >= 0)
++      TYPE_UNSIGNED (range_type) = 1;
 +    }
  
    attr = dwarf2_attr (die, DW_AT_upper_bound, cu);
@@ -16308,328 +6709,86 @@ index 55868da..71fed38 100644
 -             the lower bound we've computed above.  */
 -          high = low - 1;
 -        }
--      else
--        high = dwarf2_get_attr_constant_value (attr, 1);
-+  high_type = dwarf2_get_attr_constant_value (attr, &high);
-+  if (high_type == dwarf2_attr_unknown)
++  if (!attr || (!attr_form_is_block (attr) && !attr_form_is_constant (attr)))
 +    {
 +      attr = dwarf2_attr (die, DW_AT_count, cu);
-+      high_type = dwarf2_get_attr_constant_value (attr, &high);
 +      /* It does not hurt but it is needlessly ineffective in check_typedef.  */
-+      if (high_type != dwarf2_attr_unknown)
++      if (attr && (attr_form_is_block (attr) || attr_form_is_constant (attr)))
 +              {
 +        TYPE_RANGE_HIGH_BOUND_IS_COUNT (range_type) = 1;
 +        TYPE_DYNAMIC (range_type) = 1;
 +      }
 +      /* Pass it now as the regular DW_AT_upper_bound.  */
 +    }
-+  switch (high_type)
++
++  if (attr && attr_form_is_block (attr))
 +    {
-+    case dwarf2_attr_unknown:
-+      TYPE_RANGE_UPPER_BOUND_IS_UNDEFINED (range_type) = 1;
-+      high = low - 1;
-+      /* PASSTHRU */
-+    case dwarf2_attr_const:
-+      TYPE_HIGH_BOUND (range_type) = high;
-+      break;
-+    case dwarf2_attr_block:
 +      TYPE_RANGE_BOUND_SET_DWARF_BLOCK (range_type, 1);
 +      TYPE_FIELD_DWARF_BLOCK (range_type, 1) = dwarf2_attr_to_locexpr_baton
 +                                                                   (attr, cu);
 +      TYPE_DYNAMIC (range_type) = 1;
-+      break;
++    }
++  else
++    {
++      if (attr && attr_form_is_constant (attr))
++      TYPE_HIGH_BOUND (range_type) = dwarf2_get_attr_constant_value (attr, 0);
+       else
+-        high = dwarf2_get_attr_constant_value (attr, 1);
++      {
++        TYPE_RANGE_UPPER_BOUND_IS_UNDEFINED (range_type) = 1;
++        TYPE_HIGH_BOUND (range_type) = low - 1;
++      }
      }
  
 -  range_type = create_range_type (NULL, base_type, low, high);
 +  /* DW_AT_bit_stride is currently unsupported as we count in bytes.  */
 +  attr = dwarf2_attr (die, DW_AT_byte_stride, cu);
-+  switch (dwarf2_get_attr_constant_value (attr, &byte_stride_int))
++  if (attr && attr_form_is_block (attr))
 +    {
-+    case dwarf2_attr_unknown:
-+      break;
-+    case dwarf2_attr_const:
-+      if (byte_stride_int == 0)
-+      complaint (&symfile_complaints,
-+                 _("Found DW_AT_byte_stride with unsupported value 0"));
-+      TYPE_BYTE_STRIDE (range_type) = byte_stride_int;
-+      break;
-+    case dwarf2_attr_block:
 +      TYPE_RANGE_BOUND_SET_DWARF_BLOCK (range_type, 2);
 +      TYPE_FIELD_DWARF_BLOCK (range_type, 2) = dwarf2_attr_to_locexpr_baton
 +                                                                   (attr, cu);
 +      TYPE_DYNAMIC (range_type) = 1;
-+      break;
-+    }
-   name = dwarf2_name (die, cu);
-   if (name)
-@@ -5386,10 +6043,13 @@ read_die_and_siblings (gdb_byte *info_ptr, bfd *abfd,
- }
- /* Decompress a section that was compressed using zlib.  Store the
--   decompressed buffer, and its size, in OUTBUF and OUTSIZE.  */
-+   decompressed buffer, and its size, in OUTBUF and OUTSIZE.  The
-+   result is allocated on OBSTACK; if OBSTACK is NULL, xmalloc is
-+   used.  */
- static void
--zlib_decompress_section (struct objfile *objfile, asection *sectp,
-+zlib_decompress_section (struct objfile *objfile, struct obstack *obstack,
-+                       asection *sectp,
-                          gdb_byte **outbuf, bfd_size_type *outsize)
- {
-   bfd *abfd = objfile->obfd;
-@@ -5405,6 +6065,7 @@ zlib_decompress_section (struct objfile *objfile, asection *sectp,
-   z_stream strm;
-   int rc;
-   int header_size = 12;
-+  struct cleanup *old = NULL;
-   if (bfd_seek (abfd, sectp->filepos, SEEK_SET) != 0
-       || bfd_bread (compressed_buffer, compressed_size, abfd) != compressed_size)
-@@ -5434,8 +6095,13 @@ zlib_decompress_section (struct objfile *objfile, asection *sectp,
-   strm.avail_in = compressed_size - header_size;
-   strm.next_in = (Bytef*) compressed_buffer + header_size;
-   strm.avail_out = uncompressed_size;
--  uncompressed_buffer = obstack_alloc (&objfile->objfile_obstack,
--                                       uncompressed_size);
-+  if (obstack)
-+    uncompressed_buffer = obstack_alloc (obstack, uncompressed_size);
-+  else
-+    {
-+      uncompressed_buffer = xmalloc (uncompressed_size);
-+      old = make_cleanup (xfree, uncompressed_buffer);
-+    }
-   rc = inflateInit (&strm);
-   while (strm.avail_in > 0)
-     {
-@@ -5456,6 +6122,8 @@ zlib_decompress_section (struct objfile *objfile, asection *sectp,
-     error (_("Dwarf Error: concluding DWARF uncompression in '%s': %d"),
-            bfd_get_filename (abfd), rc);
-+  if (old)
-+    discard_cleanups (old);
-   xfree (compressed_buffer);
-   *outbuf = uncompressed_buffer;
-   *outsize = uncompressed_size;
-@@ -5463,17 +6131,20 @@ zlib_decompress_section (struct objfile *objfile, asection *sectp,
- }
--/* Read the contents of the section at OFFSET and of size SIZE from the
--   object file specified by OBJFILE into the objfile_obstack and return it.
--   If the section is compressed, uncompress it before returning.  */
-+/* Read the contents of the section at OFFSET and of size SIZE from
-+   the object file specified by OBJFILE into OBSTACK and return it.
-+   If OBSTACK is NULL, xmalloc is used instead.  If the section is
-+   compressed, uncompress it before returning.  */
--gdb_byte *
--dwarf2_read_section (struct objfile *objfile, asection *sectp)
-+static gdb_byte *
-+dwarf2_read_section_1 (struct objfile *objfile, struct obstack *obstack,
-+                     asection *sectp)
- {
-   bfd *abfd = objfile->obfd;
-   gdb_byte *buf, *retbuf;
-   bfd_size_type size = bfd_get_section_size (sectp);
-   unsigned char header[4];
-+  struct cleanup *old = NULL;
-   if (size == 0)
-     return NULL;
-@@ -5486,30 +6157,49 @@ dwarf2_read_section (struct objfile *objfile, asection *sectp)
-       /* Upon decompression, update the buffer and its size.  */
-       if (strncmp (header, "ZLIB", sizeof (header)) == 0)
-         {
--          zlib_decompress_section (objfile, sectp, &buf, &size);
-+          zlib_decompress_section (objfile, obstack, sectp, &buf, &size);
-           dwarf2_resize_section (sectp, size);
-           return buf;
-         }
-     }
-   /* If we get here, we are a normal, not-compressed section.  */
--  buf = obstack_alloc (&objfile->objfile_obstack, size);
-+  if (obstack)
-+    buf = obstack_alloc (obstack, size);
-+  else
-+    {
-+      buf = xmalloc (size);
-+      old = make_cleanup (xfree, buf);
 +    }
-   /* When debugging .o files, we may need to apply relocations; see
-      http://sourceware.org/ml/gdb-patches/2002-04/msg00136.html .
-      We never compress sections in .o files, so we only need to
-      try this when the section is not compressed.  */
-   retbuf = symfile_relocate_debug_section (abfd, sectp, buf);
-   if (retbuf != NULL)
--    return retbuf;
++  else if (attr && attr_form_is_constant (attr))
 +    {
-+      if (old)
-+      discard_cleanups (old);
-+      return retbuf;
++      TYPE_BYTE_STRIDE (range_type) = dwarf2_get_attr_constant_value (attr, 0);
++      if (TYPE_BYTE_STRIDE (range_type) == 0)
++      complaint (&symfile_complaints,
++                 _("Found DW_AT_byte_stride with unsupported value 0"));
 +    }
  
-   if (bfd_seek (abfd, sectp->filepos, SEEK_SET) != 0
-       || bfd_bread (buf, size, abfd) != size)
-     error (_("Dwarf Error: Can't read DWARF data from '%s'"),
-          bfd_get_filename (abfd));
-+  if (old)
-+    discard_cleanups (old);
-+
-   return buf;
- }
-+gdb_byte *
-+dwarf2_read_section (struct objfile *objfile, asection *sectp)
-+{
-+  return dwarf2_read_section_1 (objfile, &objfile->objfile_obstack, sectp);
-+}
-+
- /* In DWARF version 2, the description of the debugging information is
-    stored in a separate .debug_abbrev section.  Before we read any
-    dies from a section we read in all abbreviations and install them
-@@ -5914,15 +6604,6 @@ read_partial_die (struct partial_die_info *part_die,
-   struct attribute attr;
-   int has_low_pc_attr = 0;
-   int has_high_pc_attr = 0;
--  CORE_ADDR base_address = 0;
--  enum
--    {
--      base_address_none,
--      base_address_low_pc,
--      /* Overrides BASE_ADDRESS_LOW_PC.  */
--      base_address_entry_pc
--    }
--  base_address_type = base_address_none;
-   memset (part_die, 0, sizeof (struct partial_die_info));
-@@ -5945,47 +6626,35 @@ read_partial_die (struct partial_die_info *part_die,
-       switch (attr.name)
+   name = dwarf2_name (die, cu);
+   if (name)
+@@ -6469,6 +7113,7 @@ load_partial_dies (bfd *abfd, gdb_byte *buffer, gdb_byte *info_ptr,
+         && abbrev->tag != DW_TAG_lexical_block
+         && abbrev->tag != DW_TAG_variable
+         && abbrev->tag != DW_TAG_namespace
++        && abbrev->tag != DW_TAG_module
+         && abbrev->tag != DW_TAG_member)
        {
-       case DW_AT_name:
--
--        /* Prefer DW_AT_MIPS_linkage_name over DW_AT_name.  */
--        if (part_die->name == NULL)
--          part_die->name = DW_STRING (&attr);
--        break;
--      case DW_AT_comp_dir:
--        if (part_die->dirname == NULL)
--          part_die->dirname = DW_STRING (&attr);
-+        switch (part_die->tag)
-+          {
-+          case DW_TAG_compile_unit:
-+            /* Compilation units have a DW_AT_name that is a filename, not
-+               a source language identifier.  */
-+          case DW_TAG_enumeration_type:
-+          case DW_TAG_enumerator:
-+            /* These tags always have simple identifiers already; no need
-+               to canonicalize them.  */
-+            part_die->name = DW_STRING (&attr);
-+            break;
-+          default:
-+            part_die->name
-+              = dwarf2_canonicalize_name (DW_STRING (&attr), cu,
-+                                          &cu->comp_unit_obstack);
-+            break;
-+          }
+         /* Otherwise we skip to the next sibling, if any.  */
+@@ -6689,9 +7334,6 @@ read_partial_die (struct partial_die_info *part_die,
+         if (part_die->dirname == NULL)
+           part_die->dirname = DW_STRING (&attr);
          break;
-       case DW_AT_MIPS_linkage_name:
+-      case DW_AT_MIPS_linkage_name:
 -        part_die->name = DW_STRING (&attr);
-+        part_die->linkage_name = DW_STRING (&attr);
-         break;
+-        break;
        case DW_AT_low_pc:
          has_low_pc_attr = 1;
          part_die->lowpc = DW_ADDR (&attr);
--        if (part_die->tag == DW_TAG_compile_unit
--            && base_address_type < base_address_low_pc)
--          {
--            base_address = DW_ADDR (&attr);
--            base_address_type = base_address_low_pc;
--          }
-         break;
-       case DW_AT_high_pc:
-         has_high_pc_attr = 1;
-         part_die->highpc = DW_ADDR (&attr);
-         break;
--      case DW_AT_entry_pc:
--        if (part_die->tag == DW_TAG_compile_unit
--            && base_address_type < base_address_entry_pc)
--          {
--            base_address = DW_ADDR (&attr);
--            base_address_type = base_address_entry_pc;
--          }
--        break;
--      case DW_AT_ranges:
--        if (part_die->tag == DW_TAG_compile_unit)
--          {
--            cu->ranges_offset = DW_UNSND (&attr);
--            cu->has_ranges_offset = 1;
--          }
--        break;
-       case DW_AT_location:
-           /* Support the .debug_loc offsets */
-           if (attr_form_is_block (&attr))
-@@ -6002,9 +6671,6 @@ read_partial_die (struct partial_die_info *part_die,
-                                                    "partial symbol information");
-             }
-         break;
--      case DW_AT_language:
--        part_die->language = DW_UNSND (&attr);
--        break;
-       case DW_AT_external:
-         part_die->is_external = DW_UNSND (&attr);
-         break;
-@@ -6029,10 +6695,6 @@ read_partial_die (struct partial_die_info *part_die,
-           part_die->sibling = dwarf2_per_objfile->info_buffer
-             + dwarf2_get_ref_die_offset (&attr);
-         break;
--        case DW_AT_stmt_list:
--          part_die->has_stmt_list = 1;
--          part_die->line_offset = DW_UNSND (&attr);
--          break;
-         case DW_AT_byte_size:
-           part_die->has_byte_size = 1;
-           break;
-@@ -6074,13 +6736,6 @@ read_partial_die (struct partial_die_info *part_die,
-         || dwarf2_per_objfile->has_section_at_zero))
-     part_die->has_pc_info = 1;
--  if (base_address_type != base_address_none && !cu->base_known)
--    {
--      gdb_assert (part_die->tag == DW_TAG_compile_unit);
--      cu->base_known = 1;
--      cu->base_address = base_address;
--    }
--
-   return info_ptr;
- }
-@@ -6173,7 +6828,9 @@ fixup_partial_die (struct partial_die_info *part_die,
+@@ -6923,7 +7565,8 @@ fixup_partial_die (struct partial_die_info *part_die,
    /* If we found a reference attribute and the DIE has no name, try
       to find a name in the referred to DIE.  */
  
 -  if (part_die->name == NULL && part_die->has_specification)
 +  if (part_die->has_specification
-+      && (part_die->name == NULL || part_die->linkage_name == NULL
-+        || !part_die->is_external))
++      && (part_die->name == NULL || !part_die->is_external))
      {
        struct partial_die_info *spec_die;
  
-@@ -6189,6 +6846,9 @@ fixup_partial_die (struct partial_die_info *part_die,
-         if (spec_die->is_external)
-           part_die->is_external = spec_die->is_external;
-       }
-+
-+      if (spec_die->linkage_name)
-+      part_die->linkage_name = spec_die->linkage_name;
-     }
-   /* Set default names for some unnamed DIEs.  */
-@@ -7512,10 +8172,12 @@ var_decode_location (struct attribute *attr, struct symbol *sym,
+@@ -8265,10 +8908,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
@@ -16644,15 +6803,16 @@ index 55868da..71fed38 100644
  }
  
  /* Given a pointer to a DWARF information entry, figure out if we need
-@@ -7538,20 +8200,43 @@ new_symbol (struct die_info *die, struct type *type, struct dwarf2_cu *cu)
+@@ -8290,21 +8935,30 @@ new_symbol (struct die_info *die, struct type *type, struct dwarf2_cu *cu)
    baseaddr = ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile));
  
-   if (die->tag != DW_TAG_namespace)
+-  if (die->tag != DW_TAG_namespace)
 -    name = dwarf2_linkage_name (die, cu);
-+    name = dwarf2_name (die, cu);
-   else
-     name = TYPE_NAME (type);
+-  else
+-    name = TYPE_NAME (type);
+-
++  name = dwarf2_name (die, cu);
    if (name)
      {
 +      const char *linkagename;
@@ -16661,8 +6821,8 @@ index 55868da..71fed38 100644
                                             sizeof (struct symbol));
        OBJSTAT (objfile, n_syms++);
        memset (sym, 0, sizeof (struct symbol));
-+      /* Some methods are called without checking SYMBOL_OPS validity.  */
-+      SYMBOL_OPS (sym) = &dwarf2_missing_funcs;
++      /* Some methods are called w/o checking SYMBOL_COMPUTED_OPS validity.  */
++      SYMBOL_COMPUTED_OPS (sym) = &dwarf2_missing_funcs;
  
 -      /* Cache this symbol's name and the name's demangled form (if any).  */
        SYMBOL_LANGUAGE (sym) = cu->language;
@@ -16670,45 +6830,57 @@ index 55868da..71fed38 100644
 +
 +      /* Cache this symbol's name and the name's demangled form (if any).  */
 +
-+      linkagename = dwarf2_linkage_name (die, cu);
-+      if (linkagename)
-+      /* We use the linkage name if available, for the same reason
-+         we used it for TYPE_FN_FIELD_PHYSNAME earlier in this file.
-+         This usage can be removed someday.  */
-+      SYMBOL_SET_NAMES (sym, linkagename, strlen (linkagename), objfile);
-+      else if (die->tag == DW_TAG_namespace)
-+      SYMBOL_SET_LINKAGE_NAME (sym, name);
-+      else
++      linkagename = dwarf2_physname (die, cu);
++      SYMBOL_SET_NAMES (sym, linkagename, strlen (linkagename), objfile);
++      if (cu->language == language_fortran)
 +      {
-+        linkagename = dwarf2_full_name (die, cu);
-+
-+        /* Set just the "linkage" name to the fully qualified name.
-+           While this is not really a linkage name, it should match
-+           the demangled version of the corresponding minimal symbol
-+           if there is one.  */
-+        SYMBOL_SET_LINKAGE_NAME (sym, (char *) linkagename);
++        (sym)->ginfo.language_specific.cplus_specific.demangled_name =
++          SYMBOL_LINKAGE_NAME (sym);
++        SYMBOL_LINKAGE_NAME (sym) = fortran_module_linkage_name (die, cu);
 +      }
  
        /* Default assumptions.
           Use the passed type or decode it from the die.  */
-@@ -7637,7 +8322,15 @@ new_symbol (struct die_info *die, struct type *type, struct dwarf2_cu *cu)
+@@ -8402,9 +9056,28 @@ new_symbol (struct die_info *die, struct type *type, struct dwarf2_cu *cu)
          if (attr)
            {
              var_decode_location (attr, sym, cu);
--            attr2 = dwarf2_attr (die, DW_AT_external, cu);
++
+             attr2 = dwarf2_attr (die, DW_AT_external, cu);
 +
 +            /* Fortran explicitely imports any global symbols to the local
-+               scope by DW_TAG_common_block.  DW_AT_external means for
-+               Fortran the variable is importable versus it is automatically
-+               imported.  */
-+            if (cu->language == language_fortran)
-+              attr2 = NULL;
-+            else
-+              attr2 = dwarf2_attr (die, DW_AT_external, cu);
++               scope by DW_TAG_common_block.  */
++            if (cu->language == language_fortran && die->parent
++                && die->parent->tag == DW_TAG_common_block)
++              attr2 = NULL;
++
              if (attr2 && (DW_UNSND (attr2) != 0))
-               add_symbol_to_list (sym, &global_symbols);
+-              add_symbol_to_list (sym, &global_symbols);
++              {
++                /* Workaround gfortran PR debug/40040 - it uses
++                   DW_AT_location for variables in -fPIC libraries which may
++                   get overriden by other libraries/executable and get
++                   a different address.  Resolve it by .dynsym instead.  */
++
++                if (cu->language == language_fortran && die->parent
++                    && die->parent->tag == DW_TAG_module)
++                  SYMBOL_CLASS (sym) = LOC_UNRESOLVED;
++
++                add_symbol_to_list (sym, &global_symbols);
++              }
              else
-@@ -7780,6 +8473,11 @@ new_symbol (struct die_info *die, struct type *type, struct dwarf2_cu *cu)
+               add_symbol_to_list (sym, cu->list_in_scope);
+           }
+@@ -8534,7 +9207,7 @@ new_symbol (struct die_info *die, struct type *type, struct dwarf2_cu *cu)
+         add_symbol_to_list (sym, cu->list_in_scope);
+         break;
+       case DW_TAG_enumerator:
+-        SYMBOL_LINKAGE_NAME (sym) = (char *) dwarf2_full_name (die, cu);
++        SYMBOL_LINKAGE_NAME (sym) = (char *) dwarf2_name (die, cu);
+         attr = dwarf2_attr (die, DW_AT_const_value, cu);
+         if (attr)
+           {
+@@ -8558,6 +9231,16 @@ new_symbol (struct die_info *die, struct type *type, struct dwarf2_cu *cu)
          SYMBOL_CLASS (sym) = LOC_TYPEDEF;
          add_symbol_to_list (sym, &global_symbols);
          break;
@@ -16716,11 +6888,35 @@ index 55868da..71fed38 100644
 +        SYMBOL_CLASS (sym) = LOC_STATIC;
 +        SYMBOL_DOMAIN (sym) = COMMON_BLOCK_DOMAIN;
 +        add_symbol_to_list (sym, cu->list_in_scope);
++        break;
++      case DW_TAG_module:
++        SYMBOL_CLASS (sym) = LOC_STATIC;
++        SYMBOL_DOMAIN (sym) = MODULE_DOMAIN;
++        add_symbol_to_list (sym, &global_symbols);
 +        break;
        default:
          /* Not a tag we recognize.  Hopefully we aren't processing
             trash data, but since we must specifically ignore things
-@@ -8048,6 +8746,9 @@ read_type_die (struct die_info *die, struct dwarf2_cu *cu)
+@@ -8571,8 +9254,7 @@ new_symbol (struct die_info *die, struct type *type, struct dwarf2_cu *cu)
+       /* For the benefit of old versions of GCC, check for anonymous
+        namespaces based on the demangled name.  */
+       if (!processing_has_namespace_info
+-        && cu->language == language_cplus
+-        && dwarf2_attr (die, DW_AT_MIPS_linkage_name, cu) != NULL)
++        && cu->language == language_cplus)
+       cp_scan_for_anonymous_namespaces (sym);
+     }
+   return (sym);
+@@ -8823,12 +9505,18 @@ read_type_die (struct die_info *die, struct dwarf2_cu *cu)
+     case DW_TAG_namespace:
+       this_type = read_namespace_type (die, cu);
+       break;
++    case DW_TAG_module:
++      this_type = read_module_type (die, cu);
++      break;
+     default:
+       complaint (&symfile_complaints, _("unexpected tag in read_type_die: '%s'"),
+                dwarf_tag_name (die->tag));
        break;
      }
  
@@ -16730,372 +6926,458 @@ index 55868da..71fed38 100644
    return this_type;
  }
  
-@@ -8128,6 +8829,19 @@ determine_prefix (struct die_info *die, struct dwarf2_cu *cu)
-            members; no typedefs, no member functions, et cetera.
+@@ -8910,10 +9598,100 @@ determine_prefix (struct die_info *die, struct dwarf2_cu *cu)
             So it does not need a prefix.  */
          return "";
-+
-+      case DW_TAG_subprogram:
-+      /* A class's symbol, or a variable's symbol, will live
-+         directly in a function's block, so no prefix is
-+         appropriate.  However, what about methods of a
-+         function-local class?  They end up in the global symbol
-+         table because they are separate functions... their mangling
-+         normally would make them inaccessible.  They'll show up
-+         wrong in breakpoints too.  This is a symptom of the
-+         inconsistent way we handle symbol tables.  Namespaces and
-+         classes should have dictionaries just like blocks do.  */
-+      return "";
-+
        default:
-       return determine_prefix (parent, cu);
+-      return determine_prefix (parent, cu);
++        return determine_prefix (parent, cu);
        }
-@@ -8192,23 +8906,62 @@ dwarf2_linkage_name (struct die_info *die, struct dwarf2_cu *cu)
-   attr = dwarf2_attr (die, DW_AT_MIPS_linkage_name, cu);
-   if (attr && DW_STRING (attr))
-     return DW_STRING (attr);
--  attr = dwarf2_attr (die, DW_AT_name, cu);
--  if (attr && DW_STRING (attr))
--    return DW_STRING (attr);
-   return NULL;
  }
  
- /* Get name of a die, return NULL if not found.  */
- static char *
-+dwarf2_canonicalize_name (char *name, struct dwarf2_cu *cu,
-+                        struct obstack *obstack)
++/* Determines the prefix for a symbol's physname.  Unlike determine_prefix,
++   this method does not simply look at the DIE's immediate parent.
++   It will compute the symbol's physname by scanning through all parent
++   DIEs until it gets to the compilation unit's DIE.  */
++
++static char *
++physname_prefix (struct die_info *die, struct dwarf2_cu *cu)
 +{
-+  if (name && cu->language == language_cplus)
++  long length;
++  struct ui_file *buf;
++  struct die_info *d, *spec_die;
++  struct dwarf2_cu *spec_cu;
++  char *name;
++
++  /* Construct a stack containing all of the DIE's parents.  Caution
++     must be observed for dealing with DW_AT_specification. */
++  spec_cu = cu;
++  spec_die = die_specification (die, &spec_cu);
++  if (spec_die != NULL)
++    d = spec_die->parent;
++  else
++    d = die->parent;
++  while (d != NULL && d->tag != DW_TAG_compile_unit)
++    {
++      struct attribute *attr;
++
++      spec_die = die_specification (d, &spec_cu);
++      if (spec_die != NULL)
++      d = spec_die;
++
++      VEC_quick_push (die_info_p, die_list, d);
++      d = d->parent;
++    }
++
++  /* Now pop all the elements, printing their names as we go.  */
++  buf = mem_fileopen ();
++  while (!VEC_empty (die_info_p, die_list))
 +    {
-+      char *canon_name = cp_canonicalize_string (name);
++      d = VEC_pop (die_info_p, die_list);
++      physname_prefix_1 (buf, d, cu);
 +
-+      if (canon_name != NULL)
++      if (!VEC_empty (die_info_p, die_list))
 +      {
-+        if (strcmp (canon_name, name) != 0)
-+          name = obsavestring (canon_name, strlen (canon_name),
-+                               obstack);
-+        xfree (canon_name);
++        if (cu->language == language_cplus)
++          fputs_unfiltered ("::", buf);
++        else
++          fputs_unfiltered (".", buf);
 +      }
 +    }
 +
++  name = ui_file_obsavestring (buf, &cu->objfile->objfile_obstack, &length);
++  ui_file_delete (buf);
 +  return name;
 +}
 +
-+/* Get name of a die, return NULL if not found.  */
-+
-+static char *
- dwarf2_name (struct die_info *die, struct dwarf2_cu *cu)
- {
-   struct attribute *attr;
-   attr = dwarf2_attr (die, DW_AT_name, cu);
--  if (attr && DW_STRING (attr))
--    return DW_STRING (attr);
--  return NULL;
-+  if (!attr || !DW_STRING (attr))
-+    return NULL;
++static void
++physname_prefix_1 (struct ui_file *buf, struct die_info *die,
++                 struct dwarf2_cu *cu)
++{
++  const char *name = NULL;
++  gdb_assert (buf != NULL);
 +
-+  switch (die->tag)
++  if (die != NULL)
 +    {
-+    case DW_TAG_compile_unit:
-+      /* Compilation units have a DW_AT_name that is a filename, not
-+       a source language identifier.  */
-+    case DW_TAG_enumeration_type:
-+    case DW_TAG_enumerator:
-+      /* These tags always have simple identifiers already; no need
-+       to canonicalize them.  */
-+      return DW_STRING (attr);
-+    default:
-+      if (attr->form != GDB_FORM_cached_string)
++      switch (die->tag)
 +      {
-+        DW_STRING (attr)
-+          = dwarf2_canonicalize_name (DW_STRING (attr), cu,
-+                                      &cu->objfile->objfile_obstack);
-+        attr->form = GDB_FORM_cached_string;
-+      }
-+      return DW_STRING (attr);
-+    }
- }
- /* Return the die that this die in an extension of, or NULL if there
-@@ -8703,6 +9456,8 @@ dwarf_form_name (unsigned form)
-       return "DW_FORM_ref_udata";
-     case DW_FORM_indirect:
-       return "DW_FORM_indirect";
-+    case GDB_FORM_cached_string:
-+      return "GDB_FORM_cached_string";
-     default:
-       return "DW_FORM_<unknown>";
-     }
-@@ -9248,6 +10003,7 @@ dump_die_shallow (struct ui_file *f, int indent, struct die_info *die)
-         break;
-       case DW_FORM_string:
-       case DW_FORM_strp:
-+      case GDB_FORM_cached_string:
-         fprintf_unfiltered (f, "string: \"%s\"",
-                  DW_STRING (&die->attrs[i])
-                  ? DW_STRING (&die->attrs[i]) : "");
-@@ -9353,26 +10109,35 @@ dwarf2_get_ref_die_offset (struct attribute *attr)
-   return result;
++      case DW_TAG_namespace:
++        name = dwarf2_name (die, cu);
++        if (name == NULL)
++          name = "(anonymous namespace)";
++        break;
++
++      case DW_TAG_class_type:
++      case DW_TAG_structure_type:
++      case DW_TAG_union_type:
++      case DW_TAG_enumeration_type:
++      case DW_TAG_interface_type:
++      case DW_TAG_subprogram:
++        name = dwarf2_name (die, cu);
++        break;
++
++      default:
++        break;
++      }
++    }
++
++  if (name != NULL)
++    fputs_unfiltered (name, buf);
++}
++
+ /* Return a newly-allocated string formed by concatenating PREFIX and
+    SUFFIX with appropriate separator.  If PREFIX or SUFFIX is NULL or empty, then
+    simply copy the SUFFIX or PREFIX, respectively.  If OBS is non-null,
+@@ -8963,17 +9741,111 @@ sibling_die (struct die_info *die)
+   return die->sibling;
+ }
+-/* Get linkage name of a die, return NULL if not found.  */
++/* Construct a physname for the given DIE in CU. */
+ static char *
+-dwarf2_linkage_name (struct die_info *die, struct dwarf2_cu *cu)
++dwarf2_physname (struct die_info *die, struct dwarf2_cu *cu)
+ {
+   struct attribute *attr;
++  char *name;
++
++  name = dwarf2_name (die, cu);
++
++  /* These are the only languages we know how to qualify names in.  */
++  if (cu->language != language_cplus
++      && cu->language != language_java)
++    return name;
++
++  if (die_needs_namespace (die, cu))
++    {
++      long length;
++      char *prefix;
++      struct ui_file *buf;
++
++      prefix = physname_prefix (die, cu);
++      buf = mem_fileopen ();
++      if (*prefix != '\0')
++      {
++        char *prefixed_name = typename_concat (NULL, prefix, name, cu);
++        fputs_unfiltered (prefixed_name, buf);
++        xfree (prefixed_name);
++      }
++      else
++      fputs_unfiltered (name ? name : "", buf);
++
++      /* For Java and C++ methods, append formal parameter type
++       information. */
++      if ((cu->language == language_cplus || cu->language == language_java)
++        && die->tag == DW_TAG_subprogram)
++      {
++        struct type *type = read_type_die (die, cu);
++
++        c_type_print_args (type, buf, 0, cu->language);
++
++        if (cu->language == language_java)
++          {
++            /* For java, we must append the return type to method names. */
++            if (die->tag == DW_TAG_subprogram)
++              java_print_type (TYPE_TARGET_TYPE (type), "", buf, 0, 0);
++          }
++        else if (cu->language == language_cplus)
++          {
++            /* c_type_print_args adds argument types, but it does
++               not add any necessary "const". */
++            if (TYPE_NFIELDS (type) > 0 && TYPE_FIELD_ARTIFICIAL (type, 0)
++                && TYPE_CONST (TYPE_TARGET_TYPE (TYPE_FIELD_TYPE (type, 0))))
++              fputs_unfiltered (" const", buf);
++          }
++      }
++
++      name = ui_file_obsavestring (buf, &cu->objfile->objfile_obstack,
++                                 &length);
++      ui_file_delete (buf);
++
++      if (cu->language == language_cplus)
++      {
++        char *cname
++          = dwarf2_canonicalize_name (name, cu,
++                                      &cu->objfile->objfile_obstack);
++        if (cname != NULL)
++          name = cname;
++      }
++    }
++
++  return name;
++}
++
++/* Return the fully qualified .symtab name for symbols contained in Fortran
++   modules.  Return DWARF2_NAME otherwise.  */
++
++static char *
++fortran_module_linkage_name (struct die_info *die, struct dwarf2_cu *cu)
++{
++  char *name;
++
++  gdb_assert (cu->language == language_fortran);
++
++  name = dwarf2_name (die, cu);
++
++  if (name && die->parent && die->parent->tag == DW_TAG_module)
++    {
++      char *module_name = dwarf2_name (die->parent, cu);
++
++      if (module_name)
++      {
++        char *retval;
+-  attr = dwarf2_attr (die, DW_AT_MIPS_linkage_name, cu);
+-  if (attr && DW_STRING (attr))
+-    return DW_STRING (attr);
+-  return dwarf2_name (die, cu);
++        /* `__modulename_MOD_variablename0'.  */
++        retval = obstack_alloc (&cu->objfile->objfile_obstack,
++                                2 + strlen (module_name) + 5 + strlen (name)
++                                + 1);
++        sprintf (retval, "__%s_MOD_%s", module_name, name);
++
++        return retval;
++      }
++    }
++
++  return name;
+ }
+ /* Get name of a die, return NULL if not found.  */
+@@ -10200,11 +11072,11 @@ dwarf2_get_ref_die_offset (struct attribute *attr)
+   return 0;
  }
  
 -/* Return the constant value held by the given attribute.  Return -1
--   if the value held by the attribute is not constant.  */
-+/* (*val_return) is filled only if returning dwarf2_attr_const.  */
++/* Return the constant value held by the given attribute.  Return DEFAULT_VALUE
+    if the value held by the attribute is not constant.  */
  
 -static int
 -dwarf2_get_attr_constant_value (struct attribute *attr, int default_value)
-+static enum dwarf2_get_attr_constant_value
-+dwarf2_get_attr_constant_value (struct attribute *attr, int *val_return)
++static CORE_ADDR
++dwarf2_get_attr_constant_value (struct attribute *attr, CORE_ADDR default_value)
  {
-+  if (attr == NULL)
-+    return dwarf2_attr_unknown;
    if (attr->form == DW_FORM_sdata)
--    return DW_SND (attr);
--  else if (attr->form == DW_FORM_udata
--           || attr->form == DW_FORM_data1
--           || attr->form == DW_FORM_data2
--           || attr->form == DW_FORM_data4
--           || attr->form == DW_FORM_data8)
--    return DW_UNSND (attr);
--  else
-     {
--      complaint (&symfile_complaints, _("Attribute value is not a constant (%s)"),
--                 dwarf_form_name (attr->form));
--      return default_value;
-+      *val_return = DW_SND (attr);
-+      return dwarf2_attr_const;
-     }
-+  if (attr->form == DW_FORM_udata
-+      || attr->form == DW_FORM_data1
-+      || attr->form == DW_FORM_data2
-+      || attr->form == DW_FORM_data4
-+      || attr->form == DW_FORM_data8)
-+    {
-+      *val_return = DW_UNSND (attr);
-+      return dwarf2_attr_const;
-+    }
-+  if (attr->form == DW_FORM_block
-+      || attr->form == DW_FORM_block1
-+      || attr->form == DW_FORM_block2
-+      || attr->form == DW_FORM_block4)
-+    return dwarf2_attr_block;
-+  complaint (&symfile_complaints, _("Attribute value is not a constant (%s)"),
-+             dwarf_form_name (attr->form));
-+  return dwarf2_attr_unknown;
- }
- /* THIS_CU has a reference to PER_CU.  If necessary, load the new compilation
-@@ -9963,6 +10728,17 @@ dwarf_decode_macros (struct line_header *lh, unsigned int offset,
+     return DW_SND (attr);
+@@ -11009,8 +11881,6 @@ dwarf_decode_macros (struct line_header *lh, unsigned int offset,
  {
    gdb_byte *mac_ptr, *mac_end;
    struct macro_source_file *current_file = 0;
-+  enum dwarf_macinfo_record_type macinfo_type;
-+
-+  /* Flag is in use by the second pass and determines if GDB is still before
-+     first DW_MACINFO_start_file.  If true GDB is still reading the definitions
-+     from command line.  First DW_MACINFO_start_file will need to be ignored as
-+     it was already executed to create CURRENT_FILE for the main source holding
-+     also the command line definitions.  On first met DW_MACINFO_start_file
-+     this flag is reset to normally execute all the remaining
-+     DW_MACINFO_start_file macinfos.  */
-+
-+  int at_commandline;
+-  enum dwarf_macinfo_record_type macinfo_type;
+-  int at_commandline;
  
-   if (dwarf2_per_objfile->macinfo_buffer == NULL)
+   if (dwarf2_per_objfile->macinfo.buffer == NULL)
      {
-@@ -9970,19 +10746,24 @@ dwarf_decode_macros (struct line_header *lh, unsigned int offset,
+@@ -11018,29 +11888,19 @@ dwarf_decode_macros (struct line_header *lh, unsigned int offset,
        return;
      }
  
-+  /* Start the first pass to find ahead the main source file name.  GDB has to
-+     create CURRENT_FILE where to place the macros given to the compiler
-+     from the command line.  Such command line macros are present before first
-+     DW_MACINFO_start_file but still those macros are associated to the
-+     compilation unit.  The compilation unit GDB identifies by its main source
-+     file name.  */
-+
-   mac_ptr = dwarf2_per_objfile->macinfo_buffer + offset;
-   mac_end = dwarf2_per_objfile->macinfo_buffer
-     + dwarf2_per_objfile->macinfo_size;
+-  /* First pass: Find the name of the base filename.
+-     This filename is needed in order to process all macros whose definition
+-     (or undefinition) comes from the command line.  These macros are defined
+-     before the first DW_MACINFO_start_file entry, and yet still need to be
+-     associated to the base file.
+-
+-     To determine the base file name, we scan the macro definitions until we
+-     reach the first DW_MACINFO_start_file entry.  We then initialize
+-     CURRENT_FILE accordingly so that any macro definition found before the
+-     first DW_MACINFO_start_file can still be associated to the base file.  */
+-
+   mac_ptr = dwarf2_per_objfile->macinfo.buffer + offset;
+   mac_end = dwarf2_per_objfile->macinfo.buffer
+     + dwarf2_per_objfile->macinfo.size;
  
--  for (;;)
-+  do
+-  do
++  for (;;)
      {
--      enum dwarf_macinfo_record_type macinfo_type;
--
++      enum dwarf_macinfo_record_type macinfo_type;
++
        /* Do we at least have room for a macinfo type byte?  */
        if (mac_ptr >= mac_end)
          {
-         dwarf2_macros_too_long_complaint ();
--          return;
-+        break;
+-        /* Complaint is printed during the second pass as GDB will probably
+-           stop the first pass earlier upon finding DW_MACINFO_start_file.  */
+-        break;
++        dwarf2_macros_too_long_complaint ();
++          return;
          }
  
        macinfo_type = read_1_byte (abfd, mac_ptr);
-@@ -9993,7 +10774,81 @@ dwarf_decode_macros (struct line_header *lh, unsigned int offset,
+@@ -11051,92 +11911,7 @@ dwarf_decode_macros (struct line_header *lh, unsigned int offset,
            /* A zero macinfo type indicates the end of the macro
               information.  */
          case 0:
--          return;
-+        break;
-+
-+      case DW_MACINFO_define:
-+      case DW_MACINFO_undef:
-+        /* Only skip the data by MAC_PTR.  */
-+        {
-+          unsigned int bytes_read;
-+
-+          read_unsigned_leb128 (abfd, mac_ptr, &bytes_read);
-+          mac_ptr += bytes_read;
-+          read_string (abfd, mac_ptr, &bytes_read);
-+          mac_ptr += bytes_read;
-+        }
-+        break;
-+
-+      case DW_MACINFO_start_file:
-+        {
-+          unsigned int bytes_read;
-+          int line, file;
-+
-+          line = read_unsigned_leb128 (abfd, mac_ptr, &bytes_read);
-+          mac_ptr += bytes_read;
-+          file = read_unsigned_leb128 (abfd, mac_ptr, &bytes_read);
-+          mac_ptr += bytes_read;
-+
-+          current_file = macro_start_file (file, line, current_file, comp_dir,
-+                                           lh, cu->objfile);
-+        }
-+        break;
-+
-+      case DW_MACINFO_end_file:
-+        /* No data to skip by MAC_PTR.  */
-+        break;
-+
-+      case DW_MACINFO_vendor_ext:
-+        /* Only skip the data by MAC_PTR.  */
-+        {
-+          unsigned int bytes_read;
-+
-+          read_unsigned_leb128 (abfd, mac_ptr, &bytes_read);
-+          mac_ptr += bytes_read;
-+          read_string (abfd, mac_ptr, &bytes_read);
-+          mac_ptr += bytes_read;
-+        }
-+        break;
-+
-+      default:
-+        break;
-+      }
-+    } while (macinfo_type != 0 && current_file == NULL);
-+
-+  /* Here is the second pass to read in the macros starting from the ones
-+     defined at the command line.  */
-+
-+  mac_ptr = dwarf2_per_objfile->macinfo_buffer + offset;
-+  at_commandline = 1;
-+
-+  do
-+    {
-+      /* Do we at least have room for a macinfo type byte?  */
-+      if (mac_ptr >= mac_end)
-+      {
-+        /* Complaint is in the first pass above.  */
-+        break;
-+      }
-+
-+      macinfo_type = read_1_byte (abfd, mac_ptr);
-+      mac_ptr++;
-+
-+      switch (macinfo_type)
-+      {
-+        /* A zero macinfo type indicates the end of the macro
-+           information.  */
-+      case 0:
-+        break;
+-        break;
+-
+-      case DW_MACINFO_define:
+-      case DW_MACINFO_undef:
+-        /* Only skip the data by MAC_PTR.  */
+-        {
+-          unsigned int bytes_read;
+-
+-          read_unsigned_leb128 (abfd, mac_ptr, &bytes_read);
+-          mac_ptr += bytes_read;
+-          read_string (abfd, mac_ptr, &bytes_read);
+-          mac_ptr += bytes_read;
+-        }
+-        break;
+-
+-      case DW_MACINFO_start_file:
+-        {
+-          unsigned int bytes_read;
+-          int line, file;
+-
+-          line = read_unsigned_leb128 (abfd, mac_ptr, &bytes_read);
+-          mac_ptr += bytes_read;
+-          file = read_unsigned_leb128 (abfd, mac_ptr, &bytes_read);
+-          mac_ptr += bytes_read;
+-
+-          current_file = macro_start_file (file, line, current_file, comp_dir,
+-                                           lh, cu->objfile);
+-        }
+-        break;
+-
+-      case DW_MACINFO_end_file:
+-        /* No data to skip by MAC_PTR.  */
+-        break;
+-
+-      case DW_MACINFO_vendor_ext:
+-        /* Only skip the data by MAC_PTR.  */
+-        {
+-          unsigned int bytes_read;
+-
+-          read_unsigned_leb128 (abfd, mac_ptr, &bytes_read);
+-          mac_ptr += bytes_read;
+-          read_string (abfd, mac_ptr, &bytes_read);
+-          mac_ptr += bytes_read;
+-        }
+-        break;
+-
+-      default:
+-        break;
+-      }
+-    } while (macinfo_type != 0 && current_file == NULL);
+-
+-  /* Second pass: Process all entries.
+-
+-     Use the AT_COMMAND_LINE flag to determine whether we are still processing
+-     command-line macro definitions/undefinitions.  This flag is unset when we
+-     reach the first DW_MACINFO_start_file entry.  */
+-
+-  mac_ptr = dwarf2_per_objfile->macinfo.buffer + offset;
+-
+-  /* Determines if GDB is still before first DW_MACINFO_start_file.  If true
+-     GDB is still reading the definitions from command line.  First
+-     DW_MACINFO_start_file will need to be ignored as it was already executed
+-     to create CURRENT_FILE for the main source holding also the command line
+-     definitions.  On first met DW_MACINFO_start_file this flag is reset to
+-     normally execute all the remaining DW_MACINFO_start_file macinfos.  */
+-
+-  at_commandline = 1;
+-
+-  do
+-    {
+-      /* Do we at least have room for a macinfo type byte?  */
+-      if (mac_ptr >= mac_end)
+-      {
+-        dwarf2_macros_too_long_complaint ();
+-        break;
+-      }
+-
+-      macinfo_type = read_1_byte (abfd, mac_ptr);
+-      mac_ptr++;
+-
+-      switch (macinfo_type)
+-      {
+-        /* A zero macinfo type indicates the end of the macro
+-           information.  */
+-      case 0:
+-        break;
++          return;
  
          case DW_MACINFO_define:
          case DW_MACINFO_undef:
-@@ -10008,19 +10863,31 @@ dwarf_decode_macros (struct line_header *lh, unsigned int offset,
+@@ -11151,31 +11926,19 @@ dwarf_decode_macros (struct line_header *lh, unsigned int offset,
              mac_ptr += bytes_read;
  
              if (! current_file)
-+            {
-+              /* DWARF violation as no main source is present.  */
-+              complaint (&symfile_complaints,
-+                         _("debug info with no main source gives macro %s "
-+                           "on line %d: %s"),
-+                         macinfo_type ==
-+                         DW_MACINFO_define ? _("definition") : macinfo_type ==
-+                         DW_MACINFO_undef ? _("undefinition") :
-+                         "something-or-other", line, body);
-+              break;
-+            }
-+          if (at_commandline != (line == 0))
+-            {
+-              /* DWARF violation as no main source is present.  */
+-              complaint (&symfile_complaints,
+-                         _("debug info with no main source gives macro %s "
+-                           "on line %d: %s"),
+-                         macinfo_type ==
+-                         DW_MACINFO_define ? _("definition") : macinfo_type ==
+-                         DW_MACINFO_undef ? _("undefinition") :
+-                         "something-or-other", line, body);
+-              break;
+-            }
+-          if ((line == 0 && !at_commandline) || (line != 0 && at_commandline))
              complaint (&symfile_complaints,
--                       _("debug info gives macro %s outside of any file: %s"),
-+                       _("debug info gives %s macro %s with %s line %d: %s"),
-+                       at_commandline ? _("command-line") : _("in-file"),
+-                       _("debug info gives %s macro %s with %s line %d: %s"),
+-                       at_commandline ? _("command-line") : _("in-file"),
++                       _("debug info gives macro %s outside of any file: %s"),
                         macinfo_type ==
--                       DW_MACINFO_define ? "definition" : macinfo_type ==
--                       DW_MACINFO_undef ? "undefinition" :
--                       "something-or-other", body);
--            else
--              {
--                if (macinfo_type == DW_MACINFO_define)
--                  parse_macro_definition (current_file, line, body);
--                else if (macinfo_type == DW_MACINFO_undef)
--                  macro_undef (current_file, line, body);
--              }
-+                       DW_MACINFO_define ? _("definition") : macinfo_type ==
-+                       DW_MACINFO_undef ? _("undefinition") :
-+                       "something-or-other",
-+                       line == 0 ? _("zero") : _("non-zero"), line, body);
-+
-+          if (macinfo_type == DW_MACINFO_define)
-+            parse_macro_definition (current_file, line, body);
-+          else if (macinfo_type == DW_MACINFO_undef)
-+            macro_undef (current_file, line, body);
+-                       DW_MACINFO_define ? _("definition") : macinfo_type ==
+-                       DW_MACINFO_undef ? _("undefinition") :
+-                       "something-or-other",
+-                       line == 0 ? _("zero") : _("non-zero"), line, body);
+-
+-          if (macinfo_type == DW_MACINFO_define)
+-            parse_macro_definition (current_file, line, body);
+-          else if (macinfo_type == DW_MACINFO_undef)
+-            macro_undef (current_file, line, body);
++                       DW_MACINFO_define ? "definition" : macinfo_type ==
++                       DW_MACINFO_undef ? "undefinition" :
++                       "something-or-other", body);
++            else
++              {
++                if (macinfo_type == DW_MACINFO_define)
++                  parse_macro_definition (current_file, line, body);
++                else if (macinfo_type == DW_MACINFO_undef)
++                  macro_undef (current_file, line, body);
++              }
            }
            break;
  
-@@ -10034,9 +10901,22 @@ dwarf_decode_macros (struct line_header *lh, unsigned int offset,
+@@ -11189,22 +11952,9 @@ dwarf_decode_macros (struct line_header *lh, unsigned int offset,
              file = read_unsigned_leb128 (abfd, mac_ptr, &bytes_read);
              mac_ptr += bytes_read;
  
--            current_file = macro_start_file (file, line,
--                                             current_file, comp_dir,
--                                             lh, cu->objfile);
-+          if (at_commandline != (line == 0))
-+            complaint (&symfile_complaints,
-+                       _("debug info gives source %d included "
-+                         "from %s at %s line %d"),
-+                       file, at_commandline ? _("command-line") : _("file"),
-+                       line == 0 ? _("zero") : _("non-zero"), line);
-+
-+          if (at_commandline)
-+            {
-+              /* This DW_MACINFO_start_file was executed in the pass one.  */
-+              at_commandline = 0;
-+            }
-+          else
-+            current_file = macro_start_file (file, line,
-+                                             current_file, comp_dir,
-+                                             lh, cu->objfile);
+-          if ((line == 0 && !at_commandline) || (line != 0 && at_commandline))
+-            complaint (&symfile_complaints,
+-                       _("debug info gives source %d included "
+-                         "from %s at %s line %d"),
+-                       file, at_commandline ? _("command-line") : _("file"),
+-                       line == 0 ? _("zero") : _("non-zero"), line);
+-
+-          if (at_commandline)
+-            {
+-              /* This DW_MACINFO_start_file was executed in the pass one.  */
+-              at_commandline = 0;
+-            }
+-          else
+-            current_file = macro_start_file (file, line,
+-                                             current_file, comp_dir,
+-                                             lh, cu->objfile);
++            current_file = macro_start_file (file, line,
++                                             current_file, comp_dir,
++                                             lh, cu->objfile);
            }
            break;
  
-@@ -10090,7 +10970,7 @@ dwarf_decode_macros (struct line_header *lh, unsigned int offset,
+@@ -11258,7 +12008,7 @@ dwarf_decode_macros (struct line_header *lh, unsigned int offset,
            }
            break;
          }
--    }
-+    } while (macinfo_type != 0);
+-    } while (macinfo_type != 0);
++    }
  }
  
  /* Check if the attribute's form is a DW_FORM_block*
-@@ -10150,6 +11030,34 @@ attr_form_is_constant (struct attribute *attr)
+@@ -11318,6 +12068,34 @@ attr_form_is_constant (struct attribute *attr)
      }
  }
  
@@ -17130,13 +7412,13 @@ index 55868da..71fed38 100644
  static void
  dwarf2_symbol_mark_computed (struct attribute *attr, struct symbol *sym,
                             struct dwarf2_cu *cu)
-@@ -10179,35 +11087,24 @@ dwarf2_symbol_mark_computed (struct attribute *attr, struct symbol *sym,
-       SYMBOL_OPS (sym) = &dwarf2_loclist_funcs;
+@@ -11347,35 +12125,25 @@ dwarf2_symbol_mark_computed (struct attribute *attr, struct symbol *sym,
+       SYMBOL_COMPUTED_OPS (sym) = &dwarf2_loclist_funcs;
        SYMBOL_LOCATION_BATON (sym) = baton;
      }
 +  else if (attr_form_is_block (attr))
 +    {
-+      SYMBOL_OPS (sym) = &dwarf2_locexpr_funcs;
++      SYMBOL_COMPUTED_OPS (sym) = &dwarf2_locexpr_funcs;
 +      SYMBOL_LOCATION_BATON (sym) = dwarf2_attr_to_locexpr_baton (attr, cu);
 +    }
    else
@@ -17149,9 +7431,7 @@ index 55868da..71fed38 100644
 -                           sizeof (struct dwarf2_locexpr_baton));
 -      baton->per_cu = cu->per_cu;
 -      gdb_assert (baton->per_cu);
-+      /* Some methods are called without checking SYMBOL_OPS validity.  */
-+      SYMBOL_OPS (sym) = &dwarf2_missing_funcs;
-+      SYMBOL_LOCATION_BATON (sym) = NULL;
++      /* Some methods are called w/o checking SYMBOL_COMPUTED_OPS validity.  */
  
 -      if (attr_form_is_block (attr))
 -      {
@@ -17171,8 +7451,11 @@ index 55868da..71fed38 100644
 -        baton->data = NULL;
 -      }
 -      
--      SYMBOL_OPS (sym) = &dwarf2_locexpr_funcs;
+-      SYMBOL_COMPUTED_OPS (sym) = &dwarf2_locexpr_funcs;
 -      SYMBOL_LOCATION_BATON (sym) = baton;
++      SYMBOL_COMPUTED_OPS (sym) = &dwarf2_missing_funcs;
++      SYMBOL_LOCATION_BATON (sym) = NULL;
++
 +      /* For functions a missing DW_AT_frame_base does not optimize out the
 +       whole function definition, only its frame base resolving.  */
 +      if (attr->name == DW_AT_location)
@@ -17180,7 +7463,7 @@ index 55868da..71fed38 100644
      }
  }
  
-@@ -10482,6 +11379,31 @@ offset_and_type_eq (const void *item_lhs, const void *item_rhs)
+@@ -11663,6 +12431,31 @@ offset_and_type_eq (const void *item_lhs, const void *item_rhs)
    return ofs_lhs->offset == ofs_rhs->offset;
  }
  
@@ -17212,7 +7495,7 @@ index 55868da..71fed38 100644
  /* Set the type associated with DIE to TYPE.  Save it in CU's hash
     table if necessary.  For convenience, return TYPE.  */
  
-@@ -10490,6 +11412,8 @@ set_die_type (struct die_info *die, struct type *type, struct dwarf2_cu *cu)
+@@ -11671,6 +12464,8 @@ set_die_type (struct die_info *die, struct type *type, struct dwarf2_cu *cu)
  {
    struct dwarf2_offset_and_type **slot, ofs;
  
@@ -17221,11 +7504,72 @@ index 55868da..71fed38 100644
    if (cu->type_hash == NULL)
      {
        gdb_assert (cu->per_cu != NULL);
+@@ -11813,23 +12608,13 @@ show_dwarf2_cmd (char *args, int from_tty)
+   cmd_show_list (show_dwarf2_cmdlist, from_tty, "");
+ }
+-/* If section described by INFO was mmapped, munmap it now.  */
++/* A helper function to destroy a debug section.  */
+ static void
+-munmap_section_buffer (struct dwarf2_section_info *info)
++destroy_section (struct dwarf2_section_info *info)
+ {
+-  if (info->was_mmapped)
+-    {
+-#ifdef HAVE_MMAP
+-      intptr_t begin = (intptr_t) info->buffer;
+-      intptr_t map_begin = begin & ~(pagesize - 1);
+-      size_t map_length = info->size + begin - map_begin;
+-      gdb_assert (munmap ((void *) map_begin, map_length) == 0);
+-#else
+-      /* Without HAVE_MMAP, we should never be here to begin with.  */
+-      gdb_assert (0);
+-#endif
+-    }
++  if (info->destructor)
++    (*info->destructor) (info);
+ }
+ /* munmap debug sections for OBJFILE, if necessary.  */
+@@ -11838,15 +12623,15 @@ static void
+ dwarf2_per_objfile_free (struct objfile *objfile, void *d)
+ {
+   struct dwarf2_per_objfile *data = d;
+-  munmap_section_buffer (&data->info);
+-  munmap_section_buffer (&data->abbrev);
+-  munmap_section_buffer (&data->line);
+-  munmap_section_buffer (&data->str);
+-  munmap_section_buffer (&data->macinfo);
+-  munmap_section_buffer (&data->ranges);
+-  munmap_section_buffer (&data->loc);
+-  munmap_section_buffer (&data->frame);
+-  munmap_section_buffer (&data->eh_frame);
++  destroy_section (&data->info);
++  destroy_section (&data->abbrev);
++  destroy_section (&data->line);
++  destroy_section (&data->str);
++  destroy_section (&data->macinfo);
++  destroy_section (&data->ranges);
++  destroy_section (&data->loc);
++  destroy_section (&data->frame);
++  destroy_section (&data->eh_frame);
+ }
+ void _initialize_dwarf2_read (void);
+@@ -11854,6 +12639,7 @@ void _initialize_dwarf2_read (void);
+ void
+ _initialize_dwarf2_read (void)
+ {
++  die_list = VEC_alloc (die_info_p, 32);
+   dwarf2_objfile_data_key
+     = register_objfile_data_with_cleanup (NULL, dwarf2_per_objfile_free);
 diff --git a/gdb/elfread.c b/gdb/elfread.c
-index ff220a2..13158f4 100644
+index 6e79d4a..198bae3 100644
 --- a/gdb/elfread.c
 +++ b/gdb/elfread.c
-@@ -727,10 +727,18 @@ elf_symfile_read (struct objfile *objfile, int mainline)
+@@ -728,10 +728,18 @@ elf_symfile_read (struct objfile *objfile, int mainline)
                                str_sect->filepos,
                                bfd_section_size (abfd, str_sect));
      }
@@ -17245,7 +7589,7 @@ index ff220a2..13158f4 100644
      }
  
    /* FIXME: kettenis/20030504: This still needs to be integrated with
-@@ -880,6 +888,7 @@ static struct sym_fns elf_sym_fns =
+@@ -881,6 +889,7 @@ static struct sym_fns elf_sym_fns =
    elf_new_init,                       /* sym_new_init: init anything gbl to entire symtab */
    elf_symfile_init,           /* sym_init: read initial info, setup for sym_read() */
    elf_symfile_read,           /* sym_read: read a symbol file into symtab */
@@ -17254,92 +7598,60 @@ index ff220a2..13158f4 100644
    default_symfile_offsets,    /* sym_offsets:  Translate ext. to int. relocation */
    elf_symfile_segments,               /* sym_segments: Get segment information from
 diff --git a/gdb/eval.c b/gdb/eval.c
-index 1d35571..6a97e09 100644
+index 2926465..4c6de78 100644
 --- a/gdb/eval.c
 +++ b/gdb/eval.c
-@@ -39,10 +39,16 @@
+@@ -39,8 +39,12 @@
  #include "exceptions.h"
  #include "regcache.h"
  #include "user-regs.h"
 +#include "python/python.h"
  #include "valprint.h"
-+#include "dwarf2loc.h"
 +#include "gdb_obstack.h"
 +#include "objfiles.h"
+ #include "python/python.h"
++#include "dwarf2loc.h"
  
  #include "gdb_assert.h"
  
-+#include <ctype.h>
-+
- /* This is defined in valops.c */
- extern int overload_resolution;
-@@ -651,6 +657,64 @@ ptrmath_type_p (struct type *type)
+@@ -651,6 +655,36 @@ ptrmath_type_p (struct type *type)
      }
  }
  
-+/* Compares the two method/function types T1 and T2 for "equality" 
-+   with respect to the the methods' parameters. If the types of the
-+   two parameter lists are the same, returns 1; 0 otherwise. This
-+   comparison ignores any artificial this pointer. */
-+int
-+compare_parameters (struct type *t1, struct type *t2)
-+{
-+  int i, has_this;
-+  /* Hacky: we don't know a priori whether or not t1 is a static
-+     method, so we skip any artificial "this" pointer and hope
-+     for the best. t2, which comes as user input, never contains a
-+     "this" pointer (a user would never enter it into expressions. */
-+  if (TYPE_NFIELDS (t1) > 0)
-+    has_this = TYPE_FIELD_ARTIFICIAL (t1, 0) ? 1 : 0;
-+  else
-+    has_this = 0;
-+
-+  /* Special case: a method taking void. t1 will contain either
-+     no fields or just "this". t2 will contain TYPE_CODE_VOID. */
-+  if ((TYPE_NFIELDS (t1) - has_this) == 0 && TYPE_NFIELDS (t2) == 1
-+      && TYPE_CODE (TYPE_FIELD_TYPE (t2, 0)) == TYPE_CODE_VOID)
-+    return 1;
-+
-+  if ((TYPE_NFIELDS (t1) - has_this) == TYPE_NFIELDS (t2))
-+    {
-+      for (i = has_this; i < TYPE_NFIELDS (t1); ++i)
-+      {
-+        if (rank_one_type (TYPE_FIELD_TYPE (t1, i),
-+                           TYPE_FIELD_TYPE (t2, i - has_this))
-+            != 0)
-+          return 0;
-+      }
-+
-+      return 1;
-+    }
-+
-+  return 0;
-+}
-+
 +/* Constructs a fake method with the given parameter types. */
++static void
++free_param_types (void *arg)
++{
++  struct type *type = (struct type *) arg;
++  xfree (TYPE_FIELDS (type));
++  xfree (TYPE_MAIN_TYPE (type));
++  xfree (type);
++}
 +
 +static struct type *
 +make_params (int num_types, struct type **param_types)
 +{
-+  struct type *type = alloc_type (NULL, NULL);
++  struct type *type = XZALLOC (struct type);
++  TYPE_MAIN_TYPE (type) = XZALLOC (struct main_type);
 +  TYPE_LENGTH (type) = 1;
 +  TYPE_CODE (type) = TYPE_CODE_METHOD;
++  TYPE_VPTR_FIELDNO (type) = -1;
++  TYPE_CHAIN (type) = type;
 +  TYPE_NFIELDS (type) = num_types;
 +  TYPE_FIELDS (type) = (struct field *)
-+    TYPE_ALLOC (type, sizeof (struct field) * num_types);
-+  memset (TYPE_FIELDS (type), 0, sizeof (struct field) * num_types);
++    TYPE_ZALLOC (type, sizeof (struct field) * num_types);
 +
 +  while (num_types-- > 0)
 +    TYPE_FIELD_TYPE (type, num_types) = param_types[num_types];
 +
++  make_cleanup (free_param_types, type);
 +  return type;
 +}
 +
  struct value *
  evaluate_subexp_standard (struct type *expect_type,
                          struct expression *exp, int *pos,
-@@ -671,6 +735,7 @@ evaluate_subexp_standard (struct type *expect_type,
+@@ -671,6 +705,7 @@ evaluate_subexp_standard (struct type *expect_type,
    long mem_offset;
    struct type **arg_types;
    int save_pos1;
@@ -17347,7 +7659,7 @@ index 1d35571..6a97e09 100644
  
    pc = (*pos)++;
    op = exp->elts[pc].opcode;
-@@ -684,7 +749,7 @@ evaluate_subexp_standard (struct type *expect_type,
+@@ -684,7 +719,7 @@ evaluate_subexp_standard (struct type *expect_type,
        goto nosideret;
        arg1 = value_aggregate_elt (exp->elts[pc + 1].type,
                                  &exp->elts[pc + 3].string,
@@ -17356,19 +7668,7 @@ index 1d35571..6a97e09 100644
        if (arg1 == NULL)
        error (_("There is no field named %s"), &exp->elts[pc + 3].string);
        return arg1;
-@@ -1208,9 +1273,9 @@ evaluate_subexp_standard (struct type *expect_type,
-           if (TYPE_CODE (value_type (method)) != TYPE_CODE_FUNC)
-             error (_("method address has symbol information with non-function type; skipping"));
-           if (struct_return)
--            VALUE_ADDRESS (method) = value_as_address (msg_send_stret);
-+            set_value_address (method, value_as_address (msg_send_stret));
-           else
--            VALUE_ADDRESS (method) = value_as_address (msg_send);
-+            set_value_address (method, value_as_address (msg_send));
-           called_method = method;
-         }
-       else
-@@ -1284,7 +1349,6 @@ evaluate_subexp_standard (struct type *expect_type,
+@@ -1293,7 +1328,6 @@ evaluate_subexp_standard (struct type *expect_type,
        argvec = (struct value **) alloca (sizeof (struct value *) * (nargs + 3));
        if (op == STRUCTOP_MEMBER || op == STRUCTOP_MPTR)
        {
@@ -17376,7 +7676,7 @@ index 1d35571..6a97e09 100644
          /* First, evaluate the structure into arg2 */
          pc2 = (*pos)++;
  
-@@ -1308,21 +1372,40 @@ evaluate_subexp_standard (struct type *expect_type,
+@@ -1317,21 +1351,40 @@ evaluate_subexp_standard (struct type *expect_type,
  
          arg1 = evaluate_subexp (NULL_TYPE, exp, pos, noside);
  
@@ -17429,16 +7729,7 @@ index 1d35571..6a97e09 100644
        }
        else if (op == STRUCTOP_STRUCT || op == STRUCTOP_PTR)
        {
-@@ -1434,7 +1517,7 @@ evaluate_subexp_standard (struct type *expect_type,
-                of the ``this'' pointer if necessary, so modify argvec[1] to
-                reflect any ``this'' changes.  */
-             arg2 = value_from_longest (lookup_pointer_type(value_type (temp)),
--                                       VALUE_ADDRESS (temp) + value_offset (temp)
-+                                       value_address (temp)
-                                        + value_embedded_offset (temp));
-             argvec[1] = arg2; /* the ``this'' pointer */
-           }
-@@ -1448,8 +1531,7 @@ evaluate_subexp_standard (struct type *expect_type,
+@@ -1457,8 +1510,7 @@ evaluate_subexp_standard (struct type *expect_type,
        }
        else if (op == STRUCTOP_MEMBER || op == STRUCTOP_MPTR)
        {
@@ -17448,28 +7739,18 @@ index 1d35571..6a97e09 100644
        }
        else if (op == OP_VAR_VALUE)
        {
-@@ -1512,6 +1594,9 @@ evaluate_subexp_standard (struct type *expect_type,
-         else
-           error (_("Expression of type other than \"Function returning ...\" used as function"));
-       }
-+      if (TYPE_CODE (value_type (argvec[0])) == TYPE_CODE_INTERNAL_FUNCTION)
-+      return call_internal_function (argvec[0], nargs, argvec + 1);
-+
-       return call_function_by_hand (argvec[0], nargs, argvec + 1);
-       /* pai: FIXME save value from call_function_by_hand, then adjust pc by adjust_fn_pc if +ve  */
-@@ -1529,7 +1614,10 @@ evaluate_subexp_standard (struct type *expect_type,
+@@ -1549,7 +1601,10 @@ evaluate_subexp_standard (struct type *expect_type,
  
        /* First determine the type code we are dealing with.  */
        arg1 = evaluate_subexp (NULL_TYPE, exp, pos, noside);
 +      old_chain = make_cleanup (null_cleanup, 0);
-+      object_address_set (VALUE_ADDRESS (arg1));
++      object_address_set (value_raw_address (arg1));
        type = check_typedef (value_type (arg1));
 +      do_cleanups (old_chain);
        code = TYPE_CODE (type);
  
        if (code == TYPE_CODE_PTR)
-@@ -1696,6 +1784,37 @@ evaluate_subexp_standard (struct type *expect_type,
+@@ -1716,6 +1771,37 @@ evaluate_subexp_standard (struct type *expect_type,
          error (_("non-pointer-to-member value used in pointer-to-member construct"));
        }
  
@@ -17507,7 +7788,7 @@ index 1d35571..6a97e09 100644
      case BINOP_CONCAT:
        arg1 = evaluate_subexp_with_coercion (exp, pos, noside);
        arg2 = evaluate_subexp_with_coercion (exp, pos, noside);
-@@ -1963,13 +2082,19 @@ evaluate_subexp_standard (struct type *expect_type,
+@@ -1987,13 +2073,19 @@ evaluate_subexp_standard (struct type *expect_type,
        {
        int subscript_array[MAX_FORTRAN_DIMS];
        int array_size_array[MAX_FORTRAN_DIMS];
@@ -17522,12 +7803,12 @@ index 1d35571..6a97e09 100644
          error (_("Too many subscripts for F77 (%d Max)"), MAX_FORTRAN_DIMS);
  
 +      old_chain = make_cleanup (null_cleanup, 0);
-+      object_address_set (VALUE_ADDRESS (arg1));
++      object_address_set (value_raw_address (arg1));
 +
        tmp_type = check_typedef (value_type (arg1));
        ndimensions = calc_f77_array_dims (type);
  
-@@ -1999,6 +2124,9 @@ evaluate_subexp_standard (struct type *expect_type,
+@@ -2023,6 +2115,9 @@ evaluate_subexp_standard (struct type *expect_type,
            upper = f77_get_upperbound (tmp_type);
            lower = f77_get_lowerbound (tmp_type);
  
@@ -17537,24 +7818,19 @@ index 1d35571..6a97e09 100644
            array_size_array[nargs - i - 1] = upper - lower + 1;
  
            /* Zero-normalize subscripts so that offsetting will work. */
-@@ -2017,17 +2145,25 @@ evaluate_subexp_standard (struct type *expect_type,
+@@ -2041,13 +2136,25 @@ evaluate_subexp_standard (struct type *expect_type,
              tmp_type = check_typedef (TYPE_TARGET_TYPE (tmp_type));
          }
  
--      /* Now let us calculate the offset for this item */
 +      /* Kept for the f77_get_upperbound / f77_get_lowerbound calls above.  */
 +      do_cleanups (old_chain);
++
+       /* Now let us calculate the offset for this item */
  
 -      offset_item = subscript_array[ndimensions - 1];
-+      /* Now let us calculate the offset for this item */
--      for (i = ndimensions - 1; i > 0; --i)
--        offset_item =
--          array_size_array[i - 1] * offset_item + subscript_array[i - 1];
 +      offset_item = 0;
 +      offset_byte = 0;
--      /* Construct a value node with the value of the offset */
++
 +      for (i = ndimensions - 1; i >= 0; --i)
 +        {
 +          offset_item *= array_size_array[i];
@@ -17564,41 +7840,24 @@ index 1d35571..6a97e09 100644
 +            offset_byte += subscript_array[i] * byte_stride_array[i];
 +        }
  
--      arg2 = value_from_longest (builtin_type_int32, offset_item);
+-      for (i = ndimensions - 1; i > 0; --i)
+-        offset_item =
+-          array_size_array[i - 1] * offset_item + subscript_array[i - 1];
 +      element_size = TYPE_LENGTH (TYPE_TARGET_TYPE (tmp_type));
 +      offset_byte += offset_item * element_size;
  
        /* Let us now play a dirty trick: we will take arg1 
           which is a value node pointing to the topmost level
-@@ -2037,7 +2173,7 @@ evaluate_subexp_standard (struct type *expect_type,
+@@ -2057,7 +2164,7 @@ evaluate_subexp_standard (struct type *expect_type,
           returns the correct type value */
  
        deprecated_set_value_type (arg1, tmp_type);
--      return value_subscripted_rvalue (arg1, arg2, 0);
+-      return value_subscripted_rvalue (arg1, offset_item, 0);
 +      return value_subscripted_rvalue (arg1, offset_byte);
        }
  
      case BINOP_LOGICAL_AND:
-@@ -2475,7 +2611,17 @@ evaluate_subexp_standard (struct type *expect_type,
-       if (noside == EVAL_SKIP)
-         goto nosideret;
-       else if (noside == EVAL_AVOID_SIDE_EFFECTS)
--        return allocate_value (exp->elts[pc + 1].type);
-+      {
-+        struct type *type = exp->elts[pc + 1].type;
-+        /* If this is a typedef, then find its immediate target.  We
-+           use check_typedef to resolve stubs, but we ignore its
-+           result because we do not want to dig past all
-+           typedefs.  */
-+        check_typedef (type);
-+        if (TYPE_CODE (type) == TYPE_CODE_TYPEDEF)
-+          type = TYPE_TARGET_TYPE (type);
-+        return allocate_value (type);
-+      }
-       else
-         error (_("Attempt to use a type name as an expression"));
-@@ -2568,7 +2714,7 @@ evaluate_subexp_for_address (struct expression *exp, int *pos,
+@@ -2598,7 +2705,7 @@ evaluate_subexp_for_address (struct expression *exp, int *pos,
        (*pos) += 5 + BYTES_TO_EXP_ELEM (tem + 1);
        x = value_aggregate_elt (exp->elts[pc + 1].type,
                               &exp->elts[pc + 3].string,
@@ -17607,7 +7866,7 @@ index 1d35571..6a97e09 100644
        if (x == NULL)
        error (_("There is no field named %s"), &exp->elts[pc + 3].string);
        return x;
-@@ -2613,7 +2759,7 @@ evaluate_subexp_with_coercion (struct expression *exp,
+@@ -2643,7 +2750,7 @@ evaluate_subexp_with_coercion (struct expression *exp,
  {
    enum exp_opcode op;
    int pc;
@@ -17616,7 +7875,7 @@ index 1d35571..6a97e09 100644
    struct symbol *var;
    struct type *type;
  
-@@ -2624,12 +2770,17 @@ evaluate_subexp_with_coercion (struct expression *exp,
+@@ -2654,12 +2761,17 @@ evaluate_subexp_with_coercion (struct expression *exp,
      {
      case OP_VAR_VALUE:
        var = exp->elts[pc + 2].symbol;
@@ -17635,7 +7894,7 @@ index 1d35571..6a97e09 100644
          return value_cast (lookup_pointer_type (TYPE_TARGET_TYPE (type)),
                             val);
        }
-@@ -2681,9 +2832,13 @@ evaluate_subexp_for_sizeof (struct expression *exp, int *pos)
+@@ -2711,9 +2823,13 @@ evaluate_subexp_for_sizeof (struct expression *exp, int *pos)
  
      case OP_VAR_VALUE:
        (*pos) += 4;
@@ -17652,45 +7911,8 @@ index 1d35571..6a97e09 100644
  
      default:
        val = evaluate_subexp (NULL_TYPE, exp, pos, EVAL_AVOID_SIDE_EFFECTS);
-diff --git a/gdb/expprint.c b/gdb/expprint.c
-index 89bae03..f768940 100644
---- a/gdb/expprint.c
-+++ b/gdb/expprint.c
-@@ -186,8 +186,8 @@ print_subexp_standard (struct expression *exp, int *pos,
-          If necessary, we can temporarily set it to zero, or pass it as an
-          additional parameter to LA_PRINT_STRING.  -fnf */
-       get_user_print_options (&opts);
--      LA_PRINT_STRING (stream, &exp->elts[pc + 2].string, nargs, 1, 0,
--                       &opts);
-+      LA_PRINT_STRING (stream, builtin_type (exp->gdbarch)->builtin_char,
-+                       &exp->elts[pc + 2].string, nargs, 0, &opts);
-       }
-       return;
-@@ -205,8 +205,8 @@ print_subexp_standard (struct expression *exp, int *pos,
-       (*pos) += 3 + BYTES_TO_EXP_ELEM (nargs + 1);
-       fputs_filtered ("@\"", stream);
-       get_user_print_options (&opts);
--      LA_PRINT_STRING (stream, &exp->elts[pc + 2].string, nargs, 1, 0,
--                       &opts);
-+      LA_PRINT_STRING (stream, builtin_type (exp->gdbarch)->builtin_char,
-+                       &exp->elts[pc + 2].string, nargs, 0, &opts);
-       fputs_filtered ("\"", stream);
-       }
-       return;
-@@ -291,8 +291,8 @@ print_subexp_standard (struct expression *exp, int *pos,
-       {
-         struct value_print_options opts;
-         get_user_print_options (&opts);
--        LA_PRINT_STRING (stream, tempstr, nargs - 1, 1, 0,
--                         &opts);
-+        LA_PRINT_STRING (stream, builtin_type (exp->gdbarch)->builtin_char,
-+                         tempstr, nargs - 1, 0, &opts);
-         (*pos) = pc;
-       }
-       else
 diff --git a/gdb/expression.h b/gdb/expression.h
-index 12163e3..789cb89 100644
+index effe1f0..3e083ca 100644
 --- a/gdb/expression.h
 +++ b/gdb/expression.h
 @@ -88,6 +88,16 @@ enum exp_opcode
@@ -17710,26 +7932,17 @@ index 12163e3..789cb89 100644
      /* end of C++.  */
  
      /* For Modula-2 integer division DIV */
-@@ -426,6 +436,8 @@ enum noside
- extern struct value *evaluate_subexp_standard
-   (struct type *, struct expression *, int *, enum noside);
-+extern int compare_parameters (struct type *, struct type *);
-+
- /* From expprint.c */
- extern void print_expression (struct expression *, struct ui_file *);
-@@ -435,4 +447,5 @@ extern char *op_string (enum exp_opcode);
+@@ -438,4 +448,5 @@ extern char *op_string (enum exp_opcode);
  extern void dump_raw_expression (struct expression *, struct ui_file *, char *);
  extern void dump_prefix_expression (struct expression *, struct ui_file *);
  
 +
  #endif /* !defined (EXPRESSION_H) */
 diff --git a/gdb/f-exp.y b/gdb/f-exp.y
-index d91c413..c984e85 100644
+index c04c8f4..ddcd460 100644
 --- a/gdb/f-exp.y
 +++ b/gdb/f-exp.y
-@@ -198,6 +198,7 @@ static int parse_number (char *, int, int, YYSTYPE *);
+@@ -196,6 +196,7 @@ static int parse_number (char *, int, int, YYSTYPE *);
  /* Special type cases, put in to allow the parser to distinguish different
     legal basetypes.  */
  %token INT_KEYWORD INT_S2_KEYWORD LOGICAL_S1_KEYWORD LOGICAL_S2_KEYWORD 
@@ -17737,7 +7950,7 @@ index d91c413..c984e85 100644
  %token LOGICAL_KEYWORD REAL_KEYWORD REAL_S8_KEYWORD REAL_S16_KEYWORD 
  %token COMPLEX_S8_KEYWORD COMPLEX_S16_KEYWORD COMPLEX_S32_KEYWORD 
  %token BOOL_AND BOOL_OR BOOL_NOT   
-@@ -608,6 +609,8 @@ typebase  /* Implements (approximately): (type-qualifier)* type-specifier */
+@@ -606,6 +607,8 @@ typebase  /* Implements (approximately): (type-qualifier)* type-specifier */
                        { $$ = parse_f_type->builtin_integer_s2; }
        |       CHARACTER 
                        { $$ = parse_f_type->builtin_character; }
@@ -17746,7 +7959,7 @@ index d91c413..c984e85 100644
        |       LOGICAL_KEYWORD 
                        { $$ = parse_f_type->builtin_logical; }
        |       LOGICAL_S2_KEYWORD
-@@ -860,6 +863,7 @@ static const struct token f77_keywords[] =
+@@ -858,6 +861,7 @@ static const struct token f77_keywords[] =
    { "integer_2", INT_S2_KEYWORD, BINOP_END },
    { "logical_1", LOGICAL_S1_KEYWORD, BINOP_END },
    { "logical_2", LOGICAL_S2_KEYWORD, BINOP_END },
@@ -17755,10 +7968,19 @@ index d91c413..c984e85 100644
    { "integer", INT_KEYWORD, BINOP_END },
    { "logical", LOGICAL_KEYWORD, BINOP_END },
 diff --git a/gdb/f-lang.c b/gdb/f-lang.c
-index 6359841..1754c44 100644
+index 19c1316..4cc2a40 100644
 --- a/gdb/f-lang.c
 +++ b/gdb/f-lang.c
-@@ -55,23 +55,10 @@ typedef struct saved_bf_symnum SAVED_BF, *SAVED_BF_PTR;
+@@ -31,6 +31,8 @@
+ #include "f-lang.h"
+ #include "valprint.h"
+ #include "value.h"
++#include "block.h"
++#include "gdb_assert.h"
+ /* Following is dubious stuff that had been in the xcoff reader. */
+@@ -55,20 +57,6 @@ typedef struct saved_bf_symnum SAVED_BF, *SAVED_BF_PTR;
  /* Local functions */
  
  extern void _initialize_f_language (void);
@@ -17776,75 +7998,10 @@ index 6359841..1754c44 100644
 -static SAVED_F77_COMMON_PTR allocate_saved_f77_common_node (void);
 -static void patch_common_entries (SAVED_F77_COMMON_PTR, CORE_ADDR, int);
 -#endif
--
--static void f_printchar (int c, struct ui_file * stream);
--static void f_emit_char (int c, struct ui_file * stream, int quoter);
-+
-+static void f_printchar (int c, struct type *type, struct ui_file * stream);
-+static void f_emit_char (int c, struct type *type,
-+                       struct ui_file * stream, int quoter);
- /* Print the character C on STREAM as part of the contents of a literal
-    string whose delimiter is QUOTER.  Note that that format for printing
-@@ -80,7 +67,7 @@ static void f_emit_char (int c, struct ui_file * stream, int quoter);
-    be replaced with a true F77 version.  */
  
- static void
--f_emit_char (int c, struct ui_file *stream, int quoter)
-+f_emit_char (int c, struct type *type, struct ui_file *stream, int quoter)
- {
-   c &= 0xFF;                  /* Avoid sign bit follies */
-@@ -126,10 +113,10 @@ f_emit_char (int c, struct ui_file *stream, int quoter)
-    be replaced with a true F77version. */
- static void
--f_printchar (int c, struct ui_file *stream)
-+f_printchar (int c, struct type *type, struct ui_file *stream)
- {
-   fputs_filtered ("'", stream);
--  LA_EMIT_CHAR (c, stream, '\'');
-+  LA_EMIT_CHAR (c, type, stream, '\'');
-   fputs_filtered ("'", stream);
- }
-@@ -141,14 +128,15 @@ f_printchar (int c, struct ui_file *stream)
-    be replaced with a true F77 version. */
- static void
--f_printstr (struct ui_file *stream, const gdb_byte *string,
--          unsigned int length, int width, int force_ellipses,
-+f_printstr (struct ui_file *stream, struct type *type, const gdb_byte *string,
-+          unsigned int length, int force_ellipses,
-           const struct value_print_options *options)
- {
-   unsigned int i;
-   unsigned int things_printed = 0;
-   int in_quotes = 0;
-   int need_comma = 0;
-+  int width = TYPE_LENGTH (type);
-   if (length == 0)
-     {
-@@ -190,7 +178,7 @@ f_printstr (struct ui_file *stream, const gdb_byte *string,
-               fputs_filtered ("', ", stream);
-             in_quotes = 0;
-           }
--        f_printchar (string[i], stream);
-+        f_printchar (string[i], type, stream);
-         fprintf_filtered (stream, " <repeats %u times>", reps);
-         i = rep1 - 1;
-         things_printed += options->repeat_count_threshold;
-@@ -206,7 +194,7 @@ f_printstr (struct ui_file *stream, const gdb_byte *string,
-               fputs_filtered ("'", stream);
-             in_quotes = 1;
-           }
--        LA_EMIT_CHAR (string[i], stream, '"');
-+        LA_EMIT_CHAR (string[i], type, stream, '"');
-         ++things_printed;
-       }
-     }
-@@ -257,6 +245,7 @@ enum f_primitive_types {
+ static void f_printchar (int c, struct type *type, struct ui_file * stream);
+ static void f_emit_char (int c, struct type *type,
+@@ -259,6 +247,7 @@ enum f_primitive_types {
    f_primitive_type_logical,
    f_primitive_type_logical_s1,
    f_primitive_type_logical_s2,
@@ -17852,7 +8009,7 @@ index 6359841..1754c44 100644
    f_primitive_type_integer,
    f_primitive_type_integer_s2,
    f_primitive_type_real,
-@@ -287,6 +276,8 @@ f_language_arch_info (struct gdbarch *gdbarch,
+@@ -289,6 +278,8 @@ f_language_arch_info (struct gdbarch *gdbarch,
      = builtin->builtin_logical_s1;
    lai->primitive_type_vector [f_primitive_type_logical_s2]
      = builtin->builtin_logical_s2;
@@ -17861,19 +8018,74 @@ index 6359841..1754c44 100644
    lai->primitive_type_vector [f_primitive_type_real]
      = builtin->builtin_real;
    lai->primitive_type_vector [f_primitive_type_real_s8]
-@@ -378,6 +369,11 @@ build_fortran_types (struct gdbarch *gdbarch)
-              gdbarch_short_bit (gdbarch) / TARGET_CHAR_BIT,
-              TYPE_FLAG_UNSIGNED, "logical*2", (struct objfile *) NULL);
+@@ -306,6 +297,46 @@ f_language_arch_info (struct gdbarch *gdbarch,
+   lai->bool_type_default = builtin->builtin_logical_s2;
+ }
  
-+  builtin_f_type->builtin_logical_s8 =
-+    init_type (TYPE_CODE_BOOL,
-+             gdbarch_long_long_bit (gdbarch) / TARGET_CHAR_BIT,
-+             TYPE_FLAG_UNSIGNED, "logical*8", (struct objfile *) NULL);
++/* Find if NAME is not contained in any of the Fortran modules imported by the
++   Fortran USE statement.
++
++   As Fortran has no nested blocks such lookup can be processed from
++   lookup_symbol_nonlocal - when no local blocks could satisfy the lookup.  */
++
++static struct symbol *
++f_lookup_symbol_nonlocal (const char *name,
++                        const struct block *block,
++                        const domain_enum domain)
++{
++  struct fortran_using *use;
++
++  if (!block)
++    return NULL;
++
++  for (use = BLOCK_FORTRAN_USE (block); use; use = use->next)
++    {
++      struct symbol *sym;
++      struct type *type;
++      struct symbol *retval;
++
++      sym = lookup_symbol_global (use->module_name, block, MODULE_DOMAIN);
++
++      /* Module name lookup should not fail with correct debug info.  */
++      if (sym == NULL)
++      continue;
++
++      type = SYMBOL_TYPE (sym);
++      gdb_assert (TYPE_CODE (type) == TYPE_CODE_MODULE);
++      gdb_assert (TYPE_MODULE_BLOCK (type) != NULL);
 +
-   builtin_f_type->builtin_integer =
-     init_type (TYPE_CODE_INT, 
-              gdbarch_int_bit (gdbarch) / TARGET_CHAR_BIT,
-@@ -451,395 +447,3 @@ _initialize_f_language (void)
++      retval = lookup_block_symbol (TYPE_MODULE_BLOCK (type), name, domain);
++      if (retval)
++      return retval;
++    }
++
++  return NULL;
++}
++
+ /* This is declared in c-lang.h but it is silly to import that file for what
+    is already just a hack. */
+ extern int c_value_print (struct value *, struct ui_file *,
+@@ -333,7 +364,7 @@ const struct language_defn f_language_defn =
+   c_value_print,              /* FIXME */
+   NULL,                               /* Language specific skip_trampoline */
+   NULL,                       /* name_of_this */
+-  basic_lookup_symbol_nonlocal,       /* lookup_symbol_nonlocal */
++  f_lookup_symbol_nonlocal,   /* lookup_symbol_nonlocal */
+   basic_lookup_transparent_type,/* lookup_transparent_type */
+   NULL,                               /* Language specific symbol demangler */
+   NULL,                               /* Language specific class_name_from_physname */
+@@ -372,6 +403,10 @@ build_fortran_types (struct gdbarch *gdbarch)
+     = arch_boolean_type (gdbarch, gdbarch_short_bit (gdbarch), 1,
+                        "logical*2");
++  builtin_f_type->builtin_logical_s8
++    = arch_boolean_type (gdbarch, gdbarch_long_long_bit (gdbarch), 1,
++                       "logical*8");
++
+   builtin_f_type->builtin_integer
+     = arch_integer_type (gdbarch, gdbarch_int_bit (gdbarch), 0,
+                        "integer");
+@@ -418,395 +453,3 @@ _initialize_f_language (void)
  
    add_language (&f_language_defn);
  }
@@ -18270,7 +8482,7 @@ index 6359841..1754c44 100644
 -}
 -#endif
 diff --git a/gdb/f-lang.h b/gdb/f-lang.h
-index 711bdba..cd2f804 100644
+index 711bdba..9d7d92b 100644
 --- a/gdb/f-lang.h
 +++ b/gdb/f-lang.h
 @@ -28,6 +28,10 @@ extern void f_error (char *);       /* Defined in f-exp.y */
@@ -18334,6 +8546,17 @@ index 711bdba..cd2f804 100644
    struct type *builtin_real;
    struct type *builtin_real_s8;
    struct type *builtin_real_s16;
+@@ -125,3 +97,10 @@ struct builtin_f_type
+ /* Return the Fortran type table for the specified architecture.  */
+ extern const struct builtin_f_type *builtin_f_type (struct gdbarch *gdbarch);
++/* List of module names being imported by a block though BLOCK_FORTRAN_USE.  */
++
++struct fortran_using
++  {
++    struct fortran_using *next;
++    char module_name[1];
++  };
 diff --git a/gdb/f-typeprint.c b/gdb/f-typeprint.c
 index 6c9668f..852b9a8 100644
 --- a/gdb/f-typeprint.c
@@ -18403,7 +8626,7 @@ index 6c9668f..852b9a8 100644
      {
      case TYPE_CODE_ARRAY:
 diff --git a/gdb/f-valprint.c b/gdb/f-valprint.c
-index 5721041..2cff7bc 100644
+index 0a57404..a9ccc77 100644
 --- a/gdb/f-valprint.c
 +++ b/gdb/f-valprint.c
 @@ -34,10 +34,8 @@
@@ -18543,7 +8766,7 @@ index 5721041..2cff7bc 100644
            fprintf_filtered (stream, "...");
        }
      }
-@@ -251,12 +259,16 @@ f_val_print (struct type *type, const gdb_byte *valaddr, int embedded_offset,
+@@ -253,6 +261,9 @@ f_val_print (struct type *type, const gdb_byte *valaddr, int embedded_offset,
    CORE_ADDR addr;
    int index;
  
@@ -18553,33 +8776,7 @@ index 5721041..2cff7bc 100644
    CHECK_TYPEDEF (type);
    switch (TYPE_CODE (type))
      {
-     case TYPE_CODE_STRING:
-       f77_get_dynamic_length_of_aggregate (type);
--      LA_PRINT_STRING (stream, valaddr, TYPE_LENGTH (type), 1, 0, options);
-+      LA_PRINT_STRING (stream, builtin_type (current_gdbarch)->builtin_char,
-+                     valaddr, TYPE_LENGTH (type), 0, options);
-       break;
-     case TYPE_CODE_ARRAY:
-@@ -293,7 +305,7 @@ f_val_print (struct type *type, const gdb_byte *valaddr, int embedded_offset,
-             && TYPE_CODE (elttype) == TYPE_CODE_INT
-             && (options->format == 0 || options->format == 's')
-             && addr != 0)
--          i = val_print_string (addr, -1, TYPE_LENGTH (elttype), stream,
-+          i = val_print_string (TYPE_TARGET_TYPE (type), addr, -1, stream,
-                                 options);
-         /* Return number of characters printed, including the terminating
-@@ -365,7 +377,7 @@ f_val_print (struct type *type, const gdb_byte *valaddr, int embedded_offset,
-           {
-             fputs_filtered (" ", stream);
-             LA_PRINT_CHAR ((unsigned char) unpack_long (type, valaddr),
--                           stream);
-+                           type, stream);
-           }
-       }
-       break;
-@@ -464,22 +476,54 @@ f_val_print (struct type *type, const gdb_byte *valaddr, int embedded_offset,
+@@ -467,22 +478,54 @@ f_val_print (struct type *type, const gdb_byte *valaddr, int embedded_offset,
    return 0;
  }
  
@@ -18649,7 +8846,7 @@ index 5721041..2cff7bc 100644
  }
  
  /* This function is used to print out the values in a given COMMON 
-@@ -489,11 +533,9 @@ list_all_visible_commons (char *funname)
+@@ -492,11 +535,9 @@ list_all_visible_commons (char *funname)
  static void
  info_common_command (char *comname, int from_tty)
  {
@@ -18663,7 +8860,7 @@ index 5721041..2cff7bc 100644
  
    /* We have been told to display the contents of F77 COMMON 
       block supposedly visible in this function.  Let us 
-@@ -505,136 +547,32 @@ info_common_command (char *comname, int from_tty)
+@@ -508,136 +549,32 @@ info_common_command (char *comname, int from_tty)
    /* The following is generally ripped off from stack.c's routine 
       print_frame_info() */
  
@@ -18816,10 +9013,10 @@ index 5721041..2cff7bc 100644
  void
  _initialize_f_valprint (void)
 diff --git a/gdb/findcmd.c b/gdb/findcmd.c
-index 7ae43e5..2894948 100644
+index 1d28914..d176341 100644
 --- a/gdb/findcmd.c
 +++ b/gdb/findcmd.c
-@@ -26,7 +26,7 @@
+@@ -27,7 +27,7 @@
  
  /* Copied from bfd_put_bits.  */
  
@@ -18828,7 +9025,7 @@ index 7ae43e5..2894948 100644
  put_bits (bfd_uint64_t data, char *buf, int bits, bfd_boolean big_p)
  {
    int i;
-@@ -44,6 +44,41 @@ put_bits (bfd_uint64_t data, char *buf, int bits, bfd_boolean big_p)
+@@ -45,6 +45,41 @@ put_bits (bfd_uint64_t data, char *buf, int bits, bfd_boolean big_p)
      }
  }
  
@@ -18870,7 +9067,7 @@ index 7ae43e5..2894948 100644
  /* Subroutine of find_command to simplify it.
     Parse the arguments of the "find" command.  */
  
-@@ -59,8 +94,7 @@ parse_find_args (char *args, ULONGEST *max_countp,
+@@ -61,8 +96,7 @@ parse_find_args (char *args, ULONGEST *max_countp,
    char *pattern_buf;
    /* Current size of search pattern buffer.
       We realloc space as needed.  */
@@ -18880,7 +9077,7 @@ index 7ae43e5..2894948 100644
    /* Pointer to one past the last in-use part of pattern_buf.  */
    char *pattern_buf_end;
    ULONGEST pattern_len;
-@@ -74,8 +108,7 @@ parse_find_args (char *args, ULONGEST *max_countp,
+@@ -75,8 +109,7 @@ parse_find_args (char *args, ULONGEST *max_countp,
    if (args == NULL)
      error (_("Missing search parameters."));
  
@@ -18890,7 +9087,7 @@ index 7ae43e5..2894948 100644
    old_cleanups = make_cleanup (free_current_contents, &pattern_buf);
  
    /* Get search granularity and/or max count if specified.
-@@ -172,16 +205,8 @@ parse_find_args (char *args, ULONGEST *max_countp,
+@@ -173,16 +206,8 @@ parse_find_args (char *args, ULONGEST *max_countp,
        v = parse_to_comma_and_eval (&s);
        val_bytes = TYPE_LENGTH (value_type (v));
  
@@ -18909,7 +9106,7 @@ index 7ae43e5..2894948 100644
  
        if (size != '\0')
        {
-@@ -236,6 +261,45 @@ parse_find_args (char *args, ULONGEST *max_countp,
+@@ -237,6 +262,45 @@ parse_find_args (char *args, ULONGEST *max_countp,
    discard_cleanups (old_cleanups);
  }
  
@@ -18955,7 +9152,7 @@ index 7ae43e5..2894948 100644
  static void
  find_command (char *args, int from_tty)
  {
-@@ -264,12 +328,11 @@ find_command (char *args, int from_tty)
+@@ -267,12 +331,11 @@ find_command (char *args, int from_tty)
    while (search_space_len >= pattern_len
         && found_count < max_count)
      {
@@ -18971,7 +9168,7 @@ index 7ae43e5..2894948 100644
        if (found <= 0)
        break;
  
-@@ -277,16 +340,6 @@ find_command (char *args, int from_tty)
+@@ -280,16 +343,6 @@ find_command (char *args, int from_tty)
        printf_filtered ("\n");
        ++found_count;
        last_found_addr = found_addr;
@@ -18989,7 +9186,7 @@ index 7ae43e5..2894948 100644
  
    /* Record and print the results.  */
 diff --git a/gdb/findvar.c b/gdb/findvar.c
-index 1048887..b958ec6 100644
+index 8c027c9..d201f76 100644
 --- a/gdb/findvar.c
 +++ b/gdb/findvar.c
 @@ -35,6 +35,7 @@
@@ -19000,16 +9197,7 @@ index 1048887..b958ec6 100644
  
  /* Basic byte-swapping routines.  GDB has needed these for a long time...
     All extract a target-format integer at ADDR which is LEN bytes long.  */
-@@ -275,7 +276,7 @@ value_of_register (int regnum, struct frame_info *frame)
-   memcpy (value_contents_raw (reg_val), raw_buffer,
-         register_size (gdbarch, regnum));
-   VALUE_LVAL (reg_val) = lval;
--  VALUE_ADDRESS (reg_val) = addr;
-+  set_value_address (reg_val, addr);
-   VALUE_REGNUM (reg_val) = regnum;
-   set_value_optimized_out (reg_val, optim);
-   VALUE_FRAME_ID (reg_val) = get_frame_id (frame);
-@@ -382,27 +383,16 @@ symbol_read_needs_frame (struct symbol *sym)
+@@ -394,27 +395,16 @@ symbol_read_needs_frame (struct symbol *sym)
  /* Given a struct symbol for a variable,
     and a stack frame id, read the value of the variable
     and return a (pointer to a) struct value containing the value. 
@@ -19041,12 +9229,13 @@ index 1048887..b958ec6 100644
  
    if (symbol_read_needs_frame (var))
      gdb_assert (frame);
-@@ -410,31 +400,39 @@ read_var_value (struct symbol *var, struct frame_info *frame)
+@@ -422,32 +412,40 @@ read_var_value (struct symbol *var, struct frame_info *frame)
    switch (SYMBOL_CLASS (var))
      {
      case LOC_CONST:
 -      /* Put the constant back in target format.  */
 -      store_signed_integer (value_contents_raw (v), len,
+-                          gdbarch_byte_order (get_type_arch (type)),
 -                          (LONGEST) SYMBOL_VALUE (var));
 -      VALUE_LVAL (v) = not_lval;
 -      return v;
@@ -19055,6 +9244,7 @@ index 1048887..b958ec6 100644
 +      struct value *v = allocate_value (type);
 +      VALUE_LVAL (v) = not_lval;
 +      store_signed_integer (value_contents_raw (v), TYPE_LENGTH (type),
++                            gdbarch_byte_order (get_type_arch (type)),
 +                            (LONGEST) SYMBOL_VALUE (var));
 +      return v;
 +      }
@@ -19100,15 +9290,15 @@ index 1048887..b958ec6 100644
        return v;
        }
  
-@@ -476,12 +474,23 @@ read_var_value (struct symbol *var, struct frame_info *frame)
+@@ -489,12 +487,23 @@ read_var_value (struct symbol *var, struct frame_info *frame)
        break;
  
      case LOC_BLOCK:
 -      if (overlay_debugging)
--      VALUE_ADDRESS (v) = symbol_overlayed_address
--        (BLOCK_START (SYMBOL_BLOCK_VALUE (var)), SYMBOL_OBJ_SECTION (var));
+-      set_value_address (v, symbol_overlayed_address
+-        (BLOCK_START (SYMBOL_BLOCK_VALUE (var)), SYMBOL_OBJ_SECTION (var)));
 -      else
--      VALUE_ADDRESS (v) = BLOCK_START (SYMBOL_BLOCK_VALUE (var));
+-      set_value_address (v, BLOCK_START (SYMBOL_BLOCK_VALUE (var)));
 -      return v;
 +      {
 +        CORE_ADDR addr;
@@ -19123,14 +9313,14 @@ index 1048887..b958ec6 100644
 +         DW_OP_push_object_address.  */
 +      object_address_set (addr);
 +      v = allocate_value (type);
-+      VALUE_ADDRESS (v) = addr;
 +      VALUE_LVAL (v) = lval_memory;
++      set_value_address (v, addr);
 +      return v;
 +      }
  
      case LOC_REGISTER:
      case LOC_REGPARM_ADDR:
-@@ -499,7 +508,6 @@ read_var_value (struct symbol *var, struct frame_info *frame)
+@@ -513,7 +522,6 @@ read_var_value (struct symbol *var, struct frame_info *frame)
              error (_("Value of register variable not available."));
  
            addr = value_as_address (regval);
@@ -19138,7 +9328,7 @@ index 1048887..b958ec6 100644
          }
        else
          {
-@@ -542,18 +550,33 @@ read_var_value (struct symbol *var, struct frame_info *frame)
+@@ -556,18 +564,33 @@ read_var_value (struct symbol *var, struct frame_info *frame)
        break;
  
      case LOC_OPTIMIZED_OUT:
@@ -19158,7 +9348,7 @@ index 1048887..b958ec6 100644
        break;
      }
  
--  VALUE_ADDRESS (v) = addr;
+-  set_value_address (v, addr);
 -  set_value_lazy (v, 1);
 -  return v;
 +  {
@@ -19168,8 +9358,8 @@ index 1048887..b958ec6 100644
 +       DW_OP_PUSH_OBJECT_ADDRESS.  */
 +    object_address_set (addr);
 +    v = allocate_value (type);
-+    VALUE_ADDRESS (v) = addr;
 +    VALUE_LVAL (v) = lval_memory;
++    set_value_address (v, addr);
 +
 +    set_value_lazy (v, 1);
 +
@@ -19178,7 +9368,7 @@ index 1048887..b958ec6 100644
  }
  
  /* Install default attributes for register values.  */
-@@ -590,10 +613,11 @@ struct value *
+@@ -604,10 +627,11 @@ struct value *
  value_from_register (struct type *type, int regnum, struct frame_info *frame)
  {
    struct gdbarch *gdbarch = get_frame_arch (frame);
@@ -19192,7 +9382,7 @@ index 1048887..b958ec6 100644
      {
        /* The ISA/ABI need to something weird when obtaining the
           specified value from this register.  It might need to
-@@ -607,7 +631,7 @@ value_from_register (struct type *type, int regnum, struct frame_info *frame)
+@@ -621,7 +645,7 @@ value_from_register (struct type *type, int regnum, struct frame_info *frame)
        VALUE_FRAME_ID (v) = get_frame_id (frame);
        VALUE_REGNUM (v) = regnum;
        gdbarch_register_to_value (gdbarch,
@@ -19202,438 +9392,493 @@ index 1048887..b958ec6 100644
    else
      {
 diff --git a/gdb/frame.c b/gdb/frame.c
-index dfd6b3d..2ea37c3 100644
+index 7932b48..4e7c434 100644
 --- a/gdb/frame.c
 +++ b/gdb/frame.c
-@@ -596,7 +596,7 @@ frame_register_unwind (struct frame_info *frame, int regnum,
-   *optimizedp = value_optimized_out (value);
-   *lvalp = VALUE_LVAL (value);
--  *addrp = VALUE_ADDRESS (value);
-+  *addrp = value_address (value);
-   *realnump = VALUE_REGNUM (value);
-   if (bufferp)
-@@ -682,7 +682,7 @@ frame_unwind_register_value (struct frame_info *frame, int regnum)
-                               VALUE_REGNUM (value));
-         else if (VALUE_LVAL (value) == lval_memory)
-           fprintf_unfiltered (gdb_stdlog, " address=0x%s",
--                              paddr_nz (VALUE_ADDRESS (value)));
-+                              paddr_nz (value_address (value)));
-         else
-           fprintf_unfiltered (gdb_stdlog, " computed");
+@@ -1171,6 +1171,14 @@ has_stack_frames (void)
+   if (ptid_equal (inferior_ptid, null_ptid))
+     return 0;
  
-diff --git a/gdb/frv-tdep.c b/gdb/frv-tdep.c
-index ff387db..452f70c 100644
---- a/gdb/frv-tdep.c
-+++ b/gdb/frv-tdep.c
-@@ -1230,7 +1230,7 @@ frv_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
++  /* FIXME: Workaround archer-tromey-python crash in
++     add_inferior_object->get_current_arch on FSF GDB update:
++     is_thread_state would assertion check here as
++     remote_start_remote->add_inferior_silent->observer_notify_new_inferior is
++     before remote_start_remote->add_thread_silent.  */
++  if (find_thread_ptid (inferior_ptid) == NULL)
++    return 0;
++
+   /* Don't try to read from a dead thread.  */
+   if (is_exited (inferior_ptid))
+     return 0;
+diff --git a/gdb/gdbinit.in b/gdb/gdbinit.in
+index ffb7f53..a2e7e94 100644
+--- a/gdb/gdbinit.in
++++ b/gdb/gdbinit.in
+@@ -1,5 +1,15 @@
+ echo Setting up the environment for debugging gdb.\n
  
-       if (typecode == TYPE_CODE_STRUCT || typecode == TYPE_CODE_UNION)
-       {
--        store_unsigned_integer (valbuf, 4, VALUE_ADDRESS (arg));
-+        store_unsigned_integer (valbuf, 4, value_address (arg));
-         typecode = TYPE_CODE_PTR;
-         len = 4;
-         val = valbuf;
-diff --git a/gdb/gdb_locale.h b/gdb/gdb_locale.h
-index e8ba0ea..4fa4d3d 100644
---- a/gdb/gdb_locale.h
-+++ b/gdb/gdb_locale.h
-@@ -41,4 +41,8 @@
- # define N_(String) (String)
- #endif
++# Set up the Python library and "require" command.
++python
++from os.path import abspath
++gdb.datadir = abspath ('@srcdir@/python/lib')
++gdb.pythonlibdir = gdb.datadir
++gdb.__path__ = [gdb.datadir + '/gdb']
++sys.path.insert(0, gdb.datadir)
++end
++source @srcdir@/python/lib/gdb/__init__.py
++
+ set complaints 1
  
-+#ifdef HAVE_LANGINFO_CODESET
-+#include <langinfo.h>
+ b internal_error
+diff --git a/gdb/gdbserver/linux-i386-low.c b/gdb/gdbserver/linux-i386-low.c
+new file mode 100644
+index 0000000..b95c1b1
+--- /dev/null
++++ b/gdb/gdbserver/linux-i386-low.c
+@@ -0,0 +1,210 @@
++/* GNU/Linux/i386 specific low level interface, for the remote server for GDB.
++   Copyright (C) 1995, 1996, 1998, 1999, 2000, 2001, 2002, 2004, 2005, 2006,
++   2007, 2008, 2009 Free Software Foundation, Inc.
++
++   This file is part of GDB.
++
++   This program is free software; you can redistribute it and/or modify
++   it under the terms of the GNU General Public License as published by
++   the Free Software Foundation; either version 3 of the License, or
++   (at your option) any later version.
++
++   This program is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++   GNU General Public License for more details.
++
++   You should have received a copy of the GNU General Public License
++   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
++
++#include "server.h"
++#include "linux-low.h"
++#include "i387-fp.h"
++
++#include "gdb_proc_service.h"
++
++#include <sys/ptrace.h>
++
++#ifdef HAVE_SYS_REG_H
++#include <sys/reg.h>
 +#endif
 +
- #endif /* GDB_LOCALE_H */
-diff --git a/gdb/gdb_obstack.h b/gdb/gdb_obstack.h
-index 48f49cd..cd1a1d7 100644
---- a/gdb/gdb_obstack.h
-+++ b/gdb/gdb_obstack.h
-@@ -45,4 +45,7 @@
- #define obstack_grow_str0(OBSTACK,STRING) \
-   obstack_grow0 (OBSTACK, STRING, strlen (STRING))
-+#define obstack_grow_wstr(OBSTACK, WSTRING) \
-+  obstack_grow (OBSTACK, WSTRING, sizeof (wchar_t) * wcslen (WSTRING))
++#ifndef PTRACE_GET_THREAD_AREA
++#define PTRACE_GET_THREAD_AREA 25
++#endif
 +
- #endif
-diff --git a/gdb/gdbarch.c b/gdb/gdbarch.c
-index 3273b34..d6c737b 100644
---- a/gdb/gdbarch.c
-+++ b/gdb/gdbarch.c
-@@ -243,6 +243,11 @@ struct gdbarch
-   gdbarch_target_signal_to_host_ftype *target_signal_to_host;
-   gdbarch_get_siginfo_type_ftype *get_siginfo_type;
-   gdbarch_record_special_symbol_ftype *record_special_symbol;
-+  gdbarch_get_syscall_number_ftype *get_syscall_number;
-+  gdbarch_get_syscall_by_number_ftype *get_syscall_by_number;
-+  gdbarch_get_syscall_by_name_ftype *get_syscall_by_name;
-+  gdbarch_get_syscall_names_ftype *get_syscall_names;
-+  const char * xml_syscall_filename;
-   int has_global_solist;
- };
-@@ -378,6 +383,11 @@ struct gdbarch startup_gdbarch =
-   default_target_signal_to_host,  /* target_signal_to_host */
-   0,  /* get_siginfo_type */
-   0,  /* record_special_symbol */
-+  0,  /* get_syscall_number */
-+  0,  /* get_syscall_by_number */
-+  0,  /* get_syscall_by_name */
-+  0,  /* get_syscall_names */
-+  0,  /* xml_syscall_filename */
-   0,  /* has_global_solist */
-   /* startup_gdbarch() */
- };
-@@ -634,6 +644,11 @@ verify_gdbarch (struct gdbarch *gdbarch)
-   /* Skip verify of target_signal_to_host, invalid_p == 0 */
-   /* Skip verify of get_siginfo_type, has predicate */
-   /* Skip verify of record_special_symbol, has predicate */
-+  /* Skip verify of get_syscall_number, has predicate */
-+  /* Skip verify of get_syscall_by_number, has predicate */
-+  /* Skip verify of get_syscall_by_name, has predicate */
-+  /* Skip verify of get_syscall_names, has predicate */
-+  /* Skip verify of xml_syscall_filename, invalid_p == 0 */
-   /* Skip verify of has_global_solist, invalid_p == 0 */
-   buf = ui_file_xstrdup (log, &dummy);
-   make_cleanup (xfree, buf);
-@@ -859,6 +874,30 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
-                       "gdbarch_dump: get_siginfo_type = <%s>\n",
-                       host_address_to_string (gdbarch->get_siginfo_type));
-   fprintf_unfiltered (file,
-+                      "gdbarch_dump: gdbarch_get_syscall_by_name_p() = %d\n",
-+                      gdbarch_get_syscall_by_name_p (gdbarch));
-+  fprintf_unfiltered (file,
-+                      "gdbarch_dump: get_syscall_by_name = <%s>\n",
-+                      host_address_to_string (gdbarch->get_syscall_by_name));
-+  fprintf_unfiltered (file,
-+                      "gdbarch_dump: gdbarch_get_syscall_by_number_p() = %d\n",
-+                      gdbarch_get_syscall_by_number_p (gdbarch));
-+  fprintf_unfiltered (file,
-+                      "gdbarch_dump: get_syscall_by_number = <%s>\n",
-+                      host_address_to_string (gdbarch->get_syscall_by_number));
-+  fprintf_unfiltered (file,
-+                      "gdbarch_dump: gdbarch_get_syscall_names_p() = %d\n",
-+                      gdbarch_get_syscall_names_p (gdbarch));
-+  fprintf_unfiltered (file,
-+                      "gdbarch_dump: get_syscall_names = <%s>\n",
-+                      host_address_to_string (gdbarch->get_syscall_names));
-+  fprintf_unfiltered (file,
-+                      "gdbarch_dump: gdbarch_get_syscall_number_p() = %d\n",
-+                      gdbarch_get_syscall_number_p (gdbarch));
-+  fprintf_unfiltered (file,
-+                      "gdbarch_dump: get_syscall_number = <%s>\n",
-+                      host_address_to_string (gdbarch->get_syscall_number));
-+  fprintf_unfiltered (file,
-                       "gdbarch_dump: has_global_solist = %s\n",
-                       plongest (gdbarch->has_global_solist));
-   fprintf_unfiltered (file,
-@@ -1122,6 +1161,9 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
-   fprintf_unfiltered (file,
-                       "gdbarch_dump: write_pc = <%s>\n",
-                       host_address_to_string (gdbarch->write_pc));
-+  fprintf_unfiltered (file,
-+                      "gdbarch_dump: xml_syscall_filename = %s\n",
-+                      gdbarch->xml_syscall_filename);
-   if (gdbarch->dump_tdep != NULL)
-     gdbarch->dump_tdep (gdbarch, file);
- }
-@@ -3333,6 +3375,119 @@ set_gdbarch_record_special_symbol (struct gdbarch *gdbarch,
- }
- int
-+gdbarch_get_syscall_number_p (struct gdbarch *gdbarch)
-+{
-+  gdb_assert (gdbarch != NULL);
-+  return gdbarch->get_syscall_number != NULL;
-+}
++/* Defined in auto-generated file reg-i386-linux.c.  */
++void init_registers_i386_linux (void);
 +
-+LONGEST
-+gdbarch_get_syscall_number (struct gdbarch *gdbarch, ptid_t ptid)
-+{
-+  gdb_assert (gdbarch != NULL);
-+  gdb_assert (gdbarch->get_syscall_number != NULL);
-+  if (gdbarch_debug >= 2)
-+    fprintf_unfiltered (gdb_stdlog, "gdbarch_get_syscall_number called\n");
-+  return gdbarch->get_syscall_number (gdbarch, ptid);
-+}
 +
-+void
-+set_gdbarch_get_syscall_number (struct gdbarch *gdbarch,
-+                                gdbarch_get_syscall_number_ftype get_syscall_number)
++/* This module only supports access to the general purpose registers.  */
++
++#define i386_num_regs 16
++
++/* This stuff comes from i386-linux-nat.c.  */
++
++/* Mapping between the general-purpose registers in `struct user'
++   format and GDB's register array layout.  */
++static int i386_regmap[] = 
 +{
-+  gdbarch->get_syscall_number = get_syscall_number;
-+}
++  EAX * 4, ECX * 4, EDX * 4, EBX * 4,
++  UESP * 4, EBP * 4, ESI * 4, EDI * 4,
++  EIP * 4, EFL * 4, CS * 4, SS * 4,
++  DS * 4, ES * 4, FS * 4, GS * 4
++};
 +
-+int
-+gdbarch_get_syscall_by_number_p (struct gdbarch *gdbarch)
++/* Called by libthread_db.  */
++
++ps_err_e
++ps_get_thread_area (const struct ps_prochandle *ph, 
++                  lwpid_t lwpid, int idx, void **base)
 +{
-+  gdb_assert (gdbarch != NULL);
-+  return gdbarch->get_syscall_by_number != NULL;
++  unsigned int desc[4];
++
++  if (ptrace (PTRACE_GET_THREAD_AREA, lwpid,
++            (void *) idx, (unsigned long) &desc) < 0)
++    return PS_ERR;
++
++  *(int *)base = desc[1];
++  return PS_OK;
 +}
 +
-+void
-+gdbarch_get_syscall_by_number (struct gdbarch *gdbarch, int syscall_number, struct syscall *s)
++static int
++i386_cannot_store_register (int regno)
 +{
-+  gdb_assert (gdbarch != NULL);
-+  gdb_assert (gdbarch->get_syscall_by_number != NULL);
-+  if (gdbarch_debug >= 2)
-+    fprintf_unfiltered (gdb_stdlog, "gdbarch_get_syscall_by_number called\n");
-+  gdbarch->get_syscall_by_number (gdbarch, syscall_number, s);
++  return (regno >= i386_num_regs);
 +}
 +
-+void
-+set_gdbarch_get_syscall_by_number (struct gdbarch *gdbarch,
-+                                   gdbarch_get_syscall_by_number_ftype get_syscall_by_number)
++static int
++i386_cannot_fetch_register (int regno)
 +{
-+  gdbarch->get_syscall_by_number = get_syscall_by_number;
++  return (regno >= i386_num_regs);
 +}
 +
-+int
-+gdbarch_get_syscall_by_name_p (struct gdbarch *gdbarch)
++
++#ifdef HAVE_PTRACE_GETREGS
++#include <sys/procfs.h>
++#include <sys/ptrace.h>
++
++static void
++i386_fill_gregset (void *buf)
 +{
-+  gdb_assert (gdbarch != NULL);
-+  return gdbarch->get_syscall_by_name != NULL;
++  int i;
++
++  for (i = 0; i < i386_num_regs; i++)
++    collect_register (i, ((char *) buf) + i386_regmap[i]);
++
++  collect_register_by_name ("orig_eax", ((char *) buf) + ORIG_EAX * 4);
 +}
 +
-+void
-+gdbarch_get_syscall_by_name (struct gdbarch *gdbarch, const char *syscall_name, struct syscall *s)
++static void
++i386_store_gregset (const void *buf)
 +{
-+  gdb_assert (gdbarch != NULL);
-+  gdb_assert (gdbarch->get_syscall_by_name != NULL);
-+  if (gdbarch_debug >= 2)
-+    fprintf_unfiltered (gdb_stdlog, "gdbarch_get_syscall_by_name called\n");
-+  gdbarch->get_syscall_by_name (gdbarch, syscall_name, s);
++  int i;
++
++  for (i = 0; i < i386_num_regs; i++)
++    supply_register (i, ((char *) buf) + i386_regmap[i]);
++
++  supply_register_by_name ("orig_eax", ((char *) buf) + ORIG_EAX * 4);
 +}
 +
-+void
-+set_gdbarch_get_syscall_by_name (struct gdbarch *gdbarch,
-+                                 gdbarch_get_syscall_by_name_ftype get_syscall_by_name)
++static void
++i386_fill_fpregset (void *buf)
 +{
-+  gdbarch->get_syscall_by_name = get_syscall_by_name;
++  i387_cache_to_fsave (buf);
 +}
 +
-+int
-+gdbarch_get_syscall_names_p (struct gdbarch *gdbarch)
++static void
++i386_store_fpregset (const void *buf)
 +{
-+  gdb_assert (gdbarch != NULL);
-+  return gdbarch->get_syscall_names != NULL;
++  i387_fsave_to_cache (buf);
 +}
 +
-+const char **
-+gdbarch_get_syscall_names (struct gdbarch *gdbarch)
++static void
++i386_fill_fpxregset (void *buf)
 +{
-+  gdb_assert (gdbarch != NULL);
-+  gdb_assert (gdbarch->get_syscall_names != NULL);
-+  if (gdbarch_debug >= 2)
-+    fprintf_unfiltered (gdb_stdlog, "gdbarch_get_syscall_names called\n");
-+  return gdbarch->get_syscall_names (gdbarch);
++  i387_cache_to_fxsave (buf);
 +}
 +
-+void
-+set_gdbarch_get_syscall_names (struct gdbarch *gdbarch,
-+                               gdbarch_get_syscall_names_ftype get_syscall_names)
++static void
++i386_store_fpxregset (const void *buf)
++{
++  i387_fxsave_to_cache (buf);
++}
++
++#endif /* HAVE_PTRACE_GETREGS */
++
++struct regset_info target_regsets[] = {
++#ifdef HAVE_PTRACE_GETREGS
++  { PTRACE_GETREGS, PTRACE_SETREGS, sizeof (elf_gregset_t),
++    GENERAL_REGS,
++    i386_fill_gregset, i386_store_gregset },
++# ifdef HAVE_PTRACE_GETFPXREGS
++  { PTRACE_GETFPXREGS, PTRACE_SETFPXREGS, sizeof (elf_fpxregset_t),
++    EXTENDED_REGS,
++    i386_fill_fpxregset, i386_store_fpxregset },
++# endif
++  { PTRACE_GETFPREGS, PTRACE_SETFPREGS, sizeof (elf_fpregset_t),
++    FP_REGS,
++    i386_fill_fpregset, i386_store_fpregset },
++#endif /* HAVE_PTRACE_GETREGS */
++  { 0, 0, -1, -1, NULL, NULL }
++};
++
++static const unsigned char i386_breakpoint[] = { 0xCC };
++#define i386_breakpoint_len 1
++
++extern int debug_threads;
++
++static CORE_ADDR
++i386_get_pc ()
 +{
-+  gdbarch->get_syscall_names = get_syscall_names;
++  unsigned long pc;
++
++  collect_register_by_name ("eip", &pc);
++
++  if (debug_threads)
++    fprintf (stderr, "stop pc (before any decrement) is %08lx\n", pc);
++  return pc;
 +}
 +
-+const char *
-+gdbarch_xml_syscall_filename (struct gdbarch *gdbarch)
++static void
++i386_set_pc (CORE_ADDR newpc)
 +{
-+  gdb_assert (gdbarch != NULL);
-+  /* Skip verify of xml_syscall_filename, invalid_p == 0 */
-+  if (gdbarch_debug >= 2)
-+    fprintf_unfiltered (gdb_stdlog, "gdbarch_xml_syscall_filename called\n");
-+  return gdbarch->xml_syscall_filename;
++  if (debug_threads)
++    fprintf (stderr, "set pc to %08lx\n", (long) newpc);
++  supply_register_by_name ("eip", &newpc);
 +}
 +
-+void
-+set_gdbarch_xml_syscall_filename (struct gdbarch *gdbarch,
-+                                  const char * xml_syscall_filename)
++static int
++i386_breakpoint_at (CORE_ADDR pc)
 +{
-+  gdbarch->xml_syscall_filename = xml_syscall_filename;
++  unsigned char c;
++
++  read_inferior_memory (pc, &c, 1);
++  if (c == 0xCC)
++    return 1;
++
++  return 0;
 +}
 +
-+int
- gdbarch_has_global_solist (struct gdbarch *gdbarch)
- {
-   gdb_assert (gdbarch != NULL);
-diff --git a/gdb/gdbarch.h b/gdb/gdbarch.h
-index 04c8920..017b9df 100644
---- a/gdb/gdbarch.h
-+++ b/gdb/gdbarch.h
-@@ -52,6 +52,7 @@ struct bp_target_info;
- struct target_desc;
- struct displaced_step_closure;
- struct core_regset_section;
-+struct syscall;
- extern struct gdbarch *current_gdbarch;
- extern struct gdbarch *target_gdbarch;
-@@ -839,6 +840,47 @@ typedef void (gdbarch_record_special_symbol_ftype) (struct gdbarch *gdbarch, str
- extern void gdbarch_record_special_symbol (struct gdbarch *gdbarch, struct objfile *objfile, asymbol *sym);
- extern void set_gdbarch_record_special_symbol (struct gdbarch *gdbarch, gdbarch_record_special_symbol_ftype *record_special_symbol);
-+/* Functions for the 'catch syscall' feature.
-+   Get architecture-specific system calls information from registers. */
++struct linux_target_ops the_low_target = {
++  init_registers_i386_linux,
++  i386_num_regs,
++  i386_regmap,
++  i386_cannot_fetch_register,
++  i386_cannot_store_register,
++  i386_get_pc,
++  i386_set_pc,
++  i386_breakpoint,
++  i386_breakpoint_len,
++  NULL,
++  1,
++  i386_breakpoint_at,
++  NULL,
++  NULL,
++  NULL,
++  NULL,
++  NULL,
++  NULL,
++};
+diff --git a/gdb/gdbserver/linux-x86-64-low.c b/gdb/gdbserver/linux-x86-64-low.c
+new file mode 100644
+index 0000000..b8213f5
+--- /dev/null
++++ b/gdb/gdbserver/linux-x86-64-low.c
+@@ -0,0 +1,184 @@
++/* GNU/Linux/x86-64 specific low level interface, for the remote server
++   for GDB.
++   Copyright (C) 2002, 2004, 2005, 2006, 2007, 2008, 2009
++   Free Software Foundation, Inc.
 +
-+extern int gdbarch_get_syscall_number_p (struct gdbarch *gdbarch);
++   This file is part of GDB.
 +
-+typedef LONGEST (gdbarch_get_syscall_number_ftype) (struct gdbarch *gdbarch, ptid_t ptid);
-+extern LONGEST gdbarch_get_syscall_number (struct gdbarch *gdbarch, ptid_t ptid);
-+extern void set_gdbarch_get_syscall_number (struct gdbarch *gdbarch, gdbarch_get_syscall_number_ftype *get_syscall_number);
++   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.
 +
-+/* Fills the struct syscall (passed as argument) with the corresponding
-+   system call represented by syscall_number. */
++   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.
 +
-+extern int gdbarch_get_syscall_by_number_p (struct gdbarch *gdbarch);
++   You should have received a copy of the GNU General Public License
++   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 +
-+typedef void (gdbarch_get_syscall_by_number_ftype) (struct gdbarch *gdbarch, int syscall_number, struct syscall *s);
-+extern void gdbarch_get_syscall_by_number (struct gdbarch *gdbarch, int syscall_number, struct syscall *s);
-+extern void set_gdbarch_get_syscall_by_number (struct gdbarch *gdbarch, gdbarch_get_syscall_by_number_ftype *get_syscall_by_number);
++#include "server.h"
++#include "linux-low.h"
++#include "i387-fp.h"
 +
-+/* Fills the struct syscall (passed as argument) with the corresponding
-+   system call represented by syscall_name. */
++#include "gdb_proc_service.h"
 +
-+extern int gdbarch_get_syscall_by_name_p (struct gdbarch *gdbarch);
++/* Defined in auto-generated file reg-x86-64-linux.c.  */
++void init_registers_x86_64_linux (void);
 +
-+typedef void (gdbarch_get_syscall_by_name_ftype) (struct gdbarch *gdbarch, const char *syscall_name, struct syscall *s);
-+extern void gdbarch_get_syscall_by_name (struct gdbarch *gdbarch, const char *syscall_name, struct syscall *s);
-+extern void set_gdbarch_get_syscall_by_name (struct gdbarch *gdbarch, gdbarch_get_syscall_by_name_ftype *get_syscall_by_name);
++#include <sys/reg.h>
++#include <sys/procfs.h>
++#include <sys/ptrace.h>
 +
-+/* Returns the array containing the syscall names for the architecture. */
++/* This definition comes from prctl.h, but some kernels may not have it.  */
++#ifndef PTRACE_ARCH_PRCTL
++#define PTRACE_ARCH_PRCTL      30
++#endif
 +
-+extern int gdbarch_get_syscall_names_p (struct gdbarch *gdbarch);
++/* The following definitions come from prctl.h, but may be absent
++   for certain configurations.  */
++#ifndef ARCH_GET_FS
++#define ARCH_SET_GS 0x1001
++#define ARCH_SET_FS 0x1002
++#define ARCH_GET_FS 0x1003
++#define ARCH_GET_GS 0x1004
++#endif
 +
-+typedef const char ** (gdbarch_get_syscall_names_ftype) (struct gdbarch *gdbarch);
-+extern const char ** gdbarch_get_syscall_names (struct gdbarch *gdbarch);
-+extern void set_gdbarch_get_syscall_names (struct gdbarch *gdbarch, gdbarch_get_syscall_names_ftype *get_syscall_names);
++static int x86_64_regmap[] = {
++  RAX * 8, RBX * 8, RCX * 8, RDX * 8,
++  RSI * 8, RDI * 8, RBP * 8, RSP * 8,
++  R8 * 8, R9 * 8, R10 * 8, R11 * 8,
++  R12 * 8, R13 * 8, R14 * 8, R15 * 8,
++  RIP * 8, EFLAGS * 8, CS * 8, SS * 8, 
++  DS * 8, ES * 8, FS * 8, GS * 8,
++  -1, -1, -1, -1, -1, -1, -1, -1,
++  -1, -1, -1, -1, -1, -1, -1, -1,
++  -1, -1, -1, -1, -1, -1, -1, -1,
++  -1, -1, -1, -1, -1, -1, -1, -1, -1,
++  ORIG_RAX * 8
++};
 +
-+/* Stores the name of syscall's XML file. Contains NULL if the file
-+   was not set. */
++#define X86_64_NUM_GREGS (sizeof(x86_64_regmap)/sizeof(int))
 +
-+extern const char * gdbarch_xml_syscall_filename (struct gdbarch *gdbarch);
-+extern void set_gdbarch_xml_syscall_filename (struct gdbarch *gdbarch, const char * xml_syscall_filename);
++/* Called by libthread_db.  */
 +
- /* True if the list of shared libraries is one and only for all
-    processes, as opposed to a list of shared libraries per inferior.
-    When this property is true, GDB assumes that since shared libraries
-@@ -848,6 +890,9 @@ extern void set_gdbarch_record_special_symbol (struct gdbarch *gdbarch, gdbarch_
- extern int gdbarch_has_global_solist (struct gdbarch *gdbarch);
- extern void set_gdbarch_has_global_solist (struct gdbarch *gdbarch, int has_global_solist);
-+/* Definition for an unknown syscall, used basically in error-cases. */
-+#define UNKNOWN_SYSCALL (-1)
++ps_err_e
++ps_get_thread_area (const struct ps_prochandle *ph,
++                    lwpid_t lwpid, int idx, void **base)
++{
++  switch (idx)
++    {
++    case FS:
++      if (ptrace (PTRACE_ARCH_PRCTL, lwpid, base, ARCH_GET_FS) == 0)
++      return PS_OK;
++      break;
++    case GS:
++      if (ptrace (PTRACE_ARCH_PRCTL, lwpid, base, ARCH_GET_GS) == 0)
++      return PS_OK;
++      break;
++    default:
++      return PS_BADADDR;
++    }
++  return PS_ERR;
++}
 +
- extern struct gdbarch_tdep *gdbarch_tdep (struct gdbarch *gdbarch);
-diff --git a/gdb/gdbarch.sh b/gdb/gdbarch.sh
-index f93bfc1..66cbcd0 100755
---- a/gdb/gdbarch.sh
-+++ b/gdb/gdbarch.sh
-@@ -724,6 +724,26 @@ M:struct type *:get_siginfo_type:void:
- # Record architecture-specific information from the symbol table.
- M:void:record_special_symbol:struct objfile *objfile, asymbol *sym:objfile, sym
-+# Functions for the 'catch syscall' feature.
++static void
++x86_64_fill_gregset (void *buf)
++{
++  int i;
 +
-+# Get architecture-specific system calls information from registers.
-+M:LONGEST:get_syscall_number:ptid_t ptid:ptid
++  for (i = 0; i < X86_64_NUM_GREGS; i++)
++    if (x86_64_regmap[i] != -1)
++      collect_register (i, ((char *) buf) + x86_64_regmap[i]);
++}
 +
-+# Fills the struct syscall (passed as argument) with the corresponding
-+# system call represented by syscall_number.
-+M:void:get_syscall_by_number:int syscall_number, struct syscall *s:syscall_number, s
++static void
++x86_64_store_gregset (const void *buf)
++{
++  int i;
 +
-+# Fills the struct syscall (passed as argument) with the corresponding
-+# system call represented by syscall_name.
-+M:void:get_syscall_by_name:const char *syscall_name, struct syscall *s:syscall_name, s
++  for (i = 0; i < X86_64_NUM_GREGS; i++)
++    if (x86_64_regmap[i] != -1)
++      supply_register (i, ((char *) buf) + x86_64_regmap[i]);
++}
 +
-+# Returns the array containing the syscall names for the architecture.
-+M:const char **:get_syscall_names:void:
++static void
++x86_64_fill_fpregset (void *buf)
++{
++  i387_cache_to_fxsave (buf);
++}
 +
-+# Stores the name of syscall's XML file. Contains NULL if the file
-+# was not set.
-+v:const char *:xml_syscall_filename:::0:0::0:gdbarch->xml_syscall_filename
++static void
++x86_64_store_fpregset (const void *buf)
++{
++  i387_fxsave_to_cache (buf);
++}
 +
- # True if the list of shared libraries is one and only for all
- # processes, as opposed to a list of shared libraries per inferior.
- # When this property is true, GDB assumes that since shared libraries
-@@ -842,6 +862,7 @@ struct bp_target_info;
- struct target_desc;
- struct displaced_step_closure;
- struct core_regset_section;
-+struct syscall;
- extern struct gdbarch *current_gdbarch;
- extern struct gdbarch *target_gdbarch;
-@@ -911,6 +932,9 @@ done
- # close it off
- cat <<EOF
-+/* Definition for an unknown syscall, used basically in error-cases. */
-+#define UNKNOWN_SYSCALL (-1)
++struct regset_info target_regsets[] = {
++  { PTRACE_GETREGS, PTRACE_SETREGS, sizeof (elf_gregset_t),
++    GENERAL_REGS,
++    x86_64_fill_gregset, x86_64_store_gregset },
++  { PTRACE_GETFPREGS, PTRACE_SETFPREGS, sizeof (elf_fpregset_t),
++    FP_REGS,
++    x86_64_fill_fpregset, x86_64_store_fpregset },
++  { 0, 0, -1, -1, NULL, NULL }
++};
 +
- extern struct gdbarch_tdep *gdbarch_tdep (struct gdbarch *gdbarch);
-diff --git a/gdb/gdbinit.in b/gdb/gdbinit.in
-index ffb7f53..a2e7e94 100644
---- a/gdb/gdbinit.in
-+++ b/gdb/gdbinit.in
-@@ -1,5 +1,15 @@
- echo Setting up the environment for debugging gdb.\n
-+# Set up the Python library and "require" command.
-+python
-+from os.path import abspath
-+gdb.datadir = abspath ('@srcdir@/python/lib')
-+gdb.pythonlibdir = gdb.datadir
-+gdb.__path__ = [gdb.datadir + '/gdb']
-+sys.path.insert(0, gdb.datadir)
-+end
-+source @srcdir@/python/lib/gdb/__init__.py
++static const unsigned char x86_64_breakpoint[] = { 0xCC };
++#define x86_64_breakpoint_len 1
++                
++extern int debug_threads;
 +
- set complaints 1
- b internal_error
-diff --git a/gdb/gdbthread.h b/gdb/gdbthread.h
-index 3a405a8..a2e2636 100644
---- a/gdb/gdbthread.h
-+++ b/gdb/gdbthread.h
-@@ -228,6 +228,9 @@ struct thread_info *find_thread_id (int num);
- /* Change the ptid of thread OLD_PTID to NEW_PTID.  */
- void thread_change_ptid (ptid_t old_ptid, ptid_t new_ptid);
-+/* Prune dead threads from the list of threads.  */
-+extern void prune_threads (void);
++static CORE_ADDR
++x86_64_get_pc ()
++{
++  unsigned long pc;
 +
- /* Iterator function to call a user-provided callback function
-    once for each known thread.  */
- typedef int (*thread_callback_func) (struct thread_info *, void *);
++  collect_register_by_name ("rip", &pc);
++
++  if (debug_threads)
++    fprintf (stderr, "stop pc (before any decrement) is %08lx\n", pc);
++  return pc;
++}
++
++static void
++x86_64_set_pc (CORE_ADDR newpc)
++{
++  if (debug_threads)
++    fprintf (stderr, "set pc to %08lx\n", (long) newpc);
++  supply_register_by_name ("rip", &newpc);
++}
++
++static int
++x86_64_breakpoint_at (CORE_ADDR pc)
++{
++  unsigned char c;
++
++  read_inferior_memory (pc, &c, 1);
++  if (c == 0xCC)
++    return 1;
++
++  return 0;
++}
++
++struct linux_target_ops the_low_target = {
++  init_registers_x86_64_linux,
++  -1,
++  NULL,
++  NULL,
++  NULL,
++  x86_64_get_pc,
++  x86_64_set_pc,
++  x86_64_breakpoint,  
++  x86_64_breakpoint_len,
++  NULL,                                 
++  1,
++  x86_64_breakpoint_at,
++  NULL,
++  NULL,
++  NULL,
++  NULL,
++  NULL,
++  NULL,
++};
+diff --git a/gdb/gdbthread.h b/gdb/gdbthread.h
+index 79d33fe..d3b4fa1 100644
+--- a/gdb/gdbthread.h
++++ b/gdb/gdbthread.h
+@@ -185,6 +185,10 @@ struct thread_info
+   /* True if this thread has been explicitly requested to stop.  */
+   int stop_requested;
++  /* The initiating frame of a nexting operation, used for deciding
++     which exceptions to intercept.  */
++  struct frame_id initiating_frame;
++
+   /* Private data used by the target vector implementation.  */
+   struct private_thread_info *private;
+ };
+@@ -249,6 +253,9 @@ extern struct thread_info *any_thread_of_process (int pid);
+ /* Change the ptid of thread OLD_PTID to NEW_PTID.  */
+ void thread_change_ptid (ptid_t old_ptid, ptid_t new_ptid);
++/* Prune dead threads from the list of threads.  */
++extern void prune_threads (void);
++
+ /* Iterator function to call a user-provided callback function
+    once for each known thread.  */
+ typedef int (*thread_callback_func) (struct thread_info *, void *);
 diff --git a/gdb/gdbtypes.c b/gdb/gdbtypes.c
-index 8102321..012485c 100644
+index 2f77dca..90abf2c 100644
 --- a/gdb/gdbtypes.c
 +++ b/gdb/gdbtypes.c
-@@ -38,6 +38,8 @@
+@@ -38,6 +38,9 @@
  #include "cp-abi.h"
  #include "gdb_assert.h"
  #include "hashtab.h"
++#include "observer.h"
 +#include "dwarf2expr.h"
 +#include "dwarf2loc.h"
  
- /* These variables point to the objects
-    representing the predefined C data types.  */
-@@ -146,6 +148,23 @@ static void print_bit_vector (B_TYPE *, int);
- static void print_arg_types (struct field *, int, int);
+ /* Floatformat pairs.  */
+@@ -118,13 +121,31 @@ 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 void type_init_refc (struct type *new_type, struct type *parent_type);
-+
 +/* A reference count structure for the type reference count map.  Each
 +   type in a hierarchy of types is mapped to the same reference
 +   count.  */
@@ -19647,13 +9892,15 @@ index 8102321..012485c 100644
 +  int *refc;
 +};
 +
-+/* The hash table holding all reference counts.  */
-+static htab_t type_refc_table;
++/* 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;
  
- /* Alloc a new type structure and fill it with some defaults.  If
-@@ -154,23 +173,25 @@ static void print_cplus_stuff (struct type *, int);
-    structure by xmalloc () (for permanent types).  */
+ /* Allocate a new OBJFILE-associated type structure and fill it
+    with some defaults.  Space for the type structure is allocated
+    on the objfile's objfile_obstack.  */
  
  struct type *
 -alloc_type (struct objfile *objfile)
@@ -19661,153 +9908,74 @@ index 8102321..012485c 100644
  {
    struct type *type;
  
-   /* Alloc the structure and start off with all fields zeroed.  */
--  if (objfile == NULL)
-+  switch ((long) objfile)
-     {
-+    case (long) OBJFILE_INTERNAL:
-+    case (long) OBJFILE_MALLOC:
-       type = XZALLOC (struct type);
-       TYPE_MAIN_TYPE (type) = XZALLOC (struct main_type);
--    }
--  else
--    {
-+      break;
-+    default:
-       type = OBSTACK_ZALLOC (&objfile->objfile_obstack, struct type);
-       TYPE_MAIN_TYPE (type) = OBSTACK_ZALLOC (&objfile->objfile_obstack,
-                                             struct main_type);
-       OBJSTAT (objfile, n_types++);
-+      break;
-     }
-   /* Initialize the fields that might not be zero.  */
-@@ -180,6 +201,9 @@ alloc_type (struct objfile *objfile)
-   TYPE_VPTR_FIELDNO (type) = -1;
-   TYPE_CHAIN (type) = type;   /* Chain back to itself.  */
-+  if (objfile == NULL)
-+    type_init_refc (type, parent);
-+
-   return (type);
+@@ -148,6 +169,39 @@ alloc_type (struct objfile *objfile)
+   return type;
  }
  
-@@ -194,16 +218,24 @@ alloc_type_instance (struct type *oldtype)
-   /* Allocate the structure.  */
--  if (TYPE_OBJFILE (oldtype) == NULL)
--    type = XZALLOC (struct type);
--  else
--    type = OBSTACK_ZALLOC (&TYPE_OBJFILE (oldtype)->objfile_obstack,
--                         struct type);
--
-+  switch ((long) TYPE_OBJFILE (oldtype))
-+    {
-+    case (long) OBJFILE_INTERNAL:
-+    case (long) OBJFILE_MALLOC:
-+      type = XZALLOC (struct type);
-+      break;
-+    default:
-+      type = OBSTACK_ZALLOC (&TYPE_OBJFILE (oldtype)->objfile_obstack,
-+                           struct type);
-+      break;
-+    }
-   TYPE_MAIN_TYPE (type) = TYPE_MAIN_TYPE (oldtype);
-   TYPE_CHAIN (type) = type;   /* Chain back to itself for now.  */
-+  if (TYPE_OBJFILE (oldtype) == NULL)
-+    type_init_refc (type, oldtype);
++/* 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.  */
 +
-   return (type);
- }
-@@ -248,7 +280,7 @@ make_pointer_type (struct type *type, struct type **typeptr)
-   if (typeptr == 0 || *typeptr == 0)  /* We'll need to allocate one.  */
-     {
--      ntype = alloc_type (TYPE_OBJFILE (type));
-+      ntype = alloc_type (TYPE_OBJFILE (type), type);
-       if (typeptr)
-       *typeptr = ntype;
-     }
-@@ -260,6 +292,9 @@ make_pointer_type (struct type *type, struct type **typeptr)
-       smash_type (ntype);
-       TYPE_CHAIN (ntype) = chain;
-       TYPE_OBJFILE (ntype) = objfile;
++static void
++set_type_as_discardable (struct type *type)
++{
++  void **slot;
 +
-+      /* Callers may only supply storage if there is an objfile.  */
-+      gdb_assert (objfile);
-     }
-   TYPE_TARGET_TYPE (ntype) = type;
-@@ -328,7 +363,7 @@ make_reference_type (struct type *type, struct type **typeptr)
++  gdb_assert (!TYPE_DISCARDABLE (type));
++
++  TYPE_DISCARDABLE (type) = 1;
++  TYPE_DISCARDABLE_AGE (type) = type_discardable_age_current;
++
++  slot = htab_find_slot (type_discardable_table, type, INSERT);
++  gdb_assert (!*slot);
++  *slot = type;
++}
++
++/* Allocate a new type like alloc_type but preserve for it the discardability
++   state of PARENT_TYPE.  */
++
++static struct type *
++alloc_type_as_parent (struct type *parent_type)
++{
++  struct type *new_type = alloc_type_copy (parent_type);
++
++  if (TYPE_DISCARDABLE (parent_type))
++    set_type_as_discardable (new_type);
++
++  return new_type;
++}
++
+ /* Allocate a new GDBARCH-associated type structure and fill it
+    with some defaults.  Space for the type structure is allocated
+    on the heap.  */
+@@ -184,7 +238,7 @@ struct type *
+ alloc_type_copy (const struct type *type)
+ {
+   if (TYPE_OBJFILE_OWNED (type))
+-    return alloc_type (TYPE_OWNER (type).objfile);
++    return alloc_type (TYPE_OWNER (type).objfile, (struct type *) type);
+   else
+     return alloc_type_arch (TYPE_OWNER (type).gdbarch);
+ }
+@@ -273,7 +327,7 @@ make_pointer_type (struct type *type, struct type **typeptr)
  
    if (typeptr == 0 || *typeptr == 0)  /* We'll need to allocate one.  */
      {
--      ntype = alloc_type (TYPE_OBJFILE (type));
-+      ntype = alloc_type (TYPE_OBJFILE (type), type);
+-      ntype = alloc_type_copy (type);
++      ntype = alloc_type_as_parent (type);
        if (typeptr)
        *typeptr = ntype;
      }
-@@ -340,6 +375,9 @@ make_reference_type (struct type *type, struct type **typeptr)
-       smash_type (ntype);
-       TYPE_CHAIN (ntype) = chain;
-       TYPE_OBJFILE (ntype) = objfile;
-+
-+      /* Callers may only supply storage if there is an objfile.  */
-+      gdb_assert (objfile);
-     }
-   TYPE_TARGET_TYPE (ntype) = type;
-@@ -388,7 +426,7 @@ make_function_type (struct type *type, struct type **typeptr)
+@@ -350,7 +404,7 @@ make_reference_type (struct type *type, struct type **typeptr)
  
    if (typeptr == 0 || *typeptr == 0)  /* We'll need to allocate one.  */
      {
--      ntype = alloc_type (TYPE_OBJFILE (type));
-+      ntype = alloc_type (TYPE_OBJFILE (type), type);
+-      ntype = alloc_type_copy (type);
++      ntype = alloc_type_as_parent (type);
        if (typeptr)
        *typeptr = ntype;
      }
-@@ -398,6 +436,9 @@ make_function_type (struct type *type, struct type **typeptr)
-       objfile = TYPE_OBJFILE (ntype);
-       smash_type (ntype);
-       TYPE_OBJFILE (ntype) = objfile;
-+
-+      /* Callers may only supply storage if there is an objfile.  */
-+      gdb_assert (objfile);
-     }
-   TYPE_TARGET_TYPE (ntype) = type;
-@@ -643,7 +684,7 @@ lookup_memberptr_type (struct type *type, struct type *domain)
- {
-   struct type *mtype;
--  mtype = alloc_type (TYPE_OBJFILE (type));
-+  mtype = alloc_type (TYPE_OBJFILE (type), NULL);
-   smash_to_memberptr_type (mtype, domain, type);
-   return (mtype);
- }
-@@ -655,7 +696,7 @@ lookup_methodptr_type (struct type *to_type)
- {
-   struct type *mtype;
--  mtype = alloc_type (TYPE_OBJFILE (to_type));
-+  mtype = alloc_type (TYPE_OBJFILE (to_type), NULL);
-   TYPE_TARGET_TYPE (mtype) = to_type;
-   TYPE_DOMAIN_TYPE (mtype) = TYPE_DOMAIN_TYPE (to_type);
-   TYPE_LENGTH (mtype) = cplus_method_ptr_size (to_type);
-@@ -696,19 +737,20 @@ create_range_type (struct type *result_type, struct type *index_type,
-                  int low_bound, int high_bound)
- {
-   if (result_type == NULL)
--    result_type = alloc_type (TYPE_OBJFILE (index_type));
-+    result_type = alloc_type (TYPE_OBJFILE (index_type), index_type);
-   TYPE_CODE (result_type) = TYPE_CODE_RANGE;
-   TYPE_TARGET_TYPE (result_type) = index_type;
-   if (TYPE_STUB (index_type))
+@@ -721,12 +775,13 @@ create_range_type (struct type *result_type, struct type *index_type,
      TYPE_TARGET_STUB (result_type) = 1;
    else
      TYPE_LENGTH (result_type) = TYPE_LENGTH (check_typedef (index_type));
@@ -19822,29 +9990,8 @@ index 8102321..012485c 100644
  
    if (low_bound >= 0)
      TYPE_UNSIGNED (result_type) = 1;
-@@ -727,6 +769,9 @@ get_discrete_bounds (struct type *type, LONGEST *lowp, LONGEST *highp)
-   switch (TYPE_CODE (type))
-     {
-     case TYPE_CODE_RANGE:
-+      if (TYPE_RANGE_UPPER_BOUND_IS_UNDEFINED (type) 
-+        || TYPE_RANGE_LOWER_BOUND_IS_UNDEFINED (type))
-+      return -1;
-       *lowp = TYPE_LOW_BOUND (type);
-       *highp = TYPE_HIGH_BOUND (type);
-       return 1;
-@@ -805,30 +850,56 @@ create_array_type (struct type *result_type,
+@@ -826,26 +881,45 @@ create_array_type (struct type *result_type,
  
-   if (result_type == NULL)
-     {
--      result_type = alloc_type (TYPE_OBJFILE (range_type));
-+      result_type = alloc_type (TYPE_OBJFILE (range_type), range_type);
-     }
-+  else
-+    {
-+      /* Callers may only supply storage if there is an objfile.  */
-+      gdb_assert (TYPE_OBJFILE (result_type));
-+    }
-+
    TYPE_CODE (result_type) = TYPE_CODE_ARRAY;
    TYPE_TARGET_TYPE (result_type) = element_type;
 -  if (get_discrete_bounds (range_type, &low_bound, &high_bound) < 0)
@@ -19861,7 +10008,6 @@ index 8102321..012485c 100644
    TYPE_NFIELDS (result_type) = 1;
    TYPE_FIELDS (result_type) =
      (struct field *) TYPE_ZALLOC (result_type, sizeof (struct field));
-+  /* FIXME: type alloc.  */
    TYPE_INDEX_TYPE (result_type) = range_type;
    TYPE_VPTR_FIELDNO (result_type) = -1;
  
@@ -19901,23 +10047,9 @@ index 8102321..012485c 100644
 +      TYPE_TARGET_STUB (result_type) = 1;
 +    }
  
-   return (result_type);
+   return result_type;
  }
-@@ -865,7 +936,12 @@ create_set_type (struct type *result_type, struct type *domain_type)
- {
-   if (result_type == NULL)
-     {
--      result_type = alloc_type (TYPE_OBJFILE (domain_type));
-+      result_type = alloc_type (TYPE_OBJFILE (domain_type), domain_type);
-+    }
-+  else
-+    {
-+      /* Callers may only supply storage if there is an objfile.  */
-+      gdb_assert (TYPE_OBJFILE (result_type));
-     }
-   TYPE_CODE (result_type) = TYPE_CODE_SET;
-   TYPE_NFIELDS (result_type) = 1;
-@@ -1368,6 +1444,84 @@ stub_noname_complaint (void)
+@@ -1331,6 +1405,84 @@ stub_noname_complaint (void)
    complaint (&symfile_complaints, _("stub type has NULL name"));
  }
  
@@ -20002,7 +10134,7 @@ index 8102321..012485c 100644
  /* Added by Bryan Boreham, Kewill, Sun Sep 17 18:07:17 1989.
  
     If this is a stubbed struct (i.e. declared as struct foo *), see if
-@@ -1384,7 +1538,8 @@ stub_noname_complaint (void)
+@@ -1347,7 +1499,8 @@ stub_noname_complaint (void)
  /* 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
@@ -20012,16 +10144,7 @@ index 8102321..012485c 100644
  
  struct type *
  check_typedef (struct type *type)
-@@ -1420,7 +1575,7 @@ check_typedef (struct type *type)
-         if (sym)
-           TYPE_TARGET_TYPE (type) = SYMBOL_TYPE (sym);
-         else                                  /* TYPE_CODE_UNDEF */
--          TYPE_TARGET_TYPE (type) = alloc_type (NULL);
-+          TYPE_TARGET_TYPE (type) = alloc_type (NULL, NULL);
-       }
-       type = TYPE_TARGET_TYPE (type);
-     }
-@@ -1494,34 +1649,37 @@ check_typedef (struct type *type)
+@@ -1457,34 +1610,37 @@ check_typedef (struct type *type)
          }
      }
  
@@ -20077,7 +10200,7 @@ index 8102321..012485c 100644
          TYPE_TARGET_STUB (type) = 0;
        }
        else if (TYPE_CODE (type) == TYPE_CODE_RANGE)
-@@ -1529,9 +1687,12 @@ check_typedef (struct type *type)
+@@ -1492,9 +1648,12 @@ check_typedef (struct type *type)
          TYPE_LENGTH (type) = TYPE_LENGTH (target_type);
          TYPE_TARGET_STUB (type) = 0;
        }
@@ -20090,7 +10213,7 @@ index 8102321..012485c 100644
    return type;
  }
  
-@@ -1753,7 +1914,7 @@ init_type (enum type_code code, int length, int flags,
+@@ -1716,7 +1875,7 @@ init_type (enum type_code code, int length, int flags,
  {
    struct type *type;
  
@@ -20099,41 +10222,7 @@ index 8102321..012485c 100644
    TYPE_CODE (type) = code;
    TYPE_LENGTH (type) = length;
  
-@@ -1783,15 +1944,24 @@ init_type (enum type_code code, int length, int flags,
-   if (flags & TYPE_FLAG_FIXED_INSTANCE)
-     TYPE_FIXED_INSTANCE (type) = 1;
--  if ((name != NULL) && (objfile != NULL))
--    {
--      TYPE_NAME (type) = obsavestring (name, strlen (name), 
--                                     &objfile->objfile_obstack);
--    }
--  else
--    {
--      TYPE_NAME (type) = name;
--    }
-+  if (name)
-+    switch ((long) objfile)
-+      {
-+      case (long) OBJFILE_INTERNAL:
-+      TYPE_NAME (type) = name;
-+      break;
-+      case (long) OBJFILE_MALLOC:
-+      TYPE_NAME (type) = xstrdup (name);
-+      break;
-+#if 0 /* OBJFILE_MALLOC duplication now.  */
-+      case (long) NULL:
-+      internal_error (__FILE__, __LINE__,
-+                      _("OBJFILE pointer NULL should be OBJFILE_* instead"));
-+#endif
-+      default:
-+      TYPE_NAME (type) = obsavestring (name, strlen (name), 
-+                                       &objfile->objfile_obstack);
-+      }
-   /* C++ fancies.  */
-@@ -1803,6 +1973,10 @@ init_type (enum type_code code, int length, int flags,
+@@ -1760,6 +1919,10 @@ init_type (enum type_code code, int length, int flags,
      {
        INIT_CPLUS_SPECIFIC (type);
      }
@@ -20141,10 +10230,20 @@ index 8102321..012485c 100644
 +  if (!objfile)
 +    type_incref (type);
 +
-   return (type);
+   return type;
  }
  
-@@ -2916,33 +3090,47 @@ type_pair_eq (const void *item_lhs, const void *item_rhs)
+@@ -2004,7 +2167,8 @@ rank_one_type (struct type *parm, struct type *arg)
+       switch (TYPE_CODE (arg))
+       {
+       case TYPE_CODE_PTR:
+-        if (TYPE_CODE (TYPE_TARGET_TYPE (parm)) == TYPE_CODE_VOID)
++        if (TYPE_CODE (TYPE_TARGET_TYPE (parm)) == TYPE_CODE_VOID
++            && TYPE_CODE (TYPE_TARGET_TYPE (arg)) != TYPE_CODE_VOID)
+           return VOID_PTR_CONVERSION_BADNESS;
+         else
+           return rank_one_type (TYPE_TARGET_TYPE (parm), 
+@@ -2820,33 +2984,42 @@ type_pair_eq (const void *item_lhs, const void *item_rhs)
  }
  
  /* Allocate the hash table used by copy_type_recursive to walk
@@ -20181,11 +10280,8 @@ index 8102321..012485c 100644
 -   OBJFILE.  Return a new type allocated using malloc, a saved type if
 -   we have already visited TYPE (using COPIED_TYPES), or TYPE if it is
 -   not associated with OBJFILE.  */
-+/* A helper for copy_type_recursive.  This does all the work.
-+   REPRESENTATIVE is a pointer to a type.  This is used to register
-+   newly-created types in the type_refc_table.  Initially it pointer
-+   to a NULL pointer, but it is filled in the first time a type is
-+   copied.  OBJFILE is used only for an assertion checking.  */
++/* A helper for copy_type_recursive.  This does all the work.  OBJFILE is used
++   only for an assertion checking.  */
  
 -struct type *
 -copy_type_recursive (struct objfile *objfile, 
@@ -20194,27 +10290,19 @@ index 8102321..012485c 100644
 +static struct type *
 +copy_type_recursive_1 (struct objfile *objfile, 
 +                     struct type *type,
-+                     htab_t copied_types,
-+                     struct type **representative)
++                     htab_t copied_types)
  {
    struct type_pair *stored, pair;
    void **slot;
    struct type *new_type;
  
--  if (TYPE_OBJFILE (type) == NULL)
-+  if (TYPE_OBJFILE (type) == OBJFILE_INTERNAL
-+      || (objfile == OBJFILE_MALLOC && !TYPE_DYNAMIC (type)))
+-  if (! TYPE_OBJFILE_OWNED (type))
++  if (! TYPE_OBJFILE_OWNED (type) && !TYPE_DYNAMIC (type))
      return type;
  
    /* This type shouldn't be pointing to any types in other objfiles;
-@@ -2954,11 +3142,15 @@ copy_type_recursive (struct objfile *objfile,
-   if (*slot != NULL)
-     return ((struct type_pair *) *slot)->new;
--  new_type = alloc_type (NULL);
-+  new_type = alloc_type (OBJFILE_MALLOC, *representative);
-+  if (!*representative)
-+    *representative = new_type;
+@@ -2861,8 +3034,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
 -     we encounter this type again during a recursive call below.  */
@@ -20226,10 +10314,16 @@ index 8102321..012485c 100644
    stored->old = type;
    stored->new = new_type;
    *slot = stored;
-@@ -2968,6 +3160,13 @@ copy_type_recursive (struct objfile *objfile,
-   *TYPE_MAIN_TYPE (new_type) = *TYPE_MAIN_TYPE (type);
-   TYPE_OBJFILE (new_type) = NULL;
+@@ -2873,6 +3048,19 @@ copy_type_recursive (struct objfile *objfile,
+   TYPE_OBJFILE_OWNED (new_type) = 0;
+   TYPE_OWNER (new_type).gdbarch = get_type_arch (type);
  
++  /* 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);
++
 +  /* Pre-clear the fields processed by delete_main_type.  If DWARF block
 +     evaluations below call error we would leave an unfreeable TYPE.  */
 +  TYPE_TARGET_TYPE (new_type) = NULL;
@@ -20240,7 +10334,7 @@ index 8102321..012485c 100644
    if (TYPE_NAME (type))
      TYPE_NAME (new_type) = xstrdup (TYPE_NAME (type));
    if (TYPE_TAG_NAME (type))
-@@ -2976,12 +3175,45 @@ copy_type_recursive (struct objfile *objfile,
+@@ -2881,12 +3069,45 @@ copy_type_recursive (struct objfile *objfile,
    TYPE_INSTANCE_FLAGS (new_type) = TYPE_INSTANCE_FLAGS (type);
    TYPE_LENGTH (new_type) = TYPE_LENGTH (type);
  
@@ -20286,18 +10380,18 @@ index 8102321..012485c 100644
        TYPE_FIELDS (new_type) = XCALLOC (nfields, struct field);
        for (i = 0; i < nfields; i++)
        {
-@@ -2990,8 +3222,8 @@ copy_type_recursive (struct objfile *objfile,
+@@ -2895,8 +3116,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)
 -            = copy_type_recursive (objfile, TYPE_FIELD_TYPE (type, i),
 -                                   copied_types);
 +            = copy_type_recursive_1 (objfile, TYPE_FIELD_TYPE (type, i),
-+                                     copied_types, representative);
++                                     copied_types);
          if (TYPE_FIELD_NAME (type, i))
            TYPE_FIELD_NAME (new_type, i) = 
              xstrdup (TYPE_FIELD_NAME (type, i));
-@@ -3010,6 +3242,16 @@ copy_type_recursive (struct objfile *objfile,
+@@ -2915,6 +3136,16 @@ copy_type_recursive (struct objfile *objfile,
                                  xstrdup (TYPE_FIELD_STATIC_PHYSNAME (type,
                                                                       i)));
              break;
@@ -20314,7 +10408,7 @@ index 8102321..012485c 100644
            default:
              internal_error (__FILE__, __LINE__,
                              _("Unexpected type field location kind: %d"),
-@@ -3018,17 +3260,32 @@ copy_type_recursive (struct objfile *objfile,
+@@ -2923,17 +3154,30 @@ copy_type_recursive (struct objfile *objfile,
        }
      }
  
@@ -20339,8 +10433,7 @@ index 8102321..012485c 100644
 -                         copied_types);
 +      copy_type_recursive_1 (objfile, 
 +                           TYPE_TARGET_TYPE (type),
-+                           copied_types,
-+                           representative);
++                           copied_types);
    if (TYPE_VPTR_BASETYPE (type))
      TYPE_VPTR_BASETYPE (new_type) = 
 -      copy_type_recursive (objfile,
@@ -20348,12 +10441,11 @@ index 8102321..012485c 100644
 -                         copied_types);
 +      copy_type_recursive_1 (objfile,
 +                           TYPE_VPTR_BASETYPE (type),
-+                           copied_types,
-+                           representative);
++                           copied_types);
    /* Maybe copy the type_specific bits.
  
       NOTE drow/2005-12-09: We do not copy the C++-specific bits like
-@@ -3046,6 +3303,20 @@ copy_type_recursive (struct objfile *objfile,
+@@ -2951,6 +3195,17 @@ copy_type_recursive (struct objfile *objfile,
    return new_type;
  }
  
@@ -20365,44 +10457,76 @@ index 8102321..012485c 100644
 +copy_type_recursive (struct type *type,
 +                   htab_t copied_types)
 +{
-+  struct type *representative = NULL;
-+
-+  return copy_type_recursive_1 (TYPE_OBJFILE (type), type, copied_types,
-+                              &representative);
++  return copy_type_recursive_1 (TYPE_OBJFILE (type), type, copied_types);
 +}
 +
  /* Make a copy of the given TYPE, except that the pointer & reference
     types are not preserved.
     
-@@ -3059,7 +3330,7 @@ copy_type (const struct type *type)
-   gdb_assert (TYPE_OBJFILE (type) != NULL);
--  new_type = alloc_type (TYPE_OBJFILE (type));
-+  new_type = alloc_type (TYPE_OBJFILE (type), NULL);
-   TYPE_INSTANCE_FLAGS (new_type) = TYPE_INSTANCE_FLAGS (type);
-   TYPE_LENGTH (new_type) = TYPE_LENGTH (type);
-   memcpy (TYPE_MAIN_TYPE (new_type), TYPE_MAIN_TYPE (type),
-@@ -3068,6 +3339,232 @@ copy_type (const struct type *type)
+@@ -2973,6 +3228,217 @@ copy_type (const struct type *type)
    return new_type;
  }
  
-+static void delete_type (struct type *type);
++/* Callback type for main_type_crawl.  */
++typedef int (*main_type_crawl_iter) (struct type *type, void *data);
++
++/* Iterate all main_type structures reachable through any `struct type *' from
++   TYPE.  ITER will be called only for one type of each main_type, use
++   TYPE_CHAIN traversal to find all the type instances.  ITER is being called
++   for each main_type found.  ITER returns non-zero if main_type_crawl should
++   depth-first enter the specific type.  ITER must provide some detection for
++   reentering the same main_type as this function would otherwise endlessly
++   loop.  */
++
++static void
++main_type_crawl (struct type *type, main_type_crawl_iter iter, void *data)
++{
++  struct type *type_iter;
++  int i;
++
++  if (!type)
++    return;
++
++  gdb_assert (TYPE_OBJFILE (type) == NULL);
++
++  /* `struct cplus_struct_type' handling is unsupported by this function.  */
++  gdb_assert ((TYPE_CODE (type) != TYPE_CODE_STRUCT
++             && TYPE_CODE (type) != TYPE_CODE_UNION)
++            || !HAVE_CPLUS_STRUCT (type) || !TYPE_CPLUS_SPECIFIC (type));
++
++  if (!(*iter) (type, data))
++    return;
++
++  /* Iterate all the type instances of this main_type.  */
++  type_iter = type;
++  do
++    {
++      gdb_assert (TYPE_MAIN_TYPE (type_iter) == TYPE_MAIN_TYPE (type));
++
++      main_type_crawl (TYPE_POINTER_TYPE (type), iter, data);
++      main_type_crawl (TYPE_REFERENCE_TYPE (type), iter, data);
++
++      type_iter = TYPE_CHAIN (type_iter);
++    }
++  while (type_iter != type);
++
++  for (i = 0; i < TYPE_NFIELDS (type); i++)
++    main_type_crawl (TYPE_FIELD_TYPE (type, i), iter, data);
++
++  main_type_crawl (TYPE_TARGET_TYPE (type), iter, data);
++  main_type_crawl (TYPE_VPTR_BASETYPE (type), iter, data);
++}
 +
 +/* A helper for delete_type which deletes a main_type and the things to which
 +   it refers.  TYPE is a type whose main_type we wish to destroy.  */
 +
 +static void
-+delete_main_type (struct main_type *main_type)
++delete_main_type (struct type *type)
 +{
 +  int i;
-+  void **slot;
-+  struct
-+    {
-+      struct main_type *main_type;
-+    } type_local = { main_type }, *type = &type_local;
 +
-+  gdb_assert (TYPE_OBJFILE (type) == OBJFILE_MALLOC);
++  gdb_assert (TYPE_DISCARDABLE (type));
++  gdb_assert (TYPE_OBJFILE (type) == NULL);
 +
 +  xfree (TYPE_NAME (type));
 +  xfree (TYPE_TAG_NAME (type));
@@ -20416,133 +10540,88 @@ index 8102321..012485c 100644
 +    }
 +  xfree (TYPE_FIELDS (type));
 +
-+  /* Strangely, HAVE_CPLUS_STRUCT will return true when there isn't
-+     one at all.  */
-+  gdb_assert (!HAVE_CPLUS_STRUCT (type) || !TYPE_CPLUS_SPECIFIC (type));
++  /* `struct cplus_struct_type' handling is unsupported by this function.  */
++  gdb_assert ((TYPE_CODE (type) != TYPE_CODE_STRUCT
++             && TYPE_CODE (type) != TYPE_CODE_UNION)
++            || !HAVE_CPLUS_STRUCT (type) || !TYPE_CPLUS_SPECIFIC (type));
 +
 +  xfree (TYPE_MAIN_TYPE (type));
 +}
 +
-+/* Store `struct main_type *' entries which got `struct type *' deleted.  */
-+
-+static htab_t deleted_main_types_hash;
-+
-+/* To be called before any call of delete_type.  */
++/* Delete all the instances on TYPE_CHAIN of TYPE, including their referenced
++   main_type.  TYPE must be a reclaimable type - neither permanent nor objfile
++   associated.  */
 +
 +static void
-+delete_type_begin (void)
++delete_type_chain (struct type *type)
 +{
-+  gdb_assert (deleted_main_types_hash == NULL);
-+
-+  deleted_main_types_hash = htab_create_alloc (10, htab_hash_pointer,
-+                          htab_eq_pointer, NULL, xcalloc, xfree);
-+}
-+
-+/* Helper for delete_type_finish.  */
++  struct type *type_iter, *type_iter_to_free;
 +
-+static int
-+delete_type_finish_traverse (void **slot, void *unused)
-+{
-+  struct main_type *main_type = *slot;
++  gdb_assert (TYPE_DISCARDABLE (type));
++  gdb_assert (TYPE_OBJFILE (type) == NULL);
 +
-+  delete_main_type (main_type);
++  delete_main_type (type);
 +
-+  return 1;
++  type_iter = type;
++  do
++    {
++      type_iter_to_free = type_iter;
++      type_iter = TYPE_CHAIN (type_iter);
++      xfree (type_iter_to_free);
++    }
++  while (type_iter != type);
 +}
 +
-+/* To be called after all the calls of delete_type.  Each MAIN_TYPE must have
-+   either none or all of its TYPE entries deleted.  */
++/* Hash function for type_discardable_table.  */
 +
-+static void
-+delete_type_finish (void)
++static hashval_t
++type_discardable_hash (const void *p)
 +{
-+  htab_traverse (deleted_main_types_hash, delete_type_finish_traverse, NULL);
++  const struct type *type = p;
 +
-+  htab_delete (deleted_main_types_hash);
-+  deleted_main_types_hash = NULL;
++  return htab_hash_pointer (TYPE_MAIN_TYPE (type));
 +}
 +
-+/* Delete TYPE and remember MAIN_TYPE it references.  TYPE must have been
-+   allocated using xmalloc -- not using an objfile.  You must wrap calls of
-+   this function by delete_type_begin and delete_type_finish.  */
++/* Equality function for type_discardable_table.  */
 +
-+static void
-+delete_type (struct type *type)
++static int
++type_discardable_equal (const void *a, const void *b)
 +{
-+  void **slot;
-+
-+  if (!type)
-+    return;
-+
-+  if (TYPE_OBJFILE (type) == OBJFILE_INTERNAL)
-+    return;
-+  gdb_assert (TYPE_OBJFILE (type) == OBJFILE_MALLOC);
-+
-+  slot = htab_find_slot (deleted_main_types_hash, TYPE_MAIN_TYPE (type),
-+                       INSERT);
-+  gdb_assert (!*slot);
-+  *slot = TYPE_MAIN_TYPE (type);
++  const struct type *left = a;
++  const struct type *right = b;
 +
-+  xfree (type);
++  return TYPE_MAIN_TYPE (left) == TYPE_MAIN_TYPE (right);
 +}
 +
-+/* Hash function for type_refc_table.  */
++/* A helper for type_mark_used.  */
 +
-+static hashval_t
-+type_refc_hash (const void *p)
++static int
++type_mark_used_crawl (struct type *type, void *unused)
 +{
-+  const struct type_refc_entry *entry = p;
-+  return htab_hash_pointer (entry->type);
-+}
++  if (!TYPE_DISCARDABLE (type))
++    return 0;
 +
-+/* Equality function for type_refc_table.  */
++  if (TYPE_DISCARDABLE_AGE (type) == type_discardable_age_current)
++    return 0;
 +
-+static int
-+type_refc_equal (const void *a, const void *b)
-+{
-+  const struct type_refc_entry *left = a;
-+  const struct type_refc_entry *right = b;
-+  return left->type == right->type;
++  TYPE_DISCARDABLE_AGE (type) = type_discardable_age_current;
++
++  /* Continue the traversal.  */
++  return 1;
 +}
 +
-+/* Insert the new type NEW_TYPE into the table.  Does nothing if
-+   NEW_TYPE has an objfile.  If PARENT_TYPE is not NULL, then NEW_TYPE
-+   will be inserted into the same hierarchy as PARENT_TYPE.  In this
-+   case, PARENT_TYPE must already exist in the reference count map.
-+   If PARENT_TYPE is NULL, a new reference count is allocated and set
-+   to one.  */
++/* Mark TYPE and its connected types as used in this free_all_types pass.  */
 +
-+static void
-+type_init_refc (struct type *new_type, struct type *parent_type)
++void
++type_mark_used (struct type *type)
 +{
-+  int *refc;
-+  void **slot;
-+  struct type_refc_entry *new_entry;
-+
-+  if (TYPE_OBJFILE (new_type))
++  if (type == NULL)
 +    return;
 +
-+  if (parent_type)
-+    {
-+      struct type_refc_entry entry, *found;
-+      entry.type = parent_type;
-+      found = htab_find (type_refc_table, &entry);
-+      gdb_assert (found);
-+      refc = found->refc;
-+    }
-+  else
-+    {
-+      refc = xmalloc (sizeof (int));
-+      *refc = 0;
-+    }
-+
-+  new_entry = XNEW (struct type_refc_entry);
-+  new_entry->type = new_type;
-+  new_entry->refc = refc;
++  if (!TYPE_DISCARDABLE (type))
++    return;
 +
-+  slot = htab_find_slot (type_refc_table, new_entry, INSERT);
-+  gdb_assert (!*slot);
-+  *slot = new_entry;
++  main_type_crawl (type, type_mark_used_crawl, NULL);
 +}
 +
 +/* Increment the reference count for TYPE.  */
@@ -20550,321 +10629,84 @@ index 8102321..012485c 100644
 +void
 +type_incref (struct type *type)
 +{
-+  struct type_refc_entry entry, *found;
++}
 +
-+  if (TYPE_OBJFILE (type))
-+    return;
++/* Decrement the reference count for TYPE.  If TYPE has no more
++   references, delete it.  */
 +
-+  entry.type = type;
-+  found = htab_find (type_refc_table, &entry);
-+  gdb_assert (found);
-+  ++*(found->refc);
++void
++type_decref (struct type *type)
++{
 +}
 +
-+/* A traverse callback for type_refc_table which removes any entry
-+   whose reference count is zero (unused entry).  */
++/* A traverse callback for type_discardable_table which removes any
++   type_discardable whose reference count is now zero (unused link).  */
 +
 +static int
-+type_refc_remove (void **slot, void *unused)
++type_discardable_remove (void **slot, void *unused)
 +{
-+  struct type_refc_entry *entry = *slot;
++  struct type *type = *slot;
++
++  gdb_assert (TYPE_DISCARDABLE (type));
 +
-+  if (*entry->refc == 0)
++  if (TYPE_DISCARDABLE_AGE (type) != type_discardable_age_current)
 +    {
-+      delete_type (entry->type);
++      delete_type_chain (type);
 +
-+      xfree (entry);
-+      htab_clear_slot (type_refc_table, slot);
++      htab_clear_slot (type_discardable_table, slot);
 +    }
 +
 +  return 1;
 +}
 +
-+/* Decrement the reference count for TYPE.  Even if TYPE has no more
-+   references still do not delete it as callers may hold pointers to types
-+   dynamically generated by check_typedef where type_incref is never called.
-+   Always rely on the free_all_types garbage collector.  */
-+
-+void
-+type_decref (struct type *type)
-+{
-+  struct type_refc_entry entry, *found;
-+
-+  if (TYPE_OBJFILE (type))
-+    return;
-+
-+  entry.type = type;
-+  found = htab_find (type_refc_table, &entry);
-+  gdb_assert (found);
-+  gdb_assert (found->refc > 0);
-+  --*(found->refc);
-+}
++/* Free all the reclaimable types that have been allocated and that have
++   currently zero reference counter.
 +
-+/* Free all the types that have been allocated and that are not used according
-+   to type_refc_entry->refc.  Called after each command, successful or not.
-+   Use this cleanup only in the GDB idle state as GDB code does not necessarily
-+   use type_incref / type_decref during temporary use of types.  */
++   This function is called after each command, successful or not.  Use this
++   cleanup only in the GDB idle state as GDB only marks those types used by
++   globally tracked objects (with no autovariable references tracking).  */
 +
 +void
 +free_all_types (void)
 +{
-+  delete_type_begin ();
-+  htab_traverse (type_refc_table, type_refc_remove, NULL);
-+  delete_type_finish ();
-+}
++  /* Mark a new pass.  As GDB checks all the entries were visited after each
++     pass there cannot be any stale entries already containing the changed
++     value.  */
++  type_discardable_age_current ^= 1;
 +
- static struct type *
- build_flt (int bit, char *name, const struct floatformat **floatformats)
- {
-@@ -3105,7 +3602,7 @@ build_complex (int bit, char *name, struct type *target_type)
-       return builtin_type_error;
-     }
-   t = init_type (TYPE_CODE_COMPLEX, 2 * bit / TARGET_CHAR_BIT,
--               0, name, (struct objfile *) NULL);
-+               0, name, OBJFILE_INTERNAL);
-   TYPE_TARGET_TYPE (t) = target_type;
-   return t;
- }
-@@ -3119,56 +3616,56 @@ gdbtypes_post_init (struct gdbarch *gdbarch)
-   builtin_type->builtin_void =
-     init_type (TYPE_CODE_VOID, 1,
-              0,
--             "void", (struct objfile *) NULL);
-+             "void", OBJFILE_INTERNAL);
-   builtin_type->builtin_char =
-     init_type (TYPE_CODE_INT, TARGET_CHAR_BIT / TARGET_CHAR_BIT,
-              (TYPE_FLAG_NOSIGN
-                 | (gdbarch_char_signed (gdbarch) ? 0 : TYPE_FLAG_UNSIGNED)),
--             "char", (struct objfile *) NULL);
-+             "char", OBJFILE_INTERNAL);
-   builtin_type->builtin_signed_char =
-     init_type (TYPE_CODE_INT, TARGET_CHAR_BIT / TARGET_CHAR_BIT,
-              0,
--             "signed char", (struct objfile *) NULL);
-+             "signed char", OBJFILE_INTERNAL);
-   builtin_type->builtin_unsigned_char =
-     init_type (TYPE_CODE_INT, TARGET_CHAR_BIT / TARGET_CHAR_BIT,
-              TYPE_FLAG_UNSIGNED,
--             "unsigned char", (struct objfile *) NULL);
-+             "unsigned char", OBJFILE_INTERNAL);
-   builtin_type->builtin_short =
-     init_type (TYPE_CODE_INT, 
-              gdbarch_short_bit (gdbarch) / TARGET_CHAR_BIT,
--             0, "short", (struct objfile *) NULL);
-+             0, "short", OBJFILE_INTERNAL);
-   builtin_type->builtin_unsigned_short =
-     init_type (TYPE_CODE_INT, 
-              gdbarch_short_bit (gdbarch) / TARGET_CHAR_BIT,
-              TYPE_FLAG_UNSIGNED, "unsigned short", 
--             (struct objfile *) NULL);
-+             OBJFILE_INTERNAL);
-   builtin_type->builtin_int =
-     init_type (TYPE_CODE_INT, 
-              gdbarch_int_bit (gdbarch) / TARGET_CHAR_BIT,
--             0, "int", (struct objfile *) NULL);
-+             0, "int", OBJFILE_INTERNAL);
-   builtin_type->builtin_unsigned_int =
-     init_type (TYPE_CODE_INT, 
-              gdbarch_int_bit (gdbarch) / TARGET_CHAR_BIT,
-              TYPE_FLAG_UNSIGNED, "unsigned int", 
--             (struct objfile *) NULL);
-+             OBJFILE_INTERNAL);
-   builtin_type->builtin_long =
-     init_type (TYPE_CODE_INT, 
-              gdbarch_long_bit (gdbarch) / TARGET_CHAR_BIT,
--             0, "long", (struct objfile *) NULL);
-+             0, "long", OBJFILE_INTERNAL);
-   builtin_type->builtin_unsigned_long =
-     init_type (TYPE_CODE_INT, 
-              gdbarch_long_bit (gdbarch) / TARGET_CHAR_BIT,
-              TYPE_FLAG_UNSIGNED, "unsigned long", 
--             (struct objfile *) NULL);
-+             OBJFILE_INTERNAL);
-   builtin_type->builtin_long_long =
-     init_type (TYPE_CODE_INT,
-              gdbarch_long_long_bit (gdbarch) / TARGET_CHAR_BIT,
--             0, "long long", (struct objfile *) NULL);
-+             0, "long long", OBJFILE_INTERNAL);
-   builtin_type->builtin_unsigned_long_long =
-     init_type (TYPE_CODE_INT,
-              gdbarch_long_long_bit (gdbarch) / TARGET_CHAR_BIT,
-              TYPE_FLAG_UNSIGNED, "unsigned long long", 
--             (struct objfile *) NULL);
-+             OBJFILE_INTERNAL);
-   builtin_type->builtin_float
-     = build_flt (gdbarch_float_bit (gdbarch), "float",
-                gdbarch_float_format (gdbarch));
-@@ -3187,26 +3684,26 @@ gdbtypes_post_init (struct gdbarch *gdbarch)
-   builtin_type->builtin_string =
-     init_type (TYPE_CODE_STRING, TARGET_CHAR_BIT / TARGET_CHAR_BIT,
-              0,
--             "string", (struct objfile *) NULL);
-+             "string", OBJFILE_INTERNAL);
-   builtin_type->builtin_bool =
-     init_type (TYPE_CODE_BOOL, TARGET_CHAR_BIT / TARGET_CHAR_BIT,
-              0,
--             "bool", (struct objfile *) NULL);
-+             "bool", OBJFILE_INTERNAL);
-   /* The following three are about decimal floating point types, which
-      are 32-bits, 64-bits and 128-bits respectively.  */
-   builtin_type->builtin_decfloat
-     = init_type (TYPE_CODE_DECFLOAT, 32 / 8,
-               0,
--             "_Decimal32", (struct objfile *) NULL);
-+             "_Decimal32", OBJFILE_INTERNAL);
-   builtin_type->builtin_decdouble
-     = init_type (TYPE_CODE_DECFLOAT, 64 / 8,
-              0,
--             "_Decimal64", (struct objfile *) NULL);
-+             "_Decimal64", OBJFILE_INTERNAL);
-   builtin_type->builtin_declong
-     = init_type (TYPE_CODE_DECFLOAT, 128 / 8,
-              0,
--             "_Decimal128", (struct objfile *) NULL);
-+             "_Decimal128", OBJFILE_INTERNAL);
-   /* Pointer/Address types.  */
-@@ -3245,27 +3742,28 @@ gdbtypes_post_init (struct gdbarch *gdbarch)
-     init_type (TYPE_CODE_INT, 
-              gdbarch_addr_bit (gdbarch) / 8,
-              TYPE_FLAG_UNSIGNED,
--             "__CORE_ADDR", (struct objfile *) NULL);
-+             "__CORE_ADDR", OBJFILE_INTERNAL);
-   /* The following set of types is used for symbols with no
-      debug information.  */
-   builtin_type->nodebug_text_symbol =
-     init_type (TYPE_CODE_FUNC, 1, 0, 
--             "<text variable, no debug info>", NULL);
-+             "<text variable, no debug info>", OBJFILE_INTERNAL);
-   TYPE_TARGET_TYPE (builtin_type->nodebug_text_symbol) =
-     builtin_type->builtin_int;
-   builtin_type->nodebug_data_symbol =
-     init_type (TYPE_CODE_INT, 
-              gdbarch_int_bit (gdbarch) / HOST_CHAR_BIT, 0,
--             "<data variable, no debug info>", NULL);
-+             "<data variable, no debug info>", OBJFILE_INTERNAL);
-   builtin_type->nodebug_unknown_symbol =
-     init_type (TYPE_CODE_INT, 1, 0,
--             "<variable (not text or data), no debug info>", NULL);
-+             "<variable (not text or data), no debug info>",
-+             OBJFILE_INTERNAL);
-   builtin_type->nodebug_tls_symbol =
-     init_type (TYPE_CODE_INT, 
-              gdbarch_int_bit (gdbarch) / HOST_CHAR_BIT, 0,
--             "<thread local variable, no debug info>", NULL);
-+             "<thread local variable, no debug info>", OBJFILE_INTERNAL);
-   return builtin_type;
- }
-@@ -3276,6 +3774,9 @@ _initialize_gdbtypes (void)
++  observer_notify_mark_used ();
++
++  htab_traverse (type_discardable_table, type_discardable_remove, NULL);
++}
+ /* Helper functions to initialize architecture-specific types.  */
+@@ -3463,6 +3929,11 @@ void
+ _initialize_gdbtypes (void)
  {
    gdbtypes_data = gdbarch_data_register_post_init (gdbtypes_post_init);
-+  type_refc_table = htab_create_alloc (20, type_refc_hash, type_refc_equal,
-+                                     NULL, xcalloc, xfree);
-+
-   /* FIXME: The following types are architecture-neutral.  However,
-      they contain pointer_type and reference_type fields potentially
-      caching pointer or reference types that *are* architecture
-@@ -3284,47 +3785,47 @@ _initialize_gdbtypes (void)
-   builtin_type_int0 =
-     init_type (TYPE_CODE_INT, 0 / 8,
-              0,
--             "int0_t", (struct objfile *) NULL);
-+             "int0_t", OBJFILE_INTERNAL);
-   builtin_type_int8 =
-     init_type (TYPE_CODE_INT, 8 / 8,
-              TYPE_FLAG_NOTTEXT,
--             "int8_t", (struct objfile *) NULL);
-+             "int8_t", OBJFILE_INTERNAL);
-   builtin_type_uint8 =
-     init_type (TYPE_CODE_INT, 8 / 8,
-              TYPE_FLAG_UNSIGNED | TYPE_FLAG_NOTTEXT,
--             "uint8_t", (struct objfile *) NULL);
-+             "uint8_t", OBJFILE_INTERNAL);
-   builtin_type_int16 =
-     init_type (TYPE_CODE_INT, 16 / 8,
-              0,
--             "int16_t", (struct objfile *) NULL);
-+             "int16_t", OBJFILE_INTERNAL);
-   builtin_type_uint16 =
-     init_type (TYPE_CODE_INT, 16 / 8,
-              TYPE_FLAG_UNSIGNED,
--             "uint16_t", (struct objfile *) NULL);
-+             "uint16_t", OBJFILE_INTERNAL);
-   builtin_type_int32 =
-     init_type (TYPE_CODE_INT, 32 / 8,
-              0,
--             "int32_t", (struct objfile *) NULL);
-+             "int32_t", OBJFILE_INTERNAL);
-   builtin_type_uint32 =
-     init_type (TYPE_CODE_INT, 32 / 8,
-              TYPE_FLAG_UNSIGNED,
--             "uint32_t", (struct objfile *) NULL);
-+             "uint32_t", OBJFILE_INTERNAL);
-   builtin_type_int64 =
-     init_type (TYPE_CODE_INT, 64 / 8,
-              0,
--             "int64_t", (struct objfile *) NULL);
-+             "int64_t", OBJFILE_INTERNAL);
-   builtin_type_uint64 =
-     init_type (TYPE_CODE_INT, 64 / 8,
-              TYPE_FLAG_UNSIGNED,
--             "uint64_t", (struct objfile *) NULL);
-+             "uint64_t", OBJFILE_INTERNAL);
-   builtin_type_int128 =
-     init_type (TYPE_CODE_INT, 128 / 8,
-              0,
--             "int128_t", (struct objfile *) NULL);
-+             "int128_t", OBJFILE_INTERNAL);
-   builtin_type_uint128 =
-     init_type (TYPE_CODE_INT, 128 / 8,
-              TYPE_FLAG_UNSIGNED,
--             "uint128_t", (struct objfile *) NULL);
-+             "uint128_t", OBJFILE_INTERNAL);
-   builtin_type_ieee_single =
-     build_flt (-1, "builtin_type_ieee_single", floatformats_ieee_single);
-@@ -3344,15 +3845,15 @@ _initialize_gdbtypes (void)
-   builtin_type_void =
-     init_type (TYPE_CODE_VOID, 1,
-              0,
--             "void", (struct objfile *) NULL);
-+             "void", OBJFILE_INTERNAL);
-   builtin_type_true_char =
-     init_type (TYPE_CODE_CHAR, TARGET_CHAR_BIT / TARGET_CHAR_BIT,
-              0,
--             "true character", (struct objfile *) NULL);
-+             "true character", OBJFILE_INTERNAL);
-   builtin_type_true_unsigned_char =
-     init_type (TYPE_CODE_CHAR, TARGET_CHAR_BIT / TARGET_CHAR_BIT,
-              TYPE_FLAG_UNSIGNED,
--             "true character", (struct objfile *) NULL);
-+             "true character", OBJFILE_INTERNAL);
++
++  type_discardable_table = htab_create_alloc (20, type_discardable_hash,
++                                           type_discardable_equal, NULL,
++                                           xcalloc, xfree);
++
+   objfile_type_data = register_objfile_data ();
  
    add_setshow_zinteger_cmd ("overload", no_class, &overload_debug, _("\
- Set debugging of C++ overloading."), _("\
 diff --git a/gdb/gdbtypes.h b/gdb/gdbtypes.h
-index c90b6d7..077b89c 100644
+index be6ed55..6a51a4e 100644
 --- a/gdb/gdbtypes.h
 +++ b/gdb/gdbtypes.h
-@@ -134,7 +134,10 @@ enum type_code
+@@ -137,6 +137,8 @@ enum type_code
  
-     TYPE_CODE_NAMESPACE,      /* C++ namespace.  */
+     TYPE_CODE_DECFLOAT,               /* Decimal floating point.  */
  
--    TYPE_CODE_DECFLOAT                /* Decimal floating point.  */
-+    TYPE_CODE_DECFLOAT,               /* Decimal floating point.  */
++    TYPE_CODE_MODULE,         /* Fortran module.  */
 +
-+    /* Internal function type.  */
-+    TYPE_CODE_INTERNAL_FUNCTION
+     /* Internal function type.  */
+     TYPE_CODE_INTERNAL_FUNCTION
    };
- /* For now allow source to use TYPE_CODE_CLASS for C++ classes, as an
-@@ -209,6 +212,11 @@ enum type_instance_flag_value
+@@ -213,6 +215,11 @@ enum type_instance_flag_value
  
  #define TYPE_TARGET_STUB(t)   (TYPE_MAIN_TYPE (t)->flag_target_stub)
  
@@ -20876,10 +10718,22 @@ index c90b6d7..077b89c 100644
  /* Static type.  If this is set, the corresponding type had 
   * a static modifier.
   * Note: This may be unnecessary, since static data members
-@@ -266,6 +274,36 @@ enum type_instance_flag_value
- #define TYPE_NOTTEXT(t)               (TYPE_MAIN_TYPE (t)->flag_nottext)
+@@ -278,6 +285,48 @@ enum type_instance_flag_value
+ #define TYPE_OWNER(t) TYPE_MAIN_TYPE(t)->owner
+ #define TYPE_OBJFILE(t) (TYPE_OBJFILE_OWNED(t)? TYPE_OWNER(t).objfile : NULL)
  
++/* 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.  */
++
++#define TYPE_DISCARDABLE(t)   (TYPE_MAIN_TYPE (t)->flag_discardable)
++
++/* Marker this type has been visited by the type_mark_used by this
++   mark-and-sweep types garbage collecting pass.  Current pass is represented
++   by TYPE_DISCARDABLE_AGE_CURRENT.  */
++
++#define TYPE_DISCARDABLE_AGE(t)       (TYPE_MAIN_TYPE (t)->flag_discardable_age)
++
 +/* Is HIGH_BOUND a low-bound relative count (1) or the high bound itself (0)?  */
 +
 +#define TYPE_RANGE_HIGH_BOUND_IS_COUNT(range_type) \
@@ -20904,7 +10758,7 @@ index c90b6d7..077b89c 100644
 +   false.  If TYPE_DATA_LOCATION_IS_ADDR set then TYPE_DATA_LOCATION_ADDR value
 +   is the actual data address value.  If unset and
 +   TYPE_DATA_LOCATION_DWARF_BLOCK is NULL then the value is the normal
-+   VALUE_ADDRESS copy.  If unset and TYPE_DATA_LOCATION_DWARF_BLOCK is not NULL
++   value_raw_address.  If unset and TYPE_DATA_LOCATION_DWARF_BLOCK is not NULL
 +   then its DWARF block determines the actual data address.  */
 +
 +#define TYPE_DATA_LOCATION_IS_ADDR(t) \
@@ -20913,10 +10767,12 @@ index c90b6d7..077b89c 100644
  /* Constant type.  If this is set, the corresponding type has a
   * const modifier.
   */
-@@ -352,6 +390,11 @@ struct main_type
-   unsigned int flag_stub_supported : 1;
+@@ -365,6 +414,13 @@ struct main_type
    unsigned int flag_nottext : 1;
    unsigned int flag_fixed_instance : 1;
+   unsigned int flag_objfile_owned : 1;
++  unsigned int flag_discardable : 1;
++  unsigned int flag_discardable_age : 1;
 +  unsigned int flag_dynamic : 1;
 +  unsigned int flag_range_high_bound_is_count : 1;
 +  unsigned int flag_not_allocated : 1;
@@ -20925,7 +10781,7 @@ index c90b6d7..077b89c 100644
  
    /* Number of fields described for this type.  This field appears at
       this location because it packs nicely here.  */
-@@ -414,6 +457,20 @@ struct main_type
+@@ -431,6 +487,20 @@ struct main_type
  
    struct type *target_type;
  
@@ -20946,7 +10802,17 @@ index c90b6d7..077b89c 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.
-@@ -795,9 +852,9 @@ extern void allocate_cplus_struct_type (struct type *);
+@@ -538,6 +608,9 @@ struct main_type
+        supporting multiple ABIs.  Right now this is only fetched from
+        the Dwarf-2 DW_AT_calling_convention attribute.  */
+     unsigned calling_convention;
++
++    /* For TYPE_CODE_MODULE, the list of symbols contained in the module.  */
++    struct block *module_block;
+   } type_specific;
+ };
+@@ -812,9 +885,9 @@ extern void allocate_cplus_struct_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
@@ -20958,8 +10824,8 @@ index c90b6d7..077b89c 100644
 +   type, so you only have to call check_typedef once.  Since allocate_value
     calls check_typedef, TYPE_LENGTH (VALUE_TYPE (X)) is safe.  */
  #define TYPE_LENGTH(thistype) (thistype)->length
- #define TYPE_OBJFILE(thistype) TYPE_MAIN_TYPE(thistype)->objfile
-@@ -807,23 +864,44 @@ extern void allocate_cplus_struct_type (struct type *);
+ /* Note that TYPE_CODE can be TYPE_CODE_TYPEDEF, so if you want the real
+@@ -823,23 +896,44 @@ extern void allocate_cplus_struct_type (struct type *);
  #define TYPE_NFIELDS(thistype) TYPE_MAIN_TYPE(thistype)->nfields
  #define TYPE_FIELDS(thistype) TYPE_MAIN_TYPE(thistype)->fields
  #define TYPE_TEMPLATE_ARGS(thistype) TYPE_CPLUS_SPECIFIC(thistype)->template_args
@@ -21014,55 +10880,26 @@ index c90b6d7..077b89c 100644
  
  /* C++ */
  
-@@ -1078,6 +1156,16 @@ extern struct type *builtin_type_error;
-    (TYPE_UNSIGNED(t) ? UMIN_OF_SIZE(TYPE_LENGTH(t)) \
-     : MIN_OF_SIZE(TYPE_LENGTH(t)))
-+/* Virtual OBJFILE used for builtin types.  */
-+#define OBJFILE_INTERNAL ((struct objfile *) 1L)
-+
-+/* Virtual OBJFILE used for types allocated by malloc.  FIXME: Currently
-+   backward compatible with the old NULL value; fix then also init_type.  */
-+#define OBJFILE_MALLOC ((struct objfile *) 0L)
-+
-+#define OBJFILE_IS_VIRTUAL(objfile) ((objfile) == OBJFILE_INTERNAL    \
-+                                   || (objfile) == OBJFILE_MALLOC)
-+
- /* Allocate space for storing data associated with a particular type.
-    We ensure that the space is allocated using the same mechanism that
-    was used to allocate the space for the type structure itself.  I.E.
-@@ -1087,18 +1175,18 @@ extern struct type *builtin_type_error;
-    builtin types), then the data space will be allocated with xmalloc,
-    the same as for the type structure. */
--#define TYPE_ALLOC(t,size)  \
--   (TYPE_OBJFILE (t) != NULL  \
--    ? obstack_alloc (&TYPE_OBJFILE (t) -> objfile_obstack, size) \
--    : xmalloc (size))
-+#define TYPE_ALLOC(t,size)                                            \
-+   (OBJFILE_IS_VIRTUAL (TYPE_OBJFILE (t))                             \
-+    ? xmalloc (size)                                                  \
-+    : obstack_alloc (&TYPE_OBJFILE (t) -> objfile_obstack, size))
--#define TYPE_ZALLOC(t,size)  \
--   (TYPE_OBJFILE (t) != NULL  \
--    ? memset (obstack_alloc (&TYPE_OBJFILE (t)->objfile_obstack, size),  \
--            0, size)  \
--    : xzalloc (size))
-+#define TYPE_ZALLOC(t,size)                                           \
-+   (OBJFILE_IS_VIRTUAL (TYPE_OBJFILE (t))                             \
-+    ? xzalloc (size)                                                  \
-+    : memset (obstack_alloc (&TYPE_OBJFILE (t)->objfile_obstack, size),       \
-+            0, size))
+@@ -855,6 +949,7 @@ extern void allocate_cplus_struct_type (struct type *);
+ #define TYPE_CPLUS_SPECIFIC(thistype) TYPE_MAIN_TYPE(thistype)->type_specific.cplus_stuff
+ #define TYPE_FLOATFORMAT(thistype) TYPE_MAIN_TYPE(thistype)->type_specific.floatformat
+ #define TYPE_CALLING_CONVENTION(thistype) TYPE_MAIN_TYPE(thistype)->type_specific.calling_convention
++#define TYPE_MODULE_BLOCK(thistype) TYPE_MAIN_TYPE(thistype)->type_specific.module_block
+ #define TYPE_BASECLASS(thistype,index) TYPE_MAIN_TYPE(thistype)->fields[index].type
+ #define TYPE_N_BASECLASSES(thistype) TYPE_CPLUS_SPECIFIC(thistype)->n_baseclasses
+ #define TYPE_BASECLASS_NAME(thistype,index) TYPE_MAIN_TYPE(thistype)->fields[index].name
+@@ -1131,7 +1226,7 @@ extern const struct floatformat *floatformats_ibm_long_double[BFD_ENDIAN_UNKNOWN
+    Use alloc_type_arch to allocate a type owned by an architecture.
+    Use alloc_type_copy to allocate a type with the same owner as a
+    pre-existing template type, no matter whether objfile or gdbarch.  */
 -extern struct type *alloc_type (struct objfile *);
 +extern struct type *alloc_type (struct objfile *, struct type *);
+ extern struct type *alloc_type_arch (struct gdbarch *);
+ extern struct type *alloc_type_copy (const struct type *);
  
- extern struct type *init_type (enum type_code, int, int, char *,
-                              struct objfile *);
-@@ -1172,6 +1260,18 @@ extern struct type *create_range_type (struct type *, struct type *, int,
- extern struct type *create_array_type (struct type *, struct type *,
+@@ -1226,6 +1321,18 @@ extern struct type *create_array_type (struct type *, struct type *,
                                       struct type *);
+ extern struct type *lookup_array_range_type (struct type *, int, int);
  
 +extern CORE_ADDR type_range_any_field_internal (struct type *range_type,
 +                                              int fieldno);
@@ -21076,10 +10913,19 @@ index c90b6d7..077b89c 100644
 +
 +extern void finalize_type (struct type *type);
 +
- extern struct type *create_string_type (struct type *, struct type *);
+ extern struct type *create_string_type (struct type *, struct type *,
+                                       struct type *);
+ extern struct type *lookup_string_range_type (struct type *, int, int);
+@@ -1262,6 +1369,8 @@ extern int get_discrete_bounds (struct type *, LONGEST *, LONGEST *);
+ extern int is_ancestor (struct type *, struct type *);
++extern void type_mark_used (struct type *type);
++
+ /* Overload resolution */
  
- extern struct type *create_set_type (struct type *, struct type *);
-@@ -1263,10 +1363,15 @@ extern void maintenance_print_type (char *, int);
+ #define LENGTH_MATCH(bv) ((bv)->rank[0])
+@@ -1324,10 +1433,15 @@ extern void maintenance_print_type (char *, int);
  
  extern htab_t create_copied_types_hash (struct objfile *objfile);
  
@@ -21090,41 +10936,26 @@ index c90b6d7..077b89c 100644
  
  extern struct type *copy_type (const struct type *type);
  
++extern void free_all_types (void);
++
 +extern void type_incref (struct type *type);
 +
 +extern void type_decref (struct type *type);
-+
-+extern void free_all_types (void);
 +
  #endif /* GDBTYPES_H */
-diff --git a/gdb/gnu-v2-abi.c b/gdb/gnu-v2-abi.c
-index 7cacac1..a456228 100644
---- a/gdb/gnu-v2-abi.c
-+++ b/gdb/gnu-v2-abi.c
-@@ -242,7 +242,7 @@ gnuv2_value_rtti_type (struct value *v, int *full, int *top, int *using_enc)
-     we'd waste a bunch of time figuring out we already know the type.
-     Besides, we don't care about the type, just the actual pointer
-   */
--  if (VALUE_ADDRESS (value_field (v, known_type_vptr_fieldno)) == 0)
-+  if (value_address (value_field (v, known_type_vptr_fieldno)) == 0)
-     return NULL;
-   vtbl = value_as_address (value_field (v, known_type_vptr_fieldno));
 diff --git a/gdb/gnu-v3-abi.c b/gdb/gnu-v3-abi.c
-index 3a52df3..6cdf716 100644
+index 0f9d44e..c910e88 100644
 --- a/gdb/gnu-v3-abi.c
 +++ b/gdb/gnu-v3-abi.c
-@@ -269,8 +269,7 @@ gnuv3_rtti_type (struct value *value,
-   
-   /* Find the linker symbol for this vtable.  */
-   vtable_symbol
--    = lookup_minimal_symbol_by_pc (VALUE_ADDRESS (vtable)
--                                   + value_offset (vtable)
-+    = lookup_minimal_symbol_by_pc (value_address (vtable)
-                                    + value_embedded_offset (vtable));
-   if (! vtable_symbol)
-     return NULL;
-@@ -487,10 +486,8 @@ gnuv3_find_method_in (struct type *domain, CORE_ADDR voffset,
+@@ -26,6 +26,7 @@
+ #include "demangle.h"
+ #include "objfiles.h"
+ #include "valprint.h"
++#include "c-lang.h"
+ #include "gdb_assert.h"
+ #include "gdb_string.h"
+@@ -459,10 +460,8 @@ gnuv3_find_method_in (struct type *domain, CORE_ADDR voffset,
                      LONGEST adjustment)
  {
    int i;
@@ -21135,7 +10966,7 @@ index 3a52df3..6cdf716 100644
    if (adjustment == 0)
      {
        int len;
-@@ -615,13 +612,15 @@ gnuv3_print_method_ptr (const gdb_byte *contents,
+@@ -590,15 +589,24 @@ gnuv3_print_method_ptr (const gdb_byte *contents,
        {
          char *demangled_name = cplus_demangle (physname,
                                                 DMGL_ANSI | DMGL_PARAMS);
@@ -21153,674 +10984,657 @@ index 3a52df3..6cdf716 100644
 +        return;
        }
      }
++  else if (ptr_value != 0)
++    {
++      /* Found a non-virtual function: print out the type.  */
++      fputs_filtered ("(", stream);
++      c_print_type (type, "", stream, -1, 0);
++      fputs_filtered (") ", stream);
++    }
  
+   /* We didn't find it; print the raw data.  */
+   if (vbit)
 diff --git a/gdb/i386-linux-nat.c b/gdb/i386-linux-nat.c
-index 2366474..f83de32 100644
+index fe848ff..170e6cd 100644
 --- a/gdb/i386-linux-nat.c
 +++ b/gdb/i386-linux-nat.c
-@@ -751,7 +751,13 @@ i386_linux_resume (struct target_ops *ops,
+@@ -586,6 +586,8 @@ i386_linux_store_inferior_registers (struct target_ops *ops,
+ static unsigned long i386_linux_dr[DR_CONTROL + 1];
++/* Get debug register REGNUM value from only the one LWP of PTID.  */
++
+ static unsigned long
+ i386_linux_dr_get (ptid_t ptid, int regnum)
  {
-   int pid = PIDGET (ptid);
+@@ -614,6 +616,8 @@ i386_linux_dr_get (ptid_t ptid, int regnum)
+   return value;
+ }
  
--  int request = PTRACE_CONT;
-+  int request;
++/* Set debug register REGNUM to VALUE in only the one LWP of PTID.  */
 +
-+  if (target_passed_by_entrypoint () > 0
-+      && catch_syscall_enabled () > 0)
-+   request = PTRACE_SYSCALL;
-+  else
-+    request = PTRACE_CONT;
+ static void
+ i386_linux_dr_set (ptid_t ptid, int regnum, unsigned long value)
+ {
+@@ -630,6 +634,8 @@ i386_linux_dr_set (ptid_t ptid, int regnum, unsigned long value)
+     perror_with_name (_("Couldn't write debug register"));
+ }
  
-   if (step)
-     {
-diff --git a/gdb/i386-linux-tdep.c b/gdb/i386-linux-tdep.c
-index 1a2e4f0..973eced 100644
---- a/gdb/i386-linux-tdep.c
-+++ b/gdb/i386-linux-tdep.c
-@@ -37,6 +37,10 @@
- #include "symtab.h"
- #include "arch-utils.h"
- #include "regset.h"
-+#include "linux-tdep.h"
-+
-+/* The syscall's XML filename for i386.  */
-+#define XML_SYSCALL_FILENAME_I386 "syscalls/i386-linux.xml"
- /* Supported register note sections.  */
- static struct core_regset_section i386_linux_regset_sections[] =
-@@ -349,6 +353,26 @@ i386_linux_write_pc (struct regcache *regcache, CORE_ADDR pc)
++/* Set DR_CONTROL to ADDR in all LWPs of LWP_LIST.  */
++
+ static void
+ i386_linux_dr_set_control (unsigned long control)
+ {
+@@ -641,6 +647,8 @@ i386_linux_dr_set_control (unsigned long control)
+     i386_linux_dr_set (ptid, DR_CONTROL, control);
+ }
++/* Set address REGNUM (zero based) to ADDR in all LWPs of LWP_LIST.  */
++
+ static void
+ i386_linux_dr_set_addr (int regnum, CORE_ADDR addr)
+ {
+@@ -654,18 +662,55 @@ i386_linux_dr_set_addr (int regnum, CORE_ADDR addr)
+     i386_linux_dr_set (ptid, DR_FIRSTADDR + regnum, addr);
+ }
++/* Set address REGNUM (zero based) to zero in all LWPs of LWP_LIST.  */
++
+ static void
+ i386_linux_dr_reset_addr (int regnum)
+ {
+   i386_linux_dr_set_addr (regnum, 0);
  }
\f
  
-+static LONGEST
-+i386_linux_get_syscall_number (struct gdbarch *gdbarch,
-+                               ptid_t ptid)
++/* Get DR_STATUS from only the one LWP of INFERIOR_PTID.  */
++
+ static unsigned long
+ i386_linux_dr_get_status (void)
+ {
+   return i386_linux_dr_get (inferior_ptid, DR_STATUS);
+ }
++/* Unset VALUE bits in DR_STATUS in all LWPs of LWP_LIST.  */
++
++static void
++i386_linux_dr_unset_status (unsigned long mask)
 +{
-+  struct regcache *regcache = get_thread_regcache (ptid);
-+  /* The content of a register.  */
-+  gdb_byte buf[4];
-+  /* The result.  */
-+  LONGEST ret;
++  struct lwp_info *lp;
++  ptid_t ptid;
++
++  ALL_LWPS (lp, ptid)
++    {
++      unsigned long value;
++      
++      value = i386_linux_dr_get (ptid, DR_STATUS);
++      value &= ~mask;
++      i386_linux_dr_set (ptid, DR_STATUS, value);
++    }
++}
 +
-+  /* Getting the system call number from the register.
-+     When dealing with x86 architecture, this information
-+     is stored at %eax register.  */
-+  regcache_cooked_read (regcache, I386_LINUX_ORIG_EAX_REGNUM, buf);
++/* See i386_dr_low_type.detach.  Do not use wrappers i386_linux_dr_set_control
++   or i386_linux_dr_reset_addr as they would modify the register cache
++   (i386_linux_dr).  */
 +
-+  ret = extract_signed_integer (buf, 4);
++static void
++i386_linux_dr_detach (void)
++{
++  int regnum;
 +
-+  return ret;
++  i386_linux_dr_set (inferior_ptid, DR_CONTROL, 0);
++  i386_linux_dr_unset_status (~0UL);
++  for (regnum = DR_FIRSTADDR; regnum <= DR_LASTADDR; regnum++)
++    i386_linux_dr_set (inferior_ptid, regnum, 0);
 +}
 +
- /* The register sets used in GNU/Linux ELF core-dumps are identical to
-    the register sets in `struct user' that are used for a.out
-    core-dumps.  These are also used by ptrace(2).  The corresponding
-@@ -419,6 +443,9 @@ i386_linux_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
+ static void
+ i386_linux_new_thread (ptid_t ptid)
  {
-   struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
-+  /* Initializing common functions.  */
-+  linux_tdep_init (gdbarch);
-+
-   /* GNU/Linux uses ELF.  */
-   i386_elf_init_abi (info, gdbarch);
-@@ -472,6 +499,11 @@ i386_linux_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
-                                        displaced_step_at_entry_point);
-   set_gdbarch_get_siginfo_type (gdbarch, linux_get_siginfo_type);
+@@ -837,6 +882,8 @@ _initialize_i386_linux_nat (void)
+   i386_dr_low.set_addr = i386_linux_dr_set_addr;
+   i386_dr_low.reset_addr = i386_linux_dr_reset_addr;
+   i386_dr_low.get_status = i386_linux_dr_get_status;
++  i386_dr_low.unset_status = i386_linux_dr_unset_status;
++  i386_dr_low.detach = i386_linux_dr_detach;
+   i386_set_debug_register_length (4);
+   /* Override the default ptrace resume method.  */
+diff --git a/gdb/i386-nat.c b/gdb/i386-nat.c
+index ab1bd8a..ee330b8 100644
+--- a/gdb/i386-nat.c
++++ b/gdb/i386-nat.c
+@@ -137,8 +137,11 @@ struct i386_dr_low_type i386_dr_low;
+ #define I386_DR_GET_RW_LEN(i) \
+   ((dr_control_mirror >> (DR_CONTROL_SHIFT + DR_CONTROL_SIZE * (i))) & 0x0f)
++/* Mask that this I'th watchpoint has triggered.  */
++#define I386_DR_WATCH_MASK(i) (1 << (i))
++
+ /* Did the watchpoint whose address is in the I'th register break?  */
+-#define I386_DR_WATCH_HIT(i)  (dr_status_mirror & (1 << (i)))
++#define I386_DR_WATCH_HIT(i)  (dr_status_mirror & I386_DR_WATCH_MASK (i))
+ /* A macro to loop over all debug registers.  */
+ #define ALL_DEBUG_REGISTERS(i)        for (i = 0; i < DR_NADDR; i++)
+@@ -358,6 +361,10 @@ i386_insert_aligned_watchpoint (CORE_ADDR addr, unsigned len_rw_bits)
+   i386_dr_low.set_addr (i, addr);
+   i386_dr_low.set_control (dr_control_mirror);
++  /* Only a sanity check for leftover bits (set possibly only by inferior).  */
++  if (i386_dr_low.unset_status)
++    i386_dr_low.unset_status (I386_DR_WATCH_MASK (i));
 +
-+  /* Functions for 'catch syscall'.  */
-+  set_gdbarch_xml_syscall_filename (gdbarch, XML_SYSCALL_FILENAME_I386);
-+  set_gdbarch_get_syscall_number (gdbarch,
-+                                  i386_linux_get_syscall_number);
+   return 0;
  }
  
- /* Provide a prototype to silence -Wmissing-prototypes.  */
-diff --git a/gdb/inf-child.c b/gdb/inf-child.c
-index 38311f1..fc968cf 100644
---- a/gdb/inf-child.c
-+++ b/gdb/inf-child.c
-@@ -148,6 +148,15 @@ inf_child_remove_exec_catchpoint (int pid)
+@@ -387,6 +394,11 @@ i386_remove_aligned_watchpoint (CORE_ADDR addr, unsigned len_rw_bits)
+             i386_dr_low.set_control (dr_control_mirror);
+             if (i386_dr_low.reset_addr)
+               i386_dr_low.reset_addr (i);
++
++            /* Status must be already queried for each LWP.  Otherwise it will
++               be lost in all-stop mode + breakpoint always-inserted off.  */
++            if (i386_dr_low.unset_status)
++              i386_dr_low.unset_status (I386_DR_WATCH_MASK (i));
+           }
+         retval = 0;
+       }
+@@ -520,6 +532,17 @@ i386_remove_watchpoint (CORE_ADDR addr, int len, int type)
+   return retval;
  }
  
- static int
-+inf_child_set_syscall_catchpoint (int pid, int needed, int any_count,
-+                                int table_size, int *table)
++/* See target_detach_watchpoints.  */
++
++static int
++i386_detach_watchpoints (void)
 +{
-+  /* This version of Unix doesn't support notification of syscall
-+     events.  */
++  if (i386_dr_low.detach)
++    i386_dr_low.detach ();
++
 +  return 0;
 +}
 +
-+static int
- inf_child_can_run (void)
+ /* Return non-zero if we can watch a memory region that starts at
+    address ADDR and whose length is LEN bytes.  */
+@@ -575,28 +598,7 @@ static int
+ i386_stopped_by_watchpoint (void)
  {
-   return 1;
-@@ -190,6 +199,7 @@ inf_child_target (void)
-   t->to_follow_fork = inf_child_follow_fork;
-   t->to_insert_exec_catchpoint = inf_child_insert_exec_catchpoint;
-   t->to_remove_exec_catchpoint = inf_child_remove_exec_catchpoint;
-+  t->to_set_syscall_catchpoint = inf_child_set_syscall_catchpoint;
-   t->to_can_run = inf_child_can_run;
-   t->to_pid_to_exec_file = inf_child_pid_to_exec_file;
-   t->to_stratum = process_stratum;
-diff --git a/gdb/inf-ptrace.c b/gdb/inf-ptrace.c
-index f40b6b7..ff429c4 100644
---- a/gdb/inf-ptrace.c
-+++ b/gdb/inf-ptrace.c
-@@ -356,13 +356,19 @@ inf_ptrace_resume (struct target_ops *ops,
-                  ptid_t ptid, int step, enum target_signal signal)
+   CORE_ADDR addr = 0;
+-  return i386_stopped_data_address (&current_target, &addr);
+-}
+-
+-/* Return non-zero if the inferior has some break/watchpoint that
+-   triggered.  */
+-
+-static int
+-i386_stopped_by_hwbp (void)
+-{
+-  int i;
+-
+-  dr_status_mirror = i386_dr_low.get_status ();
+-  if (maint_show_dr)
+-    i386_show_dr ("stopped_by_hwbp", 0, 0, hw_execute);
+-
+-  ALL_DEBUG_REGISTERS(i)
+-    {
+-      if (I386_DR_WATCH_HIT (i))
+-      return 1;
+-    }
+-
+-  return 0;
++  return target_stopped_data_address (&current_target, &addr);
+ }
+ /* Insert a hardware-assisted breakpoint at BP_TGT->placed_address.
+@@ -690,6 +692,7 @@ i386_use_watchpoints (struct target_ops *t)
+   t->to_stopped_data_address = i386_stopped_data_address;
+   t->to_insert_watchpoint = i386_insert_watchpoint;
+   t->to_remove_watchpoint = i386_remove_watchpoint;
++  t->to_detach_watchpoints = i386_detach_watchpoints;
+   t->to_insert_hw_breakpoint = i386_insert_hw_breakpoint;
+   t->to_remove_hw_breakpoint = i386_remove_hw_breakpoint;
+ }
+diff --git a/gdb/i386-nat.h b/gdb/i386-nat.h
+index f49b9f6..cd31958 100644
+--- a/gdb/i386-nat.h
++++ b/gdb/i386-nat.h
+@@ -49,16 +49,23 @@ extern void i386_use_watchpoints (struct target_ops *);
+    functions are:
+       set_control              -- set the debug control (DR7)
+-                                register to a given value
++                                register to a given value for all LWPs
+       set_addr                 -- put an address into one debug
+-                                register
++                                register for all LWPs
+       reset_addr               -- reset the address stored in
+-                                one debug register
++                                one debug register for all LWPs
+       get_status               -- return the value of the debug
+-                                status (DR6) register.
++                                status (DR6) register for current LWP
++
++      unset_status             -- unset the specified bits of the debug
++                                status (DR6) register for all LWPs
++
++      detach                   -- clear all debug registers of only the
++                                INFERIOR_PTID task without affecting any
++                                register caches.
+    Additionally, the native file should set the debug_register_length
+    field to 4 or 8 depending on the number of bytes used for
+@@ -70,6 +77,8 @@ struct i386_dr_low_type
+     void (*set_addr) (int, CORE_ADDR);
+     void (*reset_addr) (int);
+     unsigned long (*get_status) (void);
++    void (*unset_status) (unsigned long);
++    void (*detach) (void);
+     int debug_register_length;
+   };
+diff --git a/gdb/infcmd.c b/gdb/infcmd.c
+index 9e98290..fab1892 100644
+--- a/gdb/infcmd.c
++++ b/gdb/infcmd.c
+@@ -801,7 +801,7 @@ nexti_command (char *count_string, int from_tty)
+   step_1 (1, 1, count_string);
+ }
+-static void
++void
+ delete_longjmp_breakpoint_cleanup (void *arg)
  {
-   pid_t pid = ptid_get_pid (ptid);
--  int request = PT_CONTINUE;
-+  int request;
-   if (pid == -1)
-     /* Resume all threads.  Traditionally ptrace() only supports
-        single-threaded processes, so simply resume the inferior.  */
-     pid = ptid_get_pid (inferior_ptid);
-+  if (target_passed_by_entrypoint () > 0
-+      && catch_syscall_enabled () > 0)
-+    request = PT_SYSCALL;
-+  else
-+    request = PT_CONTINUE;
-+
-   if (step)
+   int thread = * (int *) arg;
+@@ -841,10 +841,13 @@ step_1 (int skip_subroutines, int single_inst, char *count_string)
+   if (!single_inst || skip_subroutines)               /* leave si command alone */
      {
-       /* If this system does not support PT_STEP, a higher level
-diff --git a/gdb/infcall.c b/gdb/infcall.c
-index d6da8b2..80168b3 100644
---- a/gdb/infcall.c
-+++ b/gdb/infcall.c
-@@ -98,6 +98,28 @@ Unwinding of stack if a signal is received while in a call dummy is %s.\n"),
-                   value);
++      struct thread_info *tp = inferior_thread ();
++
+       if (in_thread_list (inferior_ptid))
+       thread = pid_to_thread_id (inferior_ptid);
+       set_longjmp_breakpoint (thread);
++      tp->initiating_frame = get_frame_id (get_current_frame ());
+       make_cleanup (delete_longjmp_breakpoint_cleanup, &thread);
+     }
+@@ -1193,6 +1196,15 @@ signal_command (char *signum_exp, int from_tty)
+   proceed ((CORE_ADDR) -1, oursig, 0);
  }
  
-+/* This boolean tells what gdb should do if a std::terminate call is
-+   made while in a function called from gdb (call dummy).  
-+   As the confines of a single dummy stack prohibit out-of-frame
-+   handlers from handling a raised exception, and as out-of-frame
-+   handlers are common in C++, this can lead to no handler being found
-+   by the unwinder, and a std::terminate call. This is a false positive.
-+   If set, gdb unwinds the stack and restores the context to what it 
-+   was before the call.
-+
-+   The default is to unwind the frame if a std::terminate call is made.. */
++/* A continuation callback for until_next_command.  */
 +
-+static int unwind_on_terminating_exception_p = 1;
 +static void
-+show_unwind_on_terminating_exception_p (struct ui_file *file, int from_tty,
-+                                      struct cmd_list_element *c,
-+                                      const char *value)
-+
++until_next_continuation (void *arg)
 +{
-+  fprintf_filtered (file, _("\
-+Unwind stack if a C++ exception is unhandled while in a call dummy is %s.\n"),
-+                  value);
++  struct thread_info *tp = arg;
++  delete_longjmp_breakpoint (tp->num);
 +}
++
+ /* Proceed until we reach a different source line with pc greater than
+    our current one or exit the function.  We skip calls in both cases.
  
- /* Perform the standard coercions that are specified
-    for arguments to be passed to C or Ada functions.
-@@ -217,7 +239,7 @@ find_function_addr (struct value *function, struct type **retval_type)
-   /* Determine address to call.  */
-   if (code == TYPE_CODE_FUNC || code == TYPE_CODE_METHOD)
-     {
--      funaddr = VALUE_ADDRESS (function);
-+      funaddr = value_address (function);
-       value_type = TYPE_TARGET_TYPE (ftype);
-     }
-   else if (code == TYPE_CODE_PTR)
-@@ -419,6 +441,8 @@ call_function_by_hand (struct value *function, int nargs, struct value **args)
-   struct cleanup *args_cleanup;
-   struct frame_info *frame;
-   struct gdbarch *gdbarch;
-+  struct breakpoint *terminate_bp = 0;
-+  struct minimal_symbol *tm;
-   ptid_t call_thread_ptid;
-   struct gdb_exception e;
-   const char *name;
-@@ -718,6 +742,29 @@ call_function_by_hand (struct value *function, int nargs, struct value **args)
-     bpt = set_momentary_breakpoint (sal, dummy_id, bp_call_dummy);
-     bpt->disposition = disp_del;
-   }
-+  
-+  /* Create a breakpoint in std::terminate. 
-+     If a C++ exception is raised in the dummy-frame, and the 
-+     exception handler is (normally, and expected to be) out-of-frame, 
-+     the default C++ handler will (wrongly) be called in an inferior
-+     function call.  This is wrong, as an exception can be  normally
-+     and legally handled out-of-frame. The confines of the dummy frame
-+     prevent the unwinder from finding the correct handler (or any
-+     handler, unless it is in-frame). The default handler calls
-+     std::terminate. This will kill the inferior. Assert that
-+     terminate should never be called in an inferior function
-+     call. Place a momentary breakpoint in the std::terminate function
-+     and if triggered in the call, rewind */
-+  if (unwind_on_terminating_exception_p)
-+     {
-+       tm = lookup_minimal_symbol ("std::terminate()", NULL, NULL); 
-+       if (tm != NULL) 
-+       {
-+        terminate_bp = set_momentary_breakpoint_at_pc
-+          (SYMBOL_VALUE_ADDRESS (tm),  bp_breakpoint);
-+        make_cleanup_delete_breakpoint (terminate_bp);
-+      }
-+     }
+@@ -1209,6 +1221,8 @@ until_next_command (int from_tty)
+   struct symbol *func;
+   struct symtab_and_line sal;
+   struct thread_info *tp = inferior_thread ();
++  int thread = tp->num;
++  struct cleanup *old_chain;
  
-   /* Everything's ready, push all the info needed to restore the
-      caller (and identify the dummy-frame) onto the dummy-frame
-@@ -828,6 +875,16 @@ When the function is done executing, GDB will silently stop."),
-              name);
-     }
+   clear_proceed_status ();
+   set_step_frame ();
+@@ -1244,7 +1258,19 @@ until_next_command (int from_tty)
+   tp->step_multi = 0;         /* Only one call to proceed */
  
-+  if (! target_has_execution)
++  set_longjmp_breakpoint (thread);
++  tp->initiating_frame = get_frame_id (frame);
++  old_chain = make_cleanup (delete_longjmp_breakpoint_cleanup, &thread);
++
+   proceed ((CORE_ADDR) -1, TARGET_SIGNAL_DEFAULT, 1);
++
++  if (target_can_async_p () && is_running (inferior_ptid))
 +    {
-+      /* If we try to restore the inferior status (via the cleanup),
-+       we'll crash as the inferior is no longer running.  */
-+      discard_cleanups (inf_status_cleanup);
-+      discard_inferior_status (inf_status);
-+      error (_("\
-+The program being debugged exited while in a function called from GDB."));
++      discard_cleanups (old_chain);
++      add_continuation (tp, until_next_continuation, tp, NULL);
 +    }
++  else
++    do_cleanups (old_chain);
+ }
+ static void
+@@ -1421,6 +1447,7 @@ finish_command_continuation (void *arg)
+   if (bs != NULL && tp->proceed_to_finish)
+     observer_notify_normal_stop (bs, 1 /* print frame */);
+   delete_breakpoint (a->breakpoint);
++  delete_longjmp_breakpoint (inferior_thread ()->num);
+ }
+ static void
+@@ -1504,6 +1531,7 @@ finish_forward (struct symbol *function, struct frame_info *frame)
+   struct breakpoint *breakpoint;
+   struct cleanup *old_chain;
+   struct finish_command_continuation_args *cargs;
++  int thread = tp->num;
+   sal = find_pc_line (get_frame_pc (frame), 0);
+   sal.pc = get_frame_pc (frame);
+@@ -1514,6 +1542,10 @@ finish_forward (struct symbol *function, struct frame_info *frame)
+   old_chain = make_cleanup_delete_breakpoint (breakpoint);
++  set_longjmp_breakpoint (thread);
++  tp->initiating_frame = get_frame_id (frame);
++  make_cleanup (delete_longjmp_breakpoint_cleanup, &thread);
 +
-   if (stopped_by_random_signal || !stop_stack_dummy)
-     {
-       const char *name = get_function_name (funaddr,
-@@ -884,6 +941,38 @@ When the function is done executing, GDB will silently stop."),
+   tp->proceed_to_finish = 1;    /* We want stop_registers, please...  */
+   proceed ((CORE_ADDR) -1, TARGET_SIGNAL_DEFAULT, 0);
  
-       if (!stop_stack_dummy)
-       {
-+        
-+        /* Check if unwind on terminating exception behaviour is on */
-+        if (unwind_on_terminating_exception_p)
-+          {
-+            /* Check that the breakpoint is our special std::terminate
-+               breakpoint. If it is, we do not want to kill the inferior
-+               in an inferior function call. Rewind, and warn the user */
-+            
-+            if ((terminate_bp != NULL) &&
-+                (inferior_thread()->stop_bpstat->breakpoint_at->address
-+                 == terminate_bp->loc->address)) 
-+              
-+              
-+              {
-+                
-+                /* We must get back to the frame we were before the
-+                   dummy call.  */
-+                dummy_frame_pop (dummy_id);
-+                
-+                /* We also need to restore inferior status to that before the
-+                   dummy call.  */
-+                restore_inferior_status (inf_status);
-+                
-+                error (_("\
-+The program being debugged entered a std::terminate call which would\n\
-+have terminated the program being debugged.  GDB has restored the\n\
-+context to what it was before the call\n\
-+To change this behaviour use \"set unwind-on-terminating-exception off\"\n\
-+Evaluation of the expression containing the function (%s) will be abandoned."), 
-+                       name);
-+              }
-+          } 
-         /* We hit a breakpoint inside the FUNCTION.
-            Keep the dummy frame, the user may want to examine its state.
-            Discard inferior status, we're not at the same point
-@@ -992,4 +1081,19 @@ The default is to stop in the frame where the signal was received."),
-                          NULL,
-                          show_unwind_on_signal_p,
-                          &setlist, &showlist);
-+
-+  add_setshow_boolean_cmd ("unwind-on-terminating-exception", no_class,
-+                         &unwind_on_terminating_exception_p, _("\
-+Set unwinding of stack if a std::terminate() call originates from\n\
-+the default C++ exception handler."), _("\
-+Show unwinding of stack if a std::terminate() call originates from\n\
-+the default C++ exception handler."), _("\
-+The unwind on terminating exception flag lets the user determine\n\
-+what gdb should do if a std::terminate() call is made from the\n\
-+default exception handler.\n\
-+The default is to unwind the frame."),
-+                         NULL,
-+                         show_unwind_on_terminating_exception_p,
-+                         &setlist, &showlist);
+diff --git a/gdb/inferior.h b/gdb/inferior.h
+index f1b5d17..31add7d 100644
+--- a/gdb/inferior.h
++++ b/gdb/inferior.h
+@@ -272,6 +272,8 @@ extern void interrupt_target_command (char *args, int from_tty);
+ extern void interrupt_target_1 (int all_threads);
++extern void delete_longjmp_breakpoint_cleanup (void *arg);
 +
- }
-diff --git a/gdb/infcmd.c b/gdb/infcmd.c
-index 0a17dab..d48f4b1 100644
---- a/gdb/infcmd.c
-+++ b/gdb/infcmd.c
-@@ -466,6 +466,11 @@ run_command_1 (char *args, int from_tty, int tbreak_at_main)
-   init_wait_for_inferior ();
-   clear_breakpoint_hit_counts ();
-+  /* If we already caught a syscall catchpoint, then reset its
-+     syscall_number information because we are starting all over
-+     again.  */
-+  clear_syscall_catchpoints_info ();
-+
-   /* Clean up any leftovers from other runs.  Some other things from
-      this function should probably be moved into target_pre_inferior.  */
-   target_pre_inferior (from_tty);
+ extern void detach_command (char *, int);
+ extern void notice_new_inferior (ptid_t, int, int);
 diff --git a/gdb/infrun.c b/gdb/infrun.c
-index ee5f987..2f627ea 100644
+index 1a83a25..2ee2164 100644
 --- a/gdb/infrun.c
 +++ b/gdb/infrun.c
-@@ -1046,7 +1046,7 @@ a command like `return' or `jump' to continue execution."));
-         }
-     }
+@@ -45,6 +45,8 @@
+ #include "language.h"
+ #include "solib.h"
+ #include "main.h"
++#include "dictionary.h"
++#include "block.h"
+ #include "gdb_assert.h"
+ #include "mi/mi-common.h"
+ #include "event-top.h"
+@@ -1782,6 +1784,8 @@ static void insert_step_resume_breakpoint_at_sal (struct gdbarch *gdbarch,
+                                                 struct symtab_and_line sr_sal,
+                                                 struct frame_id sr_id);
+ static void insert_longjmp_resume_breakpoint (struct gdbarch *, CORE_ADDR);
++static void check_exception_resume (struct execution_control_state *,
++                                  struct frame_info *, struct symbol *);
  
--  /* If there were any forks/vforks/execs that were caught and are
-+  /* If there were any forks/vforks/execs/syscalls that were caught and are
-      now to be followed, then do so.  */
-   switch (pending_follow.kind)
-     {
-@@ -1069,6 +1069,11 @@ a command like `return' or `jump' to continue execution."));
-       pending_follow.kind = TARGET_WAITKIND_SPURIOUS;
-       break;
+ static void stop_stepping (struct execution_control_state *ecs);
+ static void prepare_to_wait (struct execution_control_state *ecs);
+@@ -2687,6 +2691,10 @@ handle_inferior_event (struct execution_control_state *ecs)
  
-+    case TARGET_WAITKIND_SYSCALL_ENTRY:
-+    case TARGET_WAITKIND_SYSCALL_RETURN:
-+      pending_follow.kind = TARGET_WAITKIND_SPURIOUS;
-+      break;
+       stop_pc = regcache_read_pc (get_thread_regcache (ecs->ptid));
++      /* Clear WATCHPOINT_TRIGGERED values from previous stop which could
++       confuse bpstat_stop_status and bpstat_explains_signal.  */
++      watchpoints_triggered (&ecs->ws);
 +
-     default:
-       break;
-     }
-@@ -1509,7 +1514,7 @@ init_wait_for_inferior (void)
+       ecs->event_thread->stop_bpstat = bpstat_stop_status (stop_pc, ecs->ptid);
  
-   breakpoint_init_inferior (inf_starting);
+       ecs->random_signal = !bpstat_explains_signal (ecs->event_thread->stop_bpstat);
+@@ -2724,6 +2732,10 @@ handle_inferior_event (struct execution_control_state *ecs)
  
--  /* The first resume is not following a fork/vfork/exec. */
-+  /* The first resume is not following a fork/vfork/exec/syscall.  */
-   pending_follow.kind = TARGET_WAITKIND_SPURIOUS;     /* I.e., none. */
+       stop_pc = regcache_read_pc (get_thread_regcache (ecs->ptid));
  
-   clear_proceed_status ();
-@@ -2155,6 +2160,50 @@ ensure_not_running (void)
-     error_is_running ();
++      /* Clear WATCHPOINT_TRIGGERED values from previous stop which could
++       confuse bpstat_stop_status and bpstat_explains_signal.  */
++      watchpoints_triggered (&ecs->ws);
++
+       /* This causes the eventpoints and symbol table to be reset.
+          Must do this now, before trying to determine whether to
+          stop.  */
+@@ -3468,23 +3480,33 @@ process_event_stop_test:
+       ecs->event_thread->stepping_over_breakpoint = 1;
+-      if (!gdbarch_get_longjmp_target_p (gdbarch)
+-          || !gdbarch_get_longjmp_target (gdbarch, frame, &jmp_buf_pc))
++      if (what.is_longjmp)
+         {
+-          if (debug_infrun)
+-            fprintf_unfiltered (gdb_stdlog, "\
++          if (!gdbarch_get_longjmp_target_p (gdbarch)
++              || !gdbarch_get_longjmp_target (gdbarch,
++                                              frame, &jmp_buf_pc))
++            {
++              if (debug_infrun)
++                fprintf_unfiltered (gdb_stdlog, "\
+ infrun: BPSTAT_WHAT_SET_LONGJMP_RESUME (!gdbarch_get_longjmp_target)\n");
+-          keep_going (ecs);
+-          return;
+-        }
++              keep_going (ecs);
++              return;
++            }
+-      /* We're going to replace the current step-resume breakpoint
+-         with a longjmp-resume breakpoint.  */
+-      delete_step_resume_breakpoint (ecs->event_thread);
++          /* We're going to replace the current step-resume breakpoint
++             with a longjmp-resume breakpoint.  */
++          delete_step_resume_breakpoint (ecs->event_thread);
+-      /* Insert a breakpoint at resume address.  */
+-      insert_longjmp_resume_breakpoint (gdbarch, jmp_buf_pc);
++          /* Insert a breakpoint at resume address.  */
++          insert_longjmp_resume_breakpoint (gdbarch, jmp_buf_pc);
++        }
++      else
++        {
++          struct symbol *func = get_frame_function (frame);
++          if (func)
++            check_exception_resume (ecs, frame, func);
++        }
+       keep_going (ecs);
+       return;
+@@ -3496,6 +3518,53 @@ infrun: BPSTAT_WHAT_SET_LONGJMP_RESUME (!gdbarch_get_longjmp_target)\n");
+       gdb_assert (ecs->event_thread->step_resume_breakpoint != NULL);
+       delete_step_resume_breakpoint (ecs->event_thread);
++      if (!what.is_longjmp)
++        {
++          /* There are several cases to consider.
++             
++             1. The initiating frame no longer exists.  In this case
++             we must stop, because the exception has gone too far.
++             
++             2. The initiating frame exists, and is the same as the
++             current frame.
++             
++             2.1. If we are stepping, defer to the stepping logic.
++             
++             2.2. Otherwise, we are not stepping, so we are doing a
++             "finish" and we have reached the calling frame.  So,
++             stop.
++             
++             3. The initiating frame exists and is different from
++             the current frame.  This means the exception has been
++             caught beneath the initiating frame, so keep going.  */
++          struct frame_info *init_frame
++            = frame_find_by_id (ecs->event_thread->initiating_frame);
++          if (init_frame)
++            {
++              struct frame_id current_id
++                = get_frame_id (get_current_frame ());
++              if (frame_id_eq (current_id,
++                               ecs->event_thread->initiating_frame))
++                {
++                  if (ecs->event_thread->step_range_start)
++                    {
++                      /* Case 2.1.  */
++                      break;
++                    }
++                  else
++                    {
++                      /* Case 2.2: fall through.  */
++                    }
++                }
++              else
++                {
++                  /* Case 3.  */
++                  keep_going (ecs);
++                  return;
++                }
++            }
++        }
++
+       ecs->event_thread->stop_step = 1;
+       print_stop_reason (END_STEPPING_RANGE, 0);
+       stop_stepping (ecs);
+@@ -4500,6 +4569,96 @@ insert_longjmp_resume_breakpoint (struct gdbarch *gdbarch, CORE_ADDR pc)
+     set_momentary_breakpoint_at_pc (gdbarch, pc, bp_longjmp_resume);
  }
  
-+/* Auxiliary function that handles syscall entry/return events.
-+   It returns 1 if the inferior should keep going (and GDB
-+   should ignore the event), or 0 if the event deserves to be
-+   processed.  */
-+static int
-+deal_with_syscall_event (struct execution_control_state *ecs)
++/* Insert an exception resume breakpoint.  TP is the thread throwing
++   the exception.  The block B is the block of the unwinder debug hook
++   function.  FRAME is the frame corresponding to the call to this
++   function.  SYM is the symbol of the function argument holding the
++   target PC of the exception.  */
++
++static void
++insert_exception_resume_breakpoint (struct thread_info *tp,
++                                  struct block *b,
++                                  struct frame_info *frame,
++                                  struct symbol *sym)
 +{
-+  int syscall_number = gdbarch_get_syscall_number (current_gdbarch,
-+                                                   ecs->ptid);
-+  if (catch_syscall_enabled () > 0
-+      && catching_syscall_number (syscall_number) > 0)
-+    {
-+      ecs->event_thread->stop_signal = TARGET_SIGNAL_TRAP;
-+      pending_follow.kind = ecs->ws.kind;
++  struct gdb_exception e;
 +
-+      if (!ptid_equal (ecs->ptid, inferior_ptid))
-+        {
-+          context_switch (ecs->ptid);
-+          reinit_frame_cache ();
-+        }
++  /* We want to ignore errors here.  */
++  TRY_CATCH (e, RETURN_MASK_ALL)
++    {
++      struct symbol *vsym;
++      struct value *value;
++      CORE_ADDR handler;
++      struct breakpoint *bp;
 +
-+      stop_pc = read_pc ();
++      vsym = lookup_symbol (SYMBOL_LINKAGE_NAME (sym), b, VAR_DOMAIN, NULL);
++      value = read_var_value (vsym, frame);
++      handler = value_as_address (value);
 +
-+      ecs->event_thread->stop_bpstat = bpstat_stop_status (stop_pc, ecs->ptid);
++      /* We're going to replace the current step-resume breakpoint
++       with an exception-resume breakpoint.  */
++      delete_step_resume_breakpoint (tp);
 +
-+      ecs->random_signal = !bpstat_explains_signal (ecs->event_thread->stop_bpstat);
++      if (debug_infrun)
++      fprintf_unfiltered (gdb_stdlog,
++                          "infrun: exception resume at %lx\n",
++                          (unsigned long) handler);
 +
-+      /* If no catchpoint triggered for this, then keep going.  */
-+      if (ecs->random_signal)
-+        {
-+          ecs->event_thread->stop_signal = TARGET_SIGNAL_0;
-+          keep_going (ecs);
-+          return 1;
-+        }
-+      return 0;
-+    }
-+  else
-+    {
-+      resume (0, TARGET_SIGNAL_0);
-+      prepare_to_wait (ecs);
-+      return 1;
++      bp = set_momentary_breakpoint_at_pc (get_frame_arch (frame),
++                                         handler, bp_exception_resume);
++      inferior_thread ()->step_resume_breakpoint = bp;
 +    }
 +}
 +
- /* Given an execution control state that has been freshly filled in
-    by an event from the inferior, figure out what it means and take
-    appropriate action.  */
-@@ -2449,9 +2498,11 @@ handle_inferior_event (struct execution_control_state *ecs)
-     case TARGET_WAITKIND_SYSCALL_ENTRY:
-       if (debug_infrun)
-         fprintf_unfiltered (gdb_stdlog, "infrun: TARGET_WAITKIND_SYSCALL_ENTRY\n");
--      resume (0, TARGET_SIGNAL_0);
--      prepare_to_wait (ecs);
--      return;
-+      /* Getting the current syscall number */
-+      if (deal_with_syscall_event (ecs) != 0)
-+        return;
-+      goto process_event_stop_test;
-+      break;
-       /* Before examining the threads further, step this thread to
-          get it entirely out of the syscall.  (We get notice of the
-@@ -2461,9 +2512,10 @@ handle_inferior_event (struct execution_control_state *ecs)
-     case TARGET_WAITKIND_SYSCALL_RETURN:
-       if (debug_infrun)
-         fprintf_unfiltered (gdb_stdlog, "infrun: TARGET_WAITKIND_SYSCALL_RETURN\n");
--      target_resume (ecs->ptid, 1, TARGET_SIGNAL_0);
--      prepare_to_wait (ecs);
--      return;
-+      if (deal_with_syscall_event (ecs) != 0)
-+        return;
-+      goto process_event_stop_test;
-+      break;
-     case TARGET_WAITKIND_STOPPED:
-       if (debug_infrun)
-@@ -5166,6 +5218,25 @@ inferior_has_execd (ptid_t pid, char **execd_pathname)
-   return 1;
- }
-+int
-+inferior_has_called_syscall (ptid_t pid, int *syscall_number)
-+{
-+  struct target_waitstatus last;
-+  ptid_t last_ptid;
-+
-+  get_last_target_status (&last_ptid, &last);
++/* This is called when an exception has been intercepted.  Check to
++   see whether the exception's destination is of interest, and if so,
++   set an exception resume breakpoint there.  */
 +
-+  if (last.kind != TARGET_WAITKIND_SYSCALL_ENTRY &&
-+      last.kind != TARGET_WAITKIND_SYSCALL_RETURN)
-+    return 0;
++static void
++check_exception_resume (struct execution_control_state *ecs,
++                      struct frame_info *frame, struct symbol *func)
++{
++  struct gdb_exception e;
 +
-+  if (!ptid_equal (last_ptid, pid))
-+    return 0;
++  TRY_CATCH (e, RETURN_MASK_ALL)
++    {
++      struct block *b;
++      struct dict_iterator iter;
++      struct symbol *sym;
++      int argno = 0;
++
++      /* The exception breakpoint is a thread-specific breakpoint on
++       the unwinder's debug hook, declared as:
++       
++       void _Unwind_DebugHook (void *cfa, void *handler);
++       
++       The CFA argument indicates the frame to which control is
++       about to be transferred.  HANDLER is the destination PC.
++       
++       We ignore the CFA and set a temporary breakpoint at HANDLER.
++       This is not extremely efficient but it avoids issues in gdb
++       with computing the DWARF CFA, and it also works even in weird
++       cases such as throwing an exception from inside a signal
++       handler.  */
++
++      b = SYMBOL_BLOCK_VALUE (func);
++      ALL_BLOCK_SYMBOLS (b, iter, sym)
++      {
++        if (!SYMBOL_IS_ARGUMENT (sym))
++          continue;
 +
-+  *syscall_number = last.value.syscall_number;
-+  return 1;
++        if (argno == 0)
++          ++argno;
++        else
++          {
++            insert_exception_resume_breakpoint (ecs->event_thread,
++                                                b, frame, sym);
++            break;
++          }
++      }
++    }
 +}
 +
- /* Oft used ptids */
- ptid_t null_ptid;
- ptid_t minus_one_ptid;
+ static void
+ stop_stepping (struct execution_control_state *ecs)
+ {
+@@ -4568,6 +4727,8 @@ keep_going (struct execution_control_state *ecs)
+           }
+         if (e.reason < 0)
+           {
++            if (debug_infrun)
++              exception_fprintf (gdb_stdlog, e, "infrun: exception while inserting breakpoints: ");
+             stop_stepping (ecs);
+             return;
+           }
 diff --git a/gdb/jv-lang.c b/gdb/jv-lang.c
-index b702ebf..a211adf 100644
+index 6b68e7d..5095180 100644
 --- a/gdb/jv-lang.c
 +++ b/gdb/jv-lang.c
-@@ -61,7 +61,8 @@ static char *get_java_utf8_name (struct obstack *obstack, struct value *name);
- static int java_class_is_primitive (struct value *clas);
- static struct value *java_value_string (char *ptr, int len);
--static void java_emit_char (int c, struct ui_file * stream, int quoter);
-+static void java_emit_char (int c, struct type *type,
-+                          struct ui_file * stream, int quoter);
- static char *java_class_name_from_physname (const char *physname);
-@@ -210,8 +211,7 @@ get_java_utf8_name (struct obstack *obstack, struct value *name)
-   CORE_ADDR data_addr;
-   temp = value_struct_elt (&temp, NULL, "length", NULL, "structure");
-   name_length = (int) value_as_long (temp);
--  data_addr = VALUE_ADDRESS (temp) + value_offset (temp)
--    + TYPE_LENGTH (value_type (temp));
-+  data_addr = value_address (temp) + TYPE_LENGTH (value_type (temp));
-   chrs = obstack_alloc (obstack, name_length + 1);
-   chrs[name_length] = '\0';
-   read_memory (data_addr, (gdb_byte *) chrs, name_length);
-@@ -266,7 +266,7 @@ type_from_class (struct value *clas)
-       return NULL;
-       clas = value_ind (clas);
-     }
--  addr = VALUE_ADDRESS (clas) + value_offset (clas);
-+  addr = value_address (clas);
- #if 0
-   get_java_class_symtab ();
-@@ -302,7 +302,7 @@ type_from_class (struct value *clas)
-   if (type != NULL)
-     return type;
--  type = alloc_type (objfile);
-+  type = alloc_type (objfile, NULL);
-   TYPE_CODE (type) = TYPE_CODE_STRUCT;
-   INIT_CPLUS_SPECIFIC (type);
-@@ -422,7 +422,7 @@ java_link_class_type (struct type *type, struct value *clas)
-   fields = NULL;
-   nfields--;                  /* First set up dummy "class" field. */
-   SET_FIELD_PHYSADDR (TYPE_FIELD (type, nfields),
--                    VALUE_ADDRESS (clas) + value_offset (clas));
-+                    value_address (clas));
-   TYPE_FIELD_NAME (type, nfields) = "class";
-   TYPE_FIELD_TYPE (type, nfields) = value_type (clas);
-   SET_TYPE_FIELD_PRIVATE (type, nfields);
-@@ -439,7 +439,9 @@ java_link_class_type (struct type *type, struct value *clas)
-       }
-       else
-       {                       /* Re-use field value for next field. */
--        VALUE_ADDRESS (field) += TYPE_LENGTH (value_type (field));
-+        CORE_ADDR addr
-+          = value_address (field) + TYPE_LENGTH (value_type (field));
-+        set_value_address (field, addr);
-         set_value_lazy (field, 1);
-       }
-       temp = field;
-@@ -509,7 +511,9 @@ java_link_class_type (struct type *type, struct value *clas)
-       }
-       else
-       {                       /* Re-use method value for next method. */
--        VALUE_ADDRESS (method) += TYPE_LENGTH (value_type (method));
-+        CORE_ADDR addr
-+          = value_address (method) + TYPE_LENGTH (value_type (method));
-+        set_value_address (method, addr);
-         set_value_lazy (method, 1);
-       }
-@@ -796,7 +800,7 @@ java_value_string (char *ptr, int len)
-    characters and strings is language specific. */
- static void
--java_emit_char (int c, struct ui_file *stream, int quoter)
-+java_emit_char (int c, struct type *type, struct ui_file *stream, int quoter)
+@@ -1121,6 +1121,7 @@ const struct exp_descriptor exp_descriptor_java =
  {
-   switch (c)
-     {
-diff --git a/gdb/jv-valprint.c b/gdb/jv-valprint.c
-index d3606fd..cdcb440 100644
---- a/gdb/jv-valprint.c
-+++ b/gdb/jv-valprint.c
-@@ -45,7 +45,7 @@ java_value_print (struct value *val, struct ui_file *stream,
-   struct value_print_options opts;
-   type = value_type (val);
--  address = VALUE_ADDRESS (val) + value_offset (val);
-+  address = value_address (val);
-   if (is_object_type (type))
-     {
-@@ -143,8 +143,8 @@ java_value_print (struct value *val, struct ui_file *stream,
-         struct value *v = allocate_value (el_type);
-         struct value *next_v = allocate_value (el_type);
--        VALUE_ADDRESS (v) = address + JAVA_OBJECT_SIZE + 4;
--        VALUE_ADDRESS (next_v) = VALUE_ADDRESS (v);
-+        set_value_address (v, address + JAVA_OBJECT_SIZE + 4);
-+        set_value_address (next_v, value_raw_address (v));
-         while (i < length && things_printed < options->print_max)
-           {
-@@ -230,7 +230,7 @@ java_value_print (struct value *val, struct ui_file *stream,
-       value_free_to_mark (mark);      /* Release unnecessary values */
+   print_subexp_standard,
+   operator_length_standard,
++  operator_check_standard,
+   op_name_standard,
+   dump_subexp_body_standard,
+   evaluate_subexp_java
+diff --git a/gdb/language.h b/gdb/language.h
+index c650e07..660fdf6 100644
+--- a/gdb/language.h
++++ b/gdb/language.h
+@@ -237,7 +237,6 @@ struct language_defn
+        variables.  */
  
--      val_print_string (data + boffset, count, 2, stream, options);
-+      val_print_string (java_char_type, data + boffset, count, stream, options);
-       return 0;
-     }
-@@ -520,7 +520,7 @@ java_val_print (struct type *type, const gdb_byte *valaddr,
-              || (TYPE_CODE (type) == TYPE_CODE_INT
-                  && TYPE_LENGTH (type) == 2
-                  && strcmp (TYPE_NAME (type), "char") == 0))
--      LA_PRINT_CHAR ((int) unpack_long (type, valaddr), stream);
-+      LA_PRINT_CHAR ((int) unpack_long (type, valaddr), type, stream);
-       else
-       val_print_type_code_int (type, valaddr, stream);
-       break;
-diff --git a/gdb/language.c b/gdb/language.c
-index 3c37a64..6209d7f 100644
---- a/gdb/language.c
-+++ b/gdb/language.c
-@@ -65,9 +65,11 @@ static void set_check (char *, int);
- static void set_type_range_case (void);
--static void unk_lang_emit_char (int c, struct ui_file *stream, int quoter);
-+static void unk_lang_emit_char (int c, struct type *type,
-+                              struct ui_file *stream, int quoter);
--static void unk_lang_printchar (int c, struct ui_file *stream);
-+static void unk_lang_printchar (int c, struct type *type,
-+                              struct ui_file *stream);
- static void unk_lang_print_type (struct type *, char *, struct ui_file *,
-                                int, int);
-@@ -1065,20 +1067,22 @@ unk_lang_error (char *msg)
- }
- static void
--unk_lang_emit_char (int c, struct ui_file *stream, int quoter)
-+unk_lang_emit_char (int c, struct type *type, struct ui_file *stream,
-+                  int quoter)
- {
-   error (_("internal error - unimplemented function unk_lang_emit_char called."));
- }
- static void
--unk_lang_printchar (int c, struct ui_file *stream)
-+unk_lang_printchar (int c, struct type *type, struct ui_file *stream)
- {
-   error (_("internal error - unimplemented function unk_lang_printchar called."));
- }
- static void
--unk_lang_printstr (struct ui_file *stream, const gdb_byte *string,
--                 unsigned int length, int width, int force_ellipses,
-+unk_lang_printstr (struct ui_file *stream, struct type *type,
-+                 const gdb_byte *string, unsigned int length,
-+                 int force_ellipses,
-                  const struct value_print_options *options)
- {
-   error (_("internal error - unimplemented function unk_lang_printstr called."));
-diff --git a/gdb/language.h b/gdb/language.h
-index 85826fd..e5f80ab 100644
---- a/gdb/language.h
-+++ b/gdb/language.h
-@@ -186,14 +186,15 @@ struct language_defn
-     void (*la_post_parser) (struct expression ** expp, int void_context_p);
--    void (*la_printchar) (int ch, struct ui_file * stream);
-+    void (*la_printchar) (int ch, struct type *chtype, struct ui_file * stream);
--    void (*la_printstr) (struct ui_file * stream, const gdb_byte *string,
--                       unsigned int length, int width,
-+    void (*la_printstr) (struct ui_file * stream, struct type *elttype,
-+                       const gdb_byte *string, unsigned int length,
-                        int force_ellipses,
-                        const struct value_print_options *);
--    void (*la_emitchar) (int ch, struct ui_file * stream, int quoter);
-+    void (*la_emitchar) (int ch, struct type *chtype,
-+                       struct ui_file * stream, int quoter);
-     /* Print a type using syntax appropriate for this language. */
-@@ -381,13 +382,13 @@ extern enum language set_language (enum language);
- #define LA_VALUE_PRINT(val,stream,options) \
-   (current_language->la_value_print(val,stream,options))
--#define LA_PRINT_CHAR(ch, stream) \
--  (current_language->la_printchar(ch, stream))
--#define LA_PRINT_STRING(stream, string, length, width, force_ellipses,options) \
--  (current_language->la_printstr(stream, string, length, width, \
-+#define LA_PRINT_CHAR(ch, type, stream) \
-+  (current_language->la_printchar(ch, type, stream))
-+#define LA_PRINT_STRING(stream, elttype, string, length, force_ellipses,options) \
-+  (current_language->la_printstr(stream, elttype, string, length, \
-                                force_ellipses,options))
--#define LA_EMIT_CHAR(ch, stream, quoter) \
--  (current_language->la_emitchar(ch, stream, quoter))
-+#define LA_EMIT_CHAR(ch, type, stream, quoter) \
-+  (current_language->la_emitchar(ch, type, stream, quoter))
- #define LA_GET_STRING(value, buffer, length, encoding) \
-   (current_language->la_get_string(value, buffer, length, encoding))
+     struct symbol *(*la_lookup_symbol_nonlocal) (const char *,
+-                                               const char *,
+                                                const struct block *,
+                                                const domain_enum);
  
 diff --git a/gdb/linespec.c b/gdb/linespec.c
-index 6579d42..b3ae6c0 100644
+index 3e943a1..b96d425 100644
 --- a/gdb/linespec.c
 +++ b/gdb/linespec.c
-@@ -842,13 +842,33 @@ decode_line_1 (char **argptr, int funfirstline, struct symtab *default_symtab,
+@@ -30,6 +30,7 @@
+ #include "value.h"
+ #include "completer.h"
+ #include "cp-abi.h"
++#include "cp-support.h"
+ #include "parser-defs.h"
+ #include "block.h"
+ #include "objc-lang.h"
+@@ -839,13 +840,33 @@ decode_line_1 (char **argptr, int funfirstline, struct symtab *default_symtab,
      }
    else if (paren_pointer != NULL)
      {
@@ -21852,631 +11666,299 @@ index 6579d42..b3ae6c0 100644
 +  if (strncmp (p, " const", 6) == 0)
 +    p += 6;
 +
-   copy = (char *) alloca (p - *argptr + 1);
-   memcpy (copy, *argptr, p - *argptr);
-   copy[p - *argptr] = '\0';
-diff --git a/gdb/linux-nat.c b/gdb/linux-nat.c
-index 12b786e..e30bf9a 100644
---- a/gdb/linux-nat.c
-+++ b/gdb/linux-nat.c
-@@ -61,6 +61,10 @@
- # endif
- #endif /* HAVE_PERSONALITY */
-+/* To be used when one needs to know wether a
-+   WSTOPSIG (status) is a syscall */
-+#define TRAP_IS_SYSCALL (SIGTRAP | 0x80)
+   /* Keep any template parameters */
+   if (*p == '<')
+     p = find_template_name_end (p);
+@@ -1257,6 +1278,9 @@ decode_compound (char **argptr, int funfirstline, char ***canonical,
+       /* Move pointer ahead to next double-colon.  */
+       while (*p && (p[0] != ' ') && (p[0] != '\t') && (p[0] != '\''))
+       {
++        if (current_language->la_language == language_cplus)
++          p += cp_validate_operator (p);
 +
- /* This comment documents high-level logic of this file. 
- Waiting for events in sync mode
-@@ -281,17 +285,29 @@ struct simple_pid_list *stopped_pids;
+         if (p[0] == '<')
+           {
+             temp_end = find_template_name_end (p);
+@@ -1334,6 +1358,15 @@ decode_compound (char **argptr, int funfirstline, char ***canonical,
+         while (*p && *p != ' ' && *p != '\t' && *p != ',' && *p != ':')
+           p++;
+         /* At this point p->"".  String ended.  */
++        /* Nope, C++ operators could have spaces in them
++           ("foo::operator <" or "foo::operator delete []").
++           I apologize, this is a bit hacky...  */
++        if (current_language->la_language == language_cplus
++            && *p == ' ' && p - 8 - *argptr + 1 > 0)
++          {
++            /* The above loop has already swallowed "operator".  */
++            p += cp_validate_operator (p - 8) - 8;
++          }
+       }
  
- static int linux_supports_tracefork_flag = -1;
+       /* Allocate our own copy of the substring between argptr and
+@@ -1407,6 +1440,7 @@ lookup_prefix_sym (char **argptr, char *p)
+ {
+   char *p1;
+   char *copy;
++  struct symbol *sym;
  
-+/* This variable is a tri-state flag: -1 for unknown, 0 if PTRACE_O_TRACESYSGOOD
-+   can not be used, 1 if it can.  */
-+
-+static int linux_supports_tracesysgood_flag = -1;
+   /* Extract the class name.  */
+   p1 = p;
+@@ -1425,7 +1459,26 @@ lookup_prefix_sym (char **argptr, char *p)
+   /* At this point p1->"::inA::fun", p->"inA::fun" copy->"AAA",
+      argptr->"inA::fun" */
+-  return lookup_symbol (copy, 0, STRUCT_DOMAIN, 0);
++  sym = lookup_symbol (copy, 0, STRUCT_DOMAIN, 0);
++  if (sym == NULL)
++    {
++      /* Typedefs are in VAR_DOMAIN so the above symbol lookup will
++       fail when the user attempts to lookup a method of a class
++       via a typedef'd name (NOT via the classes name, which is already
++       handled in symbol_matches_domain).  So try the lookup again
++       using VAR_DOMAIN (where typedefs live) and double-check that we
++       found a struct/class type.  */
++      struct symbol *s = lookup_symbol (copy, 0, VAR_DOMAIN, 0);
++      if (s != NULL)
++      {
++        struct type *t = SYMBOL_TYPE (s);
++        CHECK_TYPEDEF (t);
++        if (TYPE_CODE (t) == TYPE_CODE_STRUCT)
++          return s;
++      }
++    }
 +
- /* If we have PTRACE_O_TRACEFORK, this flag indicates whether we also have
-    PTRACE_O_TRACEVFORKDONE.  */
++  return sym;
+ }
  
- static int linux_supports_tracevforkdone_flag = -1;
+ /* This finds the method COPY in the class whose type is T and whose
+@@ -1474,26 +1527,16 @@ find_method (int funfirstline, char ***canonical, char *saved_arg,
+     }
+   else
+     {
+-      char *tmp;
+-
+-      if (is_operator_name (copy))
+-      {
+-        tmp = (char *) alloca (strlen (copy + 3) + 9);
+-        strcpy (tmp, "operator ");
+-        strcat (tmp, copy + 3);
+-      }
+-      else
+-      tmp = copy;
+       if (not_found_ptr)
+         *not_found_ptr = 1;
+-      if (tmp[0] == '~')
++      if (copy[0] == '~')
+       cplusplus_error (saved_arg,
+                        "the class `%s' does not have destructor defined\n",
+                        SYMBOL_PRINT_NAME (sym_class));
+       else
+       cplusplus_error (saved_arg,
+                        "the class %s does not have any method named %s\n",
+-                       SYMBOL_PRINT_NAME (sym_class), tmp);
++                       SYMBOL_PRINT_NAME (sym_class), copy);
+     }
+ }
  
-+/* If the inferior have passed through its entrypoint (AT_ENTRY),
-+   then this flag is set to 1.  Otherwise, its value is 0.  */
-+static int linux_passed_by_entrypoint_flag = 0;
-+
- /* Async mode support */
+@@ -1780,7 +1823,7 @@ symbol_found (int funfirstline, char ***canonical, char *copy,
+       {
+         struct blockvector *bv = BLOCKVECTOR (SYMBOL_SYMTAB (sym));
+         struct block *b = BLOCKVECTOR_BLOCK (bv, STATIC_BLOCK);
+-        if (lookup_block_symbol (b, copy, NULL, VAR_DOMAIN) != NULL)
++        if (lookup_block_symbol (b, copy, VAR_DOMAIN) != NULL)
+           build_canonical_line_spec (values.sals, copy, canonical);
+       }
+       return values;
+diff --git a/gdb/linux-nat.c b/gdb/linux-nat.c
+index 98f6347..0907f03 100644
+--- a/gdb/linux-nat.c
++++ b/gdb/linux-nat.c
+@@ -1710,6 +1710,7 @@ resume_callback (struct lwp_info *lp, void *data)
+       lp->stopped = 0;
+       lp->step = 0;
+       memset (&lp->siginfo, 0, sizeof (lp->siginfo));
++      lp->watchpoint_hit_set = 0;
+     }
+   else if (lp->stopped && debug_linux_nat)
+     fprintf_unfiltered (gdb_stdlog, "RC: Not resuming sibling %s (has pending)\n",
+@@ -1847,6 +1848,7 @@ linux_nat_resume (struct target_ops *ops,
  
- /* Zero if the async mode, although enabled, is masked, which means
-    linux_nat_wait should behave as if async mode was off.  */
- static int linux_nat_async_mask_value = 1;
+   linux_ops->to_resume (linux_ops, ptid, step, signo);
+   memset (&lp->siginfo, 0, sizeof (lp->siginfo));
++  lp->watchpoint_hit_set = 0;
  
-+/* Stores the current used ptrace() options.  */
-+static int current_ptrace_options = 0;
-+
- /* The read/write ends of the pipe registered as waitable file in the
-    event loop.  */
- static int linux_nat_event_pipe[2] = { -1, -1 };
-@@ -636,6 +652,41 @@ linux_test_for_tracefork (int original_pid)
-   linux_nat_async_events (async_events_original_state);
+   if (debug_linux_nat)
+     fprintf_unfiltered (gdb_stdlog,
+@@ -2286,6 +2288,78 @@ maybe_clear_ignore_sigint (struct lwp_info *lp)
+     }
  }
  
-+/* Determine if PTRACE_O_TRACESYSGOOD can be used to follow syscalls.
-+
-+   We try to enable syscall tracing on ORIGINAL_PID.  If this fails,
-+   we know that the feature is not available.  This may change the tracing
-+   options for ORIGINAL_PID, but we'll be setting them shortly anyway.  */
++/* Fetch the possible triggered data watchpoint info and store it to LP.
++   The hardware data watchpoint trigger gets cleared during this fetch.  */
 +
 +static void
-+linux_test_for_tracesysgood (int original_pid)
++save_sigtrap (struct lwp_info *lp)
 +{
-+  int ret;
-+  enum sigchld_state async_events_original_state;
++  struct cleanup *old_chain;
 +
-+  async_events_original_state = linux_nat_async_events (sigchld_sync);
++  /* linux_nat_stopped_data_address is not even installed in this case.  */
++  if (linux_ops->to_stopped_data_address == NULL)
++    return;
 +
-+  linux_supports_tracesysgood_flag = 0;
++  old_chain = save_inferior_ptid ();
++  inferior_ptid = lp->ptid;
 +
-+  ret = ptrace (PTRACE_SETOPTIONS, original_pid, 0, PTRACE_O_TRACESYSGOOD);
-+  if (ret != 0)
-+    return;
++  lp->watchpoint_hit_set =
++    linux_ops->to_stopped_data_address (&current_target, &lp->watchpoint_hit);
 +
-+  linux_supports_tracesysgood_flag = 1;
-+  linux_nat_async_events (async_events_original_state);
++  do_cleanups (old_chain);
 +}
 +
-+/* Determine wether we support PTRACE_O_TRACESYSGOOD option available.
-+   This function also sets linux_supports_tracesysgood_flag.  */
++/* Wrap target_stopped_data_address where the GNU/Linux native target may be
++   directed by the watchpoint/debug register number.  Base the reported value
++   on the triggered data address instead.  During inferior stop the assignment
++   of watchpoint/debug registers may change making the register number specific
++   trigger info stale.  */
 +
 +static int
-+linux_supports_tracesysgood (int pid)
++linux_nat_stopped_data_address (struct target_ops *ops, CORE_ADDR *addr_p)
 +{
-+  if (linux_supports_tracesysgood_flag == -1)
-+    linux_test_for_tracesysgood (pid);
-+  return linux_supports_tracesysgood_flag;
++  struct lwp_info *lp = find_lwp_pid (inferior_ptid);
++
++  gdb_assert (lp != NULL);
++
++  *addr_p = lp->watchpoint_hit;
++
++  return lp->watchpoint_hit_set;
 +}
 +
- /* Return non-zero iff we have tracefork functionality available.
-    This function also sets linux_supports_tracefork_flag.  */
-@@ -655,12 +706,34 @@ linux_supports_tracevforkdone (int pid)
-   return linux_supports_tracevforkdone_flag;
- }
-+static void
-+linux_enable_tracesysgood (ptid_t ptid)
++/* In `set follow-fork-mode child' with multithreaded parent we need to detach
++   watchpoints from all the LWPs.  In such case INFERIOR_PTID will be the
++   non-threaded new child while LWP_LIST will still contain all the threads of
++   the parent being detached.  */
++
++static int
++linux_nat_detach_watchpoints (void)
 +{
-+  int pid = ptid_get_lwp (ptid);
++  struct lwp_info *lp;
++  int found = 0, retval = 0;
++  ptid_t filter = pid_to_ptid (ptid_get_pid (inferior_ptid));
++  struct cleanup *old_chain = save_inferior_ptid ();
 +
-+  if (pid == 0)
-+    pid = ptid_get_pid (ptid);
++  for (lp = lwp_list; lp; lp = lp->next)
++    if (ptid_match (lp->ptid, filter))
++      {
++      inferior_ptid = lp->ptid;
++      retval |= linux_ops->to_detach_watchpoints ();
++      found = 1;
++      }
 +
-+  if (linux_supports_tracesysgood (pid) == 0)
-+    return;
++  do_cleanups (old_chain);
 +
-+  current_ptrace_options |= PTRACE_O_TRACESYSGOOD;
-+  linux_passed_by_entrypoint_flag = 1;
++  if (!found)
++    {
++      gdb_assert (!is_lwp (inferior_ptid));
 +
-+  ptrace (PTRACE_SETOPTIONS, pid, 0, current_ptrace_options);
-+}
++      retval |= linux_ops->to_detach_watchpoints ();
++    }
 +
-+static int
-+linux_passed_by_entrypoint (void)
-+{
-+  return linux_passed_by_entrypoint_flag;
++  return retval;
 +}
 +
\f
- void
- linux_enable_event_reporting (ptid_t ptid)
- {
-   int pid = ptid_get_lwp (ptid);
--  int options;
-   if (pid == 0)
-     pid = ptid_get_pid (ptid);
-@@ -668,15 +741,16 @@ linux_enable_event_reporting (ptid_t ptid)
-   if (! linux_supports_tracefork (pid))
-     return;
--  options = PTRACE_O_TRACEFORK | PTRACE_O_TRACEVFORK | PTRACE_O_TRACEEXEC
--    | PTRACE_O_TRACECLONE;
-+  current_ptrace_options |= PTRACE_O_TRACEFORK | PTRACE_O_TRACEVFORK
-+    | PTRACE_O_TRACEEXEC | PTRACE_O_TRACECLONE;
-+
-   if (linux_supports_tracevforkdone (pid))
--    options |= PTRACE_O_TRACEVFORKDONE;
-+    current_ptrace_options |= PTRACE_O_TRACEVFORKDONE;
-   /* Do not enable PTRACE_O_TRACEEXIT until GDB is more prepared to support
-      read-only process state.  */
--  ptrace (PTRACE_SETOPTIONS, pid, 0, options);
-+  ptrace (PTRACE_SETOPTIONS, pid, 0, current_ptrace_options);
- }
- static void
-@@ -684,6 +758,7 @@ linux_child_post_attach (int pid)
- {
-   linux_enable_event_reporting (pid_to_ptid (pid));
-   check_for_thread_db ();
-+  linux_enable_tracesysgood (pid_to_ptid (pid));
- }
- static void
-@@ -691,6 +766,7 @@ linux_child_post_startup_inferior (ptid_t ptid)
- {
-   linux_enable_event_reporting (ptid);
-   check_for_thread_db ();
-+  linux_enable_tracesysgood (ptid);
- }
+ /* Wait until LP is stopped.  */
  
  static int
-@@ -931,6 +1007,16 @@ linux_child_insert_exec_catchpoint (int pid)
-     error (_("Your system does not support exec catchpoints."));
- }
-+static int
-+linux_child_set_syscall_catchpoint (int pid, int needed, int any_count,
-+                                  int table_size, int *table)
-+{
-+  if (! linux_supports_tracesysgood (pid))
-+    error (_("Your system does not support syscall catchpoints."));
-+  /* We ignore the arguments.  */
-+  return 0;
-+}
-+
- /* On GNU/Linux there are no real LWP's.  The closest thing to LWP's
-    are processes sharing the same VM space.  A multi-threaded process
-    is basically a group of such processes.  However, such a grouping
-@@ -1352,6 +1438,9 @@ linux_nat_create_inferior (struct target_ops *ops,
-   int personality_orig = 0, personality_set = 0;
- #endif /* HAVE_PERSONALITY */
+@@ -2337,6 +2411,8 @@ stop_wait_callback (struct lwp_info *lp, void *data)
+             /* Save the trap's siginfo in case we need it later.  */
+             save_siginfo (lp);
  
-+  /* We are sarting, so we still have not passed through our entrypoint.  */
-+  linux_passed_by_entrypoint_flag = 0;
++            save_sigtrap (lp);
 +
-   /* The fork_child mechanism is synchronous and calls target_wait, so
-      we have to mask the async mode.  */
-@@ -1996,6 +2085,26 @@ linux_handle_extended_wait (struct lwp_info *lp, int status,
-       return 0;
+             /* Now resume this LWP and get the SIGSTOP event. */
+             errno = 0;
+             ptrace (PTRACE_CONT, GET_LWP (lp->ptid), 0, 0);
+@@ -2701,10 +2777,14 @@ linux_nat_filter_event (int lwpid, int status, int options)
+       add_thread (lp->ptid);
      }
  
-+  /* Used for 'catch syscall' feature.  */
-+  if (WSTOPSIG (status) == TRAP_IS_SYSCALL)
+-  /* Save the trap's siginfo in case we need it later.  */
+   if (WIFSTOPPED (status)
+       && (WSTOPSIG (status) == SIGTRAP || WSTOPSIG (status) == TRAP_IS_SYSCALL))
+-    save_siginfo (lp);
 +    {
-+      if (catch_syscall_enabled () == 0)
-+          ourstatus->kind = TARGET_WAITKIND_IGNORE;
-+      else
-+        {
-+          struct regcache *regcache = get_thread_regcache (lp->ptid);
-+          struct gdbarch *gdbarch = get_regcache_arch (regcache);
-+
-+          ourstatus->kind = 
-+            (lp->syscall_state == TARGET_WAITKIND_SYSCALL_ENTRY) ?
-+            TARGET_WAITKIND_SYSCALL_RETURN : TARGET_WAITKIND_SYSCALL_ENTRY;
-+          lp->syscall_state = ourstatus->kind;
-+          ourstatus->value.syscall_number =
-+            (int) gdbarch_get_syscall_number (gdbarch, lp->ptid);
-+        }
-+      return 0;
-+    }
++      /* Save the trap's siginfo in case we need it later.  */
++      save_siginfo (lp);
 +
-   internal_error (__FILE__, __LINE__,
-                 _("unknown ptrace event %d"), event);
- }
-@@ -2606,11 +2715,16 @@ linux_nat_filter_event (int lwpid, int status, int options)
-     }
++      save_sigtrap (lp);
++    }
  
-   /* Save the trap's siginfo in case we need it later.  */
--  if (WIFSTOPPED (status) && WSTOPSIG (status) == SIGTRAP)
-+  if (WIFSTOPPED (status)
-+      && (WSTOPSIG (status) == SIGTRAP || WSTOPSIG (status) == TRAP_IS_SYSCALL))
-     save_siginfo (lp);
--  /* Handle GNU/Linux's extended waitstatus for trace events.  */
--  if (WIFSTOPPED (status) && WSTOPSIG (status) == SIGTRAP && status >> 16 != 0)
-+  /* Handle GNU/Linux's extended waitstatus for trace events.
-+     It is necessary to check if WSTOPSIG is signaling a that
-+     the inferior is entering/exiting a system call.  */
-+  if (WIFSTOPPED (status)
-+      && ((WSTOPSIG (status) == TRAP_IS_SYSCALL)
-+          || (WSTOPSIG (status) == SIGTRAP && status >> 16 != 0)))
-     {
-       if (debug_linux_nat)
-       fprintf_unfiltered (gdb_stdlog,
-@@ -4262,12 +4376,14 @@ linux_target_install_ops (struct target_ops *t)
-   t->to_insert_fork_catchpoint = linux_child_insert_fork_catchpoint;
-   t->to_insert_vfork_catchpoint = linux_child_insert_vfork_catchpoint;
-   t->to_insert_exec_catchpoint = linux_child_insert_exec_catchpoint;
-+  t->to_set_syscall_catchpoint = linux_child_set_syscall_catchpoint;
-   t->to_pid_to_exec_file = linux_child_pid_to_exec_file;
-   t->to_post_startup_inferior = linux_child_post_startup_inferior;
-   t->to_post_attach = linux_child_post_attach;
-   t->to_follow_fork = linux_child_follow_fork;
-   t->to_find_memory_regions = linux_nat_find_memory_regions;
-   t->to_make_corefile_notes = linux_nat_make_corefile_notes;
-+  t->to_passed_by_entrypoint = linux_passed_by_entrypoint;
-   super_xfer_partial = t->to_xfer_partial;
-   t->to_xfer_partial = linux_xfer_partial;
+   /* Handle GNU/Linux's extended waitstatus for trace events.
+      It is necessary to check if WSTOPSIG is signaling that
+@@ -4999,6 +5079,10 @@ linux_nat_add_target (struct target_ops *t)
+   t->to_thread_alive = linux_nat_thread_alive;
+   t->to_pid_to_str = linux_nat_pid_to_str;
+   t->to_has_thread_control = tc_schedlock;
++  if (linux_ops->to_stopped_data_address)
++    t->to_stopped_data_address = linux_nat_stopped_data_address;
++  if (linux_ops->to_detach_watchpoints)
++    t->to_detach_watchpoints = linux_nat_detach_watchpoints;
+   t->to_can_async_p = linux_nat_can_async_p;
+   t->to_is_async_p = linux_nat_is_async_p;
 diff --git a/gdb/linux-nat.h b/gdb/linux-nat.h
-index fec5139..36d2439 100644
+index eae74f3..73204fc 100644
 --- a/gdb/linux-nat.h
 +++ b/gdb/linux-nat.h
-@@ -70,6 +70,13 @@ struct lwp_info
-      or to a local variable in lin_lwp_wait.  */
-   struct target_waitstatus waitstatus;
-+  /* Signal wether we are in a SYSCALL_ENTRY or
-+     in a SYSCALL_RETURN event.
-+     Values:
-+     - TARGET_WAITKIND_SYSCALL_ENTRY
-+     - TARGET_WAITKIND_SYSCALL_RETURN */
-+  int syscall_state;
-+
-   /* Next LWP in list.  */
-   struct lwp_info *next;
- };
-diff --git a/gdb/linux-tdep.c b/gdb/linux-tdep.c
-index e18e134..d44b505 100644
---- a/gdb/linux-tdep.c
-+++ b/gdb/linux-tdep.c
-@@ -20,6 +20,8 @@
- #include "defs.h"
- #include "gdbtypes.h"
- #include "linux-tdep.h"
-+#include "xml-syscall.h"
-+#include "target.h"
- /* This function is suitable for architectures that don't
-    extend/override the standard siginfo structure.  */
-@@ -137,3 +139,81 @@ linux_get_siginfo_type (struct gdbarch *gdbarch)
+@@ -62,6 +62,12 @@ struct lwp_info
+      be the address of a hardware watchpoint.  */
+   struct siginfo siginfo;
  
-   return siginfo_type;
- }
-+
-+/* Structure used to store information about the available syscalls in
-+   the system.  */
-+static const struct syscalls_info *sysinfo = NULL;
-+
-+/* A flag to tell if we already initialized the structure above.  */
-+static int have_initialized_sysinfo = 0;
-+
-+/* The filename of the syscall's XML.  */
-+static const char *xml_syscall_file = NULL;
-+
-+/* Initializes the syscalls_info structure according to the
-+   architecture.  */
-+static void
-+init_sysinfo (struct gdbarch *gdbarch)
-+{
-+  /* Did we already try to initialize the structure?  */
-+  if (have_initialized_sysinfo)
-+    return;
-+
-+  if (xml_syscall_file == NULL)
-+    xml_syscall_file = gdbarch_xml_syscall_filename (gdbarch);
-+
-+  sysinfo = xml_init_syscalls_info (xml_syscall_file);
-+
-+  have_initialized_sysinfo = 1;
-+
-+  if (sysinfo == NULL)
-+    {
-+      if (xml_syscall_file)
-+        /* The initialization failed.  Let's show a warning
-+           message to the user (just this time) and leave.  */
-+        warning (_("Could not load the syscall XML file '%s'.\n\
-+GDB will not be able to display syscall names."), xml_syscall_file);
-+      else
-+        /* There's no file to open. Let's warn the user.  */
-+        warning (_("There is no XML file to open.\n\
-+GDB will not be able to display syscall names."));
-+    }
-+}
-+
-+static void
-+linux_get_syscall_by_number (struct gdbarch *gdbarch,
-+                             int syscall_number,
-+                             struct syscall *s)
-+{
-+  init_sysinfo (gdbarch);
-+
-+  s->number = syscall_number;
-+  s->name = xml_get_syscall_name (sysinfo, syscall_number);
-+}
-+
-+static void
-+linux_get_syscall_by_name (struct gdbarch *gdbarch,
-+                           const char *syscall_name,
-+                           struct syscall *s)
-+{
-+  init_sysinfo (gdbarch);
-+
-+  s->number = xml_get_syscall_number (sysinfo, syscall_name);
-+  s->name = syscall_name;
-+}
-+
-+static const char **
-+linux_get_syscall_names (struct gdbarch *gdbarch)
-+{
-+  init_sysinfo (gdbarch);
++  /* WATCHPOINT_HIT_SET is non-zero if this LWP stopped with a trap and a data
++     watchpoint has been found as triggered.  In such case WATCHPOINT_HIT
++     contains data address of the triggered data watchpoint.  */
++  unsigned watchpoint_hit_set : 1;
++  CORE_ADDR watchpoint_hit;
 +
-+  return xml_list_of_syscalls (sysinfo);
-+}
-+
-+void
-+linux_tdep_init (struct gdbarch *gdbarch)
-+{
-+  set_gdbarch_get_syscall_by_number (gdbarch, linux_get_syscall_by_number);
-+  set_gdbarch_get_syscall_by_name (gdbarch, linux_get_syscall_by_name);
-+  set_gdbarch_get_syscall_names (gdbarch, linux_get_syscall_names);
-+}
-diff --git a/gdb/linux-tdep.h b/gdb/linux-tdep.h
-index 50af511..1e1e541 100644
---- a/gdb/linux-tdep.h
-+++ b/gdb/linux-tdep.h
-@@ -22,4 +22,6 @@
- struct type *linux_get_siginfo_type (struct gdbarch *);
+   /* Non-zero if we expect a duplicated SIGINT.  */
+   int ignore_sigint;
  
-+extern void linux_tdep_init (struct gdbarch *gdbarch);
-+
- #endif /* linux-tdep.h */
 diff --git a/gdb/m2-lang.c b/gdb/m2-lang.c
-index 9e4bb1b..9ca3ae1 100644
+index 88c7e5e..2d0b3ca 100644
 --- a/gdb/m2-lang.c
 +++ b/gdb/m2-lang.c
-@@ -29,8 +29,8 @@
- #include "valprint.h"
- extern void _initialize_m2_language (void);
--static void m2_printchar (int, struct ui_file *);
--static void m2_emit_char (int, struct ui_file *, int);
-+static void m2_printchar (int, struct type *, struct ui_file *);
-+static void m2_emit_char (int, struct type *, struct ui_file *, int);
- /* Print the character C on STREAM as part of the contents of a literal
-    string whose delimiter is QUOTER.  Note that that format for printing
-@@ -39,7 +39,7 @@ static void m2_emit_char (int, struct ui_file *, int);
-    be replaced with a true Modula version.  */
- static void
--m2_emit_char (int c, struct ui_file *stream, int quoter)
-+m2_emit_char (int c, struct type *type, struct ui_file *stream, int quoter)
- {
-   c &= 0xFF;                  /* Avoid sign bit follies */
-@@ -88,10 +88,10 @@ m2_emit_char (int c, struct ui_file *stream, int quoter)
-    be replaced with a true Modula version.  */
- static void
--m2_printchar (int c, struct ui_file *stream)
-+m2_printchar (int c, struct type *type, struct ui_file *stream)
- {
-   fputs_filtered ("'", stream);
--  LA_EMIT_CHAR (c, stream, '\'');
-+  LA_EMIT_CHAR (c, type, stream, '\'');
-   fputs_filtered ("'", stream);
- }
-@@ -103,14 +103,15 @@ m2_printchar (int c, struct ui_file *stream)
-    be replaced with a true Modula version.  */
- static void
--m2_printstr (struct ui_file *stream, const gdb_byte *string,
--           unsigned int length, int width, int force_ellipses,
-+m2_printstr (struct ui_file *stream, struct type *type, const gdb_byte *string,
-+           unsigned int length, int force_ellipses,
-            const struct value_print_options *options)
- {
-   unsigned int i;
-   unsigned int things_printed = 0;
-   int in_quotes = 0;
-   int need_comma = 0;
-+  int width = TYPE_LENGTH (type);
-   if (length == 0)
-     {
-@@ -152,7 +153,7 @@ m2_printstr (struct ui_file *stream, const gdb_byte *string,
-               fputs_filtered ("\", ", stream);
-             in_quotes = 0;
-           }
--        m2_printchar (string[i], stream);
-+        m2_printchar (string[i], type, stream);
-         fprintf_filtered (stream, " <repeats %u times>", reps);
-         i = rep1 - 1;
-         things_printed += options->repeat_count_threshold;
-@@ -168,7 +169,7 @@ m2_printstr (struct ui_file *stream, const gdb_byte *string,
-               fputs_filtered ("\"", stream);
-             in_quotes = 1;
-           }
--        LA_EMIT_CHAR (string[i], stream, '"');
-+        LA_EMIT_CHAR (string[i], type, stream, '"');
-         ++things_printed;
-       }
-     }
-diff --git a/gdb/m2-valprint.c b/gdb/m2-valprint.c
-index 71c410c..41fb8fe 100644
---- a/gdb/m2-valprint.c
-+++ b/gdb/m2-valprint.c
-@@ -237,7 +237,8 @@ print_unpacked_pointer (struct type *type,
-       && TYPE_CODE (elttype) == TYPE_CODE_INT
-       && (options->format == 0 || options->format == 's')
-       && addr != 0)
--    return val_print_string (addr, -1, TYPE_LENGTH (elttype), stream, options);
-+    return val_print_string (TYPE_TARGET_TYPE (type), addr, -1,
-+                           stream, options);
-   
-   return 0;
- }
-@@ -294,7 +295,7 @@ m2_print_array_contents (struct type *type, const gdb_byte *valaddr,
-          || ((current_language->la_language == language_m2)
-              && (TYPE_CODE (type) == TYPE_CODE_CHAR)))
-         && (options->format == 0 || options->format == 's'))
--      val_print_string (address, len+1, eltlen, stream, options);
-+      val_print_string (type, address, len+1, stream, options);
-       else
-       {
-         fprintf_filtered (stream, "{");
-@@ -359,7 +360,8 @@ m2_val_print (struct type *type, const gdb_byte *valaddr, int embedded_offset,
-                 len = temp_len;
-               }
--            LA_PRINT_STRING (stream, valaddr + embedded_offset, len, 1, 0,
-+            LA_PRINT_STRING (stream, TYPE_TARGET_TYPE (type),
-+                             valaddr + embedded_offset, len, 0,
-                              options);
-             i = len;
-           }
-@@ -547,7 +549,7 @@ m2_val_print (struct type *type, const gdb_byte *valaddr, int embedded_offset,
-         else
-           fprintf_filtered (stream, "%d", (int) val);
-         fputs_filtered (" ", stream);
--        LA_PRINT_CHAR ((unsigned char) val, stream);
-+        LA_PRINT_CHAR ((unsigned char) val, type, stream);
-       }
-       break;
-diff --git a/gdb/m32r-tdep.c b/gdb/m32r-tdep.c
-index 5f4b9a6..eccfe31 100644
---- a/gdb/m32r-tdep.c
-+++ b/gdb/m32r-tdep.c
-@@ -713,7 +713,7 @@ m32r_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
-       if (len > 8
-         && (typecode == TYPE_CODE_STRUCT || typecode == TYPE_CODE_UNION))
-       {
--        store_unsigned_integer (valbuf, 4, VALUE_ADDRESS (args[argnum]));
-+        store_unsigned_integer (valbuf, 4, value_address (args[argnum]));
-         typecode = TYPE_CODE_PTR;
-         len = 4;
-         val = valbuf;
-diff --git a/gdb/macroexp.c b/gdb/macroexp.c
-index f0a8c1f..752a939 100644
---- a/gdb/macroexp.c
-+++ b/gdb/macroexp.c
-@@ -23,6 +23,7 @@
- #include "macrotab.h"
- #include "macroexp.h"
- #include "gdb_assert.h"
-+#include "c-lang.h"
\f
-@@ -320,14 +321,17 @@ get_character_constant (struct macro_buffer *tok, char *p, char *end)
-      way GDB's C/C++ lexer does.  So we call parse_escape in utils.c
-      to handle escape sequences.  */
-   if ((p + 1 <= end && *p == '\'')
--      || (p + 2 <= end && p[0] == 'L' && p[1] == '\''))
-+      || (p + 2 <= end
-+        && (p[0] == 'L' || p[0] == 'u' || p[0] == 'U')
-+        && p[1] == '\''))
-     {
-       char *tok_start = p;
-       char *body_start;
-+      int char_count = 0;
-       if (*p == '\'')
-         p++;
--      else if (*p == 'L')
-+      else if (*p == 'L' || *p == 'u' || *p == 'U')
-         p += 2;
-       else
-         gdb_assert (0);
-@@ -339,7 +343,7 @@ get_character_constant (struct macro_buffer *tok, char *p, char *end)
-             error (_("Unmatched single quote."));
-           else if (*p == '\'')
-             {
--              if (p == body_start)
-+              if (!char_count)
-                 error (_("A character constant must contain at least one "
-                        "character."));
-               p++;
-@@ -348,10 +352,13 @@ get_character_constant (struct macro_buffer *tok, char *p, char *end)
-           else if (*p == '\\')
-             {
-               p++;
--              parse_escape (&p);
-+            char_count += c_parse_escape (&p, NULL);
-             }
-           else
--            p++;
-+          {
-+            p++;
-+            char_count++;
-+          }
-         }
-       set_token (tok, tok_start, p);
-@@ -370,16 +377,16 @@ static int
- get_string_literal (struct macro_buffer *tok, char *p, char *end)
+@@ -356,6 +356,7 @@ const struct exp_descriptor exp_descriptor_modula2 =
  {
-   if ((p + 1 <= end
--       && *p == '\"')
-+       && *p == '"')
-       || (p + 2 <= end
--          && p[0] == 'L'
--          && p[1] == '\"'))
-+          && (p[0] == 'L' || p[0] == 'u' || p[0] == 'U')
-+          && p[1] == '"'))
-     {
-       char *tok_start = p;
--      if (*p == '\"')
-+      if (*p == '"')
-         p++;
--      else if (*p == 'L')
-+      else if (*p == 'L' || *p == 'u' || *p == 'U')
-         p += 2;
-       else
-         gdb_assert (0);
-@@ -388,7 +395,7 @@ get_string_literal (struct macro_buffer *tok, char *p, char *end)
-         {
-           if (p >= end)
-             error (_("Unterminated string in expression."));
--          else if (*p == '\"')
-+          else if (*p == '"')
-             {
-               p++;
-               break;
-@@ -399,7 +406,7 @@ get_string_literal (struct macro_buffer *tok, char *p, char *end)
-           else if (*p == '\\')
-             {
-               p++;
--              parse_escape (&p);
-+              c_parse_escape (&p, NULL);
-             }
-           else
-             p++;
+   print_subexp_standard,
+   operator_length_standard,
++  operator_check_standard,
+   op_name_standard,
+   dump_subexp_body_standard,
+   evaluate_subexp_modula2
+diff --git a/gdb/machoread.c b/gdb/machoread.c
+index 5f9a0fe..66fa067 100644
+--- a/gdb/machoread.c
++++ b/gdb/machoread.c
+@@ -681,6 +681,7 @@ static struct sym_fns macho_sym_fns = {
+   macho_new_init,               /* sym_new_init: init anything gbl to entire symtab */
+   macho_symfile_init,           /* sym_init: read initial info, setup for sym_read() */
+   macho_symfile_read,           /* sym_read: read a symbol file into symtab */
++  NULL,                               /* sym_read_psymbols */
+   macho_symfile_finish,         /* sym_finish: finished with file, cleanup */
+   macho_symfile_offsets,        /* sym_offsets:  xlate external to internal form */
+   NULL                          /* next: pointer to next struct sym_fns */
 diff --git a/gdb/main.c b/gdb/main.c
-index 5d4640b..6f9e61b 100644
+index 55411a8..ac9a540 100644
 --- a/gdb/main.c
 +++ b/gdb/main.c
-@@ -40,6 +40,8 @@
+@@ -40,6 +40,7 @@
  #include "interps.h"
  #include "main.h"
  
 +#include "python/python.h"
-+
- /* If nonzero, display time usage both at startup and for each command.  */
- int display_time;
-@@ -62,6 +64,9 @@ int dbx_commands = 0;
- /* System root path, used to find libraries etc.  */
- char *gdb_sysroot = 0;
+ #include "source.h"
  
-+/* GDB datadir, used to store data files.  */
-+char *gdb_datadir = 0;
-+
- struct ui_file *gdb_stdout;
- struct ui_file *gdb_stderr;
- struct ui_file *gdb_stdlog;
-@@ -211,6 +216,8 @@ captured_main (void *data)
+ /* If nonzero, display time usage both at startup and for each command.  */
+@@ -259,6 +260,8 @@ captured_main (void *data)
    char *cdarg = NULL;
    char *ttyarg = NULL;
  
@@ -22485,48 +11967,7 @@ index 5d4640b..6f9e61b 100644
    /* These are static so that we can take their address in an initializer.  */
    static int print_help;
    static int print_version;
-@@ -357,6 +364,40 @@ captured_main (void *data)
-       }
-     }
-+#ifdef GDB_DATADIR_RELOCATABLE
-+  gdb_datadir = make_relative_prefix (argv[0], BINDIR, GDB_DATADIR);
-+  if (gdb_datadir)
-+    {
-+      struct stat s;
-+      int res = 0;
-+
-+      if (stat (gdb_datadir, &s) == 0)
-+      if (S_ISDIR (s.st_mode))
-+        res = 1;
-+
-+      if (res == 0)
-+      {
-+        xfree (gdb_datadir);
-+        gdb_datadir = xstrdup (GDB_DATADIR);
-+      }
-+    }
-+  else
-+    gdb_datadir = xstrdup (GDB_DATADIR);
-+#else
-+  gdb_datadir = xstrdup (GDB_DATADIR);
-+#endif /* GDB_DATADIR_RELOCATABLE */
-+
-+  /* Canonicalize the GDB's datadir path.  */
-+  if (*gdb_datadir)
-+    {
-+      char *canon_debug = lrealpath (gdb_datadir);
-+      if (canon_debug)
-+      {
-+        xfree (gdb_datadir);
-+        gdb_datadir = canon_debug;
-+      }
-+    }
-+
-   get_init_files (&system_gdbinit, &home_gdbinit, &local_gdbinit);
-   /* There will always be an interpreter.  Either the one passed into
-@@ -441,10 +482,14 @@ captured_main (void *data)
+@@ -434,10 +437,14 @@ captured_main (void *data)
        {"args", no_argument, &set_args, 1},
       {"l", required_argument, 0, 'l'},
        {"return-child-result", no_argument, &return_child_result, 1},
@@ -22542,7 +11983,7 @@ index 5d4640b..6f9e61b 100644
        {
        int option_index;
  
-@@ -462,6 +507,9 @@ captured_main (void *data)
+@@ -455,6 +462,9 @@ captured_main (void *data)
          case 0:
            /* Long option that just sets a flag.  */
            break;
@@ -22552,7 +11993,7 @@ index 5d4640b..6f9e61b 100644
          case OPT_SE:
            symarg = optarg;
            execarg = optarg;
-@@ -638,7 +686,31 @@ extern int gdbtk_test (char *);
+@@ -631,7 +641,31 @@ extern int gdbtk_test (char *);
        use_windows = 0;
        }
  
@@ -22585,7 +12026,7 @@ index 5d4640b..6f9e61b 100644
        {
        /* The remaining options are the command-line options for the
           inferior.  The first one is the sym/exec file, and the rest
-@@ -866,7 +938,8 @@ Can't attach to process and specify a core file at the same time."));
+@@ -864,7 +898,8 @@ Can't attach to process and specify a core file at the same time."));
    xfree (cmdarg);
  
    /* Read in the old history after all the command files have been read. */
@@ -22595,7 +12036,7 @@ index 5d4640b..6f9e61b 100644
  
    if (batch)
      {
-@@ -895,13 +968,25 @@ Can't attach to process and specify a core file at the same time."));
+@@ -893,13 +928,25 @@ Can't attach to process and specify a core file at the same time."));
  #endif
      }
  
@@ -22627,7 +12068,7 @@ index 5d4640b..6f9e61b 100644
      }
    /* No exit -- exit is through quit_command.  */
  }
-@@ -933,7 +1018,12 @@ print_gdb_help (struct ui_file *stream)
+@@ -931,7 +978,12 @@ print_gdb_help (struct ui_file *stream)
    fputs_unfiltered (_("\
  This is the GNU debugger.  Usage:\n\n\
      gdb [options] [executable-file [core-file or process-id]]\n\
@@ -22641,7 +12082,7 @@ index 5d4640b..6f9e61b 100644
  Options:\n\n\
  "), stream);
    fputs_unfiltered (_("\
-@@ -971,7 +1061,13 @@ Options:\n\n\
+@@ -969,7 +1021,13 @@ Options:\n\n\
    --nw                     Do not use a window interface.\n\
    --nx               Do not read "), stream);
    fputs_unfiltered (gdbinit, stream);
@@ -22657,10 +12098,10 @@ index 5d4640b..6f9e61b 100644
    --readnow          Fully read symbol files on first access.\n\
  "), stream);
 diff --git a/gdb/maint.c b/gdb/maint.c
-index 56cafe9..1b57ff5 100644
+index ecbae12..80fc36e 100644
 --- a/gdb/maint.c
 +++ b/gdb/maint.c
-@@ -906,4 +906,12 @@ When enabled GDB is profiled."),
+@@ -914,4 +914,12 @@ When enabled GDB is profiled."),
                           show_maintenance_profile_p,
                           &maintenance_set_cmdlist,
                           &maintenance_show_cmdlist);
@@ -22674,10 +12115,10 @@ index 56cafe9..1b57ff5 100644
 +                           &maintenance_show_cmdlist);
  }
 diff --git a/gdb/mdebugread.c b/gdb/mdebugread.c
-index 7cbcc59..e507c3b 100644
+index aac82e9..626292c 100644
 --- a/gdb/mdebugread.c
 +++ b/gdb/mdebugread.c
-@@ -4696,7 +4696,7 @@ new_type (char *name)
+@@ -4802,7 +4802,7 @@ new_type (char *name)
  {
    struct type *t;
  
@@ -22687,276 +12128,30 @@ index 7cbcc59..e507c3b 100644
    TYPE_CPLUS_SPECIFIC (t) = (struct cplus_struct_type *) &cplus_struct_default;
    return t;
 diff --git a/gdb/mi/mi-cmd-var.c b/gdb/mi/mi-cmd-var.c
-index 143074b..0f4efba 100644
+index 0baaa83..94ebfeb 100644
 --- a/gdb/mi/mi-cmd-var.c
 +++ b/gdb/mi/mi-cmd-var.c
-@@ -249,6 +249,41 @@ mi_cmd_var_set_format (char *command, char **argv, int argc)
- }
+@@ -697,7 +697,6 @@ mi_cmd_var_update (char *command, char **argv, int argc)
+     }
+   else
+     {
+-      /* Get varobj handle, if a valid var obj name was specified */
+       struct varobj *var = varobj_get_handle (name);
  
- void
-+mi_cmd_var_set_visualizer (char *command, char **argv, int argc)
-+{
-+  struct varobj *var;
-+
-+  if (argc != 2)
-+    error ("Usage: NAME VISUALIZER_FUNCTION.");
-+
-+  var = varobj_get_handle (argv[0]);
+       varobj_update_one (var, print_values, 1 /* explicit */);
+diff --git a/gdb/mi/mi-main.c b/gdb/mi/mi-main.c
+index 857a5d5..6181002 100644
+--- a/gdb/mi/mi-main.c
++++ b/gdb/mi/mi-main.c
+@@ -1130,7 +1130,7 @@ mi_cmd_list_features (char *command, char **argv, int argc)
+       ui_out_field_string (uiout, NULL, "frozen-varobjs");
+       ui_out_field_string (uiout, NULL, "pending-breakpoints");
+       ui_out_field_string (uiout, NULL, "thread-info");
+-      
 +
-+  if (var == NULL)
-+    error ("Variable object not found");
-+
-+  varobj_set_visualizer (var, argv[1]);
-+}
-+
-+void
-+mi_cmd_var_set_child_range (char *command, char **argv, int argc)
-+{
-+  struct varobj *var;
-+  int from, to;
-+
-+  if (argc != 3)
-+    error (_("-var-set-child-range: NAME FROM TO"));
-+
-+  var = varobj_get_handle (argv[0]);
-+  if (var == NULL)
-+    error (_("Variable object not found"));
-+
-+  from = atoi (argv[1]);
-+  to = atoi (argv[2]);
-+
-+  varobj_set_child_range (var, from, to);
-+}
-+
-+void
- mi_cmd_var_set_frozen (char *command, char **argv, int argc)
- {
-   struct varobj *var;
-@@ -369,6 +404,8 @@ mi_cmd_var_list_children (char *command, char **argv, int argc)
-   int numchild;
-   enum print_values print_values;
-   int ix;
-+  int from, to;
-+  char *display_hint;
-   if (argc != 1 && argc != 2)
-     error (_("mi_cmd_var_list_children: Usage: [PRINT_VALUES] NAME"));
-@@ -388,14 +425,22 @@ mi_cmd_var_list_children (char *command, char **argv, int argc)
-   else
-     print_values = PRINT_NO_VALUES;
--  if (VEC_length (varobj_p, children) == 0)
-+  varobj_get_child_range (var, children, &from, &to);
-+  if (from >= to)
-     return;
-+  display_hint = varobj_get_display_hint (var);
-+  if (display_hint)
-+    {
-+      ui_out_field_string (uiout, "displayhint", display_hint);
-+      xfree (display_hint);
-+    }
-+
-   if (mi_version (uiout) == 1)
-     cleanup_children = make_cleanup_ui_out_tuple_begin_end (uiout, "children");
-   else
-     cleanup_children = make_cleanup_ui_out_list_begin_end (uiout, "children");
--  for (ix = 0; VEC_iterate (varobj_p, children, ix, child); ++ix)
-+  for (ix = from; ix < to && VEC_iterate (varobj_p, children, ix, child); ++ix)
-     {
-       struct cleanup *cleanup_child;
-       cleanup_child = make_cleanup_ui_out_tuple_begin_end (uiout, "child");
-@@ -662,6 +707,8 @@ varobj_update_one (struct varobj *var, enum print_values print_values,
-   
-   for (i = 0; VEC_iterate (varobj_update_result, changes, i, r); ++i)
-     {
-+      char *display_hint;
-+
-       if (mi_version (uiout) > 1)
-         cleanup = make_cleanup_ui_out_tuple_begin_end (uiout, NULL);
-       ui_out_field_string (uiout, "name", varobj_get_objname (r->varobj));
-@@ -695,6 +742,36 @@ varobj_update_one (struct varobj *var, enum print_values print_values,
-           ui_out_field_int (uiout, "new_num_children", 
-                           varobj_get_num_children (r->varobj));
-       }
-+
-+      display_hint = varobj_get_display_hint (var);
-+      if (display_hint)
-+      {
-+        ui_out_field_string (uiout, "displayhint", display_hint);
-+        xfree (display_hint);
-+      }
-+
-+      if (r->children_changed)
-+      {
-+        int ix, from, to;
-+        struct varobj *child;
-+        struct cleanup *cleanup =
-+          make_cleanup_ui_out_list_begin_end (uiout, "children");
-+
-+        VEC (varobj_p)* children = varobj_list_children (r->varobj);
-+        varobj_get_child_range (r->varobj, children, &from, &to);
-+
-+        for (ix = from;
-+             ix < to && VEC_iterate (varobj_p, children, ix, child);
-+             ++ix)
-+          {
-+            struct cleanup *cleanup_child;
-+            cleanup_child = make_cleanup_ui_out_tuple_begin_end (uiout, NULL);
-+            print_varobj (child, print_values, 1 /* print expression */);
-+            do_cleanups (cleanup_child);
-+          }
-+
-+        do_cleanups (cleanup);
-+      }
-   
-       if (mi_version (uiout) > 1)
-       do_cleanups (cleanup);
-diff --git a/gdb/mi/mi-cmds.c b/gdb/mi/mi-cmds.c
-index 2610b6a..f31233b 100644
---- a/gdb/mi/mi-cmds.c
-+++ b/gdb/mi/mi-cmds.c
-@@ -160,7 +160,9 @@ struct mi_cmd mi_cmds[] =
-   { "var-info-num-children", { NULL, 0 }, mi_cmd_var_info_num_children},
-   { "var-info-type", { NULL, 0 }, mi_cmd_var_info_type},
-   { "var-list-children", { NULL, 0 }, mi_cmd_var_list_children},
-+  { "var-set-child-range", { NULL, 0 }, mi_cmd_var_set_child_range },
-   { "var-set-format", { NULL, 0 }, mi_cmd_var_set_format},
-+  { "var-set-visualizer", { NULL, 0 }, mi_cmd_var_set_visualizer},
-   { "var-set-frozen", { NULL, 0 }, mi_cmd_var_set_frozen},
-   { "var-show-attributes", { NULL, 0 }, mi_cmd_var_show_attributes},
-   { "var-show-format", { NULL, 0 }, mi_cmd_var_show_format},
-diff --git a/gdb/mi/mi-cmds.h b/gdb/mi/mi-cmds.h
-index 39f16fb..291a07f 100644
---- a/gdb/mi/mi-cmds.h
-+++ b/gdb/mi/mi-cmds.h
-@@ -92,7 +92,9 @@ extern mi_cmd_argv_ftype mi_cmd_var_info_num_children;
- extern mi_cmd_argv_ftype mi_cmd_var_info_type;
- extern mi_cmd_argv_ftype mi_cmd_var_list_children;
- extern mi_cmd_argv_ftype mi_cmd_var_set_format;
-+extern mi_cmd_argv_ftype mi_cmd_var_set_child_range;
- extern mi_cmd_argv_ftype mi_cmd_var_set_frozen;
-+extern mi_cmd_argv_ftype mi_cmd_var_set_visualizer;
- extern mi_cmd_argv_ftype mi_cmd_var_show_attributes;
- extern mi_cmd_argv_ftype mi_cmd_var_show_format;
- extern mi_cmd_argv_ftype mi_cmd_var_update;
-diff --git a/gdb/mi/mi-main.c b/gdb/mi/mi-main.c
-index b905a9e..eaa5f12 100644
---- a/gdb/mi/mi-main.c
-+++ b/gdb/mi/mi-main.c
-@@ -777,7 +777,7 @@ mi_cmd_data_evaluate_expression (char *command, char **argv, int argc)
-   get_user_print_options (&opts);
-   opts.deref_ref = 0;
-   val_print (value_type (val), value_contents (val),
--           value_embedded_offset (val), VALUE_ADDRESS (val),
-+           value_embedded_offset (val), value_address (val),
-            stb->stream, 0, &opts, current_language);
-   ui_out_field_stream (uiout, "value", stb);
-@@ -1101,6 +1101,10 @@ mi_cmd_list_features (char *command, char **argv, int argc)
-       ui_out_field_string (uiout, NULL, "frozen-varobjs");
-       ui_out_field_string (uiout, NULL, "pending-breakpoints");
-       ui_out_field_string (uiout, NULL, "thread-info");
-+
-+#if HAVE_PYTHON
-+      ui_out_field_string (uiout, NULL, "python");
-+#endif
-       
-       do_cleanups (cleanup);
-       return;
-@@ -1317,6 +1321,7 @@ mi_cmd_execute (struct mi_parse *parse)
-   struct cleanup *cleanup;
-   int i;
-   free_all_values ();
-+  free_all_types ();
-   current_token = xstrdup (parse->token);
-   cleanup = make_cleanup (free_current_contents, &current_token);
-diff --git a/gdb/minsyms.c b/gdb/minsyms.c
-index bf776b3..e4b0f31 100644
---- a/gdb/minsyms.c
-+++ b/gdb/minsyms.c
-@@ -48,6 +48,8 @@
- #include "value.h"
- #include "cp-abi.h"
- #include "target.h"
-+#include "cp-support.h"
-+#include "language.h"
- /* Accumulate the minimal symbols for each objfile in bunches of BUNCH_SIZE.
-    At the end, copy them all into one newly allocated location on an objfile's
-@@ -187,6 +189,9 @@ lookup_minimal_symbol (const char *name, const char *sfile,
-   unsigned int hash = msymbol_hash (name) % MINIMAL_SYMBOL_HASH_SIZE;
-   unsigned int dem_hash = msymbol_hash_iw (name) % MINIMAL_SYMBOL_HASH_SIZE;
-+  int needtofreename = 0;
-+  const char *modified_name;
-+
-   if (sfile != NULL)
-     {
-       char *p = strrchr (sfile, '/');
-@@ -194,6 +199,18 @@ lookup_minimal_symbol (const char *name, const char *sfile,
-       sfile = p + 1;
-     }
-+  /* For C++, canonicalize the input name. */
-+  modified_name = name;
-+  if (current_language->la_language == language_cplus)
-+    {
-+      char *cname = cp_canonicalize_string (name);
-+      if (cname)
-+      {
-+        modified_name = cname;
-+        needtofreename = 1;
-+      }
-+    }
-+
-   for (objfile = object_files;
-        objfile != NULL && found_symbol == NULL;
-        objfile = objfile->next)
-@@ -218,9 +235,16 @@ lookup_minimal_symbol (const char *name, const char *sfile,
-                 int match;
-                 if (pass == 1)
--                  match = strcmp (SYMBOL_LINKAGE_NAME (msymbol), name) == 0;
-+                  {
-+                    match = strcmp (SYMBOL_LINKAGE_NAME (msymbol),
-+                                    modified_name) == 0;
-+                  }
-                 else
--                  match = SYMBOL_MATCHES_SEARCH_NAME (msymbol, name);
-+                  {
-+                    match = SYMBOL_MATCHES_SEARCH_NAME (msymbol,
-+                                                        modified_name);
-+                  }
-+
-                 if (match)
-                   {
-                     switch (MSYMBOL_TYPE (msymbol))
-@@ -259,6 +283,10 @@ lookup_minimal_symbol (const char *name, const char *sfile,
-           }
-       }
-     }
-+
-+  if (needtofreename)
-+    xfree ((void *) modified_name);
-+
-   /* External symbols are best.  */
-   if (found_symbol)
-     return found_symbol;
-diff --git a/gdb/mips-tdep.c b/gdb/mips-tdep.c
-index 6c8c4c0..7d283a4 100644
---- a/gdb/mips-tdep.c
-+++ b/gdb/mips-tdep.c
-@@ -2757,7 +2757,7 @@ mips_eabi_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
-       if (len > regsize
-         && (typecode == TYPE_CODE_STRUCT || typecode == TYPE_CODE_UNION))
-       {
--        store_unsigned_integer (valbuf, regsize, VALUE_ADDRESS (arg));
-+        store_unsigned_integer (valbuf, regsize, value_address (arg));
-         typecode = TYPE_CODE_PTR;
-         len = regsize;
-         val = valbuf;
+ #if HAVE_PYTHON
+       ui_out_field_string (uiout, NULL, "python");
+ #endif
 diff --git a/gdb/mipsread.c b/gdb/mipsread.c
 index a84003f..924c1c5 100644
 --- a/gdb/mipsread.c
@@ -22969,89 +12164,13 @@ index a84003f..924c1c5 100644
    mipscoff_symfile_finish,    /* sym_finish: finished with file, cleanup */
    default_symfile_offsets,    /* sym_offsets: dummy FIXME til implem sym reloc */
    default_symfile_segments,   /* sym_segments: Get segment information from
-diff --git a/gdb/mn10300-tdep.c b/gdb/mn10300-tdep.c
-index f0cea27..02be43a 100644
---- a/gdb/mn10300-tdep.c
-+++ b/gdb/mn10300-tdep.c
-@@ -1027,7 +1027,7 @@ mn10300_push_dummy_call (struct gdbarch *gdbarch,
-         /* Change to pointer-to-type.  */
-         arg_len = push_size;
-         store_unsigned_integer (valbuf, push_size, 
--                                VALUE_ADDRESS (*args));
-+                                value_address (*args));
-         val = &valbuf[0];
-       }
-       else
-diff --git a/gdb/objc-lang.c b/gdb/objc-lang.c
-index a6c74a3..9b8d801 100644
---- a/gdb/objc-lang.c
-+++ b/gdb/objc-lang.c
-@@ -280,7 +280,7 @@ objc_demangle (const char *mangled, int options)
-    for printing characters and strings is language specific.  */
- static void
--objc_emit_char (int c, struct ui_file *stream, int quoter)
-+objc_emit_char (int c, struct type *type, struct ui_file *stream, int quoter)
- {
-   c &= 0xFF;                  /* Avoid sign bit follies.  */
-@@ -326,10 +326,10 @@ objc_emit_char (int c, struct ui_file *stream, int quoter)
- }
- static void
--objc_printchar (int c, struct ui_file *stream)
-+objc_printchar (int c, struct type *type, struct ui_file *stream)
- {
-   fputs_filtered ("'", stream);
--  objc_emit_char (c, stream, '\'');
-+  objc_emit_char (c, type, stream, '\'');
-   fputs_filtered ("'", stream);
- }
-@@ -340,14 +340,16 @@ objc_printchar (int c, struct ui_file *stream)
-    FORCE_ELLIPSES.  */
- static void
--objc_printstr (struct ui_file *stream, const gdb_byte *string, 
--             unsigned int length, int width, int force_ellipses,
-+objc_printstr (struct ui_file *stream, struct type *type,
-+             const gdb_byte *string, unsigned int length,
-+             int force_ellipses,
-              const struct value_print_options *options)
- {
-   unsigned int i;
-   unsigned int things_printed = 0;
-   int in_quotes = 0;
-   int need_comma = 0;
-+  int width = TYPE_LENGTH (type);
-   /* If the string was not truncated due to `set print elements', and
-      the last byte of it is a null, we don't print that, in
-@@ -395,7 +397,7 @@ objc_printstr (struct ui_file *stream, const gdb_byte *string,
-               fputs_filtered ("\", ", stream);
-             in_quotes = 0;
-           }
--        objc_printchar (string[i], stream);
-+        objc_printchar (string[i], type, stream);
-         fprintf_filtered (stream, " <repeats %u times>", reps);
-         i = rep1 - 1;
-         things_printed += options->repeat_count_threshold;
-@@ -411,7 +413,7 @@ objc_printstr (struct ui_file *stream, const gdb_byte *string,
-               fputs_filtered ("\"", stream);
-             in_quotes = 1;
-           }
--        objc_emit_char (string[i], stream, '"');
-+        objc_emit_char (string[i], type, stream, '"');
-         ++things_printed;
-       }
-     }
 diff --git a/gdb/objfiles.c b/gdb/objfiles.c
-index bc77de8..079ebcf 100644
+index 8dcca70..4b25a5a 100644
 --- a/gdb/objfiles.c
 +++ b/gdb/objfiles.c
-@@ -691,6 +691,20 @@ have_partial_symbols (void)
-       return 1;
-       }
+@@ -731,6 +731,20 @@ have_partial_symbols (void)
+     if (objfile_has_partial_symbols (ofp))
+       return 1;
    }
 +
 +  /* Try again, after reading partial symbols.  We do this in two
@@ -23071,7 +12190,7 @@ index bc77de8..079ebcf 100644
  }
  
 diff --git a/gdb/objfiles.h b/gdb/objfiles.h
-index 60d3143..b6fdd92 100644
+index 62fa498..1fc9c6a 100644
 --- a/gdb/objfiles.h
 +++ b/gdb/objfiles.h
 @@ -212,6 +212,11 @@ struct objfile
@@ -23086,9 +12205,9 @@ index 60d3143..b6fdd92 100644
      /* Map addresses to the entries of PSYMTABS.  It would be more efficient to
         have a map per the whole process but ADDRMAP cannot selectively remove
         its items during FREE_OBJFILE.  This mapping is already present even for
-@@ -420,6 +425,15 @@ struct objfile
- #define OBJF_KEEPBFD  (1 << 4)        /* Do not delete bfd */
+@@ -414,6 +419,15 @@ struct objfile
  
+ #define OBJF_USERLOADED       (1 << 3)        /* User loaded */
  
 +/* Set if we have tried to read partial symtabs for this objfile.
 +   This is used to allow lazy reading of partial symtabs.  */
@@ -23102,7 +12221,7 @@ index 60d3143..b6fdd92 100644
  /* The object file that the main symbol table was loaded from (e.g. the
     argument to the "symbol-file" or "file" command).  */
  
-@@ -556,6 +570,13 @@ extern void *objfile_data (struct objfile *objfile,
+@@ -568,6 +582,13 @@ extern void gdb_bfd_unref (struct bfd *abfd);
    ALL_OBJFILES (objfile)       \
      ALL_OBJFILE_PSYMTABS (objfile, p)
  
@@ -23116,322 +12235,19 @@ index 60d3143..b6fdd92 100644
  /* Traverse all minimal symbols in all objfiles.  */
  
  #define       ALL_MSYMBOLS(objfile, m) \
-diff --git a/gdb/p-lang.c b/gdb/p-lang.c
-index 41da3e0..e743a6f 100644
---- a/gdb/p-lang.c
-+++ b/gdb/p-lang.c
-@@ -97,7 +97,8 @@ pascal_main_name (void)
-    but this does not happen for Free Pascal nor for GPC.  */
- int
- is_pascal_string_type (struct type *type,int *length_pos,
--                       int *length_size, int *string_pos, int *char_size,
-+                       int *length_size, int *string_pos,
-+                     struct type **char_type,
-                      char **arrayname)
- {
-   if (TYPE_CODE (type) == TYPE_CODE_STRUCT)
-@@ -114,8 +115,8 @@ is_pascal_string_type (struct type *type,int *length_pos,
-           *length_size = TYPE_LENGTH (TYPE_FIELD_TYPE (type, 0));
-           if (string_pos)
-           *string_pos = TYPE_FIELD_BITPOS (type, 1) / TARGET_CHAR_BIT;
--          if (char_size)
--          *char_size = 1;
-+          if (char_type)
-+          *char_type = TYPE_TARGET_TYPE (TYPE_FIELD_TYPE (type, 1));
-         if (arrayname)
-           *arrayname = TYPE_FIELDS (type)[1].name;
-          return 2;
-@@ -126,7 +127,6 @@ is_pascal_string_type (struct type *type,int *length_pos,
-           && strcmp (TYPE_FIELDS (type)[0].name, "Capacity") == 0
-           && strcmp (TYPE_FIELDS (type)[1].name, "length") == 0)
-         {
--        struct type *char_type;
-         if (length_pos)
-           *length_pos = TYPE_FIELD_BITPOS (type, 1) / TARGET_CHAR_BIT;
-         if (length_size)
-@@ -134,13 +134,12 @@ is_pascal_string_type (struct type *type,int *length_pos,
-         if (string_pos)
-           *string_pos = TYPE_FIELD_BITPOS (type, 2) / TARGET_CHAR_BIT;
-           /* FIXME: how can I detect wide chars in GPC ?? */
--        char_type = TYPE_FIELD_TYPE (type,2);
--        if (char_size && TYPE_CODE (char_type) == TYPE_CODE_ARRAY)
-+          if (char_type)
-           {
--            *char_size = TYPE_LENGTH (TYPE_TARGET_TYPE (char_type));
-+            *char_type = TYPE_TARGET_TYPE (TYPE_FIELD_TYPE (type, 2));
-+            if (TYPE_CODE (*char_type) == TYPE_CODE_ARRAY)
-+              *char_type = TYPE_TARGET_TYPE (*char_type);
-           }
--        else if (char_size)
--          *char_size = 1;
-         if (arrayname)
-           *arrayname = TYPE_FIELDS (type)[2].name;
-          return 3;
-@@ -182,14 +181,15 @@ pascal_one_char (int c, struct ui_file *stream, int *in_quotes)
-     }
- }
--static void pascal_emit_char (int c, struct ui_file *stream, int quoter);
-+static void pascal_emit_char (int c, struct type *type,
-+                            struct ui_file *stream, int quoter);
- /* Print the character C on STREAM as part of the contents of a literal
-    string whose delimiter is QUOTER.  Note that that format for printing
-    characters and strings is language specific. */
- static void
--pascal_emit_char (int c, struct ui_file *stream, int quoter)
-+pascal_emit_char (int c, struct type *type, struct ui_file *stream, int quoter)
- {
-   int in_quotes = 0;
-   pascal_one_char (c, stream, &in_quotes);
-@@ -198,7 +198,7 @@ pascal_emit_char (int c, struct ui_file *stream, int quoter)
- }
- void
--pascal_printchar (int c, struct ui_file *stream)
-+pascal_printchar (int c, struct type *type, struct ui_file *stream)
- {
-   int in_quotes = 0;
-   pascal_one_char (c, stream, &in_quotes);
-@@ -212,14 +212,16 @@ pascal_printchar (int c, struct ui_file *stream)
-    had to stop before printing LENGTH characters, or if FORCE_ELLIPSES.  */
- void
--pascal_printstr (struct ui_file *stream, const gdb_byte *string,
--               unsigned int length, int width, int force_ellipses,
-+pascal_printstr (struct ui_file *stream, struct type *type,
-+               const gdb_byte *string, unsigned int length,
-+               int force_ellipses,
-                const struct value_print_options *options)
- {
-   unsigned int i;
-   unsigned int things_printed = 0;
-   int in_quotes = 0;
-   int need_comma = 0;
-+  int width = TYPE_LENGTH (type);
-   /* If the string was not truncated due to `set print elements', and
-      the last byte of it is a null, we don't print that, in traditional C
-@@ -273,7 +275,7 @@ pascal_printstr (struct ui_file *stream, const gdb_byte *string,
-               fputs_filtered ("', ", stream);
-             in_quotes = 0;
-           }
--        pascal_printchar (current_char, stream);
-+        pascal_printchar (current_char, type, stream);
-         fprintf_filtered (stream, " <repeats %u times>", reps);
-         i = rep1 - 1;
-         things_printed += options->repeat_count_threshold;
-diff --git a/gdb/p-lang.h b/gdb/p-lang.h
-index 09a4569..2b2eb2d 100644
---- a/gdb/p-lang.h
-+++ b/gdb/p-lang.h
-@@ -48,12 +48,13 @@ extern void pascal_type_print_method_args (char *, char *,
- /* These are in p-lang.c: */
- extern int 
--  is_pascal_string_type (struct type *, int *, int *, int *, int *, char **);
-+  is_pascal_string_type (struct type *, int *, int *, int *,
-+                       struct type **, char **);
--extern void pascal_printchar (int, struct ui_file *);
-+extern void pascal_printchar (int, struct type *, struct ui_file *);
--extern void pascal_printstr (struct ui_file *, const gdb_byte *,
--                           unsigned int, int, int,
-+extern void pascal_printstr (struct ui_file *, struct type *, const gdb_byte *,
-+                           unsigned int, int,
-                            const struct value_print_options *);
- extern struct type **const (pascal_builtin_types[]);
-diff --git a/gdb/p-valprint.c b/gdb/p-valprint.c
-index 27ae619..29f0e6d 100644
---- a/gdb/p-valprint.c
-+++ b/gdb/p-valprint.c
-@@ -61,7 +61,7 @@ pascal_val_print (struct type *type, const gdb_byte *valaddr,
-   struct type *elttype;
-   unsigned eltlen;
-   int length_pos, length_size, string_pos;
--  int char_size;
-+  struct type *char_type;
-   LONGEST val;
-   CORE_ADDR addr;
-@@ -100,8 +100,9 @@ pascal_val_print (struct type *type, const gdb_byte *valaddr,
-                 len = temp_len;
-               }
--            LA_PRINT_STRING (stream, valaddr + embedded_offset, len, 
--                             eltlen, 0, options);
-+            LA_PRINT_STRING (stream, TYPE_TARGET_TYPE (type),
-+                             valaddr + embedded_offset, len, 0,
-+                             options);
-             i = len;
-           }
-         else
-@@ -175,8 +176,7 @@ pascal_val_print (struct type *type, const gdb_byte *valaddr,
-             && addr != 0)
-           {
-             /* no wide string yet */
--            i = val_print_string (addr, -1, TYPE_LENGTH (elttype), stream, 
--                  options);
-+            i = val_print_string (elttype, addr, -1, stream, options);
-           }
-         /* also for pointers to pascal strings */
-         /* Note: this is Free Pascal specific:
-@@ -184,7 +184,7 @@ pascal_val_print (struct type *type, const gdb_byte *valaddr,
-            Pascal strings are mapped to records
-            with lowercase names PM  */
-           if (is_pascal_string_type (elttype, &length_pos, &length_size,
--                                     &string_pos, &char_size, NULL)
-+                                     &string_pos, &char_type, NULL)
-             && addr != 0)
-           {
-             ULONGEST string_length;
-@@ -193,7 +193,7 @@ pascal_val_print (struct type *type, const gdb_byte *valaddr,
-               read_memory (addr + length_pos, buffer, length_size);
-             string_length = extract_unsigned_integer (buffer, length_size);
-               xfree (buffer);
--              i = val_print_string (addr + string_pos, string_length, char_size, stream, options);
-+              i = val_print_string (char_type ,addr + string_pos, string_length, stream, options);
-           }
-         else if (pascal_object_is_vtbl_member (type))
-           {
-@@ -298,10 +298,10 @@ pascal_val_print (struct type *type, const gdb_byte *valaddr,
-       else
-       {
-           if (is_pascal_string_type (type, &length_pos, &length_size,
--                                     &string_pos, &char_size, NULL))
-+                                     &string_pos, &char_type, NULL))
-           {
-             len = extract_unsigned_integer (valaddr + embedded_offset + length_pos, length_size);
--            LA_PRINT_STRING (stream, valaddr + embedded_offset + string_pos, len, char_size, 0, options);
-+            LA_PRINT_STRING (stream, char_type, valaddr + embedded_offset + string_pos, len, 0, options);
-           }
-         else
-           pascal_object_print_value_fields (type, valaddr + embedded_offset, address, stream,
-@@ -426,7 +426,7 @@ pascal_val_print (struct type *type, const gdb_byte *valaddr,
-         else
-           fprintf_filtered (stream, "%d", (int) val);
-         fputs_filtered (" ", stream);
--        LA_PRINT_CHAR ((unsigned char) val, stream);
-+        LA_PRINT_CHAR ((unsigned char) val, type, stream);
-       }
-       break;
-@@ -931,7 +931,7 @@ pascal_object_print_static_field (struct value *val,
-   if (TYPE_CODE (type) == TYPE_CODE_STRUCT)
-     {
--      CORE_ADDR *first_dont_print;
-+      CORE_ADDR *first_dont_print, addr;
-       int i;
-       first_dont_print
-@@ -941,7 +941,7 @@ pascal_object_print_static_field (struct value *val,
-       while (--i >= 0)
-       {
--        if (VALUE_ADDRESS (val) == first_dont_print[i])
-+        if (value_address (val) == first_dont_print[i])
-           {
-             fputs_filtered ("<same as static member of an already seen type>",
-                             stream);
-@@ -949,11 +949,12 @@ pascal_object_print_static_field (struct value *val,
-           }
-       }
--      obstack_grow (&dont_print_statmem_obstack, (char *) &VALUE_ADDRESS (val),
-+      addr = value_address (val);
-+      obstack_grow (&dont_print_statmem_obstack, (char *) &addr,
-                   sizeof (CORE_ADDR));
-       CHECK_TYPEDEF (type);
--      pascal_object_print_value_fields (type, value_contents (val), VALUE_ADDRESS (val),
-+      pascal_object_print_value_fields (type, value_contents (val), value_address (val),
-                                       stream, recurse, options, NULL, 1);
-       return;
-     }
 diff --git a/gdb/parse.c b/gdb/parse.c
-index eee1f8e..66aaf6a 100644
+index ef938e3..c243bd8 100644
 --- a/gdb/parse.c
 +++ b/gdb/parse.c
-@@ -306,7 +306,7 @@ write_exp_elt_intern (struct internalvar *expelt)
-    strings with embedded null bytes, as is required for some languages.
-    Don't be fooled by the fact that the string is null byte terminated,
--   this is strictly for the convenience of debugging gdb itself.  Gdb
-+   this is strictly for the convenience of debugging gdb itself.
-    Gdb does not depend up the string being null terminated, since the
-    actual length is recorded in expression elements at each end of the
-    string.  The null byte is taken into consideration when computing how
-@@ -352,6 +352,65 @@ write_exp_string (struct stoken str)
-   write_exp_elt_longcst ((LONGEST) len);
- }
-+/* Add a vector of string constants to the end of the expression.
-+
-+   This adds an OP_STRING operation, but encodes the contents
-+   differently from write_exp_string.  The language is expected to
-+   handle evaluation of this expression itself.
-+   
-+   After the usual OP_STRING header, TYPE is written into the
-+   expression as a long constant.  The interpretation of this field is
-+   up to the language evaluator.
-+   
-+   Next, each string in VEC is written.  The length is written as a
-+   long constant, followed by the contents of the string.  */
-+
-+void
-+write_exp_string_vector (int type, struct stoken_vector *vec)
-+{
-+  int i, n_slots, len;
-+
-+  /* Compute the size.  We compute the size in number of slots to
-+     avoid issues with string padding.  */
-+  n_slots = 0;
-+  for (i = 0; i < vec->len; ++i)
-+    {
-+      /* One slot for the length of this element, plus the number of
-+       slots needed for this string.  */
-+      n_slots += 1 + BYTES_TO_EXP_ELEM (vec->tokens[i].length);
-+    }
-+
-+  /* One more slot for the type of the string.  */
-+  ++n_slots;
-+
-+  /* Now compute a phony string length.  */
-+  len = EXP_ELEM_TO_BYTES (n_slots) - 1;
-+
-+  n_slots += 4;
-+  if ((expout_ptr + n_slots) >= expout_size)
-+    {
-+      expout_size = max (expout_size * 2, expout_ptr + n_slots + 10);
-+      expout = (struct expression *)
-+      xrealloc ((char *) expout, (sizeof (struct expression)
-+                                  + EXP_ELEM_TO_BYTES (expout_size)));
-+    }
-+
-+  write_exp_elt_opcode (OP_STRING);
-+  write_exp_elt_longcst (len);
-+  write_exp_elt_longcst (type);
-+
-+  for (i = 0; i < vec->len; ++i)
-+    {
-+      write_exp_elt_longcst (vec->tokens[i].length);
-+      memcpy (&expout->elts[expout_ptr], vec->tokens[i].ptr,
-+            vec->tokens[i].length);
-+      expout_ptr += BYTES_TO_EXP_ELEM (vec->tokens[i].length);
-+    }
-+
-+  write_exp_elt_longcst (len);
-+  write_exp_elt_opcode (OP_STRING);
-+}
-+
- /* Add a bitstring constant to the end of the expression.
-    Bitstring constants are stored by first writing an expression element
-@@ -777,6 +836,15 @@ operator_length_standard (struct expression *expr, int endpos,
+@@ -63,6 +63,7 @@ const struct exp_descriptor exp_descriptor_standard =
+   {
+     print_subexp_standard,
+     operator_length_standard,
++    operator_check_standard,
+     op_name_standard,
+     dump_subexp_body_standard,
+     evaluate_subexp_standard
+@@ -837,6 +838,15 @@ operator_length_standard (struct expression *expr, int endpos,
        args = 1 + longest_to_int (expr->elts[endpos - 2].longconst);
        break;
  
@@ -23447,245 +12263,255 @@ index eee1f8e..66aaf6a 100644
      case OP_OBJC_MSGCALL:     /* Objective C message (method) call */
        oplen = 4;
        args = 1 + longest_to_int (expr->elts[endpos - 2].longconst);
-diff --git a/gdb/parser-defs.h b/gdb/parser-defs.h
-index 2c4b755..cbda9c3 100644
---- a/gdb/parser-defs.h
-+++ b/gdb/parser-defs.h
-@@ -69,6 +69,22 @@ struct stoken
-     int length;
-   };
+@@ -1355,6 +1365,150 @@ parser_fprintf (FILE *x, const char *y, ...)
+   va_end (args);
+ }
  
-+struct typed_stoken
-+  {
-+    /* A language-specific type field.  */
-+    int type;
-+    /* Pointer to first byte of char-string or first bit of bit-string */
-+    char *ptr;
-+    /* Length of string in bytes for char-string or bits for bit-string */
-+    int length;
-+  };
++/* Implementation of the exp_descriptor method operator_check.  */
 +
-+struct stoken_vector
-+  {
-+    int len;
-+    struct typed_stoken *tokens;
-+  };
++int
++operator_check_standard (struct expression *exp, int pos,
++                       int (*type_func) (struct type *type, void *data),
++                       int (*objfile_func) (struct objfile *objfile,
++                                            void *data),
++                       void *data)
++{
++  const union exp_element *const elts = exp->elts;
++  struct type *type = NULL;
++  struct objfile *objfile = NULL;
++
++  /* Extended operators should have been already handled by exp_descriptor
++     iterate method of its specific language.  */
++  gdb_assert (elts[pos].opcode < OP_EXTENDED0);
++
++  /* Track the callers of write_exp_elt_type for this table.  */
++
++  switch (elts[pos].opcode)
++    {
++    case BINOP_VAL:
++    case OP_COMPLEX:
++    case OP_DECFLOAT:
++    case OP_DOUBLE:
++    case OP_LONG:
++    case OP_SCOPE:
++    case OP_TYPE:
++    case UNOP_CAST:
++    case UNOP_MAX:
++    case UNOP_MEMVAL:
++    case UNOP_MIN:
++      type = elts[pos + 1].type;
++      break;
 +
- struct ttype
-   {
-     struct stoken stoken;
-@@ -130,6 +146,8 @@ extern void write_exp_elt_intern (struct internalvar *);
- extern void write_exp_string (struct stoken);
-+void write_exp_string_vector (int type, struct stoken_vector *vec);
++    case UNOP_MEMVAL_TLS:
++      objfile = elts[pos + 1].objfile;
++      type = elts[pos + 2].type;
++      break;
 +
- extern void write_exp_bitstring (struct stoken);
- extern void write_exp_elt_block (struct block *);
-diff --git a/gdb/ppc-linux-tdep.c b/gdb/ppc-linux-tdep.c
-index d08d4fc..c2bbdf9 100644
---- a/gdb/ppc-linux-tdep.c
-+++ b/gdb/ppc-linux-tdep.c
-@@ -38,6 +38,7 @@
- #include "trad-frame.h"
- #include "frame-unwind.h"
- #include "tramp-frame.h"
-+#include "linux-tdep.h"
- #include "features/rs6000/powerpc-32l.c"
- #include "features/rs6000/powerpc-altivec32l.c"
-@@ -53,6 +54,9 @@
- #include "features/rs6000/powerpc-isa205-vsx64l.c"
- #include "features/rs6000/powerpc-e500l.c"
-+/* The syscall's XML filename for PPC and PPC64.  */
-+#define XML_SYSCALL_FILENAME_PPC "syscalls/ppc-linux.xml"
-+#define XML_SYSCALL_FILENAME_PPC64 "syscalls/ppc64-linux.xml"
- /* ppc_linux_memory_remove_breakpoints attempts to remove a breakpoint
-    in much the same fashion as memory_remove_breakpoint in mem-break.c,
-@@ -1009,6 +1013,38 @@ ppc_linux_trap_reg_p (struct gdbarch *gdbarch)
-          && register_size (gdbarch, PPC_TRAP_REGNUM) > 0;
- }
-+/* Return the current system call's number present in the
-+   r0 register.  When the function fails, it returns -1.  */
-+static LONGEST
-+ppc_linux_get_syscall_number (struct gdbarch *gdbarch,
-+                              ptid_t ptid)
++    case OP_VAR_VALUE:
++      {
++      const struct block *const block = elts[pos + 1].block;
++      const struct symbol *const symbol = elts[pos + 2].symbol;
++      const struct obj_section *const section = SYMBOL_OBJ_SECTION (symbol);
++
++      /* Check objfile where the variable itself is placed.  */
++      if (section && objfile_func && (*objfile_func) (section->objfile, data))
++        return 1;
++
++      /* Check objfile where is placed the code touching the variable.  */
++      objfile = block_objfile (block);
++
++      type = SYMBOL_TYPE (symbol);
++      }
++      break;
++    }
++
++  /* Invoke callbacks for TYPE and OBJFILE if they were set as non-NULL.  */
++
++  if (type && type_func && (*type_func) (type, data))
++    return 1;
++  if (type && TYPE_OBJFILE (type) && objfile_func
++      && (*objfile_func) (TYPE_OBJFILE (type), data))
++    return 1;
++  if (objfile && objfile_func && (*objfile_func) (objfile, data))
++    return 1;
++
++  return 0;
++}
++
++/* Call TYPE_FUNC and OBJFILE_FUNC for any TYPE and OBJFILE found being
++   referenced by EXP.  The functions are never called with NULL TYPE or NULL
++   OBJFILE.  Functions get passed an arbitrary caller supplied DATA pointer.
++   If any of the functions returns non-zero value then (any other) non-zero
++   value is immediately returned to the caller.  Otherwise zero is returned
++   after iterating through whole EXP.  */
++
++static int
++exp_iterate (struct expression *exp,
++           int (*type_func) (struct type *type, void *data),
++           int (*objfile_func) (struct objfile *objfile, void *data),
++           void *data)
 +{
-+  struct regcache *regcache = get_thread_regcache (ptid);
-+  struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
-+  struct cleanup *cleanbuf;
-+  /* The content of a register */
-+  gdb_byte *buf;
-+  /* The result */
-+  LONGEST ret;
++  int endpos;
++  const union exp_element *const elts = exp->elts;
++
++  for (endpos = exp->nelts; endpos > 0; )
++    {
++      int pos, args, oplen = 0;
 +
-+  /* Make sure we're in a 32- or 64-bit machine */
-+  gdb_assert (tdep->wordsize == 4 || tdep->wordsize == 8);
++      exp->language_defn->la_exp_desc->operator_length (exp, endpos,
++                                                      &oplen, &args);
++      gdb_assert (oplen > 0);
 +
-+  buf = (gdb_byte *) xmalloc (tdep->wordsize * sizeof (gdb_byte));
++      pos = endpos - oplen;
++      if (exp->language_defn->la_exp_desc->operator_check (exp, pos, type_func,
++                                                         objfile_func, data))
++      return 1;
 +
-+  cleanbuf = make_cleanup (xfree, buf);
++      endpos = pos;
++    }
 +
-+  /* Getting the system call number from the register.
-+     When dealing with PowerPC architecture, this information
-+     is stored at 0th register.  */
-+  regcache_cooked_read (regcache, tdep->ppc_gp0_regnum, buf);
++  return 0;
++}
 +
-+  ret = extract_signed_integer (buf, tdep->wordsize);
-+  do_cleanups (cleanbuf);
++/* Helper for exp_uses_objfile.  */
 +
-+  return ret;
++static int
++exp_uses_objfile_iter (struct objfile *exp_objfile, void *objfile_voidp)
++{
++  struct objfile *objfile = objfile_voidp;
++
++  return exp_objfile == objfile;
 +}
 +
- static void
- ppc_linux_write_pc (struct regcache *regcache, CORE_ADDR pc)
- {
-@@ -1069,6 +1105,9 @@ ppc_linux_init_abi (struct gdbarch_info info,
-   struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
-   struct tdesc_arch_data *tdesc_data = (void *) info.tdep_info;
-+  /* Initializing common methods.  */
-+  linux_tdep_init (gdbarch);
++/* Return 1 if EXP uses OBJFILE (and will become dangling when OBJFILE
++   is unloaded), otherwise return 0.  */
 +
-   /* PPC GNU/Linux uses either 64-bit or 128-bit long doubles; where
-      128-bit, they are IBM long double, not IEEE quad long double as
-      in the System V ABI PowerPC Processor Supplement.  We can safely
-@@ -1080,6 +1119,9 @@ ppc_linux_init_abi (struct gdbarch_info info,
-   /* Handle inferior calls during interrupted system calls.  */
-   set_gdbarch_write_pc (gdbarch, ppc_linux_write_pc);
-+  /* Get the syscall number from the arch's register.  */
-+  set_gdbarch_get_syscall_number (gdbarch, ppc_linux_get_syscall_number);
++int
++exp_uses_objfile (struct expression *exp, struct objfile *objfile)
++{
++  return exp_iterate (exp, NULL, exp_uses_objfile_iter, objfile);
++}
 +
-   if (tdep->wordsize == 4)
-     {
-       /* Until November 2001, gcc did not comply with the 32 bit SysV
-@@ -1099,6 +1141,9 @@ ppc_linux_init_abi (struct gdbarch_info info,
-       set_solib_svr4_fetch_link_map_offsets
-         (gdbarch, svr4_ilp32_fetch_link_map_offsets);
-+      /* Setting the correct XML syscall filename.  */
-+      set_gdbarch_xml_syscall_filename (gdbarch, XML_SYSCALL_FILENAME_PPC);
-+
-       /* Trampolines.  */
-       tramp_frame_prepend_unwinder (gdbarch, &ppc32_linux_sigaction_tramp_frame);
-       tramp_frame_prepend_unwinder (gdbarch, &ppc32_linux_sighandler_tramp_frame);
-@@ -1116,6 +1161,9 @@ ppc_linux_init_abi (struct gdbarch_info info,
-       set_solib_svr4_fetch_link_map_offsets
-         (gdbarch, svr4_lp64_fetch_link_map_offsets);
-+      /* Setting the correct XML syscall filename.  */
-+      set_gdbarch_xml_syscall_filename (gdbarch, XML_SYSCALL_FILENAME_PPC64);
-+
-       /* Trampolines.  */
-       tramp_frame_prepend_unwinder (gdbarch, &ppc64_linux_sigaction_tramp_frame);
-       tramp_frame_prepend_unwinder (gdbarch, &ppc64_linux_sighandler_tramp_frame);
-diff --git a/gdb/printcmd.c b/gdb/printcmd.c
-index 375f82e..8c3f476 100644
---- a/gdb/printcmd.c
-+++ b/gdb/printcmd.c
-@@ -43,6 +43,7 @@
- #include "disasm.h"
- #include "dfp.h"
- #include "valprint.h"
-+#include "charset.h"
- #ifdef TUI
- #include "tui/tui.h"          /* For tui_active et.al.   */
-@@ -62,11 +63,15 @@ struct format_data
-     int count;
-     char format;
-     char size;
-+
-+    /* True if the value should be printed raw -- that is, bypassing
-+       python-based formatters.  */
-+    unsigned char raw;
-   };
- /* Last specified output format.  */
--static char last_format = 'x';
-+static char last_format = 0;
- /* Last specified examination size.  'b', 'h', 'w' or `q'.  */
-@@ -175,6 +180,7 @@ decode_format (char **string_ptr, int oformat, int osize)
-   val.format = '?';
-   val.size = '?';
-   val.count = 1;
-+  val.raw = 0;
-   if (*p >= '0' && *p <= '9')
-     val.count = atoi (p);
-@@ -187,6 +193,11 @@ decode_format (char **string_ptr, int oformat, int osize)
-     {
-       if (*p == 'b' || *p == 'h' || *p == 'w' || *p == 'g')
-       val.size = *p++;
-+      else if (*p == 'r')
-+      {
-+        val.raw = 1;
-+        p++;
-+      }
-       else if (*p >= 'a' && *p <= 'z')
-       val.format = *p++;
-       else
-@@ -264,24 +275,27 @@ print_formatted (struct value *val, int size,
-   int len = TYPE_LENGTH (type);
-   if (VALUE_LVAL (val) == lval_memory)
--    next_address = VALUE_ADDRESS (val) + len;
-+    next_address = value_address (val) + len;
-   if (size)
-     {
-       switch (options->format)
-       {
-       case 's':
--        /* FIXME: Need to handle wchar_t's here... */
--        next_address = VALUE_ADDRESS (val)
--          + val_print_string (VALUE_ADDRESS (val), -1, 1, stream,
--                              options);
-+        {
-+          struct type *elttype = value_type (val);
-+          next_address = (value_address (val)
-+                          + val_print_string (elttype,
-+                                              value_address (val), -1,
-+                                              stream, options));
-+        }
-         return;
++/* Helper for exp_types_mark_used.  */
++
++static int
++exp_types_mark_used_iter (struct type *type, void *unused)
++{
++  type_mark_used (type);
++
++  /* Continue the traversal.  */
++  return 0;
++}
++
++/* Call type_mark_used for any TYPE contained in EXP.  */
++
++void
++exp_types_mark_used (struct expression *exp)
++{
++  exp_iterate (exp, exp_types_mark_used_iter, NULL, NULL);
++}
++
+ void
+ _initialize_parse (void)
+ {
+diff --git a/gdb/parser-defs.h b/gdb/parser-defs.h
+index cbda9c3..a07e6f2 100644
+--- a/gdb/parser-defs.h
++++ b/gdb/parser-defs.h
+@@ -189,6 +189,13 @@ extern void operator_length (struct expression *, int, int *, int *);
+ extern void operator_length_standard (struct expression *, int, int *, int *);
++extern int operator_check_standard (struct expression *exp, int pos,
++                                  int (*type_func) (struct type *type,
++                                                    void *data),
++                                  int (*objfile_func)
++                                    (struct objfile *objfile, void *data),
++                                  void *data);
++
+ extern char *op_name_standard (enum exp_opcode);
+ extern struct type *follow_types (struct type *);
+@@ -267,6 +274,20 @@ struct exp_descriptor
+        the number of subexpressions it takes.  */
+     void (*operator_length) (struct expression*, int, int*, int *);
++    /* Call TYPE_FUNC and OBJFILE_FUNC for any TYPE and OBJFILE found being
++       referenced by the single operator of EXP at position POS.  Operator
++       parameters are located at positive (POS + number) offsets in EXP.
++       The functions should never be called with NULL TYPE or NULL OBJFILE.
++       Functions should get passed an arbitrary caller supplied DATA pointer.
++       If any of the functions returns non-zero value then (any other) non-zero
++       value should be immediately returned to the caller.  Otherwise zero
++       should be returned.  */
++    int (*operator_check) (struct expression *exp, int pos,
++                         int (*type_func) (struct type *type, void *data),
++                         int (*objfile_func) (struct objfile *objfile,
++                                              void *data),
++                         void *data);
++
+     /* Name of this operator for dumping purposes.  */
+     char *(*op_name) (enum exp_opcode);
+@@ -299,4 +320,8 @@ extern void print_subexp_standard (struct expression *, int *,
+ extern void parser_fprintf (FILE *, const char *, ...) ATTR_FORMAT (printf, 2 ,3);
++extern int exp_uses_objfile (struct expression *exp, struct objfile *objfile);
++
++extern void exp_types_mark_used (struct expression *exp);
++
+ #endif /* PARSER_DEFS_H */
+diff --git a/gdb/ppc-linux-nat.c b/gdb/ppc-linux-nat.c
+index 47b74ad..22fb2fc 100644
+--- a/gdb/ppc-linux-nat.c
++++ b/gdb/ppc-linux-nat.c
+@@ -1391,6 +1391,24 @@ ppc_linux_remove_watchpoint (CORE_ADDR addr, int len, int rw)
+   return 0;
+ }
  
-       case 'i':
-         /* We often wrap here if there are long symbolic names.  */
-         wrap_here ("    ");
--        next_address = (VALUE_ADDRESS (val)
--                        + gdb_print_insn (VALUE_ADDRESS (val), stream,
-+        next_address = (value_address (val)
-+                        + gdb_print_insn (value_address (val), stream,
-                                           &branch_delay_insns));
-         return;
-       }
-@@ -369,7 +383,7 @@ print_scalar_formatted (const void *valaddr, struct type *type,
-         print_hex_chars (stream, valaddr, len, byte_order);
-         return;
-       case 'c':
--        print_char_chars (stream, valaddr, len, byte_order);
-+        print_char_chars (stream, type, valaddr, len, byte_order);
-         return;
-       default:
-         break;
-@@ -865,6 +879,7 @@ print_command_1 (char *exp, int inspect, int voidprint)
-       fmt.count = 1;
-       fmt.format = 0;
-       fmt.size = 0;
-+      fmt.raw = 0;
-     }
++/* See target_detach_watchpoints.  Do not use wrapper
++   ppc_linux_remove_watchpoint as it would modify the register cache
++   (saved_dabr_value).  */
++
++static int
++ppc_linux_detach_watchpoints (void)
++{
++  pid_t tid;
++
++  tid = TIDGET (inferior_ptid);
++  if (tid == 0)
++    tid = PIDGET (inferior_ptid);
++
++  if (ptrace (PTRACE_SET_DEBUGREG, tid, NULL, NULL) < 0)
++    return -1;
++  return 0;
++}
++
+ static void
+ ppc_linux_new_thread (ptid_t ptid)
+ {
+@@ -1648,6 +1666,7 @@ _initialize_ppc_linux_nat (void)
+   t->to_region_ok_for_hw_watchpoint = ppc_linux_region_ok_for_hw_watchpoint;
+   t->to_insert_watchpoint = ppc_linux_insert_watchpoint;
+   t->to_remove_watchpoint = ppc_linux_remove_watchpoint;
++  t->to_detach_watchpoints = ppc_linux_detach_watchpoints;
+   t->to_stopped_by_watchpoint = ppc_linux_stopped_by_watchpoint;
+   t->to_stopped_data_address = ppc_linux_stopped_data_address;
+   t->to_watchpoint_addr_within_range = ppc_linux_watchpoint_addr_within_range;
+diff --git a/gdb/printcmd.c b/gdb/printcmd.c
+index 5d8b936..fb0a455 100644
+--- a/gdb/printcmd.c
++++ b/gdb/printcmd.c
+@@ -46,7 +46,6 @@
+ #include "exceptions.h"
+ #include "observer.h"
+ #include "solist.h"
+-#include "solib.h"
+ #include "parser-defs.h"
+ #include "charset.h"
  
-   if (exp && *exp)
-@@ -878,6 +893,11 @@ print_command_1 (char *exp, int inspect, int voidprint)
+@@ -900,6 +899,11 @@ print_command_1 (char *exp, int inspect, int voidprint)
    else
      val = access_value_history (0);
  
@@ -23697,201 +12523,127 @@ index 375f82e..8c3f476 100644
    if (voidprint || (val && value_type (val) &&
                    TYPE_CODE (value_type (val)) != TYPE_CODE_VOID))
      {
-@@ -900,6 +920,7 @@ print_command_1 (char *exp, int inspect, int voidprint)
-       get_formatted_print_options (&opts, format);
-       opts.inspect_it = inspect;
-+      opts.raw = fmt.raw;
-       print_formatted (val, fmt.size, &opts, gdb_stdout);
-       printf_filtered ("\n");
-@@ -950,6 +971,7 @@ output_command (char *exp, int from_tty)
-   struct value_print_options opts;
-   fmt.size = 0;
-+  fmt.raw = 0;
-   if (exp && *exp == '/')
-     {
-@@ -967,6 +989,7 @@ output_command (char *exp, int from_tty)
-   annotate_value_begin (value_type (val));
-   get_formatted_print_options (&opts, format);
-+  opts.raw = fmt.raw;
-   print_formatted (val, fmt.size, &opts, gdb_stdout);
-   annotate_value_end ();
-@@ -1287,9 +1310,10 @@ x_command (char *exp, int from_tty)
-   struct cleanup *old_chain;
-   struct value *val;
--  fmt.format = last_format;
-+  fmt.format = last_format ? last_format : 'x';
-   fmt.size = last_size;
-   fmt.count = 1;
-+  fmt.raw = 0;
-   if (exp && *exp == '/')
-     {
-@@ -1316,7 +1340,7 @@ x_command (char *exp, int from_tty)
-       if (/* last_format == 'i'  && */ 
-         TYPE_CODE (value_type (val)) == TYPE_CODE_FUNC
-          && VALUE_LVAL (val) == lval_memory)
--      next_address = VALUE_ADDRESS (val);
-+      next_address = value_address (val);
-       else
-       next_address = value_as_address (val);
-       do_cleanups (old_chain);
-@@ -1393,6 +1417,7 @@ display_command (char *exp, int from_tty)
-         fmt.format = 0;
-         fmt.size = 0;
-         fmt.count = 0;
-+        fmt.raw = 0;
-       }
-       innermost_block = 0;
-@@ -1585,6 +1610,7 @@ do_one_display (struct display *d)
-       annotate_display_expression ();
-       get_formatted_print_options (&opts, d->format.format);
-+      opts.raw = d->format.raw;
-       print_formatted (evaluate_expression (d->exp),
-                      d->format.size, &opts, gdb_stdout);
-       printf_filtered ("\n");
-@@ -1865,7 +1891,8 @@ printf_command (char *arg, int from_tty)
+@@ -1396,6 +1400,22 @@ x_command (char *exp, int from_tty)
+       set_internalvar (lookup_internalvar ("__"), last_examine_value);
+     }
+ }
++
++/* Call type_mark_used for any TYPEs referenced from this GDB source file.  */
++
++static void
++print_types_mark_used (void)
++{
++  struct display *d;
++
++  if (last_examine_value)
++    type_mark_used (value_type (last_examine_value));
++
++  for (d = display_chain; d; d = d->next)
++    if (d->exp)
++      exp_types_mark_used (d->exp);
++}
++
\f
  
-     enum argclass
-       {
--      int_arg, long_arg, long_long_arg, ptr_arg, string_arg,
-+      int_arg, long_arg, long_long_arg, ptr_arg,
-+      string_arg, wide_string_arg, wide_char_arg,
-       double_arg, long_double_arg, decfloat_arg
-       };
-     enum argclass *argclass;
-@@ -1997,8 +2024,8 @@ printf_command (char *arg, int from_tty)
-             break;
+ /* Add an expression to the auto-display chain.
+@@ -1798,50 +1818,6 @@ disable_display_command (char *args, int from_tty)
+       }
+ }
  
-           case 'c':
--            this_argclass = int_arg;
--            if (lcount || seen_h || seen_big_l)
-+            this_argclass = lcount == 0 ? int_arg : wide_char_arg;
-+            if (lcount > 1 || seen_h || seen_big_l)
-               bad = 1;
-             if (seen_prec || seen_zero || seen_space || seen_plus)
-               bad = 1;
-@@ -2013,8 +2040,8 @@ printf_command (char *arg, int from_tty)
-             break;
+-/* Return 1 if D uses SOLIB (and will become dangling when SOLIB
+-   is unloaded), otherwise return 0.  */
+-
+-static int
+-display_uses_solib_p (const struct display *d,
+-                    const struct so_list *solib)
+-{
+-  int endpos;
+-  struct expression *const exp = d->exp;
+-  const union exp_element *const elts = exp->elts;
+-
+-  if (d->block != NULL
+-      && solib_contains_address_p (solib, d->block->startaddr))
+-    return 1;
+-
+-  for (endpos = exp->nelts; endpos > 0; )
+-    {
+-      int i, args, oplen = 0;
+-
+-      exp->language_defn->la_exp_desc->operator_length (exp, endpos,
+-                                                      &oplen, &args);
+-      gdb_assert (oplen > 0);
+-
+-      i = endpos - oplen;
+-      if (elts[i].opcode == OP_VAR_VALUE)
+-      {
+-        const struct block *const block = elts[i + 1].block;
+-        const struct symbol *const symbol = elts[i + 2].symbol;
+-        const struct obj_section *const section =
+-          SYMBOL_OBJ_SECTION (symbol);
+-
+-        if (block != NULL
+-            && solib_contains_address_p (solib, block->startaddr))
+-          return 1;
+-
+-        if (section && section->objfile == solib->objfile)
+-          return 1;
+-      }
+-      endpos -= oplen;
+-    }
+-
+-  return 0;
+-}
+-
+ /* display_chain items point to blocks and expressions.  Some expressions in
+    turn may point to symbols.
+    Both symbols and blocks are obstack_alloc'd on objfile_stack, and are
+@@ -1853,18 +1829,20 @@ display_uses_solib_p (const struct display *d,
+ static void
+ clear_dangling_display_expressions (struct so_list *solib)
+ {
++  struct objfile *objfile = solib->objfile;
+   struct display *d;
+-  struct objfile *objfile = NULL;
  
-           case 's':
--            this_argclass = string_arg;
--            if (lcount || seen_h || seen_big_l)
-+            this_argclass = lcount == 0 ? string_arg : wide_string_arg;
-+            if (lcount > 1 || seen_h || seen_big_l)
-               bad = 1;
-             if (seen_zero || seen_space || seen_plus)
-               bad = 1;
-@@ -2066,6 +2093,15 @@ printf_command (char *arg, int from_tty)
-               last_arg[length_before_ll + lcount];
-             current_substring += length_before_ll + 4;
-           }
-+        else if (this_argclass == wide_string_arg
-+                 || this_argclass == wide_char_arg)
-+          {
-+            /* Convert %ls or %lc to %s.  */
-+            int length_before_ls = f - last_arg - 2;
-+            strncpy (current_substring, last_arg, length_before_ls);
-+            strcpy (current_substring + length_before_ls, "s");
-+            current_substring += length_before_ls + 2;
-+          }
-         else
-           {
-             strncpy (current_substring, last_arg, f - last_arg);
-@@ -2130,6 +2166,76 @@ printf_command (char *arg, int from_tty)
-             printf_filtered (current_substring, (char *) str);
-           }
-           break;
-+        case wide_string_arg:
-+          {
-+            gdb_byte *str;
-+            CORE_ADDR tem;
-+            int j;
-+            struct type *wctype = lookup_typename ("wchar_t", NULL, 0);
-+            int wcwidth = TYPE_LENGTH (wctype);
-+            gdb_byte *buf = alloca (wcwidth);
-+            struct obstack output;
-+            struct cleanup *inner_cleanup;
-+
-+            tem = value_as_address (val_args[i]);
-+
-+            /* This is a %s argument.  Find the length of the string.  */
-+            for (j = 0;; j += wcwidth)
-+              {
-+                QUIT;
-+                read_memory (tem + j, buf, wcwidth);
-+                if (extract_unsigned_integer (buf, wcwidth) == 0)
-+                  break;
-+              }
-+
-+            /* Copy the string contents into a string inside GDB.  */
-+            str = (gdb_byte *) alloca (j + wcwidth);
-+            if (j != 0)
-+              read_memory (tem, str, j);
-+            memset (&str[j], 0, wcwidth);
-+
-+            obstack_init (&output);
-+            inner_cleanup = make_cleanup_obstack_free (&output);
+-  for (d = display_chain; d; d = d->next)
+-    {
+-      if (d->exp && display_uses_solib_p (d, solib))
+-      {
+-        xfree (d->exp);
+-        d->exp = NULL;
+-        d->block = NULL;
+-      }
+-    }
++  if (objfile == NULL)
++    return;
 +
-+            convert_between_encodings (target_wide_charset (),
-+                                       host_charset (),
-+                                       str, j, wcwidth,
-+                                       &output, translit_char);
-+            obstack_grow_str0 (&output, "");
++  for (d = display_chain; d != NULL; d = d->next)
++    if (block_objfile (d->block) == objfile
++      || (d->exp && exp_uses_objfile (d->exp, objfile)))
++      {
++      xfree (d->exp);
++      d->exp = NULL;
++      d->block = NULL;
++      }
+ }
\f
+@@ -2749,4 +2727,6 @@ Show printing of source filename and line number with <symbol>."), NULL,
+                          NULL,
+                          show_print_symbol_filename,
+                          &setprintlist, &showprintlist);
 +
-+            printf_filtered (current_substring, obstack_base (&output));
-+            do_cleanups (inner_cleanup);
-+          }
-+          break;
-+        case wide_char_arg:
-+          {
-+            struct type *wctype = lookup_typename ("wchar_t", NULL, 0);
-+            struct type *valtype;
-+            struct obstack output;
-+            struct cleanup *inner_cleanup;
-+            const gdb_byte *bytes;
-+
-+            valtype = value_type (val_args[i]);
-+            if (TYPE_LENGTH (valtype) != TYPE_LENGTH (wctype)
-+                || TYPE_CODE (valtype) != TYPE_CODE_INT)
-+              error (_("expected wchar_t argument for %%lc"));
-+
-+            bytes = value_contents (val_args[i]);
-+
-+            obstack_init (&output);
-+            inner_cleanup = make_cleanup_obstack_free (&output);
-+
-+            convert_between_encodings (target_wide_charset (),
-+                                       host_charset (),
-+                                       bytes, TYPE_LENGTH (valtype),
-+                                       TYPE_LENGTH (valtype),
-+                                       &output, translit_char);
-+            obstack_grow_str0 (&output, "");
-+
-+            printf_filtered (current_substring, obstack_base (&output));
-+            do_cleanups (inner_cleanup);
-+          }
-+          break;
-         case double_arg:
-           {
-             struct type *type = value_type (val_args[i]);
++  observer_attach_mark_used (print_types_mark_used);
+ }
 diff --git a/gdb/python/lib/gdb/FrameIterator.py b/gdb/python/lib/gdb/FrameIterator.py
 new file mode 100644
-index 0000000..87fb074
+index 0000000..5654546
 --- /dev/null
 +++ b/gdb/python/lib/gdb/FrameIterator.py
 @@ -0,0 +1,33 @@
 +# Iterator over frames.
 +
-+# Copyright (C) 2008 Free Software Foundation, Inc.
++# Copyright (C) 2008, 2009 Free Software Foundation, Inc.
 +
 +# This program is free software; you can redistribute it and/or modify
 +# it under the terms of the GNU General Public License as published by
@@ -23918,10 +12670,128 @@ index 0000000..87fb074
 +
 +    def next (self):
 +        result = self.frame
-+        if result == None:
++        if result is None:
 +            raise StopIteration
 +        self.frame = result.older ()
 +        return result
+diff --git a/gdb/python/lib/gdb/FrameWrapper.py b/gdb/python/lib/gdb/FrameWrapper.py
+new file mode 100644
+index 0000000..b790a54
+--- /dev/null
++++ b/gdb/python/lib/gdb/FrameWrapper.py
+@@ -0,0 +1,112 @@
++# Wrapper API for frames.
++
++# Copyright (C) 2008, 2009 Free Software Foundation, Inc.
++
++# This program is free software; you can redistribute it and/or modify
++# it under the terms of the GNU General Public License as published by
++# the Free Software Foundation; either version 3 of the License, or
++# (at your option) any later version.
++#
++# This program is distributed in the hope that it will be useful,
++# but WITHOUT ANY WARRANTY; without even the implied warranty of
++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++# GNU General Public License for more details.
++#
++# You should have received a copy of the GNU General Public License
++# along with this program.  If not, see <http://www.gnu.org/licenses/>.
++
++import gdb
++
++# FIXME: arguably all this should be on Frame somehow.
++class FrameWrapper:
++    def __init__ (self, frame):
++        self.frame = frame;
++
++    def write_symbol (self, stream, sym, block):
++        if len (sym.linkage_name):
++            nsym, is_field_of_this = gdb.lookup_symbol (sym.linkage_name, block)
++            if nsym.addr_class != gdb.SYMBOL_LOC_REGISTER:
++                sym = nsym
++
++        stream.write (sym.print_name + "=")
++        try:
++            val = self.read_var (sym)
++            if val != None:
++                val = str (val)
++        # FIXME: would be nice to have a more precise exception here.
++        except RuntimeError, text:
++            val = text
++        if val == None:
++            stream.write ("???")
++        else:
++            stream.write (str (val))
++
++    def print_frame_locals (self, stream, func):
++        if not func:
++            return
++
++        first = True
++        block = func.value
++
++        for sym in block:
++            if sym.is_argument:
++                continue;
++
++            self.write_symbol (stream, sym, block)
++            stream.write ('\n')
++
++    def print_frame_args (self, stream, func):
++        if not func:
++            return
++
++        first = True
++        block = func.value
++
++        for sym in block:
++            if not sym.is_argument:
++                continue;
++
++            if not first:
++                stream.write (", ")
++
++            self.write_symbol (stream, sym, block)
++            first = False
++
++    # FIXME: this should probably just be a method on gdb.Frame.
++    # But then we need stream wrappers.
++    def describe (self, stream, full):
++        if self.type () == gdb.DUMMY_FRAME:
++            stream.write (" <function called from gdb>\n")
++        elif self.type () == gdb.SIGTRAMP_FRAME:
++            stream.write (" <signal handler called>\n")
++        else:
++            sal = self.find_sal ()
++            pc = self.pc ()
++            name = self.name ()
++            if not name:
++                name = "??"
++            if pc != sal.pc or not sal.symtab:
++                stream.write (" 0x%08x in" % pc)
++            stream.write (" " + name + " (")
++
++            func = self.function ()
++            self.print_frame_args (stream, func)
++
++            stream.write (")")
++
++            if sal.symtab and sal.symtab.filename:
++                stream.write (" at " + sal.symtab.filename)
++                stream.write (":" + str (sal.line))
++
++            if not self.name () or (not sal.symtab or not sal.symtab.filename):
++                lib = gdb.solib_address (pc)
++                if lib:
++                    stream.write (" from " + lib)
++
++            stream.write ("\n")
++
++            if full:
++                self.print_frame_locals (stream, func)
++
++    def __getattr__ (self, name):
++        return getattr (self.frame, name)
 diff --git a/gdb/python/lib/gdb/__init__.py b/gdb/python/lib/gdb/__init__.py
 new file mode 100644
 index 0000000..b375c68
@@ -24069,13 +12939,13 @@ index 0000000..96b6618
 +AliasCommand()
 diff --git a/gdb/python/lib/gdb/command/backtrace.py b/gdb/python/lib/gdb/command/backtrace.py
 new file mode 100644
-index 0000000..f07696e
+index 0000000..ec9a527
 --- /dev/null
 +++ b/gdb/python/lib/gdb/command/backtrace.py
-@@ -0,0 +1,197 @@
+@@ -0,0 +1,106 @@
 +# New backtrace command.
 +
-+# Copyright (C) 2008 Free Software Foundation, Inc.
++# Copyright (C) 2008, 2009 Free Software Foundation, Inc.
 +
 +# This program is free software; you can redistribute it and/or modify
 +# it under the terms of the GNU General Public License as published by
@@ -24094,101 +12964,9 @@ index 0000000..f07696e
 +import gdb.backtrace
 +import itertools
 +from gdb.FrameIterator import FrameIterator
++from gdb.FrameWrapper import FrameWrapper
 +import sys
 +
-+class FrameWrapper:
-+    def __init__ (self, frame):
-+        self.frame = frame;
-+
-+    def write_symbol (self, stream, sym, block):
-+        if len (sym.linkage_name):
-+            nsym, is_field_of_this = gdb.lookup_symbol (sym.linkage_name, block)
-+            if nsym.addr_class != gdb.SYMBOL_LOC_REGISTER:
-+                sym = nsym
-+
-+        stream.write (sym.print_name + "=")
-+        try:
-+            val = self.frame.read_var (sym)
-+            if val != None:
-+                val = str (val)
-+        # FIXME: would be nice to have a more precise exception here.
-+        except RuntimeError, text:
-+            val = text
-+        if val == None:
-+            stream.write ("???")
-+        else:
-+            stream.write (str (val))
-+
-+    def print_frame_locals (self, stream, func):
-+        if not func:
-+            return
-+
-+        first = True
-+        block = func.value
-+
-+        for sym in block:
-+            if sym.is_argument:
-+                continue;
-+
-+            self.write_symbol (stream, sym, block)
-+            stream.write ('\n')
-+
-+    def print_frame_args (self, stream, func):
-+        if not func:
-+            return
-+
-+        first = True
-+        block = func.value
-+
-+        for sym in block:
-+            if not sym.is_argument:
-+                continue;
-+
-+            if not first:
-+                stream.write (", ")
-+
-+            self.write_symbol (stream, sym, block)
-+            first = False
-+
-+    # FIXME: this should probably just be a method on gdb.Frame.
-+    # But then we need stream wrappers.
-+    def describe (self, stream, full):
-+        if self.frame.type () == gdb.DUMMY_FRAME:
-+            stream.write (" <function called from gdb>\n")
-+        elif self.frame.type () == gdb.SIGTRAMP_FRAME:
-+            stream.write (" <signal handler called>\n")
-+        else:
-+            sal = self.frame.find_sal ()
-+            pc = self.frame.pc ()
-+            name = self.frame.name ()
-+            if not name:
-+                name = "??"
-+            if pc != sal.pc or not sal.symtab:
-+                stream.write (" 0x%08x in" % pc)
-+            stream.write (" " + name + " (")
-+
-+            func = gdb.find_pc_function (self.frame.addr_in_block ())
-+            self.print_frame_args (stream, func)
-+
-+            stream.write (")")
-+
-+            if sal.symtab and sal.symtab.filename:
-+                stream.write (" at " + sal.symtab.filename)
-+                stream.write (":" + str (sal.line))
-+
-+            if not self.frame.name () or (not sal.symtab or not sal.symtab.filename):
-+                lib = gdb.solib_address (pc)
-+                if lib:
-+                    stream.write (" from " + lib)
-+
-+            stream.write ("\n")
-+
-+            if full:
-+                self.print_frame_locals (stream, func)
-+
-+    def __getattr__ (self, name):
-+        return getattr (self.frame, name)
-+
 +class ReverseBacktraceParameter (gdb.Parameter):
 +    """The new-backtrace command can show backtraces in 'reverse' order.
 +This means that the innermost frame will be printed last.
@@ -24247,8 +13025,9 @@ index 0000000..f07696e
 +
 +        # FIXME: provide option to start at selected frame
 +        # However, should still number as if starting from newest
++      newest_frame = gdb.selected_thread ().newest_frame ()
 +        iter = itertools.imap (FrameWrapper,
-+                               FrameIterator (gdb.newest_frame ()))
++                               FrameIterator (newest_frame))
 +        if filter:
 +            iter = gdb.backtrace.create_frame_filter (iter)
 +
@@ -24315,13 +13094,13 @@ index 0000000..6fa48ff
 +IgnoreErrorsCommand ()
 diff --git a/gdb/python/lib/gdb/command/pahole.py b/gdb/python/lib/gdb/command/pahole.py
 new file mode 100644
-index 0000000..569b816
+index 0000000..21a0bf0
 --- /dev/null
 +++ b/gdb/python/lib/gdb/command/pahole.py
-@@ -0,0 +1,81 @@
+@@ -0,0 +1,75 @@
 +# pahole command for gdb
 +
-+# Copyright (C) 2008 Free Software Foundation, Inc.
++# Copyright (C) 2008, 2009 Free Software Foundation, Inc.
 +
 +# This program is free software; you can redistribute it and/or modify
 +# it under the terms of the GNU General Public License as published by
@@ -24347,16 +13126,10 @@ index 0000000..569b816
 +        super (Pahole, self).__init__ ("pahole", gdb.COMMAND_NONE,
 +                                       gdb.COMPLETE_SYMBOL)
 +
-+    @staticmethod
-+    def strip (type):
-+        while type.code () == gdb.TYPE_CODE_TYPEDEF:
-+            type = type.target ()
-+        return type
-+
 +    def pahole (self, type, level, name):
 +        if name is None:
 +            name = ''
-+        tag = type.tag ()
++        tag = type.tag
 +        if tag is None:
 +            tag = ''
 +        print '%sstruct %s {' % (' ' * (2 * level), tag)
@@ -24366,7 +13139,7 @@ index 0000000..569b816
 +            if not hasattr (field, ('bitpos')):
 +                continue
 +
-+            ftype = self.strip (field.type)
++            ftype = field.type.strip_typedefs()
 +
 +            if bitpos != field.bitpos:
 +                hole = field.bitpos - bitpos
@@ -24376,13 +13149,13 @@ index 0000000..569b816
 +                fieldsize = field.bitsize
 +            else:
 +                # TARGET_CHAR_BIT here...
-+                fieldsize = 8 * ftype.sizeof ()
++                fieldsize = 8 * ftype.sizeof
 +
 +            # TARGET_CHAR_BIT
 +            print ' /* %3d %3d */' % (int (bitpos / 8), int (fieldsize / 8)),
 +            bitpos = bitpos + fieldsize
 +
-+            if ftype.code () == gdb.TYPE_CODE_STRUCT:
++            if ftype.code == gdb.TYPE_CODE_STRUCT:
 +                self.pahole (ftype, level + 1, field.name)
 +            else:
 +                print ' ' * (2 + 2 * level),
@@ -24392,9 +13165,9 @@ index 0000000..569b816
 +        print '} %s' % name
 +
 +    def invoke (self, arg, from_tty):
-+        type = gdb.Type (arg)
-+        type = self.strip (type)
-+        if type.code () != gdb.TYPE_CODE_STRUCT:
++        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,
 +        self.pahole (type, 0, '')
@@ -24465,7 +13238,7 @@ index 0000000..1fbc1e8
 +RequireSubcommand("function")
 diff --git a/gdb/python/lib/gdb/command/save_breakpoints.py b/gdb/python/lib/gdb/command/save_breakpoints.py
 new file mode 100644
-index 0000000..90e07db
+index 0000000..6143187
 --- /dev/null
 +++ b/gdb/python/lib/gdb/command/save_breakpoints.py
 @@ -0,0 +1,65 @@
@@ -24521,7 +13294,7 @@ index 0000000..90e07db
 +                    print >> f, " if", bp.condition,
 +                print >> f
 +                if not bp.enabled:
-+                    print >> f, "disable %d" % bp.number
++                    print >> f, "disable $bpnum"
 +                # Note: we don't save the ignore count; there doesn't
 +                # seem to be much point.
 +                commands = bp.commands
@@ -24534,6 +13307,141 @@ index 0000000..90e07db
 +
 +SavePrefixCommand ()
 +SaveBreakpointsCommand ()
+diff --git a/gdb/python/lib/gdb/command/upto.py b/gdb/python/lib/gdb/command/upto.py
+new file mode 100644
+index 0000000..faf54ed
+--- /dev/null
++++ b/gdb/python/lib/gdb/command/upto.py
+@@ -0,0 +1,129 @@
++# upto command.
++
++# Copyright (C) 2009 Free Software Foundation, Inc.
++
++# This program is free software; you can redistribute it and/or modify
++# it under the terms of the GNU General Public License as published by
++# the Free Software Foundation; either version 3 of the License, or
++# (at your option) any later version.
++#
++# This program is distributed in the hope that it will be useful,
++# but WITHOUT ANY WARRANTY; without even the implied warranty of
++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++# GNU General Public License for more details.
++#
++# You should have received a copy of the GNU General Public License
++# along with this program.  If not, see <http://www.gnu.org/licenses/>.
++
++import gdb
++import re
++from gdb.FrameIterator import FrameIterator
++from gdb.FrameWrapper import FrameWrapper
++
++class UptoPrefix (gdb.Command):
++    def __init__ (self):
++        super (UptoPrefix, self).__init__ ("upto", gdb.COMMAND_STACK,
++                                           prefix = True)
++
++class UptoImplementation (gdb.Command):
++    def __init__ (self, subcommand):
++        super (UptoImplementation, self).__init__ ("upto " + subcommand,
++                                                   gdb.COMMAND_STACK)
++
++    def search (self):
++        saved = gdb.selected_frame ()
++        iter = FrameIterator (saved)
++        found = False
++        try:
++            for frame in iter:
++                frame.select ()
++                try:
++                    if self.filter (frame):
++                        wrapper = FrameWrapper (frame)
++                        wrapper.describe (sys.stdout, False)
++                        return
++                except:
++                    pass
++        except:
++            pass
++        saved.select ()
++        raise RuntimeError, 'Could not find a matching frame'
++
++    def invoke (self, arg, from_tty):
++        self.rx = re.compile (arg)
++        self.search ()
++
++class UptoSymbolCommand (UptoImplementation):
++    """Select and print some calling stack frame, based on symbol.
++The argument is a regular expression.  This command moves up the
++stack, stopping at the first frame whose symbol matches the regular
++expression."""
++
++    def __init__ (self):
++        super (UptoSymbolCommand, self).__init__ ("symbol")
++
++    def filter (self, frame):
++        name = frame.name ()
++        if name is not None:
++            if self.rx.search (name) is not None:
++                return True
++        return False
++
++class UptoSourceCommand (UptoImplementation):
++    """Select and print some calling stack frame, based on source file.
++The argument is a regular expression.  This command moves up the
++stack, stopping at the first frame whose source file name matches the
++regular expression."""
++
++    def __init__ (self):
++        super (UptoSourceCommand, self).__init__ ("source")
++
++    def filter (self, frame):
++        name = frame.find_sal ().symtab.filename
++        if name is not None:
++            if self.rx.search (name) is not None:
++                return True
++        return False
++
++class UptoObjectCommand (UptoImplementation):
++    """Select and print some calling stack frame, based on object file.
++The argument is a regular expression.  This command moves up the
++stack, stopping at the first frame whose object file name matches the
++regular expression."""
++
++    def __init__ (self):
++        super (UptoObjectCommand, self).__init__ ("object")
++
++    def filter (self, frame):
++        name = frame.find_sal ().symtab.objfile.filename
++        if name is not None:
++            if self.rx.search (name) is not None:
++                return True
++        return False
++
++class UptoWhereCommand (UptoImplementation):
++    """Select and print some calling stack frame, based on expression.
++The argument is an expression.  This command moves up the stack,
++parsing and evaluating the expression in each frame.  This stops when
++the expression evaluates to a non-zero (true) value."""
++
++    def __init__ (self):
++        super (UptoWhereCommand, self).__init__ ("where")
++
++    def filter (self, frame):
++        try:
++            if gdb.parse_and_eval (self.expression):
++                return True
++        except:
++            pass
++        return False
++
++    def invoke (self, arg, from_tty):
++        self.expression = arg
++        self.search ()
++
++UptoPrefix ()
++UptoSymbolCommand ()
++UptoSourceCommand ()
++UptoObjectCommand ()
++UptoWhereCommand ()
 diff --git a/gdb/python/lib/gdb/function/__init__.py b/gdb/python/lib/gdb/function/__init__.py
 new file mode 100644
 index 0000000..8b13789
@@ -24658,693 +13566,11 @@ index 0000000..debb3bb
 +      return wanted == found
 +
 +InScope ()
-diff --git a/gdb/python/lib/gdb/libstdcxx/__init__.py b/gdb/python/lib/gdb/libstdcxx/__init__.py
-new file mode 100644
-index 0000000..8b13789
---- /dev/null
-+++ b/gdb/python/lib/gdb/libstdcxx/__init__.py
-@@ -0,0 +1 @@
-+
-diff --git a/gdb/python/lib/gdb/libstdcxx/v6/__init__.py b/gdb/python/lib/gdb/libstdcxx/v6/__init__.py
-new file mode 100644
-index 0000000..8b13789
---- /dev/null
-+++ b/gdb/python/lib/gdb/libstdcxx/v6/__init__.py
-@@ -0,0 +1 @@
-+
-diff --git a/gdb/python/lib/gdb/libstdcxx/v6/hook.in b/gdb/python/lib/gdb/libstdcxx/v6/hook.in
-new file mode 100644
-index 0000000..fe7c072
---- /dev/null
-+++ b/gdb/python/lib/gdb/libstdcxx/v6/hook.in
-@@ -0,0 +1,27 @@
-+# -*- python -*-
-+# Copyright (C) 2009 Free Software Foundation, Inc.
-+
-+# This program is free software; you can redistribute it and/or modify
-+# it under the terms of the GNU General Public License as published by
-+# the Free Software Foundation; either version 3 of the License, or
-+# (at your option) any later version.
-+#
-+# This program is distributed in the hope that it will be useful,
-+# but WITHOUT ANY WARRANTY; without even the implied warranty of
-+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-+# GNU General Public License for more details.
-+#
-+# You should have received a copy of the GNU General Public License
-+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
-+
-+import sys
-+import gdb
-+
-+# Update module path.
-+dir = '@dir@'
-+if not dir in sys.path:
-+    sys.path.insert(0, dir)
-+
-+# Load the pretty-printers.
-+from libstdcxx.v6.printers import register_libstdcxx_printers
-+register_libstdcxx_printers (gdb.current_objfile ())
-diff --git a/gdb/python/lib/gdb/libstdcxx/v6/printers.py b/gdb/python/lib/gdb/libstdcxx/v6/printers.py
-new file mode 100644
-index 0000000..2572731
---- /dev/null
-+++ b/gdb/python/lib/gdb/libstdcxx/v6/printers.py
-@@ -0,0 +1,629 @@
-+# Pretty-printers for libstc++.
-+
-+# Copyright (C) 2008, 2009 Free Software Foundation, Inc.
-+
-+# This program is free software; you can redistribute it and/or modify
-+# it under the terms of the GNU General Public License as published by
-+# the Free Software Foundation; either version 3 of the License, or
-+# (at your option) any later version.
-+#
-+# This program is distributed in the hope that it will be useful,
-+# but WITHOUT ANY WARRANTY; without even the implied warranty of
-+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-+# GNU General Public License for more details.
-+#
-+# You should have received a copy of the GNU General Public License
-+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
-+
-+import gdb
-+import itertools
-+import re
-+
-+class StdPointerPrinter:
-+    "Print a smart pointer of some kind"
-+
-+    def __init__ (self, typename, val):
-+        self.typename = typename
-+        self.val = val
-+
-+    def to_string (self):
-+        return '%s (count %d) %s' % (self.typename,
-+        self.val['_M_refcount']['_M_pi']['_M_use_count'],
-+        self.val['_M_ptr'])
-+
-+class UniquePointerPrinter:
-+    "Print a unique_ptr"
-+
-+    def __init__ (self, val):
-+        self.val = val
-+
-+    def to_string (self):
-+        return self.val['_M_t']
-+
-+class StdListPrinter:
-+    "Print a std::list"
-+
-+    class _iterator:
-+        def __init__(self, nodetype, head):
-+            self.nodetype = nodetype
-+            self.base = head['_M_next']
-+            self.head = head.address()
-+            self.count = 0
-+
-+        def __iter__(self):
-+            return self
-+
-+        def next(self):
-+            if self.base == self.head:
-+                raise StopIteration
-+            elt = self.base.cast(self.nodetype).dereference()
-+            self.base = elt['_M_next']
-+            count = self.count
-+            self.count = self.count + 1
-+            return ('[%d]' % count, elt['_M_data'])
-+
-+    def __init__(self, val):
-+        self.val = val
-+
-+    def children(self):
-+        itype = self.val.type().template_argument(0)
-+        nodetype = gdb.Type('std::_List_node<%s>' % itype).pointer()
-+        return self._iterator(nodetype, self.val['_M_impl']['_M_node'])
-+
-+    def to_string(self):
-+        if self.val['_M_impl']['_M_node'].address() == self.val['_M_impl']['_M_node']['_M_next']:
-+            return 'empty std::list'
-+        return 'std::list'
-+
-+class StdListIteratorPrinter:
-+    "Print std::list::iterator"
-+
-+    def __init__(self, val):
-+        self.val = val
-+
-+    def to_string(self):
-+        itype = self.val.type().template_argument(0)
-+        nodetype = gdb.Type('std::_List_node<%s>' % itype).pointer()
-+        return self.val['_M_node'].cast(nodetype).dereference()['_M_data']
-+
-+class StdSlistPrinter:
-+    "Print a __gnu_cxx::slist"
-+
-+    class _iterator:
-+        def __init__(self, nodetype, head):
-+            self.nodetype = nodetype
-+            self.base = head['_M_head']['_M_next']
-+            self.count = 0
-+
-+        def __iter__(self):
-+            return self
-+
-+        def next(self):
-+            if self.base == 0:
-+                raise StopIteration
-+            elt = self.base.cast(self.nodetype).dereference()
-+            self.base = elt['_M_next']
-+            count = self.count
-+            self.count = self.count + 1
-+            return ('[%d]' % count, elt['_M_data'])
-+
-+    def __init__(self, val):
-+        self.val = val
-+
-+    def children(self):
-+        itype = self.val.type().template_argument(0)
-+        nodetype = gdb.Type('__gnu_cxx::_Slist_node<%s>' % itype).pointer()
-+        return self._iterator(nodetype, self.val)
-+
-+    def to_string(self):
-+        if self.val['_M_head']['_M_next'] == 0:
-+            return 'empty __gnu_cxx::slist'
-+        return '__gnu_cxx::slist'
-+
-+class StdSlistIteratorPrinter:
-+    "Print __gnu_cxx::slist::iterator"
-+
-+    def __init__(self, val):
-+        self.val = val
-+
-+    def to_string(self):
-+        itype = self.val.type().template_argument(0)
-+        nodetype = gdb.Type('__gnu_cxx::_Slist_node<%s>' % itype).pointer()
-+        return self.val['_M_node'].cast(nodetype).dereference()['_M_data']
-+
-+class StdVectorPrinter:
-+    "Print a std::vector"
-+
-+    class _iterator:
-+        def __init__ (self, start, finish):
-+            self.item = start
-+            self.finish = finish
-+            self.count = 0
-+
-+        def __iter__(self):
-+            return self
-+
-+        def next(self):
-+            if self.item == self.finish:
-+                raise StopIteration
-+            count = self.count
-+            self.count = self.count + 1
-+            elt = self.item.dereference()
-+            self.item = self.item + 1
-+            return ('[%d]' % count, elt)
-+
-+    def __init__(self, val):
-+        self.val = val
-+
-+    def children(self):
-+        return self._iterator(self.val['_M_impl']['_M_start'],
-+                              self.val['_M_impl']['_M_finish'])
-+
-+    def to_string(self):
-+        start = self.val['_M_impl']['_M_start']
-+        finish = self.val['_M_impl']['_M_finish']
-+        end = self.val['_M_impl']['_M_end_of_storage']
-+        return ('std::vector of length %d, capacity %d'
-+                % (int (finish - start), int (end - start)))
-+
-+    def display_hint(self):
-+        return 'array'
-+
-+class StdVectorIteratorPrinter:
-+    "Print std::vector::iterator"
-+
-+    def __init__(self, val):
-+        self.val = val
-+
-+    def to_string(self):
-+        return self.val['_M_current'].dereference()
-+
-+class StdStackOrQueuePrinter:
-+    "Print a std::stack or std::queue"
-+
-+    def __init__ (self, typename, val):
-+        self.typename = typename
-+        self.visualizer = gdb.default_visualizer(val['c'])
-+
-+    def children (self):
-+        return self.visualizer.children()
-+
-+    def to_string (self):
-+        return '%s wrapping: %s' % (self.typename,
-+                                    self.visualizer.to_string())
-+
-+    def display_hint (self):
-+        if hasattr (self.visualizer, 'display_hint'):
-+            return self.visualizer.display_hint ()
-+        return None
-+
-+class RbtreeIterator:
-+    def __init__(self, rbtree):
-+        self.size = rbtree['_M_t']['_M_impl']['_M_node_count']
-+        self.node = rbtree['_M_t']['_M_impl']['_M_header']['_M_left']
-+        self.count = 0
-+
-+    def __iter__(self):
-+        return self
-+
-+    def __len__(self):
-+        return int (self.size)
-+
-+    def next(self):
-+        if self.count == self.size:
-+            raise StopIteration
-+        result = self.node
-+        self.count = self.count + 1
-+        if self.count < self.size:
-+            # Compute the next node.
-+            node = self.node
-+            if node.dereference()['_M_right']:
-+                node = node.dereference()['_M_right']
-+                while node.dereference()['_M_left']:
-+                    node = node.dereference()['_M_left']
-+            else:
-+                parent = node.dereference()['_M_parent']
-+                while node == parent.dereference()['_M_right']:
-+                    node = parent
-+                    parent = parent.dereference()['_M_parent']
-+                if node.dereference()['_M_right'] != parent:
-+                    node = parent
-+            self.node = node
-+        return result
-+
-+# This is a pretty printer for std::_Rb_tree_iterator (which is
-+# std::map::iterator), and has nothing to do with the RbtreeIterator
-+# class above.
-+class StdRbtreeIteratorPrinter:
-+    "Print std::map::iterator"
-+
-+    def __init__ (self, val):
-+        self.val = val
-+
-+    def to_string (self):
-+        valuetype = self.val.type().template_argument(0)
-+        nodetype = gdb.Type('std::_Rb_tree_node < %s >' % valuetype)
-+        nodetype = nodetype.pointer()
-+        return self.val.cast(nodetype).dereference()['_M_value_field']
-+
-+
-+class StdMapPrinter:
-+    "Print a std::map or std::multimap"
-+
-+    # Turn an RbtreeIterator into a pretty-print iterator.
-+    class _iter:
-+        def __init__(self, rbiter, type):
-+            self.rbiter = rbiter
-+            self.count = 0
-+            self.type = type
-+
-+        def __iter__(self):
-+            return self
-+
-+        def next(self):
-+            if self.count % 2 == 0:
-+                n = self.rbiter.next()
-+                n = n.cast(self.type).dereference()['_M_value_field']
-+                self.pair = n
-+                item = n['first']
-+            else:
-+                item = self.pair['second']
-+            result = ('[%d]' % self.count, item)
-+            self.count = self.count + 1
-+            return result
-+
-+    def __init__ (self, typename, val):
-+        self.typename = typename
-+        self.val = val
-+        self.iter = RbtreeIterator (val)
-+
-+    def to_string (self):
-+        return '%s with %d elements' % (self.typename, len (self.iter))
-+
-+    def children (self):
-+        keytype = self.val.type().template_argument(0).const()
-+        valuetype = self.val.type().template_argument(1)
-+        nodetype = gdb.Type('std::_Rb_tree_node< std::pair< %s, %s > >' % (keytype, valuetype))
-+        nodetype = nodetype.pointer()
-+        return self._iter (self.iter, nodetype)
-+
-+    def display_hint (self):
-+        return 'map'
-+
-+class StdSetPrinter:
-+    "Print a std::set or std::multiset"
-+
-+    # Turn an RbtreeIterator into a pretty-print iterator.
-+    class _iter:
-+        def __init__(self, rbiter, type):
-+            self.rbiter = rbiter
-+            self.count = 0
-+            self.type = type
-+
-+        def __iter__(self):
-+            return self
-+
-+        def next(self):
-+            item = self.rbiter.next()
-+            item = item.cast(self.type).dereference()['_M_value_field']
-+            # FIXME: this is weird ... what to do?
-+            # Maybe a 'set' display hint?
-+            result = ('[%d]' % self.count, item)
-+            self.count = self.count + 1
-+            return result
-+
-+    def __init__ (self, typename, val):
-+        self.typename = typename
-+        self.val = val
-+        self.iter = RbtreeIterator (val)
-+
-+    def to_string (self):
-+        return '%s with %d elements' % (self.typename, len (self.iter))
-+
-+    def children (self):
-+        keytype = self.val.type().template_argument(0)
-+        nodetype = gdb.Type('std::_Rb_tree_node< %s >' % keytype).pointer()
-+        return self._iter (self.iter, nodetype)
-+
-+class StdBitsetPrinter:
-+    "Print a std::bitset"
-+
-+    def __init__(self, val):
-+        self.val = val
-+
-+    def to_string (self):
-+        # If template_argument handled values, we could print the
-+        # size.  Or we could use a regexp on the type.
-+        return 'std::bitset'
-+
-+    def children (self):
-+        words = self.val['_M_w']
-+        wtype = words.type()
-+
-+        # The _M_w member can be either an unsigned long, or an
-+        # array.  This depends on the template specialization used.
-+        # If it is a single long, convert to a single element list.
-+        if wtype.code () == gdb.TYPE_CODE_ARRAY:
-+            tsize = wtype.target ().sizeof ()
-+        else:
-+            words = [words]
-+            tsize = wtype.sizeof () 
-+
-+        nwords = wtype.sizeof() / tsize
-+        result = []
-+        byte = 0
-+        while byte < nwords:
-+            w = words[byte]
-+            bit = 0
-+            while w != 0:
-+                if (w & 1) != 0:
-+                    # Another spot where we could use 'set'?
-+                    result.append(('[%d]' % (byte * tsize * 8 + bit), 1))
-+                bit = bit + 1
-+                w = w >> 1
-+            byte = byte + 1
-+        return result
-+
-+class StdDequePrinter:
-+    "Print a std::deque"
-+
-+    class _iter:
-+        def __init__(self, node, start, end, last, buffer_size):
-+            self.node = node
-+            self.p = start
-+            self.end = end
-+            self.last = last
-+            self.buffer_size = buffer_size
-+            self.count = 0
-+
-+        def __iter__(self):
-+            return self
-+
-+        def next(self):
-+            if self.p == self.last:
-+                raise StopIteration
-+
-+            result = ('[%d]' % self.count, self.p.dereference())
-+            self.count = self.count + 1
-+
-+            # Advance the 'cur' pointer.
-+            self.p = self.p + 1
-+            if self.p == self.end:
-+                # If we got to the end of this bucket, move to the
-+                # next bucket.
-+                self.node = self.node + 1
-+                self.p = self.node[0]
-+                self.end = self.p + self.buffer_size
-+
-+            return result
-+
-+    def __init__(self, val):
-+        self.val = val
-+        self.elttype = val.type().template_argument(0)
-+        size = self.elttype.sizeof ()
-+        if size < 512:
-+            self.buffer_size = int (512 / size)
-+        else:
-+            self.buffer_size = 1
-+
-+    def to_string(self):
-+        start = self.val['_M_impl']['_M_start']
-+        end = self.val['_M_impl']['_M_finish']
-+
-+        delta_n = end['_M_node'] - start['_M_node'] - 1
-+        delta_s = start['_M_last'] - start['_M_cur']
-+        delta_e = end['_M_cur'] - end['_M_first']
-+
-+        size = self.buffer_size * delta_n + delta_s + delta_e
-+
-+        return 'std::deque with %d elements' % long (size)
-+
-+    def children(self):
-+        start = self.val['_M_impl']['_M_start']
-+        end = self.val['_M_impl']['_M_finish']
-+        return self._iter(start['_M_node'], start['_M_cur'], start['_M_last'],
-+                          end['_M_cur'], self.buffer_size)
-+
-+    def display_hint (self):
-+        return 'array'
-+
-+class StdDequeIteratorPrinter:
-+    "Print std::deque::iterator"
-+
-+    def __init__(self, val):
-+        self.val = val
-+
-+    def to_string(self):
-+        return self.val['_M_cur'].dereference()
-+
-+class StdStringPrinter:
-+    "Print a std::basic_string of some kind"
-+
-+    def __init__(self, encoding, val):
-+        self.encoding = encoding
-+        self.val = val
-+
-+    def to_string(self):
-+        # Look up the target encoding as late as possible.
-+        encoding = self.encoding
-+        if encoding[0] is '@':
-+            encoding = gdb.parameter(encoding[1:])
-+        return self.val['_M_dataplus']['_M_p'].string(encoding)
-+
-+    def display_hint (self):
-+        return 'string'
-+
-+class Tr1HashtableIterator:
-+    def __init__ (self, hash):
-+        self.count = 0
-+        self.n_buckets = hash['_M_element_count']
-+        if self.n_buckets == 0:
-+            self.node = False
-+        else:
-+            self.bucket = hash['_M_buckets']
-+            self.node = self.bucket[0]
-+            self.update ()
-+
-+    def __iter__ (self):
-+        return self
-+
-+    def update (self):
-+        # If we advanced off the end of the chain, move to the next
-+        # bucket.
-+        while self.node == 0:
-+            self.bucket = self.bucket + 1
-+            self.node = self.bucket[0]
-+
-+       # If we advanced off the end of the bucket array, then
-+       # we're done.
-+        if self.count == self.n_buckets:
-+            self.node = False
-+        else:
-+            self.count = self.count + 1
-+
-+    def next (self):
-+        if not self.node:
-+            raise StopIteration
-+        result = self.node.dereference()['_M_v']
-+        self.node = self.node.dereference()['_M_next']
-+        self.update ()
-+        return result
-+
-+class Tr1UnorderedSetPrinter:
-+    "Print a tr1::unordered_set"
-+
-+    def __init__ (self, typename, val):
-+        self.typename = typename
-+        self.val = val
-+
-+    def to_string (self):
-+        return '%s with %d elements' % (self.typename, self.val['_M_element_count'])
-+
-+    @staticmethod
-+    def format_count (i):
-+        return '[%d]' % i
-+
-+    def children (self):
-+        counter = itertools.imap (self.format_count, itertools.count())
-+        return itertools.izip (counter, Tr1HashtableIterator (self.val))
-+
-+class Tr1UnorderedMapPrinter:
-+    "Print a tr1::unordered_map"
-+
-+    def __init__ (self, typename, val):
-+        self.typename = typename
-+        self.val = val
-+
-+    def to_string (self):
-+        return '%s with %d elements' % (self.typename, self.val['_M_element_count'])
-+
-+    @staticmethod
-+    def flatten (list):
-+        for elt in list:
-+            for i in elt:
-+                yield i
-+
-+    @staticmethod
-+    def format_one (elt):
-+        return (elt['first'], elt['second'])
-+
-+    @staticmethod
-+    def format_count (i):
-+        return '[%d]' % i
-+
-+    def children (self):
-+        counter = itertools.imap (self.format_count, itertools.count())
-+        # Map over the hash table and flatten the result.
-+        data = self.flatten (itertools.imap (self.format_one, Tr1HashtableIterator (self.val)))
-+        # Zip the two iterators together.
-+        return itertools.izip (counter, data)
-+
-+    def display_hint (self):
-+        return 'map'
-+
-+def register_libstdcxx_printers (obj):
-+    "Register libstdc++ pretty-printers with objfile Obj."
-+
-+    if obj == None:
-+        obj = gdb
-+
-+    obj.pretty_printers.append (lookup_function)
-+
-+def lookup_function (val):
-+    "Look-up and return a pretty-printer that can print val."
-+
-+    # Get the type.
-+    type = val.type ();
-+
-+    # If it points to a reference, get the reference.
-+    if type.code () == gdb.TYPE_CODE_REF:
-+        type = type.target ()
-+
-+    # Get the unqualified type, stripped of typedefs.
-+    type = type.unqualified ().strip_typedefs ()
-+
-+    # Get the type name.    
-+    typename = type.tag ()
-+    if typename == None:
-+        return None
-+
-+    # Iterate over local dictionary of types to determine
-+    # if a printer is registered for that type.  Return an
-+    # instantiation of the printer if found.
-+    for function in pretty_printers_dict:
-+        if function.search (typename):
-+            return pretty_printers_dict[function] (val)
-+        
-+    # Cannot find a pretty printer.  Return None.
-+    return None
-+
-+def build_libstdcxx_dictionary ():
-+    # libstdc++ objects requiring pretty-printing.
-+    # In order from:
-+    # http://gcc.gnu.org/onlinedocs/libstdc++/latest-doxygen/a01847.html
-+    pretty_printers_dict[re.compile('^std::basic_string<char,.*>$')] = lambda val: StdStringPrinter('@target-charset', val)
-+    pretty_printers_dict[re.compile('^std::basic_string<wchar_t,.*>$')] = lambda val: StdStringPrinter('@target-wide-charset', val)
-+    pretty_printers_dict[re.compile('^std::basic_string<char16_t,.*>$')] = lambda val: StdStringPrinter('UTF-16', val)
-+    pretty_printers_dict[re.compile('^std::basic_string<char32_t,.*>$')] = lambda val: StdStringPrinter('UTF-32', val)
-+    pretty_printers_dict[re.compile('^std::bitset<.*>$')] = StdBitsetPrinter
-+    pretty_printers_dict[re.compile('^std::deque<.*>$')] = StdDequePrinter
-+    pretty_printers_dict[re.compile('^std::list<.*>$')] = StdListPrinter
-+    pretty_printers_dict[re.compile('^std::map<.*>$')] = lambda val: StdMapPrinter("std::map", val)
-+    pretty_printers_dict[re.compile('^std::multimap<.*>$')] = lambda val: StdMapPrinter("std::multimap", val)
-+    pretty_printers_dict[re.compile('^std::multiset<.*>$')] = lambda val: StdSetPrinter("std::multiset", val)
-+    pretty_printers_dict[re.compile('^std::priority_queue<.*>$')] = lambda val: StdStackOrQueuePrinter("std::priority_queue", val)
-+    pretty_printers_dict[re.compile('^std::queue<.*>$')] = lambda val: StdStackOrQueuePrinter("std::queue", val)
-+    pretty_printers_dict[re.compile('^std::set<.*>$')] = lambda val: StdSetPrinter("std::set", val)
-+    pretty_printers_dict[re.compile('^std::stack<.*>$')] = lambda val: StdStackOrQueuePrinter("std::stack", val)
-+    pretty_printers_dict[re.compile('^std::unique_ptr<.*>$')] = UniquePointerPrinter
-+    pretty_printers_dict[re.compile('^std::vector<.*>$')] = StdVectorPrinter
-+    # vector<bool>
-+
-+    # These are the C++0x printers. They also exist in the standard namespace.
-+    # For array - the default GDB pretty-printer seems reasonable.
-+    pretty_printers_dict[re.compile('^std::(tr1::)?shared_ptr<.*>$')] = lambda val: StdPointerPrinter ('std::shared_ptr', val)
-+    pretty_printers_dict[re.compile('^std::(tr1::)?weak_ptr<.*>$')] = lambda val: StdPointerPrinter ('std::weak_ptr', val)
-+    pretty_printers_dict[re.compile('^std::(tr1::)?unordered_map<.*>$')] = lambda val: Tr1UnorderedMapPrinter ('std::tr1::unordered_map', val)
-+    pretty_printers_dict[re.compile('^std::(tr1::)?unordered_set<.*>$')] = lambda val: Tr1UnorderedSetPrinter ('std::tr1::unordered_set', val)
-+    pretty_printers_dict[re.compile('^std::(tr1::)?unordered_multimap<.*>$')] = lambda val: Tr1UnorderedMapPrinter ('std::tr1::unordered_multimap', val)
-+    pretty_printers_dict[re.compile('^std::(tr1::)?unordered_multiset<.*>$')] = lambda val: Tr1UnorderedSetPrinter ('std::tr1::unordered_multiset', val)
-+
-+
-+    # Extensions.
-+    pretty_printers_dict[re.compile('^__gnu_cxx::slist<.*>$')] = StdSlistPrinter
-+
-+    if True:
-+        # These shouldn't be necessary, if GDB "print *i" worked.
-+        # But it often doesn't, so here they are.
-+        pretty_printers_dict[re.compile('^std::_List_iterator<.*>$')] = lambda val: StdListIteratorPrinter(val)
-+        pretty_printers_dict[re.compile('^std::_List_const_iterator<.*>$')] = lambda val: StdListIteratorPrinter(val)
-+        pretty_printers_dict[re.compile('^std::_Rb_tree_iterator<.*>$')] = lambda val: StdRbtreeIteratorPrinter(val)
-+        pretty_printers_dict[re.compile('^std::_Rb_tree_const_iterator<.*>$')] = lambda val: StdRbtreeIteratorPrinter(val)
-+        pretty_printers_dict[re.compile('^std::_Deque_iterator<.*>$')] = lambda val: StdDequeIteratorPrinter(val)
-+        pretty_printers_dict[re.compile('^std::_Deque_const_iterator<.*>$')] = lambda val: StdDequeIteratorPrinter(val)
-+        pretty_printers_dict[re.compile('^__gnu_cxx::__normal_iterator<.*>$')] = lambda val: StdVectorIteratorPrinter(val)
-+        pretty_printers_dict[re.compile('^__gnu_cxx::_Slist_iterator<.*>$')] = lambda val: StdSlistIteratorPrinter(val)
-+
-+pretty_printers_dict = {}
-+
-+build_libstdcxx_dictionary ()
-diff --git a/gdb/python/python-block.c b/gdb/python/python-block.c
+diff --git a/gdb/python/py-block.c b/gdb/python/py-block.c
 new file mode 100644
 index 0000000..8019e9d
 --- /dev/null
-+++ b/gdb/python/python-block.c
++++ b/gdb/python/py-block.c
 @@ -0,0 +1,265 @@
 +/* Python interface to blocks.
 +
@@ -25611,11 +13837,11 @@ index 0000000..8019e9d
 +  blpy_block_syms_iternext,     /* tp_iternext */
 +  0                             /* tp_methods */
 +};
-diff --git a/gdb/python/python-breakpoint.c b/gdb/python/python-breakpoint.c
+diff --git a/gdb/python/py-breakpoint.c b/gdb/python/py-breakpoint.c
 new file mode 100644
-index 0000000..ec80419
+index 0000000..afa9526
 --- /dev/null
-+++ b/gdb/python/python-breakpoint.c
++++ b/gdb/python/py-breakpoint.c
 @@ -0,0 +1,665 @@
 +/* Python interface to breakpoints
 +
@@ -26059,8 +14285,8 @@ index 0000000..ec80419
 +
 +  TRY_CATCH (except, RETURN_MASK_ALL)
 +    {
-+      set_breakpoint (spec, NULL, 0, 0, -1, 0, AUTO_BOOLEAN_TRUE,
-+                    1 /*enabled*/);
++      set_breakpoint (python_gdbarch, spec, NULL, 0, 0, -1, 0,
++                    AUTO_BOOLEAN_TRUE, 1);
 +    }
 +  if (except.reason < 0)
 +    {
@@ -26282,11 +14508,11 @@ index 0000000..ec80419
 +  0,                            /* tp_members */
 +  breakpoint_object_getset      /* tp_getset */
 +};
-diff --git a/gdb/python/python-cmd.c b/gdb/python/python-cmd.c
-index 36cde34..e6e3ac0 100644
---- a/gdb/python/python-cmd.c
-+++ b/gdb/python/python-cmd.c
-@@ -47,8 +47,7 @@ static struct cmdpy_completer completers[] =
+diff --git a/gdb/python/py-cmd.c b/gdb/python/py-cmd.c
+index 528aca6..04b3fd1 100644
+--- a/gdb/python/py-cmd.c
++++ b/gdb/python/py-cmd.c
+@@ -49,8 +49,7 @@ static struct cmdpy_completer completers[] =
  
  #define N_COMPLETERS (sizeof (completers) / sizeof (completers[0]))
  
@@ -26296,7 +14522,7 @@ index 36cde34..e6e3ac0 100644
  struct cmdpy_object
  {
    PyObject_HEAD
-@@ -68,7 +67,6 @@ typedef struct cmdpy_object cmdpy_object;
+@@ -70,7 +69,6 @@ typedef struct cmdpy_object cmdpy_object;
  
  static PyTypeObject cmdpy_object_type;
  
@@ -26304,7 +14530,7 @@ index 36cde34..e6e3ac0 100644
  /* Constants used by this module.  */
  static PyObject *invoke_cst;
  static PyObject *complete_cst;
-@@ -265,10 +263,13 @@ cmdpy_completer (struct cmd_list_element *command, char *text, char *word)
+@@ -263,10 +261,13 @@ cmdpy_completer (struct cmd_list_element *command, char *text, char *word)
     *BASE_LIST is set to the final prefix command's list of
     *sub-commands.
     
@@ -26320,7 +14546,7 @@ index 36cde34..e6e3ac0 100644
  {
    struct cmd_list_element *elt;
    int len = strlen (text);
-@@ -301,7 +302,7 @@ parse_command_name (char *text, struct cmd_list_element ***base_list)
+@@ -299,7 +300,7 @@ parse_command_name (char *text, struct cmd_list_element ***base_list)
      ;
    if (i < 0)
      {
@@ -26329,7 +14555,7 @@ index 36cde34..e6e3ac0 100644
        return result;
      }
  
-@@ -310,7 +311,7 @@ parse_command_name (char *text, struct cmd_list_element ***base_list)
+@@ -308,7 +309,7 @@ parse_command_name (char *text, struct cmd_list_element ***base_list)
    prefix_text[i + 1] = '\0';
  
    text = prefix_text;
@@ -26338,1313 +14564,1133 @@ index 36cde34..e6e3ac0 100644
    if (!elt || elt == (struct cmd_list_element *) -1)
      {
        PyErr_Format (PyExc_RuntimeError, _("could not find command prefix %s"),
-@@ -336,16 +337,16 @@ parse_command_name (char *text, struct cmd_list_element ***base_list)
- /* Object initializer; sets up gdb-side structures for command.
--   Use: __init__(NAME, CMDCLASS, [COMPLETERCLASS, [PREFIX]]).
-+   Use: __init__(NAME, COMMAND_CLASS, [COMPLETER_CLASS, [PREFIX]]).
+@@ -399,7 +400,7 @@ cmdpy_init (PyObject *self, PyObject *args, PyObject *kw)
+       return -1;
+     }
  
-    NAME is the name of the command.  It may consist of multiple words,
-    in which case the final word is the name of the new command, and
-    earlier words must be prefix commands.
+-  cmd_name = parse_command_name (name, &cmd_list);
++  cmd_name = gdbpy_parse_command_name (name, &cmd_list, &cmdlist);
+   if (! cmd_name)
+     return -1;
  
--   CMDCLASS is the kind of command.  It should be one of the COMMAND_*
-+   COMMAND_CLASS is the kind of command.  It should be one of the COMMAND_*
-    constants defined in the gdb module.
+diff --git a/gdb/python/py-frame.c b/gdb/python/py-frame.c
+index 279415c..5d8ce0a 100644
+--- a/gdb/python/py-frame.c
++++ b/gdb/python/py-frame.c
+@@ -202,10 +202,59 @@ frapy_pc (PyObject *self, PyObject *args)
+   return PyLong_FromUnsignedLongLong (pc);
+ }
  
--   COMPLETERCLASS is the kind of completer.  If not given, the
-+   COMPLETER_CLASS is the kind of completer.  If not given, the
-    "complete" method will be used.  Otherwise, it should be one of the
-    COMPLETE_* constants defined in the gdb module.
-@@ -356,7 +357,7 @@ parse_command_name (char *text, struct cmd_list_element ***base_list)
-    
- */
- static int
--cmdpy_init (PyObject *self, PyObject *args, PyObject *kwds)
-+cmdpy_init (PyObject *self, PyObject *args, PyObject *kw)
- {
-   cmdpy_object *obj = (cmdpy_object *) self;
-   char *name;
-@@ -366,6 +367,8 @@ cmdpy_init (PyObject *self, PyObject *args, PyObject *kwds)
-   volatile struct gdb_exception except;
-   struct cmd_list_element **cmd_list;
-   char *cmd_name, *pfx_name;
-+  static char *keywords[] = { "name", "command_class", "completer_class",
-+                            "prefix", NULL };
-   PyObject *is_prefix = NULL;
-   int cmp;
-@@ -378,7 +381,7 @@ cmdpy_init (PyObject *self, PyObject *args, PyObject *kwds)
-       return -1;
-     }
--  if (! PyArg_ParseTuple (args, "si|iO", &name, &cmdtype,
-+  if (! PyArg_ParseTupleAndKeywords (args, kw, "si|iO", keywords, &name, &cmdtype,
-                         &completetype, &is_prefix))
-     return -1;
-@@ -399,7 +402,7 @@ cmdpy_init (PyObject *self, PyObject *args, PyObject *kwds)
-       return -1;
-     }
--  cmd_name = parse_command_name (name, &cmd_list);
-+  cmd_name = gdbpy_parse_command_name (name, &cmd_list, &cmdlist);
-   if (! cmd_name)
-     return -1;
-diff --git a/gdb/python/python-frame.c b/gdb/python/python-frame.c
-new file mode 100644
-index 0000000..c257ac3
---- /dev/null
-+++ b/gdb/python/python-frame.c
-@@ -0,0 +1,686 @@
-+/* Python interface to stack frames
-+
-+   Copyright (C) 2008, 2009 Free Software Foundation, Inc.
-+
-+   This file is part of GDB.
-+
-+   This program is free software; you can redistribute it and/or modify
-+   it under the terms of the GNU General Public License as published by
-+   the Free Software Foundation; either version 3 of the License, or
-+   (at your option) any later version.
-+
-+   This program is distributed in the hope that it will be useful,
-+   but WITHOUT ANY WARRANTY; without even the implied warranty of
-+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-+   GNU General Public License for more details.
-+
-+   You should have received a copy of the GNU General Public License
-+   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
-+
-+#include "defs.h"
-+#include "charset.h"
-+#include "block.h"
-+#include "frame.h"
-+#include "exceptions.h"
-+#include "symtab.h"
-+#include "stack.h"
-+#include "value.h"
-+#include "python-internal.h"
-+
-+typedef struct {
-+  PyObject_HEAD
-+  struct frame_id frame_id;
-+  struct gdbarch *gdbarch;
-+
-+  /* Marks that the FRAME_ID member actually holds the ID of the frame next
-+     to this, and not this frames' ID itself.  This is a hack to permit Python
-+     frame objects which represent invalid frames (i.e., the last frame_info
-+     in a corrupt stack).  The problem arises from the fact that this code
-+     relies on FRAME_ID to uniquely identify a frame, which is not always true
-+     for the last "frame" in a corrupt stack (it can have a null ID, or the same
-+     ID as the  previous frame).  Whenever get_prev_frame returns NULL, we
-+     record the frame_id of the next frame and set FRAME_ID_IS_NEXT to 1.  */
-+  int frame_id_is_next;
-+} frame_object;
-+
-+/* Require a valid frame.  This must be called inside a TRY_CATCH, or
-+   another context in which a gdb exception is allowed.  */
-+#define FRAPY_REQUIRE_VALID(frame_obj, frame)         \
-+    do {                                              \
-+      frame = frame_object_to_frame_info (frame_obj); \
-+      if (frame == NULL)                              \
-+      error ("Frame is invalid.");                    \
-+    } while (0)
-+
-+static PyTypeObject frame_object_type;
-+
-+/* Returns the frame_info object corresponding to the given Python Frame
-+   object.  If the frame doesn't exist anymore (the frame id doesn't
-+   correspond to any frame in the inferior), returns NULL.  */
-+
-+static struct frame_info *
-+frame_object_to_frame_info (frame_object *frame_obj)
-+{
-+  struct frame_info *frame;
-+
-+  frame = frame_find_by_id (frame_obj->frame_id);
-+  if (frame == NULL)
-+    return NULL;
-+
-+  if (frame_obj->frame_id_is_next)
-+    frame = get_prev_frame (frame);
-+
-+  return frame;
-+}
-+
-+/* Called by the Python interpreter to obtain string representation
-+   of the object.  */
-+
-+static PyObject *
-+frapy_str (PyObject *self)
-+{
-+  char *s;
-+  long len;
-+  PyObject *result;
-+  struct ui_file *strfile;
-+  
-+  strfile = mem_fileopen ();
-+  fprint_frame_id (strfile, ((frame_object *) self)->frame_id);
-+  s = ui_file_xstrdup (strfile, &len);
-+  result = PyString_FromString (s);
-+  xfree (s);
-+
-+  return result;
-+}
-+
-+/* Implementation of gdb.Frame.is_valid (self) -> Boolean.
-+   Returns True if the frame corresponding to the frame_id of this
-+   object still exists in the inferior.  */
-+
-+static PyObject *
-+frapy_is_valid (PyObject *self, PyObject *args)
-+{
-+  struct frame_info *frame;
-+
-+  frame = frame_object_to_frame_info ((frame_object *) self);
-+  if (frame == NULL)
-+    Py_RETURN_FALSE;
-+
-+  Py_RETURN_TRUE;
-+}
-+
-+/* Implementation of gdb.Frame.equals (self, other) -> Boolean. */
-+
-+static PyObject *
-+frapy_equal_p (PyObject *self, PyObject *args)
-+{
-+  int equalp = 0;       /* Initialize to appease gcc warning.  */
-+  frame_object *self_frame = (frame_object *) self;
-+  frame_object *other;
-+  volatile struct gdb_exception except;
-+
-+  if (!PyArg_ParseTuple (args, "O!", &frame_object_type, &other))
-+    return NULL;
-+
-+  TRY_CATCH (except, RETURN_MASK_ALL)
-+    {
-+      equalp = frame_id_eq (self_frame->frame_id, other->frame_id);
-+    }
-+  GDB_PY_HANDLE_EXCEPTION (except);
-+
-+  if (equalp)
-+    Py_RETURN_TRUE;
-+
-+  Py_RETURN_FALSE;
-+}
-+
-+/* Implementation of gdb.Frame.name (self) -> String.
-+   Returns the name of the function corresponding to this frame.  */
++/* Implementation of gdb.Frame.block (self) -> gdb.Block.
++   Returns the frame's code block.  */
 +
 +static PyObject *
-+frapy_name (PyObject *self, PyObject *args)
++frapy_block (PyObject *self, PyObject *args)
 +{
 +  struct frame_info *frame;
-+  char *name;
-+  enum language lang;
-+  PyObject *result;
++  struct block *block = NULL;
 +  volatile struct gdb_exception except;
 +
 +  TRY_CATCH (except, RETURN_MASK_ALL)
 +    {
 +      FRAPY_REQUIRE_VALID ((frame_object *) self, frame);
 +
-+      find_frame_funname (frame, &name, &lang);
++      block = block_for_pc (get_frame_address_in_block (frame));
 +    }
 +  GDB_PY_HANDLE_EXCEPTION (except);
 +
-+  if (name)
-+    result = target_string_to_unicode (name, strlen (name));
-+  else
-+    {
-+      result = Py_None;
-+      Py_INCREF (Py_None);
-+    }
++  if (block)
++    return block_to_block_object (block);
 +
-+  return result;
++  Py_RETURN_NONE;
 +}
 +
-+/* Implementation of gdb.Frame.type (self) -> Integer.
-+   Returns the frame type, namely one of the gdb.*_FRAME constants.  */
++
++/* Implementation of gdb.Frame.function (self) -> gdb.Symbol.
++   Returns the symbol for the function corresponding to this frame.  */
 +
 +static PyObject *
-+frapy_type (PyObject *self, PyObject *args)
++frapy_function (PyObject *self, PyObject *args)
 +{
++  struct symbol *sym = NULL;
 +  struct frame_info *frame;
-+  enum frame_type type = NORMAL_FRAME;/* Initialize to appease gcc warning.  */
 +  volatile struct gdb_exception except;
 +
 +  TRY_CATCH (except, RETURN_MASK_ALL)
 +    {
 +      FRAPY_REQUIRE_VALID ((frame_object *) self, frame);
 +
-+      type = get_frame_type (frame);
-+    }
-+  GDB_PY_HANDLE_EXCEPTION (except);
-+
-+  return PyInt_FromLong (type);
-+}
-+
-+/* Implementation of gdb.Frame.unwind_stop_reason (self) -> Integer.
-+   Returns one of the gdb.FRAME_UNWIND_* constants.  */
-+
-+static PyObject *
-+frapy_unwind_stop_reason (PyObject *self, PyObject *args)
-+{
-+  struct frame_info *frame = NULL;    /* Initialize to appease gcc warning.  */
-+  volatile struct gdb_exception except;
-+  enum unwind_stop_reason stop_reason;
-+
-+  TRY_CATCH (except, RETURN_MASK_ALL)
-+    {
-+      FRAPY_REQUIRE_VALID ((frame_object *) self, frame);
++      sym = find_pc_function (get_frame_address_in_block (frame));
 +    }
 +  GDB_PY_HANDLE_EXCEPTION (except);
 +
-+  stop_reason = get_frame_unwind_stop_reason (frame);
++  if (sym)
++    return symbol_to_symbol_object (sym);
 +
-+  return PyInt_FromLong (stop_reason);
++  Py_RETURN_NONE;
 +}
 +
-+/* Implementation of gdb.Frame.pc (self) -> Long.
-+   Returns the frame's resume address.  */
+ /* Convert a frame_info struct to a Python Frame object.
+    Sets a Python exception and returns NULL on error.  */
+-static frame_object *
++PyObject *
+ frame_info_to_frame_object (struct frame_info *frame)
+ {
+   frame_object *frame_obj;
+@@ -235,7 +284,7 @@ frame_info_to_frame_object (struct frame_info *frame)
+   frame_obj->gdbarch = get_frame_arch (frame);
+-  return frame_obj;
++  return (PyObject *) frame_obj;
+ }
+ /* Implementation of gdb.Frame.older (self) -> gdb.Frame.
+@@ -296,7 +345,30 @@ frapy_newer (PyObject *self, PyObject *args)
+   return next_obj;
+ }
+-/* Implementation of gdb.Frame.read_var_value (self, variable) -> gdb.Value.
++/* Implementation of gdb.Frame.find_sal (self) -> gdb.Symtab_and_line.
++   Returns the frame's symtab and line.  */
 +
 +static PyObject *
-+frapy_pc (PyObject *self, PyObject *args)
++frapy_find_sal (PyObject *self, PyObject *args)
 +{
-+  CORE_ADDR pc = 0;         /* Initialize to appease gcc warning.  */
 +  struct frame_info *frame;
++  struct symtab_and_line sal;
 +  volatile struct gdb_exception except;
++  PyObject *sal_obj = NULL;   /* Initialize to appease gcc warning.  */
 +
 +  TRY_CATCH (except, RETURN_MASK_ALL)
 +    {
 +      FRAPY_REQUIRE_VALID ((frame_object *) self, frame);
 +
-+      pc = get_frame_pc (frame);
++      find_frame_sal (frame, &sal);
++      sal_obj = symtab_and_line_to_sal_object (sal);
 +    }
 +  GDB_PY_HANDLE_EXCEPTION (except);
 +
-+  return PyLong_FromUnsignedLongLong (pc);
++  return sal_obj;
 +}
 +
-+/* Implementation of gdb.Frame.block (self) -> gdb.Block.
-+   Returns the frame's code block.  */
++/* Implementation of gdb.Frame.read_var (self, variable) -> gdb.Value.
+    Returns the value of the given variable in this frame.  The argument must be
+    a string.  Returns None if GDB can't find the specified variable.  */
+@@ -312,7 +384,9 @@ frapy_read_var (PyObject *self, PyObject *args)
+   if (!PyArg_ParseTuple (args, "O", &sym_obj))
+     return NULL;
+-  if (gdbpy_is_string (sym_obj))
++  if (PyObject_TypeCheck (sym_obj, &symbol_object_type))
++    var = symbol_object_to_symbol (sym_obj);
++  else if (gdbpy_is_string (sym_obj))
+     {
+       char *var_name;
+       struct block *block = NULL;
+@@ -365,6 +439,25 @@ frapy_read_var (PyObject *self, PyObject *args)
+   Py_RETURN_NONE;
+ }
++/* Select this frame.  */
 +
 +static PyObject *
-+frapy_block (PyObject *self, PyObject *args)
++frapy_select (PyObject *self, PyObject *args)
 +{
-+  struct frame_info *frame;
-+  struct block *block = NULL;
++  struct frame_info *fi;
++  frame_object *frame = (frame_object *) self;
 +  volatile struct gdb_exception except;
 +
 +  TRY_CATCH (except, RETURN_MASK_ALL)
 +    {
-+      FRAPY_REQUIRE_VALID ((frame_object *) self, frame);
-+
-+      block = block_for_pc (get_frame_address_in_block (frame));
++      FRAPY_REQUIRE_VALID (frame, fi);
++      select_frame (fi);
 +    }
 +  GDB_PY_HANDLE_EXCEPTION (except);
 +
-+  if (block)
-+    return block_to_block_object (block);
-+
 +  Py_RETURN_NONE;
 +}
 +
+ /* Implementation of gdb.selected_frame () -> gdb.Frame.
+    Returns the selected frame object.  */
+@@ -372,7 +465,7 @@ PyObject *
+ gdbpy_selected_frame (PyObject *self, PyObject *args)
+ {
+   struct frame_info *frame;
+-  frame_object *frame_obj = NULL;   /* Initialize to appease gcc warning.  */
++  PyObject *frame_obj = NULL;   /* Initialize to appease gcc warning.  */
+   volatile struct gdb_exception except;
+   TRY_CATCH (except, RETURN_MASK_ALL)
+@@ -382,7 +475,7 @@ gdbpy_selected_frame (PyObject *self, PyObject *args)
+     }
+   GDB_PY_HANDLE_EXCEPTION (except);
+-  return (PyObject *) frame_obj;
++  return frame_obj;
+ }
+ /* Implementation of gdb.stop_reason_string (Integer) -> String.
+@@ -484,15 +577,26 @@ Return the reason why it's not possible to find frames older than this." },
+   { "pc", frapy_pc, METH_NOARGS,
+     "pc () -> Long.\n\
+ Return the frame's resume address." },
++  { "block", frapy_block, METH_NOARGS,
++    "block () -> gdb.Block.\n\
++Return the frame's code block." },
++  { "function", frapy_function, METH_NOARGS,
++    "function () -> gdb.Symbol.\n\
++Returns the symbol for the function corresponding to this frame." },
+   { "older", frapy_older, METH_NOARGS,
+     "older () -> gdb.Frame.\n\
+ Return the frame that called this frame." },
+   { "newer", frapy_newer, METH_NOARGS,
+     "newer () -> gdb.Frame.\n\
+ Return the frame called by this frame." },
++  { "find_sal", frapy_find_sal, METH_NOARGS,
++    "find_sal () -> gdb.Symtab_and_line.\n\
++Return the frame's symtab and line." },
+   { "read_var", frapy_read_var, METH_VARARGS,
+     "read_var (variable) -> gdb.Value.\n\
+ Return the value of the variable in this frame." },
++  { "select", frapy_select, METH_NOARGS,
++    "Select this frame as the user's current frame." },
+   {NULL}  /* Sentinel */
+ };
+diff --git a/gdb/python/py-hooks.c b/gdb/python/py-hooks.c
+new file mode 100644
+index 0000000..a3140bc
+--- /dev/null
++++ b/gdb/python/py-hooks.c
+@@ -0,0 +1,50 @@
++/* Notifications from gdb to Python
 +
-+/* Implementation of gdb.Frame.addr_in_block (self) -> Long.
-+   Returns an address which falls within the frame's code block.  */
++   Copyright (C) 2008 Free Software Foundation, Inc.
 +
-+static PyObject *
-+frapy_addr_in_block (PyObject *self, PyObject *args)
-+{
-+  CORE_ADDR pc = 0;         /* Initialize to appease gcc warning.  */
-+  struct frame_info *frame;
-+  volatile struct gdb_exception except;
++   This file is part of GDB.
 +
-+  TRY_CATCH (except, RETURN_MASK_ALL)
-+    {
-+      FRAPY_REQUIRE_VALID ((frame_object *) self, frame);
++   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.
 +
-+      pc = get_frame_address_in_block (frame);
-+    }
-+  GDB_PY_HANDLE_EXCEPTION (except);
++   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.
 +
-+  return PyLong_FromUnsignedLongLong (pc);
-+}
++   You should have received a copy of the GNU General Public License
++   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 +
-+/* Convert a frame_info struct to a Python Frame object.
-+   Sets a Python exception and returns NULL on error.  */
++#include "defs.h"
++#include "cli/cli-decode.h"
++#include "charset.h"
++#include "python.h"
++#include "python-internal.h"
++#include "observer.h"
 +
-+static frame_object *
-+frame_info_to_frame_object (struct frame_info *frame)
++PyObject *
++gdbpy_get_hook_function (const char *name)
 +{
-+  frame_object *frame_obj;
++  PyObject *hooks;
++  PyObject *result;
 +
-+  frame_obj = PyObject_New (frame_object, &frame_object_type);
-+  if (frame_obj == NULL)
++  if (! PyObject_HasAttrString (gdb_module, "hooks"))
++    return NULL;
++  hooks = PyObject_GetAttrString (gdb_module, "hooks");
++  if (! hooks)
++    return NULL;
++  /* The cast is because the Python function doesn't declare const argument.
++     This is a problem in Python version 2.4, but not in 2.5.  */
++  if (! PyObject_HasAttrString (hooks, (char *) name))
 +    {
-+      PyErr_SetString (PyExc_MemoryError, "Could not allocate frame object.");
++      Py_DECREF (hooks);
 +      return NULL;
 +    }
++  /* The cast is because the Python function doesn't declare const argument.
++     This is a problem in Python version 2.4, but not in 2.5.  */
++  result = PyObject_GetAttrString (hooks, (char *) name);
++  Py_DECREF (hooks);
++  return result;
++}
+diff --git a/gdb/python/py-inferior.c b/gdb/python/py-inferior.c
+new file mode 100644
+index 0000000..5e90cc2
+--- /dev/null
++++ b/gdb/python/py-inferior.c
+@@ -0,0 +1,926 @@
++/* Python interface to inferiors.
 +
-+  /* Try to get the previous frame, to determine if this is the last frame
-+     in a corrupt stack.  If so, we need to store the frame_id of the next
-+     frame and not of this one (which is possibly invalid).  */
-+  if (get_prev_frame (frame) == NULL
-+      && get_frame_unwind_stop_reason (frame) != UNWIND_NO_REASON
-+      && get_next_frame (frame) != NULL)
-+    {
-+      frame_obj->frame_id = get_frame_id (get_next_frame (frame));
-+      frame_obj->frame_id_is_next = 1;
-+    }
-+  else
-+    {
-+      frame_obj->frame_id = get_frame_id (frame);
-+      frame_obj->frame_id_is_next = 0;
-+    }
++   Copyright (C) 2009 Free Software Foundation, Inc.
 +
-+  frame_obj->gdbarch = get_frame_arch (frame);
++   This file is part of GDB.
 +
-+  return frame_obj;
-+}
++   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.
 +
-+/* Implementation of gdb.Frame.older (self) -> gdb.Frame.
-+   Returns the frame immediately older (outer) to this frame, or None if
-+   there isn't one.  */
++   You should have received a copy of the GNU General Public License
++   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 +
-+static PyObject *
-+frapy_older (PyObject *self, PyObject *args)
++#include "defs.h"
++#include "exceptions.h"
++#include "gdbcore.h"
++#include "gdbthread.h"
++#include "inferior.h"
++#include "observer.h"
++#include "python-internal.h"
++#include "arch-utils.h"
++#include "language.h"
++
++struct threadlist_entry {
++  thread_object *thread_obj;
++  struct threadlist_entry *next;
++};
++
++typedef struct
 +{
-+  struct frame_info *frame, *prev;
-+  volatile struct gdb_exception except;
-+  PyObject *prev_obj = NULL;   /* Initialize to appease gcc warning.  */
++  PyObject_HEAD
 +
-+  TRY_CATCH (except, RETURN_MASK_ALL)
-+    {
-+      FRAPY_REQUIRE_VALID ((frame_object *) self, frame);
++  /* The inferior we represent.  */
++  struct inferior *inferior;
 +
-+      prev = get_prev_frame (frame);
-+      if (prev)
-+      prev_obj = (PyObject *) frame_info_to_frame_object (prev);
-+      else
-+      {
-+        Py_INCREF (Py_None);
-+        prev_obj = Py_None;
-+      }
-+    }
-+  GDB_PY_HANDLE_EXCEPTION (except);
++  /* thread_object instances under this inferior.  This list owns a reference
++     to each object it contains. */
++  struct threadlist_entry *threads;
 +
-+  return prev_obj;
-+}
++  /* Number of threads in the list.  */
++  int nthreads;
++} inferior_object;
 +
-+/* Implementation of gdb.Frame.newer (self) -> gdb.Frame.
-+   Returns the frame immediately newer (inner) to this frame, or None if
-+   there isn't one.  */
++static PyTypeObject inferior_object_type;
 +
-+static PyObject *
-+frapy_newer (PyObject *self, PyObject *args)
-+{
-+  struct frame_info *frame, *next;
-+  volatile struct gdb_exception except;
-+  PyObject *next_obj = NULL;   /* Initialize to appease gcc warning.  */
++typedef struct {
++  PyObject_HEAD
++  void *buffer;
 +
-+  TRY_CATCH (except, RETURN_MASK_ALL)
-+    {
-+      FRAPY_REQUIRE_VALID ((frame_object *) self, frame);
++  /* These are kept just for mbpy_str.  */
++  CORE_ADDR addr;
++  CORE_ADDR length;
++} membuf_object;
 +
-+      next = get_next_frame (frame);
-+      if (next)
-+      next_obj = (PyObject *) frame_info_to_frame_object (next);
-+      else
-+      {
-+        Py_INCREF (Py_None);
-+        next_obj = Py_None;
-+      }
-+    }
-+  GDB_PY_HANDLE_EXCEPTION (except);
++static PyTypeObject membuf_object_type;
 +
-+  return next_obj;
-+}
++/* Require that INFERIOR be a valid inferior ID.  */
++#define INFPY_REQUIRE_VALID(Inferior)                         \
++  do {                                                                \
++    if (!Inferior->inferior)                                  \
++      {                                                               \
++      PyErr_SetString (PyExc_RuntimeError,                    \
++                       "inferior no longer exists");          \
++      return NULL;                                            \
++      }                                                               \
++  } while (0)
 +
-+/* Implementation of gdb.Frame.find_sal (self) -> gdb.Symtab_and_line.
-+   Returns the frame's symtab and line.  */
++struct inflist_entry {
++  inferior_object *inf_obj;
++  struct inflist_entry *next;
++};
 +
-+static PyObject *
-+frapy_find_sal (PyObject *self, PyObject *args)
++\f
++
++/* Inferior objects list.  */
++
++/* List containing inferior_objects.  This list owns a reference to each
++   object it contains.  */
++static struct inflist_entry *inferior_list;
++
++static int ninferiors;
++
++
++/* An observer callback function that is called when an inferior has
++   been created.  Creates a corresponding Python object for the inferior
++   and adds it to the list.  */
++static void
++add_inferior_object (int pid)
 +{
-+  struct frame_info *frame;
-+  struct symtab_and_line sal;
-+  volatile struct gdb_exception except;
-+  PyObject *sal_obj = NULL;   /* Initialize to appease gcc warning.  */
++  struct inferior *inf = find_inferior_pid (pid);
++  inferior_object *inf_obj;
++  struct inflist_entry *entry;
++  struct cleanup *cleanup;
 +
-+  TRY_CATCH (except, RETURN_MASK_ALL)
++  if (!inf)
 +    {
-+      FRAPY_REQUIRE_VALID ((frame_object *) self, frame);
++      warning (_("Can't create Python Inferior object."));
++      return;
++    }
 +
-+      find_frame_sal (frame, &sal);
-+      sal_obj = symtab_and_line_to_sal_object (sal);
++  cleanup = ensure_python_env (get_current_arch (), current_language);
++
++  inf_obj = PyObject_New (inferior_object, &inferior_object_type);
++  if (!inf_obj)
++    {
++      warning (_("Can't create Python Inferior object."));
++      gdbpy_print_stack ();
++      do_cleanups (cleanup);
++      return;
 +    }
-+  GDB_PY_HANDLE_EXCEPTION (except);
 +
-+  return sal_obj;
-+}
++  inf_obj->inferior = inf;
++  inf_obj->threads = NULL;
++  inf_obj->nthreads = 0;
 +
-+/* Implementation of gdb.Frame.read_var (self, variable) -> gdb.Value.
-+   Returns the value of the given variable in this frame.  The argument can be
-+   either a gdb.Symbol or a string.  Returns None if GDB can't find the
-+   specified variable.  */
++  entry = xmalloc (sizeof (struct inflist_entry));
++  entry->inf_obj = inf_obj;
++  entry->next = inferior_list;
 +
-+static PyObject *
-+frapy_read_var (PyObject *self, PyObject *args)
-+{
-+  struct frame_info *frame;
-+  PyObject *sym_obj;
-+  struct symbol *var = NULL;  /* gcc-4.3.2 false warning.  */
-+  struct value *val = NULL;
-+  volatile struct gdb_exception except;
++  inferior_list = entry;
 +
-+  if (!PyArg_ParseTuple (args, "O", &sym_obj))
-+    return NULL;
++  ninferiors++;
 +
-+  if (PyObject_TypeCheck (sym_obj, &symbol_object_type))
-+    var = symbol_object_to_symbol (sym_obj);
-+  else if (gdbpy_is_string (sym_obj))
-+    {
-+      char *var_name;
-+      struct block *block = NULL;
-+      struct cleanup *cleanup;
-+      volatile struct gdb_exception except;
++  do_cleanups (cleanup);
++}
 +
-+      var_name = python_string_to_target_string (sym_obj);
-+      if (!var_name)
-+              return NULL;
-+      cleanup = make_cleanup (xfree, var_name);
++/* An observer callback function that is called when an inferior has
++   been deleted.  Removes the corresponding Python object from the
++   inferior list, and removes the list's reference to the object.  */
++static void
++delete_inferior_object (int pid)
++{
++  PyGILState_STATE state;
++  struct inflist_entry **inf_entry, *inf_tmp;
++  struct threadlist_entry *th_entry, *th_tmp;
 +
-+      TRY_CATCH (except, RETURN_MASK_ALL)
-+      {
-+        FRAPY_REQUIRE_VALID ((frame_object *) self, frame);
++  /* Find inferior_object for the given PID.  */
++  for (inf_entry = &inferior_list; *inf_entry != NULL;
++       inf_entry = &(*inf_entry)->next)
++    if ((*inf_entry)->inf_obj->inferior->pid == pid)
++      break;
 +
-+        block = block_for_pc (get_frame_address_in_block (frame));
-+        var = lookup_symbol (var_name, block, VAR_DOMAIN, NULL);
-+      }
-+      GDB_PY_HANDLE_EXCEPTION (except);
++  if (!*inf_entry)
++    return;
 +
-+      if (!var)
-+      {
-+        PyErr_Format (PyExc_ValueError,
-+                      _("variable '%s' not found"), var_name);
-+        do_cleanups (cleanup);
++  state = PyGILState_Ensure ();
 +
-+        return NULL;
-+      }
++  inf_tmp = *inf_entry;
++  inf_tmp->inf_obj->inferior = NULL;
 +
-+      do_cleanups (cleanup);
-+    }
-+  else
++  /* Deallocate threads list.  */
++  for (th_entry = inf_tmp->inf_obj->threads; th_entry != NULL;)
 +    {
-+      PyErr_SetString (PyExc_TypeError,
-+                     _("argument must be a symbol or string"));
-+      return NULL;
++      Py_DECREF (th_entry->thread_obj);
++
++      th_tmp = th_entry;
++      th_entry = th_entry->next;
++      xfree (th_tmp);
 +    }
 +
-+  TRY_CATCH (except, RETURN_MASK_ALL)
-+    {
-+      FRAPY_REQUIRE_VALID ((frame_object *) self, frame);
++  inf_tmp->inf_obj->nthreads = 0;
 +
-+      val = read_var_value (var, frame);
-+    }
-+  GDB_PY_HANDLE_EXCEPTION (except);
++  *inf_entry = (*inf_entry)->next;
++  Py_DECREF (inf_tmp->inf_obj);
++  xfree (inf_tmp);
 +
-+  if (val)
-+    return value_to_value_object (val);
++  ninferiors--;
 +
-+  Py_RETURN_NONE;
++  PyGILState_Release (state);
 +}
 +
-+/* Implementation of gdb.frames () -> (gdb.Frame, ...).
-+   Returns a tuple of all frame objects.  */
-+
++/* Finds the Python Inferior object for the given pid.  Returns a borrowed
++   reference.  */
 +PyObject *
-+gdbpy_frames (PyObject *self, PyObject *args)
++find_inferior_object (int pid)
 +{
-+  int result = 0;
-+  struct frame_info *frame;
-+  frame_object *frame_obj;
-+  PyObject *list, *tuple;
-+  volatile struct gdb_exception except;
++  struct inflist_entry *p;
 +
-+  list = PyList_New (0);
-+  if (list == NULL)
-+    {
-+      PyErr_SetString (PyExc_MemoryError, "Could not allocate frames list.");
-+      return NULL;
-+    }
++  for (p = inferior_list; p != NULL; p = p->next)
++    if (p->inf_obj->inferior->pid == pid)
++      return (PyObject *) p->inf_obj;
 +
-+  TRY_CATCH (except, RETURN_MASK_ALL)
-+    {
-+      for (frame = get_current_frame (); frame; frame = get_prev_frame (frame))
-+      {
-+        frame_obj = frame_info_to_frame_object (frame);
-+        if (frame_obj == NULL)
-+          {
-+            Py_DECREF (list);
-+            list = NULL;
-+            break;
-+          }
++  return NULL;
++}
 +
-+        PyList_Append (list, (PyObject *) frame_obj);
-+      }
-+    }
-+  if (except.reason < 0)
-+    {
-+      Py_DECREF (list);
-+      return PyErr_Format (except.reason == RETURN_QUIT
-+                         ? PyExc_KeyboardInterrupt : PyExc_RuntimeError,
-+                         "%s", except.message);
-+    }
++/* Finds the Python InferiorThread object for the given ptid.  Returns a
++   borrowed reference.  */
++thread_object *
++find_thread_object (ptid_t ptid)
++{
++  int pid;
++  struct inflist_entry *p;
++  struct threadlist_entry *q;
 +
-+  if (list)
-+    {
-+      tuple = PyList_AsTuple (list);
-+      Py_DECREF (list);
-+    }
-+  else
-+    tuple = NULL;
++  pid = PIDGET (ptid);
++  for (p = inferior_list; p != NULL; p = p->next)
++    if (p->inf_obj->inferior->pid == pid)
++      for (q = p->inf_obj->threads; q != NULL; q = q->next)
++      if (ptid_equal (q->thread_obj->thread->ptid, ptid))
++        return q->thread_obj;
 +
-+  return tuple;
++  return NULL;
 +}
 +
-+/* Implementation of gdb.newest_frame () -> gdb.Frame.
-+   Returns the newest frame object.  */
++\f
 +
-+PyObject *
-+gdbpy_newest_frame (PyObject *self, PyObject *args)
++/* Inferior object.  */
++
++static void
++add_thread_object (struct thread_info *tp)
 +{
-+  struct frame_info *frame;
-+  frame_object *frame_obj = NULL;   /* Initialize to appease gcc warning.  */
-+  volatile struct gdb_exception except;
++  PyGILState_STATE state;
++  thread_object *thread_obj;
++  inferior_object *inf_obj;
++  struct threadlist_entry *entry;
 +
-+  TRY_CATCH (except, RETURN_MASK_ALL)
++  state = PyGILState_Ensure ();
++
++  thread_obj = create_thread_object (tp);
++  if (!thread_obj)
 +    {
-+      frame = get_current_frame ();
-+      frame_obj = frame_info_to_frame_object (frame);
++      warning (_("Can't create Python InferiorThread object."));
++      gdbpy_print_stack ();
++      PyGILState_Release (state);
++      return;
 +    }
-+  GDB_PY_HANDLE_EXCEPTION (except);
 +
-+  return (PyObject *) frame_obj;
-+}
++  inf_obj = (inferior_object *) thread_obj->inf_obj;
 +
-+/* Implementation of gdb.selected_frame () -> gdb.Frame.
-+   Returns the selected frame object.  */
++  entry = xmalloc (sizeof (struct threadlist_entry));
++  entry->thread_obj = thread_obj;
++  entry->next = inf_obj->threads;
 +
-+PyObject *
-+gdbpy_selected_frame (PyObject *self, PyObject *args)
++  inf_obj->threads = entry;
++  inf_obj->nthreads++;
++
++  PyGILState_Release (state);
++}
++
++static void
++delete_thread_object (struct thread_info *tp, int ignore)
 +{
-+  struct frame_info *frame;
-+  frame_object *frame_obj = NULL;   /* Initialize to appease gcc warning.  */
-+  volatile struct gdb_exception except;
++  PyGILState_STATE state;
++  inferior_object *inf_obj;
++  thread_object *thread_obj;
++  struct threadlist_entry **entry, *tmp;
 +
-+  TRY_CATCH (except, RETURN_MASK_ALL)
-+    {
-+      frame = get_selected_frame ("No frame is currently selected.");
-+      frame_obj = frame_info_to_frame_object (frame);
-+    }
-+  GDB_PY_HANDLE_EXCEPTION (except);
++  inf_obj = (inferior_object *) find_inferior_object (PIDGET(tp->ptid));
++  if (!inf_obj)
++    return;
 +
-+  return (PyObject *) frame_obj;
-+}
++  /* Find thread entry in its inferior's thread_list.  */
++  for (entry = &inf_obj->threads; *entry != NULL; entry = &(*entry)->next)
++    if ((*entry)->thread_obj->thread == tp)
++      break;
++
++  if (!*entry)
++    return;
++
++  state = PyGILState_Ensure ();
 +
-+/* Implementation of gdb.stop_reason_string (Integer) -> String.
-+   Return a string explaining the unwind stop reason.  */
++  tmp = *entry;
++  tmp->thread_obj->thread = NULL;
 +
-+PyObject *
-+gdbpy_frame_stop_reason_string (PyObject *self, PyObject *args)
++  *entry = (*entry)->next;
++  inf_obj->nthreads--;
++
++  Py_DECREF (tmp->thread_obj);
++  xfree (tmp);
++
++
++  PyGILState_Release (state);
++}
++
++static PyObject *
++infpy_threads (PyObject *self, PyObject *args)
 +{
-+  int reason;
-+  const char *str;
++  int i;
++  struct threadlist_entry *entry;
++  inferior_object *inf_obj = (inferior_object *) self;
++  PyObject *tuple;
++
++  INFPY_REQUIRE_VALID (inf_obj);
 +
-+  if (!PyArg_ParseTuple (args, "i", &reason))
++
++  tuple = PyTuple_New (inf_obj->nthreads);
++  if (!tuple)
 +    return NULL;
 +
-+  if (reason < 0 || reason > UNWIND_NO_SAVED_PC)
++  /* The list is in reverse order of thread age (i.e., newest comes first),
++     is this a problem?  */
++  for (i = 0, entry = inf_obj->threads; i < inf_obj->nthreads;
++       i++, entry = entry->next)
 +    {
-+      PyErr_SetString (PyExc_ValueError, "Invalid frame stop reason.");
-+      return NULL;
++      Py_INCREF (entry->thread_obj);
++      PyTuple_SET_ITEM (tuple, i, (PyObject *) entry->thread_obj);
 +    }
 +
-+  str = frame_stop_reason_string (reason);
-+  return PyUnicode_Decode (str, strlen (str), host_charset (), NULL);
++  return tuple;
 +}
 +
-+/* Sets up the Frame API in the gdb module.  */
++static PyObject *
++infpy_get_num (PyObject *self, void *closure)
++{
++  inferior_object *inf = (inferior_object *) self;
 +
-+void
-+gdbpy_initialize_frames (void)
++  INFPY_REQUIRE_VALID (inf);
++
++  return PyLong_FromLong (inf->inferior->num);
++}
++
++static PyObject *
++infpy_get_pid (PyObject *self, void *closure)
 +{
-+  frame_object_type.tp_new = PyType_GenericNew;
-+  if (PyType_Ready (&frame_object_type) < 0)
-+    return;
++  inferior_object *inf = (inferior_object *) self;
 +
-+  /* Note: These would probably be best exposed as class attributes of Frame,
-+     but I don't know how to do it except by messing with the type's dictionary.
-+     That seems too messy.  */
-+  PyModule_AddIntConstant (gdb_module, "NORMAL_FRAME", NORMAL_FRAME);
-+  PyModule_AddIntConstant (gdb_module, "DUMMY_FRAME", DUMMY_FRAME);
-+  PyModule_AddIntConstant (gdb_module, "SIGTRAMP_FRAME", SIGTRAMP_FRAME);
-+  PyModule_AddIntConstant (gdb_module, "SENTINEL_FRAME", SENTINEL_FRAME);
-+  PyModule_AddIntConstant (gdb_module,
-+                         "FRAME_UNWIND_NO_REASON", UNWIND_NO_REASON);
-+  PyModule_AddIntConstant (gdb_module,
-+                         "FRAME_UNWIND_NULL_ID", UNWIND_NULL_ID);
-+  PyModule_AddIntConstant (gdb_module,
-+                         "FRAME_UNWIND_FIRST_ERROR", UNWIND_FIRST_ERROR);
-+  PyModule_AddIntConstant (gdb_module,
-+                         "FRAME_UNWIND_INNER_ID", UNWIND_INNER_ID);
-+  PyModule_AddIntConstant (gdb_module,
-+                         "FRAME_UNWIND_SAME_ID", UNWIND_SAME_ID);
-+  PyModule_AddIntConstant (gdb_module,
-+                         "FRAME_UNWIND_NO_SAVED_PC", UNWIND_NO_SAVED_PC);
-+
-+  Py_INCREF (&frame_object_type);
-+  PyModule_AddObject (gdb_module, "Frame", (PyObject *) &frame_object_type);
++  INFPY_REQUIRE_VALID (inf);
++
++  return PyLong_FromLong (inf->inferior->pid);
++}
++
++static PyObject *
++infpy_get_was_attached (PyObject *self, void *closure)
++{
++  inferior_object *inf = (inferior_object *) self;
++  INFPY_REQUIRE_VALID (inf);
++  if (inf->inferior->attach_flag)
++    Py_RETURN_TRUE;
++  Py_RETURN_FALSE;
 +}
 +
 +\f
 +
-+static PyMethodDef frame_object_methods[] = {
-+  { "equals", frapy_equal_p, METH_VARARGS,
-+    "equals (frame) -> Boolean.\n\
-+Compare this frame to the given frame." },
-+  { "is_valid", frapy_is_valid, METH_NOARGS,
-+    "is_valid () -> Boolean.\n\
-+Return true if this frame is valid, false if not." },
-+  { "name", frapy_name, METH_NOARGS,
-+    "name () -> String.\n\
-+Return the function name of the frame, or None if it can't be determined." },
-+  { "type", frapy_type, METH_NOARGS,
-+    "type () -> Integer.\n\
-+Return the type of the frame." },
-+  { "unwind_stop_reason", frapy_unwind_stop_reason, METH_NOARGS,
-+    "unwind_stop_reason () -> Integer.\n\
-+Return the reason why it's not possible to find frames older than this." },
-+  { "pc", frapy_pc, METH_NOARGS,
-+    "pc () -> Long.\n\
-+Return the frame's resume address." },
-+  { "block", frapy_block, METH_NOARGS,
-+    "block () -> gdb.Block.\n\
-+Return the frame's code block." },
-+  { "addr_in_block", frapy_addr_in_block, METH_NOARGS,
-+    "addr_in_block () -> Long.\n\
-+Return an address which falls within the frame's code block." },
-+  { "older", frapy_older, METH_NOARGS,
-+    "older () -> gdb.Frame.\n\
-+Return the frame immediately older (outer) to this frame." },
-+  { "newer", frapy_newer, METH_NOARGS,
-+    "newer () -> gdb.Frame.\n\
-+Return the frame immetidaely newer (inner) to this frame." },
-+  { "find_sal", frapy_find_sal, METH_NOARGS,
-+    "find_sal () -> gdb.Symtab_and_line.\n\
-+Return the frame's symtab and line." },
-+  { "read_var", frapy_read_var, METH_VARARGS,
-+    "read_var (variable) -> gdb.Value.\n\
-+Return the value of the variable in this frame." },
-+  {NULL}  /* Sentinel */
-+};
++/* Implementation of gdb.inferiors () -> (gdb.Inferior, ...).
++   Returns a list of all inferiors.  */
 +
-+static PyTypeObject frame_object_type = {
-+  PyObject_HEAD_INIT (NULL)
-+  0,                            /* ob_size */
-+  "gdb.Frame",                          /* tp_name */
-+  sizeof (frame_object),        /* tp_basicsize */
-+  0,                            /* tp_itemsize */
-+  0,                            /* tp_dealloc */
-+  0,                            /* tp_print */
-+  0,                            /* tp_getattr */
-+  0,                            /* tp_setattr */
-+  0,                            /* tp_compare */
-+  0,                            /* tp_repr */
-+  0,                            /* tp_as_number */
-+  0,                            /* tp_as_sequence */
-+  0,                            /* tp_as_mapping */
-+  0,                            /* tp_hash  */
-+  0,                            /* tp_call */
-+  frapy_str,                    /* tp_str */
-+  0,                            /* tp_getattro */
-+  0,                            /* tp_setattro */
-+  0,                            /* tp_as_buffer */
-+  Py_TPFLAGS_DEFAULT,           /* tp_flags */
-+  "GDB frame object",           /* tp_doc */
-+  0,                            /* tp_traverse */
-+  0,                            /* tp_clear */
-+  0,                            /* tp_richcompare */
-+  0,                            /* tp_weaklistoffset */
-+  0,                            /* tp_iter */
-+  0,                            /* tp_iternext */
-+  frame_object_methods                  /* tp_methods */
-+};
-diff --git a/gdb/python/python-function.c b/gdb/python/python-function.c
-new file mode 100644
-index 0000000..4a85a33
---- /dev/null
-+++ b/gdb/python/python-function.c
-@@ -0,0 +1,180 @@
-+/* Convenience functions implemented in Python.
++PyObject *
++gdbpy_inferiors (PyObject *unused, PyObject *unused2)
++{
++  int i;
++  struct inflist_entry *entry;
++  PyObject *tuple;
 +
-+   Copyright (C) 2008, 2009 Free Software Foundation, Inc.
++  tuple = PyTuple_New (ninferiors);
++  if (!tuple)
++    return NULL;
 +
-+   This file is part of GDB.
++  /* The list is in reverse order of inferior age (i.e., newest comes first),
++     is this a problem?  */
++  for (i = 0, entry = inferior_list; i < ninferiors; i++, entry = entry->next)
++    {
++      Py_INCREF (entry->inf_obj);
++      PyTuple_SET_ITEM (tuple, i, (PyObject *) entry->inf_obj);
++    }
 +
-+   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.
++  return tuple;
++}
 +
-+   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.
++\f
 +
-+   You should have received a copy of the GNU General Public License
-+   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
++/* Membuf and memory manipulation.  */
 +
++/* Implementation of gdb.read_memory (address, length).
++   Returns a Python buffer object with LENGTH bytes of the inferior's memory
++   at ADDRESS. Both arguments are integers.  */
 +
-+#include "defs.h"
-+#include "value.h"
-+#include "exceptions.h"
-+#include "python-internal.h"
-+#include "charset.h"
-+#include "gdbcmd.h"
-+#include "cli/cli-decode.h"
-+#include "completer.h"
-+#include "expression.h"
++static PyObject *
++infpy_read_memory (PyObject *self, PyObject *args)
++{
++  int error = 0;
++  CORE_ADDR addr, length;
++  void *buffer = NULL;
++  membuf_object *membuf_obj;
++  PyObject *addr_obj, *length_obj;
++  struct cleanup *cleanups;
++  volatile struct gdb_exception except;
 +
-+static PyTypeObject fnpy_object_type;
++  if (! PyArg_ParseTuple (args, "OO", &addr_obj, &length_obj))
++    return NULL;
 +
-+\f
++  cleanups = make_cleanup (null_cleanup, NULL);
 +
-+static PyObject *
-+convert_values_to_python (int argc, struct value **argv)
-+{
-+  int i;
-+  PyObject *result = PyTuple_New (argc);
-+  for (i = 0; i < argc; ++i)
++  TRY_CATCH (except, RETURN_MASK_ALL)
 +    {
-+      PyObject *elt = value_to_value_object (argv[i]);
-+      if (! elt)
++      if (!get_addr_from_python (addr_obj, &addr)
++        || !get_addr_from_python (length_obj, &length))
 +      {
-+        Py_DECREF (result);
-+        error (_("Could not convert value to Python object."));
++        error = 1;
++        break;
 +      }
-+      PyTuple_SetItem (result, i, elt);
-+    }
-+  return result;
-+}
-+
-+/* Call a Python function object's invoke method.  */
-+
-+static struct value *
-+fnpy_call (void *cookie, int argc, struct value **argv)
-+{
-+  int i;
-+  struct value *value = NULL;
-+  PyObject *result, *callable, *args;
-+  struct cleanup *cleanup;
-+  PyGILState_STATE state;
-+
-+  state = PyGILState_Ensure ();
-+  cleanup = make_cleanup_py_restore_gil (&state);
 +
-+  args = convert_values_to_python (argc, argv);
++      buffer = xmalloc (length);
++      make_cleanup (xfree, buffer);
 +
-+  callable = PyObject_GetAttrString ((PyObject *) cookie, "invoke");
-+  if (! callable)
-+    {
-+      Py_DECREF (args);
-+      error (_("No method named 'invoke' in object."));
++      read_memory (addr, buffer, length);
 +    }
++  GDB_PY_HANDLE_EXCEPTION (except);
 +
-+  result = PyObject_Call (callable, args, NULL);
-+  Py_DECREF (callable);
-+  Py_DECREF (args);
-+
-+  if (!result)
++  if (error)
 +    {
-+      gdbpy_print_stack ();
-+      error (_("Error while executing Python code."));
++      do_cleanups (cleanups);
++      return NULL;
 +    }
 +
-+  value = convert_value_from_python (result);
-+  if (value == NULL)
++  membuf_obj = PyObject_New (membuf_object, &membuf_object_type);
++  if (membuf_obj == NULL)
 +    {
-+      Py_DECREF (result);
-+      gdbpy_print_stack ();
-+      error (_("Error while executing Python code."));
++      PyErr_SetString (PyExc_MemoryError,
++                     "Could not allocate memory buffer object.");
++      do_cleanups (cleanups);
++      return NULL;
 +    }
 +
-+  Py_DECREF (result);
-+  do_cleanups (cleanup);
++  discard_cleanups (cleanups);
++
++  membuf_obj->buffer = buffer;
++  membuf_obj->addr = addr;
++  membuf_obj->length = length;
 +
-+  return value;
++  return PyBuffer_FromReadWriteObject ((PyObject *) membuf_obj, 0,
++                                     Py_END_OF_BUFFER);
 +}
 +
-+/* Initializer for a Function object.  It takes one argument, the name
-+   of the function.  */
++/* Implementation of gdb.write_memory (address, buffer [, length]).
++   Writes the contents of BUFFER (a Python object supporting the read buffer
++   protocol) at ADDRESS in the inferior's memory.  Write LENGTH bytes from
++   BUFFER, or its entire contents if the argument is not provided.  The
++   function returns nothing.  */
 +
-+static int
-+fnpy_init (PyObject *self, PyObject *args, PyObject *kwds)
++static PyObject *
++infpy_write_memory (PyObject *self, PyObject *args)
 +{
-+  char *name, *docstring = NULL;
-+  if (! PyArg_ParseTuple (args, "s", &name))
-+    return -1;
-+  Py_INCREF (self);
++  int buf_len, error = 0;
++  const char *buffer;
++  CORE_ADDR addr, length;
++  PyObject *addr_obj, *length_obj = NULL;
++  volatile struct gdb_exception except;
 +
-+  if (PyObject_HasAttrString (self, "__doc__"))
++  if (! PyArg_ParseTuple (args, "Os#|O", &addr_obj, &buffer, &buf_len,
++                        &length_obj))
++    return NULL;
++
++  TRY_CATCH (except, RETURN_MASK_ALL)
 +    {
-+      PyObject *ds_obj = PyObject_GetAttrString (self, "__doc__");
-+      if (ds_obj && gdbpy_is_string (ds_obj))
-+      /* Nothing ever frees this.  */
-+      docstring = python_string_to_host_string (ds_obj);
++      if (!get_addr_from_python (addr_obj, &addr))
++      {
++        error = 1;
++        break;
++      }
++      
++      if (!length_obj)
++      length = buf_len;
++      else if (!get_addr_from_python (length_obj, &length))
++      {
++        error = 1;
++        break;
++      }
++
++      write_memory (addr, buffer, length);
 +    }
-+  if (! docstring)
-+    docstring = _("This function is not documented.");
++  GDB_PY_HANDLE_EXCEPTION (except);
 +
-+  add_internal_function (name, docstring, fnpy_call, self);
-+  return 0;
++  if (error)
++    return NULL;
++
++  Py_RETURN_NONE;
 +}
 +
-+/* Initialize internal function support.  */
++/* Destructor of Membuf objects.  */
 +
-+void
-+gdbpy_initialize_functions (void)
++static void
++mbpy_dealloc (PyObject *self)
 +{
-+  if (PyType_Ready (&fnpy_object_type) < 0)
-+    return;
-+
-+  Py_INCREF (&fnpy_object_type);
-+  PyModule_AddObject (gdb_module, "Function", (PyObject *) &fnpy_object_type);
++  xfree (((membuf_object *) self)->buffer);
++  self->ob_type->tp_free (self);
 +}
 +
-+\f
++/* Return a description of the Membuf object.  */
 +
-+static PyTypeObject fnpy_object_type =
++static PyObject *
++mbpy_str (PyObject *self)
 +{
-+  PyObject_HEAD_INIT (NULL)
-+  0,                            /*ob_size*/
-+  "gdb.Function",               /*tp_name*/
-+  sizeof (PyObject),            /*tp_basicsize*/
-+  0,                            /*tp_itemsize*/
-+  0,                            /*tp_dealloc*/
-+  0,                            /*tp_print*/
-+  0,                            /*tp_getattr*/
-+  0,                            /*tp_setattr*/
-+  0,                            /*tp_compare*/
-+  0,                            /*tp_repr*/
-+  0,                            /*tp_as_number*/
-+  0,                            /*tp_as_sequence*/
-+  0,                            /*tp_as_mapping*/
-+  0,                            /*tp_hash */
-+  0,                            /*tp_call*/
-+  0,                            /*tp_str*/
-+  0,                            /*tp_getattro*/
-+  0,                            /*tp_setattro*/
-+  0,                            /*tp_as_buffer*/
-+  Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /*tp_flags*/
-+  "GDB function object",        /* tp_doc */
-+  0,                            /* tp_traverse */
-+  0,                            /* tp_clear */
-+  0,                            /* tp_richcompare */
-+  0,                            /* tp_weaklistoffset */
-+  0,                            /* tp_iter */
-+  0,                            /* tp_iternext */
-+  0,                            /* tp_methods */
-+  0,                            /* tp_members */
-+  0,                            /* tp_getset */
-+  0,                            /* tp_base */
-+  0,                            /* tp_dict */
-+  0,                            /* tp_descr_get */
-+  0,                            /* tp_descr_set */
-+  0,                            /* tp_dictoffset */
-+  fnpy_init,                    /* tp_init */
-+  0,                            /* tp_alloc */
-+  PyType_GenericNew             /* tp_new */
-+};
-diff --git a/gdb/python/python-hooks.c b/gdb/python/python-hooks.c
-new file mode 100644
-index 0000000..a3140bc
---- /dev/null
-+++ b/gdb/python/python-hooks.c
-@@ -0,0 +1,50 @@
-+/* Notifications from gdb to Python
++  membuf_object *membuf_obj = (membuf_object *) self;
 +
-+   Copyright (C) 2008 Free Software Foundation, Inc.
++  return PyString_FromFormat ("memory buffer for address %s, %s bytes long",
++                            paddress (python_gdbarch, membuf_obj->addr),
++                            pulongest (membuf_obj->length));
++}
 +
-+   This file is part of GDB.
++static Py_ssize_t
++get_read_buffer (PyObject *self, Py_ssize_t segment, void **ptrptr)
++{
++  membuf_object *membuf_obj = (membuf_object *) self;
 +
-+   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.
++  if (segment)
++    {
++      PyErr_SetString (PyExc_SystemError,
++                     "The memory buffer supports only one segment.");
++      return -1;
++    }
 +
-+   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.
++  *ptrptr = membuf_obj->buffer;
 +
-+   You should have received a copy of the GNU General Public License
-+   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
++  return membuf_obj->length;
++}
 +
-+#include "defs.h"
-+#include "cli/cli-decode.h"
-+#include "charset.h"
-+#include "python.h"
-+#include "python-internal.h"
-+#include "observer.h"
++static Py_ssize_t
++get_write_buffer (PyObject *self, Py_ssize_t segment, void **ptrptr)
++{
++  return get_read_buffer (self, segment, ptrptr);
++}
 +
-+PyObject *
-+gdbpy_get_hook_function (const char *name)
++static Py_ssize_t
++get_seg_count (PyObject *self, Py_ssize_t *lenp)
 +{
-+  PyObject *hooks;
-+  PyObject *result;
++  if (lenp)
++    *lenp = ((membuf_object *) self)->length;
 +
-+  if (! PyObject_HasAttrString (gdb_module, "hooks"))
-+    return NULL;
-+  hooks = PyObject_GetAttrString (gdb_module, "hooks");
-+  if (! hooks)
-+    return NULL;
-+  /* The cast is because the Python function doesn't declare const argument.
-+     This is a problem in Python version 2.4, but not in 2.5.  */
-+  if (! PyObject_HasAttrString (hooks, (char *) name))
-+    {
-+      Py_DECREF (hooks);
-+      return NULL;
-+    }
-+  /* The cast is because the Python function doesn't declare const argument.
-+     This is a problem in Python version 2.4, but not in 2.5.  */
-+  result = PyObject_GetAttrString (hooks, (char *) name);
-+  Py_DECREF (hooks);
-+  return result;
++  return 1;
 +}
-diff --git a/gdb/python/python-internal.h b/gdb/python/python-internal.h
-index 02dbfc4..4aae0aa 100644
---- a/gdb/python/python-internal.h
-+++ b/gdb/python/python-internal.h
-@@ -33,6 +33,7 @@
- #if HAVE_LIBPYTHON2_4
- #include "python2.4/Python.h"
-+#include "python2.4/frameobject.h"
- /* Py_ssize_t is not defined until 2.5.
-    Logical type for Py_ssize_t is Py_intptr_t, but that fails in 64-bit
-    compilation due to several apparent mistakes in python2.4 API, so we
-@@ -40,8 +41,10 @@
- typedef int Py_ssize_t;
- #elif HAVE_LIBPYTHON2_5
- #include "python2.5/Python.h"
-+#include "python2.5/frameobject.h"
- #elif HAVE_LIBPYTHON2_6
- #include "python2.6/Python.h"
-+#include "python2.6/frameobject.h"
- #else
- #error "Unable to find usable Python.h"
- #endif
-@@ -58,23 +61,69 @@ typedef int Py_ssize_t;
- #define PyEval_ReleaseLock() 0
- #endif
-+#include "command.h"
 +
-+struct block;
-+struct symbol;
-+struct symtab_and_line;
- struct value;
- extern PyObject *gdb_module;
-+extern PyTypeObject block_object_type;
- extern PyTypeObject value_object_type;
-+extern PyTypeObject symbol_object_type;
- PyObject *gdbpy_history (PyObject *self, PyObject *args);
--
-+PyObject *gdbpy_breakpoints (PyObject *, PyObject *);
-+PyObject *gdbpy_frames (PyObject *, PyObject *);
-+PyObject *gdbpy_newest_frame (PyObject *, PyObject *);
-+PyObject *gdbpy_frame_stop_reason_string (PyObject *, PyObject *);
-+PyObject *gdbpy_lookup_symbol (PyObject *self, PyObject *args, PyObject *kw);
-+PyObject *gdbpy_selected_frame (PyObject *self, PyObject *args);
-+PyObject *gdbpy_block_for_pc (PyObject *self, PyObject *args);
-+PyObject *gdbpy_read_memory (PyObject *self, PyObject *args);
-+PyObject *gdbpy_write_memory (PyObject *self, PyObject *args);
++static Py_ssize_t
++get_char_buffer (PyObject *self, Py_ssize_t segment, char **ptrptr)
++{
++  void *ptr = NULL;
++  Py_ssize_t ret;
 +
-+PyObject *symtab_and_line_to_sal_object (struct symtab_and_line sal);
-+PyObject *symtab_to_symtab_object (struct symtab *symtab);
-+PyObject *symbol_to_symbol_object (struct symbol *sym);
-+PyObject *block_to_block_object (struct block *block);
- PyObject *value_to_value_object (struct value *v);
-+PyObject *type_to_type_object (struct type *);
-+PyObject *objfile_to_objfile_object (struct objfile *);
-+PyObject *objfpy_get_printers (PyObject *, void *);
++  ret = get_read_buffer (self, segment, &ptr);
++  *ptrptr = (char *) ptr;
 +
-+struct block *block_object_to_block (PyObject *obj);
-+struct symbol *symbol_object_to_symbol (PyObject *obj);
-+struct value *value_object_to_value (PyObject *self);
- struct value *convert_value_from_python (PyObject *obj);
-+struct type *type_object_to_type (PyObject *obj);
++  return ret;
++}
 +
-+PyObject *gdbpy_get_hook_function (const char *);
- void gdbpy_initialize_values (void);
-+void gdbpy_initialize_breakpoints (void);
-+void gdbpy_initialize_frames (void);
-+void gdbpy_initialize_symtabs (void);
- void gdbpy_initialize_commands (void);
-+void gdbpy_initialize_symbols (void);
-+void gdbpy_initialize_types (void);
-+void gdbpy_initialize_blocks (void);
-+void gdbpy_initialize_functions (void);
-+void gdbpy_initialize_objfile (void);
-+void gdbpy_initialize_parameters (void);
-+void gdbpy_initialize_membuf (void);
- struct cleanup *make_cleanup_py_decref (PyObject *py);
- struct cleanup *make_cleanup_py_restore_gil (PyGILState_STATE *state);
-+char *gdbpy_parse_command_name (char *text,
-+                              struct cmd_list_element ***base_list,
-+                              struct cmd_list_element **start_list);
++/* Adds GDB value V to the pattern buffer in *PATTERN_BUF.  If SIZE is not zero,
++   it specifies the number of bytes from V to copy to *PATTERN_BUF.  The
++   function increases the size of *PATTERN_BUF as necessary, adjusting
++   *PATTERN_BUF_END and *PATTERN_BUF_SIZE in the process.  */
 +
-+PyObject *gdbpy_parameter_value (enum var_types, void *);
++static void
++add_value_pattern (struct value *v, int size, char **pattern_buf,
++                 char **pattern_buf_end, ULONGEST *pattern_buf_size)
++{
++  int val_bytes;
 +
- /* Use this after a TRY_EXCEPT to throw the appropriate Python
-    exception.  */
- #define GDB_PY_HANDLE_EXCEPTION(Exception)                            \
-@@ -85,6 +134,19 @@ struct cleanup *make_cleanup_py_restore_gil (PyGILState_STATE *state);
-                            "%s", Exception.message);                  \
-     } while (0)
-+/* Use this after a TRY_EXCEPT to throw the appropriate Python
-+   exception.  This macro is for use inside setter functions.  */
-+#define GDB_PY_SET_HANDLE_EXCEPTION(Exception)                                \
-+    do {                                                              \
-+      if (Exception.reason < 0)                                               \
-+        {                                                             \
-+        PyErr_Format (Exception.reason == RETURN_QUIT                 \
-+                      ? PyExc_KeyboardInterrupt : PyExc_RuntimeError, \
-+                      "%s", Exception.message);                       \
-+        return -1;                                                    \
-+      }                                                               \
-+    } while (0)
++  if (size)
++    {
++      LONGEST x = value_as_long (v);
 +
- void gdbpy_print_stack (void);
-@@ -95,6 +157,21 @@ char *python_string_to_host_string (PyObject *obj);
- PyObject *target_string_to_unicode (const gdb_byte *str, int length);
- int gdbpy_is_string (PyObject *obj);
-+int gdbpy_is_value_object (PyObject *obj);
++      if (size == 1)
++      *(*pattern_buf_end)++ = x;
++      else
++      {
++        put_bits (x, *pattern_buf_end, size * 8,
++                  gdbarch_byte_order (python_gdbarch) == BFD_ENDIAN_BIG);
++        *pattern_buf_end += size;
++      }
++    }
++  else
++   {
++     val_bytes = TYPE_LENGTH (value_type (v));
 +
-+/* Note that these are declared here, and not in python.h with the
-+   other pretty-printer functions, because they refer to PyObject.  */
-+char *apply_varobj_pretty_printer (PyObject *print_obj,
-+                                 struct value **replacement);
-+PyObject *gdbpy_get_varobj_pretty_printer (struct value *value);
-+PyObject *gdbpy_instantiate_printer (PyObject *cons, PyObject *value);
-+char *gdbpy_get_display_hint (PyObject *printer);
++     increase_pattern_buffer (pattern_buf, pattern_buf_end,
++                            pattern_buf_size, val_bytes);
 +
-+extern PyObject *gdbpy_children_cst;
-+extern PyObject *gdbpy_to_string_cst;
-+extern PyObject *gdbpy_display_hint_cst;
- extern PyObject *gdbpy_doc_cst;
-+int get_addr_from_python (PyObject *obj, CORE_ADDR *addr);
++     memcpy (*pattern_buf_end, value_contents_raw (v), val_bytes);
++     *pattern_buf_end += val_bytes;
++   }
++}
 +
- #endif /* GDB_PYTHON_INTERNAL_H */
-diff --git a/gdb/python/python-membuf.c b/gdb/python/python-membuf.c
-new file mode 100644
-index 0000000..a4c7d74
---- /dev/null
-+++ b/gdb/python/python-membuf.c
-@@ -0,0 +1,243 @@
-+/* Python interface to the inferior memory.
++/* This function does the actual work of constructing the pattern buffer from
++   OBJ.  If OBJ is an object which implements the read buffer protocol (such
++   as a string, a byte array or gdb.Membuf), then its contents are directly
++   copied to *PATTERN_BUF.  If it is a list, then this function is recursively
++   called for each of its elements.  If OBJ is an object which can be converted
++   to a GDB value, then the contents of the value are copied to PATTERN_BUF.
++   If SIZE is different than zero, then it limits the number of bytes which
++   are copied to the buffer in case OBJ is converted to a GDB value.  That
++   means that SIZE influences only Python scalars and gdb.Value objects.
++   The function increases the size of *PATTERN_BUF as necessary, adjusting
++   *PATTERN_BUF_END and *PATTERN_BUF_SIZE in the process.
 +
-+   Copyright (C) 2008, 2009 Free Software Foundation, Inc.
++   Returns 1 on success or 0 on failure, with a Python exception set.  This
++   function can also throw GDB exceptions.  */
 +
-+   This file is part of GDB.
++static int
++add_pattern_element (PyObject *obj, int size, char **pattern_buf,
++                   char **pattern_buf_end, ULONGEST *pattern_buf_size)
++{
++  if (PyObject_CheckReadBuffer (obj))
++    {
++      /* Handle string, Unicode string, byte array, gdb.Membuf and any other
++         object implementing the buffer protocol.  The SIZE parameter is
++       ignored in this case.  */
 +
-+   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.
++      Py_ssize_t val_bytes;
++      const void *buffer;
 +
-+   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.
++      if (PyObject_AsReadBuffer (obj, &buffer, &val_bytes) == -1)
++      return 0;
 +
-+   You should have received a copy of the GNU General Public License
-+   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
++      increase_pattern_buffer (pattern_buf, pattern_buf_end,
++                             pattern_buf_size, val_bytes);
 +
-+#include "defs.h"
-+#include "exceptions.h"
-+#include "gdbcore.h"
-+#include "python-internal.h"
++      memcpy (*pattern_buf_end, buffer, val_bytes);
++      *pattern_buf_end += val_bytes;
++    }
++  else if (gdbpy_is_value_object (obj))
++    add_value_pattern (value_object_to_value (obj), size, pattern_buf,
++                     pattern_buf_end, pattern_buf_size);
++  else if (PySequence_Check (obj))
++    {
++      /* Handle lists and tuples.  */
 +
-+typedef struct {
-+  PyObject_HEAD
-+  void *buffer;
++      Py_ssize_t i, num_objs;
 +
-+  /* These are kept just for mbpy_str.  */
-+  CORE_ADDR addr;
-+  CORE_ADDR length;
-+} membuf_object;
++      num_objs = PySequence_Size (obj);
++      for (i = 0; i < num_objs; i++)
++      if (!add_pattern_element (PySequence_GetItem (obj, i), size,
++                                pattern_buf, pattern_buf_end,
++                                pattern_buf_size))
++        return 0;
++    }
++  else
++    {
++      /* See if we can convert from a Python object to a GDB value.  */
 +
-+static PyTypeObject membuf_object_type;
++      struct value *v = convert_value_from_python (obj);
 +
-+/* Implementation of gdb.read_memory (address, length).
-+   Returns a Python buffer object with LENGTH bytes of the inferior's memory
-+   at ADDRESS. Both arguments are integers.  */
++      if (v)
++      add_value_pattern (v, size, pattern_buf, pattern_buf_end,
++                         pattern_buf_size);
++      else
++      return 0;
++    }
 +
-+PyObject *
-+gdbpy_read_memory (PyObject *self, PyObject *args)
-+{
-+  CORE_ADDR addr, length;
-+  void *buffer;
-+  membuf_object *membuf_obj;
-+  struct cleanup *cleanups;
-+  volatile struct gdb_exception except;
++  return 1;
++}
 +
-+  /* Assume CORE_ADDR corresponds to unsigned long.  */
-+  if (! PyArg_ParseTuple (args, "kk", &addr, &length))
-+    return NULL;
++/* Constructs the search pattern from OBJ, putting it in *PATTERN_BUFP, and its
++   size in *PATTERN_LENP.  See the function add_pattern_element to learn how
++   the search pattern is obtained from OBJ.
 +
-+  buffer = xmalloc (length);
-+  cleanups = make_cleanup (xfree, buffer);
++   Returns 1 on success or 0 on failure, with a Python exception set.  This
++   function can also throw GDB exceptions.  */
 +
-+  TRY_CATCH (except, RETURN_MASK_ALL)
-+    {
-+      read_memory (addr, buffer, length);
-+    }
-+  GDB_PY_HANDLE_EXCEPTION (except);
++static int
++get_search_pattern (PyObject *obj, int size, char **pattern_bufp,
++                  ULONGEST *pattern_lenp)
++{
++  /* Buffer to hold the search pattern.  */
++  char *pattern_buf;
++  /* Current size of search pattern buffer.
++     We realloc space as needed.  */
++  ULONGEST pattern_buf_size;
++  /* Pointer to one past the last in-use part of pattern_buf.  */
++  char *pattern_buf_end;
++  struct cleanup *old_cleanups;
 +
-+  discard_cleanups (cleanups);
++  allocate_pattern_buffer (&pattern_buf, &pattern_buf_end, &pattern_buf_size);
++  old_cleanups = make_cleanup (free_current_contents, &pattern_buf);
 +
-+  membuf_obj = PyObject_New (membuf_object, &membuf_object_type);
-+  if (membuf_obj == NULL)
++  if (!add_pattern_element (obj, size, &pattern_buf, &pattern_buf_end,
++                          &pattern_buf_size))
 +    {
-+      xfree (buffer);
-+      PyErr_SetString (PyExc_MemoryError,
-+                     "Could not allocate memory buffer object.");
-+      return NULL;
++      do_cleanups (old_cleanups);
++
++      return 0;
 +    }
 +
-+  membuf_obj->buffer = buffer;
++  *pattern_bufp = pattern_buf;
++  *pattern_lenp = pattern_buf_end - pattern_buf;
 +
-+  membuf_obj->addr = addr;
-+  membuf_obj->length = length;
++  discard_cleanups (old_cleanups);
 +
-+  return PyBuffer_FromReadWriteObject ((PyObject *) membuf_obj, 0, Py_END_OF_BUFFER);
++  return 1;
 +}
 +
-+/* Implementation of gdb.write_memory (address, buffer [, length]).
-+   Writes the contents of BUFFER (a Python object supporting the read buffer
-+   protocol) at ADDRESS in the inferior's memory.  Write LENGTH bytes from
-+   BUFFER, or its entire contents if the argument is not provided.  The
-+   function returns nothing.  */
++/* Implementation of
++   gdb.search_memory (address, length, pattern [, size] [, max_count]).
++   The third argument may be either a pattern, or a list or tupple of patterns
++   to be searched.  Size is the size in bytes of each search query value, either
++   1, 2, 4 or 8.  Returns a list of the addresses where matches were found.  */
 +
-+PyObject *
-+gdbpy_write_memory (PyObject *self, PyObject *args)
++static PyObject *
++infpy_search_memory (PyObject *self, PyObject *args, PyObject *kw)
 +{
-+  int buf_len;
-+  const char *buffer;
-+  long length = -1;
-+  CORE_ADDR addr;
++  int size = 0;
++  unsigned int found_count = 0;
++  long max_count = 0;
++  CORE_ADDR start_addr, length;
++  char *pattern_buf;
++  static char *keywords[] = { "address", "length", "pattern", "size",
++                            "max_count", NULL };
++  ULONGEST pattern_len, search_space_len;
++  PyObject *pattern, *list = NULL, *start_addr_obj, *length_obj;
 +  volatile struct gdb_exception except;
 +
-+  /* Assume CORE_ADDR corresponds to unsigned long.  */
-+  if (! PyArg_ParseTuple (args, "ks#|l", &addr, &buffer, &buf_len, &length))
++  if (! PyArg_ParseTupleAndKeywords (args, kw, "OOO|il", keywords,
++                                   &start_addr_obj, &length_obj, &pattern,
++                                   &size, &max_count))
 +    return NULL;
 +
-+  if (length == -1)
-+    length = buf_len;
++  if (!max_count)
++    max_count = LONG_MAX;
 +
-+  TRY_CATCH (except, RETURN_MASK_ALL)
++  if (size != 0 && size != 1 && size != 2 && size != 4 && size != 8)
 +    {
-+      write_memory (addr, buffer, length);
++      PyErr_SetString (PyExc_ValueError, "invalid pattern size");
++      return NULL;
 +    }
-+  GDB_PY_HANDLE_EXCEPTION (except);
 +
-+  Py_RETURN_NONE;
-+}
++  TRY_CATCH (except, RETURN_MASK_ALL)
++    {
++      if (get_addr_from_python (start_addr_obj, &start_addr)
++        && get_addr_from_python (length_obj, &length))
++      {
++        if (!length)
++          {
++            PyErr_SetString (PyExc_ValueError, "empty search range");
++            break;
++          }
++        /* Watch for overflows.  */
++        else if (length > CORE_ADDR_MAX
++                 || (start_addr + length - 1) < start_addr)
++          {
++            PyErr_SetString (PyExc_ValueError, "search range too large");
++            break;
++          }
 +
-+/* Destructor of Membuf objects.  */
++        search_space_len = length;
 +
-+static void
-+mbpy_dealloc (PyObject *self)
-+{
-+  xfree (((membuf_object *) self)->buffer);
-+  self->ob_type->tp_free (self);
-+}
++        if (get_search_pattern (pattern, size, &pattern_buf, &pattern_len))
++          {
++            /* Any cleanups get automatically executed on an exception.  */
++            struct cleanup *cleanups = make_cleanup (xfree, pattern_buf);
 +
-+/* Return a description of the Membuf object.  */
++            list = PyList_New (0);
 +
-+static PyObject *
-+mbpy_str (PyObject *self)
-+{
-+  membuf_object *membuf_obj = (membuf_object *) self;
++            while (search_space_len >= pattern_len && found_count < max_count)
++              {
++                CORE_ADDR found_addr;
++                int found;
 +
-+  return PyString_FromFormat ("memory buffer for address %s, %s bytes long",
-+                            paddress (membuf_obj->addr),
-+                            pulongest (membuf_obj->length));
-+}
++                found = search_memory (&start_addr, &search_space_len,
++                                       pattern_buf, pattern_len, &found_addr);
++                if (found <= 0)
++                  break;
 +
-+static Py_ssize_t
-+get_read_buffer (PyObject *self, Py_ssize_t segment, void **ptrptr)
-+{
-+  membuf_object *membuf_obj = (membuf_object *) self;
++                PyList_Append (list, PyLong_FromUnsignedLong (found_addr));
++                ++found_count;
++              }
 +
-+  if (segment)
-+    {
-+      PyErr_SetString (PyExc_SystemError,
-+                     "The memory buffer supports only one segment.");
-+      return -1;
++            do_cleanups (cleanups);
++          }
++      }
 +    }
++  GDB_PY_HANDLE_EXCEPTION (except);
 +
-+  *ptrptr = membuf_obj->buffer;
-+
-+  return membuf_obj->length;
++  return list;
 +}
 +
-+static Py_ssize_t
-+get_write_buffer (PyObject *self, Py_ssize_t segment, void **ptrptr)
++\f
++
++void
++gdbpy_initialize_inferior (void)
 +{
-+  return get_read_buffer (self, segment, ptrptr);
++  if (PyType_Ready (&inferior_object_type) < 0)
++    return;
++
++  Py_INCREF (&inferior_object_type);
++  PyModule_AddObject (gdb_module, "Inferior",
++                    (PyObject *) &inferior_object_type);
++
++  inferior_list = NULL;
++  ninferiors = 0;
++
++  observer_attach_new_inferior (add_inferior_object);
++  observer_attach_inferior_exit (delete_inferior_object);
++  observer_attach_new_thread (add_thread_object);
++  observer_attach_thread_exit (delete_thread_object);
++
++  if (PyType_Ready (&membuf_object_type) < 0)
++    return;
++
++  Py_INCREF (&membuf_object_type);
++  PyModule_AddObject (gdb_module, "Membuf", (PyObject *) &membuf_object_type);
 +}
 +
-+static Py_ssize_t
-+get_seg_count (PyObject *self, Py_ssize_t *lenp)
++\f
++
++static PyGetSetDef inferior_object_getset[] =
 +{
-+  if (lenp)
-+    *lenp = ((membuf_object *) self)->length;
++  { "num", infpy_get_num, NULL, "ID of inferior, as assigned by GDB.", NULL },
++  { "pid", infpy_get_pid, NULL, "PID of inferior, as assigned by the OS.",
++    NULL },
++  { "was_attached", infpy_get_was_attached, NULL,
++    "True if the inferior was created using 'attach'.", NULL },
 +
-+  return 1;
-+}
++  { NULL }
++};
 +
-+static Py_ssize_t
-+get_char_buffer (PyObject *self, Py_ssize_t segment, char **ptrptr)
++static PyMethodDef inferior_object_methods[] =
 +{
-+  void *ptr = NULL;
-+  Py_ssize_t ret;
++  { "threads", infpy_threads, METH_NOARGS,
++    "Return all the threads of this inferior." },
 +
-+  ret = get_read_buffer (self, segment, &ptr);
-+  *ptrptr = (char *) ptr;
++  { "read_memory", infpy_read_memory, METH_VARARGS,
++    "read_memory (address, length) -> buffer\n\
++Return a buffer object for reading from the inferior's memory." },
++  { "write_memory", infpy_write_memory, METH_VARARGS,
++    "write_memory (address, buffer [, length])\n\
++Write the given buffer object to the inferior's memory." },
++  { "search_memory", (PyCFunction) infpy_search_memory, METH_VARARGS | METH_KEYWORDS,
++    "search_memory (address, length, pattern [, size] [, max_count]) -> list\n\
++Return a list with the addresses where matches were found." },
 +
-+  return ret;
-+}
++  { NULL }
++};
++
++static PyTypeObject inferior_object_type =
++{
++  PyObject_HEAD_INIT (NULL)
++  0,                            /* ob_size */
++  "gdb.Inferior",               /* tp_name */
++  sizeof (inferior_object),     /* tp_basicsize */
++  0,                            /* tp_itemsize */
++  0,                            /* tp_dealloc */
++  0,                            /* tp_print */
++  0,                            /* tp_getattr */
++  0,                            /* tp_setattr */
++  0,                            /* tp_compare */
++  0,                            /* tp_repr */
++  0,                            /* tp_as_number */
++  0,                            /* tp_as_sequence */
++  0,                            /* tp_as_mapping */
++  0,                            /* tp_hash  */
++  0,                            /* tp_call */
++  0,                            /* tp_str */
++  0,                            /* tp_getattro */
++  0,                            /* tp_setattro */
++  0,                            /* tp_as_buffer */
++  Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_ITER,  /* tp_flags */
++  "GDB inferior object",        /* tp_doc */
++  0,                            /* tp_traverse */
++  0,                            /* tp_clear */
++  0,                            /* tp_richcompare */
++  0,                            /* tp_weaklistoffset */
++  0,                            /* tp_iter */
++  0,                            /* tp_iternext */
++  inferior_object_methods,      /* tp_methods */
++  0,                            /* tp_members */
++  inferior_object_getset,       /* tp_getset */
++  0,                            /* tp_base */
++  0,                            /* tp_dict */
++  0,                            /* tp_descr_get */
++  0,                            /* tp_descr_set */
++  0,                            /* tp_dictoffset */
++  0,                            /* tp_init */
++  0                             /* tp_alloc */
++};
++
++\f
 +
 +/* Python doesn't provide a decent way to get compatibility here.  */
 +#if HAVE_LIBPYTHON2_4
@@ -27703,25 +15749,15 @@ index 0000000..a4c7d74
 +  0,                            /* tp_alloc */
 +  PyType_GenericNew             /* tp_new */
 +};
-+
-+void
-+gdbpy_initialize_membuf (void)
-+{
-+  if (PyType_Ready (&membuf_object_type) < 0)
-+    return;
-+
-+  Py_INCREF (&membuf_object_type);
-+  PyModule_AddObject (gdb_module, "Membuf", (PyObject *) &membuf_object_type);
-+}
-diff --git a/gdb/python/python-objfile.c b/gdb/python/python-objfile.c
+diff --git a/gdb/python/py-infthread.c b/gdb/python/py-infthread.c
 new file mode 100644
-index 0000000..e97d3a2
+index 0000000..21e4eab
 --- /dev/null
-+++ b/gdb/python/python-objfile.c
-@@ -0,0 +1,221 @@
-+/* Python interface to objfiles.
++++ b/gdb/python/py-infthread.c
+@@ -0,0 +1,285 @@
++/* Python interface to inferior threads.
 +
-+   Copyright (C) 2008, 2009 Free Software Foundation, Inc.
++   Copyright (C) 2009 Free Software Foundation, Inc.
 +
 +   This file is part of GDB.
 +
@@ -27739,173 +15775,238 @@ index 0000000..e97d3a2
 +   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 +
 +#include "defs.h"
++#include "exceptions.h"
++#include "gdbthread.h"
++#include "inferior.h"
 +#include "python-internal.h"
-+#include "charset.h"
-+#include "objfiles.h"
 +
-+typedef struct
-+{
-+  PyObject_HEAD
++static PyTypeObject thread_object_type;
++
++/* Require that INFERIOR be a valid inferior ID.  */
++#define THPY_REQUIRE_VALID(Thread)                            \
++  do {                                                                \
++    if (!Thread->thread)                                      \
++      {                                                               \
++      PyErr_SetString (PyExc_RuntimeError,                    \
++                       "thread no longer exists");            \
++      return NULL;                                            \
++      }                                                               \
++  } while (0)
 +
-+  /* The corresponding objfile.  */
-+  struct objfile *objfile;
++\f
 +
-+  /* The pretty-printer list of functions.  */
-+  PyObject *printers;
-+} objfile_object;
++thread_object *
++create_thread_object (struct thread_info *tp)
++{
++  thread_object *thread_obj;
++  
++  thread_obj = PyObject_New (thread_object, &thread_object_type);
++  if (!thread_obj)
++    return NULL;
 +
-+static PyTypeObject objfile_object_type;
++  thread_obj->thread = tp;
++  thread_obj->inf_obj = find_inferior_object (PIDGET (tp->ptid));
++  Py_INCREF (thread_obj->inf_obj);
 +
-+static const struct objfile_data *objfpy_objfile_data_key;
++  return thread_obj;
++}
 +
 +\f
 +
-+/* An Objfile method which returns the objfile's file name, or None.  */
-+static PyObject *
-+objfpy_get_filename (PyObject *self, void *closure)
-+{
-+  objfile_object *obj = (objfile_object *) self;
-+  if (obj->objfile && obj->objfile->name)
-+    return PyString_Decode (obj->objfile->name, strlen (obj->objfile->name),
-+                          host_charset (), NULL);
-+  Py_RETURN_NONE;
-+}
-+
 +static void
-+objfpy_dealloc (PyObject *o)
++thpy_dealloc (PyObject *self)
 +{
-+  objfile_object *self = (objfile_object *) o;
-+  Py_XDECREF (self->printers);
-+  self->ob_type->tp_free ((PyObject *) self);
++  Py_DECREF (((thread_object *) self)->inf_obj);
++  self->ob_type->tp_free (self);
 +}
 +
 +static PyObject *
-+objfpy_new (PyTypeObject *type, PyObject *args, PyObject *keywords)
++thpy_get_num (PyObject *self, void *closure)
 +{
-+  objfile_object *self = (objfile_object *) type->tp_alloc (type, 0);
-+  if (self)
-+    {
-+      self->objfile = NULL;
++  thread_object *thread_obj = (thread_object *) self;
 +
-+      self->printers = PyList_New (0);
-+      if (!self->printers)
-+      {
-+        Py_DECREF (self);
-+        return NULL;
-+      }
-+    }
-+  return (PyObject *) self;
++  THPY_REQUIRE_VALID (thread_obj);
++
++  return PyLong_FromLong (thread_obj->thread->num);
 +}
 +
++\f
++
++/* Implementation of Inferior.frames () -> (gdb.Frame, ...).
++   Returns a tuple of all frame objects.  */
 +PyObject *
-+objfpy_get_printers (PyObject *o, void *ignore)
++thpy_frames (PyObject *self, PyObject *args)
 +{
-+  objfile_object *self = (objfile_object *) o;
-+  Py_INCREF (self->printers);
-+  return self->printers;
-+}
++  int result = 0;
++  struct frame_info *frame;
++  PyObject *frame_obj;
++  PyObject *list, *tuple;
++  thread_object *thread_obj = (thread_object *) self;
++  struct cleanup *cleanup;
++  volatile struct gdb_exception except;
 +
-+static int
-+objfpy_set_printers (PyObject *o, PyObject *value, void *ignore)
-+{
-+  objfile_object *self = (objfile_object *) o;
-+  if (! value)
-+    {
-+      PyErr_SetString (PyExc_TypeError,
-+                     "cannot delete the pretty_printers attribute");
-+      return -1;
-+    }
++  THPY_REQUIRE_VALID (thread_obj);
 +
-+  if (! PyList_Check (value))
++  list = PyList_New (0);
++  if (list == NULL)
 +    {
-+      PyErr_SetString (PyExc_TypeError,
-+                     "the pretty_printers attribute must be a list");
-+      return -1;
++      PyErr_SetString (PyExc_MemoryError, "Could not allocate frames list.");
++      return NULL;
 +    }
 +
-+  Py_XDECREF (self->printers);
-+  Py_INCREF (value);
-+  self->printers = value;
++  cleanup = make_cleanup_restore_current_thread ();
 +
-+  return 0;
-+}
-+
-+\f
-+
-+/* Clear the OBJFILE pointer in an Objfile object and remove the
-+   reference.  */
-+static void
-+clean_up_objfile (struct objfile *objfile, void *datum)
-+{
-+  objfile_object *object = datum;
-+  object->objfile = NULL;
-+  Py_DECREF ((PyObject *) object);
-+}
-+
-+/* Return the Python object of type Objfile representing OBJFILE.  If
-+   the object has already been created, return it.  Otherwise, create
-+   it.  Return NULL and set the Python error on failure.  */
-+PyObject *
-+objfile_to_objfile_object (struct objfile *objfile)
-+{
-+  objfile_object *object;
-+
-+  object = objfile_data (objfile, objfpy_objfile_data_key);
-+  if (!object)
++  TRY_CATCH (except, RETURN_MASK_ALL)
 +    {
-+      object = PyObject_New (objfile_object, &objfile_object_type);
-+      if (object)
-+      {
-+        PyObject *dict;
-+
-+        object->objfile = objfile;
++      switch_to_thread (thread_obj->thread->ptid);
 +
-+        object->printers = PyList_New (0);
-+        if (!object->printers)
++      for (frame = get_current_frame (); frame; frame = get_prev_frame (frame))
++      {
++        frame_obj = frame_info_to_frame_object (frame);
++        if (frame_obj == NULL)
 +          {
-+            Py_DECREF (object);
-+            return NULL;
++            Py_DECREF (list);
++            list = NULL;
++            break;
 +          }
 +
-+        set_objfile_data (objfile, objfpy_objfile_data_key, object);
++        PyList_Append (list, frame_obj);
 +      }
 +    }
++  if (except.reason < 0)
++    {
++      Py_DECREF (list);
++      return PyErr_Format (except.reason == RETURN_QUIT
++                         ? PyExc_KeyboardInterrupt : PyExc_RuntimeError,
++                         "%s", except.message);
++    }
 +
-+  return (PyObject *) object;
-+}
++  do_cleanups (cleanup);
 +
-+void
-+gdbpy_initialize_objfile (void)
++  if (list)
++    {
++      tuple = PyList_AsTuple (list);
++      Py_DECREF (list);
++    }
++  else
++    tuple = NULL;
++
++  return tuple;
++}
++
++/* Implementation of InferiorThread.newest_frame () -> gdb.Frame.
++   Returns the newest frame object.  */
++PyObject *
++thpy_newest_frame (PyObject *self, PyObject *args)
++{
++  struct frame_info *frame;
++  PyObject *frame_obj = NULL;   /* Initialize to appease gcc warning.  */
++  thread_object *thread_obj = (thread_object *) self;
++  struct cleanup *cleanup;
++  volatile struct gdb_exception except;
++
++  THPY_REQUIRE_VALID (thread_obj);
++
++  cleanup = make_cleanup_restore_current_thread ();
++
++  TRY_CATCH (except, RETURN_MASK_ALL)
++    {
++      switch_to_thread (thread_obj->thread->ptid);
++
++      frame = get_current_frame ();
++      frame_obj = frame_info_to_frame_object (frame);
++    }
++  GDB_PY_HANDLE_EXCEPTION (except);
++
++  do_cleanups (cleanup);
++
++  return frame_obj;
++}
++
++/* Implementation of InferiorThread.switch ().
++   Makes this the GDB selected thread.  */
++static PyObject *
++thpy_switch (PyObject *self, PyObject *args)
++{
++  thread_object *thread_obj = (thread_object *) self;
++  struct cleanup *cleanup;
++  volatile struct gdb_exception except;
++
++  THPY_REQUIRE_VALID (thread_obj);
++
++  TRY_CATCH (except, RETURN_MASK_ALL)
++    {
++      switch_to_thread (thread_obj->thread->ptid);
++    }
++  GDB_PY_HANDLE_EXCEPTION (except);
++
++  Py_RETURN_NONE;
++}
++
++\f
++
++/* Implementation of gdb.selected_thread () -> gdb.InferiorThread.
++   Returns the selected thread object.  */
++PyObject *
++gdbpy_selected_thread (PyObject *self, PyObject *args)
 +{
-+  objfpy_objfile_data_key
-+    = register_objfile_data_with_cleanup (clean_up_objfile);
++  PyObject *thread_obj;
++  
++  thread_obj = (PyObject *) find_thread_object (inferior_ptid);
++  if (thread_obj)
++    {
++      Py_INCREF (thread_obj);
++      return thread_obj;
++    }
++
++  Py_RETURN_NONE;
++}
++
++\f
 +
-+  if (PyType_Ready (&objfile_object_type) < 0)
++void
++gdbpy_initialize_thread (void)
++{
++  if (PyType_Ready (&thread_object_type) < 0)
 +    return;
 +
-+  Py_INCREF (&objfile_object_type);
-+  PyModule_AddObject (gdb_module, "Objfile", (PyObject *) &objfile_object_type);
++  Py_INCREF (&thread_object_type);
++  PyModule_AddObject (gdb_module, "InferiorThread",
++                    (PyObject *) &thread_object_type);
 +}
 +
 +\f
 +
-+static PyGetSetDef objfile_getset[] =
++static PyGetSetDef thread_object_getset[] =
++{
++  { "num", thpy_get_num, NULL, "ID of the thread, as assigned by GDB.", NULL },
++
++  { NULL }
++};
++
++static PyMethodDef thread_object_methods[] =
 +{
-+  { "filename", objfpy_get_filename, NULL,
-+    "The objfile's filename, or None.", NULL },
-+  { "pretty_printers", objfpy_get_printers, objfpy_set_printers,
-+    "Pretty printers.", NULL },
++  { "frames", thpy_frames, METH_NOARGS,
++    "frames () -> (gdb.Frame, ...)\n\
++Return a tuple containing all frames in the thread." },
++  { "newest_frame", thpy_newest_frame, METH_NOARGS,
++    "newest_frame () -> gdb.Frame\n\
++Return the newest frame in the thread." },
++  { "switch", thpy_switch, METH_NOARGS,
++    "switch ()\n\
++Makes this the GDB selected thread." },
++
 +  { NULL }
 +};
 +
-+static PyTypeObject objfile_object_type =
++static PyTypeObject thread_object_type =
 +{
 +  PyObject_HEAD_INIT (NULL)
 +  0,                            /*ob_size*/
-+  "gdb.Objfile",                /*tp_name*/
-+  sizeof (objfile_object),      /*tp_basicsize*/
++  "gdb.InferiorThread",                 /*tp_name*/
++  sizeof (thread_object),       /*tp_basicsize*/
 +  0,                            /*tp_itemsize*/
-+  objfpy_dealloc,               /*tp_dealloc*/
++  thpy_dealloc,                         /*tp_dealloc*/
 +  0,                            /*tp_print*/
 +  0,                            /*tp_getattr*/
 +  0,                            /*tp_setattr*/
@@ -27920,33 +16021,32 @@ index 0000000..e97d3a2
 +  0,                            /*tp_getattro*/
 +  0,                            /*tp_setattro*/
 +  0,                            /*tp_as_buffer*/
-+  Py_TPFLAGS_DEFAULT,           /*tp_flags*/
-+  "GDB objfile object",                 /* tp_doc */
++  Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_ITER,  /*tp_flags*/
++  "GDB thread object",                  /* tp_doc */
 +  0,                            /* tp_traverse */
 +  0,                            /* tp_clear */
 +  0,                            /* tp_richcompare */
 +  0,                            /* tp_weaklistoffset */
 +  0,                            /* tp_iter */
 +  0,                            /* tp_iternext */
-+  0,                            /* tp_methods */
++  thread_object_methods,        /* tp_methods */
 +  0,                            /* tp_members */
-+  objfile_getset,               /* tp_getset */
++  thread_object_getset,                 /* tp_getset */
 +  0,                            /* tp_base */
 +  0,                            /* tp_dict */
 +  0,                            /* tp_descr_get */
 +  0,                            /* tp_descr_set */
 +  0,                            /* tp_dictoffset */
 +  0,                            /* tp_init */
-+  0,                            /* tp_alloc */
-+  objfpy_new,                   /* tp_new */
++  0                             /* tp_alloc */
 +};
-diff --git a/gdb/python/python-param.c b/gdb/python/python-param.c
+diff --git a/gdb/python/py-membuf.c b/gdb/python/py-membuf.c
 new file mode 100644
-index 0000000..1f591a8
+index 0000000..7bc294c
 --- /dev/null
-+++ b/gdb/python/python-param.c
-@@ -0,0 +1,606 @@
-+/* gdb parameters implemented in Python
++++ b/gdb/python/py-membuf.c
+@@ -0,0 +1,268 @@
++/* Python interface to the inferior memory.
 +
 +   Copyright (C) 2008, 2009 Free Software Foundation, Inc.
 +
@@ -27965,559 +16065,211 @@ index 0000000..1f591a8
 +   You should have received a copy of the GNU General Public License
 +   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 +
-+
 +#include "defs.h"
-+#include "value.h"
 +#include "exceptions.h"
++#include "gdbcore.h"
 +#include "python-internal.h"
-+#include "charset.h"
-+#include "gdbcmd.h"
-+#include "cli/cli-decode.h"
-+#include "completer.h"
-+
-+/* Parameter constants and their values.  */
-+struct parm_constant
-+{
-+  char *name;
-+  int value;
-+};
-+
-+struct parm_constant parm_constants[] =
-+{
-+  { "PARAM_BOOLEAN", var_boolean },
-+  { "PARAM_AUTO_BOOLEAN", var_auto_boolean },
-+  { "PARAM_UINTEGER", var_uinteger },
-+  { "PARAM_INTEGER", var_integer },
-+  { "PARAM_STRING", var_string },
-+  { "PARAM_STRING_NOESCAPE", var_string_noescape },
-+  { "PARAM_OPTIONAL_FILENAME", var_optional_filename },
-+  { "PARAM_FILENAME", var_filename },
-+  { "PARAM_ZINTEGER", var_zinteger },
-+  { "PARAM_ENUM", var_enum },
-+  { NULL, 0 }
-+};
 +
-+/* A union that can hold anything described by enum var_types.  */
-+union parmpy_variable
-+{
-+  /* Hold an integer value, for boolean and integer types.  */
-+  int intval;
-+
-+  /* Hold an auto_boolean.  */
-+  enum auto_boolean autoboolval;
++typedef struct {
++  PyObject_HEAD
++  void *buffer;
 +
-+  /* Hold an unsigned integer value, for uinteger.  */
-+  unsigned int uintval;
++  /* These are kept just for mbpy_str.  */
++  CORE_ADDR addr;
++  CORE_ADDR length;
++} membuf_object;
 +
-+  /* Hold a string, for the various string types.  */
-+  char *stringval;
++static PyTypeObject membuf_object_type;
 +
-+  /* Hold a string, for enums.  */
-+  const char *cstringval;
-+};
++/* Implementation of gdb.read_memory (address, length).
++   Returns a Python buffer object with LENGTH bytes of the inferior's memory
++   at ADDRESS. Both arguments are integers.  */
 +
-+/* A gdb parameter.  */
-+struct parmpy_object
++PyObject *
++gdbpy_read_memory (PyObject *self, PyObject *args)
 +{
-+  PyObject_HEAD
-+
-+  /* The type of the parameter.  */
-+  enum var_types type;
++  int error = 0;
++  CORE_ADDR addr, length;
++  void *buffer = NULL;
++  membuf_object *membuf_obj;
++  PyObject *addr_obj, *length_obj;
++  struct cleanup *cleanups = NULL;
++  volatile struct gdb_exception except;
 +
-+  /* The value of the parameter.  */
-+  union parmpy_variable value;
++  if (! PyArg_ParseTuple (args, "OO", &addr_obj, &length_obj))
++    return NULL;
 +
-+  /* For an enum command, the possible values.  The vector is
-+     allocated with xmalloc, as is each element.  It is
-+     NULL-terminated.  */
-+  const char **enumeration;
-+};
++  TRY_CATCH (except, RETURN_MASK_ALL)
++    {
++      if (!get_addr_from_python (addr_obj, &addr)
++        || !get_addr_from_python (length_obj, &length))
++      {
++        error = 1;
++        break;
++      }
 +
-+typedef struct parmpy_object parmpy_object;
++      buffer = xmalloc (length);
++      cleanups = make_cleanup (xfree, buffer);
 +
-+static PyTypeObject parmpy_object_type;
++      read_memory (addr, buffer, length);
++    }
++  GDB_PY_HANDLE_EXCEPTION (except);
 +
-+/* Some handy string constants.  */
-+static PyObject *set_doc_cst;
-+static PyObject *show_doc_cst;
++  if (error)
++    return NULL;
 +
-+\f
++  discard_cleanups (cleanups);
 +
-+/* Get an attribute.  */
-+static PyObject *
-+get_attr (PyObject *obj, PyObject *attr_name)
-+{
-+  if (PyString_Check (attr_name)
-+      && ! strcmp (PyString_AsString (attr_name), "value"))
++  membuf_obj = PyObject_New (membuf_object, &membuf_object_type);
++  if (membuf_obj == NULL)
 +    {
-+      parmpy_object *self = (parmpy_object *) obj;
-+      return gdbpy_parameter_value (self->type, &self->value);
++      xfree (buffer);
++      PyErr_SetString (PyExc_MemoryError,
++                     "Could not allocate memory buffer object.");
++      return NULL;
 +    }
 +
-+  return PyObject_GenericGetAttr (obj, attr_name);
++  membuf_obj->buffer = buffer;
++  membuf_obj->addr = addr;
++  membuf_obj->length = length;
++
++  return PyBuffer_FromReadWriteObject ((PyObject *) membuf_obj, 0,
++                                     Py_END_OF_BUFFER);
 +}
 +
-+/* Set a parameter value from a Python value.  Return 0 on success, -1
-+   on failure.  */
-+static int
-+set_parameter_value (parmpy_object *self, PyObject *value)
++/* Implementation of gdb.write_memory (address, buffer [, length]).
++   Writes the contents of BUFFER (a Python object supporting the read buffer
++   protocol) at ADDRESS in the inferior's memory.  Write LENGTH bytes from
++   BUFFER, or its entire contents if the argument is not provided.  The
++   function returns nothing.  */
++
++PyObject *
++gdbpy_write_memory (PyObject *self, PyObject *args)
 +{
-+  int cmp;
++  int buf_len, error = 0;
++  const char *buffer;
++  CORE_ADDR addr, length;
++  PyObject *addr_obj, *length_obj = NULL;
++  volatile struct gdb_exception except;
 +
-+  switch (self->type)
++  if (! PyArg_ParseTuple (args, "Os#|O", &addr_obj, &buffer, &buf_len,
++                        &length_obj))
++    return NULL;
++
++  TRY_CATCH (except, RETURN_MASK_ALL)
 +    {
-+    case var_string:
-+    case var_string_noescape:
-+    case var_optional_filename:
-+    case var_filename:
-+      if (! gdbpy_is_string (value)
-+        && (self->type == var_filename
-+            || value != Py_None))
++      if (!get_addr_from_python (addr_obj, &addr))
 +      {
-+        PyErr_SetString (PyExc_RuntimeError, "string required");
-+        return -1;
++        error = 1;
++        break;
 +      }
-+      if (self->value.stringval)
-+      xfree (self->value.stringval);
-+      if (value == Py_None)
++      
++      if (!length_obj)
++      length = buf_len;
++      else if (!get_addr_from_python (length_obj, &length))
 +      {
-+        if (self->type == var_optional_filename)
-+          self->value.stringval = xstrdup ("");
-+        else
-+          self->value.stringval = NULL;
++        error = 1;
++        break;
 +      }
-+      else
-+      self->value.stringval = python_string_to_host_string (value);
-+      break;
 +
-+    case var_enum:
-+      {
-+      int i;
-+      char *str;
++      write_memory (addr, buffer, length);
++    }
++  GDB_PY_HANDLE_EXCEPTION (except);
 +
-+      if (! gdbpy_is_string (value))
-+        {
-+          PyErr_SetString (PyExc_RuntimeError, "string required");
-+          return -1;
-+        }
++  if (error)
++    return NULL;
 +
-+      str = python_string_to_host_string (value);
-+      for (i = 0; self->enumeration[i]; ++i)
-+        if (! strcmp (self->enumeration[i], str))
-+          break;
-+      xfree (str);
-+      if (! self->enumeration[i])
-+        {
-+          PyErr_SetString (PyExc_RuntimeError,
-+                           "value must be member of enumeration");
-+          return -1;
-+        }
-+      self->value.cstringval = self->enumeration[i];
-+      break;
-+      }
++  Py_RETURN_NONE;
++}
 +
-+    case var_boolean:
-+      if (! PyBool_Check (value))
-+      {
-+        PyErr_SetString (PyExc_RuntimeError, "boolean required");
-+        return -1;
-+      }
-+      cmp = PyObject_IsTrue (value);
-+      if (cmp < 0) 
-+        return -1;
-+      self->value.intval = cmp;
-+      break;
-+
-+    case var_auto_boolean:
-+      if (! PyBool_Check (value) && value != Py_None)
-+      {
-+        PyErr_SetString (PyExc_RuntimeError,
-+                         "boolean or None required");
-+        return -1;
-+      }
-+
-+      if (value == Py_None)
-+      self->value.autoboolval = AUTO_BOOLEAN_AUTO;
-+      else
-+      {
-+        cmp = PyObject_IsTrue (value);
-+        if (cmp < 0 )
-+          return -1;    
-+        if (cmp == 1)
-+          self->value.autoboolval = AUTO_BOOLEAN_TRUE;
-+        else 
-+          self->value.autoboolval = AUTO_BOOLEAN_FALSE;
-+
-+        break;
-+      }
++/* Destructor of Membuf objects.  */
 +
-+    case var_integer:
-+    case var_zinteger:
-+    case var_uinteger:
-+      {
-+      long l;
-+      int ok;
++static void
++mbpy_dealloc (PyObject *self)
++{
++  xfree (((membuf_object *) self)->buffer);
++  self->ob_type->tp_free (self);
++}
 +
-+      if (! PyInt_Check (value))
-+        {
-+          PyErr_SetString (PyExc_RuntimeError, "value must be integer");
-+          return -1;
-+        }
++/* Return a description of the Membuf object.  */
 +
-+      l = PyInt_AsLong (value);
-+      if (self->type == var_uinteger)
-+        {
-+          ok = (l >= 0 && l <= UINT_MAX);
-+          if (l == 0)
-+            l = UINT_MAX;
-+        }
-+      else if (self->type == var_integer)
-+        {
-+          ok = (l >= INT_MIN && l <= INT_MAX);
-+          if (l == 0)
-+            l = INT_MAX;
-+        }
-+      else
-+        ok = (l >= INT_MIN && l <= INT_MAX);
++static PyObject *
++mbpy_str (PyObject *self)
++{
++  membuf_object *membuf_obj = (membuf_object *) self;
 +
-+      if (! ok)
-+        {
-+          PyErr_SetString (PyExc_RuntimeError, "range exceeded");
-+          return -1;
-+        }
++  return PyString_FromFormat ("memory buffer for address %s, %s bytes long",
++                            paddress (membuf_obj->addr),
++                            pulongest (membuf_obj->length));
++}
 +
-+      self->value.intval = (int) l;
-+      break;
-+      }
++static Py_ssize_t
++get_read_buffer (PyObject *self, Py_ssize_t segment, void **ptrptr)
++{
++  membuf_object *membuf_obj = (membuf_object *) self;
 +
-+    default:
-+      PyErr_SetString (PyExc_RuntimeError, "programmer error: unhandled type");
++  if (segment)
++    {
++      PyErr_SetString (PyExc_SystemError,
++                     "The memory buffer supports only one segment.");
 +      return -1;
 +    }
 +
-+  return 0;
++  *ptrptr = membuf_obj->buffer;
++
++  return membuf_obj->length;
 +}
 +
-+/* Set an attribute.  */
-+static int
-+set_attr (PyObject *obj, PyObject *attr_name, PyObject *val)
++static Py_ssize_t
++get_write_buffer (PyObject *self, Py_ssize_t segment, void **ptrptr)
 +{
-+  if (PyString_Check (attr_name)
-+      && ! strcmp (PyString_AsString (attr_name), "value"))
-+    {
-+      if (!val)
-+      {
-+        PyErr_SetString (PyExc_RuntimeError,
-+                         "cannot delete a parameter's value");
-+        return -1;
-+      }
-+      return set_parameter_value ((parmpy_object *) obj, val);
-+    }
-+
-+  return PyObject_GenericSetAttr (obj, attr_name, val);
++  return get_read_buffer (self, segment, ptrptr);
 +}
 +
-+\f
-+
-+/* A helper function that dispatches to the appropriate add_setshow
-+   function.  */
-+static void
-+add_setshow_generic (int parmclass, enum command_class cmdclass,
-+                   char *cmd_name, parmpy_object *self,
-+                   char *set_doc, char *show_doc, char *help_doc,
-+                   struct cmd_list_element **set_list,
-+                   struct cmd_list_element **show_list)
++static Py_ssize_t
++get_seg_count (PyObject *self, Py_ssize_t *lenp)
 +{
-+  switch (parmclass)
-+    {
-+    case var_boolean:
-+      add_setshow_boolean_cmd (cmd_name, cmdclass, &self->value.intval,
-+                             set_doc, show_doc, help_doc,
-+                             NULL, NULL, set_list, show_list);
-+      break;
-+
-+    case var_auto_boolean:
-+      add_setshow_auto_boolean_cmd (cmd_name, cmdclass,
-+                                  &self->value.autoboolval,
-+                                  set_doc, show_doc, help_doc,
-+                                  NULL, NULL, set_list, show_list);
-+      break;
-+
-+    case var_uinteger:
-+      add_setshow_uinteger_cmd (cmd_name, cmdclass, &self->value.uintval,
-+                              set_doc, show_doc, help_doc,
-+                              NULL, NULL, set_list, show_list);
-+      break;
-+
-+    case var_integer:
-+      add_setshow_integer_cmd (cmd_name, cmdclass, &self->value.intval,
-+                             set_doc, show_doc, help_doc,
-+                             NULL, NULL, set_list, show_list);
-+      break;
-+
-+    case var_string:
-+      add_setshow_string_cmd (cmd_name, cmdclass, &self->value.stringval,
-+                            set_doc, show_doc, help_doc,
-+                            NULL, NULL, set_list, show_list);
-+      break;
-+
-+    case var_string_noescape:
-+      add_setshow_string_noescape_cmd (cmd_name, cmdclass,
-+                                     &self->value.stringval,
-+                                     set_doc, show_doc, help_doc,
-+                                     NULL, NULL, set_list, show_list);
-+      break;
-+
-+    case var_optional_filename:
-+      add_setshow_optional_filename_cmd (cmd_name, cmdclass,
-+                                       &self->value.stringval,
-+                                       set_doc, show_doc, help_doc,
-+                                       NULL, NULL, set_list, show_list);
-+      break;
-+
-+    case var_filename:
-+      add_setshow_filename_cmd (cmd_name, cmdclass, &self->value.stringval,
-+                              set_doc, show_doc, help_doc,
-+                              NULL, NULL, set_list, show_list);
-+      break;
-+
-+    case var_zinteger:
-+      add_setshow_zinteger_cmd (cmd_name, cmdclass, &self->value.intval,
-+                              set_doc, show_doc, help_doc,
-+                              NULL, NULL, set_list, show_list);
-+      break;
++  if (lenp)
++    *lenp = ((membuf_object *) self)->length;
 +
-+    case var_enum:
-+      add_setshow_enum_cmd (cmd_name, cmdclass, self->enumeration,
-+                          &self->value.cstringval,
-+                          set_doc, show_doc, help_doc,
-+                          NULL, NULL, set_list, show_list);
-+      /* Initialize the value, just in case.  */
-+      self->value.cstringval = self->enumeration[0];
-+      break;
-+    }
++  return 1;
 +}
 +
-+/* A helper which computes enum values.  Returns 1 on success, 0 on
-+   error.  */
-+static int
-+compute_enum_values (parmpy_object *self, PyObject *enum_values)
++static Py_ssize_t
++get_char_buffer (PyObject *self, Py_ssize_t segment, char **ptrptr)
 +{
-+  Py_ssize_t size, i;
++  void *ptr = NULL;
++  Py_ssize_t ret;
 +
-+  if (! enum_values)
-+    {
-+      PyErr_SetString (PyExc_RuntimeError,
-+                     "enumeration required for PARAM_ENUM");
-+      return 0;
-+    }
++  ret = get_read_buffer (self, segment, &ptr);
++  *ptrptr = (char *) ptr;
 +
-+  if (! PySequence_Check (enum_values))
-+    {
-+      PyErr_SetString (PyExc_RuntimeError, "enumeration is not a sequence");
-+      return 0;
-+    }
++  return ret;
++}
 +
-+  size = PySequence_Size (enum_values);
-+  if (size < 0)
-+    return 0;
-+  if (size == 0)
-+    {
-+      PyErr_SetString (PyExc_RuntimeError, "empty enumeration");
-+      return 0;
-+    }
++/* Python doesn't provide a decent way to get compatibility here.  */
++#if HAVE_LIBPYTHON2_4
++#define CHARBUFFERPROC_NAME getcharbufferproc
++#else
++#define CHARBUFFERPROC_NAME charbufferproc
++#endif
 +
-+  self->enumeration = xmalloc ((size + 1) * sizeof (char *));
-+  memset (self->enumeration, 0, (size + 1) * sizeof (char *));
++static PyBufferProcs buffer_procs = {
++  get_read_buffer,
++  get_write_buffer,
++  get_seg_count,
++  /* The cast here works around a difference between Python 2.4 and
++     Python 2.5.  */
++  (CHARBUFFERPROC_NAME) get_char_buffer
++};
 +
-+  for (i = 0; i < size; ++i)
-+    {
-+      PyObject *item = PySequence_GetItem (enum_values, i);
-+      if (! item)
-+      return 0;
-+      if (! gdbpy_is_string (item))
-+      {
-+        PyErr_SetString (PyExc_RuntimeError, "enumeration item not a string");
-+        return 0;
-+      }
-+      self->enumeration[i] = python_string_to_host_string (item);
-+    }
-+
-+  return 1;
-+}
-+
-+/* A helper function which returns a documentation string for an
-+   object.  */
-+static char *
-+get_doc_string (PyObject *object, PyObject *attr)
-+{
-+  char *result = NULL;
-+  if (PyObject_HasAttr (object, attr))
-+    {
-+      PyObject *ds_obj = PyObject_GetAttr (object, attr);
-+      if (ds_obj && gdbpy_is_string (ds_obj))
-+      result = python_string_to_host_string (ds_obj);
-+    }
-+  if (! result)
-+    result = xstrdup ("This command is not documented.");
-+  return result;
-+}
-+
-+/* Object initializer; sets up gdb-side structures for command.
-+
-+   Use: __init__(NAME, CMDCLASS, PARMCLASS, [ENUM])
-+
-+   NAME is the name of the parameter.  It may consist of multiple
-+   words, in which case the final word is the name of the new command,
-+   and earlier words must be prefix commands.
-+
-+   CMDCLASS is the kind of command.  It should be one of the COMMAND_*
-+   constants defined in the gdb module.
-+
-+   PARMCLASS is the type of the parameter.  It should be one of the
-+   PARAM_* constants defined in the gdb module.
-+
-+   If PARMCLASS is PARAM_ENUM, then the final argument should be a
-+   collection of strings.  These strings are the valid values for this
-+   parameter.
-+
-+   The documentation for the parameter is taken from the doc string
-+   for the python class.
-+   
-+*/
-+static int
-+parmpy_init (PyObject *self, PyObject *args, PyObject *kwds)
-+{
-+  parmpy_object *obj = (parmpy_object *) self;
-+  char *name;
-+  char *set_doc, *show_doc, *doc;
-+  char *cmd_name;
-+  int parmclass, cmdtype;
-+  PyObject *enum_values = NULL;
-+  struct cmd_list_element *cmd_list;
-+  struct cmd_list_element **set_list, **show_list;
-+  volatile struct gdb_exception except;
-+
-+  if (! PyArg_ParseTuple (args, "sii|O", &name, &cmdtype, &parmclass,
-+                        &enum_values))
-+    return -1;
-+
-+  if (cmdtype != no_class && cmdtype != class_run
-+      && cmdtype != class_vars && cmdtype != class_stack
-+      && cmdtype != class_files && cmdtype != class_support
-+      && cmdtype != class_info && cmdtype != class_breakpoint
-+      && cmdtype != class_trace && cmdtype != class_obscure
-+      && cmdtype != class_maintenance)
-+    {
-+      PyErr_Format (PyExc_RuntimeError, "invalid command class argument");
-+      return -1;
-+    }
-+
-+  if (parmclass != var_boolean && parmclass != var_auto_boolean
-+      && parmclass != var_uinteger && parmclass != var_integer
-+      && parmclass != var_string && parmclass != var_string_noescape
-+      && parmclass != var_optional_filename && parmclass != var_filename
-+      && parmclass != var_zinteger && parmclass != var_enum)
-+    {
-+      PyErr_SetString (PyExc_RuntimeError, "invalid parameter class argument");
-+      return -1;
-+    }
-+
-+  if (enum_values && parmclass != var_enum)
-+    {
-+      PyErr_SetString (PyExc_RuntimeError,
-+                     "only PARAM_ENUM accepts a fourth argument");
-+      return -1;
-+    }
-+  if (parmclass == var_enum)
-+    {
-+      if (! compute_enum_values (obj, enum_values))
-+      return -1;
-+    }
-+
-+  obj->type = (enum var_types) parmclass;
-+  memset (&obj->value, 0, sizeof (obj->value));
-+  obj->enumeration = NULL;
-+
-+  cmd_name = gdbpy_parse_command_name (name, &set_list, &setlist);
-+  if (! cmd_name)
-+    return -1;
-+  xfree (cmd_name);
-+  cmd_name = gdbpy_parse_command_name (name, &show_list, &showlist);
-+  if (! cmd_name)
-+    return -1;
-+
-+  /* FIXME: there is no way to register a destructor function for
-+     set/show commands.  So, these are leaked.  */
-+  set_doc = get_doc_string (self, set_doc_cst);
-+  show_doc = get_doc_string (self, show_doc_cst);
-+  doc = get_doc_string (self, gdbpy_doc_cst);
-+
-+  Py_INCREF (self);
-+
-+  TRY_CATCH (except, RETURN_MASK_ALL)
-+    {
-+      add_setshow_generic (parmclass, (enum command_class) cmdtype,
-+                         cmd_name, obj,
-+                         set_doc, show_doc,
-+                         doc, set_list, show_list);
-+    }
-+  if (except.reason < 0)
-+    {
-+      xfree (cmd_name);
-+      xfree (set_doc);
-+      xfree (show_doc);
-+      xfree (doc);
-+      Py_DECREF (self);
-+      PyErr_Format (except.reason == RETURN_QUIT
-+                  ? PyExc_KeyboardInterrupt : PyExc_RuntimeError,
-+                  "%s", except.message);
-+      return -1;
-+    }
-+  return 0;
-+}
-+
-+\f
-+
-+/* Initialize the 'parameters' module.  */
-+void
-+gdbpy_initialize_parameters (void)
-+{
-+  int i;
-+
-+  if (PyType_Ready (&parmpy_object_type) < 0)
-+    return;
-+
-+  set_doc_cst = PyString_FromString ("set_doc");
-+  if (! set_doc_cst)
-+    return;
-+  show_doc_cst = PyString_FromString ("show_doc");
-+  if (! show_doc_cst)
-+    return;
-+
-+  for (i = 0; parm_constants[i].name; ++i)
-+    {
-+      if (PyModule_AddIntConstant (gdb_module,
-+                                 parm_constants[i].name,
-+                                 parm_constants[i].value) < 0)
-+      return;
-+    }
-+
-+  Py_INCREF (&parmpy_object_type);
-+  PyModule_AddObject (gdb_module, "Parameter",
-+                    (PyObject *) &parmpy_object_type);
-+}
-+
-+\f
-+
-+static PyTypeObject parmpy_object_type =
-+{
++static PyTypeObject membuf_object_type = {
 +  PyObject_HEAD_INIT (NULL)
 +  0,                            /*ob_size*/
-+  "gdb.Parameter",              /*tp_name*/
-+  sizeof (parmpy_object),       /*tp_basicsize*/
++  "gdb.Membuf",                         /*tp_name*/
++  sizeof (membuf_object),       /*tp_basicsize*/
 +  0,                            /*tp_itemsize*/
-+  0,                            /*tp_dealloc*/
++  mbpy_dealloc,                         /*tp_dealloc*/
 +  0,                            /*tp_print*/
 +  0,                            /*tp_getattr*/
 +  0,                            /*tp_setattr*/
@@ -28528,12 +16280,12 @@ index 0000000..1f591a8
 +  0,                            /*tp_as_mapping*/
 +  0,                            /*tp_hash */
 +  0,                            /*tp_call*/
-+  0,                            /*tp_str*/
-+  get_attr,                     /*tp_getattro*/
-+  set_attr,                     /*tp_setattro*/
-+  0,                            /*tp_as_buffer*/
-+  Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /*tp_flags*/
-+  "GDB parameter object",       /* tp_doc */
++  mbpy_str,                     /*tp_str*/
++  0,                            /*tp_getattro*/
++  0,                            /*tp_setattro*/
++  &buffer_procs,                /*tp_as_buffer*/
++  Py_TPFLAGS_DEFAULT,           /*tp_flags*/
++  "GDB memory buffer object",           /*tp_doc*/
 +  0,                            /* tp_traverse */
 +  0,                            /* tp_clear */
 +  0,                            /* tp_richcompare */
@@ -28548,19 +16300,29 @@ index 0000000..1f591a8
 +  0,                            /* tp_descr_get */
 +  0,                            /* tp_descr_set */
 +  0,                            /* tp_dictoffset */
-+  parmpy_init,                          /* tp_init */
++  0,                            /* tp_init */
 +  0,                            /* tp_alloc */
 +  PyType_GenericNew             /* tp_new */
 +};
-diff --git a/gdb/python/python-symbol.c b/gdb/python/python-symbol.c
++
++void
++gdbpy_initialize_membuf (void)
++{
++  if (PyType_Ready (&membuf_object_type) < 0)
++    return;
++
++  Py_INCREF (&membuf_object_type);
++  PyModule_AddObject (gdb_module, "Membuf", (PyObject *) &membuf_object_type);
++}
+diff --git a/gdb/python/py-param.c b/gdb/python/py-param.c
 new file mode 100644
-index 0000000..c7fda5c
+index 0000000..1f591a8
 --- /dev/null
-+++ b/gdb/python/python-symbol.c
-@@ -0,0 +1,337 @@
-+/* Python interface to symbols.
++++ b/gdb/python/py-param.c
+@@ -0,0 +1,606 @@
++/* gdb parameters implemented in Python
 +
-+   Copyright (C) 2008 Free Software Foundation, Inc.
++   Copyright (C) 2008, 2009 Free Software Foundation, Inc.
 +
 +   This file is part of GDB.
 +
@@ -28577,296 +16339,557 @@ index 0000000..c7fda5c
 +   You should have received a copy of the GNU General Public License
 +   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 +
++
 +#include "defs.h"
-+#include "block.h"
++#include "value.h"
 +#include "exceptions.h"
-+#include "frame.h"
-+#include "symtab.h"
 +#include "python-internal.h"
++#include "charset.h"
++#include "gdbcmd.h"
++#include "cli/cli-decode.h"
++#include "completer.h"
 +
-+typedef struct {
-+  PyObject_HEAD
-+  struct symbol *symbol;
-+} symbol_object;
-+
++/* Parameter constants and their values.  */
++struct parm_constant
++{
++  char *name;
++  int value;
++};
 +
-+static PyObject *
-+sympy_str (PyObject *self)
++struct parm_constant parm_constants[] =
 +{
-+  int ret;
-+  char *s;
-+  PyObject *result;
++  { "PARAM_BOOLEAN", var_boolean },
++  { "PARAM_AUTO_BOOLEAN", var_auto_boolean },
++  { "PARAM_UINTEGER", var_uinteger },
++  { "PARAM_INTEGER", var_integer },
++  { "PARAM_STRING", var_string },
++  { "PARAM_STRING_NOESCAPE", var_string_noescape },
++  { "PARAM_OPTIONAL_FILENAME", var_optional_filename },
++  { "PARAM_FILENAME", var_filename },
++  { "PARAM_ZINTEGER", var_zinteger },
++  { "PARAM_ENUM", var_enum },
++  { NULL, 0 }
++};
 +
-+  ret = asprintf (&s, "symbol for %s",
-+                SYMBOL_PRINT_NAME (((symbol_object *) self)->symbol));
-+  if (ret < 0)
-+    Py_RETURN_NONE;
++/* A union that can hold anything described by enum var_types.  */
++union parmpy_variable
++{
++  /* Hold an integer value, for boolean and integer types.  */
++  int intval;
 +
-+  result = PyString_FromString (s);
-+  xfree (s);
++  /* Hold an auto_boolean.  */
++  enum auto_boolean autoboolval;
 +
-+  return result;
-+}
++  /* Hold an unsigned integer value, for uinteger.  */
++  unsigned int uintval;
 +
-+static PyObject *
-+sympy_get_value (PyObject *self, void *closure)
++  /* Hold a string, for the various string types.  */
++  char *stringval;
++
++  /* Hold a string, for enums.  */
++  const char *cstringval;
++};
++
++/* A gdb parameter.  */
++struct parmpy_object
 +{
-+  symbol_object *self_sym = (symbol_object *) self;
++  PyObject_HEAD
 +
-+  switch (SYMBOL_CLASS (self_sym->symbol))
-+    {
-+    case LOC_BLOCK:
-+      return block_to_block_object (SYMBOL_BLOCK_VALUE (self_sym->symbol));
-+    }
++  /* The type of the parameter.  */
++  enum var_types type;
 +
-+  PyErr_SetString (PyExc_NotImplementedError,
-+                 "Symbol type not yet supported in Python scripts.");
-+  return NULL;
-+}
++  /* The value of the parameter.  */
++  union parmpy_variable value;
 +
-+static PyObject *
-+sympy_get_symtab (PyObject *self, void *closure)
-+{
-+  symbol_object *self_sym = (symbol_object *) self;
++  /* For an enum command, the possible values.  The vector is
++     allocated with xmalloc, as is each element.  It is
++     NULL-terminated.  */
++  const char **enumeration;
++};
 +
-+  return symtab_to_symtab_object (SYMBOL_SYMTAB (self_sym->symbol));
-+}
++typedef struct parmpy_object parmpy_object;
 +
-+static PyObject *
-+sympy_get_name (PyObject *self, void *closure)
-+{
-+  symbol_object *self_sym = (symbol_object *) self;
++static PyTypeObject parmpy_object_type;
 +
-+  return PyString_FromString (SYMBOL_NATURAL_NAME (self_sym->symbol));
-+}
++/* Some handy string constants.  */
++static PyObject *set_doc_cst;
++static PyObject *show_doc_cst;
 +
++\f
++
++/* Get an attribute.  */
 +static PyObject *
-+sympy_get_linkage_name (PyObject *self, void *closure)
++get_attr (PyObject *obj, PyObject *attr_name)
 +{
-+  symbol_object *self_sym = (symbol_object *) self;
++  if (PyString_Check (attr_name)
++      && ! strcmp (PyString_AsString (attr_name), "value"))
++    {
++      parmpy_object *self = (parmpy_object *) obj;
++      return gdbpy_parameter_value (self->type, &self->value);
++    }
 +
-+  return PyString_FromString (SYMBOL_LINKAGE_NAME (self_sym->symbol));
++  return PyObject_GenericGetAttr (obj, attr_name);
 +}
 +
-+static PyObject *
-+sympy_get_print_name (PyObject *self, void *closure)
++/* Set a parameter value from a Python value.  Return 0 on success, -1
++   on failure.  */
++static int
++set_parameter_value (parmpy_object *self, PyObject *value)
 +{
-+  symbol_object *self_sym = (symbol_object *) self;
++  int cmp;
 +
-+  return PyString_FromString (SYMBOL_PRINT_NAME (self_sym->symbol));
-+}
++  switch (self->type)
++    {
++    case var_string:
++    case var_string_noescape:
++    case var_optional_filename:
++    case var_filename:
++      if (! gdbpy_is_string (value)
++        && (self->type == var_filename
++            || value != Py_None))
++      {
++        PyErr_SetString (PyExc_RuntimeError, "string required");
++        return -1;
++      }
++      if (self->value.stringval)
++      xfree (self->value.stringval);
++      if (value == Py_None)
++      {
++        if (self->type == var_optional_filename)
++          self->value.stringval = xstrdup ("");
++        else
++          self->value.stringval = NULL;
++      }
++      else
++      self->value.stringval = python_string_to_host_string (value);
++      break;
 +
-+static PyObject *
-+sympy_get_addr_class (PyObject *self, void *closure)
-+{
-+  symbol_object *self_sym = (symbol_object *) self;
++    case var_enum:
++      {
++      int i;
++      char *str;
 +
-+  return PyInt_FromLong (SYMBOL_CLASS (self_sym->symbol));
-+}
++      if (! gdbpy_is_string (value))
++        {
++          PyErr_SetString (PyExc_RuntimeError, "string required");
++          return -1;
++        }
 +
-+static PyObject *
-+sympy_is_argument (PyObject *self, void *closure)
-+{
-+  symbol_object *self_sym = (symbol_object *) self;
++      str = python_string_to_host_string (value);
++      for (i = 0; self->enumeration[i]; ++i)
++        if (! strcmp (self->enumeration[i], str))
++          break;
++      xfree (str);
++      if (! self->enumeration[i])
++        {
++          PyErr_SetString (PyExc_RuntimeError,
++                           "value must be member of enumeration");
++          return -1;
++        }
++      self->value.cstringval = self->enumeration[i];
++      break;
++      }
 +
-+  return PyBool_FromLong (SYMBOL_IS_ARGUMENT (self_sym->symbol));
-+}
++    case var_boolean:
++      if (! PyBool_Check (value))
++      {
++        PyErr_SetString (PyExc_RuntimeError, "boolean required");
++        return -1;
++      }
++      cmp = PyObject_IsTrue (value);
++      if (cmp < 0) 
++        return -1;
++      self->value.intval = cmp;
++      break;
 +
-+static PyObject *
-+sympy_is_constant (PyObject *self, void *closure)
-+{
-+  symbol_object *self_sym = (symbol_object *) self;
-+  enum address_class class = SYMBOL_CLASS (self_sym->symbol);
++    case var_auto_boolean:
++      if (! PyBool_Check (value) && value != Py_None)
++      {
++        PyErr_SetString (PyExc_RuntimeError,
++                         "boolean or None required");
++        return -1;
++      }
 +
-+  return PyBool_FromLong (class == LOC_CONST || class == LOC_CONST_BYTES);
-+}
++      if (value == Py_None)
++      self->value.autoboolval = AUTO_BOOLEAN_AUTO;
++      else
++      {
++        cmp = PyObject_IsTrue (value);
++        if (cmp < 0 )
++          return -1;    
++        if (cmp == 1)
++          self->value.autoboolval = AUTO_BOOLEAN_TRUE;
++        else 
++          self->value.autoboolval = AUTO_BOOLEAN_FALSE;
 +
-+static PyObject *
-+sympy_is_function (PyObject *self, void *closure)
-+{
-+  symbol_object *self_sym = (symbol_object *) self;
-+  enum address_class class = SYMBOL_CLASS (self_sym->symbol);
++        break;
++      }
 +
-+  return PyBool_FromLong (class == LOC_BLOCK);
-+}
++    case var_integer:
++    case var_zinteger:
++    case var_uinteger:
++      {
++      long l;
++      int ok;
 +
-+static PyObject *
-+sympy_is_variable (PyObject *self, void *closure)
-+{
-+  symbol_object *self_sym = (symbol_object *) self;
-+  enum address_class class = SYMBOL_CLASS (self_sym->symbol);
++      if (! PyInt_Check (value))
++        {
++          PyErr_SetString (PyExc_RuntimeError, "value must be integer");
++          return -1;
++        }
 +
-+  return PyBool_FromLong (!SYMBOL_IS_ARGUMENT (self_sym->symbol)
-+      && (class == LOC_LOCAL || class == LOC_REGISTER || class == LOC_STATIC
-+        || class == LOC_COMPUTED || class == LOC_OPTIMIZED_OUT));
-+}
++      l = PyInt_AsLong (value);
++      if (self->type == var_uinteger)
++        {
++          ok = (l >= 0 && l <= UINT_MAX);
++          if (l == 0)
++            l = UINT_MAX;
++        }
++      else if (self->type == var_integer)
++        {
++          ok = (l >= INT_MIN && l <= INT_MAX);
++          if (l == 0)
++            l = INT_MAX;
++        }
++      else
++        ok = (l >= INT_MIN && l <= INT_MAX);
 +
-+PyObject *
-+symbol_to_symbol_object (struct symbol *sym)
-+{
-+  symbol_object *sym_obj;
++      if (! ok)
++        {
++          PyErr_SetString (PyExc_RuntimeError, "range exceeded");
++          return -1;
++        }
 +
-+  sym_obj = PyObject_New (symbol_object, &symbol_object_type);
-+  if (sym_obj == NULL)
-+    {
-+      PyErr_SetString (PyExc_MemoryError, "Could not allocate symbol object.");
-+      return NULL;
-+    }
++      self->value.intval = (int) l;
++      break;
++      }
 +
-+  sym_obj->symbol = sym;
++    default:
++      PyErr_SetString (PyExc_RuntimeError, "programmer error: unhandled type");
++      return -1;
++    }
 +
-+  return (PyObject *) sym_obj;
++  return 0;
 +}
 +
-+struct symbol *
-+symbol_object_to_symbol (PyObject *obj)
++/* Set an attribute.  */
++static int
++set_attr (PyObject *obj, PyObject *attr_name, PyObject *val)
 +{
-+  if (! PyObject_TypeCheck (obj, &symbol_object_type))
-+    return NULL;
-+  return ((symbol_object *) obj)->symbol;
-+}
-+
-+/* Implementation of
-+   gdb.lookup_symbol (name [, block] [, domain]) -> (symbol, is_field_of_this)
-+   A tuple with 2 elements is always returned.  The first is the symbol
-+   object or None, the second is a boolean with the value of
-+   is_a_field_of_this (see comment in lookup_symbol_in_language).  */
++  if (PyString_Check (attr_name)
++      && ! strcmp (PyString_AsString (attr_name), "value"))
++    {
++      if (!val)
++      {
++        PyErr_SetString (PyExc_RuntimeError,
++                         "cannot delete a parameter's value");
++        return -1;
++      }
++      return set_parameter_value ((parmpy_object *) obj, val);
++    }
 +
-+PyObject *gdbpy_lookup_symbol (PyObject *self, PyObject *args, PyObject *kw)
-+{
-+  int domain = VAR_DOMAIN, is_a_field_of_this = 0;
-+  const char *name;
-+  static char *keywords[] = { "name", "block", "domain", NULL };
-+  struct symbol *symbol;
-+  PyObject *block_obj = NULL, *ret_tuple, *sym_obj, *bool_obj;
-+  struct block *block = NULL;
++  return PyObject_GenericSetAttr (obj, attr_name, val);
++}
 +
-+  if (! PyArg_ParseTupleAndKeywords (args, kw, "s|O!i", keywords, &name,
-+                                   &block_object_type, &block_obj, &domain))
-+    return NULL;
++\f
 +
-+  if (block_obj)
-+    block = block_object_to_block (block_obj);
-+  else
++/* A helper function that dispatches to the appropriate add_setshow
++   function.  */
++static void
++add_setshow_generic (int parmclass, enum command_class cmdclass,
++                   char *cmd_name, parmpy_object *self,
++                   char *set_doc, char *show_doc, char *help_doc,
++                   struct cmd_list_element **set_list,
++                   struct cmd_list_element **show_list)
++{
++  switch (parmclass)
 +    {
-+      struct frame_info *selected_frame;
-+      volatile struct gdb_exception except;
++    case var_boolean:
++      add_setshow_boolean_cmd (cmd_name, cmdclass, &self->value.intval,
++                             set_doc, show_doc, help_doc,
++                             NULL, NULL, set_list, show_list);
++      break;
 +
-+      TRY_CATCH (except, RETURN_MASK_ALL)
-+      {
-+        selected_frame  = get_selected_frame (_("No frame selected."));
-+        block = block_for_pc (get_frame_address_in_block (selected_frame));
-+      }
-+      GDB_PY_HANDLE_EXCEPTION (except);
++    case var_auto_boolean:
++      add_setshow_auto_boolean_cmd (cmd_name, cmdclass,
++                                  &self->value.autoboolval,
++                                  set_doc, show_doc, help_doc,
++                                  NULL, NULL, set_list, show_list);
++      break;
++
++    case var_uinteger:
++      add_setshow_uinteger_cmd (cmd_name, cmdclass, &self->value.uintval,
++                              set_doc, show_doc, help_doc,
++                              NULL, NULL, set_list, show_list);
++      break;
++
++    case var_integer:
++      add_setshow_integer_cmd (cmd_name, cmdclass, &self->value.intval,
++                             set_doc, show_doc, help_doc,
++                             NULL, NULL, set_list, show_list);
++      break;
++
++    case var_string:
++      add_setshow_string_cmd (cmd_name, cmdclass, &self->value.stringval,
++                            set_doc, show_doc, help_doc,
++                            NULL, NULL, set_list, show_list);
++      break;
++
++    case var_string_noescape:
++      add_setshow_string_noescape_cmd (cmd_name, cmdclass,
++                                     &self->value.stringval,
++                                     set_doc, show_doc, help_doc,
++                                     NULL, NULL, set_list, show_list);
++      break;
++
++    case var_optional_filename:
++      add_setshow_optional_filename_cmd (cmd_name, cmdclass,
++                                       &self->value.stringval,
++                                       set_doc, show_doc, help_doc,
++                                       NULL, NULL, set_list, show_list);
++      break;
++
++    case var_filename:
++      add_setshow_filename_cmd (cmd_name, cmdclass, &self->value.stringval,
++                              set_doc, show_doc, help_doc,
++                              NULL, NULL, set_list, show_list);
++      break;
++
++    case var_zinteger:
++      add_setshow_zinteger_cmd (cmd_name, cmdclass, &self->value.intval,
++                              set_doc, show_doc, help_doc,
++                              NULL, NULL, set_list, show_list);
++      break;
++
++    case var_enum:
++      add_setshow_enum_cmd (cmd_name, cmdclass, self->enumeration,
++                          &self->value.cstringval,
++                          set_doc, show_doc, help_doc,
++                          NULL, NULL, set_list, show_list);
++      /* Initialize the value, just in case.  */
++      self->value.cstringval = self->enumeration[0];
++      break;
 +    }
++}
 +
-+  symbol = lookup_symbol (name, block, domain, &is_a_field_of_this);
++/* A helper which computes enum values.  Returns 1 on success, 0 on
++   error.  */
++static int
++compute_enum_values (parmpy_object *self, PyObject *enum_values)
++{
++  Py_ssize_t size, i;
 +
-+  ret_tuple = PyTuple_New (2);
-+  if (!ret_tuple)
++  if (! enum_values)
 +    {
-+      PyErr_SetString (PyExc_MemoryError, "Could not allocate tuple object.");
-+      return NULL;
++      PyErr_SetString (PyExc_RuntimeError,
++                     "enumeration required for PARAM_ENUM");
++      return 0;
 +    }
 +
-+  if (symbol)
++  if (! PySequence_Check (enum_values))
 +    {
-+      sym_obj = symbol_to_symbol_object (symbol);
-+      if (!sym_obj)
-+      {
-+        Py_DECREF (ret_tuple);
-+        return NULL;
-+      }
++      PyErr_SetString (PyExc_RuntimeError, "enumeration is not a sequence");
++      return 0;
 +    }
-+  else
++
++  size = PySequence_Size (enum_values);
++  if (size < 0)
++    return 0;
++  if (size == 0)
 +    {
-+      sym_obj = Py_None;
-+      Py_INCREF (Py_None);
++      PyErr_SetString (PyExc_RuntimeError, "empty enumeration");
++      return 0;
 +    }
-+  PyTuple_SET_ITEM (ret_tuple, 0, sym_obj);
 +
-+  bool_obj = is_a_field_of_this? Py_True : Py_False;
-+  Py_INCREF (bool_obj);
-+  PyTuple_SET_ITEM (ret_tuple, 1, bool_obj);
++  self->enumeration = xmalloc ((size + 1) * sizeof (char *));
++  memset (self->enumeration, 0, (size + 1) * sizeof (char *));
 +
-+  return ret_tuple;
++  for (i = 0; i < size; ++i)
++    {
++      PyObject *item = PySequence_GetItem (enum_values, i);
++      if (! item)
++      return 0;
++      if (! gdbpy_is_string (item))
++      {
++        PyErr_SetString (PyExc_RuntimeError, "enumeration item not a string");
++        return 0;
++      }
++      self->enumeration[i] = python_string_to_host_string (item);
++    }
++
++  return 1;
 +}
 +
-+void
-+gdbpy_initialize_symbols (void)
++/* A helper function which returns a documentation string for an
++   object.  */
++static char *
++get_doc_string (PyObject *object, PyObject *attr)
 +{
-+  symbol_object_type.tp_new = PyType_GenericNew;
-+  if (PyType_Ready (&symbol_object_type) < 0)
-+    return;
++  char *result = NULL;
++  if (PyObject_HasAttr (object, attr))
++    {
++      PyObject *ds_obj = PyObject_GetAttr (object, attr);
++      if (ds_obj && gdbpy_is_string (ds_obj))
++      result = python_string_to_host_string (ds_obj);
++    }
++  if (! result)
++    result = xstrdup ("This command is not documented.");
++  return result;
++}
 +
-+  /* FIXME: These would probably be best exposed as class attributes of Symbol,
-+     but I don't know how to do it except by messing with the type's dictionary.
-+     That seems too messy.  */
-+  /* FIXME 2: Some of these were removed from GDB since I first wrote this code,
-+     so it's probably a good idea not to expose them to Python.  */
-+  PyModule_AddIntConstant (gdb_module, "SYMBOL_LOC_UNDEF", LOC_UNDEF);
-+  PyModule_AddIntConstant (gdb_module, "SYMBOL_LOC_CONST", LOC_CONST);
-+  PyModule_AddIntConstant (gdb_module, "SYMBOL_LOC_STATIC", LOC_STATIC);
-+  PyModule_AddIntConstant (gdb_module, "SYMBOL_LOC_REGISTER", LOC_REGISTER);
-+  PyModule_AddIntConstant (gdb_module, "SYMBOL_LOC_ARG", LOC_ARG);
-+  PyModule_AddIntConstant (gdb_module, "SYMBOL_LOC_REF_ARG", LOC_REF_ARG);
-+  PyModule_AddIntConstant (gdb_module, "SYMBOL_LOC_LOCAL", LOC_LOCAL);
-+  PyModule_AddIntConstant (gdb_module, "SYMBOL_LOC_TYPEDEF", LOC_TYPEDEF);
-+  PyModule_AddIntConstant (gdb_module, "SYMBOL_LOC_LABEL", LOC_LABEL);
-+  PyModule_AddIntConstant (gdb_module, "SYMBOL_LOC_BLOCK", LOC_BLOCK);
-+  PyModule_AddIntConstant (gdb_module, "SYMBOL_LOC_CONST_BYTES",
-+                         LOC_CONST_BYTES);
-+  PyModule_AddIntConstant (gdb_module, "SYMBOL_LOC_UNRESOLVED", LOC_UNRESOLVED);
-+  PyModule_AddIntConstant (gdb_module, "SYMBOL_LOC_OPTIMIZED_OUT",
-+                         LOC_OPTIMIZED_OUT);
-+  PyModule_AddIntConstant (gdb_module, "SYMBOL_LOC_COMPUTED", LOC_COMPUTED);
-+  PyModule_AddIntConstant (gdb_module, "SYMBOL_LOC_REGPARM_ADDR",
-+                         LOC_REGPARM_ADDR);
-+  PyModule_AddIntConstant (gdb_module, "SYMBOL_UNDEF_DOMAIN", UNDEF_DOMAIN);
-+  PyModule_AddIntConstant (gdb_module, "SYMBOL_VAR_DOMAIN", VAR_DOMAIN);
-+  PyModule_AddIntConstant (gdb_module, "SYMBOL_STRUCT_DOMAIN", STRUCT_DOMAIN);
-+  PyModule_AddIntConstant (gdb_module, "SYMBOL_LABEL_DOMAIN", LABEL_DOMAIN);
-+  PyModule_AddIntConstant (gdb_module, "SYMBOL_VARIABLES_DOMAIN",
-+                         VARIABLES_DOMAIN);
-+  PyModule_AddIntConstant (gdb_module, "SYMBOL_FUNCTIONS_DOMAIN",
-+                         FUNCTIONS_DOMAIN);
-+  PyModule_AddIntConstant (gdb_module, "SYMBOL_TYPES_DOMAIN", TYPES_DOMAIN);
++/* Object initializer; sets up gdb-side structures for command.
 +
-+  Py_INCREF (&symbol_object_type);
-+  PyModule_AddObject (gdb_module, "Symbol", (PyObject *) &symbol_object_type);
-+}
++   Use: __init__(NAME, CMDCLASS, PARMCLASS, [ENUM])
 +
-+\f
++   NAME is the name of the parameter.  It may consist of multiple
++   words, in which case the final word is the name of the new command,
++   and earlier words must be prefix commands.
 +
-+static PyGetSetDef symbol_object_getset[] = {
-+  { "value", sympy_get_value, NULL, "Value of the symbol.", NULL },
-+  { "symtab", sympy_get_symtab, NULL,
-+    "Symbol table in which the symbol appears.", NULL },
-+  { "name", sympy_get_name, NULL,
-+    "Name of the symbol, as it appears in the source code.", NULL },
-+  { "linkage_name", sympy_get_linkage_name, NULL,
-+    "Name of the symbol, as used by the linker (i.e., may be mangled).", NULL },
-+  { "print_name", sympy_get_print_name, NULL,
-+    "Name of the symbol in a form suitable for output.\n\
-+This is either name or linkage_name, depending on whether the user asked GDB\n\
-+to display demangled or mangled names.", NULL },
-+  { "addr_class", sympy_get_addr_class, NULL, "Address class of the symbol." },
-+  { "is_argument", sympy_is_argument, NULL,
-+    "True if the symbol is an argument of a function." },
-+  { "is_constant", sympy_is_constant, NULL,
-+    "True if the symbol is a constant." },
-+  { "is_function", sympy_is_function, NULL,
-+    "True if the symbol is a function or method." },
-+  { "is_variable", sympy_is_variable, NULL,
-+    "True if the symbol is a variable." },
-+  { NULL }  /* Sentinel */
-+};
++   CMDCLASS is the kind of command.  It should be one of the COMMAND_*
++   constants defined in the gdb module.
 +
-+PyTypeObject symbol_object_type = {
++   PARMCLASS is the type of the parameter.  It should be one of the
++   PARAM_* constants defined in the gdb module.
++
++   If PARMCLASS is PARAM_ENUM, then the final argument should be a
++   collection of strings.  These strings are the valid values for this
++   parameter.
++
++   The documentation for the parameter is taken from the doc string
++   for the python class.
++   
++*/
++static int
++parmpy_init (PyObject *self, PyObject *args, PyObject *kwds)
++{
++  parmpy_object *obj = (parmpy_object *) self;
++  char *name;
++  char *set_doc, *show_doc, *doc;
++  char *cmd_name;
++  int parmclass, cmdtype;
++  PyObject *enum_values = NULL;
++  struct cmd_list_element *cmd_list;
++  struct cmd_list_element **set_list, **show_list;
++  volatile struct gdb_exception except;
++
++  if (! PyArg_ParseTuple (args, "sii|O", &name, &cmdtype, &parmclass,
++                        &enum_values))
++    return -1;
++
++  if (cmdtype != no_class && cmdtype != class_run
++      && cmdtype != class_vars && cmdtype != class_stack
++      && cmdtype != class_files && cmdtype != class_support
++      && cmdtype != class_info && cmdtype != class_breakpoint
++      && cmdtype != class_trace && cmdtype != class_obscure
++      && cmdtype != class_maintenance)
++    {
++      PyErr_Format (PyExc_RuntimeError, "invalid command class argument");
++      return -1;
++    }
++
++  if (parmclass != var_boolean && parmclass != var_auto_boolean
++      && parmclass != var_uinteger && parmclass != var_integer
++      && parmclass != var_string && parmclass != var_string_noescape
++      && parmclass != var_optional_filename && parmclass != var_filename
++      && parmclass != var_zinteger && parmclass != var_enum)
++    {
++      PyErr_SetString (PyExc_RuntimeError, "invalid parameter class argument");
++      return -1;
++    }
++
++  if (enum_values && parmclass != var_enum)
++    {
++      PyErr_SetString (PyExc_RuntimeError,
++                     "only PARAM_ENUM accepts a fourth argument");
++      return -1;
++    }
++  if (parmclass == var_enum)
++    {
++      if (! compute_enum_values (obj, enum_values))
++      return -1;
++    }
++
++  obj->type = (enum var_types) parmclass;
++  memset (&obj->value, 0, sizeof (obj->value));
++  obj->enumeration = NULL;
++
++  cmd_name = gdbpy_parse_command_name (name, &set_list, &setlist);
++  if (! cmd_name)
++    return -1;
++  xfree (cmd_name);
++  cmd_name = gdbpy_parse_command_name (name, &show_list, &showlist);
++  if (! cmd_name)
++    return -1;
++
++  /* FIXME: there is no way to register a destructor function for
++     set/show commands.  So, these are leaked.  */
++  set_doc = get_doc_string (self, set_doc_cst);
++  show_doc = get_doc_string (self, show_doc_cst);
++  doc = get_doc_string (self, gdbpy_doc_cst);
++
++  Py_INCREF (self);
++
++  TRY_CATCH (except, RETURN_MASK_ALL)
++    {
++      add_setshow_generic (parmclass, (enum command_class) cmdtype,
++                         cmd_name, obj,
++                         set_doc, show_doc,
++                         doc, set_list, show_list);
++    }
++  if (except.reason < 0)
++    {
++      xfree (cmd_name);
++      xfree (set_doc);
++      xfree (show_doc);
++      xfree (doc);
++      Py_DECREF (self);
++      PyErr_Format (except.reason == RETURN_QUIT
++                  ? PyExc_KeyboardInterrupt : PyExc_RuntimeError,
++                  "%s", except.message);
++      return -1;
++    }
++  return 0;
++}
++
++\f
++
++/* Initialize the 'parameters' module.  */
++void
++gdbpy_initialize_parameters (void)
++{
++  int i;
++
++  if (PyType_Ready (&parmpy_object_type) < 0)
++    return;
++
++  set_doc_cst = PyString_FromString ("set_doc");
++  if (! set_doc_cst)
++    return;
++  show_doc_cst = PyString_FromString ("show_doc");
++  if (! show_doc_cst)
++    return;
++
++  for (i = 0; parm_constants[i].name; ++i)
++    {
++      if (PyModule_AddIntConstant (gdb_module,
++                                 parm_constants[i].name,
++                                 parm_constants[i].value) < 0)
++      return;
++    }
++
++  Py_INCREF (&parmpy_object_type);
++  PyModule_AddObject (gdb_module, "Parameter",
++                    (PyObject *) &parmpy_object_type);
++}
++
++\f
++
++static PyTypeObject parmpy_object_type =
++{
 +  PyObject_HEAD_INIT (NULL)
 +  0,                            /*ob_size*/
-+  "gdb.Symbol",                         /*tp_name*/
-+  sizeof (symbol_object),       /*tp_basicsize*/
++  "gdb.Parameter",              /*tp_name*/
++  sizeof (parmpy_object),       /*tp_basicsize*/
 +  0,                            /*tp_itemsize*/
 +  0,                            /*tp_dealloc*/
 +  0,                            /*tp_print*/
@@ -28879,12 +16902,12 @@ index 0000000..c7fda5c
 +  0,                            /*tp_as_mapping*/
 +  0,                            /*tp_hash */
 +  0,                            /*tp_call*/
-+  sympy_str,                    /*tp_str*/
-+  0,                            /*tp_getattro*/
-+  0,                            /*tp_setattro*/
++  0,                            /*tp_str*/
++  get_attr,                     /*tp_getattro*/
++  set_attr,                     /*tp_setattro*/
 +  0,                            /*tp_as_buffer*/
-+  Py_TPFLAGS_DEFAULT,           /*tp_flags*/
-+  "GDB symbol object",                  /* tp_doc */
++  Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /*tp_flags*/
++  "GDB parameter object",       /* tp_doc */
 +  0,                            /* tp_traverse */
 +  0,                            /* tp_clear */
 +  0,                            /* tp_richcompare */
@@ -28893,17 +16916,72 @@ index 0000000..c7fda5c
 +  0,                            /* tp_iternext */
 +  0,                            /* tp_methods */
 +  0,                            /* tp_members */
-+  symbol_object_getset                  /* tp_getset */
++  0,                            /* tp_getset */
++  0,                            /* tp_base */
++  0,                            /* tp_dict */
++  0,                            /* tp_descr_get */
++  0,                            /* tp_descr_set */
++  0,                            /* tp_dictoffset */
++  parmpy_init,                          /* tp_init */
++  0,                            /* tp_alloc */
++  PyType_GenericNew             /* tp_new */
 +};
-diff --git a/gdb/python/python-symtab.c b/gdb/python/python-symtab.c
+diff --git a/gdb/python/py-prettyprint.c b/gdb/python/py-prettyprint.c
+index 5d696c8..a6348ba 100644
+--- a/gdb/python/py-prettyprint.c
++++ b/gdb/python/py-prettyprint.c
+@@ -121,6 +121,7 @@ find_pretty_printer (PyObject *value)
+   
+   return function;
+ }
++
+ /* Pretty-print a single value, via the printer object PRINTER.
+    If the function returns a string, a PyObject containing the string
+    is returned.  Otherwise, if the function returns a value,
+@@ -141,10 +142,15 @@ pretty_print_one_value (PyObject *printer, struct value **out_value)
+         if (! gdbpy_is_string (result))
+           {
+             *out_value = convert_value_from_python (result);
+-            if (PyErr_Occurred ())
+-              *out_value = NULL;
+-            Py_DECREF (result);
+-            result = NULL;
++            if (PyErr_Occurred ())
++              *out_value = NULL;
++            else
++              /* We must increment the value's refcount, because we
++                 are about to decref RESULT, and this may result in
++                 the value being destroyed.  */
++              value_incref (*out_value);
++            Py_DECREF (result);
++            result = NULL;
+           }
+       }
+     }
+@@ -556,14 +562,7 @@ gdbpy_get_varobj_pretty_printer (struct value *value)
+ {
+   PyObject *val_obj;
+   PyObject *pretty_printer = NULL;
+-  volatile struct gdb_exception except;
+-  TRY_CATCH (except, RETURN_MASK_ALL)
+-    {
+-      value = value_copy (value);
+-    }
+-  GDB_PY_HANDLE_EXCEPTION (except);
+-  
+   val_obj = value_to_value_object (value);
+   if (! val_obj)
+     return NULL;
+diff --git a/gdb/python/py-symbol.c b/gdb/python/py-symbol.c
 new file mode 100644
-index 0000000..a48c38c
+index 0000000..03d43c1
 --- /dev/null
-+++ b/gdb/python/python-symtab.c
-@@ -0,0 +1,311 @@
-+/* Python interface to symbol tables.
++++ b/gdb/python/py-symbol.c
+@@ -0,0 +1,336 @@
++/* Python interface to symbols.
 +
-+   Copyright (C) 2008 Free Software Foundation, Inc.
++   Copyright (C) 2008, 2009 Free Software Foundation, Inc.
 +
 +   This file is part of GDB.
 +
@@ -28921,36 +16999,27 @@ index 0000000..a48c38c
 +   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 +
 +#include "defs.h"
-+#include "charset.h"
++#include "block.h"
++#include "exceptions.h"
++#include "frame.h"
 +#include "symtab.h"
-+#include "source.h"
 +#include "python-internal.h"
 +
 +typedef struct {
 +  PyObject_HEAD
-+  struct symtab *symtab;
-+} symtab_object;
-+
-+static PyTypeObject symtab_object_type;
-+
-+typedef struct {
-+  PyObject_HEAD
-+  symtab_object *symtab;
-+  struct symtab_and_line *sal;
-+} sal_object;
-+
-+static PyTypeObject sal_object_type;
++  struct symbol *symbol;
++} symbol_object;
 +
 +
 +static PyObject *
-+stpy_str (PyObject *self)
++sympy_str (PyObject *self)
 +{
 +  int ret;
 +  char *s;
 +  PyObject *result;
 +
-+  ret = asprintf (&s, "symbol table for %s",
-+                ((symtab_object *) self)->symtab->filename);
++  ret = asprintf (&s, "symbol for %s",
++                SYMBOL_PRINT_NAME (((symbol_object *) self)->symbol));
 +  if (ret < 0)
 +    Py_RETURN_NONE;
 +
@@ -28961,187 +17030,263 @@ index 0000000..a48c38c
 +}
 +
 +static PyObject *
-+stpy_get_filename (PyObject *self, void *closure)
++sympy_get_value (PyObject *self, void *closure)
 +{
-+  symtab_object *self_symtab = (symtab_object *) self;
-+  PyObject *str_obj;
++  symbol_object *self_sym = (symbol_object *) self;
 +
-+  /* FIXME: Can symtab->filename really be NULL?  */
-+  if (self_symtab->symtab->filename)
-+    str_obj = PyString_Decode (self_symtab->symtab->filename,
-+                             strlen (self_symtab->symtab->filename),
-+                             host_charset (), NULL);
-+  else
++  switch (SYMBOL_CLASS (self_sym->symbol))
 +    {
-+      str_obj = Py_None;
-+      Py_INCREF (Py_None);
++    case LOC_BLOCK:
++      return block_to_block_object (SYMBOL_BLOCK_VALUE (self_sym->symbol));
 +    }
 +
-+  return str_obj;
++  PyErr_SetString (PyExc_NotImplementedError,
++                 "Symbol type not yet supported in Python scripts.");
++  return NULL;
 +}
 +
 +static PyObject *
-+stpy_fullname (PyObject *self, PyObject *args)
++sympy_get_symtab (PyObject *self, void *closure)
 +{
-+  char *fullname;
-+
-+  fullname = symtab_to_fullname (((symtab_object *) self)->symtab);
-+  if (fullname)
-+    return PyString_Decode (fullname, strlen (fullname), host_charset (), NULL);
++  symbol_object *self_sym = (symbol_object *) self;
 +
-+  Py_RETURN_NONE;
++  return symtab_to_symtab_object (SYMBOL_SYMTAB (self_sym->symbol));
 +}
 +
 +static PyObject *
-+salpy_str (PyObject *self)
++sympy_get_name (PyObject *self, void *closure)
 +{
-+  int ret;
-+  char *s, *filename;
-+  sal_object *sal_obj;
-+  PyObject *result;
-+
-+  sal_obj = (sal_object *) self;
-+  filename = (sal_obj->symtab == (symtab_object *) Py_None)? "<unknown>" :
-+                                         sal_obj->symtab->symtab->filename;
-+  ret = asprintf (&s, "symbol and line for %s, line %d", filename,
-+                sal_obj->sal->line);
-+  if (ret < 0)
-+    Py_RETURN_NONE;
-+
-+  result = PyString_FromString (s);
-+  xfree (s);
++  symbol_object *self_sym = (symbol_object *) self;
 +
-+  return result;
++  return PyString_FromString (SYMBOL_NATURAL_NAME (self_sym->symbol));
 +}
 +
 +static PyObject *
-+salpy_get_pc (PyObject *self, void *closure)
++sympy_get_linkage_name (PyObject *self, void *closure)
 +{
-+  return PyLong_FromUnsignedLongLong (((sal_object *) self)->sal->pc);
++  symbol_object *self_sym = (symbol_object *) self;
++
++  return PyString_FromString (SYMBOL_LINKAGE_NAME (self_sym->symbol));
 +}
 +
 +static PyObject *
-+salpy_get_line (PyObject *self, void *closure)
++sympy_get_print_name (PyObject *self, void *closure)
 +{
-+  return PyLong_FromUnsignedLongLong (((sal_object *) self)->sal->line);
++  symbol_object *self_sym = (symbol_object *) self;
++
++  return PyString_FromString (SYMBOL_PRINT_NAME (self_sym->symbol));
 +}
 +
 +static PyObject *
-+salpy_get_symtab (PyObject *self, void *closure)
++sympy_get_addr_class (PyObject *self, void *closure)
 +{
-+  sal_object *self_sal = (sal_object *) self;
++  symbol_object *self_sym = (symbol_object *) self;
 +
-+  Py_INCREF (self_sal->symtab);
++  return PyInt_FromLong (SYMBOL_CLASS (self_sym->symbol));
++}
 +
-+  return (PyObject *) self_sal->symtab;
++static PyObject *
++sympy_is_argument (PyObject *self, void *closure)
++{
++  symbol_object *self_sym = (symbol_object *) self;
++
++  return PyBool_FromLong (SYMBOL_IS_ARGUMENT (self_sym->symbol));
 +}
 +
-+static void 
-+salpy_dealloc (PyObject *self)
++static PyObject *
++sympy_is_constant (PyObject *self, void *closure)
 +{
-+  sal_object *self_sal = (sal_object *) self;
++  symbol_object *self_sym = (symbol_object *) self;
++  enum address_class class = SYMBOL_CLASS (self_sym->symbol);
 +
-+  Py_DECREF (self_sal->symtab);
-+  xfree (self_sal->sal);
-+  self_sal->ob_type->tp_free (self);
++  return PyBool_FromLong (class == LOC_CONST || class == LOC_CONST_BYTES);
++}
++
++static PyObject *
++sympy_is_function (PyObject *self, void *closure)
++{
++  symbol_object *self_sym = (symbol_object *) self;
++  enum address_class class = SYMBOL_CLASS (self_sym->symbol);
++
++  return PyBool_FromLong (class == LOC_BLOCK);
++}
++
++static PyObject *
++sympy_is_variable (PyObject *self, void *closure)
++{
++  symbol_object *self_sym = (symbol_object *) self;
++  enum address_class class = SYMBOL_CLASS (self_sym->symbol);
++
++  return PyBool_FromLong (!SYMBOL_IS_ARGUMENT (self_sym->symbol)
++      && (class == LOC_LOCAL || class == LOC_REGISTER || class == LOC_STATIC
++        || class == LOC_COMPUTED || class == LOC_OPTIMIZED_OUT));
 +}
 +
 +PyObject *
-+symtab_and_line_to_sal_object (struct symtab_and_line sal)
++symbol_to_symbol_object (struct symbol *sym)
 +{
-+  sal_object *sal_obj;
-+  symtab_object *symtab_obj;
++  symbol_object *sym_obj;
 +
-+  sal_obj = PyObject_New (sal_object, &sal_object_type);
-+  if (sal_obj == NULL)
++  sym_obj = PyObject_New (symbol_object, &symbol_object_type);
++  if (sym_obj == NULL)
 +    {
-+      PyErr_SetString (PyExc_MemoryError,
-+                     "Could not allocate Symtab_and_line object.");
++      PyErr_SetString (PyExc_MemoryError, "Could not allocate symbol object.");
 +      return NULL;
 +    }
 +
-+  if (sal.symtab)
-+    {
-+      symtab_obj = (symtab_object *) symtab_to_symtab_object (sal.symtab);
-+      if (symtab_obj == NULL)
-+      {
-+        Py_DECREF (sal_obj);
-+        return NULL;
-+      }
-+
-+      symtab_obj->symtab = sal.symtab;
-+    }
-+  else
-+    {
-+      symtab_obj = (symtab_object *) Py_None;
-+      Py_INCREF (Py_None);
-+    }
++  sym_obj->symbol = sym;
 +
-+  sal_obj->sal = (struct symtab_and_line *)
-+                                  xmalloc (sizeof (struct symtab_and_line));
-+  *(sal_obj->sal) = sal;
-+  sal_obj->symtab = symtab_obj;
++  return (PyObject *) sym_obj;
++}
 +
-+  return (PyObject *) sal_obj;
++struct symbol *
++symbol_object_to_symbol (PyObject *obj)
++{
++  if (! PyObject_TypeCheck (obj, &symbol_object_type))
++    return NULL;
++  return ((symbol_object *) obj)->symbol;
 +}
 +
-+PyObject *
-+symtab_to_symtab_object (struct symtab *symtab)
++/* Implementation of
++   gdb.lookup_symbol (name [, block] [, domain]) -> (symbol, is_field_of_this)
++   A tuple with 2 elements is always returned.  The first is the symbol
++   object or None, the second is a boolean with the value of
++   is_a_field_of_this (see comment in lookup_symbol_in_language).  */
++
++PyObject *gdbpy_lookup_symbol (PyObject *self, PyObject *args, PyObject *kw)
 +{
-+  symtab_object *symtab_obj;
-+  
-+  symtab_obj = PyObject_New (symtab_object, &symtab_object_type);
-+  if (symtab_obj == NULL)
++  int domain = VAR_DOMAIN, is_a_field_of_this = 0;
++  const char *name;
++  static char *keywords[] = { "name", "block", "domain", NULL };
++  struct symbol *symbol;
++  PyObject *block_obj = NULL, *ret_tuple, *sym_obj, *bool_obj;
++  struct block *block = NULL;
++
++  if (! PyArg_ParseTupleAndKeywords (args, kw, "s|O!i", keywords, &name,
++                                   &block_object_type, &block_obj, &domain))
++    return NULL;
++
++  if (block_obj)
++    block = block_object_to_block (block_obj);
++  else
 +    {
-+      PyErr_SetString (PyExc_MemoryError,
-+        "Could not allocate Symtab object.");
++      struct frame_info *selected_frame;
++      volatile struct gdb_exception except;
++
++      TRY_CATCH (except, RETURN_MASK_ALL)
++      {
++        selected_frame  = get_selected_frame (_("No frame selected."));
++        block = block_for_pc (get_frame_address_in_block (selected_frame));
++      }
++      GDB_PY_HANDLE_EXCEPTION (except);
++    }
++
++  symbol = lookup_symbol (name, block, domain, &is_a_field_of_this);
 +
++  ret_tuple = PyTuple_New (2);
++  if (!ret_tuple)
++    {
++      PyErr_SetString (PyExc_MemoryError, "Could not allocate tuple object.");
 +      return NULL;
 +    }
 +
-+  symtab_obj->symtab = symtab;
++  if (symbol)
++    {
++      sym_obj = symbol_to_symbol_object (symbol);
++      if (!sym_obj)
++      {
++        Py_DECREF (ret_tuple);
++        return NULL;
++      }
++    }
++  else
++    {
++      sym_obj = Py_None;
++      Py_INCREF (Py_None);
++    }
++  PyTuple_SET_ITEM (ret_tuple, 0, sym_obj);
 +
-+  return (PyObject *) symtab_obj;
++  bool_obj = is_a_field_of_this? Py_True : Py_False;
++  Py_INCREF (bool_obj);
++  PyTuple_SET_ITEM (ret_tuple, 1, bool_obj);
++
++  return ret_tuple;
 +}
 +
 +void
-+gdbpy_initialize_symtabs (void)
++gdbpy_initialize_symbols (void)
 +{
-+  symtab_object_type.tp_new = PyType_GenericNew;
-+  if (PyType_Ready (&symtab_object_type) < 0)
-+    return;
-+
-+  sal_object_type.tp_new = PyType_GenericNew;
-+  if (PyType_Ready (&sal_object_type) < 0)
++  if (PyType_Ready (&symbol_object_type) < 0)
 +    return;
 +
-+  Py_INCREF (&symtab_object_type);
-+  PyModule_AddObject (gdb_module, "Symtab", (PyObject *) &symtab_object_type);
++  /* FIXME: These would probably be best exposed as class attributes of Symbol,
++     but I don't know how to do it except by messing with the type's dictionary.
++     That seems too messy.  */
++  /* FIXME 2: Some of these were removed from GDB since I first wrote this code,
++     so it's probably a good idea not to expose them to Python.  */
++  PyModule_AddIntConstant (gdb_module, "SYMBOL_LOC_UNDEF", LOC_UNDEF);
++  PyModule_AddIntConstant (gdb_module, "SYMBOL_LOC_CONST", LOC_CONST);
++  PyModule_AddIntConstant (gdb_module, "SYMBOL_LOC_STATIC", LOC_STATIC);
++  PyModule_AddIntConstant (gdb_module, "SYMBOL_LOC_REGISTER", LOC_REGISTER);
++  PyModule_AddIntConstant (gdb_module, "SYMBOL_LOC_ARG", LOC_ARG);
++  PyModule_AddIntConstant (gdb_module, "SYMBOL_LOC_REF_ARG", LOC_REF_ARG);
++  PyModule_AddIntConstant (gdb_module, "SYMBOL_LOC_LOCAL", LOC_LOCAL);
++  PyModule_AddIntConstant (gdb_module, "SYMBOL_LOC_TYPEDEF", LOC_TYPEDEF);
++  PyModule_AddIntConstant (gdb_module, "SYMBOL_LOC_LABEL", LOC_LABEL);
++  PyModule_AddIntConstant (gdb_module, "SYMBOL_LOC_BLOCK", LOC_BLOCK);
++  PyModule_AddIntConstant (gdb_module, "SYMBOL_LOC_CONST_BYTES",
++                         LOC_CONST_BYTES);
++  PyModule_AddIntConstant (gdb_module, "SYMBOL_LOC_UNRESOLVED", LOC_UNRESOLVED);
++  PyModule_AddIntConstant (gdb_module, "SYMBOL_LOC_OPTIMIZED_OUT",
++                         LOC_OPTIMIZED_OUT);
++  PyModule_AddIntConstant (gdb_module, "SYMBOL_LOC_COMPUTED", LOC_COMPUTED);
++  PyModule_AddIntConstant (gdb_module, "SYMBOL_LOC_REGPARM_ADDR",
++                         LOC_REGPARM_ADDR);
++  PyModule_AddIntConstant (gdb_module, "SYMBOL_UNDEF_DOMAIN", UNDEF_DOMAIN);
++  PyModule_AddIntConstant (gdb_module, "SYMBOL_VAR_DOMAIN", VAR_DOMAIN);
++  PyModule_AddIntConstant (gdb_module, "SYMBOL_STRUCT_DOMAIN", STRUCT_DOMAIN);
++  PyModule_AddIntConstant (gdb_module, "SYMBOL_LABEL_DOMAIN", LABEL_DOMAIN);
++  PyModule_AddIntConstant (gdb_module, "SYMBOL_VARIABLES_DOMAIN",
++                         VARIABLES_DOMAIN);
++  PyModule_AddIntConstant (gdb_module, "SYMBOL_FUNCTIONS_DOMAIN",
++                         FUNCTIONS_DOMAIN);
++  PyModule_AddIntConstant (gdb_module, "SYMBOL_TYPES_DOMAIN", TYPES_DOMAIN);
 +
-+  Py_INCREF (&sal_object_type);
-+  PyModule_AddObject (gdb_module, "Symtab_and_line",
-+                    (PyObject *) &sal_object_type);
++  Py_INCREF (&symbol_object_type);
++  PyModule_AddObject (gdb_module, "Symbol", (PyObject *) &symbol_object_type);
 +}
 +
 +\f
 +
-+static PyGetSetDef symtab_object_getset[] = {
-+  { "filename", stpy_get_filename, NULL,
-+    "The symbol table's source filename.", NULL },
-+  {NULL}  /* Sentinel */
-+};
-+
-+static PyMethodDef symtab_object_methods[] = {
-+  { "fullname", stpy_fullname, METH_NOARGS,
-+    "Return the symtab's full source filename." },
-+  {NULL}  /* Sentinel */
++static PyGetSetDef symbol_object_getset[] = {
++  { "value", sympy_get_value, NULL, "Value of the symbol.", NULL },
++  { "symtab", sympy_get_symtab, NULL,
++    "Symbol table in which the symbol appears.", NULL },
++  { "name", sympy_get_name, NULL,
++    "Name of the symbol, as it appears in the source code.", NULL },
++  { "linkage_name", sympy_get_linkage_name, NULL,
++    "Name of the symbol, as used by the linker (i.e., may be mangled).", NULL },
++  { "print_name", sympy_get_print_name, NULL,
++    "Name of the symbol in a form suitable for output.\n\
++This is either name or linkage_name, depending on whether the user asked GDB\n\
++to display demangled or mangled names.", NULL },
++  { "addr_class", sympy_get_addr_class, NULL, "Address class of the symbol." },
++  { "is_argument", sympy_is_argument, NULL,
++    "True if the symbol is an argument of a function." },
++  { "is_constant", sympy_is_constant, NULL,
++    "True if the symbol is a constant." },
++  { "is_function", sympy_is_function, NULL,
++    "True if the symbol is a function or method." },
++  { "is_variable", sympy_is_variable, NULL,
++    "True if the symbol is a variable." },
++  { NULL }  /* Sentinel */
 +};
 +
-+static PyTypeObject symtab_object_type = {
++PyTypeObject symbol_object_type = {
 +  PyObject_HEAD_INIT (NULL)
 +  0,                            /*ob_size*/
-+  "gdb.Symtab",                         /*tp_name*/
-+  sizeof (symtab_object),       /*tp_basicsize*/
++  "gdb.Symbol",                         /*tp_name*/
++  sizeof (symbol_object),       /*tp_basicsize*/
 +  0,                            /*tp_itemsize*/
 +  0,                            /*tp_dealloc*/
 +  0,                            /*tp_print*/
@@ -29154,54 +17299,12 @@ index 0000000..a48c38c
 +  0,                            /*tp_as_mapping*/
 +  0,                            /*tp_hash */
 +  0,                            /*tp_call*/
-+  stpy_str,                     /*tp_str*/
++  sympy_str,                    /*tp_str*/
 +  0,                            /*tp_getattro*/
 +  0,                            /*tp_setattro*/
 +  0,                            /*tp_as_buffer*/
 +  Py_TPFLAGS_DEFAULT,           /*tp_flags*/
-+  "GDB symtab object",                  /* tp_doc */
-+  0,                            /* tp_traverse */
-+  0,                            /* tp_clear */
-+  0,                            /* tp_richcompare */
-+  0,                            /* tp_weaklistoffset */
-+  0,                            /* tp_iter */
-+  0,                            /* tp_iternext */
-+  symtab_object_methods,        /* tp_methods */
-+  0,                            /* tp_members */
-+  symtab_object_getset                  /* tp_getset */
-+};
-+
-+static PyGetSetDef sal_object_getset[] = {
-+  { "symtab", salpy_get_symtab, NULL, "Symtab object.", NULL },
-+  { "pc", salpy_get_pc, NULL, "Return the symtab_and_line's pc.", NULL },
-+  { "line", salpy_get_line, NULL,
-+    "Return the symtab_and_line's line.", NULL },
-+  {NULL}  /* Sentinel */
-+};
-+
-+static PyTypeObject sal_object_type = {
-+  PyObject_HEAD_INIT (NULL)
-+  0,                            /*ob_size*/
-+  "gdb.Symtab_and_line",        /*tp_name*/
-+  sizeof (sal_object),                  /*tp_basicsize*/
-+  0,                            /*tp_itemsize*/
-+  salpy_dealloc,                /*tp_dealloc*/
-+  0,                            /*tp_print*/
-+  0,                            /*tp_getattr*/
-+  0,                            /*tp_setattr*/
-+  0,                            /*tp_compare*/
-+  0,                            /*tp_repr*/
-+  0,                            /*tp_as_number*/
-+  0,                            /*tp_as_sequence*/
-+  0,                            /*tp_as_mapping*/
-+  0,                            /*tp_hash */
-+  0,                            /*tp_call*/
-+  salpy_str,                    /*tp_str*/
-+  0,                            /*tp_getattro*/
-+  0,                            /*tp_setattro*/
-+  0,                            /*tp_as_buffer*/
-+  Py_TPFLAGS_DEFAULT,           /*tp_flags*/
-+  "GDB symtab_and_line object",         /* tp_doc */
++  "GDB symbol object",                  /* tp_doc */
 +  0,                            /* tp_traverse */
 +  0,                            /* tp_clear */
 +  0,                            /* tp_richcompare */
@@ -29210,15 +17313,15 @@ index 0000000..a48c38c
 +  0,                            /* tp_iternext */
 +  0,                            /* tp_methods */
 +  0,                            /* tp_members */
-+  sal_object_getset             /* tp_getset */
++  symbol_object_getset                  /* tp_getset */
 +};
-diff --git a/gdb/python/python-type.c b/gdb/python/python-type.c
+diff --git a/gdb/python/py-symtab.c b/gdb/python/py-symtab.c
 new file mode 100644
-index 0000000..772a011
+index 0000000..830e586
 --- /dev/null
-+++ b/gdb/python/python-type.c
-@@ -0,0 +1,821 @@
-+/* Python interface to types.
++++ b/gdb/python/py-symtab.c
+@@ -0,0 +1,322 @@
++/* Python interface to symbol tables.
 +
 +   Copyright (C) 2008, 2009 Free Software Foundation, Inc.
 +
@@ -29238,424 +17341,409 @@ index 0000000..772a011
 +   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 +
 +#include "defs.h"
-+#include "value.h"
-+#include "exceptions.h"
-+#include "python-internal.h"
 +#include "charset.h"
-+#include "gdbtypes.h"
-+#include "cp-support.h"
-+#include "demangle.h"
-+#include "objfiles.h"
-+#include "gdb_assert.h"
++#include "symtab.h"
++#include "source.h"
++#include "python-internal.h"
 +
-+typedef struct pyty_type_object
-+{
++typedef struct {
 +  PyObject_HEAD
-+  struct type *type;
-+
-+  /* 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
-+     underlying struct type when the objfile is deleted.  */
-+  struct pyty_type_object *prev;
-+  struct pyty_type_object *next;
-+} type_object;
++  struct symtab *symtab;
++} symtab_object;
 +
-+static PyTypeObject type_object_type;
++static PyTypeObject symtab_object_type;
 +
-+/* A Field object.  */
-+typedef struct pyty_field_object
-+{
++typedef struct {
 +  PyObject_HEAD
++  symtab_object *symtab;
++  struct symtab_and_line *sal;
++} sal_object;
 +
-+  /* Dictionary holding our attributes.  */
-+  PyObject *dict;
-+} field_object;
++static PyTypeObject sal_object_type;
 +
-+static PyTypeObject field_object_type;
 +
-+/* This is used to initialize various gdb.TYPE_ constants.  */
-+struct pyty_code
++static PyObject *
++stpy_str (PyObject *self)
 +{
-+  /* The code.  */
-+  enum type_code code;
-+  /* The name.  */
-+  const char *name;
-+};
++  int ret;
++  char *s;
++  PyObject *result;
 +
-+#define ENTRY(X) { X, #X }
-+
-+static struct pyty_code pyty_codes[] =
-+{
-+  ENTRY (TYPE_CODE_PTR),
-+  ENTRY (TYPE_CODE_ARRAY),
-+  ENTRY (TYPE_CODE_STRUCT),
-+  ENTRY (TYPE_CODE_UNION),
-+  ENTRY (TYPE_CODE_ENUM),
-+  ENTRY (TYPE_CODE_FLAGS),
-+  ENTRY (TYPE_CODE_FUNC),
-+  ENTRY (TYPE_CODE_INT),
-+  ENTRY (TYPE_CODE_FLT),
-+  ENTRY (TYPE_CODE_VOID),
-+  ENTRY (TYPE_CODE_SET),
-+  ENTRY (TYPE_CODE_RANGE),
-+  ENTRY (TYPE_CODE_STRING),
-+  ENTRY (TYPE_CODE_BITSTRING),
-+  ENTRY (TYPE_CODE_ERROR),
-+  ENTRY (TYPE_CODE_METHOD),
-+  ENTRY (TYPE_CODE_METHODPTR),
-+  ENTRY (TYPE_CODE_MEMBERPTR),
-+  ENTRY (TYPE_CODE_REF),
-+  ENTRY (TYPE_CODE_CHAR),
-+  ENTRY (TYPE_CODE_BOOL),
-+  ENTRY (TYPE_CODE_COMPLEX),
-+  ENTRY (TYPE_CODE_TYPEDEF),
-+  ENTRY (TYPE_CODE_TEMPLATE),
-+  ENTRY (TYPE_CODE_TEMPLATE_ARG),
-+  ENTRY (TYPE_CODE_NAMESPACE),
-+  ENTRY (TYPE_CODE_DECFLOAT),
-+  ENTRY (TYPE_CODE_INTERNAL_FUNCTION),
-+  { TYPE_CODE_UNDEF, NULL }
-+};
++  ret = asprintf (&s, "symbol table for %s",
++                ((symtab_object *) self)->symtab->filename);
++  if (ret < 0)
++    Py_RETURN_NONE;
 +
-+\f
++  result = PyString_FromString (s);
++  xfree (s);
 +
-+static void
-+field_dealloc (PyObject *obj)
-+{
-+  field_object *f = (field_object *) obj;
-+  Py_XDECREF (f->dict);
++  return result;
 +}
 +
 +static PyObject *
-+field_new (void)
++stpy_get_filename (PyObject *self, void *closure)
 +{
-+  field_object *result = PyObject_New (field_object, &field_object_type);
-+  if (result)
++  symtab_object *self_symtab = (symtab_object *) self;
++  PyObject *str_obj;
++
++  /* FIXME: Can symtab->filename really be NULL?  */
++  if (self_symtab->symtab->filename)
++    str_obj = PyString_Decode (self_symtab->symtab->filename,
++                             strlen (self_symtab->symtab->filename),
++                             host_charset (), NULL);
++  else
 +    {
-+      result->dict = PyDict_New ();
-+      if (!result->dict)
-+      {
-+        Py_DECREF (result);
-+        result = NULL;
-+      }
++      str_obj = Py_None;
++      Py_INCREF (Py_None);
 +    }
-+  return (PyObject *) result;
-+}
 +
-+\f
++  return str_obj;
++}
 +
-+/* Return the code for this type.  */
 +static PyObject *
-+typy_code (PyObject *self, PyObject *args)
++stpy_get_objfile (PyObject *self, void *closure)
 +{
-+  struct type *type = ((type_object *) self)->type;
-+  return PyInt_FromLong (TYPE_CODE (type));
++  symtab_object *self_symtab = (symtab_object *) self;
++  PyObject *result = objfile_to_objfile_object (self_symtab->symtab->objfile);
++  Py_INCREF (result);
++  return result;
 +}
 +
-+/* Helper function for typy_fields which converts a single field to a
-+   dictionary.  Returns NULL on error.  */
 +static PyObject *
-+convert_field (struct type *type, int field)
++stpy_fullname (PyObject *self, PyObject *args)
 +{
-+  PyObject *result = field_new ();
-+  PyObject *arg;
-+
-+  if (!result)
-+    return NULL;
-+
-+  if (!field_is_static (&TYPE_FIELD (type, field)))
-+    {
-+      arg = PyLong_FromLong (TYPE_FIELD_BITPOS (type, field));
-+      if (!arg)
-+      goto fail;
-+
-+      if (PyObject_SetAttrString (result, "bitpos", arg) < 0)
-+      goto failarg;
-+    }
-+
-+  if (TYPE_FIELD_NAME (type, field))
-+    arg = PyString_FromString (TYPE_FIELD_NAME (type, field));
-+  else
-+    {
-+      arg = Py_None;
-+      Py_INCREF (arg);
-+    }
-+  if (!arg)
-+    goto fail;
-+  if (PyObject_SetAttrString (result, "name", arg) < 0)
-+    goto failarg;
-+
-+  arg = TYPE_FIELD_ARTIFICIAL (type, field) ? Py_True : Py_False;
-+  Py_INCREF (arg);
-+  if (PyObject_SetAttrString (result, "artificial", arg) < 0)
-+    goto failarg;
-+
-+  arg = PyLong_FromLong (TYPE_FIELD_BITSIZE (type, field));
-+  if (!arg)
-+    goto fail;
-+  if (PyObject_SetAttrString (result, "bitsize", arg) < 0)
-+    goto failarg;
-+
-+  arg = type_to_type_object (TYPE_FIELD_TYPE (type, field));
-+  if (!arg)
-+    goto fail;
-+  if (PyObject_SetAttrString (result, "type", arg) < 0)
-+    goto failarg;
++  char *fullname;
 +
-+  return result;
++  fullname = symtab_to_fullname (((symtab_object *) self)->symtab);
++  if (fullname)
++    return PyString_Decode (fullname, strlen (fullname), host_charset (), NULL);
 +
-+ failarg:
-+  Py_DECREF (arg);
-+ fail:
-+  Py_DECREF (result);
-+  return NULL;
++  Py_RETURN_NONE;
 +}
 +
-+/* Return a sequence of all fields.  Each field is a dictionary with
-+   some pre-defined keys.  */
 +static PyObject *
-+typy_fields (PyObject *self, PyObject *args)
++salpy_str (PyObject *self)
 +{
++  int ret;
++  char *s, *filename;
++  sal_object *sal_obj;
 +  PyObject *result;
-+  int i;
-+  struct type *type = ((type_object *) self)->type;
 +
-+  /* We would like to make a tuple here, make fields immutable, and
-+     then memoize the result (and perhaps make Field.type() lazy).
-+     However, that can lead to cycles.  */
-+  result = PyList_New (0);
++  sal_obj = (sal_object *) self;
++  filename = (sal_obj->symtab == (symtab_object *) Py_None)? "<unknown>" :
++                                         sal_obj->symtab->symtab->filename;
++  ret = asprintf (&s, "symbol and line for %s, line %d", filename,
++                sal_obj->sal->line);
++  if (ret < 0)
++    Py_RETURN_NONE;
 +
-+  for (i = 0; i < TYPE_NFIELDS (type); ++i)
-+    {
-+      PyObject *dict = convert_field (type, i);
-+      if (!dict)
-+      {
-+        Py_DECREF (result);
-+        return NULL;
-+      }
-+      if (PyList_Append (result, dict))
-+      {
-+        Py_DECREF (dict);
-+        Py_DECREF (result);
-+        return NULL;
-+      }
-+    }
++  result = PyString_FromString (s);
++  xfree (s);
 +
 +  return result;
 +}
 +
-+/* Return the type's tag, or None.  */
 +static PyObject *
-+typy_tag (PyObject *self, PyObject *args)
++salpy_get_pc (PyObject *self, void *closure)
 +{
-+  struct type *type = ((type_object *) self)->type;
-+  if (!TYPE_TAG_NAME (type))
-+    Py_RETURN_NONE;
-+  return PyString_FromString (TYPE_TAG_NAME (type));
++  return PyLong_FromUnsignedLongLong (((sal_object *) self)->sal->pc);
 +}
 +
-+/* Return the type, stripped of typedefs. */
 +static PyObject *
-+typy_strip_typedefs (PyObject *self, PyObject *args)
++salpy_get_line (PyObject *self, void *closure)
 +{
-+  struct type *type = ((type_object *) self)->type;
-+
-+  return type_to_type_object (check_typedef (type));
++  return PyLong_FromUnsignedLongLong (((sal_object *) self)->sal->line);
 +}
 +
-+/* Return a Type object which represents a pointer to SELF.  */
 +static PyObject *
-+typy_pointer (PyObject *self, PyObject *args)
++salpy_get_symtab (PyObject *self, void *closure)
 +{
-+  struct type *type = ((type_object *) self)->type;
-+  volatile struct gdb_exception except;
++  sal_object *self_sal = (sal_object *) self;
 +
-+  TRY_CATCH (except, RETURN_MASK_ALL)
-+    {
-+      type = lookup_pointer_type (type);
-+    }
-+  GDB_PY_HANDLE_EXCEPTION (except);
++  Py_INCREF (self_sal->symtab);
 +
-+  return type_to_type_object (type);
++  return (PyObject *) self_sal->symtab;
 +}
 +
-+/* Return a Type object which represents a reference to SELF.  */
-+static PyObject *
-+typy_reference (PyObject *self, PyObject *args)
++static void 
++salpy_dealloc (PyObject *self)
 +{
-+  struct type *type = ((type_object *) self)->type;
-+  volatile struct gdb_exception except;
-+
-+  TRY_CATCH (except, RETURN_MASK_ALL)
-+    {
-+      type = lookup_reference_type (type);
-+    }
-+  GDB_PY_HANDLE_EXCEPTION (except);
++  sal_object *self_sal = (sal_object *) self;
 +
-+  return type_to_type_object (type);
++  Py_DECREF (self_sal->symtab);
++  xfree (self_sal->sal);
++  self_sal->ob_type->tp_free (self);
 +}
 +
-+/* Return a Type object which represents the target type of SELF.  */
-+static PyObject *
-+typy_target (PyObject *self, PyObject *args)
++PyObject *
++symtab_and_line_to_sal_object (struct symtab_and_line sal)
 +{
-+  struct type *type = ((type_object *) self)->type;
++  sal_object *sal_obj;
++  symtab_object *symtab_obj;
 +
-+  if (!TYPE_TARGET_TYPE (type))
++  sal_obj = PyObject_New (sal_object, &sal_object_type);
++  if (sal_obj == NULL)
 +    {
-+      PyErr_SetString (PyExc_RuntimeError, "type does not have a target");
++      PyErr_SetString (PyExc_MemoryError,
++                     "Could not allocate Symtab_and_line object.");
 +      return NULL;
 +    }
 +
-+  return type_to_type_object (TYPE_TARGET_TYPE (type));
-+}
-+
-+/* Return a const-qualified type variant.  */
-+static PyObject *
-+typy_const (PyObject *self, PyObject *args)
-+{
-+  struct type *type = ((type_object *) self)->type;
-+  volatile struct gdb_exception except;
++  if (sal.symtab)
++    {
++      symtab_obj = (symtab_object *) symtab_to_symtab_object (sal.symtab);
++      if (symtab_obj == NULL)
++      {
++        Py_DECREF (sal_obj);
++        return NULL;
++      }
 +
-+  TRY_CATCH (except, RETURN_MASK_ALL)
++      symtab_obj->symtab = sal.symtab;
++    }
++  else
 +    {
-+      type = make_cv_type (1, 0, type, NULL);
++      symtab_obj = (symtab_object *) Py_None;
++      Py_INCREF (Py_None);
 +    }
-+  GDB_PY_HANDLE_EXCEPTION (except);
 +
-+  return type_to_type_object (type);
++  sal_obj->sal = (struct symtab_and_line *)
++                                  xmalloc (sizeof (struct symtab_and_line));
++  *(sal_obj->sal) = sal;
++  sal_obj->symtab = symtab_obj;
++
++  return (PyObject *) sal_obj;
 +}
 +
-+/* Return a volatile-qualified type variant.  */
-+static PyObject *
-+typy_volatile (PyObject *self, PyObject *args)
++PyObject *
++symtab_to_symtab_object (struct symtab *symtab)
 +{
-+  struct type *type = ((type_object *) self)->type;
-+  volatile struct gdb_exception except;
-+
-+  TRY_CATCH (except, RETURN_MASK_ALL)
++  symtab_object *symtab_obj;
++  
++  symtab_obj = PyObject_New (symtab_object, &symtab_object_type);
++  if (symtab_obj == NULL)
 +    {
-+      type = make_cv_type (0, 1, type, NULL);
++      PyErr_SetString (PyExc_MemoryError,
++        "Could not allocate Symtab object.");
++
++      return NULL;
 +    }
-+  GDB_PY_HANDLE_EXCEPTION (except);
 +
-+  return type_to_type_object (type);
++  symtab_obj->symtab = symtab;
++
++  return (PyObject *) symtab_obj;
 +}
 +
-+/* Return an unqualified type variant.  */
-+static PyObject *
-+typy_unqualified (PyObject *self, PyObject *args)
++void
++gdbpy_initialize_symtabs (void)
 +{
-+  struct type *type = ((type_object *) self)->type;
-+  volatile struct gdb_exception except;
++  symtab_object_type.tp_new = PyType_GenericNew;
++  if (PyType_Ready (&symtab_object_type) < 0)
++    return;
 +
-+  TRY_CATCH (except, RETURN_MASK_ALL)
-+    {
-+      type = make_cv_type (0, 0, type, NULL);
-+    }
-+  GDB_PY_HANDLE_EXCEPTION (except);
++  sal_object_type.tp_new = PyType_GenericNew;
++  if (PyType_Ready (&sal_object_type) < 0)
++    return;
++
++  Py_INCREF (&symtab_object_type);
++  PyModule_AddObject (gdb_module, "Symtab", (PyObject *) &symtab_object_type);
 +
-+  return type_to_type_object (type);
++  Py_INCREF (&sal_object_type);
++  PyModule_AddObject (gdb_module, "Symtab_and_line",
++                    (PyObject *) &sal_object_type);
 +}
 +
-+/* Return the size of the type represented by SELF, in bytes.  */
-+static PyObject *
-+typy_sizeof (PyObject *self, PyObject *args)
-+{
-+  struct type *type = ((type_object *) self)->type;
-+  volatile struct gdb_exception except;
-+
-+  TRY_CATCH (except, RETURN_MASK_ALL)
-+    {
-+      CHECK_TYPEDEF (type);
-+    }
-+  GDB_PY_HANDLE_EXCEPTION (except);
++\f
 +
-+  return PyLong_FromLong (TYPE_LENGTH (type));
-+}
++static PyGetSetDef symtab_object_getset[] = {
++  { "filename", stpy_get_filename, NULL,
++    "The symbol table's source filename.", NULL },
++  { "objfile", stpy_get_objfile, NULL, "The symtab's objfile.",
++    NULL },
++  {NULL}  /* Sentinel */
++};
 +
-+static struct type *
-+typy_lookup_typename (char *type_name, struct block *block)
-+{
-+  struct type *type = NULL;
-+  volatile struct gdb_exception except;
-+  TRY_CATCH (except, RETURN_MASK_ALL)
-+    {
-+      if (!strncmp (type_name, "struct ", 7))
-+      type = lookup_struct (type_name + 7, block);
-+      else if (!strncmp (type_name, "union ", 6))
-+      type = lookup_union (type_name + 6, block);
-+      else if (!strncmp (type_name, "enum ", 5))
-+      type = lookup_enum (type_name + 5, block);
-+      else
-+      type = lookup_typename (type_name, block, 0);
-+    }
-+  if (except.reason < 0)
-+    {
-+      PyErr_Format (except.reason == RETURN_QUIT
-+                  ? PyExc_KeyboardInterrupt : PyExc_RuntimeError,
-+                  "%s", except.message);
-+      return NULL;
-+    }
++static PyMethodDef symtab_object_methods[] = {
++  { "fullname", stpy_fullname, METH_NOARGS,
++    "Return the symtab's full source filename." },
++  {NULL}  /* Sentinel */
++};
 +
-+  return type;
-+}
++static PyTypeObject symtab_object_type = {
++  PyObject_HEAD_INIT (NULL)
++  0,                            /*ob_size*/
++  "gdb.Symtab",                         /*tp_name*/
++  sizeof (symtab_object),       /*tp_basicsize*/
++  0,                            /*tp_itemsize*/
++  0,                            /*tp_dealloc*/
++  0,                            /*tp_print*/
++  0,                            /*tp_getattr*/
++  0,                            /*tp_setattr*/
++  0,                            /*tp_compare*/
++  0,                            /*tp_repr*/
++  0,                            /*tp_as_number*/
++  0,                            /*tp_as_sequence*/
++  0,                            /*tp_as_mapping*/
++  0,                            /*tp_hash */
++  0,                            /*tp_call*/
++  stpy_str,                     /*tp_str*/
++  0,                            /*tp_getattro*/
++  0,                            /*tp_setattro*/
++  0,                            /*tp_as_buffer*/
++  Py_TPFLAGS_DEFAULT,           /*tp_flags*/
++  "GDB symtab object",                  /* tp_doc */
++  0,                            /* tp_traverse */
++  0,                            /* tp_clear */
++  0,                            /* tp_richcompare */
++  0,                            /* tp_weaklistoffset */
++  0,                            /* tp_iter */
++  0,                            /* tp_iternext */
++  symtab_object_methods,        /* tp_methods */
++  0,                            /* tp_members */
++  symtab_object_getset                  /* tp_getset */
++};
 +
-+static struct type *
-+typy_lookup_type (struct demangle_component *demangled,
-+                struct block *block)
-+{
-+  struct type *type;
-+  char *type_name;
-+  enum demangle_component_type demangled_type;
++static PyGetSetDef sal_object_getset[] = {
++  { "symtab", salpy_get_symtab, NULL, "Symtab object.", NULL },
++  { "pc", salpy_get_pc, NULL, "Return the symtab_and_line's pc.", NULL },
++  { "line", salpy_get_line, NULL,
++    "Return the symtab_and_line's line.", NULL },
++  {NULL}  /* Sentinel */
++};
 +
-+  /* Save the type: typy_lookup_type() may (indirectly) overwrite
-+     memory pointed by demangled.  */
-+  demangled_type = demangled->type;
++static PyTypeObject sal_object_type = {
++  PyObject_HEAD_INIT (NULL)
++  0,                            /*ob_size*/
++  "gdb.Symtab_and_line",        /*tp_name*/
++  sizeof (sal_object),                  /*tp_basicsize*/
++  0,                            /*tp_itemsize*/
++  salpy_dealloc,                /*tp_dealloc*/
++  0,                            /*tp_print*/
++  0,                            /*tp_getattr*/
++  0,                            /*tp_setattr*/
++  0,                            /*tp_compare*/
++  0,                            /*tp_repr*/
++  0,                            /*tp_as_number*/
++  0,                            /*tp_as_sequence*/
++  0,                            /*tp_as_mapping*/
++  0,                            /*tp_hash */
++  0,                            /*tp_call*/
++  salpy_str,                    /*tp_str*/
++  0,                            /*tp_getattro*/
++  0,                            /*tp_setattro*/
++  0,                            /*tp_as_buffer*/
++  Py_TPFLAGS_DEFAULT,           /*tp_flags*/
++  "GDB symtab_and_line object",         /* tp_doc */
++  0,                            /* tp_traverse */
++  0,                            /* tp_clear */
++  0,                            /* tp_richcompare */
++  0,                            /* tp_weaklistoffset */
++  0,                            /* tp_iter */
++  0,                            /* tp_iternext */
++  0,                            /* tp_methods */
++  0,                            /* tp_members */
++  sal_object_getset             /* tp_getset */
++};
+diff --git a/gdb/python/py-type.c b/gdb/python/py-type.c
+index 590d90a..f512248 100644
+--- a/gdb/python/py-type.c
++++ b/gdb/python/py-type.c
+@@ -27,6 +27,8 @@
+ #include "demangle.h"
+ #include "objfiles.h"
+ #include "language.h"
++#include "observer.h"
++#include "gdb_assert.h"
+ typedef struct pyty_type_object
+ {
+@@ -35,11 +37,17 @@ 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
+-     underlying struct type when the objfile is deleted.  */
++     underlying struct type when the objfile is deleted.
 +
-+  if (demangled_type == DEMANGLE_COMPONENT_POINTER
-+      || demangled_type == DEMANGLE_COMPONENT_REFERENCE
-+      || demangled_type == DEMANGLE_COMPONENT_CONST
-+      || demangled_type == DEMANGLE_COMPONENT_VOLATILE)
-+    {
-+      type = typy_lookup_type (demangled->u.s_binary.left, block);
-+      if (! type)
-+      return NULL;
++     With NULL objfile Type still can be doubly-linked in the list
++     PYTY_OBJECTS_DISCARDABLE.  */
+   struct pyty_type_object *prev;
+   struct pyty_type_object *next;
+ } type_object;
++/* First element of a doubly-linked list of TYPE_DISCARDABLE Types.  */
++static type_object *pyty_objects_discardable;
 +
-+      switch (demangled_type)
-+      {
-+      case DEMANGLE_COMPONENT_REFERENCE:
-+        return lookup_reference_type (type);
-+      case DEMANGLE_COMPONENT_POINTER:
-+        return lookup_pointer_type (type);
-+      case DEMANGLE_COMPONENT_CONST:
-+        return make_cv_type (1, 0, type, NULL);
-+      case DEMANGLE_COMPONENT_VOLATILE:
-+        return make_cv_type (0, 1, type, NULL);
-+      }
-+    }
+ static PyTypeObject type_object_type;
+ /* A Field object.  */
+@@ -169,6 +177,11 @@ convert_field (struct type *type, int field)
+   if (PyObject_SetAttrString (result, "artificial", arg) < 0)
+     goto failarg;
++  arg = field < TYPE_N_BASECLASSES (type) ? Py_True : Py_False;
++  Py_INCREF (arg);
++  if (PyObject_SetAttrString (result, "is_base_class", arg) < 0)
++    goto failarg;
 +
-+  type_name = cp_comp_to_string (demangled, 10);
+   arg = PyLong_FromLong (TYPE_FIELD_BITSIZE (type, field));
+   if (!arg)
+     goto fail;
+@@ -361,7 +374,7 @@ typy_get_sizeof (PyObject *self, void *closure)
+ }
+ static struct type *
+-typy_lookup_typename (char *type_name)
++typy_lookup_typename (char *type_name, struct block *block)
+ {
+   struct type *type = NULL;
+   volatile struct gdb_exception except;
+@@ -375,7 +388,7 @@ typy_lookup_typename (char *type_name)
+       type = lookup_enum (type_name + 5, NULL);
+       else
+       type = lookup_typename (python_language, python_gdbarch,
+-                              type_name, NULL, 0);
++                              type_name, block, 0);
+     }
+   if (except.reason < 0)
+     {
+@@ -389,7 +402,8 @@ typy_lookup_typename (char *type_name)
+ }
+ static struct type *
+-typy_lookup_type (struct demangle_component *demangled)
++typy_lookup_type (struct demangle_component *demangled,
++                struct block *block)
+ {
+   struct type *type;
+   char *type_name;
+@@ -404,7 +418,7 @@ typy_lookup_type (struct demangle_component *demangled)
+       || demangled_type == DEMANGLE_COMPONENT_CONST
+       || demangled_type == DEMANGLE_COMPONENT_VOLATILE)
+     {
+-      type = typy_lookup_type (demangled->u.s_binary.left);
++      type = typy_lookup_type (demangled->u.s_binary.left, block);
+       if (! type)
+       return NULL;
+@@ -422,7 +436,7 @@ typy_lookup_type (struct demangle_component *demangled)
+     }
+   type_name = cp_comp_to_string (demangled, 10);
+-  type = typy_lookup_typename (type_name);
 +  type = typy_lookup_typename (type_name, block);
-+  xfree (type_name);
-+
-+  return type;
-+}
-+
-+static PyObject *
-+typy_template_argument (PyObject *self, PyObject *args)
-+{
-+  int i, argno, n_pointers;
-+  struct type *type = ((type_object *) self)->type;
-+  struct demangle_component *demangled;
-+  const char *err;
-+  struct type *argtype;
+   xfree (type_name);
+   return type;
+@@ -436,10 +450,23 @@ typy_template_argument (PyObject *self, PyObject *args)
+   struct demangle_component *demangled;
+   const char *err;
+   struct type *argtype;
 +  struct block *block = NULL;
 +  PyObject *block_obj = NULL;
-+
+-  if (! PyArg_ParseTuple (args, "i", &argno))
 +  if (! PyArg_ParseTuple (args, "i|O", &argno, &block_obj))
-+    return NULL;
-+
+     return NULL;
 +  if (block_obj)
 +    {
 +      block = block_object_to_block (block_obj);
@@ -29667,382 +17755,207 @@ index 0000000..772a011
 +      }
 +    }
 +
-+  type = check_typedef (type);
-+  if (TYPE_CODE (type) == TYPE_CODE_REF)
-+    type = check_typedef (TYPE_TARGET_TYPE (type));
-+
-+  if (TYPE_NAME (type) == NULL)
-+    {
-+      PyErr_SetString (PyExc_RuntimeError, "null type name");
-+      return NULL;
-+    }
-+
-+  /* Note -- this is not thread-safe.  */
-+  demangled = cp_demangled_name_to_comp (TYPE_NAME (type), &err);
-+  if (! demangled)
-+    {
-+      PyErr_SetString (PyExc_RuntimeError, err);
-+      return NULL;
-+    }
-+
-+  /* Strip off component names.  */
-+  while (demangled->type == DEMANGLE_COMPONENT_QUAL_NAME
-+       || demangled->type == DEMANGLE_COMPONENT_LOCAL_NAME)
-+    demangled = demangled->u.s_binary.right;
-+
-+  if (demangled->type != DEMANGLE_COMPONENT_TEMPLATE)
-+    {
-+      PyErr_SetString (PyExc_RuntimeError, "type is not a template");
-+      return NULL;
-+    }
-+
-+  /* Skip from the template to the arguments.  */
-+  demangled = demangled->u.s_binary.right;
-+
-+  for (i = 0; demangled && i < argno; ++i)
-+    demangled = demangled->u.s_binary.right;
-+
-+  if (! demangled)
-+    {
-+      PyErr_Format (PyExc_RuntimeError, "no argument %d in template",
-+                  argno);
-+      return NULL;
-+    }
-+
+   type = check_typedef (type);
+   if (TYPE_CODE (type) == TYPE_CODE_REF)
+     type = check_typedef (TYPE_TARGET_TYPE (type));
+@@ -482,7 +509,7 @@ typy_template_argument (PyObject *self, PyObject *args)
+       return NULL;
+     }
+-  argtype = typy_lookup_type (demangled->u.s_binary.left);
 +  argtype = typy_lookup_type (demangled->u.s_binary.left, block);
-+  if (! argtype)
-+    return NULL;
-+
-+  return type_to_type_object (argtype);
-+}
-+
-+static PyObject *
-+typy_str (PyObject *self)
+   if (! argtype)
+     return NULL;
+@@ -524,8 +551,59 @@ typy_str (PyObject *self)
\f
++/* Key associated with each objfile pointing to the first element of
++   a doubly-linked list of Types associated with this objfile.  */
+ static const struct objfile_data *typy_objfile_data_key;
++/* Link TYPE_OBJ to its appropriate list.  Either to its objfile associated one
++   or at least to the global list for TYPE_DISCARDABLE Types.  Permanent types
++   do not get linked anywhere.  */
++static void
++typy_link (type_object *type_obj)
 +{
-+  volatile struct gdb_exception except;
-+  char *thetype = NULL;
-+  PyObject *result;
++  type_obj->prev = NULL;
 +
-+  TRY_CATCH (except, RETURN_MASK_ALL)
++  if (type_obj->type && TYPE_OBJFILE (type_obj->type))
 +    {
-+      struct cleanup *old_chain;
-+      struct ui_file *stb;
-+      long length;
-+
-+      stb = mem_fileopen ();
-+      old_chain = make_cleanup_ui_file_delete (stb);
++      struct objfile *objfile = TYPE_OBJFILE (type_obj->type);
 +
-+      type_print (type_object_to_type (self), "", stb, -1);
-+
-+      thetype = ui_file_xstrdup (stb, &length);
-+      do_cleanups (old_chain);
++      type_obj->next = objfile_data (objfile, typy_objfile_data_key);
++      if (type_obj->next)
++      type_obj->next->prev = type_obj;
++      set_objfile_data (objfile, typy_objfile_data_key, type_obj);
 +    }
-+  if (except.reason < 0)
++  else if (type_obj->type && TYPE_DISCARDABLE (type_obj->type))
 +    {
-+      xfree (thetype);
-+      GDB_PY_HANDLE_EXCEPTION (except);
++      type_obj->next = pyty_objects_discardable;
++      if (type_obj->next)
++      type_obj->next->prev = type_obj;
++      pyty_objects_discardable = type_obj;
 +    }
-+
-+  result = PyUnicode_Decode (thetype, strlen (thetype), host_charset (), NULL);
-+  xfree (thetype);
-+
-+  return result;
++  else
++    type_obj->next = NULL;
 +}
 +
-+\f
-+
-+static const struct objfile_data *typy_objfile_data_key;
-+
++/* Unlink TYPE_OBJ from its current list.  Permanent types are not linked
++   anywhere and this function has no effect on them.  */
 +static void
-+clean_up_objfile_types (struct objfile *objfile, void *datum)
++typy_unlink (type_object *type_obj)
 +{
-+  type_object *obj = datum;
-+  htab_t copied_types;
-+  struct cleanup *cleanup;
-+  PyGILState_STATE state;
-+
-+  /* This prevents another thread from freeing the objects we're
-+     operating on.  */
-+  state = PyGILState_Ensure ();
-+  cleanup = make_cleanup_py_restore_gil (&state);
-+
-+  copied_types = create_copied_types_hash (objfile);
-+
-+  while (obj)
++  if (type_obj->prev)
++    type_obj->prev->next = type_obj->next;
++  else if (type_obj->type && TYPE_OBJFILE (type_obj->type))
 +    {
-+      type_object *next = obj->next;
-+
-+      htab_empty (copied_types);
-+
-+      /* No need to decref the old type here, since we know it has no
-+       reference count.  */
-+      gdb_assert (objfile == TYPE_OBJFILE (obj->type));
-+      obj->type = copy_type_recursive (obj->type, copied_types);
-+      type_incref (obj->type);
-+
-+      obj->next = NULL;
-+      obj->prev = NULL;
++      /* Must reset head of list.  */
++      struct objfile *objfile = TYPE_OBJFILE (type_obj->type);
 +
-+      obj = next;
++      set_objfile_data (objfile, typy_objfile_data_key, type_obj->next);
 +    }
++  else if (pyty_objects_discardable == type_obj)
++    pyty_objects_discardable = type_obj->next;
 +
-+  htab_delete (copied_types);
-+
-+  do_cleanups (cleanup);
-+}
-+
-+static void
-+set_type (type_object *obj, struct type *type)
-+{
-+  obj->type = type;
-+  type_incref (type);
-+  obj->prev = NULL;
-+  if (type && !OBJFILE_IS_VIRTUAL (TYPE_OBJFILE (type)))
-+    {
-+      struct objfile *objfile = TYPE_OBJFILE (type);
-+
-+      obj->next = objfile_data (objfile, typy_objfile_data_key);
-+      if (obj->next)
-+      obj->next->prev = obj;
-+      set_objfile_data (objfile, typy_objfile_data_key, obj);
-+    }
-+  else
-+    obj->next = NULL;
++  if (type_obj->next)
++    type_obj->next->prev = type_obj->prev;
 +}
 +
-+static PyObject *
-+typy_new (PyTypeObject *subtype, PyObject *args, PyObject *kwargs)
-+{
-+  char *type_name = NULL;
-+  struct type *type = NULL;
-+  type_object *result;
-+  PyObject *block_obj = NULL;
-+  struct block *block = NULL;
-+
-+  /* FIXME: it is strange to allow a Type with no name, but we need
-+     this for type_to_type_object.  */
-+  if (! PyArg_ParseTuple (args, "|sO", &type_name, &block_obj))
-+    return NULL;
-+
-+  if (block_obj)
-+    {
-+      block = block_object_to_block (block_obj);
-+      if (! block)
-+      {
-+        PyErr_SetString (PyExc_RuntimeError,
-+                         "second argument must be block");
-+        return NULL;
-+      }
-+    }
-+
-+  if (type_name)
-+    {
-+      type = typy_lookup_typename (type_name, block);
-+      if (! type)
-+      return NULL;
-+    }
-+
-+  result = (type_object *) subtype->tp_alloc (subtype, 1);
-+  if (! result)
-+    return NULL;
-+
-+  set_type (result, type);
-+
-+  return (PyObject *) result;
-+}
-+
-+static void
+ static void
+ save_objfile_types (struct objfile *objfile, void *datum)
+ {
+@@ -543,12 +621,13 @@ save_objfile_types (struct objfile *objfile, void *datum)
+     {
+       type_object *next = obj->next;
+-      htab_empty (copied_types);
++      gdb_assert (TYPE_OBJFILE (obj->type) == objfile);
++      typy_unlink (obj);
+-      obj->type = copy_type_recursive (objfile, obj->type, copied_types);
++      obj->type = copy_type_recursive (obj->type, copied_types);
+-      obj->next = NULL;
+-      obj->prev = NULL;
++      gdb_assert (TYPE_OBJFILE (obj->type) == NULL);
++      typy_link (obj);
+       obj = next;
+     }
+@@ -559,41 +638,25 @@ save_objfile_types (struct objfile *objfile, void *datum)
+ }
+ static void
+-set_type (type_object *obj, struct type *type)
 +typy_dealloc (PyObject *obj)
-+{
-+  type_object *type = (type_object *) obj;
-+
-+  if (type->type)
-+    type_decref (type->type);
+ {
+-  obj->type = type;
+-  obj->prev = NULL;
+-  if (type && TYPE_OBJFILE (type))
+-    {
+-      struct objfile *objfile = TYPE_OBJFILE (type);
++  type_object *type_obj = (type_object *) obj;
+-      obj->next = objfile_data (objfile, typy_objfile_data_key);
+-      if (obj->next)
+-      obj->next->prev = obj;
+-      set_objfile_data (objfile, typy_objfile_data_key, obj);
+-    }
+-  else
+-    obj->next = NULL;
++  typy_unlink (type_obj);
 +
-+  if (type->prev)
-+    type->prev->next = type->next;
-+  else if (type->type && !OBJFILE_IS_VIRTUAL (TYPE_OBJFILE (type->type)))
++  type_obj->ob_type->tp_free (obj);
+ }
++/* Call type_mark_used for any TYPEs referenced from this GDB source file.  */
+ static void
+-typy_dealloc (PyObject *obj)
++typy_types_mark_used (void)
+ {
+-  type_object *type = (type_object *) obj;
+-
+-  if (type->prev)
+-    type->prev->next = type->next;
+-  else if (type->type && TYPE_OBJFILE (type->type))
+-    {
+-      /* Must reset head of list.  */
+-      struct objfile *objfile = TYPE_OBJFILE (type->type);
+-      if (objfile)
+-      set_objfile_data (objfile, typy_objfile_data_key, type->next);
+-    }
+-  if (type->next)
+-    type->next->prev = type->prev;
++  type_object *type_obj;
+-  type->ob_type->tp_free (type);
++  for (type_obj = pyty_objects_discardable;
++       type_obj != NULL;
++       type_obj = type_obj->next)
++    type_mark_used (type_obj->type);
+ }
+ /* Create a new Type referring to TYPE.  */
+@@ -604,7 +667,10 @@ type_to_type_object (struct type *type)
+   type_obj = PyObject_New (type_object, &type_object_type);
+   if (type_obj)
+-    set_type (type_obj, type);
 +    {
-+      /* Must reset head of list.  */
-+      struct objfile *objfile = TYPE_OBJFILE (type->type);
-+      if (objfile)
-+      set_objfile_data (objfile, typy_objfile_data_key, type->next);
++      type_obj->type = type;
++      typy_link (type_obj);
 +    }
-+  if (type->next)
-+    type->next->prev = type->prev;
-+
-+  type->ob_type->tp_free (type);
-+}
-+
-+/* Create a new Type referring to TYPE.  */
-+PyObject *
-+type_to_type_object (struct type *type)
-+{
-+  type_object *type_obj;
-+
-+  type_obj = PyObject_New (type_object, &type_object_type);
-+  if (type_obj)
-+    set_type (type_obj, type);
-+
-+  return (PyObject *) type_obj;
-+}
-+
-+struct type *
-+type_object_to_type (PyObject *obj)
-+{
-+  if (! PyObject_TypeCheck (obj, &type_object_type))
-+    return NULL;
-+  return ((type_object *) obj)->type;
-+}
-+
-+\f
-+
-+void
-+gdbpy_initialize_types (void)
-+{
-+  int i;
-+
-+  typy_objfile_data_key
-+    = register_objfile_data_with_cleanup (clean_up_objfile_types);
-+
-+  if (PyType_Ready (&type_object_type) < 0)
-+    return;
-+  if (PyType_Ready (&field_object_type) < 0)
-+    return;
-+
-+  for (i = 0; pyty_codes[i].name; ++i)
+   return (PyObject *) type_obj;
+ }
+@@ -623,14 +689,28 @@ type_object_to_type (PyObject *obj)
+ PyObject *
+ gdbpy_lookup_type (PyObject *self, PyObject *args, PyObject *kw)
+ {
+-  static char *keywords[] = { "name", NULL };
++  static char *keywords[] = { "name", "block", NULL };
+   char *type_name = NULL;
+   struct type *type = NULL;
++  PyObject *block_obj = NULL;
++  struct block *block = NULL;
+-  if (! PyArg_ParseTupleAndKeywords (args, kw, "s", keywords, &type_name))
++  if (! PyArg_ParseTupleAndKeywords (args, kw, "s|O", keywords,
++                                   &type_name, &block_obj))
+     return NULL;
+-  type = typy_lookup_typename (type_name);
++  if (block_obj)
 +    {
-+      if (PyModule_AddIntConstant (gdb_module,
-+                                 /* Cast needed for Python 2.4.  */
-+                                 (char *) pyty_codes[i].name,
-+                                 pyty_codes[i].code) < 0)
-+      return;
++      block = block_object_to_block (block_obj);
++      if (! block)
++      {
++        PyErr_SetString (PyExc_RuntimeError,
++                         "'block' argument must be a Block");
++        return NULL;
++      }
 +    }
 +
-+  Py_INCREF (&type_object_type);
-+  PyModule_AddObject (gdb_module, "Type", (PyObject *) &type_object_type);
-+
-+  Py_INCREF (&field_object_type);
-+  PyModule_AddObject (gdb_module, "Field", (PyObject *) &field_object_type);
-+}
-+
-+\f
-+
-+static PyMethodDef type_object_methods[] =
-+{
-+  { "code", typy_code, METH_NOARGS, "Return the code for this type" },
-+  { "const", typy_const, METH_NOARGS, "Return a const variant of this type" },
-+  { "fields", typy_fields, METH_NOARGS,
-+    "Return a sequence holding all the fields of this type.\n\
-+Each field is a dictionary." },
-+  { "pointer", typy_pointer, METH_NOARGS, "Return pointer to this type" },
-+  { "reference", typy_reference, METH_NOARGS, "Return reference to this type" },
-+  { "sizeof", typy_sizeof, METH_NOARGS,
-+    "Return the size of this type, in bytes" },
-+  { "tag", typy_tag, METH_NOARGS,
-+    "Return the tag name for this type, or None." },
-+  { "strip_typedefs", typy_strip_typedefs, METH_NOARGS,
-+    "Return a type stripped of typedefs"},
-+  { "target", typy_target, METH_NOARGS,
-+    "Return the target type of this type" },
-+  { "template_argument", typy_template_argument, METH_VARARGS,
-+    "Return a single template argument type" },
-+  { "unqualified", typy_unqualified, METH_NOARGS,
-+    "Return a variant of this type without const or volatile attributes" },
-+  { "volatile", typy_volatile, METH_NOARGS,
-+    "Return a volatile variant of this type" },
-+  { NULL }
-+};
-+
-+static PyTypeObject type_object_type =
-+{
-+  PyObject_HEAD_INIT (NULL)
-+  0,                            /*ob_size*/
-+  "gdb.Type",                   /*tp_name*/
-+  sizeof (type_object),                 /*tp_basicsize*/
-+  0,                            /*tp_itemsize*/
-+  typy_dealloc,                         /*tp_dealloc*/
-+  0,                            /*tp_print*/
-+  0,                            /*tp_getattr*/
-+  0,                            /*tp_setattr*/
-+  0,                            /*tp_compare*/
-+  0,                            /*tp_repr*/
-+  0,                            /*tp_as_number*/
-+  0,                            /*tp_as_sequence*/
-+  0,                            /*tp_as_mapping*/
-+  0,                            /*tp_hash */
-+  0,                            /*tp_call*/
-+  typy_str,                     /*tp_str*/
-+  0,                            /*tp_getattro*/
-+  0,                            /*tp_setattro*/
-+  0,                            /*tp_as_buffer*/
-+  Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_ITER,  /*tp_flags*/
-+  "GDB type object",            /* tp_doc */
-+  0,                            /* tp_traverse */
-+  0,                            /* tp_clear */
-+  0,                            /* tp_richcompare */
-+  0,                            /* tp_weaklistoffset */
-+  0,                            /* tp_iter */
-+  0,                            /* tp_iternext */
-+  type_object_methods,                  /* tp_methods */
-+  0,                            /* tp_members */
-+  0,                            /* tp_getset */
-+  0,                            /* tp_base */
-+  0,                            /* tp_dict */
-+  0,                            /* tp_descr_get */
-+  0,                            /* tp_descr_set */
-+  0,                            /* tp_dictoffset */
-+  0,                            /* tp_init */
-+  0,                            /* tp_alloc */
-+  typy_new,                     /* tp_new */
-+};
++  type = typy_lookup_typename (type_name, block);
+   if (! type)
+     return NULL;
+@@ -664,6 +744,8 @@ gdbpy_initialize_types (void)
+   Py_INCREF (&field_object_type);
+   PyModule_AddObject (gdb_module, "Field", (PyObject *) &field_object_type);
 +
-+static PyTypeObject field_object_type =
-+{
-+  PyObject_HEAD_INIT (NULL)
-+  0,                            /*ob_size*/
-+  "gdb.Field",                          /*tp_name*/
-+  sizeof (field_object),        /*tp_basicsize*/
-+  0,                            /*tp_itemsize*/
-+  field_dealloc,                /*tp_dealloc*/
-+  0,                            /*tp_print*/
-+  0,                            /*tp_getattr*/
-+  0,                            /*tp_setattr*/
-+  0,                            /*tp_compare*/
-+  0,                            /*tp_repr*/
-+  0,                            /*tp_as_number*/
-+  0,                            /*tp_as_sequence*/
-+  0,                            /*tp_as_mapping*/
-+  0,                            /*tp_hash */
-+  0,                            /*tp_call*/
-+  0,                            /*tp_str*/
-+  0,                            /*tp_getattro*/
-+  0,                            /*tp_setattro*/
-+  0,                            /*tp_as_buffer*/
-+  Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_ITER,  /*tp_flags*/
-+  "GDB field object",           /* tp_doc */
-+  0,                            /* tp_traverse */
-+  0,                            /* tp_clear */
-+  0,                            /* tp_richcompare */
-+  0,                            /* tp_weaklistoffset */
-+  0,                            /* tp_iter */
-+  0,                            /* tp_iternext */
-+  0,                            /* tp_methods */
-+  0,                            /* tp_members */
-+  0,                            /* tp_getset */
-+  0,                            /* tp_base */
-+  0,                            /* tp_dict */
-+  0,                            /* tp_descr_get */
-+  0,                            /* tp_descr_set */
-+  offsetof (field_object, dict),  /* tp_dictoffset */
-+  0,                            /* tp_init */
-+  0,                            /* tp_alloc */
-+  0,                            /* tp_new */
-+};
-diff --git a/gdb/python/python-utils.c b/gdb/python/python-utils.c
-index ddac2f5..f9c9486 100644
---- a/gdb/python/python-utils.c
-+++ b/gdb/python/python-utils.c
++  observer_attach_mark_used (typy_types_mark_used);
+ }
\f
+diff --git a/gdb/python/py-utils.c b/gdb/python/py-utils.c
+index 49c0437..84a476e 100644
+--- a/gdb/python/py-utils.c
++++ b/gdb/python/py-utils.c
 @@ -19,6 +19,7 @@
  
  #include "defs.h"
@@ -30051,18 +17964,7 @@ index ddac2f5..f9c9486 100644
  #include "python-internal.h"
  
  
-@@ -99,8 +100,8 @@ python_string_to_unicode (PyObject *obj)
- }
- /* Returns a newly allocated string with the contents of the given unicode
--   string object converted to CHARSET.  If an error occurs during the
--   conversion, NULL will be returned and a python exception will be set.
-+   string object converted to a named charset.  If an error occurs during
-+   the conversion, NULL will be returned and a python exception will be set.
-    The caller is responsible for xfree'ing the string.  */
- static char *
-@@ -191,3 +192,48 @@ gdbpy_is_string (PyObject *obj)
+@@ -219,3 +220,48 @@ gdbpy_is_string (PyObject *obj)
  {
    return PyString_Check (obj) || PyUnicode_Check (obj);
  }
@@ -30111,133 +18013,30 @@ index ddac2f5..f9c9486 100644
 +
 +  return 1;
 +}
-diff --git a/gdb/python/python-value.c b/gdb/python/python-value.c
-index bc077b6..2507fcd 100644
---- a/gdb/python/python-value.c
-+++ b/gdb/python/python-value.c
-@@ -52,6 +52,10 @@ struct value *values_in_python = NULL;
+diff --git a/gdb/python/py-value.c b/gdb/python/py-value.c
+index 58bcee3..b2e7b7d 100644
+--- a/gdb/python/py-value.c
++++ b/gdb/python/py-value.c
+@@ -25,6 +25,7 @@
+ #include "language.h"
+ #include "dfp.h"
+ #include "valprint.h"
++#include "observer.h"
+ #ifdef HAVE_PYTHON
+@@ -43,6 +44,10 @@
  /* Python's long type corresponds to C's long long type.  */
- #define builtin_type_pylong builtin_type (current_gdbarch)->builtin_long_long
+ #define builtin_type_pylong builtin_type (python_gdbarch)->builtin_long_long
  
 +/* Python's long type corresponds to C's long long type.  Unsigned version.  */
 +#define builtin_type_upylong builtin_type \
-+  (current_gdbarch)->builtin_unsigned_long_long
++  (python_gdbarch)->builtin_unsigned_long_long
 +
  #define builtin_type_pybool \
-   language_bool_type (current_language, current_gdbarch)
-@@ -143,10 +147,19 @@ valpy_address (PyObject *self, PyObject *args)
-   return value_to_value_object (res_val);
- }
--/* Return Unicode string with value contents (assumed to be encoded in the
--   target's charset).  */
-+/* Return type of the value.  */
-+static PyObject *
-+valpy_type (PyObject *self, PyObject *args)
-+{
-+  struct value *value = ((value_object *) self)->value;
-+  return type_to_type_object (value_type (value));
-+}
-+
-+/* Implementation of gdb.Value.string ([encoding] [, errors]) -> string
-+   Return Unicode string with value contents.  If ENCODING is not given,
-+   the string is assumed to be encoded in the target's charset.  */
- static PyObject *
--valpy_string (PyObject *self, PyObject *args)
-+valpy_string (PyObject *self, PyObject *args, PyObject *kw)
- {
-   int length, ret = 0;
-   gdb_byte *buffer;
-@@ -157,8 +170,10 @@ valpy_string (PyObject *self, PyObject *args)
-   const char *errors = NULL;
-   const char *user_encoding = NULL;
-   const char *la_encoding = NULL;
-+  static char *keywords[] = { "encoding", "errors" };
--  if (!PyArg_ParseTuple (args, "|ss", &user_encoding, &errors))
-+  if (!PyArg_ParseTupleAndKeywords (args, kw, "|ss", keywords,
-+                                  &user_encoding, &errors))
-     return NULL;
-   TRY_CATCH (except, RETURN_MASK_ALL)
-@@ -174,6 +189,34 @@ valpy_string (PyObject *self, PyObject *args)
-   return unicode;
- }
-+/* Cast a value to a given type.  */
-+static PyObject *
-+valpy_cast (PyObject *self, PyObject *args)
-+{
-+  PyObject *type_obj;
-+  struct type *type;
-+  struct value *res_val = NULL;         /* Initialize to appease gcc warning.  */
-+  volatile struct gdb_exception except;
-+
-+  if (! PyArg_ParseTuple (args, "O", &type_obj))
-+    return NULL;
-+
-+  type = type_object_to_type (type_obj);
-+  if (! type)
-+    {
-+      PyErr_SetString (PyExc_RuntimeError, "argument must be a Type");
-+      return NULL;
-+    }
-+
-+  TRY_CATCH (except, RETURN_MASK_ALL)
-+    {
-+      res_val = value_cast (type, ((value_object *) self)->value);
-+    }
-+  GDB_PY_HANDLE_EXCEPTION (except);
-+
-+  return value_to_value_object (res_val);
-+}
-+
- static Py_ssize_t
- valpy_length (PyObject *self)
- {
-@@ -306,11 +349,11 @@ valpy_binop (enum valpy_opcode opcode, PyObject *self, PyObject *other)
-        a gdb.Value object and need to convert it from python as well.  */
-       arg1 = convert_value_from_python (self);
-       if (arg1 == NULL)
--      return NULL;
-+      break;
-       arg2 = convert_value_from_python (other);
-       if (arg2 == NULL)
--      return NULL;
-+      break;
+   language_bool_type (python_language, python_gdbarch)
  
-       switch (opcode)
-       {
-@@ -387,7 +430,7 @@ valpy_binop (enum valpy_opcode opcode, PyObject *self, PyObject *other)
-     }
-   GDB_PY_HANDLE_EXCEPTION (except);
--  return value_to_value_object (res_val);
-+  return res_val ? value_to_value_object (res_val) : NULL;
- }
- static PyObject *
-@@ -718,6 +761,17 @@ value_to_value_object (struct value *val)
-   return (PyObject *) val_obj;
- }
-+/* Returns value structure corresponding to the given value object.  */
-+struct value *
-+value_object_to_value (PyObject *self)
-+{
-+  value_object *real;
-+  if (! PyObject_TypeCheck (self, &value_object_type))
-+    return NULL;
-+  real = (value_object *) self;
-+  return real->value;
-+}
-+
- /* Try to convert a Python value to a gdb value.  If the value cannot
-    be converted, set a Python exception and return NULL.  */
-@@ -751,7 +805,34 @@ convert_value_from_python (PyObject *obj)
+@@ -913,7 +918,34 @@ convert_value_from_python (PyObject *obj)
        {
          LONGEST l = PyLong_AsLongLong (obj);
  
@@ -30273,19 +18072,21 @@ index bc077b6..2507fcd 100644
            value = value_from_longest (builtin_type_pylong, l);
        }
        else if (PyFloat_Check (obj))
-@@ -774,7 +855,7 @@ convert_value_from_python (PyObject *obj)
-           }
-       }
-       else if (PyObject_TypeCheck (obj, &value_object_type))
--      value = ((value_object *) obj)->value;
-+      value = value_copy (((value_object *) obj)->value);
-       else
-       PyErr_Format (PyExc_TypeError, _("Could not convert Python object: %s"),
-                     PyString_AsString (PyObject_Str (obj)));
-@@ -810,6 +891,14 @@ gdbpy_history (PyObject *self, PyObject *args)
+@@ -972,6 +1004,25 @@ gdbpy_history (PyObject *self, PyObject *args)
    return value_to_value_object (res_val);
  }
  
++/* Call type_mark_used for any TYPEs referenced from this GDB source file.  */
++
++static void
++python_types_mark_used (void)
++{
++  value_object *iter;
++
++  for (iter = values_in_python; iter; iter = iter->next)
++    type_mark_used (value_type (iter->value));
++}
++
 +/* Returns 1 in OBJ is a gdb.Value object, 0 otherwise.  */
 +
 +int
@@ -30297,54 +18098,166 @@ index bc077b6..2507fcd 100644
  void
  gdbpy_initialize_values (void)
  {
-@@ -822,11 +911,16 @@ gdbpy_initialize_values (void)
-   values_in_python = NULL;
- }
+@@ -982,6 +1033,8 @@ gdbpy_initialize_values (void)
+   PyModule_AddObject (gdb_module, "Value", (PyObject *) &value_object_type);
  
-+\f
+   values_in_python = NULL;
 +
- static PyMethodDef value_object_methods[] = {
-   { "address", valpy_address, METH_NOARGS, "Return the address of the value." },
-+  { "cast", valpy_cast, METH_VARARGS, "Cast the value to the supplied type." },
-   { "dereference", valpy_dereference, METH_NOARGS, "Dereferences the value." },
--  { "string", valpy_string, METH_VARARGS,
--    "Return Unicode string representation of the value." },
-+  { "type", valpy_type, METH_NOARGS, "Return type of the value." },
-+  { "string", (PyCFunction) valpy_string, METH_VARARGS | METH_KEYWORDS,
-+    "string ([encoding] [, errors]) -> string\n\
-+Return Unicode string representation of the value." },
-   {NULL}  /* Sentinel */
- };
++  observer_attach_mark_used (python_types_mark_used);
+ }
  
-diff --git a/gdb/python/python.c b/gdb/python/python.c
-index b3a27d6..2b06748 100644
---- a/gdb/python/python.c
-+++ b/gdb/python/python.c
-@@ -22,6 +22,12 @@
- #include "ui-out.h"
- #include "cli/cli-script.h"
- #include "gdbcmd.h"
-+#include "objfiles.h"
-+#include "observer.h"
-+#include "gdb_regex.h"
-+#include "language.h"
-+#include "valprint.h"
-+#include "event-loop.h"
\f
+diff --git a/gdb/python/python-internal.h b/gdb/python/python-internal.h
+index 67a78af..47662d9 100644
+--- a/gdb/python/python-internal.h
++++ b/gdb/python/python-internal.h
+@@ -61,33 +61,76 @@ typedef int Py_ssize_t;
+ #define PyEval_ReleaseLock() 0
+ #endif
  
- #include <ctype.h>
++#include "command.h"
++
++struct block;
++struct symbol;
++struct symtab_and_line;
+ struct value;
+ struct language_defn;
+ extern PyObject *gdb_module;
++extern PyTypeObject block_object_type;
+ extern PyTypeObject value_object_type;
++extern PyTypeObject symbol_object_type;
++
++/* Used in python-inferior.c.  */
++typedef struct
++{
++  PyObject_HEAD
++
++  /* The thread we represent.  */
++  struct thread_info *thread;
++
++  /* The Inferior object to which this thread belongs.  */
++  PyObject *inf_obj;
++} thread_object;
+ PyObject *gdbpy_history (PyObject *self, PyObject *args);
++PyObject *gdbpy_breakpoints (PyObject *, PyObject *);
+ PyObject *gdbpy_frame_stop_reason_string (PyObject *, PyObject *);
++PyObject *gdbpy_lookup_symbol (PyObject *self, PyObject *args, PyObject *kw);
+ PyObject *gdbpy_selected_frame (PyObject *self, PyObject *args);
++PyObject *gdbpy_block_for_pc (PyObject *self, PyObject *args);
+ PyObject *gdbpy_lookup_type (PyObject *self, PyObject *args, PyObject *kw);
++PyObject *gdbpy_inferiors (PyObject *unused, PyObject *unused2);
++PyObject *gdbpy_selected_thread (PyObject *self, PyObject *args);
++PyObject *symtab_and_line_to_sal_object (struct symtab_and_line sal);
++PyObject *symtab_to_symtab_object (struct symtab *symtab);
++PyObject *symbol_to_symbol_object (struct symbol *sym);
++PyObject *block_to_block_object (struct block *block);
+ PyObject *value_to_value_object (struct value *v);
+ PyObject *type_to_type_object (struct type *);
+ PyObject *objfile_to_objfile_object (struct objfile *);
++PyObject *frame_info_to_frame_object (struct frame_info *frame);
++thread_object *create_thread_object (struct thread_info *tp);
++thread_object *find_thread_object (ptid_t ptid);
++PyObject *find_inferior_object (int pid);
+ PyObject *objfpy_get_printers (PyObject *, void *);
  
-@@ -29,6 +35,10 @@
-    false otherwise.  */
- static int gdbpy_should_print_stack = 1;
++struct block *block_object_to_block (PyObject *obj);
++struct symbol *symbol_object_to_symbol (PyObject *obj);
+ struct value *value_object_to_value (PyObject *self);
+ struct value *convert_value_from_python (PyObject *obj);
+ struct type *type_object_to_type (PyObject *obj);
  
-+/* This is true if we should auto-load python code when an objfile is
-+   opened, false otherwise.  */
-+static int gdbpy_auto_load = 1;
++PyObject *gdbpy_get_hook_function (const char *);
 +
- #ifdef HAVE_PYTHON
+ void gdbpy_initialize_values (void);
++void gdbpy_initialize_breakpoints (void);
+ void gdbpy_initialize_frames (void);
++void gdbpy_initialize_symtabs (void);
+ void gdbpy_initialize_commands (void);
++void gdbpy_initialize_symbols (void);
+ void gdbpy_initialize_types (void);
++void gdbpy_initialize_blocks (void);
+ void gdbpy_initialize_functions (void);
+ void gdbpy_initialize_objfile (void);
++void gdbpy_initialize_parameters (void);
++void gdbpy_initialize_thread (void);
++void gdbpy_initialize_inferior (void);
+ struct cleanup *make_cleanup_py_decref (PyObject *py);
+@@ -97,6 +140,12 @@ struct cleanup *ensure_python_env (struct gdbarch *gdbarch,
+ extern struct gdbarch *python_gdbarch;
+ extern const struct language_defn *python_language;
++char *gdbpy_parse_command_name (char *text,
++                              struct cmd_list_element ***base_list,
++                              struct cmd_list_element **start_list);
++
++PyObject *gdbpy_parameter_value (enum var_types, void *);
++
+ /* Use this after a TRY_EXCEPT to throw the appropriate Python
+    exception.  */
+ #define GDB_PY_HANDLE_EXCEPTION(Exception)                            \
+@@ -107,6 +156,19 @@ extern const struct language_defn *python_language;
+                            "%s", Exception.message);                  \
+     } while (0)
++/* Use this after a TRY_EXCEPT to throw the appropriate Python
++   exception.  This macro is for use inside setter functions.  */
++#define GDB_PY_SET_HANDLE_EXCEPTION(Exception)                                \
++    do {                                                              \
++      if (Exception.reason < 0)                                               \
++        {                                                             \
++        PyErr_Format (Exception.reason == RETURN_QUIT                 \
++                      ? PyExc_KeyboardInterrupt : PyExc_RuntimeError, \
++                      "%s", Exception.message);                       \
++        return -1;                                                    \
++      }                                                               \
++    } while (0)
++
+ void gdbpy_print_stack (void);
+@@ -118,17 +180,22 @@ char *python_string_to_host_string (PyObject *obj);
+ PyObject *target_string_to_unicode (const gdb_byte *str, int length);
+ int gdbpy_is_string (PyObject *obj);
++int gdbpy_is_value_object (PyObject *obj);
++
+ /* Note that these are declared here, and not in python.h with the
+    other pretty-printer functions, because they refer to PyObject.  */
+ PyObject *apply_varobj_pretty_printer (PyObject *print_obj,
+                                      struct value **replacement);
+ PyObject *gdbpy_get_varobj_pretty_printer (struct value *value);
++PyObject *gdbpy_instantiate_printer (PyObject *cons, PyObject *value);
+ char *gdbpy_get_display_hint (PyObject *printer);
+ PyObject *gdbpy_default_visualizer (PyObject *self, PyObject *args);
+-extern PyObject *gdbpy_doc_cst;
+ extern PyObject *gdbpy_children_cst;
+ extern PyObject *gdbpy_to_string_cst;
+ extern PyObject *gdbpy_display_hint_cst;
++extern PyObject *gdbpy_doc_cst;
++
++int get_addr_from_python (PyObject *obj, CORE_ADDR *addr);
+ #endif /* GDB_PYTHON_INTERNAL_H */
+diff --git a/gdb/python/python.c b/gdb/python/python.c
+index 254bd28..5a2a9ae 100644
+--- a/gdb/python/python.c
++++ b/gdb/python/python.c
+@@ -27,6 +27,7 @@
+ #include "observer.h"
+ #include "value.h"
+ #include "language.h"
++#include "event-loop.h"
+ #include <ctype.h>
  
- #include "python.h"
-@@ -36,16 +46,29 @@ static int gdbpy_should_print_stack = 1;
+@@ -45,11 +46,18 @@ static int gdbpy_auto_load = 1;
  #include "cli/cli-decode.h"
  #include "charset.h"
  #include "top.h"
@@ -30360,21 +18273,10 @@ index b3a27d6..2b06748 100644
  #include "target.h"
  #include "gdbthread.h"
 +#include "event-top.h"
-+
-+static PyMethodDef GdbMethods[];
  
  static PyMethodDef GdbMethods[];
  
- PyObject *gdb_module;
-+/* Some string constants we may wish to use.  */
-+PyObject *gdbpy_to_string_cst;
-+PyObject *gdbpy_children_cst;
-+PyObject *gdbpy_display_hint_cst;
- PyObject *gdbpy_doc_cst;
- /* Given a command_line, return a command string suitable for passing
-@@ -143,10 +166,10 @@ python_command (char *arg, int from_tty)
+@@ -197,10 +205,10 @@ python_command (char *arg, int from_tty)
     NULL (and set a Python exception) on error.  Helper function for
     get_parameter.  */
  
@@ -30388,7 +18290,7 @@ index b3a27d6..2b06748 100644
      {
      case var_string:
      case var_string_noescape:
-@@ -154,7 +177,7 @@ parameter_to_python (struct cmd_list_element *cmd)
+@@ -208,7 +216,7 @@ parameter_to_python (struct cmd_list_element *cmd)
      case var_filename:
      case var_enum:
        {
@@ -30397,7 +18299,7 @@ index b3a27d6..2b06748 100644
        if (! str)
          str = "";
        return PyString_Decode (str, strlen (str), host_charset (), NULL);
-@@ -162,7 +185,7 @@ parameter_to_python (struct cmd_list_element *cmd)
+@@ -216,7 +224,7 @@ parameter_to_python (struct cmd_list_element *cmd)
  
      case var_boolean:
        {
@@ -30406,7 +18308,7 @@ index b3a27d6..2b06748 100644
          Py_RETURN_TRUE;
        else
          Py_RETURN_FALSE;
-@@ -170,7 +193,7 @@ parameter_to_python (struct cmd_list_element *cmd)
+@@ -224,7 +232,7 @@ parameter_to_python (struct cmd_list_element *cmd)
  
      case var_auto_boolean:
        {
@@ -30415,7 +18317,7 @@ index b3a27d6..2b06748 100644
        if (ab == AUTO_BOOLEAN_TRUE)
          Py_RETURN_TRUE;
        else if (ab == AUTO_BOOLEAN_FALSE)
-@@ -180,15 +203,15 @@ parameter_to_python (struct cmd_list_element *cmd)
+@@ -234,15 +242,15 @@ parameter_to_python (struct cmd_list_element *cmd)
        }
  
      case var_integer:
@@ -30434,46 +18336,16 @@ index b3a27d6..2b06748 100644
        if (val == UINT_MAX)
          Py_RETURN_NONE;
        return PyLong_FromUnsignedLong (val);
-@@ -202,10 +225,11 @@ parameter_to_python (struct cmd_list_element *cmd)
-    value.  */
- static PyObject *
--get_parameter (PyObject *self, PyObject *args)
-+gdbpy_parameter (PyObject *self, PyObject *args)
- {
-   struct cmd_list_element *alias, *prefix, *cmd;
-   char *arg, *newarg;
-+  int found = -1;
-   volatile struct gdb_exception except;
-   if (! PyArg_ParseTuple (args, "s", &arg))
-@@ -215,19 +239,17 @@ get_parameter (PyObject *self, PyObject *args)
-   TRY_CATCH (except, RETURN_MASK_ALL)
-     {
--      if (! lookup_cmd_composition (newarg, &alias, &prefix, &cmd))
--      {
--        xfree (newarg);
--        return PyErr_Format (PyExc_RuntimeError,
--                             "could not find variable `%s'", arg);
--      }
-+      found = lookup_cmd_composition (newarg, &alias, &prefix, &cmd);
-     }
-   xfree (newarg);
-   GDB_PY_HANDLE_EXCEPTION (except);
-+  if (!found)
-+    return PyErr_Format (PyExc_RuntimeError,
-+                       "could not find parameter `%s'", arg);
+@@ -280,7 +288,7 @@ gdbpy_parameter (PyObject *self, PyObject *args)
  
    if (! cmd->var)
--    return PyErr_Format (PyExc_RuntimeError, "`%s' is not a variable", arg);
+     return PyErr_Format (PyExc_RuntimeError, "`%s' is not a parameter", arg);
 -  return parameter_to_python (cmd);
-+    return PyErr_Format (PyExc_RuntimeError, "`%s' is not a parameter", arg);
 +  return gdbpy_parameter_value (cmd->var_type, cmd->var);
  }
  
  /* A Python function which evaluates a string using the gdb CLI.  */
-@@ -266,6 +288,570 @@ execute_gdb_command (PyObject *self, PyObject *args)
+@@ -319,6 +327,233 @@ execute_gdb_command (PyObject *self, PyObject *args)
    Py_RETURN_NONE;
  }
  
@@ -30490,7 +18362,7 @@ index b3a27d6..2b06748 100644
 +  if (!PyArg_ParseTuple (args, "K", &pc))
 +    return NULL;
 +
-+  soname = solib_address (pc);
++  soname = solib_name_from_address (pc);
 +  if (soname)
 +    str_obj = PyString_Decode (soname, strlen (soname), host_charset (), NULL);
 +  else
@@ -30502,357 +18374,103 @@ index b3a27d6..2b06748 100644
 +  return str_obj;
 +}
 +
++/* A Python function which is a wrapper for decode_line_1.  */
++
 +static PyObject *
-+gdbpy_find_pc_function (PyObject *self, PyObject *args)
++gdbpy_decode_line (PyObject *self, PyObject *args)
 +{
-+  unsigned long long pc;
-+  struct symbol *sym;
-+  PyObject *sym_obj;
++  struct symtabs_and_lines sals = { NULL, 0 }; /* Initialize to appease gcc.  */
++  struct symtab_and_line sal;
++  char *arg = NULL;
++  int free_sals = 0, i;
++  PyObject *result = NULL;
++  volatile struct gdb_exception except;
 +
-+  if (!PyArg_ParseTuple (args, "K", &pc))
++  if (! PyArg_ParseTuple (args, "|s", &arg))
 +    return NULL;
 +
-+  sym = find_pc_function (pc);
-+  if (sym)
-+    return symbol_to_symbol_object (sym);
-+
-+  Py_RETURN_NONE;
-+}
++  TRY_CATCH (except, RETURN_MASK_ALL)
++    {
++      if (arg)
++      {
++        char *copy;
 +
-+/* Adds GDB value V to the pattern buffer in *PATTERN_BUF.  If SIZE is not zero,
-+   it specifies the number of bytes from V to copy to *PATTERN_BUF.  The
-+   function increases the size of *PATTERN_BUF as necessary, adjusting
-+   *PATTERN_BUF_END and *PATTERN_BUF_SIZE in the process.  */
++        arg = strdup (arg);
++        copy = arg;
 +
-+static void
-+add_value_pattern (struct value *v, int size, char **pattern_buf,
-+                 char **pattern_buf_end, ULONGEST *pattern_buf_size)
-+{
-+  int val_bytes;
++        sals = decode_line_1 (&copy, 0, 0, 0, 0, 0);
++        free_sals = 1;
++      }
++      else
++      {
++        set_default_source_symtab_and_line ();
++        sal = get_current_source_symtab_and_line ();
++        sals.sals = &sal;
++        sals.nelts = 1;
++      }
++    }
++  if (arg)
++    xfree (arg);
 +
-+  if (size)
++  if (except.reason < 0)
 +    {
-+      LONGEST x = value_as_long (v);
++      if (free_sals)
++      xfree (sals.sals);
++      /* We know this will always throw.  */
++      GDB_PY_HANDLE_EXCEPTION (except);
++    }
 +
-+      if (size == 1)
-+      *(*pattern_buf_end)++ = x;
-+      else
++  if (sals.nelts)
++    {
++      result = PyTuple_New (sals.nelts);
++      for (i = 0; i < sals.nelts; ++i)
 +      {
-+        put_bits (x, *pattern_buf_end, size * 8,
-+                  gdbarch_byte_order (current_gdbarch) == BFD_ENDIAN_BIG);
-+        *pattern_buf_end += size;
++        PyObject *obj;
++        char *str;
++
++        obj = symtab_and_line_to_sal_object (sals.sals[i]);
++        if (! obj)
++          {
++            Py_DECREF (result);
++            result = NULL;
++            break;
++          }
++
++        PyTuple_SetItem (result, i, obj);
 +      }
 +    }
-+  else
-+   {
-+     val_bytes = TYPE_LENGTH (value_type (v));
 +
-+     increase_pattern_buffer (pattern_buf, pattern_buf_end,
-+                            pattern_buf_size, val_bytes);
++  if (free_sals)
++    xfree (sals.sals);
 +
-+     memcpy (*pattern_buf_end, value_contents_raw (v), val_bytes);
-+     *pattern_buf_end += val_bytes;
-+   }
++  if (result)
++    return result;
++  Py_RETURN_NONE;
 +}
 +
-+/* This function does the actual work of constructing the pattern buffer from
-+   OBJ.  If OBJ is an object which implements the read buffer protocol (such
-+   as a string, a byte array or gdb.Membuf), then its contents are directly
-+   copied to *PATTERN_BUF.  If it is a list, then this function is recursively
-+   called for each of its elements.  If OBJ is an object which can be converted
-+   to a GDB value, then the contents of the value are copied to PATTERN_BUF.
-+   If SIZE is different than zero, then it limits the number of bytes which
-+   are copied to the buffer in case OBJ is converted to a GDB value.  That
-+   means that SIZE influences only Python scalars and gdb.Value objects.
-+   The function increases the size of *PATTERN_BUF as necessary, adjusting
-+   *PATTERN_BUF_END and *PATTERN_BUF_SIZE in the process.
++/* Parse a string and evaluate it as an expression.  */
++static PyObject *
++gdbpy_parse_and_eval (PyObject *self, PyObject *args)
++{
++  char *expr_str;
++  struct value *result = NULL;
++  volatile struct gdb_exception except;
 +
-+   Returns 1 on success or 0 on failure, with a Python exception set.  This
-+   function can also throw GDB exceptions.  */
++  if (!PyArg_ParseTuple (args, "s", &expr_str))
++    return NULL;
 +
-+static int
-+add_pattern_element (PyObject *obj, int size, char **pattern_buf,
-+                   char **pattern_buf_end, ULONGEST *pattern_buf_size)
-+{
-+  if (PyObject_CheckReadBuffer (obj))
++  TRY_CATCH (except, RETURN_MASK_ALL)
 +    {
-+      /* Handle string, Unicode string, byte array, gdb.Membuf and any other
-+         object implementing the buffer protocol.  The SIZE parameter is
-+       ignored in this case.  */
++      result = parse_and_eval (expr_str);
++    }
++  GDB_PY_HANDLE_EXCEPTION (except);
 +
-+      Py_ssize_t val_bytes;
-+      const void *buffer;
++  return value_to_value_object (result);
++}
 +
-+      if (PyObject_AsReadBuffer (obj, &buffer, &val_bytes) == -1)
-+      return 0;
++\f
 +
-+      increase_pattern_buffer (pattern_buf, pattern_buf_end,
-+                             pattern_buf_size, val_bytes);
-+
-+      memcpy (*pattern_buf_end, buffer, val_bytes);
-+      *pattern_buf_end += val_bytes;
-+    }
-+  else if (gdbpy_is_value_object (obj))
-+    add_value_pattern (value_object_to_value (obj), size, pattern_buf,
-+                     pattern_buf_end, pattern_buf_size);
-+  else if (PySequence_Check (obj))
-+    {
-+      /* Handle lists and tuples.  */
-+
-+      Py_ssize_t i, num_objs;
-+
-+      num_objs = PySequence_Size (obj);
-+      for (i = 0; i < num_objs; i++)
-+      if (!add_pattern_element (PySequence_GetItem (obj, i), size,
-+                                pattern_buf, pattern_buf_end,
-+                                pattern_buf_size))
-+        return 0;
-+    }
-+  else
-+    {
-+      /* See if we can convert from a Python object to a GDB value.  */
-+
-+      struct value *v = convert_value_from_python (obj);
-+
-+      if (v)
-+      add_value_pattern (v, size, pattern_buf, pattern_buf_end,
-+                         pattern_buf_size);
-+      else
-+      return 0;
-+    }
-+
-+  return 1;
-+}
-+
-+/* Constructs the search pattern from OBJ, putting it in *PATTERN_BUFP, and its
-+   size in *PATTERN_LENP.  See the function add_pattern_element to learn how
-+   the search pattern is obtained from OBJ.
-+
-+   Returns 1 on success or 0 on failure, with a Python exception set.  This
-+   function can also throw GDB exceptions.  */
-+
-+static int
-+get_search_pattern (PyObject *obj, int size, char **pattern_bufp,
-+                  ULONGEST *pattern_lenp)
-+{
-+  /* Buffer to hold the search pattern.  */
-+  char *pattern_buf;
-+  /* Current size of search pattern buffer.
-+     We realloc space as needed.  */
-+  ULONGEST pattern_buf_size;
-+  /* Pointer to one past the last in-use part of pattern_buf.  */
-+  char *pattern_buf_end;
-+  struct cleanup *old_cleanups;
-+
-+  allocate_pattern_buffer (&pattern_buf, &pattern_buf_end, &pattern_buf_size);
-+  old_cleanups = make_cleanup (free_current_contents, &pattern_buf);
-+
-+  if (!add_pattern_element (obj, size, &pattern_buf, &pattern_buf_end,
-+                          &pattern_buf_size))
-+    {
-+      do_cleanups (old_cleanups);
-+
-+      return 0;
-+    }
-+
-+  *pattern_bufp = pattern_buf;
-+  *pattern_lenp = pattern_buf_end - pattern_buf;
-+
-+  discard_cleanups (old_cleanups);
-+
-+  return 1;
-+}
-+
-+/* Implementation of
-+   gdb.search_memory (address, length, pattern [, size] [, max_count]).
-+   The third argument may be either a pattern, or a list or tupple of patterns
-+   to be searched.  Size is the size in bytes of each search query value, either
-+   1, 2, 4 or 8.  Returns a list of the addresses where matches were found.  */
-+
-+PyObject *
-+gdbpy_search_memory (PyObject *self, PyObject *args, PyObject *kw)
-+{
-+  int size = 0;
-+  long length;
-+  unsigned int found_count = 0;
-+  long max_count = 0;
-+  CORE_ADDR start_addr;
-+  char *pattern_buf;
-+  static char *keywords[] = { "address", "length", "pattern", "size",
-+                            "max_count", NULL };
-+  ULONGEST pattern_len, search_space_len;
-+  PyObject *pattern, *list = NULL, *start_addr_obj;
-+  volatile struct gdb_exception except;
-+
-+  /* Assume CORE_ADDR corresponds to unsigned long.  */
-+  if (! PyArg_ParseTupleAndKeywords (args, kw, "OlO|il", keywords,
-+                                   &start_addr_obj, &length, &pattern,
-+                                   &size, &max_count))
-+    return NULL;
-+
-+  if (!max_count)
-+    max_count = LONG_MAX;
-+
-+  if (!length)
-+    {
-+      PyErr_SetString (PyExc_ValueError, "empty search range");
-+      return NULL;
-+    }
-+  else if (length < 0)
-+    {
-+      PyErr_SetString (PyExc_ValueError, "invalid search range");
-+      return NULL;
-+    }
-+  else
-+    {
-+      /* Watch for overflows.  */
-+      if (length > CORE_ADDR_MAX
-+        || (start_addr + length - 1) < start_addr)
-+      {
-+        PyErr_SetString (PyExc_ValueError, "search range too large");
-+        return NULL;
-+      }
-+
-+      search_space_len = length;
-+    }
-+
-+  if (size != 0 && size != 1 && size != 2 && size != 4 && size != 8)
-+    {
-+      PyErr_SetString (PyExc_ValueError, "invalid pattern size");
-+      return NULL;
-+    }
-+
-+  TRY_CATCH (except, RETURN_MASK_ALL)
-+    {
-+      if (get_addr_from_python (start_addr_obj, &start_addr))
-+      {
-+        if (get_search_pattern (pattern, size, &pattern_buf, &pattern_len))
-+          {
-+            /* Any cleanups get automatically executed on an exception.  */
-+            struct cleanup *cleanups = make_cleanup (xfree, pattern_buf);
-+
-+            list = PyList_New (0);
-+
-+            while (search_space_len >= pattern_len && found_count < max_count)
-+              {
-+                CORE_ADDR found_addr;
-+                int found;
-+
-+                found = search_memory (&start_addr, &search_space_len,
-+                                       pattern_buf, pattern_len, &found_addr);
-+                if (found <= 0)
-+                  break;
-+
-+                PyList_Append (list, PyLong_FromUnsignedLong (found_addr));
-+                ++found_count;
-+              }
-+
-+            do_cleanups (cleanups);
-+          }
-+      }
-+    }
-+  GDB_PY_HANDLE_EXCEPTION (except);
-+
-+  return list;
-+}
-+
-+/* A Python function which is a wrapper for decode_line_1.  */
-+
-+static PyObject *
-+gdbpy_decode_line (PyObject *self, PyObject *args)
-+{
-+  struct symtabs_and_lines sals = { NULL, 0 }; /* Initialize to appease gcc.  */
-+  struct symtab_and_line sal;
-+  char *arg = NULL;
-+  int free_sals = 0, i;
-+  PyObject *result = NULL;
-+  volatile struct gdb_exception except;
-+
-+  if (! PyArg_ParseTuple (args, "|s", &arg))
-+    return NULL;
-+
-+  TRY_CATCH (except, RETURN_MASK_ALL)
-+    {
-+      if (arg)
-+      {
-+        char *copy;
-+
-+        arg = strdup (arg);
-+        copy = arg;
-+
-+        sals = decode_line_1 (&copy, 0, 0, 0, 0, 0);
-+        free_sals = 1;
-+      }
-+      else
-+      {
-+        set_default_source_symtab_and_line ();
-+        sal = get_current_source_symtab_and_line ();
-+        sals.sals = &sal;
-+        sals.nelts = 1;
-+      }
-+    }
-+  if (arg)
-+    xfree (arg);
-+
-+  if (except.reason < 0)
-+    {
-+      if (free_sals)
-+      xfree (sals.sals);
-+      /* We know this will always throw.  */
-+      GDB_PY_HANDLE_EXCEPTION (except);
-+    }
-+
-+  if (sals.nelts)
-+    {
-+      result = PyTuple_New (sals.nelts);
-+      for (i = 0; i < sals.nelts; ++i)
-+      {
-+        PyObject *obj;
-+        char *str;
-+
-+        obj = symtab_and_line_to_sal_object (sals.sals[i]);
-+        if (! obj)
-+          {
-+            Py_DECREF (result);
-+            result = NULL;
-+            break;
-+          }
-+
-+        PyTuple_SetItem (result, i, obj);
-+      }
-+    }
-+
-+  if (free_sals)
-+    xfree (sals.sals);
-+
-+  if (result)
-+    return result;
-+  Py_RETURN_NONE;
-+}
-+
-+/* Parse a string and evaluate it as an expression.  */
-+static PyObject *
-+gdbpy_parse_and_eval (PyObject *self, PyObject *args)
-+{
-+  char *expr_str;
-+  struct value *result = NULL;
-+  volatile struct gdb_exception except;
-+
-+  if (!PyArg_ParseTuple (args, "s", &expr_str))
-+    return NULL;
-+
-+  TRY_CATCH (except, RETURN_MASK_ALL)
-+    {
-+      result = parse_and_eval (expr_str);
-+    }
-+  GDB_PY_HANDLE_EXCEPTION (except);
-+
-+  return value_to_value_object (result);
-+}
-+
-+\f
-+
-+/* Posting and handling events.  */
++/* Posting and handling events.  */
 +
 +/* A single event.  */
 +struct gdbpy_event
@@ -30958,99 +18576,14 @@ index b3a27d6..2b06748 100644
 +    }
 +}
 +
-+\f
-+
-+/* Threads.  */
-+
-+/* Callback function for use with iterate_over_threads.  This function
-+   just counts the number of threads.  */
-+
-+static int
-+count_callback (struct thread_info *info, void *user_data)
-+{
-+  int *count = (int *) user_data;
-+  ++*count;
-+  return 0;
-+}
-+
-+/* Structure for storing some state when iterating over threads.  */
-+
-+struct set_thread_info
-+{
-+  PyObject *tuple;
-+  int index;
-+};
-+
-+/* Callback function for use with iterate_over_threads.  This function
-+   stores the thread ID into a Python tuple.  */
-+
-+static int
-+update_tuple_callback (struct thread_info *info, void *user_data)
-+{
-+  struct set_thread_info *tinfo = (struct set_thread_info *) user_data;
-+  PyTuple_SetItem (tinfo->tuple, tinfo->index, PyInt_FromLong (info->num));
-+  ++tinfo->index;
-+  return 0;
-+}
-+
-+/* Python function which yields a tuple holding all valid thread IDs.  */
-+
-+static PyObject *
-+gdbpy_threads (PyObject *unused1, PyObject *unused2)
-+{
-+  int thread_count = 0;
-+  struct set_thread_info info;
-+  PyObject *result;
-+
-+  prune_threads ();
-+  target_find_new_threads ();
-+
-+  iterate_over_threads (count_callback, &thread_count);
-+
-+  if (!thread_count)
-+    Py_RETURN_NONE;
-+
-+  result = PyTuple_New (thread_count);
-+  info.tuple = result;
-+  info.index = 0;
-+  iterate_over_threads (update_tuple_callback, &info);
-+  return result;
-+}
-+
-+/* Python function that returns the current thread's ID.  */
-+
-+static PyObject *
-+gdbpy_current_thread (PyObject *unused1, PyObject *unused2)
-+{
-+  if (PIDGET (inferior_ptid) == 0)
-+    Py_RETURN_NONE;
-+  return PyInt_FromLong (pid_to_thread_id (inferior_ptid));
-+}
-+
-+/* Python function for switching to a given thread.  */
-+
-+static PyObject *
-+gdbpy_switch_to_thread (PyObject *self, PyObject *args)
-+{
-+  int id;
-+  if (! PyArg_ParseTuple (args, "i", &id))
-+    return NULL;
-+  if (! valid_thread_id (id))
-+    return PyErr_Format (PyExc_RuntimeError, "invalid thread id");
-+  switch_to_thread (thread_id_to_pid (id));
-+  Py_RETURN_NONE;
-+}
-+
\f
- /* Printing.  */
-@@ -302,6 +888,769 @@ gdbpy_print_stack (void)
-     PyErr_Clear ();
- }
-+\f
-+
-+/* Script interface.  */
\f
+ /* Printing.  */
+@@ -357,6 +592,69 @@ gdbpy_print_stack (void)
\f
++/* Script interface.  */
 +
 +/* True if 'gdb -P' was used, false otherwise.  */
 +static int running_python_script;
@@ -31113,2795 +18646,1458 @@ index b3a27d6..2b06748 100644
 +
 +\f
 +
-+/* The "current" objfile.  This is set when gdb detects that a new
-+   objfile has been loaded.  It is only set for the duration of a call
-+   to gdbpy_new_objfile; it is NULL at other times.  */
-+static struct objfile *gdbpy_current_objfile;
-+
-+/* The file name we attempt to read.  */
-+#define GDBPY_AUTO_FILENAME "-gdb.py"
-+
-+/* This is a new_objfile observer callback which loads python code
-+   based on the path to the objfile.  */
-+static void
-+gdbpy_new_objfile (struct objfile *objfile)
+ /* The "current" objfile.  This is set when gdb detects that a new
+    objfile has been loaded.  It is only set for the duration of a call
+    to gdbpy_new_objfile; it is NULL at other times.  */
+@@ -501,6 +799,13 @@ eval_python_from_control_command (struct command_line *cmd)
+   error (_("Python scripting is not supported in this copy of GDB."));
+ }
++void
++source_python_script (FILE *stream)
 +{
-+  char *realname;
-+  char *filename, *debugfile;
-+  int len;
-+  FILE *input;
-+  PyGILState_STATE state;
-+  struct cleanup *cleanups;
-+
-+  if (!gdbpy_auto_load || !objfile || !objfile->name)
-+    return;
-+
-+  state = PyGILState_Ensure ();
-+
-+  gdbpy_current_objfile = objfile;
-+
-+  realname = gdb_realpath (objfile->name);
-+  len = strlen (realname);
-+  filename = xmalloc (len + sizeof (GDBPY_AUTO_FILENAME));
-+  memcpy (filename, realname, len);
-+  strcpy (filename + len, GDBPY_AUTO_FILENAME);
-+
-+  input = fopen (filename, "r");
-+  debugfile = filename;
-+
-+  cleanups = make_cleanup (xfree, filename);
-+  make_cleanup (xfree, realname);
-+
-+  if (!input && debug_file_directory)
-+    {
-+      /* Also try the same file in the separate debug info directory.  */
-+      debugfile = xmalloc (strlen (filename)
-+                         + strlen (debug_file_directory) + 1);
-+      strcpy (debugfile, debug_file_directory);
-+      /* FILENAME is absolute, so we don't need a "/" here.  */
-+      strcat (debugfile, filename);
-+
-+      make_cleanup (xfree, debugfile);
-+      input = fopen (debugfile, "r");
-+    }
-+
-+  if (!input && gdb_datadir)
-+    {
-+      /* Also try the same file in a subdirectory of gdb's data
-+       directory.  */
-+      debugfile = xmalloc (strlen (gdb_datadir) + strlen (filename)
-+                         + strlen ("/auto-load") + 1);
-+      strcpy (debugfile, gdb_datadir);
-+      strcat (debugfile, "/auto-load");
-+      /* FILENAME is absolute, so we don't need a "/" here.  */
-+      strcat (debugfile, filename);
++  fclose (stream);
++  error (_("Python scripting is not supported in this copy of GDB."));
++}
 +
-+      make_cleanup (xfree, debugfile);
-+      input = fopen (debugfile, "r");
-+    }
+ #endif /* HAVE_PYTHON */
\f
+@@ -592,13 +897,27 @@ Enables or disables auto-loading of Python code when an object is opened."),
+   PyModule_AddStringConstant (gdb_module, "VERSION", (char*) version);
+   PyModule_AddStringConstant (gdb_module, "HOST_CONFIG", (char*) host_name);
+   PyModule_AddStringConstant (gdb_module, "TARGET_CONFIG", (char*) target_name);
++#ifdef PYTHONDIR
++  PyModule_AddStringConstant (gdb_module, "pythondir", PYTHONDIR);
++#else
++  if (gdb_datadir)
++    PyModule_AddStringConstant (gdb_module, "datadir", gdb_datadir);
++#endif
+   gdbpy_initialize_values ();
++  gdbpy_initialize_breakpoints ();
+   gdbpy_initialize_frames ();
++  gdbpy_initialize_symtabs ();
+   gdbpy_initialize_commands ();
++  gdbpy_initialize_symbols ();
++  gdbpy_initialize_blocks ();
+   gdbpy_initialize_functions ();
+   gdbpy_initialize_types ();
++  gdbpy_initialize_parameters ();
+   gdbpy_initialize_objfile ();
++  gdbpy_initialize_thread ();
++  gdbpy_initialize_inferior ();
++  gdbpy_initialize_events ();
+   PyRun_SimpleString ("import gdb");
+   PyRun_SimpleString ("gdb.pretty_printers = []");
+@@ -634,6 +953,15 @@ class GdbOutputFile:\n\
+ \n\
+ sys.stderr = GdbOutputFile()\n\
+ sys.stdout = GdbOutputFile()\n\
++if hasattr (gdb, 'datadir'):\n\
++  gdb.pythondir = gdb.datadir + '/python'\n\
++if hasattr (gdb, 'pythondir'):\n\
++  sys.path.insert(0, gdb.pythondir)\n\
++  gdb.__path__ = [gdb.pythondir + '/gdb']\n\
++  from os.path import exists\n\
++  ipy = gdb.pythondir + '/gdb/__init__.py'\n\
++  if exists (ipy):\n\
++    execfile (ipy)\n\
+ ");
+   /* Release the GIL while gdb runs.  */
+@@ -653,9 +981,14 @@ static PyMethodDef GdbMethods[] =
+     "Get a value from history" },
+   { "execute", execute_gdb_command, METH_VARARGS,
+     "Execute a gdb command" },
++  { "cli", gdbpy_cli, METH_NOARGS,
++    "Enter the gdb CLI" },
+   { "parameter", gdbpy_parameter, METH_VARARGS,
+     "Return a gdb parameter's value" },
++  { "breakpoints", gdbpy_breakpoints, METH_NOARGS,
++    "Return a tuple of all breakpoint objects" },
 +
-+  if (input)
-+    {
-+      /* We don't want to throw an exception here -- but the user
-+       would like to know that something went wrong.  */
-+      if (PyRun_SimpleFile (input, debugfile))
-+      gdbpy_print_stack ();
-+      fclose (input);
-+    }
+   { "default_visualizer", gdbpy_default_visualizer, METH_VARARGS,
+     "Find the default visualizer for a Value." },
+@@ -676,6 +1009,37 @@ Return a string explaining unwind stop reason." },
+     "lookup_type (name [, block]) -> type\n\
+ Return a Type corresponding to the given name." },
++  { "lookup_symbol", (PyCFunction) gdbpy_lookup_symbol,
++    METH_VARARGS | METH_KEYWORDS,
++    "lookup_symbol (name [, block] [, domain]) -> (symbol, is_field_of_this)\n\
++Return a tuple with the symbol corresponding to the given name (or None) and\n\
++a boolean indicating if name is a field of the current implied argument\n\
++`this' (when the current language is object-oriented)." },
++  { "solib_address", gdbpy_solib_address, METH_VARARGS,
++    "solib_address (Long) -> String.\n\
++Return the name of the shared library holding a given address, or None." },
 +
-+  do_cleanups (cleanups);
-+  gdbpy_current_objfile = NULL;
++  { "block_for_pc", gdbpy_block_for_pc, METH_VARARGS,
++    "Return the block containing the given pc value, or None." },
 +
-+  PyGILState_Release (state);
-+}
++  { "decode_line", gdbpy_decode_line, METH_VARARGS,
++    "Decode a string argument the way that 'break' or 'edit' does.\n\
++Return a tuple holding the file name (or None) and line number (or None).\n\
++Note: may later change to return an object." },
 +
-+/* Return the current Objfile, or None if there isn't one.  */
-+static PyObject *
-+gdbpy_get_current_objfile (PyObject *unused1, PyObject *unused2)
-+{
-+  PyObject *result;
++  { "selected_thread", gdbpy_selected_thread, METH_NOARGS,
++    "selected_thread () -> gdb.InferiorThread.\n\
++Return the selected thread object." },
++  { "inferiors", gdbpy_inferiors, METH_NOARGS,
++    "inferiors () -> (gdb.Inferior, ...).\n\
++Return a tuple containing all inferiors." },
 +
-+  if (! gdbpy_current_objfile)
-+    Py_RETURN_NONE;
++  { "parse_and_eval", gdbpy_parse_and_eval, METH_VARARGS,
++    "Parse a string as an expression, evaluate it, and return the result." },
 +
-+  result = objfile_to_objfile_object (gdbpy_current_objfile);
-+  if (result)
-+    Py_INCREF (result);
-+  return result;
-+}
++  { "post_event", gdbpy_post_event, METH_VARARGS,
++    "Post an event into gdb's event loop." },
 +
-+/* Return a sequence holding all the Objfiles.  */
-+static PyObject *
-+gdbpy_objfiles (PyObject *unused1, PyObject *unused2)
-+{
-+  struct objfile *objf;
-+  PyObject *list;
+   { "write", gdbpy_write, METH_VARARGS,
+     "Write a string using gdb's filtered stream." },
+   { "flush", gdbpy_flush, METH_NOARGS,
+diff --git a/gdb/python/python.h b/gdb/python/python.h
+index e970180..bbb6184 100644
+--- a/gdb/python/python.h
++++ b/gdb/python/python.h
+@@ -24,6 +24,10 @@
+ void eval_python_from_control_command (struct command_line *);
++void source_python_script (FILE *stream, char *file);
 +
-+  list = PyList_New (0);
-+  if (!list)
-+    return NULL;
++void run_python_script (int argc, char **argv);
 +
-+  ALL_OBJFILES (objf)
+ int apply_val_pretty_printer (struct type *type, const gdb_byte *valaddr,
+                             int embedded_offset, CORE_ADDR address,
+                             struct ui_file *stream, int recurse,
+diff --git a/gdb/scm-lang.c b/gdb/scm-lang.c
+index de34894..07518b0 100644
+--- a/gdb/scm-lang.c
++++ b/gdb/scm-lang.c
+@@ -233,6 +233,7 @@ const struct exp_descriptor exp_descriptor_scm =
+ {
+   print_subexp_standard,
+   operator_length_standard,
++  operator_check_standard,
+   op_name_standard,
+   dump_subexp_body_standard,
+   evaluate_exp
+diff --git a/gdb/scm-valprint.c b/gdb/scm-valprint.c
+index cc3319a..d0d4702 100644
+--- a/gdb/scm-valprint.c
++++ b/gdb/scm-valprint.c
+@@ -62,9 +62,9 @@ scm_inferior_print (struct type *type, LONGEST value, struct ui_file *stream,
+     {
+       /* XXX: Should we cache these symbols?  */
+       gdb_output_sym =
+-      lookup_symbol_global ("gdb_output", NULL, NULL, VAR_DOMAIN);
++      lookup_symbol_global ("gdb_output", NULL, VAR_DOMAIN);
+       gdb_output_len_sym =
+-      lookup_symbol_global ("gdb_output_length", NULL, NULL, VAR_DOMAIN);
++      lookup_symbol_global ("gdb_output_length", NULL, VAR_DOMAIN);
+       if ((gdb_output_sym == NULL) || (gdb_output_len_sym == NULL))
+       ret = -1;
+diff --git a/gdb/solib-darwin.c b/gdb/solib-darwin.c
+index 8b96a6f..9428d92 100644
+--- a/gdb/solib-darwin.c
++++ b/gdb/solib-darwin.c
+@@ -389,7 +389,6 @@ darwin_relocate_section_addresses (struct so_list *so,
+ static struct symbol *
+ darwin_lookup_lib_symbol (const struct objfile *objfile,
+                         const char *name,
+-                        const char *linkage_name,
+                         const domain_enum domain)
+ {
+   return NULL;
+diff --git a/gdb/solib-spu.c b/gdb/solib-spu.c
+index 19e3212..9f06fa9 100644
+--- a/gdb/solib-spu.c
++++ b/gdb/solib-spu.c
+@@ -334,16 +334,13 @@ spu_bfd_open (char *pathname)
+ static struct symbol *
+ spu_lookup_lib_symbol (const struct objfile *objfile,
+                      const char *name,
+-                     const char *linkage_name,
+                      const domain_enum domain)
+ {
+   if (bfd_get_arch (objfile->obfd) == bfd_arch_spu)
+-    return lookup_global_symbol_from_objfile (objfile, name, linkage_name,
+-                                            domain);
++    return lookup_global_symbol_from_objfile (objfile, name, domain);
+   if (svr4_so_ops.lookup_lib_global_symbol != NULL)
+-    return svr4_so_ops.lookup_lib_global_symbol (objfile, name, linkage_name,
+-                                               domain);
++    return svr4_so_ops.lookup_lib_global_symbol (objfile, name, domain);
+   return NULL;
+ }
+diff --git a/gdb/solib-svr4.c b/gdb/solib-svr4.c
+index 6cfaa85..68aadc0 100644
+--- a/gdb/solib-svr4.c
++++ b/gdb/solib-svr4.c
+@@ -1908,15 +1908,13 @@ struct target_so_ops svr4_so_ops;
+ static struct symbol *
+ elf_lookup_lib_symbol (const struct objfile *objfile,
+                      const char *name,
+-                     const char *linkage_name,
+                      const domain_enum domain)
+ {
+   if (objfile->obfd == NULL
+      || scan_dyntag (DT_SYMBOLIC, objfile->obfd, NULL) != 1)
+     return NULL;
+-  return lookup_global_symbol_from_objfile
+-              (objfile, name, linkage_name, domain);
++  return lookup_global_symbol_from_objfile (objfile, name, domain);
+ }
+ extern initialize_file_ftype _initialize_svr4_solib; /* -Wmissing-prototypes */
+diff --git a/gdb/solib.c b/gdb/solib.c
+index a2ad0c4..3574e62 100644
+--- a/gdb/solib.c
++++ b/gdb/solib.c
+@@ -1127,13 +1127,12 @@ show_auto_solib_add (struct ui_file *file, int from_tty,
+ struct symbol *
+ solib_global_lookup (const struct objfile *objfile,
+                    const char *name,
+-                   const char *linkage_name,
+                    const domain_enum domain)
+ {
+   struct target_so_ops *ops = solib_ops (target_gdbarch);
+   if (ops->lookup_lib_global_symbol != NULL)
+-    return ops->lookup_lib_global_symbol (objfile, name, linkage_name, domain);
++    return ops->lookup_lib_global_symbol (objfile, name, domain);
+   return NULL;
+ }
+diff --git a/gdb/solist.h b/gdb/solist.h
+index 63a6ba0..005e8f7 100644
+--- a/gdb/solist.h
++++ b/gdb/solist.h
+@@ -114,7 +114,6 @@ struct target_so_ops
+     /* Hook for looking up global symbols in a library-specific way.  */
+     struct symbol * (*lookup_lib_global_symbol) (const struct objfile *objfile,
+                                                const char *name,
+-                                               const char *linkage_name,
+                                                const domain_enum domain);
+     /* Given two so_list objects, one from the GDB thread list
+@@ -146,7 +145,6 @@ extern struct target_so_ops *current_target_so_ops;
+ /* Handler for library-specific global symbol lookup in solib.c.  */
+ struct symbol *solib_global_lookup (const struct objfile *objfile,
+                                   const char *name,
+-                                  const char *linkage_name,
+                                   const domain_enum domain);
+ #endif
+diff --git a/gdb/somread.c b/gdb/somread.c
+index 36a2b28..4d5bda9 100644
+--- a/gdb/somread.c
++++ b/gdb/somread.c
+@@ -435,6 +435,7 @@ static struct sym_fns som_sym_fns =
+   som_new_init,                       /* sym_new_init: init anything gbl to entire symtab */
+   som_symfile_init,           /* sym_init: read initial info, setup for sym_read() */
+   som_symfile_read,           /* sym_read: read a symbol file into symtab */
++  NULL,                               /* sym_read_psymbols */
+   som_symfile_finish,         /* sym_finish: finished with file, cleanup */
+   som_symfile_offsets,                /* sym_offsets:  Translate ext. to int. relocation */
+   default_symfile_segments,   /* sym_segments: Get segment information from
+diff --git a/gdb/spu-tdep.c b/gdb/spu-tdep.c
+index 7e7ab9c..a014b7a 100644
+--- a/gdb/spu-tdep.c
++++ b/gdb/spu-tdep.c
+@@ -1839,7 +1839,7 @@ spu_catch_start (struct objfile *objfile)
+       struct symbol *sym;
+       struct symtab_and_line sal;
+-      sym = lookup_block_symbol (block, "main", NULL, VAR_DOMAIN);
++      sym = lookup_block_symbol (block, "main", VAR_DOMAIN);
+       if (sym)
+       {
+         fixup_symbol_section (sym, objfile);
+diff --git a/gdb/stabsread.c b/gdb/stabsread.c
+index e62bb15..ad6568e 100644
+--- a/gdb/stabsread.c
++++ b/gdb/stabsread.c
+@@ -322,7 +322,7 @@ dbx_alloc_type (int typenums[2], struct objfile *objfile)
+   if (typenums[0] == -1)
+     {
+-      return (alloc_type (objfile));
++      return (alloc_type (objfile, NULL));
+     }
+   type_addr = dbx_lookup_type (typenums, objfile);
+@@ -332,7 +332,7 @@ dbx_alloc_type (int typenums[2], struct objfile *objfile)
+      We will fill it in later if we find out how.  */
+   if (*type_addr == 0)
+     {
+-      *type_addr = alloc_type (objfile);
++      *type_addr = alloc_type (objfile, NULL);
+     }
+   return (*type_addr);
+diff --git a/gdb/stack.c b/gdb/stack.c
+index 1c37801..594eb16 100644
+--- a/gdb/stack.c
++++ b/gdb/stack.c
+@@ -1308,24 +1308,24 @@ backtrace_command_1 (char *count_exp, int show_locals, int from_tty)
+   else
+     count = -1;
+-  if (info_verbose)
+-    {
+-      struct partial_symtab *ps;
+-
+-      /* Read in symbols for all of the frames.  Need to do this in a
+-         separate pass so that "Reading in symbols for xxx" messages
+-         don't screw up the appearance of the backtrace.  Also if
+-         people have strong opinions against reading symbols for
+-         backtrace this may have to be an option.  */
+-      i = count;
+-      for (fi = trailing; fi != NULL && i--; fi = get_prev_frame (fi))
+-      {
+-        QUIT;
+-        ps = find_pc_psymtab (get_frame_address_in_block (fi));
+-        if (ps)
+-          PSYMTAB_TO_SYMTAB (ps); /* Force syms to come in.  */
+-      }
+-    }
 +  {
-+    PyObject *item = objfile_to_objfile_object (objf);
-+    if (!item || PyList_Append (list, item) == -1)
-+      {
-+      Py_DECREF (list);
-+      return NULL;
-+      }
-+  }
++    struct partial_symtab *ps;
 +
-+  return list;
-+}
-+
-+\f
-+
-+/* Helper function for find_pretty_printer which iterates over a
-+   list, calls each function and inspects output.  */
-+static PyObject *
-+search_pp_list (PyObject *list, PyObject *value)
++    /* Read in symbols for all of the frames.  Need to do this
++       unconditionally to ensure that psymbols are read.  Also need to
++       do this in a separate pass so that "Reading in symbols for xxx"
++       messages don't screw up the appearance of the backtrace.  Also
++       if people have strong opinions against reading symbols for
++       backtrace this may have to be an option.  */
++    i = count;
++    for (fi = trailing; fi != NULL && i--; fi = get_prev_frame (fi))
++      {
++      QUIT;
++      ps = find_pc_psymtab (get_frame_address_in_block (fi));
++      if (info_verbose && ps)
++        PSYMTAB_TO_SYMTAB (ps); /* Force syms to come in.  */
++      }
++  }
+   for (i = 0, fi = trailing; fi && count--; i++, fi = get_prev_frame (fi))
+     {
+@@ -1473,6 +1473,8 @@ print_block_frame_locals (struct block *b, struct frame_info *frame,
+       case LOC_COMPUTED:
+         if (SYMBOL_IS_ARGUMENT (sym))
+           break;
++        if (SYMBOL_DOMAIN (sym) == COMMON_BLOCK_DOMAIN)
++          break;
+         values_printed = 1;
+         print_variable_and_value (NULL, sym, frame, stream, 4 * num_tabs);
+         break;
+diff --git a/gdb/symfile.c b/gdb/symfile.c
+index 2458201..c31b72a 100644
+--- a/gdb/symfile.c
++++ b/gdb/symfile.c
+@@ -921,6 +921,17 @@ new_symfile_objfile (struct objfile *objfile, int add_flags)
+   clear_complaints (&symfile_complaints, 0, add_flags & SYMFILE_VERBOSE);
+ }
++/* A helper function which returns true if OBJFILE has any debug
++   symbols, and false otherwise.  */
++static int
++has_any_debug_symbols (struct objfile *objfile)
 +{
-+  Py_ssize_t pp_list_size, list_index;
-+  PyObject *function, *printer = NULL;
-+  
-+  pp_list_size = PyList_Size (list);
-+  for (list_index = 0; list_index < pp_list_size; list_index++)
-+    {
-+      function = PyList_GetItem (list, list_index);
-+      if (! function)
-+      return NULL;
++  return (objfile->psymtabs || objfile->quick_addrmap
++        || (objfile->separate_debug_objfile
++            && (objfile->separate_debug_objfile->psymtabs
++                || objfile->separate_debug_objfile->quick_addrmap)));
++}
 +
-+      /* gdbpy_instantiate_printer can return three possible return
-+       values:  NULL on error;  Py_None if the pretty-printer
-+       in the list cannot print the value; or a printer instance if
-+       the printer can print the value.  */
-+      printer = gdbpy_instantiate_printer (function, value);
-+      if (! printer)
-+      return NULL;
-+      else if (printer != Py_None)
-+      return printer;
+ /* Process a symbol file, as either the main file or as a dynamically
+    loaded file.
+@@ -958,13 +969,16 @@ symbol_file_add_with_addrs_or_offsets (bfd *abfd,
+   /* Give user a chance to burp if we'd be
+      interactively wiping out any existing symbols.  */
+-  if ((have_full_symbols () || have_partial_symbols ())
+-      && (add_flags & SYMFILE_MAINLINE)
++  if ((add_flags & SYMFILE_MAINLINE)
++      && (have_full_symbols () || have_partial_symbols ())
+       && from_tty
++      && (have_full_symbols () || have_partial_symbols ())
+       && !query (_("Load new symbol table from \"%s\"? "), name))
+     error (_("Not confirmed."));
+   objfile = allocate_objfile (abfd, flags);
++  if (add_flags & SYMFILE_MAINLINE)
++    objfile->flags |= OBJF_MAIN;
+   discard_cleanups (my_cleanups);
+   if (addrs)
+@@ -997,6 +1011,8 @@ symbol_file_add_with_addrs_or_offsets (bfd *abfd,
+   if ((flags & OBJF_READNOW) || readnow_symbol_files)
+     {
++      require_partial_symbols (objfile);
 +
-+      Py_DECREF (printer);
-+    }
+       if (from_tty || info_verbose)
+       {
+         printf_unfiltered (_("expanding to full symbols..."));
+@@ -1015,7 +1031,7 @@ symbol_file_add_with_addrs_or_offsets (bfd *abfd,
+   /* If the file has its own symbol tables it has no separate debug info.
+      `.dynsym'/`.symtab' go to MSYMBOLS, `.debug_info' goes to SYMTABS/PSYMTABS.
+      `.gnu_debuglink' may no longer be present with `.note.gnu.build-id'.  */
+-  if (objfile->psymtabs == NULL)
++  if (!has_any_debug_symbols (objfile))
+     debugfile = find_separate_debug_file (objfile);
+   if (debugfile)
+     {
+@@ -1039,9 +1055,10 @@ symbol_file_add_with_addrs_or_offsets (bfd *abfd,
+       xfree (debugfile);
+     }
++  /* has_any_debug_symbols is not fully compatible with the former calls which
++     would just be needlessly expensive here.  */
+   if ((from_tty || info_verbose)
+-      && !objfile_has_partial_symbols (objfile)
+-      && !objfile_has_full_symbols (objfile))
++      && !has_any_debug_symbols (objfile))
+     {
+       wrap_here ("");
+       printf_unfiltered (_("(no debugging symbols found)..."));
+@@ -2422,14 +2439,15 @@ reread_symbols (void)
+                zero is OK since dbxread.c also does what it needs to do if
+                objfile->global_psymbols.size is 0.  */
+             (*objfile->sf->sym_read) (objfile, 0);
+-            if (!objfile_has_partial_symbols (objfile)
+-                && !objfile_has_full_symbols (objfile))
++            if (!has_any_debug_symbols (objfile))
+               {
+                 wrap_here ("");
+                 printf_unfiltered (_("(no debugging symbols found)\n"));
+                 wrap_here ("");
+               }
++            objfile->flags &= ~OBJF_SYMTABS_READ;
 +
-+  Py_RETURN_NONE;
-+}
+             /* We're done reading the symbol file; finish off complaints.  */
+             clear_complaints (&symfile_complaints, 0, 1);
+@@ -2727,7 +2745,7 @@ allocate_symtab (char *filename, struct objfile *objfile)
+ }
+ struct partial_symtab *
+-allocate_psymtab (char *filename, struct objfile *objfile)
++allocate_psymtab (const char *filename, struct objfile *objfile)
+ {
+   struct partial_symtab *psymtab;
+@@ -3041,7 +3059,8 @@ again2:
+ struct partial_symtab *
+ start_psymtab_common (struct objfile *objfile,
+-                    struct section_offsets *section_offsets, char *filename,
++                    struct section_offsets *section_offsets,
++                    const char *filename,
+                     CORE_ADDR textlow, struct partial_symbol **global_syms,
+                     struct partial_symbol **static_syms)
+ {
+diff --git a/gdb/symfile.h b/gdb/symfile.h
+index 8c9249c..bf9d9e7 100644
+--- a/gdb/symfile.h
++++ b/gdb/symfile.h
+@@ -140,6 +140,12 @@ struct sym_fns
+   void (*sym_read) (struct objfile *, int);
++  /* Read the partial symbols for an objfile.  This may be NULL, in
++     which case gdb assumes that sym_read already read the partial
++     symbols.  */
 +
-+/* Find the pretty-printing constructor function for TYPE.  If no
-+   pretty-printer exists, return NULL.  If one exists, return a new
-+   reference.  */
-+static PyObject *
-+find_pretty_printer (PyObject *value)
-+{
-+  PyObject *pp_list = NULL;
-+  PyObject *function = NULL;
-+  struct objfile *obj;
-+  volatile struct gdb_exception except;
++  void (*sym_read_psymbols) (struct objfile *);
 +
-+  /* Look at the pretty-printer dictionary for each objfile.  */
-+  ALL_OBJFILES (obj)
+   /* Called when we are finished with an objfile.  Should do all
+      cleanup that is specific to the object file format for the
+      particular objfile.  */
+@@ -266,7 +272,7 @@ extern void free_section_addr_info (struct section_addr_info *);
+ extern struct partial_symtab *start_psymtab_common (struct objfile *,
+                                                   struct section_offsets *,
+-                                                  char *, CORE_ADDR,
++                                                  const char *, CORE_ADDR,
+                                                   struct partial_symbol **,
+                                                   struct partial_symbol **);
+@@ -309,7 +315,7 @@ extern int auto_solib_limit;
+ extern void set_initial_language (void);
+-extern struct partial_symtab *allocate_psymtab (char *, struct objfile *);
++extern struct partial_symtab *allocate_psymtab (const char *, struct objfile *);
+ extern void discard_psymtab (struct partial_symtab *);
+@@ -378,7 +384,7 @@ void free_symfile_segment_data (struct symfile_segment_data *data);
+ /* From dwarf2read.c */
+ extern int dwarf2_has_info (struct objfile *);
+-
++extern void dwarf2_create_quick_addrmap (struct objfile *);
+ extern void dwarf2_build_psymtabs (struct objfile *, int);
+ extern void dwarf2_build_frame_info (struct objfile *);
+diff --git a/gdb/symmisc.c b/gdb/symmisc.c
+index eb35369..dfd8c8c 100644
+--- a/gdb/symmisc.c
++++ b/gdb/symmisc.c
+@@ -1128,7 +1128,7 @@ maintenance_check_symtabs (char *ignore, int from_tty)
+     while (length--)
+       {
+       sym = lookup_block_symbol (b, SYMBOL_LINKAGE_NAME (*psym),
+-                                 NULL, SYMBOL_DOMAIN (*psym));
++                                 SYMBOL_DOMAIN (*psym));
+       if (!sym)
+         {
+           printf_filtered ("Static symbol `");
+@@ -1145,7 +1145,7 @@ maintenance_check_symtabs (char *ignore, int from_tty)
+     while (length--)
+       {
+       sym = lookup_block_symbol (b, SYMBOL_LINKAGE_NAME (*psym),
+-                                 NULL, SYMBOL_DOMAIN (*psym));
++                                 SYMBOL_DOMAIN (*psym));
+       if (!sym)
+         {
+           printf_filtered ("Global symbol `");
+diff --git a/gdb/symtab.c b/gdb/symtab.c
+index 8d9d72c..82e0163 100644
+--- a/gdb/symtab.c
++++ b/gdb/symtab.c
+@@ -42,6 +42,7 @@
+ #include "ada-lang.h"
+ #include "p-lang.h"
+ #include "addrmap.h"
++#include "cp-support.h"
+ #include "hashtab.h"
+@@ -85,7 +86,6 @@ static int find_line_common (struct linetable *, int, int *);
+ char *operator_chars (char *p, char **end);
+ static struct symbol *lookup_symbol_aux (const char *name,
+-                                       const char *linkage_name,
+                                        const struct block *block,
+                                        const domain_enum domain,
+                                        enum language language,
+@@ -93,20 +93,19 @@ static struct symbol *lookup_symbol_aux (const char *name,
+ static
+ struct symbol *lookup_symbol_aux_local (const char *name,
+-                                      const char *linkage_name,
+                                       const struct block *block,
+-                                      const domain_enum domain);
++                                      const domain_enum domain,
++                                      enum language language,
++                                      int *is_a_field_of_this);
+ static
+ struct symbol *lookup_symbol_aux_symtabs (int block_index,
+                                         const char *name,
+-                                        const char *linkage_name,
+                                         const domain_enum domain);
+ static
+ struct symbol *lookup_symbol_aux_psymtabs (int block_index,
+                                          const char *name,
+-                                         const char *linkage_name,
+                                          const domain_enum domain);
+ static int file_matches (char *, char **, int);
+@@ -271,7 +270,7 @@ lookup_partial_symtab (const char *name)
+       make_cleanup (xfree, real_path);
+     }
+-  ALL_PSYMTABS (objfile, pst)
++  ALL_PSYMTABS_REQUIRED (objfile, pst)
+   {
+     if (FILENAME_CMP (name, pst->filename) == 0)
+       {
+@@ -414,7 +413,8 @@ symbol_init_language_specific (struct general_symbol_info *gsymbol,
+   gsymbol->language = language;
+   if (gsymbol->language == language_cplus
+       || gsymbol->language == language_java
+-      || gsymbol->language == language_objc)
++      || gsymbol->language == language_objc
++      || gsymbol->language == language_fortran)
+     {
+       gsymbol->language_specific.cplus_specific.demangled_name = NULL;
+     }
+@@ -474,7 +474,7 @@ symbol_find_demangled_name (struct general_symbol_info *gsymbol,
+       || gsymbol->language == language_auto)
+     {
+       demangled =
+-        cplus_demangle (mangled, DMGL_PARAMS | DMGL_ANSI);
++        cplus_demangle (mangled, DMGL_PARAMS | DMGL_ANSI | DMGL_VERBOSE);
+       if (demangled != NULL)
+       {
+         gsymbol->language = language_cplus;
+@@ -633,6 +633,7 @@ symbol_natural_name (const struct general_symbol_info *gsymbol)
+     case language_cplus:
+     case language_java:
+     case language_objc:
++    case language_fortran:
+       if (gsymbol->language_specific.cplus_specific.demangled_name != NULL)
+       return gsymbol->language_specific.cplus_specific.demangled_name;
+       break;
+@@ -658,6 +659,7 @@ symbol_demangled_name (const struct general_symbol_info *gsymbol)
+     case language_cplus:
+     case language_java:
+     case language_objc:
++    case language_fortran:
+       if (gsymbol->language_specific.cplus_specific.demangled_name != NULL)
+       return gsymbol->language_specific.cplus_specific.demangled_name;
+       break;
+@@ -868,7 +870,13 @@ find_pc_sect_psymtab (CORE_ADDR pc, struct obj_section *section)
+      than the later used TEXTLOW/TEXTHIGH one.  */
+   ALL_OBJFILES (objfile)
+-    if (objfile->psymtabs_addrmap != NULL)
 +  {
-+    PyObject *objf = objfile_to_objfile_object (obj);
-+    if (!objf)
-+      continue;
-+
-+    pp_list = objfpy_get_printers (objf, NULL);
-+    function = search_pp_list (pp_list, value);
-+
-+    /* If there is an error in any objfile list, abort the search and
-+       exit.  */
-+    if (! function)
++    if (objfile->quick_addrmap)
 +      {
-+      Py_XDECREF (pp_list);
-+      return NULL;
++      if (!addrmap_find (objfile->quick_addrmap, pc))
++        continue;
 +      }
-+
-+    if (function != Py_None)
-+      goto done;
-+    
-+    /* In this loop, if function is not an instantiation of a
-+    pretty-printer, and it is not null, then it is a return of
-+    Py_RETURN_NONE, which must be decremented.  */
-+    Py_DECREF (function);
-+    Py_XDECREF (pp_list);
++    if (require_partial_symbols (objfile)->psymtabs_addrmap != NULL)
+       {
+       struct partial_symtab *pst;
+@@ -901,6 +909,7 @@ find_pc_sect_psymtab (CORE_ADDR pc, struct obj_section *section)
+           return pst;
+         }
+       }
 +  }
+   /* Existing PSYMTABS_ADDRMAP mapping is present even for PARTIAL_SYMTABs
+      which still have no corresponding full SYMTABs read.  But it is not
+@@ -1168,6 +1177,22 @@ fixup_psymbol_section (struct partial_symbol *psym, struct objfile *objfile)
+   return psym;
+ }
++/* Ensure that the partial symbols for OBJFILE have been loaded.  This
++   function always returns its argument, as a convenience.  */
 +
-+  pp_list = NULL;
-+  /* Fetch the global pretty printer dictionary.  */
-+  if (! PyObject_HasAttrString (gdb_module, "pretty_printers"))
-+    goto done;
-+  pp_list = PyObject_GetAttrString (gdb_module, "pretty_printers");
-+  if (! pp_list)
-+    goto done;
-+  if (! PyList_Check (pp_list))
-+    goto done;
-+
-+  function = search_pp_list (pp_list, value);
-+
-+ done:
-+  Py_XDECREF (pp_list);
-+  
-+  return function;
-+}
-+
-+/* Pretty-print a single value, via the printer object PRINTER.  If
-+   the function returns a string, an xmalloc()d copy is returned.
-+   Otherwise, if the function returns a value, a *OUT_VALUE is set to
-+   the value, and NULL is returned.  On error, *OUT_VALUE is set to
-+   NULL and NULL is returned.  */
-+static char *
-+pretty_print_one_value (PyObject *printer, struct value **out_value)
++struct objfile *
++require_partial_symbols (struct objfile *objfile)
 +{
-+  char *output = NULL;
-+  volatile struct gdb_exception except;
-+
-+  TRY_CATCH (except, RETURN_MASK_ALL)
++  if ((objfile->flags & OBJF_SYMTABS_READ) == 0)
 +    {
-+      PyObject *result;
++      objfile->flags |= OBJF_SYMTABS_READ;
 +
-+      result = PyObject_CallMethodObjArgs (printer, gdbpy_to_string_cst, NULL);
-+      if (result)
-+      {
-+        if (gdbpy_is_string (result))
-+          output = python_string_to_host_string (result);
-+        else if (PyObject_TypeCheck (result, &value_object_type))
-+          {
-+            /* If we just call convert_value_from_python for this
-+               type, we won't know who owns the result.  For this
-+               one case we need to copy the resulting value.  */
-+            struct value *v = value_object_to_value (result);
-+            *out_value = value_copy (v);
-+          }
-+        else
-+          *out_value = convert_value_from_python (result);
-+        Py_DECREF (result);
-+      }
++      if (objfile->sf->sym_read_psymbols)
++      (*objfile->sf->sym_read_psymbols) (objfile);
 +    }
-+
-+  return output;
-+}
-+
-+/* Instantiate a pretty-printer given a constructor, CONS, and a
-+   value, VAL.  Return NULL on error.  Ownership of the object
-+   instance is transferred to the reciever */
-+PyObject *
-+gdbpy_instantiate_printer (PyObject *cons, PyObject *value)
-+{
-+  PyObject *result;
-+  result = PyObject_CallFunctionObjArgs (cons, value, NULL);
-+  return result;
++  return objfile;
 +}
 +
-+/* Return the display hint for the object printer, PRINTER.  Return
-+   NULL if there is no display_hint method, or if the method did not
-+   return a string.  On error, print stack trace and return NULL.  On
-+   success, return an xmalloc()d string.  */
-+char *
-+gdbpy_get_display_hint (PyObject *printer)
-+{
-+  PyObject *hint;
-+  char *result = NULL;
-+
-+  if (! PyObject_HasAttr (printer, gdbpy_display_hint_cst))
-+    return NULL;
-+
-+  hint = PyObject_CallMethodObjArgs (printer, gdbpy_display_hint_cst, NULL);
-+  if (gdbpy_is_string (hint))
-+    result = python_string_to_host_string (hint);
-+  if (hint)
-+    Py_DECREF (hint);
-+  else
-+    gdbpy_print_stack ();
-+
-+  return result;
-+}
-+
-+/* Helper for apply_val_pretty_printer which calls to_string and
-+   formats the result.  */
-+static void
-+print_string_repr (PyObject *printer, const char *hint,
-+                 struct ui_file *stream, int recurse,
-+                 const struct value_print_options *options,
-+                 const struct language_defn *language)
-+{
-+  char *output;
-+  struct value *replacement = NULL;
-+
-+  output = pretty_print_one_value (printer, &replacement);
-+  if (output)
-+    {
-+      if (hint && !strcmp (hint, "string"))
-+      {
-+        struct type *string_char_type;
-+
-+        /* OUTPUT is already in the hosts's charset.  */
-+        string_char_type = language_string_char_type (language,
-+                                                      current_gdbarch);
-+        LA_PRINT_STRING (stream, string_char_type, (gdb_byte *) output,
-+                         strlen (output), 0, options);
-+      }
-+      else
-+      fputs_filtered (output, stream);
-+      xfree (output);
-+    }
-+  else if (replacement)
-+    common_val_print (replacement, stream, recurse, options, language);
-+  else
-+    gdbpy_print_stack ();
-+}
-+
-+static void
-+py_restore_tstate (void *p)
-+{
-+  PyFrameObject *frame = p;
-+  PyThreadState *tstate = PyThreadState_GET ();
-+  tstate->frame = frame;
-+}
-+
-+/* Create a dummy PyFrameObject, needed to work around
-+   a Python-2.4 bug with generators.  */
-+static PyObject *
-+push_dummy_python_frame ()
-+{
-+  PyObject *empty_string, *null_tuple, *globals;
-+  PyCodeObject *code;
-+  PyFrameObject *frame;
-+  PyThreadState *tstate;
-+
-+  empty_string = PyString_FromString ("");
-+  if (!empty_string)
-+    return NULL;
-+
-+  null_tuple = PyTuple_New (0);
-+  if (!null_tuple)
-+    {
-+      Py_DECREF (empty_string);
-+      return NULL;
-+    }
-+
-+  code = PyCode_New (0,                       /* argcount */
-+                   0,                 /* nlocals */
-+                   0,                 /* stacksize */
-+                   0,                 /* flags */
-+                   empty_string,      /* code */
-+                   null_tuple,        /* consts */
-+                   null_tuple,        /* names */
-+                   null_tuple,        /* varnames */
-+#if PYTHON_API_VERSION >= 1010
-+                   null_tuple,        /* freevars */
-+                   null_tuple,        /* cellvars */
-+#endif
-+                   empty_string,      /* filename */
-+                   empty_string,      /* name */
-+                   1,                 /* firstlineno */
-+                   empty_string       /* lnotab */
-+                  );
-+
-+  Py_DECREF (empty_string);
-+  Py_DECREF (null_tuple);
-+
-+  if (!code)
-+    return NULL;
-+
-+  globals = PyDict_New ();
-+  if (!globals)
-+    {
-+      Py_DECREF (code);
-+      return NULL;
-+    }
-+
-+  tstate = PyThreadState_GET ();
-+
-+  frame = PyFrame_New (tstate, code, globals, NULL);
-+
-+  Py_DECREF (globals);
-+  Py_DECREF (code);
-+
-+  if (!frame)
-+    return NULL;
-+
-+  tstate->frame = frame;
-+  make_cleanup (py_restore_tstate, frame->f_back);
-+  return (PyObject *) frame;
-+}
-+
-+/* Helper for apply_val_pretty_printer that formats children of the
-+   printer, if any exist.  */
-+static void
-+print_children (PyObject *printer, const char *hint,
-+              struct ui_file *stream, int recurse,
-+              const struct value_print_options *options,
-+              const struct language_defn *language)
-+{
-+  int is_map, is_array, done_flag, pretty;
-+  unsigned int i;
-+  PyObject *children, *iter, *frame;
-+  struct cleanup *cleanups;
-+
-+  if (! PyObject_HasAttr (printer, gdbpy_children_cst))
-+    return;
-+
-+  /* If we are printing a map or an array, we want some special
-+     formatting.  */
-+  is_map = hint && ! strcmp (hint, "map");
-+  is_array = hint && ! strcmp (hint, "array");
-+
-+  children = PyObject_CallMethodObjArgs (printer, gdbpy_children_cst,
-+                                       NULL);
-+  if (! children)
-+    {
-+      gdbpy_print_stack ();
-+      return;
-+    }
-+
-+  cleanups = make_cleanup_py_decref (children);
-+
-+  iter = PyObject_GetIter (children);
-+  if (!iter)
-+    {
-+      gdbpy_print_stack ();
-+      goto done;
-+    }
-+  make_cleanup_py_decref (iter);
-+
-+  /* Use the prettyprint_arrays option if we are printing an array,
-+     and the pretty option otherwise.  */
-+  pretty = is_array ? options->prettyprint_arrays : options->pretty;
-+
-+  /* Manufacture a dummy Python frame to work around Python 2.4 bug,
-+     where it insists on having a non-NULL tstate->frame when
-+     a generator is called.  */
-+  frame = push_dummy_python_frame ();
-+  if (!frame)
-+    {
-+      gdbpy_print_stack ();
-+      goto done;
-+    }
-+  make_cleanup_py_decref (frame);
-+
-+  done_flag = 0;
-+  for (i = 0; i < options->print_max; ++i)
-+    {
-+      PyObject *py_v, *item = PyIter_Next (iter);
-+      char *name;
-+      struct cleanup *inner_cleanup;
-+
-+      if (! item)
-+      {
-+        if (PyErr_Occurred ())
-+          gdbpy_print_stack ();
-+        /* Set a flag so we can know whether we printed all the
-+           available elements.  */
-+        else    
-+          done_flag = 1;
-+        break;
-+      }
-+
-+      if (! PyArg_ParseTuple (item, "sO", &name, &py_v))
-+      {
-+        gdbpy_print_stack ();
-+        Py_DECREF (item);
-+        continue;
-+      }
-+      inner_cleanup = make_cleanup_py_decref (item);
-+
-+      /* Print initial "{".  For other elements, there are three
-+       cases:
-+       1. Maps.  Print a "," after each value element.
-+       2. Arrays.  Always print a ",".
-+       3. Other.  Always print a ",".  */
-+      if (i == 0)
-+      fputs_filtered (" = {", stream);
-+      else if (! is_map || i % 2 == 0)
-+      fputs_filtered (pretty ? "," : ", ", stream);
-+
-+      /* In summary mode, we just want to print "= {...}" if there is
-+       a value.  */
-+      if (options->summary)
-+      {
-+        /* This increment tricks the post-loop logic to print what
-+           we want.  */
-+        ++i;
-+        /* Likewise.  */
-+        pretty = 0;
-+        break;
-+      }
-+
-+      if (! is_map || i % 2 == 0)
-+      {
-+        if (pretty)
-+          {
-+            fputs_filtered ("\n", stream);
-+            print_spaces_filtered (2 + 2 * recurse, stream);
-+          }
-+        else
-+          wrap_here (n_spaces (2 + 2 *recurse));
-+      }
-+
-+      if (is_map && i % 2 == 0)
-+      fputs_filtered ("[", stream);
-+      else if (is_array)
-+      {
-+        /* We print the index, not whatever the child method
-+           returned as the name.  */
-+        if (options->print_array_indexes)
-+          fprintf_filtered (stream, "[%d] = ", i);
-+      }
-+      else if (! is_map)
-+      {
-+        fputs_filtered (name, stream);
-+        fputs_filtered (" = ", stream);
-+      }
-+
-+      if (gdbpy_is_string (py_v))
-+      {
-+        char *text = python_string_to_host_string (py_v);
-+        if (! text)
-+          gdbpy_print_stack ();
-+        else
-+          {
-+            fputs_filtered (text, stream);
-+            xfree (text);
-+          }
-+      }
-+      else
-+      {
-+        struct value *value = convert_value_from_python (py_v);
-+
-+        if (value == NULL)
-+          {
-+            gdbpy_print_stack ();
-+            error (_("Error while executing Python code."));
-+          }
-+        else
-+          common_val_print (value, stream, recurse + 1, options, language);
-+      }
-+
-+      if (is_map && i % 2 == 0)
-+      fputs_filtered ("] = ", stream);
-+
-+      do_cleanups (inner_cleanup);
-+    }
-+
-+  if (i)
-+    {
-+      if (!done_flag)
-+      {
-+        if (pretty)
-+          {
-+            fputs_filtered ("\n", stream);
-+            print_spaces_filtered (2 + 2 * recurse, stream);
-+          }
-+        fputs_filtered ("...", stream);
-+      }
-+      if (pretty)
-+      {
-+        fputs_filtered ("\n", stream);
-+        print_spaces_filtered (2 * recurse, stream);
-+      }
-+      fputs_filtered ("}", stream);
-+    }
-+
-+ done:
-+  do_cleanups (cleanups);
-+}
-+
-+int
-+apply_val_pretty_printer (struct type *type, const gdb_byte *valaddr,
-+                        int embedded_offset, CORE_ADDR address,
-+                        struct ui_file *stream, int recurse,
-+                        const struct value_print_options *options,
-+                        const struct language_defn *language)
-+{
-+  PyObject *printer = NULL;
-+  PyObject *val_obj = NULL;
-+  struct value *value;
-+  char *hint = NULL;
-+  struct cleanup *cleanups;
-+  int result = 0;
-+  PyGILState_STATE state;
-+
-+  state = PyGILState_Ensure ();
-+  cleanups = make_cleanup_py_restore_gil (&state);
-+
-+  /* Instantiate the printer.  */
-+  if (valaddr)
-+    valaddr += embedded_offset;
-+  value = value_from_contents_and_address (type, valaddr, address);
-+
-+  val_obj = value_to_value_object (value);
-+  if (! val_obj)
-+    goto done;
-+  
-+  /* Find the constructor.  */
-+  printer = find_pretty_printer (val_obj);
-+  Py_DECREF (val_obj);
-+  make_cleanup_py_decref (printer);
-+  if (! printer || printer == Py_None)
-+    goto done;
-+
-+  /* If we are printing a map, we want some special formatting.  */
-+  hint = gdbpy_get_display_hint (printer);
-+  make_cleanup (free_current_contents, &hint);
-+
-+  /* Print the section */
-+  print_string_repr (printer, hint, stream, recurse, options, language);
-+  print_children (printer, hint, stream, recurse, options, language);
-+  result = 1;
-+
-+
-+ done:
-+  if (PyErr_Occurred ())
-+    gdbpy_print_stack ();
-+  do_cleanups (cleanups);
-+  return result;
-+}
-+
-+/* Apply a pretty-printer for the varobj code.  PRINTER_OBJ is the
-+   print object.  It must have a 'to_string' method (but this is
-+   checked by varobj, not here) which takes no arguments and
-+   returns a string.  This function returns an xmalloc()d string if
-+   the printer returns a string.  The printer may return a replacement
-+   value instead; in this case *REPLACEMENT is set to the replacement
-+   value, and this function returns NULL.  On error, *REPLACEMENT is
-+   set to NULL and this function also returns NULL.  */
-+char *
-+apply_varobj_pretty_printer (PyObject *printer_obj,
-+                           struct value **replacement)
-+{
-+  char *result;
-+  PyGILState_STATE state = PyGILState_Ensure ();
-+
-+  *replacement = NULL;
-+  result = pretty_print_one_value (printer_obj, replacement);
-+  if (result == NULL);
-+    gdbpy_print_stack ();
-+  PyGILState_Release (state);
-+
-+  return result;
-+}
-+
-+/* Find a pretty-printer object for the varobj module.  Returns a new
-+   reference to the object if successful; returns NULL if not.  VALUE
-+   is the value for which a printer tests to determine if it 
-+   can pretty-print the value.  */
-+PyObject *
-+gdbpy_get_varobj_pretty_printer (struct value *value)
-+{
-+  PyObject *val_obj;
-+  PyObject *pretty_printer = NULL;
-+  volatile struct gdb_exception except;
-+
-+  TRY_CATCH (except, RETURN_MASK_ALL)
-+    {
-+      value = value_copy (value);
-+    }
-+  GDB_PY_HANDLE_EXCEPTION (except);
+ /* Find the definition for a specified symbol name NAME
+    in domain DOMAIN, visible from lexical block BLOCK.
+    Returns the struct symbol pointer, or zero if no symbol is found.
+@@ -1194,10 +1219,14 @@ lookup_symbol_in_language (const char *name, const struct block *block,
+ {
+   char *demangled_name = NULL;
+   const char *modified_name = NULL;
+-  const char *mangled_name = NULL;
+   struct symbol *returnval;
+   struct cleanup *cleanup = make_cleanup (null_cleanup, 0);
++  if(strncmp(name, "::", 2) == 0){/* this must be a global name */
++    name = name+2;
++    block = NULL;
++  }
 +  
-+  val_obj = value_to_value_object (value);
-+  if (! val_obj)
+   modified_name = name;
+   /* If we are using C++ or Java, demangle the name before doing a lookup, so
+@@ -1207,7 +1236,6 @@ lookup_symbol_in_language (const char *name, const struct block *block,
+       demangled_name = cplus_demangle (name, DMGL_ANSI | DMGL_PARAMS);
+       if (demangled_name)
+       {
+-        mangled_name = name;
+         modified_name = demangled_name;
+         make_cleanup (xfree, demangled_name);
+       }
+@@ -1229,7 +1257,6 @@ lookup_symbol_in_language (const char *name, const struct block *block,
+                                      DMGL_ANSI | DMGL_PARAMS | DMGL_JAVA);
+       if (demangled_name)
+       {
+-        mangled_name = name;
+         modified_name = demangled_name;
+         make_cleanup (xfree, demangled_name);
+       }
+@@ -1248,8 +1275,8 @@ lookup_symbol_in_language (const char *name, const struct block *block,
+       modified_name = copy;
+     }
+-  returnval = lookup_symbol_aux (modified_name, mangled_name, block,
+-                               domain, lang, is_a_field_of_this);
++  returnval = lookup_symbol_aux (modified_name, block, domain, lang,
++                               is_a_field_of_this);
+   do_cleanups (cleanup);
+   return returnval;
+@@ -1273,9 +1300,9 @@ lookup_symbol (const char *name, const struct block *block,
+    well.  */
+ static struct symbol *
+-lookup_symbol_aux (const char *name, const char *linkage_name,
+-                 const struct block *block, const domain_enum domain,
+-                 enum language language, int *is_a_field_of_this)
++lookup_symbol_aux (const char *name, const struct block *block,
++                 const domain_enum domain, enum language language,
++                 int *is_a_field_of_this)
+ {
+   struct symbol *sym;
+   const struct language_defn *langdef;
+@@ -1291,55 +1318,19 @@ lookup_symbol_aux (const char *name, const char *linkage_name,
+   /* Search specified block and its superiors.  Don't search
+      STATIC_BLOCK or GLOBAL_BLOCK.  */
+-  sym = lookup_symbol_aux_local (name, linkage_name, block, domain);
++  sym = lookup_symbol_aux_local (name, block, domain, language, is_a_field_of_this);
+   if (sym != NULL)
+     return sym;
+-  /* If requested to do so by the caller and if appropriate for LANGUAGE,
+-     check to see if NAME is a field of `this'. */
+-
+-  langdef = language_def (language);
+-
+-  if (langdef->la_name_of_this != NULL && is_a_field_of_this != NULL
+-      && block != NULL)
+-    {
+-      struct symbol *sym = NULL;
+-      /* 'this' is only defined in the function's block, so find the
+-       enclosing function block.  */
+-      for (; block && !BLOCK_FUNCTION (block);
+-         block = BLOCK_SUPERBLOCK (block));
+-
+-      if (block && !dict_empty (BLOCK_DICT (block)))
+-      sym = lookup_block_symbol (block, langdef->la_name_of_this,
+-                                 NULL, VAR_DOMAIN);
+-      if (sym)
+-      {
+-        struct type *t = sym->type;
+-
+-        /* I'm not really sure that type of this can ever
+-           be typedefed; just be safe.  */
+-        CHECK_TYPEDEF (t);
+-        if (TYPE_CODE (t) == TYPE_CODE_PTR
+-            || TYPE_CODE (t) == TYPE_CODE_REF)
+-          t = TYPE_TARGET_TYPE (t);
+-
+-        if (TYPE_CODE (t) != TYPE_CODE_STRUCT
+-            && TYPE_CODE (t) != TYPE_CODE_UNION)
+-          error (_("Internal error: `%s' is not an aggregate"),
+-                 langdef->la_name_of_this);
+-
+-        if (check_field (t, name))
+-          {
+-            *is_a_field_of_this = 1;
+-            return NULL;
+-          }
+-      }
+-    }
++  /* this symbol was found to be a member variable
++     do not perform the global search. */
++  if (is_a_field_of_this && *is_a_field_of_this)
 +    return NULL;
+   /* Now do whatever is appropriate for LANGUAGE to look
+      up static and global variables.  */
+-
+-  sym = langdef->la_lookup_symbol_nonlocal (name, linkage_name, block, domain);
++  langdef = language_def (language);
++  sym = langdef->la_lookup_symbol_nonlocal (name, block, domain);
+   if (sym != NULL)
+     return sym;
+@@ -1349,11 +1340,11 @@ lookup_symbol_aux (const char *name, const char *linkage_name,
+      desired name as a file-level static, then do psymtab-to-symtab
+      conversion on the fly and return the found symbol. */
+-  sym = lookup_symbol_aux_symtabs (STATIC_BLOCK, name, linkage_name, domain);
++  sym = lookup_symbol_aux_symtabs (STATIC_BLOCK, name, domain);
+   if (sym != NULL)
+     return sym;
+-  sym = lookup_symbol_aux_psymtabs (STATIC_BLOCK, name, linkage_name, domain);
++  sym = lookup_symbol_aux_psymtabs (STATIC_BLOCK, name, domain);
+   if (sym != NULL)
+     return sym;
+@@ -1364,30 +1355,81 @@ lookup_symbol_aux (const char *name, const char *linkage_name,
+    Don't search STATIC_BLOCK or GLOBAL_BLOCK.  */
+ static struct symbol *
+-lookup_symbol_aux_local (const char *name, const char *linkage_name,
+-                       const struct block *block,
+-                       const domain_enum domain)
++lookup_symbol_aux_local (const char *name, const struct block *block,
++                       const domain_enum domain, enum language language,
++                       int *is_a_field_of_this)
+ {
+   struct symbol *sym;
+-  const struct block *static_block = block_static_block (block);
++  const struct block *global_block = block_global_block (block);
++  const struct block *block_iterator = block;
++  const struct language_defn *langdef;
 +
-+  pretty_printer = find_pretty_printer (val_obj);
-+  Py_DECREF (val_obj);
-+  return pretty_printer;
-+}
++  langdef = language_def (language);
+   /* Check if either no block is specified or it's a global block.  */
+-  if (static_block == NULL)
++  if (global_block == NULL)
+     return NULL;
+-  while (block != static_block)
++  while (block_iterator != global_block)
+     {
+-      sym = lookup_symbol_aux_block (name, linkage_name, block, domain);
 +
-+/* A Python function which wraps find_pretty_printer and instantiates
-+   the resulting class.  This accepts a Value argument and returns a
-+   pretty printer instance, or None.  This function is useful as an
-+   argument to the MI command -var-set-visualizer.  */
-+static PyObject *
-+gdbpy_default_visualizer (PyObject *self, PyObject *args)
-+{
-+  PyObject *val_obj;
-+  PyObject *cons, *printer = NULL;
-+  struct value *value;
++      sym = lookup_symbol_aux_block (name, block_iterator, domain);
 +
-+  if (! PyArg_ParseTuple (args, "O", &val_obj))
-+    return NULL;
-+  value = value_object_to_value (val_obj);
-+  if (! value)
-+    {
-+      PyErr_SetString (PyExc_TypeError, "argument must be a gdb.Value");
-+      return NULL;
-+    }
+       if (sym != NULL)
+       return sym;
+-
+-      if (BLOCK_FUNCTION (block) != NULL && block_inlined_p (block))
+-      break;
+-      block = BLOCK_SUPERBLOCK (block);
++    
++      if (language == language_cplus )
++        {
++          sym = cp_lookup_symbol_imports (block_scope (block_iterator), name,
++                                          block_iterator, domain, 1, 1);
 +
-+  cons = find_pretty_printer (val_obj);
-+  return cons;
-+}
++          if (sym != NULL)
++            return sym;
++        }
 +
- #else /* HAVE_PYTHON */
- /* Dummy implementation of the gdb "python" command.  */
-@@ -328,6 +1677,24 @@ eval_python_from_control_command (struct command_line *cmd)
-   error (_("Python scripting is not supported in this copy of GDB."));
- }
-+int
-+apply_val_pretty_printer (struct type *type, const gdb_byte *valaddr,
-+                        int embedded_offset, CORE_ADDR address,
-+                        struct ui_file *stream, int format,
-+                        int deref_ref, int recurse,
-+                        enum val_prettyprint pretty,
-+                        const struct language_defn *language)
-+{
-+  return 0;
-+}
++      if (langdef->la_name_of_this != NULL && is_a_field_of_this != NULL
++        && BLOCK_FUNCTION (block_iterator))
++        {
++          if (!dict_empty (BLOCK_DICT (block_iterator)))
++            {
++              sym = lookup_block_symbol (block_iterator,
++                                       langdef->la_name_of_this,
++                                       VAR_DOMAIN);
++
++
++              if (sym)
++                {
++                  struct type *t = sym->type;
++
++                  /* I'm not really sure that type of this can ever
++                     be typedefed; just be safe.  */
++                  CHECK_TYPEDEF (t);
++                  if (TYPE_CODE (t) == TYPE_CODE_PTR
++                      || TYPE_CODE (t) == TYPE_CODE_REF)
++                      t = TYPE_TARGET_TYPE (t);
++
++                  if (TYPE_CODE (t) != TYPE_CODE_STRUCT
++                      && TYPE_CODE (t) != TYPE_CODE_UNION)
++                    error (_("Internal error: `%s' is not an aggregate"),
++                        langdef->la_name_of_this);
++
++                  if (check_field (t, name))
++                    {
++                      *is_a_field_of_this = 1;
++                      return NULL;
++                    }
++                }
++            }
++        }
 +
-+void
-+source_python_script (FILE *stream)
-+{
-+  fclose (stream);
-+  error (_("Python scripting is not supported in this copy of GDB."));
-+}
++      if (BLOCK_FUNCTION (block_iterator) != NULL && block_inlined_p (block_iterator))
++        break;
 +
- #endif /* HAVE_PYTHON */
++      block_iterator = BLOCK_SUPERBLOCK (block_iterator);
+     }
  
\f
-@@ -355,9 +1722,6 @@ show_python (char *args, int from_tty)
+-  /* We've reached the edge of the function without finding a result.  */
++  /* We've reached the global block without finding a result.  */
  
- /* Initialize the Python code.  */
+   return NULL;
+ }
+@@ -1416,13 +1458,12 @@ lookup_objfile_from_block (const struct block *block)
+    block_found appropriately.  */
  
--/* Provide a prototype to silence -Wmissing-prototypes.  */
--extern initialize_file_ftype _initialize_python;
--
- void
_initialize_python (void)
+ struct symbol *
+-lookup_symbol_aux_block (const char *name, const char *linkage_name,
+-                       const struct block *block,
++lookup_symbol_aux_block (const char *name, const struct block *block,
                       const domain_enum domain)
  {
-@@ -400,6 +1764,15 @@ Enables or disables printing of Python stack traces."),
-                          &set_python_list,
-                          &show_python_list);
-+  add_setshow_boolean_cmd ("auto-load", class_maintenance,
-+                         &gdbpy_auto_load, _("\
-+Enable or disable auto-loading of Python code when an object is opened."), _("\
-+Show whether Python code will be auto-loaded when an object is opened."), _("\
-+Enables or disables auto-loading of Python code when an object is opened."),
-+                         NULL, NULL,
-+                         &set_python_list,
-+                         &show_python_list);
-+
- #ifdef HAVE_PYTHON
-   Py_Initialize ();
-   PyEval_InitThreads ();
-@@ -410,11 +1783,36 @@ Enables or disables printing of Python stack traces."),
-   PyModule_AddStringConstant (gdb_module, "VERSION", (char*) version);
-   PyModule_AddStringConstant (gdb_module, "HOST_CONFIG", (char*) host_name);
-   PyModule_AddStringConstant (gdb_module, "TARGET_CONFIG", (char*) target_name);
-+#ifdef PYTHONDIR
-+  PyModule_AddStringConstant (gdb_module, "pythondir", PYTHONDIR);
-+#else
-+  if (gdb_datadir)
-+    PyModule_AddStringConstant (gdb_module, "datadir", gdb_datadir);
-+#endif
+   struct symbol *sym;
  
-   gdbpy_initialize_values ();
-+  gdbpy_initialize_breakpoints ();
-+  gdbpy_initialize_frames ();
-+  gdbpy_initialize_symtabs ();
-   gdbpy_initialize_commands ();
-+  gdbpy_initialize_symbols ();
-+  gdbpy_initialize_blocks ();
-+  gdbpy_initialize_functions ();
-+  gdbpy_initialize_types ();
-+  gdbpy_initialize_parameters ();
-+  gdbpy_initialize_objfile ();
-+  gdbpy_initialize_events ();
-+  gdbpy_initialize_membuf ();
+-  sym = lookup_block_symbol (block, name, linkage_name, domain);
++  sym = lookup_block_symbol (block, name, domain);
+   if (sym)
+     {
+       block_found = block;
+@@ -1438,7 +1479,6 @@ lookup_symbol_aux_block (const char *name, const char *linkage_name,
+ struct symbol *
+ lookup_global_symbol_from_objfile (const struct objfile *objfile,
+                                  const char *name,
+-                                 const char *linkage_name,
+                                  const domain_enum domain)
+ {
+   struct symbol *sym;
+@@ -1452,7 +1492,7 @@ lookup_global_symbol_from_objfile (const struct objfile *objfile,
+   {
+     bv = BLOCKVECTOR (s);
+     block = BLOCKVECTOR_BLOCK (bv, GLOBAL_BLOCK);
+-    sym = lookup_block_symbol (block, name, linkage_name, domain);
++    sym = lookup_block_symbol (block, name, domain);
+     if (sym)
+       {
+       block_found = block;
+@@ -1461,23 +1501,23 @@ lookup_global_symbol_from_objfile (const struct objfile *objfile,
+   }
  
-   PyRun_SimpleString ("import gdb");
-+  PyRun_SimpleString ("gdb.pretty_printers = []");
-+
-+  observer_attach_new_objfile (gdbpy_new_objfile);
-+
-+  gdbpy_to_string_cst = PyString_FromString ("to_string");
-+  gdbpy_children_cst = PyString_FromString ("children");
-+  gdbpy_display_hint_cst = PyString_FromString ("display_hint");
-+  gdbpy_doc_cst = PyString_FromString ("__doc__");
+   /* Now go through psymtabs.  */
++  require_partial_symbols ((struct objfile *) objfile);
+   ALL_OBJFILE_PSYMTABS (objfile, ps)
+   {
+     if (!ps->readin
+-      && lookup_partial_symbol (ps, name, linkage_name,
+-                                1, domain))
++      && lookup_partial_symbol (ps, name, 1, domain))
+       {
+       s = PSYMTAB_TO_SYMTAB (ps);
+       bv = BLOCKVECTOR (s);
+       block = BLOCKVECTOR_BLOCK (bv, GLOBAL_BLOCK);
+-      sym = lookup_block_symbol (block, name, linkage_name, domain);
++      sym = lookup_block_symbol (block, name, domain);
+       return fixup_symbol_section (sym, (struct objfile *)objfile);
+       }
+   }
  
-   gdbpy_doc_cst = PyString_FromString ("__doc__");
+   if (objfile->separate_debug_objfile)
+     return lookup_global_symbol_from_objfile (objfile->separate_debug_objfile,
+-                                            name, linkage_name, domain);
++                                            name, domain);
  
-@@ -442,6 +1840,15 @@ class GdbOutputFile:\n\
- \n\
- sys.stderr = GdbOutputFile()\n\
- sys.stdout = GdbOutputFile()\n\
-+if hasattr (gdb, 'datadir'):\n\
-+  gdb.pythondir = gdb.datadir + '/python'\n\
-+if hasattr (gdb, 'pythondir'):\n\
-+  sys.path.insert(0, gdb.pythondir)\n\
-+  gdb.__path__ = [gdb.pythondir + '/gdb']\n\
-+  from os.path import exists\n\
-+  ipy = gdb.pythondir + '/gdb/__init__.py'\n\
-+  if exists (ipy):\n\
-+    execfile (ipy)\n\
- ");
+   return NULL;
+ }
+@@ -1488,8 +1528,7 @@ lookup_global_symbol_from_objfile (const struct objfile *objfile,
+    static symbols.  */
  
-   /* Release the GIL while gdb runs.  */
-@@ -461,9 +1868,79 @@ static PyMethodDef GdbMethods[] =
-     "Get a value from history" },
-   { "execute", execute_gdb_command, METH_VARARGS,
-     "Execute a gdb command" },
--  { "get_parameter", get_parameter, METH_VARARGS,
-+  { "cli", gdbpy_cli, METH_NOARGS,
-+    "Enter the gdb CLI" },
-+  { "parameter", gdbpy_parameter, METH_VARARGS,
-     "Return a gdb parameter's value" },
+ static struct symbol *
+-lookup_symbol_aux_symtabs (int block_index,
+-                         const char *name, const char *linkage_name,
++lookup_symbol_aux_symtabs (int block_index, const char *name,
+                          const domain_enum domain)
+ {
+   struct symbol *sym;
+@@ -1502,7 +1541,7 @@ lookup_symbol_aux_symtabs (int block_index,
+   {
+     bv = BLOCKVECTOR (s);
+     block = BLOCKVECTOR_BLOCK (bv, block_index);
+-    sym = lookup_block_symbol (block, name, linkage_name, domain);
++    sym = lookup_block_symbol (block, name, domain);
+     if (sym)
+       {
+       block_found = block;
+@@ -1520,7 +1559,6 @@ lookup_symbol_aux_symtabs (int block_index,
  
-+  { "breakpoints", gdbpy_breakpoints, METH_NOARGS,
-+    "Return a tuple of all breakpoint objects" },
-+
-+  { "default_visualizer", gdbpy_default_visualizer, METH_VARARGS,
-+    "Find the default visualizer for a Value." },
-+
-+  { "current_objfile", gdbpy_get_current_objfile, METH_NOARGS,
-+    "Return the current Objfile being loaded, or None." },
-+  { "objfiles", gdbpy_objfiles, METH_NOARGS,
-+    "Return a sequence of all loaded objfiles." },
-+
-+  { "frames", gdbpy_frames, METH_NOARGS,
-+    "frames () -> (gdb.Frame, ...).\n\
-+Return a tuple of all frame objects." },
-+  { "newest_frame", gdbpy_newest_frame, METH_NOARGS,
-+    "newest_frame () -> gdb.Frame.\n\
-+Return the newest frame object." },
-+  { "selected_frame", gdbpy_selected_frame, METH_NOARGS,
-+    "selected_frame () -> gdb.Frame.\n\
-+Return the selected frame object." },
-+  { "frame_stop_reason_string", gdbpy_frame_stop_reason_string, METH_VARARGS,
-+    "stop_reason_string (Integer) -> String.\n\
-+Return a string explaining unwind stop reason." },
-+
-+  { "lookup_symbol", (PyCFunction) gdbpy_lookup_symbol,
-+    METH_VARARGS | METH_KEYWORDS,
-+    "lookup_symbol (name [, block] [, domain]) -> (symbol, is_field_of_this)\n\
-+Return a tuple with the symbol corresponding to the given name (or None) and\n\
-+a boolean indicating if name is a field of the current implied argument\n\
-+`this' (when the current language is object-oriented)." },
-+  { "solib_address", gdbpy_solib_address, METH_VARARGS,
-+    "solib_address (Long) -> String.\n\
-+Return the name of the shared library holding a given address, or None." },
-+
-+  { "find_pc_function", gdbpy_find_pc_function, METH_VARARGS,
-+    "Return the function containing the given pc value, or None." },
-+
-+  { "block_for_pc", gdbpy_block_for_pc, METH_VARARGS,
-+    "Return the block containing the given pc value, or None." },
-+
-+  { "decode_line", gdbpy_decode_line, METH_VARARGS,
-+    "Decode a string argument the way that 'break' or 'edit' does.\n\
-+Return a tuple holding the file name (or None) and line number (or None).\n\
-+Note: may later change to return an object." },
-+
-+  { "threads", gdbpy_threads, METH_NOARGS,
-+    "Return a tuple holding all the valid thread IDs." },
-+  { "current_thread", gdbpy_current_thread, METH_NOARGS,
-+    "Return the thread ID of the current thread." },
-+  { "switch_to_thread", gdbpy_switch_to_thread, METH_VARARGS,
-+    "Switch to a thread, given the thread ID." },
-+
-+  { "parse_and_eval", gdbpy_parse_and_eval, METH_VARARGS,
-+    "Parse a string as an expression, evaluate it, and return the result." },
-+
-+  { "post_event", gdbpy_post_event, METH_VARARGS,
-+    "Post an event into gdb's event loop." },
-+
-+  { "read_memory", gdbpy_read_memory, METH_VARARGS,
-+    "read_memory (address, length) -> buffer\n\
-+Return a buffer object for reading from the inferior's memory." },
-+  { "write_memory", gdbpy_write_memory, METH_VARARGS,
-+    "write_memory (address, buffer [, length])\n\
-+Write the given buffer object to the inferior's memory." },
-+  { "search_memory", (PyCFunction) gdbpy_search_memory, METH_VARARGS | METH_KEYWORDS,
-+    "search_memory (address, length, pattern [, size] [, max_count]) -> list\n\
-+Return a list with the addresses where matches were found." },
-+
-   { "write", gdbpy_write, METH_VARARGS,
-     "Write a string using gdb's filtered stream." },
-   { "flush", gdbpy_flush, METH_NOARGS,
-diff --git a/gdb/python/python.h b/gdb/python/python.h
-index e63c447..767af86 100644
---- a/gdb/python/python.h
-+++ b/gdb/python/python.h
-@@ -26,4 +26,14 @@ extern struct value *values_in_python;
+ static struct symbol *
+ lookup_symbol_aux_psymtabs (int block_index, const char *name,
+-                          const char *linkage_name,
+                           const domain_enum domain)
+ {
+   struct symbol *sym;
+@@ -1531,16 +1569,15 @@ lookup_symbol_aux_psymtabs (int block_index, const char *name,
+   struct symtab *s;
+   const int psymtab_index = (block_index == GLOBAL_BLOCK ? 1 : 0);
  
- void eval_python_from_control_command (struct command_line *);
+-  ALL_PSYMTABS (objfile, ps)
++  ALL_PSYMTABS_REQUIRED (objfile, ps)
+   {
+     if (!ps->readin
+-      && lookup_partial_symbol (ps, name, linkage_name,
+-                                psymtab_index, domain))
++      && lookup_partial_symbol (ps, name, psymtab_index, domain))
+       {
+       s = PSYMTAB_TO_SYMTAB (ps);
+       bv = BLOCKVECTOR (s);
+       block = BLOCKVECTOR_BLOCK (bv, block_index);
+-      sym = lookup_block_symbol (block, name, linkage_name, domain);
++      sym = lookup_block_symbol (block, name, domain);
+       if (!sym)
+         {
+           /* This shouldn't be necessary, but as a last resort try
+@@ -1557,7 +1594,7 @@ lookup_symbol_aux_psymtabs (int block_index, const char *name,
+           block = BLOCKVECTOR_BLOCK (bv,
+                                      block_index == GLOBAL_BLOCK ?
+                                      STATIC_BLOCK : GLOBAL_BLOCK);
+-          sym = lookup_block_symbol (block, name, linkage_name, domain);
++          sym = lookup_block_symbol (block, name, domain);
+           if (!sym)
+             error (_("Internal: %s symbol `%s' found in %s psymtab but not in symtab.\n%s may be an inlined function, or may be a template function\n(if a template, try specifying an instantiation: %s<type>)."),
+                    block_index == GLOBAL_BLOCK ? "global" : "static",
+@@ -1576,7 +1613,6 @@ lookup_symbol_aux_psymtabs (int block_index, const char *name,
+ struct symbol *
+ basic_lookup_symbol_nonlocal (const char *name,
+-                            const char *linkage_name,
+                             const struct block *block,
+                             const domain_enum domain)
+ {
+@@ -1610,11 +1646,11 @@ basic_lookup_symbol_nonlocal (const char *name,
+      than that one, so I don't think we should worry about that for
+      now.  */
  
-+void source_python_script (FILE *stream, char *file);
-+
-+void run_python_script (int argc, char **argv);
-+
-+int apply_val_pretty_printer (struct type *type, const gdb_byte *valaddr,
-+                            int embedded_offset, CORE_ADDR address,
-+                            struct ui_file *stream, int recurse,
-+                            const struct value_print_options *options,
-+                            const struct language_defn *language);
-+
- #endif /* GDB_PYTHON_H */
-diff --git a/gdb/scm-lang.c b/gdb/scm-lang.c
-index 345befd..e2568c8 100644
---- a/gdb/scm-lang.c
-+++ b/gdb/scm-lang.c
-@@ -43,14 +43,14 @@ static int in_eval_c (void);
- struct type *builtin_type_scm;
+-  sym = lookup_symbol_static (name, linkage_name, block, domain);
++  sym = lookup_symbol_static (name, block, domain);
+   if (sym != NULL)
+     return sym;
  
- void
--scm_printchar (int c, struct ui_file *stream)
-+scm_printchar (int c, struct type *type, struct ui_file *stream)
- {
-   fprintf_filtered (stream, "#\\%c", c);
+-  return lookup_symbol_global (name, linkage_name, block, domain);
++  return lookup_symbol_global (name, block, domain);
  }
  
- static void
--scm_printstr (struct ui_file *stream, const gdb_byte *string,
--            unsigned int length, int width, int force_ellipses,
-+scm_printstr (struct ui_file *stream, struct type *type, const gdb_byte *string,
-+            unsigned int length, int force_ellipses,
-             const struct value_print_options *options)
+ /* Lookup a symbol in the static block associated to BLOCK, if there
+@@ -1622,14 +1658,13 @@ basic_lookup_symbol_nonlocal (const char *name,
+ struct symbol *
+ lookup_symbol_static (const char *name,
+-                    const char *linkage_name,
+                     const struct block *block,
+                     const domain_enum domain)
  {
-   fprintf_filtered (stream, "\"%s\"", string);
-diff --git a/gdb/scm-lang.h b/gdb/scm-lang.h
-index 6bf88f5..1798b2f 100644
---- a/gdb/scm-lang.h
-+++ b/gdb/scm-lang.h
-@@ -59,7 +59,7 @@ extern void scm_scmval_print (LONGEST, struct ui_file *, int,
+   const struct block *static_block = block_static_block (block);
  
- extern int is_scmvalue_type (struct type *);
+   if (static_block != NULL)
+-    return lookup_symbol_aux_block (name, linkage_name, static_block, domain);
++    return lookup_symbol_aux_block (name, static_block, domain);
+   else
+     return NULL;
+ }
+@@ -1639,7 +1674,6 @@ lookup_symbol_static (const char *name,
  
--extern void scm_printchar (int, struct ui_file *);
-+extern void scm_printchar (int, struct type *, struct ui_file *);
+ struct symbol *
+ lookup_symbol_global (const char *name,
+-                    const char *linkage_name,
+                     const struct block *block,
+                     const domain_enum domain)
+ {
+@@ -1649,15 +1683,15 @@ lookup_symbol_global (const char *name,
+   /* Call library-specific lookup procedure.  */
+   objfile = lookup_objfile_from_block (block);
+   if (objfile != NULL)
+-    sym = solib_global_lookup (objfile, name, linkage_name, domain);
++    sym = solib_global_lookup (objfile, name, domain);
+   if (sym != NULL)
+     return sym;
+-  sym = lookup_symbol_aux_symtabs (GLOBAL_BLOCK, name, linkage_name, domain);
++  sym = lookup_symbol_aux_symtabs (GLOBAL_BLOCK, name, domain);
+   if (sym != NULL)
+     return sym;
+-  return lookup_symbol_aux_psymtabs (GLOBAL_BLOCK, name, linkage_name, domain);
++  return lookup_symbol_aux_psymtabs (GLOBAL_BLOCK, name, domain);
+ }
  
- extern struct value *scm_evaluate_string (char *, int);
+ int
+@@ -1681,14 +1715,11 @@ symbol_matches_domain (enum language symbol_language,
+ }
  
-diff --git a/gdb/scm-valprint.c b/gdb/scm-valprint.c
-index f0a7642..a32add5 100644
---- a/gdb/scm-valprint.c
-+++ b/gdb/scm-valprint.c
-@@ -187,7 +187,8 @@ taloop:
-       if (SCM_ICHRP (svalue))
+ /* Look, in partial_symtab PST, for symbol whose natural name is NAME.
+-   If LINKAGE_NAME is non-NULL, check in addition that the symbol's
+-   linkage name matches it.  Check the global symbols if GLOBAL, the
+-   static symbols if not */
++   Check the global symbols if GLOBAL, the static symbols if not. */
+ struct partial_symbol *
+ lookup_partial_symbol (struct partial_symtab *pst, const char *name,
+-                     const char *linkage_name, int global,
+-                     domain_enum domain)
++                     int global, domain_enum domain)
+ {
+   struct partial_symbol *temp;
+   struct partial_symbol **start, **psym;
+@@ -1740,9 +1771,7 @@ lookup_partial_symbol (struct partial_symtab *pst, const char *name,
+       internal_error (__FILE__, __LINE__, _("failed internal consistency check"));
+       while (top <= real_top
+-           && (linkage_name != NULL
+-               ? strcmp (SYMBOL_LINKAGE_NAME (*top), linkage_name) == 0
+-               : SYMBOL_MATCHES_SEARCH_NAME (*top,name)))
++           && SYMBOL_MATCHES_SEARCH_NAME (*top, name))
        {
-         svalue = SCM_ICHR (svalue);
--        scm_printchar (svalue, stream);
-+        scm_printchar (svalue, builtin_type (current_gdbarch)->builtin_char,
-+                       stream);
-         break;
+         if (symbol_matches_domain (SYMBOL_LANGUAGE (*top),
+                                    SYMBOL_DOMAIN (*top), domain))
+@@ -1759,15 +1788,9 @@ lookup_partial_symbol (struct partial_symtab *pst, const char *name,
+       for (psym = start; psym < start + length; psym++)
+       {
+         if (symbol_matches_domain (SYMBOL_LANGUAGE (*psym),
+-                                   SYMBOL_DOMAIN (*psym), domain))
+-          {
+-            if (linkage_name != NULL
+-                ? strcmp (SYMBOL_LINKAGE_NAME (*psym), linkage_name) == 0
+-                : SYMBOL_MATCHES_SEARCH_NAME (*psym, name))
+-              {
+-                return (*psym);
+-              }
+-          }
++                                   SYMBOL_DOMAIN (*psym), domain)
++            && SYMBOL_MATCHES_SEARCH_NAME (*psym, name))
++          return (*psym);
        }
-       else if (SCM_IFLAGP (svalue)
-diff --git a/gdb/stabsread.c b/gdb/stabsread.c
-index 2d7eb15..7423b32 100644
---- a/gdb/stabsread.c
-+++ b/gdb/stabsread.c
-@@ -322,7 +322,7 @@ dbx_alloc_type (int typenums[2], struct objfile *objfile)
-   if (typenums[0] == -1)
-     {
--      return (alloc_type (objfile));
-+      return (alloc_type (objfile, NULL));
      }
  
-   type_addr = dbx_lookup_type (typenums);
-@@ -332,7 +332,7 @@ dbx_alloc_type (int typenums[2], struct objfile *objfile)
-      We will fill it in later if we find out how.  */
-   if (*type_addr == 0)
-     {
--      *type_addr = alloc_type (objfile);
-+      *type_addr = alloc_type (objfile, NULL);
-     }
+@@ -1809,22 +1832,25 @@ basic_lookup_transparent_type (const char *name)
+   {
+     bv = BLOCKVECTOR (s);
+     block = BLOCKVECTOR_BLOCK (bv, GLOBAL_BLOCK);
+-    sym = lookup_block_symbol (block, name, NULL, STRUCT_DOMAIN);
++    sym = lookup_block_symbol (block, name, STRUCT_DOMAIN);
+     if (sym && !TYPE_IS_OPAQUE (SYMBOL_TYPE (sym)))
+       {
+       return SYMBOL_TYPE (sym);
+       }
+   }
  
-   return (*type_addr);
-@@ -589,6 +589,7 @@ define_symbol (CORE_ADDR valu, char *string, int desc, int type,
-   int deftype;
-   int synonym = 0;
-   int i;
-+  char *new_name = NULL;
+-  ALL_PSYMTABS (objfile, ps)
++  /* FIXME: .debug_pubnames should be read in.
++     
++     One may also try to the first pass without the require_partial_symbols
++     call but that would behave nondeterministically.  */
++  ALL_PSYMTABS_REQUIRED (objfile, ps)
+   {
+-    if (!ps->readin && lookup_partial_symbol (ps, name, NULL,
+-                                            1, STRUCT_DOMAIN))
++    if (!ps->readin && lookup_partial_symbol (ps, name, 1, STRUCT_DOMAIN))
+       {
+       s = PSYMTAB_TO_SYMTAB (ps);
+       bv = BLOCKVECTOR (s);
+       block = BLOCKVECTOR_BLOCK (bv, GLOBAL_BLOCK);
+-      sym = lookup_block_symbol (block, name, NULL, STRUCT_DOMAIN);
++      sym = lookup_block_symbol (block, name, STRUCT_DOMAIN);
+       if (!sym)
+         {
+           /* This shouldn't be necessary, but as a last resort
+@@ -1833,7 +1859,7 @@ basic_lookup_transparent_type (const char *name)
+            * the psymtab gets it wrong in some cases.
+            */
+           block = BLOCKVECTOR_BLOCK (bv, STATIC_BLOCK);
+-          sym = lookup_block_symbol (block, name, NULL, STRUCT_DOMAIN);
++          sym = lookup_block_symbol (block, name, STRUCT_DOMAIN);
+           if (!sym)
+             error (_("Internal: global symbol `%s' found in %s psymtab but not in symtab.\n\
+ %s may be an inlined function, or may be a template function\n\
+@@ -1857,21 +1883,26 @@ basic_lookup_transparent_type (const char *name)
+   {
+     bv = BLOCKVECTOR (s);
+     block = BLOCKVECTOR_BLOCK (bv, STATIC_BLOCK);
+-    sym = lookup_block_symbol (block, name, NULL, STRUCT_DOMAIN);
++    sym = lookup_block_symbol (block, name, STRUCT_DOMAIN);
+     if (sym && !TYPE_IS_OPAQUE (SYMBOL_TYPE (sym)))
+       {
+       return SYMBOL_TYPE (sym);
+       }
+   }
  
-   /* We would like to eliminate nameless symbols, but keep their types.
-      E.g. stab entry ":t10=*2" should produce a type 10, which is a pointer
-@@ -683,9 +684,37 @@ define_symbol (CORE_ADDR valu, char *string, int desc, int type,
-     {
-     normal:
-       SYMBOL_LANGUAGE (sym) = current_subfile->language;
--      SYMBOL_SET_NAMES (sym, string, p - string, objfile);
-+      if (current_subfile->language == language_cplus)
-+      {
-+        char *name = alloca (p - string + 1);
-+        memcpy (name, string, p - string);
-+        name[p - string] = '\0';
-+        new_name = cp_canonicalize_string (name);
-+      }
-+
-+      if (new_name != NULL)
+-  ALL_PSYMTABS (objfile, ps)
++  /* FIXME: Something like .debug_pubnames containing also static symbols
++     should be read in.  Compiler needs to be taught to generate it first.
++     
++     One may also try to the first pass without the require_partial_symbols
++     call but that would behave nondeterministically.  */
++  ALL_PSYMTABS_REQUIRED (objfile, ps)
+   {
+-    if (!ps->readin && lookup_partial_symbol (ps, name, NULL, 0, STRUCT_DOMAIN))
++    if (!ps->readin && lookup_partial_symbol (ps, name, 0, STRUCT_DOMAIN))
+       {
+       s = PSYMTAB_TO_SYMTAB (ps);
+       bv = BLOCKVECTOR (s);
+       block = BLOCKVECTOR_BLOCK (bv, STATIC_BLOCK);
+-      sym = lookup_block_symbol (block, name, NULL, STRUCT_DOMAIN);
++      sym = lookup_block_symbol (block, name, STRUCT_DOMAIN);
+       if (!sym)
+         {
+           /* This shouldn't be necessary, but as a last resort
+@@ -1880,7 +1911,7 @@ basic_lookup_transparent_type (const char *name)
+            * the psymtab gets it wrong in some cases.
+            */
+           block = BLOCKVECTOR_BLOCK (bv, GLOBAL_BLOCK);
+-          sym = lookup_block_symbol (block, name, NULL, STRUCT_DOMAIN);
++          sym = lookup_block_symbol (block, name, STRUCT_DOMAIN);
+           if (!sym)
+             error (_("Internal: static symbol `%s' found in %s psymtab but not in symtab.\n\
+ %s may be an inlined function, or may be a template function\n\
+@@ -1905,9 +1936,23 @@ find_main_psymtab (void)
+   struct partial_symtab *pst;
+   struct objfile *objfile;
+-  ALL_PSYMTABS (objfile, pst)
++  ALL_OBJFILES (objfile)
++  {
++    if ((objfile->flags & OBJF_MAIN) == 0)
++      continue;
++    require_partial_symbols (objfile);
++    ALL_OBJFILE_PSYMTABS (objfile, pst)
++    {
++      if (lookup_partial_symbol (pst, main_name (), 1, VAR_DOMAIN))
 +      {
-+        SYMBOL_SET_NAMES (sym, new_name, strlen (new_name), objfile);
-+        xfree (new_name);
++        return pst;
 +      }
-+      else
-+      SYMBOL_SET_NAMES (sym, string, p - string, objfile);
++    }
++  }
 +
-       if (SYMBOL_LANGUAGE (sym) == language_cplus)
--      cp_scan_for_anonymous_namespaces (sym);
-+      {
-+        char *name = alloca (p - string + 1);
-+        memcpy (name, string, p - string);
-+        name[p - string] = '\0';
-+        new_name = cp_canonicalize_string (name);
-+        cp_scan_for_anonymous_namespaces (sym);
-+      }
-+      if (new_name != NULL)
-+      {
-+        SYMBOL_SET_NAMES (sym, new_name, strlen (new_name), objfile);
-+        xfree (new_name);
-+      }
-+      else
-+      SYMBOL_SET_NAMES (sym, string, p - string, objfile);
-     }
-   p++;
-@@ -1519,18 +1548,35 @@ again:
-             if (*p != ':')
-               return error_type (pp, objfile);
-           }
--        to = type_name =
--          (char *) obstack_alloc (&objfile->objfile_obstack, p - *pp + 1);
++  ALL_PSYMTABS_REQUIRED (objfile, pst)
+   {
+-    if (lookup_partial_symbol (pst, main_name (), NULL, 1, VAR_DOMAIN))
++    if (lookup_partial_symbol (pst, main_name (), 1, VAR_DOMAIN))
+       {
+       return (pst);
+       }
+@@ -1925,14 +1970,10 @@ find_main_psymtab (void)
+    search on the symbols.  Each symbol which is marked as being a ObjC/C++
+    symbol (language_cplus or language_objc set) has both the encoded and
+    non-encoded names tested for a match.
 -
--        /* Copy the name.  */
--        from = *pp + 1;
--        while (from < p)
--          *to++ = *from++;
--        *to = '\0';
-+        type_name = NULL;
-+        if (current_subfile->language == language_cplus)
-+          {
-+            char *new_name, *name = alloca (p - *pp + 1);
-+            memcpy (name, *pp, p - *pp);
-+            name[p - *pp] = '\0';
-+            new_name = cp_canonicalize_string (name);
-+            if (new_name != NULL)
-+              {
-+                type_name = obsavestring (new_name, strlen (new_name),
-+                                          &objfile->objfile_obstack);
-+                xfree (new_name);
-+              }
-+          }
-+        if (type_name == NULL)
-+          {
-+            to = type_name =
-+              (char *) obstack_alloc (&objfile->objfile_obstack, p - *pp + 1);
-+
-+            /* Copy the name.  */
-+            from = *pp + 1;
-+            while (from < p)
-+              *to++ = *from++;
-+            *to = '\0';
-+          }
-         /* Set the pointer ahead of the name which we just read, and
-            the colon.  */
--        *pp = from + 1;
-+        *pp = p + 1;
-       }
-         /* If this type has already been declared, then reuse the same
-diff --git a/gdb/stack.c b/gdb/stack.c
-index 3bcf758..094a4ce 100644
---- a/gdb/stack.c
-+++ b/gdb/stack.c
-@@ -380,6 +380,7 @@ print_frame_args (struct symbol *func, struct frame_info *frame,
-                 get_raw_print_options (&opts);
-                 opts.deref_ref = 0;
-+                opts.summary = 1;
-                 common_val_print (val, stb->stream, 2,
-                                   &opts, language);
-                 ui_out_field_stream (uiout, "value", stb);
-@@ -579,20 +580,16 @@ print_frame_info (struct frame_info *frame, int print_level,
-   gdb_flush (gdb_stdout);
- }
+-   If LINKAGE_NAME is non-NULL, verify that any symbol we find has this
+-   particular mangled name.
+ */
  
--static void
--print_frame (struct frame_info *frame, int print_level,
--           enum print_what print_what, int print_args,
--           struct symtab_and_line sal)
-+/* Attempt to obtain the FUNNAME and FUNLANG of the function corresponding
-+   to FRAME.  */
-+void
-+find_frame_funname (struct frame_info *frame, char **funname,
-+                  enum language *funlang)
+ struct symbol *
+ lookup_block_symbol (const struct block *block, const char *name,
+-                   const char *linkage_name,
+                    const domain_enum domain)
  {
-   struct symbol *func;
--  char *funname = NULL;
--  enum language funlang = language_unknown;
--  struct ui_stream *stb;
--  struct cleanup *old_chain, *list_chain;
--  struct value_print_options opts;
--  stb = ui_out_stream_new (uiout);
--  old_chain = make_cleanup_ui_out_stream_delete (stb);
-+  *funname = NULL;
-+  *funlang = language_unknown;
-   func = find_pc_function (get_frame_address_in_block (frame));
-   if (func)
-@@ -625,24 +622,24 @@ print_frame (struct frame_info *frame, int print_level,
-         /* We also don't know anything about the function besides
-            its address and name.  */
-         func = 0;
--        funname = SYMBOL_PRINT_NAME (msymbol);
--        funlang = SYMBOL_LANGUAGE (msymbol);
-+        *funname = SYMBOL_PRINT_NAME (msymbol);
-+        *funlang = SYMBOL_LANGUAGE (msymbol);
+   struct dict_iterator iter;
+@@ -1945,9 +1986,7 @@ lookup_block_symbol (const struct block *block, const char *name,
+          sym = dict_iter_name_next (name, &iter))
+       {
+         if (symbol_matches_domain (SYMBOL_LANGUAGE (sym),
+-                                   SYMBOL_DOMAIN (sym), domain)
+-            && (linkage_name != NULL
+-                ? strcmp (SYMBOL_LINKAGE_NAME (sym), linkage_name) == 0 : 1))
++                                   SYMBOL_DOMAIN (sym), domain))
+           return sym;
        }
-       else
+       return NULL;
+@@ -1967,9 +2006,7 @@ lookup_block_symbol (const struct block *block, const char *name,
+          sym = dict_iter_name_next (name, &iter))
        {
--        funname = SYMBOL_PRINT_NAME (func);
--        funlang = SYMBOL_LANGUAGE (func);
--        if (funlang == language_cplus)
-+        *funname = SYMBOL_PRINT_NAME (func);
-+        *funlang = SYMBOL_LANGUAGE (func);
-+        if (*funlang == language_cplus)
+         if (symbol_matches_domain (SYMBOL_LANGUAGE (sym),
+-                                   SYMBOL_DOMAIN (sym), domain)
+-            && (linkage_name != NULL
+-                ? strcmp (SYMBOL_LINKAGE_NAME (sym), linkage_name) == 0 : 1))
++                                   SYMBOL_DOMAIN (sym), domain))
            {
-             /* It seems appropriate to use SYMBOL_PRINT_NAME() here,
-                to display the demangled name that we already have
-                stored in the symbol table, but we stored a version
-                with DMGL_PARAMS turned on, and here we don't want to
-                display parameters.  So remove the parameters.  */
--            char *func_only = cp_remove_params (funname);
-+            char *func_only = cp_remove_params (*funname);
-             if (func_only)
-               {
--                funname = func_only;
-+                *funname = func_only;
-                 make_cleanup (xfree, func_only);
-               }
-           }
-@@ -655,10 +652,27 @@ print_frame (struct frame_info *frame, int print_level,
+             sym_found = sym;
+             if (!SYMBOL_IS_ARGUMENT (sym))
+@@ -3172,7 +3209,7 @@ search_symbols (char *regexp, domain_enum kind, int nfiles, char *files[],
+      matching the regexp.  That way we don't have to reproduce all of
+      the machinery below. */
  
-       if (msymbol != NULL)
-       {
--        funname = SYMBOL_PRINT_NAME (msymbol);
--        funlang = SYMBOL_LANGUAGE (msymbol);
-+        *funname = SYMBOL_PRINT_NAME (msymbol);
-+        *funlang = SYMBOL_LANGUAGE (msymbol);
-       }
-     }
-+}
-+
-+static void
-+print_frame (struct frame_info *frame, int print_level,
-+           enum print_what print_what, int print_args,
-+           struct symtab_and_line sal)
-+{
-+  char *funname = NULL;
-+  enum language funlang = language_unknown;
-+  struct ui_stream *stb;
-+  struct cleanup *old_chain, *list_chain;
-+  struct value_print_options opts;
-+
-+  stb = ui_out_stream_new (uiout);
-+  old_chain = make_cleanup_ui_out_stream_delete (stb);
-+
-+  find_frame_funname (frame, &funname, &funlang);
-   annotate_frame_begin (print_level ? frame_relative_level (frame) : 0,
-                       get_frame_pc (frame));
-@@ -694,7 +708,7 @@ print_frame (struct frame_info *frame, int print_level,
-       struct print_args_args args;
-       struct cleanup *args_list_chain;
-       args.frame = frame;
--      args.func = func;
-+      args.func = find_pc_function (get_frame_address_in_block (frame));
-       args.stream = gdb_stdout;
-       args_list_chain = make_cleanup_ui_out_list_begin_end (uiout, "args");
-       catch_errors (print_args_stub, &args, "", RETURN_MASK_ERROR);
-@@ -1208,24 +1222,24 @@ backtrace_command_1 (char *count_exp, int show_locals, int from_tty)
-   else
-     count = -1;
+-  ALL_PSYMTABS (objfile, ps)
++  ALL_PSYMTABS_REQUIRED (objfile, ps)
+   {
+     struct partial_symbol **bound, **gbound, **sbound;
+     int keep_going = 1;
+diff --git a/gdb/symtab.h b/gdb/symtab.h
+index 740d4e0..461ff95 100644
+--- a/gdb/symtab.h
++++ b/gdb/symtab.h
+@@ -171,9 +171,6 @@ extern CORE_ADDR symbol_overlayed_address (CORE_ADDR, struct obj_section *);
+ #define SYMBOL_SECTION(symbol)                (symbol)->ginfo.section
+ #define SYMBOL_OBJ_SECTION(symbol)    (symbol)->ginfo.obj_section
  
--  if (info_verbose)
--    {
--      struct partial_symtab *ps;
+-#define SYMBOL_CPLUS_DEMANGLED_NAME(symbol)   \
+-  (symbol)->ginfo.language_specific.cplus_specific.demangled_name
 -
--      /* Read in symbols for all of the frames.  Need to do this in a
--         separate pass so that "Reading in symbols for xxx" messages
--         don't screw up the appearance of the backtrace.  Also if
--         people have strong opinions against reading symbols for
--         backtrace this may have to be an option.  */
--      i = count;
--      for (fi = trailing; fi != NULL && i--; fi = get_prev_frame (fi))
--      {
--        QUIT;
--        ps = find_pc_psymtab (get_frame_address_in_block (fi));
--        if (ps)
--          PSYMTAB_TO_SYMTAB (ps); /* Force syms to come in.  */
--      }
--    }
-+  {
-+    struct partial_symtab *ps;
-+
-+    /* Read in symbols for all of the frames.  Need to do this
-+       unconditionally to ensure that psymbols are read.  Also need to
-+       do this in a separate pass so that "Reading in symbols for xxx"
-+       messages don't screw up the appearance of the backtrace.  Also
-+       if people have strong opinions against reading symbols for
-+       backtrace this may have to be an option.  */
-+    i = count;
-+    for (fi = trailing; fi != NULL && i--; fi = get_prev_frame (fi))
-+      {
-+      QUIT;
-+      ps = find_pc_psymtab (get_frame_address_in_block (fi));
-+      if (info_verbose && ps)
-+        PSYMTAB_TO_SYMTAB (ps); /* Force syms to come in.  */
-+      }
-+  }
-   for (i = 0, fi = trailing; fi && count--; i++, fi = get_prev_frame (fi))
-     {
-@@ -1373,6 +1387,8 @@ print_block_frame_locals (struct block *b, struct frame_info *frame,
-       case LOC_COMPUTED:
-         if (SYMBOL_IS_ARGUMENT (sym))
-           break;
-+        if (SYMBOL_DOMAIN (sym) == COMMON_BLOCK_DOMAIN)
-+          break;
-         values_printed = 1;
-         print_variable_and_value (NULL, sym, frame, stream, 4 * num_tabs);
-         break;
-@@ -1796,18 +1812,27 @@ return_command (char *retval_exp, int from_tty)
-      message.  */
-   if (retval_exp)
-     {
-+      struct expression *retval_expr = parse_expression (retval_exp);
-+      struct cleanup *old_chain = make_cleanup (xfree, retval_expr);
-       struct type *return_type = NULL;
-       /* Compute the return value.  Should the computation fail, this
-          call throws an error.  */
--      return_value = parse_and_eval (retval_exp);
-+      return_value = evaluate_expression (retval_expr);
-       /* Cast return value to the return type of the function.  Should
-          the cast fail, this call throws an error.  */
-       if (thisfun != NULL)
-       return_type = TYPE_TARGET_TYPE (SYMBOL_TYPE (thisfun));
-       if (return_type == NULL)
--      return_type = builtin_type (get_frame_arch (thisframe))->builtin_int;
-+              {
-+        if (retval_expr->elts[0].opcode != UNOP_CAST)
-+          error (_("Return value type not available for selected "
-+                   "stack frame.\n"
-+                   "Please use an explicit cast of the value to return."));
-+        return_type = value_type (return_value);
-+      }
-+      do_cleanups (old_chain);
-       CHECK_TYPEDEF (return_type);
-       return_value = value_cast (return_type, return_value);
-diff --git a/gdb/stack.h b/gdb/stack.h
-index 973a57f..56b1d91 100644
---- a/gdb/stack.h
-+++ b/gdb/stack.h
-@@ -22,4 +22,9 @@
- void select_frame_command (char *level_exp, int from_tty);
-+/* Attempt to obtain the FUNNAME and FUNLANG of the function corresponding
-+   to FRAME.  */
-+void find_frame_funname (struct frame_info *frame, char **funname,
-+                       enum language *funlang);
-+
- #endif /* #ifndef STACK_H */
-diff --git a/gdb/symfile.c b/gdb/symfile.c
-index 63b5c1d..b047e94 100644
---- a/gdb/symfile.c
-+++ b/gdb/symfile.c
-@@ -929,6 +929,17 @@ new_symfile_objfile (struct objfile *objfile, int mainline, int verbo)
-   clear_complaints (&symfile_complaints, 0, verbo);
- }
-+/* A helper function which returns true if OBJFILE has any debug
-+   symbols, and false otherwise.  */
-+static int
-+has_any_debug_symbols (struct objfile *objfile)
-+{
-+  return (objfile->psymtabs || objfile->quick_addrmap
-+        || (objfile->separate_debug_objfile
-+            && (objfile->separate_debug_objfile->psymtabs
-+                || objfile->separate_debug_objfile->quick_addrmap)));
-+}
-+
- /* Process a symbol file, as either the main file or as a dynamically
-    loaded file.
-@@ -965,13 +976,15 @@ symbol_file_add_with_addrs_or_offsets (bfd *abfd, int from_tty,
-   /* Give user a chance to burp if we'd be
-      interactively wiping out any existing symbols.  */
--  if ((have_full_symbols () || have_partial_symbols ())
--      && mainline
-+  if (mainline
-       && from_tty
-+      && (have_full_symbols () || have_partial_symbols ())
-       && !query (_("Load new symbol table from \"%s\"? "), name))
-     error (_("Not confirmed."));
-   objfile = allocate_objfile (abfd, flags);
-+  if (mainline)
-+    objfile->flags |= OBJF_MAIN;
-   discard_cleanups (my_cleanups);
-   if (addrs)
-@@ -1007,6 +1020,8 @@ symbol_file_add_with_addrs_or_offsets (bfd *abfd, int from_tty,
+ /* Initializes the language dependent portion of a symbol
+    depending upon the language for the symbol. */
+ #define SYMBOL_INIT_LANGUAGE_SPECIFIC(symbol,language) \
+@@ -394,7 +391,13 @@ typedef enum domain_enum_tag
+   FUNCTIONS_DOMAIN,
  
-   if ((flags & OBJF_READNOW) || readnow_symbol_files)
-     {
-+      require_partial_symbols (objfile);
+   /* All defined types */
+-  TYPES_DOMAIN
++  TYPES_DOMAIN,
 +
-       if ((from_tty || info_verbose) && print_symbol_loading)
-       {
-         printf_unfiltered (_("expanding to full symbols..."));
-@@ -1025,7 +1040,7 @@ symbol_file_add_with_addrs_or_offsets (bfd *abfd, int from_tty,
-   /* If the file has its own symbol tables it has no separate debug info.
-      `.dynsym'/`.symtab' go to MSYMBOLS, `.debug_info' goes to SYMTABS/PSYMTABS.
-      `.gnu_debuglink' may no longer be present with `.note.gnu.build-id'.  */
--  if (objfile->psymtabs == NULL)
-+  if (!has_any_debug_symbols (objfile))
-     debugfile = find_separate_debug_file (objfile);
-   if (debugfile)
-     {
-@@ -1049,8 +1064,10 @@ symbol_file_add_with_addrs_or_offsets (bfd *abfd, int from_tty,
-       xfree (debugfile);
-     }
--  if (!have_partial_symbols () && !have_full_symbols ()
--      && print_symbol_loading)
-+  /* has_any_debug_symbols is not fully compatible with the former calls which
-+     would just be needlessly expensive here.  */
-+  if ((from_tty || info_verbose) && print_symbol_loading
-+      && !has_any_debug_symbols (objfile) && mainline)
-     {
-       wrap_here ("");
-       printf_unfiltered (_("(no debugging symbols found)"));
-@@ -2423,13 +2440,15 @@ reread_symbols (void)
-                zero is OK since dbxread.c also does what it needs to do if
-                objfile->global_psymbols.size is 0.  */
-             (*objfile->sf->sym_read) (objfile, 0);
--            if (!have_partial_symbols () && !have_full_symbols ())
-+            if (!has_any_debug_symbols (objfile))
-               {
-                 wrap_here ("");
-                 printf_unfiltered (_("(no debugging symbols found)\n"));
-                 wrap_here ("");
-               }
-+            objfile->flags &= ~OBJF_SYMTABS_READ;
++  /* Fortran common blocks.  Their naming must be separate from VAR_DOMAIN.  */
++  COMMON_BLOCK_DOMAIN,
 +
-             /* We're done reading the symbol file; finish off complaints.  */
-             clear_complaints (&symfile_complaints, 0, 1);
-@@ -2726,7 +2745,7 @@ allocate_symtab (char *filename, struct objfile *objfile)
++  /* Fortran module.  Their naming must be separate.  */
++  MODULE_DOMAIN
  }
+ domain_enum;
  
- struct partial_symtab *
--allocate_psymtab (char *filename, struct objfile *objfile)
-+allocate_psymtab (const char *filename, struct objfile *objfile)
- {
-   struct partial_symtab *psymtab;
-@@ -3040,7 +3059,8 @@ again2:
- struct partial_symtab *
- start_psymtab_common (struct objfile *objfile,
--                    struct section_offsets *section_offsets, char *filename,
-+                    struct section_offsets *section_offsets,
-+                    const char *filename,
-                     CORE_ADDR textlow, struct partial_symbol **global_syms,
-                     struct partial_symbol **static_syms)
- {
-diff --git a/gdb/symfile.h b/gdb/symfile.h
-index 88f8326..50671c1 100644
---- a/gdb/symfile.h
-+++ b/gdb/symfile.h
-@@ -140,6 +140,12 @@ struct sym_fns
+@@ -990,7 +993,6 @@ extern struct symbol *lookup_symbol (const char *, const struct block *,
+    that can't think of anything better to do.  */
  
-   void (*sym_read) (struct objfile *, int);
+ extern struct symbol *basic_lookup_symbol_nonlocal (const char *,
+-                                                  const char *,
+                                                   const struct block *,
+                                                   const domain_enum);
  
-+  /* Read the partial symbols for an objfile.  This may be NULL, in
-+     which case gdb assumes that sym_read already read the partial
-+     symbols.  */
-+
-+  void (*sym_read_psymbols) (struct objfile *);
-+
-   /* Called when we are finished with an objfile.  Should do all
-      cleanup that is specific to the object file format for the
-      particular objfile.  */
-@@ -250,7 +256,7 @@ extern void free_section_addr_info (struct section_addr_info *);
+@@ -1001,7 +1003,6 @@ extern struct symbol *basic_lookup_symbol_nonlocal (const char *,
+    is one; do nothing if BLOCK is NULL or a global block.  */
  
- extern struct partial_symtab *start_psymtab_common (struct objfile *,
-                                                   struct section_offsets *,
--                                                  char *, CORE_ADDR,
-+                                                  const char *, CORE_ADDR,
-                                                   struct partial_symbol **,
-                                                   struct partial_symbol **);
+ extern struct symbol *lookup_symbol_static (const char *name,
+-                                          const char *linkage_name,
+                                           const struct block *block,
+                                           const domain_enum domain);
  
-@@ -300,7 +306,7 @@ extern int auto_solib_limit;
+@@ -1009,7 +1010,6 @@ extern struct symbol *lookup_symbol_static (const char *name,
+    necessary).  */
  
- extern void set_initial_language (void);
+ extern struct symbol *lookup_symbol_global (const char *name,
+-                                          const char *linkage_name,
+                                           const struct block *block,
+                                           const domain_enum domain);
  
--extern struct partial_symtab *allocate_psymtab (char *, struct objfile *);
-+extern struct partial_symtab *allocate_psymtab (const char *, struct objfile *);
+@@ -1018,21 +1018,18 @@ extern struct symbol *lookup_symbol_global (const char *name,
+    will fix up the symbol if necessary.  */
  
- extern void discard_psymtab (struct partial_symtab *);
+ extern struct symbol *lookup_symbol_aux_block (const char *name,
+-                                             const char *linkage_name,
+                                              const struct block *block,
+                                              const domain_enum domain);
  
-@@ -369,7 +375,7 @@ void free_symfile_segment_data (struct symfile_segment_data *data);
- /* From dwarf2read.c */
+ /* Lookup a partial symbol.  */
  
- extern int dwarf2_has_info (struct objfile *);
--
-+extern void dwarf2_create_quick_addrmap (struct objfile *);
- extern void dwarf2_build_psymtabs (struct objfile *, int);
- extern void dwarf2_build_frame_info (struct objfile *);
+ extern struct partial_symbol *lookup_partial_symbol (struct partial_symtab *,
+-                                                   const char *,
+                                                    const char *, int,
+                                                    domain_enum);
  
-diff --git a/gdb/symtab.c b/gdb/symtab.c
-index d2ba1f3..b4da8c1 100644
---- a/gdb/symtab.c
-+++ b/gdb/symtab.c
-@@ -42,6 +42,7 @@
- #include "ada-lang.h"
- #include "p-lang.h"
- #include "addrmap.h"
-+#include "cp-support.h"
+ /* lookup a symbol by name, within a specified block */
  
- #include "hashtab.h"
+ extern struct symbol *lookup_block_symbol (const struct block *, const char *,
+-                                         const char *,
+                                          const domain_enum);
  
-@@ -55,6 +56,7 @@
- #include "gdb_stat.h"
- #include <ctype.h>
- #include "cp-abi.h"
-+#include "cp-support.h"
- #include "observer.h"
- #include "gdb_assert.h"
- #include "solist.h"
-@@ -273,7 +275,7 @@ lookup_partial_symtab (const char *name)
-       make_cleanup (xfree, real_path);
-     }
+ /* lookup a [struct, union, enum] by name, within a specified block */
+@@ -1062,6 +1059,8 @@ extern void clear_pc_function_cache (void);
  
--  ALL_PSYMTABS (objfile, pst)
-+  ALL_PSYMTABS_REQUIRED (objfile, pst)
-   {
-     if (FILENAME_CMP (name, pst->filename) == 0)
-       {
-@@ -870,7 +872,13 @@ find_pc_sect_psymtab (CORE_ADDR pc, struct obj_section *section)
-      than the later used TEXTLOW/TEXTHIGH one.  */
+ /* from symtab.c: */
  
-   ALL_OBJFILES (objfile)
--    if (objfile->psymtabs_addrmap != NULL)
-+  {
-+    if (objfile->quick_addrmap)
-+      {
-+      if (!addrmap_find (objfile->quick_addrmap, pc))
-+        continue;
-+      }
-+    if (require_partial_symbols (objfile)->psymtabs_addrmap != NULL)
-       {
-       struct partial_symtab *pst;
++struct objfile *require_partial_symbols (struct objfile *);
++
+ /* lookup partial symbol table by filename */
  
-@@ -903,6 +911,7 @@ find_pc_sect_psymtab (CORE_ADDR pc, struct obj_section *section)
-           return pst;
-         }
-       }
-+  }
+ extern struct partial_symtab *lookup_partial_symtab (const char *);
+@@ -1356,7 +1355,6 @@ extern /*const */ char *main_name (void);
+ /* Check global symbols in objfile.  */
+ struct symbol *lookup_global_symbol_from_objfile (const struct objfile *objfile,
+                                                 const char *name,
+-                                                const char *linkage_name,
+                                                 const domain_enum domain);
  
-   /* Existing PSYMTABS_ADDRMAP mapping is present even for PARTIAL_SYMTABs
-      which still have no corresponding full SYMTABs read.  But it is not
-@@ -1170,6 +1179,22 @@ fixup_psymbol_section (struct partial_symbol *psym, struct objfile *objfile)
-   return psym;
+ extern struct symtabs_and_lines
+diff --git a/gdb/target.c b/gdb/target.c
+index e5d14fd..37fab72 100644
+--- a/gdb/target.c
++++ b/gdb/target.c
+@@ -124,6 +124,8 @@ static int debug_to_insert_watchpoint (CORE_ADDR, int, int);
+ static int debug_to_remove_watchpoint (CORE_ADDR, int, int);
++static int debug_to_detach_watchpoints (void);
++
+ static int debug_to_stopped_by_watchpoint (void);
+ static int debug_to_stopped_data_address (struct target_ops *, CORE_ADDR *);
+@@ -622,6 +624,7 @@ update_current_target (void)
+       INHERIT (to_remove_hw_breakpoint, t);
+       INHERIT (to_insert_watchpoint, t);
+       INHERIT (to_remove_watchpoint, t);
++      INHERIT (to_detach_watchpoints, t);
+       INHERIT (to_stopped_data_address, t);
+       INHERIT (to_have_steppable_watchpoint, t);
+       INHERIT (to_have_continuable_watchpoint, t);
+@@ -733,6 +736,9 @@ update_current_target (void)
+   de_fault (to_remove_watchpoint,
+           (int (*) (CORE_ADDR, int, int))
+           return_minus_one);
++  de_fault (to_detach_watchpoints,
++          (int (*) (void))
++          return_zero);
+   de_fault (to_stopped_by_watchpoint,
+           (int (*) (void))
+           return_zero);
+@@ -3173,6 +3179,19 @@ debug_to_remove_watchpoint (CORE_ADDR addr, int len, int type)
+   return retval;
  }
  
-+/* Ensure that the partial symbols for OBJFILE have been loaded.  This
-+   function always returns its argument, as a convenience.  */
-+
-+struct objfile *
-+require_partial_symbols (struct objfile *objfile)
++static int
++debug_to_detach_watchpoints (void)
 +{
-+  if ((objfile->flags & OBJF_SYMTABS_READ) == 0)
-+    {
-+      objfile->flags |= OBJF_SYMTABS_READ;
++  int retval;
 +
-+      if (objfile->sf->sym_read_psymbols)
-+      (*objfile->sf->sym_read_psymbols) (objfile);
-+    }
-+  return objfile;
++  retval = debug_target.to_detach_watchpoints ();
++
++  fprintf_unfiltered (gdb_stdlog,
++                    "target_detach_watchpoints () = %ld\n",
++                    (unsigned long) retval);
++  return retval;
 +}
 +
- /* Find the definition for a specified symbol name NAME
-    in domain DOMAIN, visible from lexical block BLOCK.
-    Returns the struct symbol pointer, or zero if no symbol is found.
-@@ -1200,6 +1225,11 @@ lookup_symbol_in_language (const char *name, const struct block *block,
-   int needtofreename = 0;
-   struct symbol *returnval;
-+  if(strncmp(name, "::", 2) == 0){/* this must be a global name */
-+    name = name+2;
-+    block = NULL;
-+  }
-+  
-   modified_name = name;
-   /* If we are using C++ or Java, demangle the name before doing a lookup, so
-@@ -1213,6 +1243,17 @@ lookup_symbol_in_language (const char *name, const struct block *block,
-         modified_name = demangled_name;
-         needtofreename = 1;
-       }
-+      else
-+      {
-+        /* If we were given a non-mangled name, canonicalize it
-+           according to the language (so far only for C++).  */
-+        demangled_name = cp_canonicalize_string (name);
-+        if (demangled_name)
-+          {
-+            modified_name = demangled_name;
-+            needtofreename = 1;
-+          }
-+      }
-     }
-   else if (lang == language_java)
-     {
-@@ -1296,13 +1337,15 @@ lookup_symbol_aux (const char *name, const char *linkage_name,
-       && block != NULL)
-     {
-       struct symbol *sym = NULL;
-+      const struct block *function_block = block;
-+
-       /* 'this' is only defined in the function's block, so find the
-        enclosing function block.  */
--      for (; block && !BLOCK_FUNCTION (block); 
--         block = BLOCK_SUPERBLOCK (block));
-+      for (; function_block && !BLOCK_FUNCTION (function_block);
-+      function_block = BLOCK_SUPERBLOCK (function_block));
--      if (block && !dict_empty (BLOCK_DICT (block)))
--      sym = lookup_block_symbol (block, langdef->la_name_of_this,
-+      if (function_block && !dict_empty (BLOCK_DICT (function_block)))
-+      sym = lookup_block_symbol (function_block, langdef->la_name_of_this,
-                                  NULL, VAR_DOMAIN);
-       if (sym)
-       {
-@@ -1361,22 +1404,24 @@ lookup_symbol_aux_local (const char *name, const char *linkage_name,
-                        const domain_enum domain)
+ static void
+ debug_to_terminal_init (void)
  {
-   struct symbol *sym;
--  const struct block *static_block = block_static_block (block);
-+  const struct block *global_block = block_global_block (block);
-+  const struct block *block_iterator = block;
-   /* Check if either no block is specified or it's a global block.  */
--  if (static_block == NULL)
-+  if (global_block == NULL)
-     return NULL;
--  while (block != static_block)
-+  while (block_iterator != global_block)
-     {
--      sym = lookup_symbol_aux_block (name, linkage_name, block, domain);
-+      sym = lookup_symbol_aux_block (name, linkage_name, block_iterator, domain);
-       if (sym != NULL)
-       return sym;
--      block = BLOCK_SUPERBLOCK (block);
-+    
-+      block_iterator = BLOCK_SUPERBLOCK (block_iterator);
-     }
--  /* We've reached the static block without finding a result.  */
-+  /* We've reached the global block without finding a result.  */
-   return NULL;
- }
-@@ -1450,6 +1495,7 @@ lookup_global_symbol_from_objfile (const struct objfile *objfile,
-   }
-   /* Now go through psymtabs.  */
-+  require_partial_symbols ((struct objfile *) objfile);
-   ALL_OBJFILE_PSYMTABS (objfile, ps)
-   {
-     if (!ps->readin
-@@ -1520,7 +1566,7 @@ lookup_symbol_aux_psymtabs (int block_index, const char *name,
-   struct symtab *s;
-   const int psymtab_index = (block_index == GLOBAL_BLOCK ? 1 : 0);
--  ALL_PSYMTABS (objfile, ps)
-+  ALL_PSYMTABS_REQUIRED (objfile, ps)
-   {
-     if (!ps->readin
-       && lookup_partial_symbol (ps, name, linkage_name,
-@@ -1805,7 +1851,11 @@ basic_lookup_transparent_type (const char *name)
-       }
-   }
--  ALL_PSYMTABS (objfile, ps)
-+  /* FIXME: .debug_pubnames should be read in.
-+     
-+     One may also try to the first pass without the require_partial_symbols
-+     call but that would behave nondeterministically.  */
-+  ALL_PSYMTABS_REQUIRED (objfile, ps)
-   {
-     if (!ps->readin && lookup_partial_symbol (ps, name, NULL,
-                                             1, STRUCT_DOMAIN))
-@@ -1853,7 +1903,12 @@ basic_lookup_transparent_type (const char *name)
-       }
-   }
--  ALL_PSYMTABS (objfile, ps)
-+  /* FIXME: Something like .debug_pubnames containing also static symbols
-+     should be read in.  Compiler needs to be taught to generate it first.
-+     
-+     One may also try to the first pass without the require_partial_symbols
-+     call but that would behave nondeterministically.  */
-+  ALL_PSYMTABS_REQUIRED (objfile, ps)
-   {
-     if (!ps->readin && lookup_partial_symbol (ps, name, NULL, 0, STRUCT_DOMAIN))
-       {
-@@ -1894,7 +1949,21 @@ find_main_psymtab (void)
-   struct partial_symtab *pst;
-   struct objfile *objfile;
--  ALL_PSYMTABS (objfile, pst)
-+  ALL_OBJFILES (objfile)
-+  {
-+    if ((objfile->flags & OBJF_MAIN) == 0)
-+      continue;
-+    require_partial_symbols (objfile);
-+    ALL_OBJFILE_PSYMTABS (objfile, pst)
-+    {
-+      if (lookup_partial_symbol (pst, main_name (), NULL, 1, VAR_DOMAIN))
-+      {
-+        return pst;
-+      }
-+    }
-+  }
-+
-+  ALL_PSYMTABS_REQUIRED (objfile, pst)
-   {
-     if (lookup_partial_symbol (pst, main_name (), NULL, 1, VAR_DOMAIN))
-       {
-@@ -3085,7 +3154,7 @@ search_symbols (char *regexp, domain_enum kind, int nfiles, char *files[],
-      matching the regexp.  That way we don't have to reproduce all of
-      the machinery below. */
--  ALL_PSYMTABS (objfile, ps)
-+  ALL_PSYMTABS_REQUIRED (objfile, ps)
-   {
-     struct partial_symbol **bound, **gbound, **sbound;
-     int keep_going = 1;
-diff --git a/gdb/symtab.h b/gdb/symtab.h
-index 8b086f3..06bf7e8 100644
---- a/gdb/symtab.h
-+++ b/gdb/symtab.h
-@@ -171,9 +171,6 @@ extern CORE_ADDR symbol_overlayed_address (CORE_ADDR, struct obj_section *);
- #define SYMBOL_SECTION(symbol)                (symbol)->ginfo.section
- #define SYMBOL_OBJ_SECTION(symbol)    (symbol)->ginfo.obj_section
--#define SYMBOL_CPLUS_DEMANGLED_NAME(symbol)   \
--  (symbol)->ginfo.language_specific.cplus_specific.demangled_name
--
- /* Initializes the language dependent portion of a symbol
-    depending upon the language for the symbol. */
- #define SYMBOL_INIT_LANGUAGE_SPECIFIC(symbol,language) \
-@@ -394,7 +391,10 @@ typedef enum domain_enum_tag
-   FUNCTIONS_DOMAIN,
-   /* All defined types */
--  TYPES_DOMAIN
-+  TYPES_DOMAIN,
-+
-+  /* Fortran common blocks.  Their naming must be separate from VAR_DOMAIN.  */
-+  COMMON_BLOCK_DOMAIN
- }
- domain_enum;
-@@ -1027,6 +1027,8 @@ extern void clear_pc_function_cache (void);
- /* from symtab.c: */
-+struct objfile *require_partial_symbols (struct objfile *);
-+
- /* lookup partial symbol table by filename */
- extern struct partial_symtab *lookup_partial_symtab (const char *);
-diff --git a/gdb/syscalls/gdb-syscalls.dtd b/gdb/syscalls/gdb-syscalls.dtd
-new file mode 100644
-index 0000000..0d40ab4
---- /dev/null
-+++ b/gdb/syscalls/gdb-syscalls.dtd
-@@ -0,0 +1,21 @@
-+<!-- Copyright (C) 2007, 2008 Free Software Foundation, Inc.
-+
-+     Copying and distribution of this file, with or without modification,
-+     are permitted in any medium without royalty provided the copyright
-+     notice and this notice are preserved.  -->
-+
-+<!-- The root element of a syscall info is <syscalls_info>.  -->
-+
-+<!ELEMENT syscalls_info               (syscall*)>
-+
-+<!-- Maybe the 'number' attribute will have to be changed from
-+     ID to CDATA.  -->
-+<!ELEMENT syscall             EMPTY>
-+<!ATTLIST syscall
-+      name                    CDATA   #REQUIRED
-+      number                  ID      #REQUIRED>
-+
-+<!ELEMENT xi:include  (EMPTY)>
-+<!ATTLIST xi:include
-+      xmlns:xi        CDATA   #FIXED "http://www.w3.org/2001/XInclude"
-+      href            CDATA   #REQUIRED>
-diff --git a/gdb/syscalls/i386-linux.xml b/gdb/syscalls/i386-linux.xml
-new file mode 100644
-index 0000000..6f2beee
---- /dev/null
-+++ b/gdb/syscalls/i386-linux.xml
-@@ -0,0 +1,334 @@
-+<?xml version="1.0"?>
-+<!-- Copyright (C) 2007, 2008 Free Software Foundation, Inc.
-+
-+     Copying and distribution of this file, with or without modification,
-+     are permitted in any medium without royalty provided the copyright
-+     notice and this notice are preserved.  -->
-+
-+<!DOCTYPE feature SYSTEM "gdb-syscalls.dtd">
-+
-+<syscalls_info>
-+  <syscall name="restart_syscall" number="0"/>
-+  <syscall name="exit" number="1"/>
-+  <syscall name="fork" number="2"/>
-+  <syscall name="read" number="3"/>
-+  <syscall name="write" number="4"/>
-+  <syscall name="open" number="5"/>
-+  <syscall name="close" number="6"/>
-+  <syscall name="waitpid" number="7"/>
-+  <syscall name="creat" number="8"/>
-+  <syscall name="link" number="9"/>
-+  <syscall name="unlink" number="10"/>
-+  <syscall name="execve" number="11"/>
-+  <syscall name="chdir" number="12"/>
-+  <syscall name="time" number="13"/>
-+  <syscall name="mknod" number="14"/>
-+  <syscall name="chmod" number="15"/>
-+  <syscall name="lchown" number="16"/>
-+  <syscall name="break" number="17"/>
-+  <syscall name="oldstat" number="18"/>
-+  <syscall name="lseek" number="19"/>
-+  <syscall name="getpid" number="20"/>
-+  <syscall name="mount" number="21"/>
-+  <syscall name="umount" number="22"/>
-+  <syscall name="setuid" number="23"/>
-+  <syscall name="getuid" number="24"/>
-+  <syscall name="stime" number="25"/>
-+  <syscall name="ptrace" number="26"/>
-+  <syscall name="alarm" number="27"/>
-+  <syscall name="oldfstat" number="28"/>
-+  <syscall name="pause" number="29"/>
-+  <syscall name="utime" number="30"/>
-+  <syscall name="stty" number="31"/>
-+  <syscall name="gtty" number="32"/>
-+  <syscall name="access" number="33"/>
-+  <syscall name="nice" number="34"/>
-+  <syscall name="ftime" number="35"/>
-+  <syscall name="sync" number="36"/>
-+  <syscall name="kill" number="37"/>
-+  <syscall name="rename" number="38"/>
-+  <syscall name="mkdir" number="39"/>
-+  <syscall name="rmdir" number="40"/>
-+  <syscall name="dup" number="41"/>
-+  <syscall name="pipe" number="42"/>
-+  <syscall name="times" number="43"/>
-+  <syscall name="prof" number="44"/>
-+  <syscall name="brk" number="45"/>
-+  <syscall name="setgid" number="46"/>
-+  <syscall name="getgid" number="47"/>
-+  <syscall name="signal" number="48"/>
-+  <syscall name="geteuid" number="49"/>
-+  <syscall name="getegid" number="50"/>
-+  <syscall name="acct" number="51"/>
-+  <syscall name="umount2" number="52"/>
-+  <syscall name="lock" number="53"/>
-+  <syscall name="ioctl" number="54"/>
-+  <syscall name="fcntl" number="55"/>
-+  <syscall name="mpx" number="56"/>
-+  <syscall name="setpgid" number="57"/>
-+  <syscall name="ulimit" number="58"/>
-+  <syscall name="oldolduname" number="59"/>
-+  <syscall name="umask" number="60"/>
-+  <syscall name="chroot" number="61"/>
-+  <syscall name="ustat" number="62"/>
-+  <syscall name="dup2" number="63"/>
-+  <syscall name="getppid" number="64"/>
-+  <syscall name="getpgrp" number="65"/>
-+  <syscall name="setsid" number="66"/>
-+  <syscall name="sigaction" number="67"/>
-+  <syscall name="sgetmask" number="68"/>
-+  <syscall name="ssetmask" number="69"/>
-+  <syscall name="setreuid" number="70"/>
-+  <syscall name="setregid" number="71"/>
-+  <syscall name="sigsuspend" number="72"/>
-+  <syscall name="sigpending" number="73"/>
-+  <syscall name="sethostname" number="74"/>
-+  <syscall name="setrlimit" number="75"/>
-+  <syscall name="getrlimit" number="76"/>
-+  <syscall name="getrusage" number="77"/>
-+  <syscall name="gettimeofday" number="78"/>
-+  <syscall name="settimeofday" number="79"/>
-+  <syscall name="getgroups" number="80"/>
-+  <syscall name="setgroups" number="81"/>
-+  <syscall name="select" number="82"/>
-+  <syscall name="symlink" number="83"/>
-+  <syscall name="oldlstat" number="84"/>
-+  <syscall name="readlink" number="85"/>
-+  <syscall name="uselib" number="86"/>
-+  <syscall name="swapon" number="87"/>
-+  <syscall name="reboot" number="88"/>
-+  <syscall name="readdir" number="89"/>
-+  <syscall name="mmap" number="90"/>
-+  <syscall name="munmap" number="91"/>
-+  <syscall name="truncate" number="92"/>
-+  <syscall name="ftruncate" number="93"/>
-+  <syscall name="fchmod" number="94"/>
-+  <syscall name="fchown" number="95"/>
-+  <syscall name="getpriority" number="96"/>
-+  <syscall name="setpriority" number="97"/>
-+  <syscall name="profil" number="98"/>
-+  <syscall name="statfs" number="99"/>
-+  <syscall name="fstatfs" number="100"/>
-+  <syscall name="ioperm" number="101"/>
-+  <syscall name="socketcall" number="102"/>
-+  <syscall name="syslog" number="103"/>
-+  <syscall name="setitimer" number="104"/>
-+  <syscall name="getitimer" number="105"/>
-+  <syscall name="stat" number="106"/>
-+  <syscall name="lstat" number="107"/>
-+  <syscall name="fstat" number="108"/>
-+  <syscall name="olduname" number="109"/>
-+  <syscall name="iopl" number="110"/>
-+  <syscall name="vhangup" number="111"/>
-+  <syscall name="idle" number="112"/>
-+  <syscall name="vm86old" number="113"/>
-+  <syscall name="wait4" number="114"/>
-+  <syscall name="swapoff" number="115"/>
-+  <syscall name="sysinfo" number="116"/>
-+  <syscall name="ipc" number="117"/>
-+  <syscall name="fsync" number="118"/>
-+  <syscall name="sigreturn" number="119"/>
-+  <syscall name="clone" number="120"/>
-+  <syscall name="setdomainname" number="121"/>
-+  <syscall name="uname" number="122"/>
-+  <syscall name="modify_ldt" number="123"/>
-+  <syscall name="adjtimex" number="124"/>
-+  <syscall name="mprotect" number="125"/>
-+  <syscall name="sigprocmask" number="126"/>
-+  <syscall name="create_module" number="127"/>
-+  <syscall name="init_module" number="128"/>
-+  <syscall name="delete_module" number="129"/>
-+  <syscall name="get_kernel_syms" number="130"/>
-+  <syscall name="quotactl" number="131"/>
-+  <syscall name="getpgid" number="132"/>
-+  <syscall name="fchdir" number="133"/>
-+  <syscall name="bdflush" number="134"/>
-+  <syscall name="sysfs" number="135"/>
-+  <syscall name="personality" number="136"/>
-+  <syscall name="afs_syscall" number="137"/>
-+  <syscall name="setfsuid" number="138"/>
-+  <syscall name="setfsgid" number="139"/>
-+  <syscall name="_llseek" number="140"/>
-+  <syscall name="getdents" number="141"/>
-+  <syscall name="_newselect" number="142"/>
-+  <syscall name="flock" number="143"/>
-+  <syscall name="msync" number="144"/>
-+  <syscall name="readv" number="145"/>
-+  <syscall name="writev" number="146"/>
-+  <syscall name="getsid" number="147"/>
-+  <syscall name="fdatasync" number="148"/>
-+  <syscall name="_sysctl" number="149"/>
-+  <syscall name="mlock" number="150"/>
-+  <syscall name="munlock" number="151"/>
-+  <syscall name="mlockall" number="152"/>
-+  <syscall name="munlockall" number="153"/>
-+  <syscall name="sched_setparam" number="154"/>
-+  <syscall name="sched_getparam" number="155"/>
-+  <syscall name="sched_setscheduler" number="156"/>
-+  <syscall name="sched_getscheduler" number="157"/>
-+  <syscall name="sched_yield" number="158"/>
-+  <syscall name="sched_get_priority_max" number="159"/>
-+  <syscall name="sched_get_priority_min" number="160"/>
-+  <syscall name="sched_rr_get_interval" number="161"/>
-+  <syscall name="nanosleep" number="162"/>
-+  <syscall name="mremap" number="163"/>
-+  <syscall name="setresuid" number="164"/>
-+  <syscall name="getresuid" number="165"/>
-+  <syscall name="vm86" number="166"/>
-+  <syscall name="query_module" number="167"/>
-+  <syscall name="poll" number="168"/>
-+  <syscall name="nfsservctl" number="169"/>
-+  <syscall name="setresgid" number="170"/>
-+  <syscall name="getresgid" number="171"/>
-+  <syscall name="prctl" number="172"/>
-+  <syscall name="rt_sigreturn" number="173"/>
-+  <syscall name="rt_sigaction" number="174"/>
-+  <syscall name="rt_sigprocmask" number="175"/>
-+  <syscall name="rt_sigpending" number="176"/>
-+  <syscall name="rt_sigtimedwait" number="177"/>
-+  <syscall name="rt_sigqueueinfo" number="178"/>
-+  <syscall name="rt_sigsuspend" number="179"/>
-+  <syscall name="pread64" number="180"/>
-+  <syscall name="pwrite64" number="181"/>
-+  <syscall name="chown" number="182"/>
-+  <syscall name="getcwd" number="183"/>
-+  <syscall name="capget" number="184"/>
-+  <syscall name="capset" number="185"/>
-+  <syscall name="sigaltstack" number="186"/>
-+  <syscall name="sendfile" number="187"/>
-+  <syscall name="getpmsg" number="188"/>
-+  <syscall name="putpmsg" number="189"/>
-+  <syscall name="vfork" number="190"/>
-+  <syscall name="ugetrlimit" number="191"/>
-+  <syscall name="mmap2" number="192"/>
-+  <syscall name="truncate64" number="193"/>
-+  <syscall name="ftruncate64" number="194"/>
-+  <syscall name="stat64" number="195"/>
-+  <syscall name="lstat64" number="196"/>
-+  <syscall name="fstat64" number="197"/>
-+  <syscall name="lchown32" number="198"/>
-+  <syscall name="getuid32" number="199"/>
-+  <syscall name="getgid32" number="200"/>
-+  <syscall name="geteuid32" number="201"/>
-+  <syscall name="getegid32" number="202"/>
-+  <syscall name="setreuid32" number="203"/>
-+  <syscall name="setregid32" number="204"/>
-+  <syscall name="getgroups32" number="205"/>
-+  <syscall name="setgroups32" number="206"/>
-+  <syscall name="fchown32" number="207"/>
-+  <syscall name="setresuid32" number="208"/>
-+  <syscall name="getresuid32" number="209"/>
-+  <syscall name="setresgid32" number="210"/>
-+  <syscall name="getresgid32" number="211"/>
-+  <syscall name="chown32" number="212"/>
-+  <syscall name="setuid32" number="213"/>
-+  <syscall name="setgid32" number="214"/>
-+  <syscall name="setfsuid32" number="215"/>
-+  <syscall name="setfsgid32" number="216"/>
-+  <syscall name="pivot_root" number="217"/>
-+  <syscall name="mincore" number="218"/>
-+  <syscall name="madvise" number="219"/>
-+  <syscall name="madvise1" number="220"/>
-+  <syscall name="getdents64" number="221"/>
-+  <syscall name="fcntl64" number="222"/>
-+  <syscall name="gettid" number="224"/>
-+  <syscall name="readahead" number="225"/>
-+  <syscall name="setxattr" number="226"/>
-+  <syscall name="lsetxattr" number="227"/>
-+  <syscall name="fsetxattr" number="228"/>
-+  <syscall name="getxattr" number="229"/>
-+  <syscall name="lgetxattr" number="230"/>
-+  <syscall name="fgetxattr" number="231"/>
-+  <syscall name="listxattr" number="232"/>
-+  <syscall name="llistxattr" number="233"/>
-+  <syscall name="flistxattr" number="234"/>
-+  <syscall name="removexattr" number="235"/>
-+  <syscall name="lremovexattr" number="236"/>
-+  <syscall name="fremovexattr" number="237"/>
-+  <syscall name="tkill" number="238"/>
-+  <syscall name="sendfile64" number="239"/>
-+  <syscall name="futex" number="240"/>
-+  <syscall name="sched_setaffinity" number="241"/>
-+  <syscall name="sched_getaffinity" number="242"/>
-+  <syscall name="set_thread_area" number="243"/>
-+  <syscall name="get_thread_area" number="244"/>
-+  <syscall name="io_setup" number="245"/>
-+  <syscall name="io_destroy" number="246"/>
-+  <syscall name="io_getevents" number="247"/>
-+  <syscall name="io_submit" number="248"/>
-+  <syscall name="io_cancel" number="249"/>
-+  <syscall name="fadvise64" number="250"/>
-+  <syscall name="exit_group" number="252"/>
-+  <syscall name="lookup_dcookie" number="253"/>
-+  <syscall name="epoll_create" number="254"/>
-+  <syscall name="epoll_ctl" number="255"/>
-+  <syscall name="epoll_wait" number="256"/>
-+  <syscall name="remap_file_pages" number="257"/>
-+  <syscall name="set_tid_address" number="258"/>
-+  <syscall name="timer_create" number="259"/>
-+  <syscall name="timer_settime" number="260"/>
-+  <syscall name="timer_gettime" number="261"/>
-+  <syscall name="timer_getoverrun" number="262"/>
-+  <syscall name="timer_delete" number="263"/>
-+  <syscall name="clock_settime" number="264"/>
-+  <syscall name="clock_gettime" number="265"/>
-+  <syscall name="clock_getres" number="266"/>
-+  <syscall name="clock_nanosleep" number="267"/>
-+  <syscall name="statfs64" number="268"/>
-+  <syscall name="fstatfs64" number="269"/>
-+  <syscall name="tgkill" number="270"/>
-+  <syscall name="utimes" number="271"/>
-+  <syscall name="fadvise64_64" number="272"/>
-+  <syscall name="vserver" number="273"/>
-+  <syscall name="mbind" number="274"/>
-+  <syscall name="get_mempolicy" number="275"/>
-+  <syscall name="set_mempolicy" number="276"/>
-+  <syscall name="mq_open" number="277"/>
-+  <syscall name="mq_unlink" number="278"/>
-+  <syscall name="mq_timedsend" number="279"/>
-+  <syscall name="mq_timedreceive" number="280"/>
-+  <syscall name="mq_notify" number="281"/>
-+  <syscall name="mq_getsetattr" number="282"/>
-+  <syscall name="kexec_load" number="283"/>
-+  <syscall name="waitid" number="284"/>
-+  <syscall name="add_key" number="286"/>
-+  <syscall name="request_key" number="287"/>
-+  <syscall name="keyctl" number="288"/>
-+  <syscall name="ioprio_set" number="289"/>
-+  <syscall name="ioprio_get" number="290"/>
-+  <syscall name="inotify_init" number="291"/>
-+  <syscall name="inotify_add_watch" number="292"/>
-+  <syscall name="inotify_rm_watch" number="293"/>
-+  <syscall name="migrate_pages" number="294"/>
-+  <syscall name="openat" number="295"/>
-+  <syscall name="mkdirat" number="296"/>
-+  <syscall name="mknodat" number="297"/>
-+  <syscall name="fchownat" number="298"/>
-+  <syscall name="futimesat" number="299"/>
-+  <syscall name="fstatat64" number="300"/>
-+  <syscall name="unlinkat" number="301"/>
-+  <syscall name="renameat" number="302"/>
-+  <syscall name="linkat" number="303"/>
-+  <syscall name="symlinkat" number="304"/>
-+  <syscall name="readlinkat" number="305"/>
-+  <syscall name="fchmodat" number="306"/>
-+  <syscall name="faccessat" number="307"/>
-+  <syscall name="pselect6" number="308"/>
-+  <syscall name="ppoll" number="309"/>
-+  <syscall name="unshare" number="310"/>
-+  <syscall name="set_robust_list" number="311"/>
-+  <syscall name="get_robust_list" number="312"/>
-+  <syscall name="splice" number="313"/>
-+  <syscall name="sync_file_range" number="314"/>
-+  <syscall name="tee" number="315"/>
-+  <syscall name="vmsplice" number="316"/>
-+  <syscall name="move_pages" number="317"/>
-+  <syscall name="getcpu" number="318"/>
-+  <syscall name="epoll_pwait" number="319"/>
-+  <syscall name="utimensat" number="320"/>
-+  <syscall name="signalfd" number="321"/>
-+  <syscall name="timerfd_create" number="322"/>
-+  <syscall name="eventfd" number="323"/>
-+  <syscall name="fallocate" number="324"/>
-+  <syscall name="timerfd_settime" number="325"/>
-+</syscalls_info>
-diff --git a/gdb/syscalls/ppc-linux.xml b/gdb/syscalls/ppc-linux.xml
-new file mode 100644
-index 0000000..f09fabd
---- /dev/null
-+++ b/gdb/syscalls/ppc-linux.xml
-@@ -0,0 +1,304 @@
-+<?xml version="1.0"?>
-+<!-- Copyright (C) 2007, 2008 Free Software Foundation, Inc.
-+
-+     Copying and distribution of this file, with or without modification,
-+     are permitted in any medium without royalty provided the copyright
-+     notice and this notice are preserved.  -->
-+
-+<!DOCTYPE feature SYSTEM "gdb-syscalls.dtd">
-+
-+<syscalls_info>
-+  <syscall name="restart_syscall" number="0"/>
-+  <syscall name="exit" number="1"/>
-+  <syscall name="fork" number="2"/>
-+  <syscall name="read" number="3"/>
-+  <syscall name="write" number="4"/>
-+  <syscall name="open" number="5"/>
-+  <syscall name="close" number="6"/>
-+  <syscall name="waitpid" number="7"/>
-+  <syscall name="creat" number="8"/>
-+  <syscall name="link" number="9"/>
-+  <syscall name="unlink" number="10"/>
-+  <syscall name="execve" number="11"/>
-+  <syscall name="chdir" number="12"/>
-+  <syscall name="time" number="13"/>
-+  <syscall name="mknod" number="14"/>
-+  <syscall name="chmod" number="15"/>
-+  <syscall name="lchown" number="16"/>
-+  <syscall name="break" number="17"/>
-+  <syscall name="oldstat" number="18"/>
-+  <syscall name="lseek" number="19"/>
-+  <syscall name="getpid" number="20"/>
-+  <syscall name="mount" number="21"/>
-+  <syscall name="umount" number="22"/>
-+  <syscall name="setuid" number="23"/>
-+  <syscall name="getuid" number="24"/>
-+  <syscall name="stime" number="25"/>
-+  <syscall name="ptrace" number="26"/>
-+  <syscall name="alarm" number="27"/>
-+  <syscall name="oldfstat" number="28"/>
-+  <syscall name="pause" number="29"/>
-+  <syscall name="utime" number="30"/>
-+  <syscall name="stty" number="31"/>
-+  <syscall name="gtty" number="32"/>
-+  <syscall name="access" number="33"/>
-+  <syscall name="nice" number="34"/>
-+  <syscall name="ftime" number="35"/>
-+  <syscall name="sync" number="36"/>
-+  <syscall name="kill" number="37"/>
-+  <syscall name="rename" number="38"/>
-+  <syscall name="mkdir" number="39"/>
-+  <syscall name="rmdir" number="40"/>
-+  <syscall name="dup" number="41"/>
-+  <syscall name="pipe" number="42"/>
-+  <syscall name="times" number="43"/>
-+  <syscall name="prof" number="44"/>
-+  <syscall name="brk" number="45"/>
-+  <syscall name="setgid" number="46"/>
-+  <syscall name="getgid" number="47"/>
-+  <syscall name="signal" number="48"/>
-+  <syscall name="geteuid" number="49"/>
-+  <syscall name="getegid" number="50"/>
-+  <syscall name="acct" number="51"/>
-+  <syscall name="umount2" number="52"/>
-+  <syscall name="lock" number="53"/>
-+  <syscall name="ioctl" number="54"/>
-+  <syscall name="fcntl" number="55"/>
-+  <syscall name="mpx" number="56"/>
-+  <syscall name="setpgid" number="57"/>
-+  <syscall name="ulimit" number="58"/>
-+  <syscall name="oldolduname" number="59"/>
-+  <syscall name="umask" number="60"/>
-+  <syscall name="chroot" number="61"/>
-+  <syscall name="ustat" number="62"/>
-+  <syscall name="dup2" number="63"/>
-+  <syscall name="getppid" number="64"/>
-+  <syscall name="getpgrp" number="65"/>
-+  <syscall name="setsid" number="66"/>
-+  <syscall name="sigaction" number="67"/>
-+  <syscall name="sgetmask" number="68"/>
-+  <syscall name="ssetmask" number="69"/>
-+  <syscall name="setreuid" number="70"/>
-+  <syscall name="setregid" number="71"/>
-+  <syscall name="sigsuspend" number="72"/>
-+  <syscall name="sigpending" number="73"/>
-+  <syscall name="sethostname" number="74"/>
-+  <syscall name="setrlimit" number="75"/>
-+  <syscall name="getrlimit" number="76"/>
-+  <syscall name="getrusage" number="77"/>
-+  <syscall name="gettimeofday" number="78"/>
-+  <syscall name="settimeofday" number="79"/>
-+  <syscall name="getgroups" number="80"/>
-+  <syscall name="setgroups" number="81"/>
-+  <syscall name="select" number="82"/>
-+  <syscall name="symlink" number="83"/>
-+  <syscall name="oldlstat" number="84"/>
-+  <syscall name="readlink" number="85"/>
-+  <syscall name="uselib" number="86"/>
-+  <syscall name="swapon" number="87"/>
-+  <syscall name="reboot" number="88"/>
-+  <syscall name="readdir" number="89"/>
-+  <syscall name="mmap" number="90"/>
-+  <syscall name="munmap" number="91"/>
-+  <syscall name="truncate" number="92"/>
-+  <syscall name="ftruncate" number="93"/>
-+  <syscall name="fchmod" number="94"/>
-+  <syscall name="fchown" number="95"/>
-+  <syscall name="getpriority" number="96"/>
-+  <syscall name="setpriority" number="97"/>
-+  <syscall name="profil" number="98"/>
-+  <syscall name="statfs" number="99"/>
-+  <syscall name="fstatfs" number="100"/>
-+  <syscall name="ioperm" number="101"/>
-+  <syscall name="socketcall" number="102"/>
-+  <syscall name="syslog" number="103"/>
-+  <syscall name="setitimer" number="104"/>
-+  <syscall name="getitimer" number="105"/>
-+  <syscall name="stat" number="106"/>
-+  <syscall name="lstat" number="107"/>
-+  <syscall name="fstat" number="108"/>
-+  <syscall name="olduname" number="109"/>
-+  <syscall name="iopl" number="110"/>
-+  <syscall name="vhangup" number="111"/>
-+  <syscall name="idle" number="112"/>
-+  <syscall name="vm86" number="113"/>
-+  <syscall name="wait4" number="114"/>
-+  <syscall name="swapoff" number="115"/>
-+  <syscall name="sysinfo" number="116"/>
-+  <syscall name="ipc" number="117"/>
-+  <syscall name="fsync" number="118"/>
-+  <syscall name="sigreturn" number="119"/>
-+  <syscall name="clone" number="120"/>
-+  <syscall name="setdomainname" number="121"/>
-+  <syscall name="uname" number="122"/>
-+  <syscall name="modify_ldt" number="123"/>
-+  <syscall name="adjtimex" number="124"/>
-+  <syscall name="mprotect" number="125"/>
-+  <syscall name="sigprocmask" number="126"/>
-+  <syscall name="create_module" number="127"/>
-+  <syscall name="init_module" number="128"/>
-+  <syscall name="delete_module" number="129"/>
-+  <syscall name="get_kernel_syms" number="130"/>
-+  <syscall name="quotactl" number="131"/>
-+  <syscall name="getpgid" number="132"/>
-+  <syscall name="fchdir" number="133"/>
-+  <syscall name="bdflush" number="134"/>
-+  <syscall name="sysfs" number="135"/>
-+  <syscall name="personality" number="136"/>
-+  <syscall name="afs_syscall" number="137"/>
-+  <syscall name="setfsuid" number="138"/>
-+  <syscall name="setfsgid" number="139"/>
-+  <syscall name="_llseek" number="140"/>
-+  <syscall name="getdents" number="141"/>
-+  <syscall name="_newselect" number="142"/>
-+  <syscall name="flock" number="143"/>
-+  <syscall name="msync" number="144"/>
-+  <syscall name="readv" number="145"/>
-+  <syscall name="writev" number="146"/>
-+  <syscall name="getsid" number="147"/>
-+  <syscall name="fdatasync" number="148"/>
-+  <syscall name="_sysctl" number="149"/>
-+  <syscall name="mlock" number="150"/>
-+  <syscall name="munlock" number="151"/>
-+  <syscall name="mlockall" number="152"/>
-+  <syscall name="munlockall" number="153"/>
-+  <syscall name="sched_setparam" number="154"/>
-+  <syscall name="sched_getparam" number="155"/>
-+  <syscall name="sched_setscheduler" number="156"/>
-+  <syscall name="sched_getscheduler" number="157"/>
-+  <syscall name="sched_yield" number="158"/>
-+  <syscall name="sched_get_priority_max" number="159"/>
-+  <syscall name="sched_get_priority_min" number="160"/>
-+  <syscall name="sched_rr_get_interval" number="161"/>
-+  <syscall name="nanosleep" number="162"/>
-+  <syscall name="mremap" number="163"/>
-+  <syscall name="setresuid" number="164"/>
-+  <syscall name="getresuid" number="165"/>
-+  <syscall name="query_module" number="166"/>
-+  <syscall name="poll" number="167"/>
-+  <syscall name="nfsservctl" number="168"/>
-+  <syscall name="setresgid" number="169"/>
-+  <syscall name="getresgid" number="170"/>
-+  <syscall name="prctl" number="171"/>
-+  <syscall name="rt_sigreturn" number="172"/>
-+  <syscall name="rt_sigaction" number="173"/>
-+  <syscall name="rt_sigprocmask" number="174"/>
-+  <syscall name="rt_sigpending" number="175"/>
-+  <syscall name="rt_sigtimedwait" number="176"/>
-+  <syscall name="rt_sigqueueinfo" number="177"/>
-+  <syscall name="rt_sigsuspend" number="178"/>
-+  <syscall name="pread64" number="179"/>
-+  <syscall name="pwrite64" number="180"/>
-+  <syscall name="chown" number="181"/>
-+  <syscall name="getcwd" number="182"/>
-+  <syscall name="capget" number="183"/>
-+  <syscall name="capset" number="184"/>
-+  <syscall name="sigaltstack" number="185"/>
-+  <syscall name="sendfile" number="186"/>
-+  <syscall name="getpmsg" number="187"/>
-+  <syscall name="putpmsg" number="188"/>
-+  <syscall name="vfork" number="189"/>
-+  <syscall name="ugetrlimit" number="190"/>
-+  <syscall name="readahead" number="191"/>
-+  <syscall name="mmap2" number="192"/>
-+  <syscall name="truncate64" number="193"/>
-+  <syscall name="ftruncate64" number="194"/>
-+  <syscall name="stat64" number="195"/>
-+  <syscall name="lstat64" number="196"/>
-+  <syscall name="fstat64" number="197"/>
-+  <syscall name="pciconfig_read" number="198"/>
-+  <syscall name="pciconfig_write" number="199"/>
-+  <syscall name="pciconfig_iobase" number="200"/>
-+  <syscall name="multiplexer" number="201"/>
-+  <syscall name="getdents64" number="202"/>
-+  <syscall name="pivot_root" number="203"/>
-+  <syscall name="fcntl64" number="204"/>
-+  <syscall name="madvise" number="205"/>
-+  <syscall name="mincore" number="206"/>
-+  <syscall name="gettid" number="207"/>
-+  <syscall name="tkill" number="208"/>
-+  <syscall name="setxattr" number="209"/>
-+  <syscall name="lsetxattr" number="210"/>
-+  <syscall name="fsetxattr" number="211"/>
-+  <syscall name="getxattr" number="212"/>
-+  <syscall name="lgetxattr" number="213"/>
-+  <syscall name="fgetxattr" number="214"/>
-+  <syscall name="listxattr" number="215"/>
-+  <syscall name="llistxattr" number="216"/>
-+  <syscall name="flistxattr" number="217"/>
-+  <syscall name="removexattr" number="218"/>
-+  <syscall name="lremovexattr" number="219"/>
-+  <syscall name="fremovexattr" number="220"/>
-+  <syscall name="futex" number="221"/>
-+  <syscall name="sched_setaffinity" number="222"/>
-+  <syscall name="sched_getaffinity" number="223"/>
-+  <syscall name="tuxcall" number="225"/>
-+  <syscall name="sendfile64" number="226"/>
-+  <syscall name="io_setup" number="227"/>
-+  <syscall name="io_destroy" number="228"/>
-+  <syscall name="io_getevents" number="229"/>
-+  <syscall name="io_submit" number="230"/>
-+  <syscall name="io_cancel" number="231"/>
-+  <syscall name="set_tid_address" number="232"/>
-+  <syscall name="fadvise64" number="233"/>
-+  <syscall name="exit_group" number="234"/>
-+  <syscall name="lookup_dcookie" number="235"/>
-+  <syscall name="epoll_create" number="236"/>
-+  <syscall name="epoll_ctl" number="237"/>
-+  <syscall name="epoll_wait" number="238"/>
-+  <syscall name="remap_file_pages" number="239"/>
-+  <syscall name="timer_create" number="240"/>
-+  <syscall name="timer_settime" number="241"/>
-+  <syscall name="timer_gettime" number="242"/>
-+  <syscall name="timer_getoverrun" number="243"/>
-+  <syscall name="timer_delete" number="244"/>
-+  <syscall name="clock_settime" number="245"/>
-+  <syscall name="clock_gettime" number="246"/>
-+  <syscall name="clock_getres" number="247"/>
-+  <syscall name="clock_nanosleep" number="248"/>
-+  <syscall name="swapcontext" number="249"/>
-+  <syscall name="tgkill" number="250"/>
-+  <syscall name="utimes" number="251"/>
-+  <syscall name="statfs64" number="252"/>
-+  <syscall name="fstatfs64" number="253"/>
-+  <syscall name="fadvise64_64" number="254"/>
-+  <syscall name="rtas" number="255"/>
-+  <syscall name="sys_debug_setcontext" number="256"/>
-+  <syscall name="mbind" number="259"/>
-+  <syscall name="get_mempolicy" number="260"/>
-+  <syscall name="set_mempolicy" number="261"/>
-+  <syscall name="mq_open" number="262"/>
-+  <syscall name="mq_unlink" number="263"/>
-+  <syscall name="mq_timedsend" number="264"/>
-+  <syscall name="mq_timedreceive" number="265"/>
-+  <syscall name="mq_notify" number="266"/>
-+  <syscall name="mq_getsetattr" number="267"/>
-+  <syscall name="kexec_load" number="268"/>
-+  <syscall name="add_key" number="269"/>
-+  <syscall name="request_key" number="270"/>
-+  <syscall name="keyctl" number="271"/>
-+  <syscall name="waitid" number="272"/>
-+  <syscall name="ioprio_set" number="273"/>
-+  <syscall name="ioprio_get" number="274"/>
-+  <syscall name="inotify_init" number="275"/>
-+  <syscall name="inotify_add_watch" number="276"/>
-+  <syscall name="inotify_rm_watch" number="277"/>
-+  <syscall name="spu_run" number="278"/>
-+  <syscall name="spu_create" number="279"/>
-+  <syscall name="pselect6" number="280"/>
-+  <syscall name="ppoll" number="281"/>
-+  <syscall name="unshare" number="282"/>
-+  <syscall name="openat" number="286"/>
-+  <syscall name="mkdirat" number="287"/>
-+  <syscall name="mknodat" number="288"/>
-+  <syscall name="fchownat" number="289"/>
-+  <syscall name="futimesat" number="290"/>
-+  <syscall name="fstatat64" number="291"/>
-+  <syscall name="unlinkat" number="292"/>
-+  <syscall name="renameat" number="293"/>
-+  <syscall name="linkat" number="294"/>
-+  <syscall name="symlinkat" number="295"/>
-+  <syscall name="readlinkat" number="296"/>
-+  <syscall name="fchmodat" number="297"/>
-+  <syscall name="faccessat" number="298"/>
-+</syscalls_info>
-diff --git a/gdb/syscalls/ppc64-linux.xml b/gdb/syscalls/ppc64-linux.xml
-new file mode 100644
-index 0000000..7ee929c
---- /dev/null
-+++ b/gdb/syscalls/ppc64-linux.xml
-@@ -0,0 +1,289 @@
-+<?xml version="1.0"?>
-+<!-- Copyright (C) 2007, 2008 Free Software Foundation, Inc.
-+
-+     Copying and distribution of this file, with or without modification,
-+     are permitted in any medium without royalty provided the copyright
-+     notice and this notice are preserved.  -->
-+
-+<!DOCTYPE feature SYSTEM "gdb-syscalls.dtd">
-+
-+<syscalls_info>
-+  <syscall name="restart_syscall" number="0"/>
-+  <syscall name="exit" number="1"/>
-+  <syscall name="fork" number="2"/>
-+  <syscall name="read" number="3"/>
-+  <syscall name="write" number="4"/>
-+  <syscall name="open" number="5"/>
-+  <syscall name="close" number="6"/>
-+  <syscall name="waitpid" number="7"/>
-+  <syscall name="creat" number="8"/>
-+  <syscall name="link" number="9"/>
-+  <syscall name="unlink" number="10"/>
-+  <syscall name="execve" number="11"/>
-+  <syscall name="chdir" number="12"/>
-+  <syscall name="time" number="13"/>
-+  <syscall name="mknod" number="14"/>
-+  <syscall name="chmod" number="15"/>
-+  <syscall name="lchown" number="16"/>
-+  <syscall name="break" number="17"/>
-+  <syscall name="oldstat" number="18"/>
-+  <syscall name="lseek" number="19"/>
-+  <syscall name="getpid" number="20"/>
-+  <syscall name="mount" number="21"/>
-+  <syscall name="umount" number="22"/>
-+  <syscall name="setuid" number="23"/>
-+  <syscall name="getuid" number="24"/>
-+  <syscall name="stime" number="25"/>
-+  <syscall name="ptrace" number="26"/>
-+  <syscall name="alarm" number="27"/>
-+  <syscall name="oldfstat" number="28"/>
-+  <syscall name="pause" number="29"/>
-+  <syscall name="utime" number="30"/>
-+  <syscall name="stty" number="31"/>
-+  <syscall name="gtty" number="32"/>
-+  <syscall name="access" number="33"/>
-+  <syscall name="nice" number="34"/>
-+  <syscall name="ftime" number="35"/>
-+  <syscall name="sync" number="36"/>
-+  <syscall name="kill" number="37"/>
-+  <syscall name="rename" number="38"/>
-+  <syscall name="mkdir" number="39"/>
-+  <syscall name="rmdir" number="40"/>
-+  <syscall name="dup" number="41"/>
-+  <syscall name="pipe" number="42"/>
-+  <syscall name="times" number="43"/>
-+  <syscall name="prof" number="44"/>
-+  <syscall name="brk" number="45"/>
-+  <syscall name="setgid" number="46"/>
-+  <syscall name="getgid" number="47"/>
-+  <syscall name="signal" number="48"/>
-+  <syscall name="geteuid" number="49"/>
-+  <syscall name="getegid" number="50"/>
-+  <syscall name="acct" number="51"/>
-+  <syscall name="umount2" number="52"/>
-+  <syscall name="lock" number="53"/>
-+  <syscall name="ioctl" number="54"/>
-+  <syscall name="fcntl" number="55"/>
-+  <syscall name="mpx" number="56"/>
-+  <syscall name="setpgid" number="57"/>
-+  <syscall name="ulimit" number="58"/>
-+  <syscall name="oldolduname" number="59"/>
-+  <syscall name="umask" number="60"/>
-+  <syscall name="chroot" number="61"/>
-+  <syscall name="ustat" number="62"/>
-+  <syscall name="dup2" number="63"/>
-+  <syscall name="getppid" number="64"/>
-+  <syscall name="getpgrp" number="65"/>
-+  <syscall name="setsid" number="66"/>
-+  <syscall name="sigaction" number="67"/>
-+  <syscall name="sgetmask" number="68"/>
-+  <syscall name="ssetmask" number="69"/>
-+  <syscall name="setreuid" number="70"/>
-+  <syscall name="setregid" number="71"/>
-+  <syscall name="sigsuspend" number="72"/>
-+  <syscall name="sigpending" number="73"/>
-+  <syscall name="sethostname" number="74"/>
-+  <syscall name="setrlimit" number="75"/>
-+  <syscall name="getrlimit" number="76"/>
-+  <syscall name="getrusage" number="77"/>
-+  <syscall name="gettimeofday" number="78"/>
-+  <syscall name="settimeofday" number="79"/>
-+  <syscall name="getgroups" number="80"/>
-+  <syscall name="setgroups" number="81"/>
-+  <syscall name="select" number="82"/>
-+  <syscall name="symlink" number="83"/>
-+  <syscall name="oldlstat" number="84"/>
-+  <syscall name="readlink" number="85"/>
-+  <syscall name="uselib" number="86"/>
-+  <syscall name="swapon" number="87"/>
-+  <syscall name="reboot" number="88"/>
-+  <syscall name="readdir" number="89"/>
-+  <syscall name="mmap" number="90"/>
-+  <syscall name="munmap" number="91"/>
-+  <syscall name="truncate" number="92"/>
-+  <syscall name="ftruncate" number="93"/>
-+  <syscall name="fchmod" number="94"/>
-+  <syscall name="fchown" number="95"/>
-+  <syscall name="getpriority" number="96"/>
-+  <syscall name="setpriority" number="97"/>
-+  <syscall name="profil" number="98"/>
-+  <syscall name="statfs" number="99"/>
-+  <syscall name="fstatfs" number="100"/>
-+  <syscall name="ioperm" number="101"/>
-+  <syscall name="socketcall" number="102"/>
-+  <syscall name="syslog" number="103"/>
-+  <syscall name="setitimer" number="104"/>
-+  <syscall name="getitimer" number="105"/>
-+  <syscall name="stat" number="106"/>
-+  <syscall name="lstat" number="107"/>
-+  <syscall name="fstat" number="108"/>
-+  <syscall name="olduname" number="109"/>
-+  <syscall name="iopl" number="110"/>
-+  <syscall name="vhangup" number="111"/>
-+  <syscall name="idle" number="112"/>
-+  <syscall name="vm86" number="113"/>
-+  <syscall name="wait4" number="114"/>
-+  <syscall name="swapoff" number="115"/>
-+  <syscall name="sysinfo" number="116"/>
-+  <syscall name="ipc" number="117"/>
-+  <syscall name="fsync" number="118"/>
-+  <syscall name="sigreturn" number="119"/>
-+  <syscall name="clone" number="120"/>
-+  <syscall name="setdomainname" number="121"/>
-+  <syscall name="uname" number="122"/>
-+  <syscall name="modify_ldt" number="123"/>
-+  <syscall name="adjtimex" number="124"/>
-+  <syscall name="mprotect" number="125"/>
-+  <syscall name="sigprocmask" number="126"/>
-+  <syscall name="create_module" number="127"/>
-+  <syscall name="init_module" number="128"/>
-+  <syscall name="delete_module" number="129"/>
-+  <syscall name="get_kernel_syms" number="130"/>
-+  <syscall name="quotactl" number="131"/>
-+  <syscall name="getpgid" number="132"/>
-+  <syscall name="fchdir" number="133"/>
-+  <syscall name="bdflush" number="134"/>
-+  <syscall name="sysfs" number="135"/>
-+  <syscall name="personality" number="136"/>
-+  <syscall name="afs_syscall" number="137"/>
-+  <syscall name="setfsuid" number="138"/>
-+  <syscall name="setfsgid" number="139"/>
-+  <syscall name="_llseek" number="140"/>
-+  <syscall name="getdents" number="141"/>
-+  <syscall name="_newselect" number="142"/>
-+  <syscall name="flock" number="143"/>
-+  <syscall name="msync" number="144"/>
-+  <syscall name="readv" number="145"/>
-+  <syscall name="writev" number="146"/>
-+  <syscall name="getsid" number="147"/>
-+  <syscall name="fdatasync" number="148"/>
-+  <syscall name="_sysctl" number="149"/>
-+  <syscall name="mlock" number="150"/>
-+  <syscall name="munlock" number="151"/>
-+  <syscall name="mlockall" number="152"/>
-+  <syscall name="munlockall" number="153"/>
-+  <syscall name="sched_setparam" number="154"/>
-+  <syscall name="sched_getparam" number="155"/>
-+  <syscall name="sched_setscheduler" number="156"/>
-+  <syscall name="sched_getscheduler" number="157"/>
-+  <syscall name="sched_yield" number="158"/>
-+  <syscall name="sched_get_priority_max" number="159"/>
-+  <syscall name="sched_get_priority_min" number="160"/>
-+  <syscall name="sched_rr_get_interval" number="161"/>
-+  <syscall name="nanosleep" number="162"/>
-+  <syscall name="mremap" number="163"/>
-+  <syscall name="setresuid" number="164"/>
-+  <syscall name="getresuid" number="165"/>
-+  <syscall name="query_module" number="166"/>
-+  <syscall name="poll" number="167"/>
-+  <syscall name="nfsservctl" number="168"/>
-+  <syscall name="setresgid" number="169"/>
-+  <syscall name="getresgid" number="170"/>
-+  <syscall name="prctl" number="171"/>
-+  <syscall name="rt_sigreturn" number="172"/>
-+  <syscall name="rt_sigaction" number="173"/>
-+  <syscall name="rt_sigprocmask" number="174"/>
-+  <syscall name="rt_sigpending" number="175"/>
-+  <syscall name="rt_sigtimedwait" number="176"/>
-+  <syscall name="rt_sigqueueinfo" number="177"/>
-+  <syscall name="rt_sigsuspend" number="178"/>
-+  <syscall name="pread64" number="179"/>
-+  <syscall name="pwrite64" number="180"/>
-+  <syscall name="chown" number="181"/>
-+  <syscall name="getcwd" number="182"/>
-+  <syscall name="capget" number="183"/>
-+  <syscall name="capset" number="184"/>
-+  <syscall name="sigaltstack" number="185"/>
-+  <syscall name="sendfile" number="186"/>
-+  <syscall name="getpmsg" number="187"/>
-+  <syscall name="putpmsg" number="188"/>
-+  <syscall name="vfork" number="189"/>
-+  <syscall name="ugetrlimit" number="190"/>
-+  <syscall name="readahead" number="191"/>
-+  <syscall name="pciconfig_read" number="198"/>
-+  <syscall name="pciconfig_write" number="199"/>
-+  <syscall name="pciconfig_iobase" number="200"/>
-+  <syscall name="multiplexer" number="201"/>
-+  <syscall name="getdents64" number="202"/>
-+  <syscall name="pivot_root" number="203"/>
-+  <syscall name="madvise" number="205"/>
-+  <syscall name="mincore" number="206"/>
-+  <syscall name="gettid" number="207"/>
-+  <syscall name="tkill" number="208"/>
-+  <syscall name="setxattr" number="209"/>
-+  <syscall name="lsetxattr" number="210"/>
-+  <syscall name="fsetxattr" number="211"/>
-+  <syscall name="getxattr" number="212"/>
-+  <syscall name="lgetxattr" number="213"/>
-+  <syscall name="fgetxattr" number="214"/>
-+  <syscall name="listxattr" number="215"/>
-+  <syscall name="llistxattr" number="216"/>
-+  <syscall name="flistxattr" number="217"/>
-+  <syscall name="removexattr" number="218"/>
-+  <syscall name="lremovexattr" number="219"/>
-+  <syscall name="fremovexattr" number="220"/>
-+  <syscall name="futex" number="221"/>
-+  <syscall name="sched_setaffinity" number="222"/>
-+  <syscall name="sched_getaffinity" number="223"/>
-+  <syscall name="tuxcall" number="225"/>
-+  <syscall name="io_setup" number="227"/>
-+  <syscall name="io_destroy" number="228"/>
-+  <syscall name="io_getevents" number="229"/>
-+  <syscall name="io_submit" number="230"/>
-+  <syscall name="io_cancel" number="231"/>
-+  <syscall name="set_tid_address" number="232"/>
-+  <syscall name="fadvise64" number="233"/>
-+  <syscall name="exit_group" number="234"/>
-+  <syscall name="lookup_dcookie" number="235"/>
-+  <syscall name="epoll_create" number="236"/>
-+  <syscall name="epoll_ctl" number="237"/>
-+  <syscall name="epoll_wait" number="238"/>
-+  <syscall name="remap_file_pages" number="239"/>
-+  <syscall name="timer_create" number="240"/>
-+  <syscall name="timer_settime" number="241"/>
-+  <syscall name="timer_gettime" number="242"/>
-+  <syscall name="timer_getoverrun" number="243"/>
-+  <syscall name="timer_delete" number="244"/>
-+  <syscall name="clock_settime" number="245"/>
-+  <syscall name="clock_gettime" number="246"/>
-+  <syscall name="clock_getres" number="247"/>
-+  <syscall name="clock_nanosleep" number="248"/>
-+  <syscall name="swapcontext" number="249"/>
-+  <syscall name="tgkill" number="250"/>
-+  <syscall name="utimes" number="251"/>
-+  <syscall name="statfs64" number="252"/>
-+  <syscall name="fstatfs64" number="253"/>
-+  <syscall name="rtas" number="255"/>
-+  <syscall name="sys_debug_setcontext" number="256"/>
-+  <syscall name="mbind" number="259"/>
-+  <syscall name="get_mempolicy" number="260"/>
-+  <syscall name="set_mempolicy" number="261"/>
-+  <syscall name="mq_open" number="262"/>
-+  <syscall name="mq_unlink" number="263"/>
-+  <syscall name="mq_timedsend" number="264"/>
-+  <syscall name="mq_timedreceive" number="265"/>
-+  <syscall name="mq_notify" number="266"/>
-+  <syscall name="mq_getsetattr" number="267"/>
-+  <syscall name="kexec_load" number="268"/>
-+  <syscall name="add_key" number="269"/>
-+  <syscall name="request_key" number="270"/>
-+  <syscall name="keyctl" number="271"/>
-+  <syscall name="waitid" number="272"/>
-+  <syscall name="ioprio_set" number="273"/>
-+  <syscall name="ioprio_get" number="274"/>
-+  <syscall name="inotify_init" number="275"/>
-+  <syscall name="inotify_add_watch" number="276"/>
-+  <syscall name="inotify_rm_watch" number="277"/>
-+  <syscall name="spu_run" number="278"/>
-+  <syscall name="spu_create" number="279"/>
-+  <syscall name="pselect6" number="280"/>
-+  <syscall name="ppoll" number="281"/>
-+  <syscall name="unshare" number="282"/>
-+  <syscall name="unlinkat" number="286"/>
-+  <syscall name="renameat" number="287"/>
-+  <syscall name="linkat" number="288"/>
-+  <syscall name="symlinkat" number="289"/>
-+  <syscall name="readlinkat" number="290"/>
-+  <syscall name="fchmodat" number="291"/>
-+  <syscall name="faccessat" number="292"/>
-+</syscalls_info>
-diff --git a/gdb/target.c b/gdb/target.c
-index b89d551..831070c 100644
---- a/gdb/target.c
-+++ b/gdb/target.c
-@@ -443,6 +443,8 @@ update_current_target (void)
-       /* Do not inherit to_follow_fork.  */
-       INHERIT (to_insert_exec_catchpoint, t);
-       INHERIT (to_remove_exec_catchpoint, t);
-+      INHERIT (to_passed_by_entrypoint, t);
-+      INHERIT (to_set_syscall_catchpoint, t);
-       INHERIT (to_has_exited, t);
-       /* Do not inherit to_mourn_inferiour.  */
-       INHERIT (to_can_run, t);
-@@ -586,9 +588,15 @@ update_current_target (void)
-   de_fault (to_insert_exec_catchpoint,
-           (void (*) (int))
-           tcomplain);
-+  de_fault (to_passed_by_entrypoint,
-+            (int (*) (void))
-+            tcomplain);
-   de_fault (to_remove_exec_catchpoint,
-           (int (*) (int))
-           tcomplain);
-+  de_fault (to_set_syscall_catchpoint,
-+          (int (*) (int, int, int, int, int *))
-+          tcomplain);
-   de_fault (to_has_exited,
-           (int (*) (int, int, int *))
-           return_zero);
-@@ -2677,9 +2685,9 @@ target_waitstatus_to_string (const struct target_waitstatus *ws)
-     case TARGET_WAITKIND_EXECD:
-       return xstrprintf ("%sexecd", kind_str);
-     case TARGET_WAITKIND_SYSCALL_ENTRY:
--      return xstrprintf ("%ssyscall-entry", kind_str);
-+      return xstrprintf ("%sentered syscall", kind_str);
-     case TARGET_WAITKIND_SYSCALL_RETURN:
--      return xstrprintf ("%ssyscall-return", kind_str);
-+      return xstrprintf ("%sexited syscall", kind_str);
-     case TARGET_WAITKIND_SPURIOUS:
-       return xstrprintf ("%sspurious", kind_str);
-     case TARGET_WAITKIND_IGNORE:
+@@ -3420,6 +3439,7 @@ setup_target_debug (void)
+   current_target.to_remove_hw_breakpoint = debug_to_remove_hw_breakpoint;
+   current_target.to_insert_watchpoint = debug_to_insert_watchpoint;
+   current_target.to_remove_watchpoint = debug_to_remove_watchpoint;
++  current_target.to_detach_watchpoints = debug_to_detach_watchpoints;
+   current_target.to_stopped_by_watchpoint = debug_to_stopped_by_watchpoint;
+   current_target.to_stopped_data_address = debug_to_stopped_data_address;
+   current_target.to_watchpoint_addr_within_range = debug_to_watchpoint_addr_within_range;
 diff --git a/gdb/target.h b/gdb/target.h
-index 7f4cd8f..8dcc3d6 100644
+index b1cb852..adff946 100644
 --- a/gdb/target.h
 +++ b/gdb/target.h
-@@ -140,18 +140,34 @@ struct target_waitstatus
-   {
-     enum target_waitkind kind;
--    /* Forked child pid, execd pathname, exit status or signal number.  */
-+    /* Forked child pid, execd pathname, exit status, signal number or
-+       syscall name.  */
-     union
-       {
-       int integer;
-       enum target_signal sig;
-       ptid_t related_pid;
-       char *execd_pathname;
--      int syscall_id;
-+      int syscall_number;
-       }
-     value;
-   };
-+/* The structure below stores information about a system call.
-+   It is basically used in the "catch syscall" command, and in
-+   every function that gives information about a system call.
-+   
-+   It's also good to mention that its fields represent everything
-+   that we currently know about a syscall in GDB.  */
-+struct syscall
-+  {
-+    /* The syscall number.  */
-+    int number;
-+
-+    /* The syscall name.  */
-+    const char *name;
-+  };
-+
- /* Return a pretty printed form of target_waitstatus.
-    Space for the result is malloc'd, caller must free.  */
- extern char *target_waitstatus_to_string (const struct target_waitstatus *);
-@@ -392,6 +408,8 @@ struct target_ops
-     int (*to_follow_fork) (struct target_ops *, int);
-     void (*to_insert_exec_catchpoint) (int);
-     int (*to_remove_exec_catchpoint) (int);
-+    int (*to_passed_by_entrypoint) (void);
-+    int (*to_set_syscall_catchpoint) (int, int, int, int, int *);
-     int (*to_has_exited) (int, int, int *);
-     void (*to_mourn_inferior) (struct target_ops *);
-     int (*to_can_run) (void);
-@@ -723,6 +741,8 @@ extern int inferior_has_vforked (ptid_t pid, ptid_t *child_pid);
- extern int inferior_has_execd (ptid_t pid, char **execd_pathname);
-+extern int inferior_has_called_syscall (ptid_t pid, int *syscall_number);
-+
- /* From exec.c */
- extern void print_section_info (struct target_ops *, bfd *);
-@@ -881,6 +901,21 @@ int target_follow_fork (int follow_child);
- #define target_remove_exec_catchpoint(pid) \
-      (*current_target.to_remove_exec_catchpoint) (pid)
-+/* Has the inferior already passed through its entrypoint? */
-+#define target_passed_by_entrypoint() \
-+     (*current_target.to_passed_by_entrypoint) ()
-+
-+/* Syscall catch.  NEEDED is nonzero if any syscall catch (of any
-+   kind) is requested.  ANY_COUNT is nonzero if a generic
-+   (filter-less) syscall catch is being requested.  TABLE is an array
-+   of ints, indexed by syscall number.  An element in this array is
-+   nonzero if that syscall should be caught.  TABLE_SIZE is the number
-+   of elements in TABLE.  */
-+
-+#define target_set_syscall_catchpoint(pid, needed, any_count, table_size, table) \
-+     (*current_target.to_set_syscall_catchpoint) (pid, needed, any_count, \
-+                                                table_size, table)
-+
- /* Returns TRUE if PID has exited.  And, also sets EXIT_STATUS to the
-    exit code of PID, if any.  */
-@@ -1146,6 +1181,20 @@ extern int target_search_memory (CORE_ADDR start_addr,
+@@ -395,6 +395,7 @@ struct target_ops
+     int (*to_remove_hw_breakpoint) (struct gdbarch *, struct bp_target_info *);
+     int (*to_remove_watchpoint) (CORE_ADDR, int, int);
+     int (*to_insert_watchpoint) (CORE_ADDR, int, int);
++    int (*to_detach_watchpoints) (void);
+     int (*to_stopped_by_watchpoint) (void);
+     int to_have_steppable_watchpoint;
+     int to_have_continuable_watchpoint;
+@@ -1166,6 +1167,15 @@ extern char *normal_pid_to_str (ptid_t ptid);
+ #define       target_remove_watchpoint(addr, len, type)       \
+      (*current_target.to_remove_watchpoint) (addr, len, type)
++/* Clear all debug registers without affecting any register caches.  Function
++   acts on INFERIOR_PTID which should be the forked-off process, either the
++   non-threaded child one or the threaded parent one, depending on `set
++   follow-fork-mode'.  Both watchpoints and hardware breakpoints get removed.
++   Return 0 on success, -1 on failure.  */
++
++#define       target_detach_watchpoints()     \
++     (*current_target.to_detach_watchpoints) ()
++
+ #define target_insert_hw_breakpoint(gdbarch, bp_tgt) \
+      (*current_target.to_insert_hw_breakpoint) (gdbarch, bp_tgt)
+@@ -1203,6 +1213,20 @@ extern int target_search_memory (CORE_ADDR start_addr,
                                   ULONGEST pattern_len,
                                   CORE_ADDR *found_addrp);
  
@@ -33922,131 +20118,27 @@ index 7f4cd8f..8dcc3d6 100644
  /* Command logging facility.  */
  
  #define target_log_command(p)                                         \
-diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
-index e3aaeab..e886869 100644
---- a/gdb/testsuite/ChangeLog
-+++ b/gdb/testsuite/ChangeLog
-@@ -1,3 +1,7 @@
-+2009-03-05  Pedro Alves  <pedro@codesourcery.com>
-+
-+      * gdb.arch/i386-permbkpt.S, gdb.arch/i386-permbkpt.exp: New.
-+
- 2009-02-18  Jan Kratochvil  <jan.kratochvil@redhat.com>
-       * gdb.base/macscp.exp (objfile): Move it to ${objdir}/${subdir}/.
-diff --git a/gdb/testsuite/configure.ac b/gdb/testsuite/configure.ac
-index 3d8fae4..5fb9067 100644
---- a/gdb/testsuite/configure.ac
-+++ b/gdb/testsuite/configure.ac
-@@ -1,7 +1,7 @@
- #                                                       -*- Autoconf -*-
- # Process this file with autoconf to produce a configure script.
--# Copyright 2002, 2003, 2004, 2005
-+# Copyright 2002, 2003, 2004, 2005, 2008
- # Free Software Foundation, Inc.
- #
- # This program is free software; you can redistribute it and/or modify
-diff --git a/gdb/testsuite/gdb.arch/i386-permbkpt.S b/gdb/testsuite/gdb.arch/i386-permbkpt.S
-new file mode 100644
-index 0000000..02a31d6
---- /dev/null
-+++ b/gdb/testsuite/gdb.arch/i386-permbkpt.S
-@@ -0,0 +1,30 @@
-+/* Copyright 2009 Free Software Foundation, Inc.
-+
-+   This program is free software; you can redistribute it and/or modify
-+   it under the terms of the GNU General Public License as published by
-+   the Free Software Foundation; either version 3 of the License, or
-+   (at your option) any later version.
-+
-+   This program is distributed in the hope that it will be useful,
-+   but WITHOUT ANY WARRANTY; without even the implied warranty of
-+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-+   GNU General Public License for more details.
-+
-+   You should have received a copy of the GNU General Public License
-+   along with this program.  If not, see <http://www.gnu.org/licenses/>.
-+
-+   This file is part of the gdb testsuite.  */
-+
-+#define CONCAT1(a, b) CONCAT2(a, b)
-+#define CONCAT2(a, b) a ## b
-+
-+#ifdef SYMBOL_PREFIX
-+# define SYMBOL(str)     CONCAT1(SYMBOL_PREFIX, str)
-+#else
-+# define SYMBOL(str)     str
-+#endif
-+
-+      .global SYMBOL(main)
-+SYMBOL(main):
-+      int3
-+      ret
-diff --git a/gdb/testsuite/gdb.arch/i386-permbkpt.exp b/gdb/testsuite/gdb.arch/i386-permbkpt.exp
-new file mode 100644
-index 0000000..f1930e5
---- /dev/null
-+++ b/gdb/testsuite/gdb.arch/i386-permbkpt.exp
-@@ -0,0 +1,52 @@
-+# Copyright (C) 2009 Free Software Foundation, Inc.
-+
-+# This program is free software; you can redistribute it and/or modify
-+# it under the terms of the GNU General Public License as published by
-+# the Free Software Foundation; either version 3 of the License, or
-+# (at your option) any later version.
-+#
-+# This program is distributed in the hope that it will be useful,
-+# but WITHOUT ANY WARRANTY; without even the implied warranty of
-+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-+# GNU General Public License for more details.
-+#
-+# You should have received a copy of the GNU General Public License
-+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
-+
-+
-+# This file is part of the gdb testsuite.
-+
-+if $tracelevel {
-+    strace $tracelevel
-+}
-+
-+# Test inserting breakpoints over permanent breakpoints on i386 and amd64.
-+
-+if { ![istarget "i?86-*-*"] && ![istarget "x86_64-*-*"] } then {
-+    verbose "Skipping i386 test for multi break at permanent breakpoint location."
-+    return
-+}
-+
-+set testfile "i386-permbkpt"
-+set srcfile ${testfile}.S
-+set binfile ${objdir}/${subdir}/${testfile}
-+
-+# Some targets have leading underscores on assembly symbols.
-+# TODO: detect this automatically
-+set additional_flags ""
-+if { [istarget "*-*-cygwin*"] || [istarget "*-*-mingw*"] } then {
-+    set additional_flags "additional_flags=-DSYMBOL_PREFIX=_"
-+}
-+
-+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable [list debug $additional_flags]] != "" } {
-+    untested i386-permbkpt.exp
-+    return -1
-+}
+@@ -1322,6 +1346,14 @@ extern struct target_ops *find_target_beneath (struct target_ops *);
+ extern char *target_get_osdata (const char *type);
++/* Read OS data object of type TYPE from the target, and return it in
++   XML format.  The result is NUL-terminated and returned as a string,
++   allocated using xmalloc.  If an error occurs or the transfer is
++   unsupported, NULL is returned.  Empty objects are returned as
++   allocated but empty strings.  */
 +
-+gdb_exit
-+gdb_start
-+gdb_reinitialize_dir $srcdir/$subdir
-+gdb_load ${binfile}
++extern char *target_get_osdata (const char *type);
 +
-+gdb_test "break main" "" "First permanent break"
-+gdb_test "break main" "" "Second permanent break"
\f
+ /* Stuff that should be shared among the various remote targets.  */
 diff --git a/gdb/testsuite/gdb.arch/powerpc-power7.exp b/gdb/testsuite/gdb.arch/powerpc-power7.exp
 new file mode 100644
-index 0000000..d9c48f9
+index 0000000..ae301db
 --- /dev/null
 +++ b/gdb/testsuite/gdb.arch/powerpc-power7.exp
-@@ -0,0 +1,166 @@
+@@ -0,0 +1,175 @@
 +# Copyright 2009 Free Software Foundation, Inc.
 +
 +# This program is free software; you can redistribute it and/or modify
@@ -34096,14 +20188,23 @@ index 0000000..d9c48f9
 +    }
 +}
 +
-+proc func_check {offset instr} {
++proc instr_to_patt {offset instr} {
++    # 0x0000000000000018 <func+24>:   stxvd2x vs43,r4,r5
++    return ".*\r\n[string map {0x 0x0*} $offset] <func\\+?\[0-9\]*>:\[ \t\]*[string map [list { } "\[ \t\]+" . {\.}] $instr]\[ \t\]*\r\n.*"
++}
++
++# KFAIL strings would not exist if -Many would print the same as -Mpower7.
++# That means the power7 form should be the preferred one.
++# http://sourceware.org/ml/gdb-patches/2009-03/threads.html#00020
++
++proc func_check {offset instr {kfail ""}} {
 +    global func
 +
-+    # 0x0000000000000018 <func+24>:   stxvd2x vs43,r4,r5
-+    set patt ".*\r\n[string map {0x 0x0*} $offset] <func\\+?\[0-9\]*>:\[ \t\]*[string map [list { } "\[ \t\]+" . {\.}] $instr]\[ \t\]*\r\n.*"
 +    set test "Found $offset: $instr"
-+    if [regexp -nocase -line $patt $func] {
++    if [regexp -nocase -line [instr_to_patt $offset $instr] $func] {
 +      pass $test
++    } elseif {$kfail != "" && [regexp -nocase -line [instr_to_patt $offset $kfail] $func]} {
++      kfail gdb/NNNN $test
 +    } else {
 +      fail $test
 +    }
@@ -34147,8 +20248,8 @@ index 0000000..d9c48f9
 +func_check  0x8c "rvwinkle"
 +func_check  0x90 "prtyw   r3,r4"
 +func_check  0x94 "prtyd   r13,r14"
-+func_check  0x98 "mfcfar  r10"
-+func_check  0x9c "mtcfar  r11"
++func_check  0x98 "mfcfar  r10"           "mfspr   r10,28"
++func_check  0x9c "mtcfar  r11"           "mtspr   28,r11"
 +func_check  0xa0 "cmpb    r3,r4,r5"
 +func_check  0xa4 "lwzcix  r10,r11,r12"
 +func_check  0xa8 "dadd    f16,f17,f18"
@@ -34192,8 +20293,8 @@ index 0000000..d9c48f9
 +func_check 0x140 "ftdiv   cr7,f10,f11"
 +func_check 0x144 "ftsqrt  cr0,f10"
 +func_check 0x148 "ftsqrt  cr7,f10"
-+func_check 0x14c "dcbtt   r8,r9"
-+func_check 0x150 "dcbtstt r8,r9"
++func_check 0x14c "dcbtt   r8,r9"         "dcbt    16,r8,r9"
++func_check 0x150 "dcbtstt r8,r9"         "dcbtst  16,r8,r9"
 +func_check 0x154 "dcffix  f10,f12"
 +func_check 0x158 "dcffix. f20,f22"
 +func_check 0x15c "lbarx   r10,r11,r12"
@@ -34838,7 +20939,7 @@ index 0000000..b809c4e
 +#endif
 diff --git a/gdb/testsuite/gdb.arch/x86_64-vla-typedef.exp b/gdb/testsuite/gdb.arch/x86_64-vla-typedef.exp
 new file mode 100644
-index 0000000..534120a
+index 0000000..b05411e
 --- /dev/null
 +++ b/gdb/testsuite/gdb.arch/x86_64-vla-typedef.exp
 @@ -0,0 +1,64 @@
@@ -34896,955 +20997,57 @@ index 0000000..534120a
 +
 +gdb_test "ptype array" "type = char \\\[26\\\]" "first: ptype array"
 +
-+gdb_test "p array\[1\]" "\\$\[0-9\] = 1 '\\\\1'"
-+gdb_test "p array\[2\]" "\\$\[0-9\] = 2 '\\\\2'"
-+gdb_test "p array\[3\]" "\\$\[0-9\] = 3 '\\\\3'"
-+gdb_test "p array\[4\]" "\\$\[0-9\] = 4 '\\\\4'"
++gdb_test "p array\[1\]" "\\$\[0-9\] = 1 '\\\\001'"
++gdb_test "p array\[2\]" "\\$\[0-9\] = 2 '\\\\002'"
++gdb_test "p array\[3\]" "\\$\[0-9\] = 3 '\\\\003'"
++gdb_test "p array\[4\]" "\\$\[0-9\] = 4 '\\\\004'"
 +
 +gdb_continue_to_breakpoint "break_here"
 +
 +gdb_test "whatis array" "type = array_t" "second: whatis array"
 +
 +gdb_test "ptype array" "type = char \\\[78\\\]" "second: ptype array"
-diff --git a/gdb/testsuite/gdb.base/Makefile.in b/gdb/testsuite/gdb.base/Makefile.in
-index 9f382db..12db521 100644
---- a/gdb/testsuite/gdb.base/Makefile.in
-+++ b/gdb/testsuite/gdb.base/Makefile.in
-@@ -12,7 +12,7 @@ EXECUTABLES = all-types annota1 bitfields break \
-       scope section_command setshow setvar shmain sigall signals \
-       solib solib_sl so-impl-ld so-indr-cl \
-       step-line step-test structs structs2 \
--      twice-tmp varargs vforked-prog watchpoint whatis
-+      twice-tmp varargs vforked-prog watchpoint whatis catch-syscall
- MISCELLANEOUS = coremmap.data ../foobar.baz \
-       shr1.sl shr2.sl solib_sl.sl solib1.sl solib2.sl
-diff --git a/gdb/testsuite/gdb.base/call-rt-st.exp b/gdb/testsuite/gdb.base/call-rt-st.exp
-index 3359c70..f73dd7f 100644
---- a/gdb/testsuite/gdb.base/call-rt-st.exp
-+++ b/gdb/testsuite/gdb.base/call-rt-st.exp
-@@ -186,7 +186,7 @@ if {![gdb_skip_float_test "print print_two_floats(*f3)"] && \
- if ![gdb_skip_stdio_test "print print_bit_flags_char(*cflags)"] {
-     print_struct_call "print_bit_flags_char(*cflags)" \
--            ".*alpha\[ \r\n\]+gamma\[ \r\n\]+epsilon\[ \r\n\]+.\[0-9\]+ = \\{alpha = 1 '\\\\001', beta = 0 '\\\\0', gamma = 1 '\\\\001', delta = 0 '\\\\0', epsilon = 1 '\\\\001', omega = 0 '\\\\0'\\}"
-+            ".*alpha\[ \r\n\]+gamma\[ \r\n\]+epsilon\[ \r\n\]+.\[0-9\]+ = \\{alpha = 1 '\\\\1', beta = 0 '\\\\0', gamma = 1 '\\\\1', delta = 0 '\\\\0', epsilon = 1 '\\\\1', omega = 0 '\\\\0'\\}"
- }
- if ![gdb_skip_stdio_test "print print_bit_flags_short(*sflags)"] {
-diff --git a/gdb/testsuite/gdb.base/callfuncs.exp b/gdb/testsuite/gdb.base/callfuncs.exp
-index 6d8aa45..be6a872 100644
---- a/gdb/testsuite/gdb.base/callfuncs.exp
-+++ b/gdb/testsuite/gdb.base/callfuncs.exp
-@@ -437,7 +437,7 @@ gdb_test "print t_small_values(1,3,5,7,9,11,13,15,17,19)" \
-       "The program being debugged stopped while.*" \
-       "stop at nested call level 4"
- gdb_test "backtrace" \
--      "\#0  t_small_values \\(arg1=1 '.001', arg2=3, arg3=5, arg4=7 '.a', arg5=9, arg6=11 '.v', arg7=13, arg8=15, arg9=17, arg10=19\\).*\#2  sum10 \\(i0=2, i1=4, i2=6, i3=8, i4=10, i5=12, i6=14, i7=16, i8=18, i9=20\\).*\#3  <function called from gdb>.*\#4  add \\(a=4, b=5\\).*\#5  <function called from gdb>.*\#6  add \\(a=2, b=3\\).*\#7  <function called from gdb>.*\#8  main.*" \
-+      "\#0  t_small_values \\(arg1=1 '.1', arg2=3, arg3=5, arg4=7 '.a', arg5=9, arg6=11 '.v', arg7=13, arg8=15, arg9=17, arg10=19\\).*\#2  sum10 \\(i0=2, i1=4, i2=6, i3=8, i4=10, i5=12, i6=14, i7=16, i8=18, i9=20\\).*\#3  <function called from gdb>.*\#4  add \\(a=4, b=5\\).*\#5  <function called from gdb>.*\#6  add \\(a=2, b=3\\).*\#7  <function called from gdb>.*\#8  main.*" \
-       "backtrace at nested call level 4"
- gdb_test "finish" "Value returned is .* = 100" \
-       "Finish from nested call level 4"
-diff --git a/gdb/testsuite/gdb.base/catch-syscall.c b/gdb/testsuite/gdb.base/catch-syscall.c
-new file mode 100644
-index 0000000..64850de
---- /dev/null
-+++ b/gdb/testsuite/gdb.base/catch-syscall.c
-@@ -0,0 +1,25 @@
-+/* This file is used to test the 'catch syscall' feature on GDB.
-+ 
-+   Please, if you are going to edit this file DO NOT change the syscalls
-+   being called (nor the order of them).  If you really must do this, then
-+   take a look at catch-syscall.exp and modify there too.
-+
-+   Written by Sergio Durigan Junior <sergiodj@linux.vnet.ibm.com>
-+   September, 2008 */
-+
-+#include <unistd.h>
-+#include <fcntl.h>
-+#include <sys/stat.h>
-+
-+int
-+main (void)
-+{
-+      /* A close() with a wrong argument.  We are only
-+         interested in the syscall.  */
-+      close (-1);
-+
-+      chroot (".");
-+
-+      /* The last syscall.  Do not change this.  */
-+      _exit (0);
-+}
-diff --git a/gdb/testsuite/gdb.base/catch-syscall.exp b/gdb/testsuite/gdb.base/catch-syscall.exp
-new file mode 100644
-index 0000000..a9f6937
---- /dev/null
-+++ b/gdb/testsuite/gdb.base/catch-syscall.exp
-@@ -0,0 +1,386 @@
-+#   Copyright 1997, 1999, 2007, 2008 Free Software Foundation, Inc.
-+
-+# This program is free software; you can redistribute it and/or modify
-+# it under the terms of the GNU General Public License as published by
-+# the Free Software Foundation; either version 3 of the License, or
-+# (at your option) any later version.
-+#
-+# This program is distributed in the hope that it will be useful,
-+# but WITHOUT ANY WARRANTY; without even the implied warranty of
-+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-+# GNU General Public License for more details.
-+#
-+# You should have received a copy of the GNU General Public License
-+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
-+
-+
-+# This program tests the 'catch syscall' functionality.
-+#
-+# It was written by Sergio Durigan Junior <sergiodj@linux.vnet.ibm.com>
-+# on September/2008.
-+
-+if { [is_remote target] || ![isnative] } then {
-+    continue
-+}
-+
-+set prms_id 0
-+set bug_id 0
-+
-+global srcfile
-+set testfile "catch-syscall"
-+set srcfile ${testfile}.c
-+set binfile ${objdir}/${subdir}/${testfile}
-+
-+# All (but the last) syscalls from the example code
-+# They are ordered according to the file, so do not change this.
-+set all_syscalls { "close" "chroot" }
-+# The last syscall (exit()) does not return, so
-+# we cannot expect the catchpoint to be triggered
-+# twice.  It is a special case.
-+set last_syscall "exit_group"
-+
-+if  { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
-+     untested catch-syscall.exp
-+     return -1
-+}
-+
-+# Until "catch syscall" is implemented on other targets...
-+if {![istarget "hppa*-hp-hpux*"] && ![istarget "*-linux*"]} then {
-+    continue
-+}
-+
-+# This shall be updated whenever 'catch syscall' is implemented
-+# on some architecture.
-+#if { ![istarget "x86_64-*-linux*"] && ![istarget "i\[34567\]86-*-linux*"]
-+if { ![istarget "i\[34567\]86-*-linux*"]
-+     && ![istarget "powerpc-*-linux*"] && ![istarget "powerpc64-*-linux*"] } {
-+     continue
-+}
-+
-+# Internal procedure used to check if, before any syscall is caught,
-+# the command 'info breakpoints' correctly lists the catchpoints AND
-+# says that nothing was caught yet.
-+proc check_init_info_breakpoints {} {
-+    global gdb_prompt
-+
-+    # Verifying that the catchpoint appears in the 'info breakpoints'
-+    # command, but with "<any syscall>".
-+    set thistest "catch syscall appears in 'info breakpoints'"
-+    gdb_test "info breakpoints" ".*catchpoint.*keep y.*syscall \"<any syscall>\".*" $thistest
-+}
-+
-+# This procedure checks if, after a syscall catchpoint is hit, the
-+# command 'info breakpoints' correctly lists the syscall name.
-+proc check_info_breakpoints { syscall } {
-+    global gdb_prompt
-+
-+    set thistest "syscall $syscall appears in 'info breakpoints'"
-+    gdb_test "info breakpoints" ".*catchpoint.*keep y.*syscall (.)?${syscall}(.)?.*" $thistest
-+}
-+
-+# This procedure checks if there was a call to a syscall.
-+proc check_call_to_syscall { syscall } {
-+    global gdb_prompt
-+
-+    set thistest "program has called $syscall"
-+    gdb_test "continue" "Catchpoint .*(call to syscall .?${syscall}.?).*" $thistest
-+
-+    # Checking if the syscall is reported to be caught in
-+    # 'info breakpoints'.
-+    check_info_breakpoints "$syscall"
-+}
-+
-+# This procedure checks if the syscall returned.
-+proc check_return_from_syscall { syscall } {
-+    global gdb_prompt
-+
-+    set thistest "syscall $syscall has returned"
-+    gdb_test "continue" "Catchpoint .*(returned from syscall (.)?${syscall}(.)?).*" $thistest
-+
-+    # Checking if the syscall is reported to be caught in
-+    # 'info breakpoints'.
-+    check_info_breakpoints "$syscall"
-+}
-+
-+# Internal procedure that performs two 'continue' commands and checks if
-+# a syscall call AND return occur.
-+proc check_continue { syscall } {
-+    global gdb_prompt
-+
-+    # Testing if the 'continue' stops at the
-+    # specified syscall_name.  If it does, then it should
-+    # first print that the infeior has called the syscall,
-+    # and after print that the syscall has returned.
-+
-+    # Testing if the inferiorr has called the syscall.
-+    check_call_to_syscall $syscall
-+    # And now, that the syscall has returned.
-+    check_return_from_syscall $syscall
-+}
-+
-+# Inserts a syscall catchpoint with an argument.
-+proc insert_catch_syscall_with_arg { syscall } {
-+    global gdb_prompt
-+
-+    # Trying to set the syscall
-+    set thistest "catch syscall with arguments ($syscall)"
-+    gdb_test "catch syscall $syscall" "Catchpoint .*(syscall\[(\]s\[)\] (.)?${syscall}(.)?).*" $thistest
-+}
-+
-+proc check_for_program_end {} {
-+    global gdb_prompt
-+
-+    # Deleting the catchpoints
-+    delete_breakpoints
-+
-+    set thistest "successful program end"
-+    gdb_test "continue" "Program exited normally.*" $thistest
-+
-+}
-+
-+proc test_catch_syscall_without_args {} {
-+    global gdb_prompt all_syscalls last_syscall
-+
-+    # Trying to set the syscall
-+    set thistest "setting catch syscall without arguments"
-+    gdb_test "catch syscall" "Catchpoint .*(syscall).*" $thistest
-+
-+    check_init_info_breakpoints
-+
-+    # We have to check every syscall
-+    foreach name $all_syscalls {
-+        check_continue $name
-+    }
-+
-+    # At last but not least, we check if the inferior
-+    # has called the last (exit) syscall.
-+    check_call_to_syscall $last_syscall
-+
-+    # Now let's see if the inferior correctly finishes.
-+    check_for_program_end
-+}
-+
-+proc test_catch_syscall_with_args {} {
-+    global gdb_prompt
-+    set syscall_name "close"
-+
-+    insert_catch_syscall_with_arg $syscall_name 
-+    check_init_info_breakpoints
-+
-+    # Can we continue until we catch the syscall?
-+    check_continue $syscall_name
-+
-+    # Now let's see if the inferior correctly finishes.
-+    check_for_program_end
-+}
-+
-+proc test_catch_syscall_with_wrong_args {} {
-+    global gdb_prompt
-+    # mlock is not called from the source
-+    set syscall_name "mlock"
-+
-+    insert_catch_syscall_with_arg $syscall_name
-+    check_init_info_breakpoints
-+
-+    # Now, we must verify if the program stops with a continue.
-+    # If it doesn't, everything is right (since we don't have
-+    # a syscall named "mlock" in it).  Otherwise, this is a failure.
-+    set thistest "catch syscall with unused syscall ($syscall_name)"
-+    gdb_test "continue" "Program exited normally.*" $thistest
-+}
-+
-+proc test_catch_syscall_restarting_inferior {} {
-+    global gdb_prompt
-+    set syscall_name "chroot"
-+
-+    insert_catch_syscall_with_arg $syscall_name
-+    check_init_info_breakpoints
-+
-+    # Let's first reach the call of the syscall.
-+    check_call_to_syscall $syscall_name
-+
-+    # Now, restart the program
-+    rerun_to_main
-+
-+    # And check for call/return
-+    check_continue $syscall_name
-+
-+    # Can we finish?
-+    check_for_program_end
-+}
-+
-+proc do_syscall_tests {} {
-+    global gdb_prompt srcdir
-+
-+    # First, we need to set GDB datadir.
-+    send_gdb "maintenance set gdb_datadir $srcdir/..\n"
-+    gdb_expect 10 {
-+      -re "$gdb_prompt $" {
-+          verbose "Setting GDB datadir to $srcdir/..." 2
-+      }
-+      timeout {
-+          error "Couldn't set GDB datadir."
-+      }
-+    }
-+
-+    # Verify that the 'catch syscall' help is available
-+    set thistest "help catch syscall"
-+    gdb_test "help catch syscall" "Catch system calls.*" $thistest
-+
-+    # Try to set a catchpoint to a nonsense syscall
-+    set thistest "catch syscall to a nonsense syscall is prohibited"
-+    gdb_test "catch syscall nonsense_syscall" "Unknown syscall name .*" $thistest
-+
-+    # Testing the 'catch syscall' command without arguments.
-+    # This test should catch any syscalls.
-+    if [runto_main] then { test_catch_syscall_without_args }
-+
-+    # Testing the 'catch syscall' command with arguments.
-+    # This test should only catch the specified syscall.
-+    if [runto_main] then { test_catch_syscall_with_args }
-+
-+    # Testing the 'catch syscall' command with WRONG arguments.
-+    # This test should not trigger any catchpoints.
-+    if [runto_main] then { test_catch_syscall_with_wrong_args }
-+
-+    # Testing the 'catch' syscall command during a restart of
-+    # the inferior.
-+    if [runto_main] then { test_catch_syscall_restarting_inferior }
-+}
-+
-+proc test_catch_syscall_fail_noxml {} {
-+    global gdb_prompt
-+
-+    # Sanitizing.
-+    delete_breakpoints
-+
-+    # Testing to see if we receive a warning when calling "catch syscall"
-+    # without XML support.
-+    set thistest "Catch syscall displays a warning when there is no XML support"
-+    gdb_test "catch syscall" "warning: Could not open .*warning: Could not load the syscall XML file .*GDB will not be able to display syscall names.*Catchpoint .*(syscall).*" $thistest
-+
-+    # Since the catchpoint was set, we must check if it's present at
-+    # "info breakpoints"
-+    check_init_info_breakpoints
-+
-+    # Sanitizing.
-+    delete_breakpoints
-+}
-+
-+proc test_catch_syscall_without_args_noxml {} {
-+    # We will need the syscall names even not using it
-+    # because we need to know know many syscalls are in
-+    # the example file.
-+    global gdb_prompt all_syscalls last_syscall
-+
-+    delete_breakpoints
-+
-+    set thistest "Catch syscall without arguments and without XML support"
-+    gdb_test "catch syscall" "Catchpoint .*(syscall).*"
-+
-+    # Now, we should be able to set a catchpoint,
-+    # and GDB shall not display the warning anymore.
-+    foreach name $all_syscalls {
-+        # Unfortunately, we don't know the syscall number
-+        # that will be caught because this information is
-+        # arch-dependent.  Thus, we try to catch anything
-+        # similar to a number.
-+        check_continue "\[0-9\]*"
-+    }
-+
-+    # At last but not least, we check if the inferior
-+    # has called the last (exit) syscall.
-+    check_call_to_syscall "\[0-9\]*"
-+
-+    delete_breakpoints
-+}
-+
-+proc test_catch_syscall_with_args_noxml {} {
-+    global gdb_prompt
-+
-+    # The number of the "close" syscall.  This is our
-+    # options for a "long-estabilished" syscall in all
-+    # Linux architectures, but unfortunately x86_64 and
-+    # a few other platforms don't "follow the convention".
-+    # Because of this, we need this ugly check :-(.
-+    set close_number ""
-+    if { [istarget "x86_64-*-linux*"] } {
-+        set close_number "3"
-+    } else {
-+        set close_number "6"
-+    }
-+
-+    delete_breakpoints
-+
-+    insert_catch_syscall_with_arg $close_number
-+    check_init_info_breakpoints
-+
-+    check_continue $close_number
-+
-+    delete_breakpoints
-+}
-+
-+proc test_catch_syscall_with_wrong_args_noxml {} {
-+    global gdb_prompt
-+
-+    delete_breakpoints
-+
-+    # Even without XML support, GDB should not accept unknown
-+    # syscall names for the catchpoint.
-+    set thistest "Catch a nonsense syscall without XML support"
-+    gdb_test "catch syscall nonsense_syscall" "Unknown syscall name .nonsense_syscall.*" $thistest
-+
-+    delete_breakpoints
-+}
-+
-+proc do_syscall_tests_without_xml {} {
-+    global gdb_prompt srcdir
-+
-+    # In this case, we don't need to set GDB's datadir because
-+    # we want GDB to display only numbers, not names.  So, let's
-+    # begin with the tests.
-+
-+    # The first test is to see if GDB displays a warning when we
-+    # try to catch syscalls without the XML support.
-+    test_catch_syscall_fail_noxml
-+
-+    # Now, let's test if we can catch syscalls without XML support.
-+    # We should succeed, but GDB is not supposed to print syscall names.
-+    if [runto_main] then { test_catch_syscall_without_args_noxml }
-+
-+    # The only valid argument "catch syscall" should accept is the
-+    # syscall number, and not the name (since it can't translate a
-+    # name to a number).
-+    #
-+    # It's worth mentioning that we only try to catch the syscall
-+    # close().  This is because the syscall number is an arch-dependent
-+    # information, so we can't assume that we know every syscall number
-+    # in this system.  Therefore, we have decided to use a "long-estabilished"
-+    # system call, and close() just sounded the right choice :-).
-+    if [runto_main] then { test_catch_syscall_with_args_noxml }
-+
-+    # Now, we'll try to provide a syscall name (valid or not) to the command,
-+    # and expect it to fail.
-+    if [runto_main] then { test_catch_syscall_with_wrong_args_noxml }
-+}
-+
-+# Start with a fresh gdb
-+
-+gdb_exit
-+gdb_start
-+gdb_reinitialize_dir $srcdir/$subdir
-+gdb_load ${binfile}
-+
-+# Execute the tests, using XML support
-+do_syscall_tests
-+
-+# Restart gdb
-+
-+gdb_exit
-+gdb_start
-+gdb_reinitialize_dir $srcdir/$subdir
-+gdb_load ${binfile}
-+
-+# Execute the tests, without XML support.  In this case, GDB will
-+# only display syscall numbers, and not syscall names.
-+do_syscall_tests_without_xml
-diff --git a/gdb/testsuite/gdb.base/charset.c b/gdb/testsuite/gdb.base/charset.c
-index b640702..55a50ce 100644
---- a/gdb/testsuite/gdb.base/charset.c
-+++ b/gdb/testsuite/gdb.base/charset.c
-@@ -20,11 +20,6 @@
-    Please email any bugs, comments, and/or additions to this file to:
-    bug-gdb@gnu.org  */
--#include <stdio.h>
--#include <stdlib.h>
--#include <string.h>
--
--
- /* X_string is a null-terminated string in the X charset whose
-    elements are as follows.  X should be the name the `set charset'
-    command uses for the character set, in lower-case, with any
-@@ -54,6 +49,21 @@ char iso_8859_1_string[NUM_CHARS];
- char ebcdic_us_string[NUM_CHARS];
- char ibm1047_string[NUM_CHARS];
-+/* We make a phony wchar_t and then pretend that this platform uses
-+   UCS-4 (or UCS-2, depending on the size -- same difference for the
-+   purposes of this test).  */
-+typedef unsigned int wchar_t;
-+wchar_t ucs_4_string[NUM_CHARS];
-+
-+/* We also define a couple phony types for testing the u'' and U''
-+   support.  It is ok if these have the wrong size on some platforms
-+   -- the test case will skip the tests in that case.  */
-+typedef unsigned short char16_t;
-+typedef unsigned int char32_t;
-+
-+/* Make sure to use the typedefs.  */
-+char16_t uvar;
-+char32_t Uvar;
- void
- init_string (char string[],
-@@ -62,7 +72,10 @@ init_string (char string[],
-              char line_feed, char carriage_return, char horizontal_tab,
-              char vertical_tab, char cent, char misc_ctrl)
- {
--  memset (string, x, NUM_CHARS);
-+  int i;
-+
-+  for (i = 0; i < NUM_CHARS; ++i)
-+    string[i] = x;
-   string[0] = alert;
-   string[1] = backspace;
-   string[2] = form_feed;
-@@ -85,13 +98,21 @@ fill_run (char string[], int start, int len, int first)
- }
+diff --git a/gdb/testsuite/gdb.base/arrayidx.c b/gdb/testsuite/gdb.base/arrayidx.c
+index 98d4d35..f98a656 100644
+--- a/gdb/testsuite/gdb.base/arrayidx.c
++++ b/gdb/testsuite/gdb.base/arrayidx.c
+@@ -17,6 +17,13 @@
  
+ int array[] = {1, 2, 3, 4};
  
-+void
-+init_ucs4 ()
-+{
-+  int i;
-+
-+  for (i = 0; i < NUM_CHARS; ++i)
-+    ucs_4_string[i] = iso_8859_1_string[i] & 0xff;
-+}
++#ifdef __GNUC__
++struct
++  {
++    int a[0];
++  } unbound;
++#endif
 +
- int main ()
+ int
+ main (void)
  {
- #ifdef usestubs
-   set_debug_traps();
-   breakpoint();
- #endif
--  (void) malloc (1);
-   /* Initialize ascii_string.  */
-   init_string (ascii_string,
-                120,
-@@ -146,5 +167,7 @@ int main ()
-   /* The digits, at least, are contiguous.  */
-   fill_run (ibm1047_string, 59, 10, 240);
--  puts ("All set!");            /* all strings initialized */
-+  init_ucs4 ();
-+
-+  return 0;            /* all strings initialized */
- }
-diff --git a/gdb/testsuite/gdb.base/charset.exp b/gdb/testsuite/gdb.base/charset.exp
-index fa26521..93f66c0 100644
---- a/gdb/testsuite/gdb.base/charset.exp
-+++ b/gdb/testsuite/gdb.base/charset.exp
-@@ -47,13 +47,7 @@ proc parse_show_charset_output {testname} {
-     global gdb_prompt
+diff --git a/gdb/testsuite/gdb.base/arrayidx.exp b/gdb/testsuite/gdb.base/arrayidx.exp
+index 71ce4aa..af0e5f8 100644
+--- a/gdb/testsuite/gdb.base/arrayidx.exp
++++ b/gdb/testsuite/gdb.base/arrayidx.exp
+@@ -59,4 +59,12 @@ gdb_test "print array" \
+          "\\{\\\[0\\\] = 1, \\\[1\\\] = 2, \\\[2\\\] = 3, \\\[3\\\] = 4\\}" \
+          "Print array with array-indexes on"
  
-     gdb_expect {
--        -re "The current host and target character set is `(.*)'\\.\[\r\n\]+$gdb_prompt $" {
--            set host_charset $expect_out(1,string)
--            set target_charset $expect_out(1,string)
--          set retlist [list $host_charset $target_charset]
--            pass $testname
--        }
--        -re "The current host character set is `(.*)'\\.\[\r\n\]+The current target character set is `(.*)'\\.\[\r\n\]+$gdb_prompt $" {
-+        -re "The host character set is \"(.*)\"\\.\[\r\n\]+The target character set is \"(.*)\"\\.\[\r\n\]+The target wide character set is \"(.*)\"\\.\[\r\n\]+$gdb_prompt $" {
-             set host_charset $expect_out(1,string)
-             set target_charset $expect_out(2,string)
-           set retlist [list $host_charset $target_charset]
-@@ -81,79 +75,35 @@ proc parse_show_charset_output {testname} {
- }
--# Try the various `show charset' commands.  These are all aliases of each
--# other; `show target-charset' and `show host-charset' actually print
--# both the host and target charsets.
-+# Try the various `show charset' commands.
- send_gdb "show charset\n"
- set show_charset [parse_show_charset_output "show charset"]
- send_gdb "show target-charset\n"
--set show_target_charset [parse_show_charset_output "show target-charset"]
-+set show_target_charset \
-+  [lindex [parse_show_charset_output "show target-charset"] 0]
--if {[lsearch $show_charset $show_target_charset] >= 0} {
-+if {[lsearch -exact $show_charset $show_target_charset] >= 0} {
-     pass "check `show target-charset' against `show charset'"
- } else {
-     fail "check `show target-charset' against `show charset'"
- }
- send_gdb "show host-charset\n"
--set show_host_charset [parse_show_charset_output "show host-charset"]
-+set show_host_charset \
-+  [lindex [parse_show_charset_output "show host-charset"] 0]
--if {[lsearch $show_charset $show_host_charset] >= 0} {
-+if {[lsearch -exact $show_charset $show_host_charset] >= 0} {
-     pass "check `show host-charset' against `show charset'"
- } else {
-     fail "check `show host-charset' against `show charset'"
- }
--
--# Get the list of supported (host) charsets as possible completions.
--send_gdb "set charset \t\t"
--
--# Check that we can at least use ASCII as a host character set.
--sleep 1
--gdb_expect {
--    -re "^set charset .*\r\nASCII.*\r\n$gdb_prompt set charset " {
--      # We got the output that we wanted, including ASCII as possible
--      # charset. Send a newline to get us back to the prompt. This will
--      # also generate an error message. Let's not check here that the error
--      # message makes sense, we do that below, as a separate testcase.
--        send_gdb "\n"
--        gdb_expect {
--          -re ".*Requires an argument.*$gdb_prompt $" {
--              pass "get valid character sets"
--          }
--          -re ".*$gdb_prompt $" {
--              send_gdb "\n"
--              gdb_expect {
--                  -re ".*$gdb_prompt $" {
--                      fail "get valid character sets"
--                  }
--              }
--          }
--          timeout {
--              fail "(timeout) get valid character sets"
--          }
--      }
--    }
--    -re ".*$gdb_prompt $" {
--      # We got some output that ended with a regular prompt
--        fail "get valid character sets"
--    }
--    -re ".*$gdb_prompt set charset.*$" {
--      # We got some other output, send a cntrl-c to gdb to get us back
--        # to the prompt.
--      send_gdb "\003"
--        fail "get valid character sets"
--    }
--    timeout {
--        fail "get valid character sets (timeout)"
--    }
--}
 -
- # Try a malformed `set charset'.
-+# Also check that we can at least use ASCII as a host character set.
- gdb_test "set charset" \
--         "Requires an argument. Valid arguments are.*" \
-+         "Requires an argument. Valid arguments are.* ASCII,.*" \
-          "try malformed `set charset'"
- # Try using `set host-charset' on an invalid character set.
-@@ -244,8 +194,10 @@ gdb_expect {
-     }
- }
--# Make sure that GDB supports every host/target charset combination.
--foreach host_charset [all_charset_names] {
-+# We don't want to test all the charset names here, since that would
-+# be too many combinations.  We we pick a subset.
-+set charset_subset {ASCII ISO-8859-1 EBCDIC-US IBM1047}
-+foreach host_charset $charset_subset {
-     if {[valid_host_charset $host_charset]} {
-         set testname "try `set host-charset $host_charset'"
-@@ -279,7 +231,7 @@ foreach host_charset [all_charset_names] {
-         # Now try setting every possible target character set,
-         # given that host charset.
--        foreach target_charset [all_charset_names] {
-+        foreach target_charset $charset_subset {
-             set testname "try `set target-charset $target_charset'"
-             send_gdb "set target-charset $target_charset\n"
-             gdb_expect {
-@@ -404,23 +356,42 @@ gdb_expect {
- }
-+# We only try the wide character tests on machines where the wchar_t
-+# typedef in the test case has the right size.
-+set wchar_size [get_sizeof wchar_t 99]
-+set wchar_ok 0
-+if {$wchar_size == 2} {
-+    lappend charset_subset UCS-2
-+    set wchar_ok 1
-+} elseif {$wchar_size == 4} {
-+    lappend charset_subset UCS-4
-+    set wchar_ok 1
-+}
-+
- gdb_test "set host-charset ASCII" ""
--foreach target_charset [all_charset_names] {
--    send_gdb "set target-charset $target_charset\n" 
-+foreach target_charset $charset_subset {
-+    if {$target_charset == "UCS-4" || $target_charset == "UCS-2"} {
-+      set param target-wide-charset
-+      set L L
-+    } else {
-+      set param target-charset
-+      set L ""
++set test "p unbound.a == &unbound.a\[0\]"
++gdb_test_multiple $test $test {
++    -re " = 1\r\n$gdb_prompt $" {
++      pass $test
 +    }
-+    send_gdb "set $param $target_charset\n" 
-     gdb_expect {
-         -re "$gdb_prompt $" {
--            pass "set target-charset $target_charset"
-+            pass "set $param $target_charset"
-         }
-         timeout {
--            fail "set target-charset $target_charset (timeout)"
-+            fail "set $param $target_charset (timeout)"
-         }
-     }
-     # Try printing the null character.  There seems to be a bug in
-     # gdb_test that requires us to use gdb_expect here.
--    send_gdb "print '\\0'\n"
-+    send_gdb "print $L'\\0'\n"
-     gdb_expect {
--        -re "\\\$${decimal} = 0 '\\\\0'\[\r\n\]+$gdb_prompt $" {
-+        -re "\\\$${decimal} = 0 $L'\\\\0'\[\r\n\]+$gdb_prompt $" {
-             pass "print the null character in ${target_charset}"
-         }
-         -re "$gdb_prompt $" {
-@@ -435,8 +406,14 @@ foreach target_charset [all_charset_names] {
-     # a string in $target_charset.  The variable's name is the
-     # character set's name, in lower-case, with all non-identifier
-     # characters replaced with '_', with "_string" stuck on the end.
--    set var_name [string tolower "${target_charset}_string"]
--    regsub -all -- "\[^a-z0-9_\]" $var_name "_" var_name
-+    if {$target_charset == "UCS-2"} {
-+      # We still use the ucs_4_string variable -- but the size is
-+      # correct for UCS-2.
-+      set var_name ucs_4_string
-+    } else {
-+      set var_name [string tolower "${target_charset}_string"]
-+      regsub -all -- "\[^a-z0-9_\]" $var_name "_" var_name
-+    }
-     
-     # Compute a regexp matching the results we expect.  This is static,
-     # but it's easier than writing it out.
-@@ -444,12 +421,12 @@ foreach target_charset [all_charset_names] {
-     set uppercase "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
-     set lowercase "abcdefghijklmnopqrstuvwxyz"
-     set digits "0123456789"
--    set octal_escape "\\\\\[0-9\]\[0-9\]\[0-9\]"
-+    set octal_escape "\\\\\[0-9\]+"
-     send_gdb "print $var_name\n"
-     # ${escapes}${uppercase}${lowercase}${digits}${octal}${octal}
-     gdb_expect {
--        -re ".* = \"(\\\\a|x)(\\\\b|x)(\\\\f|x)(\\\\n|x)(\\\\r|x)(\\\\t|x)(\\\\v|x)${uppercase}${lowercase}${digits}(\\\\\[0-9\]\[0-9\]\[0-9\]|x)(\\\\\[0-9\]\[0-9\]\[0-9\]|x).*\"\[\r\n\]+$gdb_prompt $" {
-+        -re ".* = $L\"(\\\\a|x)(\\\\b|x)(\\\\f|x)(\\\\n|x)(\\\\r|x)(\\\\t|x)(\\\\v|x)${uppercase}${lowercase}${digits}(${octal_escape}|x)+\"\[\r\n\]+$gdb_prompt $" {
-             pass "print string in $target_charset"
-         }
-         -re "$gdb_prompt $" {
-@@ -461,22 +438,22 @@ foreach target_charset [all_charset_names] {
-     }
-     # Try entering a character literal, and see if it comes back unchanged.
--    gdb_test "print 'A'" \
--             " = \[0-9-\]+ 'A'" \
-+    gdb_test "print $L'A'" \
-+             " = \[0-9-\]+ $L'A'" \
-              "parse character literal in ${target_charset}"
-     # Check that the character literal was encoded correctly.
--    gdb_test "print 'A' == $var_name\[7\]" \
-+    gdb_test "print $L'A' == $var_name\[7\]" \
-              " = 1" \
-              "check value of parsed character literal in ${target_charset}"
-     # Try entering a string literal, and see if it comes back unchanged.
--    gdb_test "print \"abcdefABCDEF012345\"" \
--             " = \"abcdefABCDEF012345\"" \
-+    gdb_test "print $L\"abcdefABCDEF012345\"" \
-+             " = $L\"abcdefABCDEF012345\"" \
-              "parse string literal in ${target_charset}"
-     # Check that the string literal was encoded correctly.
--    gdb_test "print \"q\"\[0\] == $var_name\[49\]" \
-+    gdb_test "print $L\"q\"\[0\] == $var_name\[49\]" \
-              " = 1" \
-              "check value of parsed string literal in ${target_charset}"
-@@ -509,7 +486,7 @@ foreach target_charset [all_charset_names] {
-         send_gdb "print $var_name\[$i\]\n"
-         set have_escape 1
-         gdb_expect {
--            -re "= \[0-9-\]+ '\\\\${escape}'\[\r\n\]+$gdb_prompt $" {
-+            -re "= \[0-9-\]+ $L'\\\\${escape}'\[\r\n\]+$gdb_prompt $" {
-                 pass "try printing '\\${escape}' in ${target_charset}"
-             }
-             -re "= \[0-9-\]+ 'x'\[\r\n\]+$gdb_prompt $" {
-@@ -527,12 +504,12 @@ foreach target_charset [all_charset_names] {
-         if {$have_escape} {
-             # Try parsing a backslash escape in a character literal.
--            gdb_test "print '\\${escape}' == $var_name\[$i\]" \
-+            gdb_test "print $L'\\${escape}' == $var_name\[$i\]" \
-                      " = 1" \
-                      "check value of '\\${escape}' in ${target_charset}"
-             # Try parsing a backslash escape in a string literal.
--            gdb_test "print \"\\${escape}\"\[0\] == $var_name\[$i\]" \
-+            gdb_test "print $L\"\\${escape}\"\[0\] == $var_name\[$i\]" \
-                      " = 1" \
-                      "check value of \"\\${escape}\" in ${target_charset}"
-         }
-@@ -540,10 +517,73 @@ foreach target_charset [all_charset_names] {
-     # Try printing a character escape that doesn't exist.  We should 
-     # get the unescaped character, in the target character set.
--    gdb_test "print '\\q'" " = \[0-9-\]+ 'q'" \
-+    gdb_test "print $L'\\q'" " = \[0-9-\]+ $L'q'" \
-              "print escape that doesn't exist in $target_charset"
--    gdb_test "print '\\q' == $var_name\[49\]" " = 1" \
-+    gdb_test "print $L'\\q' == $var_name\[49\]" " = 1" \
-              "check value of escape that doesn't exist in $target_charset"
- }
-+# Reset the target charset.
-+gdb_test "set target-charset UTF-8" ""
-+
-+# \242 is not a valid UTF-8 character.
-+gdb_test "print \"\\242\"" " = \"\\\\242\"" \
-+  "non-representable target character"
-+
-+gdb_test "print '\\x'" "\\\\x escape without a following hex digit."
-+gdb_test "print '\\u'" "\\\\u escape without a following hex digit."
-+gdb_test "print '\\9'" " = \[0-9\]+ '9'"
-+
-+# Tests for wide- or unicode- strings.  L is the prefix letter to use,
-+# either "L" (for wide strings), "u" (for UCS-2), or "U" (for UCS-4).
-+# NAME is used in the test names and should be related to the prefix
-+# letter in some easy-to-undestand way.
-+proc test_wide_or_unicode {L name} {
-+    gdb_test "print $L\"ab\" $L\"c\"" " = $L\"abc\"" \
-+      "basic $name string concatenation"
-+    gdb_test "print $L\"ab\" \"c\"" " = $L\"abc\"" \
-+      "narrow and $name string concatenation"
-+    gdb_test "print \"ab\" $L\"c\"" " = $L\"abc\"" \
-+      "$name and narrow string concatenation"
-+    gdb_test "print $L\"\\xe\" $L\"c\"" " = $L\"\\\\16c\"" \
-+      "$name string concatenation with escape"
-+    gdb_test "print $L\"\" \"abcdef\" \"g\"" \
-+      "$L\"abcdefg\"" \
-+      "concatenate three strings with empty $name string"
-+
-+    gdb_test "print $L'a'" "= \[0-9\]+ $L'a'" \
-+      "basic $name character"
-+}
-+
-+if {$wchar_ok} {
-+    test_wide_or_unicode L wide
-+}
-+
-+set ucs2_ok [expr {[get_sizeof char16_t 99] == 2}]
-+if {$ucs2_ok} {
-+    test_wide_or_unicode u UCS-2
-+}
-+
-+set ucs4_ok [expr {[get_sizeof char32_t 99] == 4}]
-+if {$ucs4_ok} {
-+    test_wide_or_unicode U UCS-4
-+}
-+
-+# Test an invalid string combination.
-+proc test_combination {L1 name1 L2 name2} {
-+    gdb_test "print $L1\"abc\" $L2\"def\"" \
-+      "Undefined string concatenation." \
-+      "undefined concatenation of $name1 and $name2"
-+}
-+
-+if {$wchar_ok && $ucs2_ok} {
-+    test_combination L wide u UCS-2
-+}
-+if {$wchar_ok && $ucs4_ok} {
-+    test_combination L wide U UCS-4
-+}
-+if {$ucs2_ok && $ucs4_ok} {
-+    test_combination u UCS-2 U UCS-4
-+}
-+
- gdb_exit 
-diff --git a/gdb/testsuite/gdb.base/constvars.exp b/gdb/testsuite/gdb.base/constvars.exp
-index d53a826..6d1bd12 100644
---- a/gdb/testsuite/gdb.base/constvars.exp
-+++ b/gdb/testsuite/gdb.base/constvars.exp
-@@ -161,7 +161,7 @@ proc do_constvar_tests {} {
-     gdb_test "print laconic" " = 65 'A'"
-     local_compiler_xfail_check
-     gdb_test "ptype laconic" "type = const char"
--    gdb_test "print laggard" " = 1 '.001'"
-+    gdb_test "print laggard" " = 1 '.1'"
-     local_compiler_xfail_check
-     gdb_test "ptype laggard" "type = const unsigned char"
-     gdb_test "print lagoon" " = 2"
-@@ -209,7 +209,7 @@ proc do_constvar_tests {} {
-     gdb_test "print *lewd" " = 65 'A'"
-     local_compiler_xfail_check
-     gdb_test "ptype lewd" "type = const char \\* const"
--    gdb_test "print *lexicographer" " = 1 '.001'"
-+    gdb_test "print *lexicographer" " = 1 '.1'"
-     local_compiler_xfail_check
-     gdb_test "ptype lexicographer" "type = const unsigned char \\* const"
-     gdb_test "print *lexicon" " = 2"
-@@ -233,7 +233,7 @@ proc do_constvar_tests {} {
-     gdb_test "print *languish" " = 65 'A'"
-     local_compiler_xfail_check
-     gdb_test "ptype languish" "type = const char \\*"
--    gdb_test "print *languor" " = 1 '.001'"
-+    gdb_test "print *languor" " = 1 '.1'"
-     local_compiler_xfail_check
-     gdb_test "ptype languor" "type = const unsigned char \\*"
-     gdb_test "print *lank" " = 2"
-diff --git a/gdb/testsuite/gdb.base/display.exp b/gdb/testsuite/gdb.base/display.exp
-index d62e8bf..aa65373 100644
---- a/gdb/testsuite/gdb.base/display.exp
-+++ b/gdb/testsuite/gdb.base/display.exp
-@@ -180,8 +180,12 @@ gdb_test "printf \"%p\\n\", 1" "0x1"
- # play with "print", too
- #
--gdb_test "print/r j" ".*Undefined output format.*"
--gdb_test "print j"   ".*" "debug test output"
-+gdb_test "print/z j" ".*Undefined output format.*"
-+gdb_test "print/d j" " = 0\[\\r\\n\]+"   "debug test output 1"
-+gdb_test "print/r j" " = 0\[\\r\\n\]+"   "debug test output 1a"
-+gdb_test "print/x j" " = 0x0\[\\r\\n\]+" "debug test output 2"
-+gdb_test "print/r j" " = 0x0\[\\r\\n\]+" "debug test output 2a"
-+gdb_test "print j"   " = 0\[\\r\\n\]+"   "debug test output 3"
- # x/0 j doesn't produce any output and terminates PA64 process when testing
- if [istarget "hppa2.0w-hp-hpux11*"] {
++    -re "No symbol \"unbound\" in current context.\r\n$gdb_prompt $" {
++      unsupported "$test (no GCC)"
++    }
++}
 diff --git a/gdb/testsuite/gdb.base/help.exp b/gdb/testsuite/gdb.base/help.exp
-index 4618a2c..40830c3 100644
+index d76cc36..496ff18 100644
 --- a/gdb/testsuite/gdb.base/help.exp
 +++ b/gdb/testsuite/gdb.base/help.exp
-@@ -603,7 +603,7 @@ gdb_test "help stepi" "Step one instruction exactly\.\[\r\n\]+Argument N means d
+@@ -606,7 +606,7 @@ gdb_test "help stepi" "Step one instruction exactly\.\[\r\n\]+Argument N means d
  gdb_test "help signal" "Continue program giving it signal.*" "help signal"
  # test help source
  # vxgdb reads .vxgdbinit
@@ -36005,68 +21208,11 @@ index 0000000..0c75b84
 +      fail $test
 +    }
 +}
-diff --git a/gdb/testsuite/gdb.base/long_long.exp b/gdb/testsuite/gdb.base/long_long.exp
-index d0ad5ba..5189324 100644
---- a/gdb/testsuite/gdb.base/long_long.exp
-+++ b/gdb/testsuite/gdb.base/long_long.exp
-@@ -210,7 +210,7 @@ gdb_test_char "p/o *(char *)c" "01"
- gdb_test_char "p/t *(char *)c" "1"
- gdb_test_char "p/a *(char *)c" "0x1( <.*>)?"
- gdb_test_char "p/f *(char *)c" "1"
--gdb_test_char "p/c *(char *)c" "1 '.001'"
-+gdb_test_char "p/c *(char *)c" "1 '.1'"
- gdb_test_short "p/x *(short *)s" "" "0x123" ""
- gdb_test_short "p/d *(short *)s" "" "291" ""
-@@ -257,7 +257,7 @@ gdb_test "x/u w" "19088743"
- gdb_test "x/o w" "0110642547"
- gdb_test "x/t w" "00000001001000110100010101100111"
- gdb_test_xptr "x/a" { b "" } { h "" } { w "0x1234567" } { g "0x123456789abcdef" }
--gdb_test "x/c b" "1 '.001'"
-+gdb_test "x/c b" "1 '.1'"
- if { $sizeof_double == 8 || $sizeof_long_double == 8 } {
-     gdb_test "x/f &val.oct" "-5.9822653797615723e-120"
- } else {
-@@ -273,7 +273,7 @@ gdb_test "x/2u g" "81985529216486895.*12046818088235383159"
- gdb_test "x/2o g" "04432126361152746757.*01234567123456701234567"
- gdb_test "x/2t g" "0000000100100011010001010110011110001001101010111100110111101111.*1010011100101110111001010011100101110111000001010011100101110111"
- gdb_test_xptr "x/2a" { b "" } { h "" } { w "0x1234567.*0xa72ee539" } { g "0x123456789abcdef.*0xa72ee53977053977" }
--gdb_test "x/2c b" "1 '.001'.*-89 '.'"
-+gdb_test "x/2c b" "1 '.1'.*-89 '.\[0-9\]*'"
- if { $sizeof_double == 8 || $sizeof_long_double == 8 } {
-     gdb_test "x/2f &val.oct" "-5.9822653797615723e-120.*-5.9041889495880968e-100"
- } else {
-@@ -288,7 +288,7 @@ gdb_test "x/2bu b" "1.*167"
- gdb_test "x/2bo b" "01.*0247"
- gdb_test "x/2bt b" "00000001.*10100111"
- gdb_test_ptr "x/2ba b" "" "" "0x1.*0xffffffa7" "0x1.*0xffffffffffffffa7"
--gdb_test "x/2bc b" "1 '.001'.*-89 '.'"
-+gdb_test "x/2bc b" "1 '.1'.*-89 '.\[0-9\]*'"
- gdb_test "x/2bf b" "1.*-89"
- gdb_test "x/2hx h" "0x0123.*0xa72e"
-@@ -315,7 +315,7 @@ gdb_test "x/2gu g" "81985529216486895.*12046818088235383159"
- gdb_test "x/2go g" "04432126361152746757.*01234567123456701234567"
- gdb_test "x/2gt g" "0000000100100011010001010110011110001001101010111100110111101111.*1010011100101110111001010011100101110111000001010011100101110111"
- gdb_test_ptr "x/2ga g" "" "" "0x89abcdef.*0x77053977" "0x123456789abcdef.*0xa72ee53977053977"
--gdb_test "x/2gc g" "-17 '.'.*119 'w'"
-+gdb_test "x/2gc g" "-17 '.\[0-9\]*'.*119 'w'"
- gdb_test "x/2gf g" "3.5127005640885037e-303.*-5.9822653797615723e-120"
- gdb_exit
 diff --git a/gdb/testsuite/gdb.base/macscp.exp b/gdb/testsuite/gdb.base/macscp.exp
-index 7086e90..dd196d7 100644
+index 55c4d31..df25d3c 100644
 --- a/gdb/testsuite/gdb.base/macscp.exp
 +++ b/gdb/testsuite/gdb.base/macscp.exp
-@@ -26,13 +26,21 @@ set testfile "macscp"
- set objfile ${objdir}/${subdir}/${testfile}.o
- set binfile ${objdir}/${subdir}/${testfile}
--set options { debug }
-+set options { debug additional_flags=-DFROM_COMMANDLINE=ARG}
- get_compiler_info ${binfile}
- if [test_compiler_info gcc*] {
+@@ -33,6 +33,14 @@ if [test_compiler_info gcc*] {
      lappend options additional_flags=-g3
  }
  
@@ -36074,470 +21220,31 @@ index 7086e90..dd196d7 100644
 +if {[find_gcc] == "gcc" && [file executable "/usr/bin/gcc"]} {
 +    set result [catch "exec which gcc" output]
 +    if {$result == 0 && [string first "/ccache/" $output] >= -1} {
-+      lappend options "compiler=/usr/bin/gcc"
++       lappend options "compiler=/usr/bin/gcc"
 +    }
 +}
 +
  # Generate the intermediate object file.  This is required by Darwin to
  # have access to the .debug_macinfo section.
  if  {[gdb_compile "${srcdir}/${subdir}/macscp1.c" "${objfile}" \
-@@ -79,11 +87,15 @@ proc info_macro {macro} {
-     if {$debug_me} {exp_internal 1}
-     gdb_expect {
--        -re "Defined at \[^\r\n\]*(${filepat}):${decimal}\[\r\n\]" {
-+        -re "Defined at \[^\r\n\]*(${filepat}):(${decimal})\[\r\n\]" {
-             # `location' and `definition' should be empty when we see
-             # this message.
-             if {[llength $location] == 0 && [llength $definition] == 0} {
-                 set location $expect_out(1,string)
-+              # Definitions from gcc command-line get suffixed by the lineno.
-+              if {$expect_out(2,string) == "0" } {
-+                  set location "$location:$expect_out(2,string)"
-+              }
-                 exp_continue
-             } else {
-                 # Exit this expect loop, with a result indicating failure.
-@@ -198,6 +210,8 @@ proc list_and_check_macro {func macro expected} {
- }
-+list_and_check_macro main FROM_COMMANDLINE "macscp1.c:0 ARG"
-+
- if {[list_and_check_macro main WHERE {macscp1.c {before macscp1_3}}]} {
-     return 0
- }
-diff --git a/gdb/testsuite/gdb.base/multi-forks.exp b/gdb/testsuite/gdb.base/multi-forks.exp
-index ac56fb0..f853180 100644
---- a/gdb/testsuite/gdb.base/multi-forks.exp
-+++ b/gdb/testsuite/gdb.base/multi-forks.exp
-@@ -51,7 +51,62 @@ global gdb_prompt
- # This is a test of gdb's ability to follow the parent, child or both
- # parent and child of multiple Unix fork() system calls.
--#
-+
-+set exit_bp_loc [gdb_get_line_number "Set exit breakpoint here."]
-+
-+# Insert a breakpoint at the location provided by the exit_bp_loc global
-+# and resume the execution until hitting that breakpoint.  We also make
-+# sure to consume all the expected output from all processes as well,
-+# to make sure it doesn't cause trouble during a subsequent test.
-+
-+proc continue_to_exit_bp_loc {} {
-+    global exit_bp_loc decimal gdb_prompt
-+
-+    gdb_breakpoint $exit_bp_loc
-+
-+    send_gdb "continue\n"
-+
-+    # The output from the child processes can be interleaved arbitrarily
-+    # with the output from GDB and the parent process.  If we don't
-+    # consume it all now, it can confuse later interactions.
-+    set seen_done 0
-+    set seen_break 0
-+    set seen_prompt 0
-+    set seen_timeout 0
-+    while { ($seen_done < 16 || ! $seen_prompt) && ! $seen_timeout } {
-+      # We don't know what order the interesting things will arrive in.
-+      # Using a pattern of the form 'x|y|z' instead of -re x ... -re y
-+      # ... -re z ensures that expect always chooses the match that
-+      # occurs leftmost in the input, and not the pattern appearing
-+      # first in the script that occurs anywhere in the input, so that
-+      # we don't skip anything.
-+      gdb_expect {
-+          -re "($decimal done)|(Breakpoint)|($gdb_prompt)" {
-+              if {[info exists expect_out(1,string)]} {
-+                  incr seen_done
-+              } elseif {[info exists expect_out(2,string)]} {
-+                  set seen_break 1
-+              } elseif {[info exists expect_out(3,string)]} {
-+                  set seen_prompt 1
-+              }
-+              array unset expect_out
-+          }
-+          timeout { set seen_timeout 1 }
-+      }
-+    }
-+
-+    if { $seen_timeout } {
-+      fail "run to exit 2 (timeout)"
-+    } elseif { ! $seen_prompt } {
-+      fail "run to exit 2 (no prompt)"
-+    } elseif { ! $seen_break } {
-+      fail "run to exit 2 (no breakpoint hit)"
-+    } elseif { $seen_done != 16 } {
-+      fail "run to exit 2 (missing done messages)"
-+    } else {
-+      pass "run to exit 2"
-+    }
-+}
- # The inferior program builds a tree of processes by executing a loop
- # four times, calling fork at each iteration.  Thus, at each
-@@ -66,69 +121,17 @@ global gdb_prompt
- # The result should be that each of the 4 forks returns zero.
- runto_main
--set exit_bp_loc [gdb_get_line_number "Set exit breakpoint here."]
--gdb_test "break $exit_bp_loc" "Breakpoint.* at .*" "Break at exit"
--gdb_test "set follow child" "" ""
--
--send_gdb "continue\n"
--gdb_expect {
--    -re ".*Break.* main .*$gdb_prompt.*$" {}
--    -re ".*$gdb_prompt $" {fail "run to exit 1"}
--    default {fail "run to exit 1 (timeout)"}
--}
-+gdb_test "set follow child"
-+continue_to_exit_bp_loc
- gdb_test "print pids" "\\$.* = \\{0, 0, 0, 0\\}.*" "follow child, print pids"
- # Now set gdb to follow the parent.
- # Result should be that none of the 4 forks returns zero.
--delete_breakpoints
- runto_main
--gdb_test "break $exit_bp_loc" "Breakpoint.* at .*" "Break at exit"
- gdb_test "set follow parent" "" ""
--
--send_gdb "continue\n"
--
--# The output from the child processes can be interleaved arbitrarily
--# with the output from GDB and the parent process.  If we don't
--# consume it all now, it can confuse later interactions.
--set seen_done 0
--set seen_break 0
--set seen_prompt 0
--set seen_timeout 0
--while { ($seen_done < 16 || ! $seen_prompt) && ! $seen_timeout } {
--    # We don't know what order the interesting things will arrive in.
--    # Using a pattern of the form 'x|y|z' instead of -re x ... -re y
--    # ... -re z ensures that expect always chooses the match that
--    # occurs leftmost in the input, and not the pattern appearing
--    # first in the script that occurs anywhere in the input, so that
--    # we don't skip anything.
--    gdb_expect {
--        -re "($decimal done)|(Breakpoint)|($gdb_prompt)" {
--            if {[info exists expect_out(1,string)]} {
--                incr seen_done
--            } elseif {[info exists expect_out(2,string)]} {
--                set seen_break 1
--            } elseif {[info exists expect_out(3,string)]} {
--                set seen_prompt 1
--            }
--            array unset expect_out
--        }
--        timeout { set seen_timeout 1 }
--    }
--}
--
--if { $seen_timeout } {
--    fail "run to exit 2 (timeout)"
--} elseif { ! $seen_prompt } {
--    fail "run to exit 2 (no prompt)"
--} elseif { ! $seen_break } {
--    fail "run to exit 2 (no breakpoint hit)"
--} elseif { $seen_done != 16 } {
--    fail "run to exit 2 (missing done messages)"
--} else {
--    pass "run to exit 2"
--}
-+continue_to_exit_bp_loc
- gdb_test "print pids\[0\]==0 || pids\[1\]==0 || pids\[2\]==0 || pids\[3\]==0" \
-     " = 0" "follow parent, print pids"
-@@ -138,7 +141,7 @@ gdb_test "print pids\[0\]==0 || pids\[1\]==0 || pids\[2\]==0 || pids\[3\]==0" \
- #
- runto_main
--gdb_test "break $exit_bp_loc" "Breakpoint.* at .*" ""
-+gdb_breakpoint $exit_bp_loc
- gdb_test "help set detach-on-fork" "whether gdb will detach the child.*" \
-     "help set detach"
-diff --git a/gdb/testsuite/gdb.base/pointers.exp b/gdb/testsuite/gdb.base/pointers.exp
-index 91838a2..2d0a70e 100644
---- a/gdb/testsuite/gdb.base/pointers.exp
-+++ b/gdb/testsuite/gdb.base/pointers.exp
-@@ -389,7 +389,7 @@ gdb_expect {
- send_gdb "print *pUC\n"
- gdb_expect {
--    -re ".\[0-9\]* = 21 \'.025\'.*$gdb_prompt $" {
-+    -re ".\[0-9\]* = 21 \'.25\'.*$gdb_prompt $" {
-         pass "print value of *pUC"
-       }
-     -re ".*$gdb_prompt $" { fail "print value of *pUC" }
-diff --git a/gdb/testsuite/gdb.base/printcmds.exp b/gdb/testsuite/gdb.base/printcmds.exp
-index 1e17da4..b6f8a1f 100644
---- a/gdb/testsuite/gdb.base/printcmds.exp
-+++ b/gdb/testsuite/gdb.base/printcmds.exp
-@@ -137,12 +137,12 @@ proc test_print_all_chars {} {
-     global gdb_prompt
-     gdb_test "p ctable1\[0\]"   " = 0 '\\\\0'"
--    gdb_test "p ctable1\[1\]"   " = 1 '\\\\001'"
--    gdb_test "p ctable1\[2\]"   " = 2 '\\\\002'"
--    gdb_test "p ctable1\[3\]"   " = 3 '\\\\003'"
--    gdb_test "p ctable1\[4\]"   " = 4 '\\\\004'"
--    gdb_test "p ctable1\[5\]"   " = 5 '\\\\005'"
--    gdb_test "p ctable1\[6\]"   " = 6 '\\\\006'"
-+    gdb_test "p ctable1\[1\]"   " = 1 '\\\\1'"
-+    gdb_test "p ctable1\[2\]"   " = 2 '\\\\2'"
-+    gdb_test "p ctable1\[3\]"   " = 3 '\\\\3'"
-+    gdb_test "p ctable1\[4\]"   " = 4 '\\\\4'"
-+    gdb_test "p ctable1\[5\]"   " = 5 '\\\\5'"
-+    gdb_test "p ctable1\[6\]"   " = 6 '\\\\6'"
-     gdb_test "p ctable1\[7\]"   " = 7 '\\\\a'"
-     gdb_test "p ctable1\[8\]"   " = 8 '\\\\b'"
-     gdb_test "p ctable1\[9\]"   " = 9 '\\\\t'"
-@@ -150,24 +150,24 @@ proc test_print_all_chars {} {
-     gdb_test "p ctable1\[11\]"  " = 11 '\\\\v'"
-     gdb_test "p ctable1\[12\]"  " = 12 '\\\\f'"
-     gdb_test "p ctable1\[13\]"  " = 13 '\\\\r'"
--    gdb_test "p ctable1\[14\]"  " = 14 '\\\\016'"
--    gdb_test "p ctable1\[15\]"  " = 15 '\\\\017'"
--    gdb_test "p ctable1\[16\]"  " = 16 '\\\\020'"
--    gdb_test "p ctable1\[17\]"  " = 17 '\\\\021'"
--    gdb_test "p ctable1\[18\]"  " = 18 '\\\\022'"
--    gdb_test "p ctable1\[19\]"  " = 19 '\\\\023'"
--    gdb_test "p ctable1\[20\]"  " = 20 '\\\\024'"
--    gdb_test "p ctable1\[21\]"  " = 21 '\\\\025'"
--    gdb_test "p ctable1\[22\]"  " = 22 '\\\\026'"
--    gdb_test "p ctable1\[23\]"  " = 23 '\\\\027'"
--    gdb_test "p ctable1\[24\]"  " = 24 '\\\\030'"
--    gdb_test "p ctable1\[25\]"  " = 25 '\\\\031'"
--    gdb_test "p ctable1\[26\]"  " = 26 '\\\\032'"
--    gdb_test "p ctable1\[27\]"  " = 27 '\\\\033'"
--    gdb_test "p ctable1\[28\]"  " = 28 '\\\\034'"
--    gdb_test "p ctable1\[29\]"  " = 29 '\\\\035'"
--    gdb_test "p ctable1\[30\]"  " = 30 '\\\\036'"
--    gdb_test "p ctable1\[31\]"  " = 31 '\\\\037'"
-+    gdb_test "p ctable1\[14\]"  " = 14 '\\\\16'"
-+    gdb_test "p ctable1\[15\]"  " = 15 '\\\\17'"
-+    gdb_test "p ctable1\[16\]"  " = 16 '\\\\20'"
-+    gdb_test "p ctable1\[17\]"  " = 17 '\\\\21'"
-+    gdb_test "p ctable1\[18\]"  " = 18 '\\\\22'"
-+    gdb_test "p ctable1\[19\]"  " = 19 '\\\\23'"
-+    gdb_test "p ctable1\[20\]"  " = 20 '\\\\24'"
-+    gdb_test "p ctable1\[21\]"  " = 21 '\\\\25'"
-+    gdb_test "p ctable1\[22\]"  " = 22 '\\\\26'"
-+    gdb_test "p ctable1\[23\]"  " = 23 '\\\\27'"
-+    gdb_test "p ctable1\[24\]"  " = 24 '\\\\30'"
-+    gdb_test "p ctable1\[25\]"  " = 25 '\\\\31'"
-+    gdb_test "p ctable1\[26\]"  " = 26 '\\\\32'"
-+    gdb_test "p ctable1\[27\]"  " = 27 '\\\\33'"
-+    gdb_test "p ctable1\[28\]"  " = 28 '\\\\34'"
-+    gdb_test "p ctable1\[29\]"  " = 29 '\\\\35'"
-+    gdb_test "p ctable1\[30\]"  " = 30 '\\\\36'"
-+    gdb_test "p ctable1\[31\]"  " = 31 '\\\\37'"
-     gdb_test "p ctable1\[32\]"  " = 32 ' '"
-     gdb_test "p ctable1\[33\]"  " = 33 '!'"
-     gdb_test "p ctable1\[34\]"  " = 34 '\"'"
-@@ -475,13 +475,13 @@ proc test_print_strings {} {
-     gdb_test "p &ctable1\[0\]" \
-       " = \\(unsigned char \\*\\) \"\""
-     gdb_test "p &ctable1\[1\]" \
--      " = \\(unsigned char \\*\\) \"\\\\001\\\\002\\\\003\\\\004\\\\005\\\\006\\\\a\\\\b\"..."
-+      " = \\(unsigned char \\*\\) \"\\\\1\\\\2\\\\3\\\\4\\\\5\\\\6\\\\a\\\\b\"..."
-     gdb_test "p &ctable1\[1*8\]" \
--      " = \\(unsigned char \\*\\) \"\\\\b\\\\t\\\\n\\\\v\\\\f\\\\r\\\\016\\\\017\"..."
-+      " = \\(unsigned char \\*\\) \"\\\\b\\\\t\\\\n\\\\v\\\\f\\\\r\\\\16\\\\17\"..."
-     gdb_test "p &ctable1\[2*8\]" \
--      " = \\(unsigned char \\*\\) \"\\\\020\\\\021\\\\022\\\\023\\\\024\\\\025\\\\026\\\\027\"..."
-+      " = \\(unsigned char \\*\\) \"\\\\20\\\\21\\\\22\\\\23\\\\24\\\\25\\\\26\\\\27\"..."
-     gdb_test "p &ctable1\[3*8\]" \
--      " = \\(unsigned char \\*\\) \"\\\\030\\\\031\\\\032\\\\033\\\\034\\\\035\\\\036\\\\037\"..."
-+      " = \\(unsigned char \\*\\) \"\\\\30\\\\31\\\\32\\\\33\\\\34\\\\35\\\\36\\\\37\"..."
-     gdb_test "p &ctable1\[4*8\]" \
-       " = \\(unsigned char \\*\\) \" !\\\\\"#\\\$%&'\"..."
-     gdb_test "p &ctable1\[5*8\]" \
-@@ -622,7 +622,7 @@ proc test_print_string_constants {} {
-     set timeout 60;
-     gdb_test "p \"a string\""         " = \"a string\""
--    gdb_test "p \"embedded \\000 null\"" " = \"embedded \\\\000 null\""
-+    gdb_test "p \"embedded \\000 null\"" " = \"embedded \\\\0 null\""
-     gdb_test "p \"abcd\"\[2\]"        " = 99 'c'"
-     gdb_test "p sizeof (\"abcdef\")"  " = 7"
-     gdb_test "ptype \"foo\""          " = char \\\[4\\\]"
-diff --git a/gdb/testsuite/gdb.base/return-nodebug.c b/gdb/testsuite/gdb.base/return-nodebug.c
-new file mode 100644
-index 0000000..e1211b3
---- /dev/null
-+++ b/gdb/testsuite/gdb.base/return-nodebug.c
-@@ -0,0 +1,49 @@
-+/* This testcase is part of GDB, the GNU debugger.
-+
-+   Copyright 2009 Free Software Foundation, Inc.
-+
-+   This program is free software; you can redistribute it and/or modify
-+   it under the terms of the GNU General Public License as published by
-+   the Free Software Foundation; either version 3 of the License, or
-+   (at your option) any later version.
-+
-+   This program is distributed in the hope that it will be useful,
-+   but WITHOUT ANY WARRANTY; without even the implied warranty of
-+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-+   GNU General Public License for more details.
-+
-+   You should have received a copy of the GNU General Public License
-+   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
-+
-+#include <stdio.h>
-+
-+static TYPE
-+init (void)
-+{
-+  return 0;
-+}
-+
-+static TYPE
-+func (void)
-+{
-+  return 31;
-+}
-+
-+static void
-+marker (void)
-+{
-+}
-+
-+int
-+main (void)
-+{
-+  /* Preinitialize registers to 0 to avoid false PASS by leftover garbage.  */
-+  init ();
-+
-+  printf ("result=" FORMAT "\n", CAST func ());
-+
-+  /* Cannot `next' with no debug info.  */
-+  marker ();
-+
-+  return 0;
-+}
-diff --git a/gdb/testsuite/gdb.base/return-nodebug.exp b/gdb/testsuite/gdb.base/return-nodebug.exp
-new file mode 100644
-index 0000000..7d43776
---- /dev/null
-+++ b/gdb/testsuite/gdb.base/return-nodebug.exp
-@@ -0,0 +1,61 @@
-+# Copyright (C) 2009 Free Software Foundation, Inc.
-+
-+# This program is free software; you can redistribute it and/or modify
-+# it under the terms of the GNU General Public License as published by
-+# the Free Software Foundation; either version 3 of the License, or
-+# (at your option) any later version.
-+#
-+# This program is distributed in the hope that it will be useful,
-+# but WITHOUT ANY WARRANTY; without even the implied warranty of
-+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-+# GNU General Public License for more details.
-+#
-+# You should have received a copy of the GNU General Public License
-+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
-+
-+proc do_test {type} {
-+    set typenospace [string map {{ } -} $type]
-+
-+    global pf_prefix
-+    set old_prefix $pf_prefix
-+    lappend pf_prefix "$typenospace:"
-+
-+    if {[runto "func"]} {
-+      # Verify that we do not crash when using "return" from a function with
-+      # no debugging info.  Such function has no `struct symbol'.  It may
-+      # still have an associated `struct minimal_symbol'.
-+
-+      gdb_test "return -1" \
-+               "Return value type not available for selected stack frame\\.\r\nPlease use an explicit cast of the value to return\\." \
-+               "return from function with no debug info without a cast"
-+
-+      # Cast of the result to the proper width must be done explicitely.
-+      gdb_test "return ($type) -1" "#0 .* main \\(.*"                 \
-+               "return from function with no debug info with a cast"  \
-+               "Make selected stack frame return now\\? \\(y or n\\) " "y"
-+
-+      # And if it returned the full width of the result.
-+      gdb_test "adv marker" "\r\nresult=-1\r\n.* in marker \\(.*" \
-+               "full width of the returned result"
-+    }
-+
-+    set pf_prefix $old_prefix
-+}
-+
-+foreach case {{{signed char} %d (int)}        \
-+            {{short}       %d (int)}  \
-+            {{int}         %d}        \
-+            {{long}        %ld}       \
-+            {{long long}   %lld}}     {
-+    set type [lindex $case 0]
-+    set format [lindex $case 1]
-+    set cast [lindex $case 2]
-+
-+    set typeesc [string map {{ } {\ }} $type]
-+    set typenospace [string map {{ } -} $type]
-+
-+    if {[prepare_for_testing return-nodebug.exp "return-nodebug-$typenospace" "return-nodebug.c" \
-+       [list "additional_flags=-DFORMAT=\"$format\" -DTYPE=$typeesc -DCAST=$cast"]] == 0} {
-+      do_test $type
-+    }
-+}
-diff --git a/gdb/testsuite/gdb.base/setvar.exp b/gdb/testsuite/gdb.base/setvar.exp
-index 2350a33..3be8424 100644
---- a/gdb/testsuite/gdb.base/setvar.exp
-+++ b/gdb/testsuite/gdb.base/setvar.exp
-@@ -121,7 +121,7 @@ proc test_set { args } {
- #    
- test_set "set variable v_char=0" "print v_char" ".\[0-9\]* = 0 \'.0\'"        "set variable char=0" 
--test_set "set variable v_char=1" "print v_char" ".\[0-9\]* = 1 \'.001\'"        "set variable char=1" 
-+test_set "set variable v_char=1" "print v_char" ".\[0-9\]* = 1 \'.1\'"        "set variable char=1" 
- test_set "set variable v_char=7" "print v_char" ".\[0-9\]* = 7 \'.a\'"        "set variable char=7 (Bel)" 
- test_set "set variable v_char=32" "print v_char" ".\[0-9\]* = 32 \' \'"        "set variable char=32 (SPC)" 
- test_set "set variable v_char=65" "print v_char" ".\[0-9\]* = 65 \'A\'"        "set variable char=65 ('A')" 
-@@ -132,7 +132,7 @@ test_set "set variable v_char=127" "print v_char" ".\[0-9\]* = 127 \'.177\'"
- # test "set variable" for type "signed char"
- #    
- test_set "set variable v_char=0" "print v_signed_char" ".\[0-9\]* = 0 \'.0\'"                 "set variable signed char=0" 
--test_set "set variable v_signed_char=1" "print v_signed_char" ".\[0-9\]* = 1 \'.001\'"        "set variable signed char=1" 
-+test_set "set variable v_signed_char=1" "print v_signed_char" ".\[0-9\]* = 1 \'.1\'"        "set variable signed char=1" 
- test_set "set variable v_signed_char=7" "print v_signed_char" ".\[0-9\]* = 7 \'.a\'"        "set variable signed char=7 (Bel)" 
- test_set "set variable v_signed_char=32" "print v_signed_char" ".\[0-9\]* = 32 \' \'"        "set variable signed char=32 (SPC)" 
- test_set "set variable v_signed_char=65" "print v_signed_char" ".\[0-9\]* = 65 \'A\'"        "set variable signed char=65 ('A')" 
-@@ -151,7 +151,7 @@ gdb_test "print v_signed_char" ".\[0-9\]* = -1 \'.377\'" \
- # test "set variable" for type "unsigned char"
- #
- test_set "set variable v_unsigned_char=0" "print v_unsigned_char" ".\[0-9\]* = 0 \'.0\'"        "set variable unsigned char=0" 
--test_set "set variable v_unsigned_char=1" "print v_unsigned_char" ".\[0-9\]* = 1 \'.001\'"        "set variable unsigned char=1" 
-+test_set "set variable v_unsigned_char=1" "print v_unsigned_char" ".\[0-9\]* = 1 \'.1\'"        "set variable unsigned char=1" 
- test_set "set variable v_unsigned_char=7" "print v_unsigned_char" ".\[0-9\]* = 7 \'.a\'"        "set variable unsigned char=7 (Bel)" 
- test_set "set variable v_unsigned_char=32" "print v_unsigned_char" ".\[0-9\]* = 32 \' \'"        "set variable unsigned char=32 (SPC)" 
- test_set "set variable v_unsigned_char=65" "print v_unsigned_char" ".\[0-9\]* = 65 \'A\'"        "set variable unsigned char=65 ('A')" 
-diff --git a/gdb/testsuite/gdb.base/store.exp b/gdb/testsuite/gdb.base/store.exp
-index 963bb19..feab6bd 100644
---- a/gdb/testsuite/gdb.base/store.exp
-+++ b/gdb/testsuite/gdb.base/store.exp
-@@ -74,7 +74,7 @@ proc check_set { t l r new add } {
-       "${prefix}; print incremented l, expecting ${add}"
- }
--check_set "charest" "-1 .*" "-2 .*" "4 ..004." "2 ..002."
-+check_set "charest" "-1 .*" "-2 .*" "4 ..4." "2 ..2."
- check_set "short" "-1" "-2" "4" "2"
- check_set "int" "-1" "-2" "4" "2"
- check_set "long" "-1" "-2" "4" "2"
-@@ -102,7 +102,7 @@ proc up_set { t l r new } {
-       "${prefix}; print new l, expecting ${new}"
- }
--up_set "charest" "-1 .*" "-2 .*" "4 ..004."
-+up_set "charest" "-1 .*" "-2 .*" "4 ..4."
- up_set "short" "-1" "-2" "4"
- up_set "int" "-1" "-2" "4"
- up_set "long" "-1" "-2" "4"
+diff --git a/gdb/testsuite/gdb.base/radix.exp b/gdb/testsuite/gdb.base/radix.exp
+index 750fd23..dfdb929 100644
+--- a/gdb/testsuite/gdb.base/radix.exp
++++ b/gdb/testsuite/gdb.base/radix.exp
+@@ -162,13 +162,6 @@ gdb_test "set radix" \
+     "Input and output radices now set to decimal 10, hex a, octal 12\." \
+     "Reset radices"
+-gdb_test "set input-radix 0" \
+-    "Nonsense input radix ``decimal 0''; input radix unchanged\\." \
+-    "Reject input-radix 0"
+-gdb_test "show input-radix" \
+-    "Default input radix for entering numbers is 10\\." \
+-    "Input radix unchanged after rejecting 0"
+-
+ gdb_test "set input-radix 1" \
+     "Nonsense input radix ``decimal 1''; input radix unchanged\\." \
+     "Reject input-radix 1"
 diff --git a/gdb/testsuite/gdb.base/valgrind-attach.c b/gdb/testsuite/gdb.base/valgrind-attach.c
 new file mode 100644
 index 0000000..84b57db
@@ -36977,118 +21684,152 @@ index 0000000..5da7378
 +gdb_test "p temp1" " = '1' <repeats 78 times>" "second: print temp1"
 +gdb_test "p temp2" " = '2' <repeats 78 times>" "second: print temp2"
 +gdb_test "p temp3" " = '3' <repeats 48 times>" "second: print temp3"
-diff --git a/gdb/testsuite/gdb.cp/Makefile.in b/gdb/testsuite/gdb.cp/Makefile.in
-index 1787ad5..391bfc2 100644
---- a/gdb/testsuite/gdb.cp/Makefile.in
-+++ b/gdb/testsuite/gdb.cp/Makefile.in
-@@ -4,7 +4,7 @@ srcdir = @srcdir@
- EXECUTABLES = ambiguous annota2 anon-union cplusfuncs cttiadd \
-       derivation inherit local member-ptr method misc \
-         overload ovldbreak ref-typ ref-typ2 templates userdef virtfunc namespace \
--      ref-types ref-params method2 pr9594
-+      ref-types ref-params method2 pr9594 gdb2495 
- all info install-info dvi install uninstall installcheck check:
-       @echo "Nothing to be done for $@..."
-diff --git a/gdb/testsuite/gdb.cp/abstract-origin.cc b/gdb/testsuite/gdb.cp/abstract-origin.cc
-new file mode 100644
-index 0000000..e2de3fb
---- /dev/null
-+++ b/gdb/testsuite/gdb.cp/abstract-origin.cc
-@@ -0,0 +1,42 @@
-+/* This testcase is part of GDB, the GNU debugger.
-+
-+   Copyright 2008 Free Software Foundation, Inc.
-+
-+   This program is free software; you can redistribute it and/or modify
-+   it under the terms of the GNU General Public License as published by
-+   the Free Software Foundation; either version 3 of the License, or
-+   (at your option) any later version.
-+
-+   This program is distributed in the hope that it will be useful,
-+   but WITHOUT ANY WARRANTY; without even the implied warranty of
-+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-+   GNU General Public License for more details.
-+
-+   You should have received a copy of the GNU General Public License
-+   along with this program.  If not, see <http://www.gnu.org/licenses/>.
-+   */
-+
-+extern void f (int *);
-+
-+class A
-+{
-+public:
-+  A(int i);
-+};
+diff --git a/gdb/testsuite/gdb.base/watchpoint-hw.c b/gdb/testsuite/gdb.base/watchpoint-hw.c
+index 8da9af5..e2de53a 100644
+--- a/gdb/testsuite/gdb.base/watchpoint-hw.c
++++ b/gdb/testsuite/gdb.base/watchpoint-hw.c
+@@ -20,5 +20,11 @@ int watchee;
+ int
+ main (void)
+ {
++  volatile int dummy;
 +
-+A::A(int i)
-+{
-+  static int *problem = new int(i);
-+  f (problem);                                /* break-here */
-+}
++  dummy = watchee;
++  dummy = 1;
++  dummy = 2;  /* break-at-exit */
 +
-+void f (int *)
-+{
-+}
+   return 0;
+ }
+diff --git a/gdb/testsuite/gdb.base/watchpoint-hw.exp b/gdb/testsuite/gdb.base/watchpoint-hw.exp
+index a2bb731..d74d6c7 100644
+--- a/gdb/testsuite/gdb.base/watchpoint-hw.exp
++++ b/gdb/testsuite/gdb.base/watchpoint-hw.exp
+@@ -21,19 +21,12 @@ if {(![istarget "i?86-*-*"] && ![istarget "x86_64-*-*"]
+     return
+ }
+-set testfile watchpoint-hw
+-set srcfile ${testfile}.c
+-set binfile ${objdir}/${subdir}/${testfile}
+-if  { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
+-    untested "Couldn't compile test program"
++set test watchpoint-hw
++set srcfile ${test}.c
++if { [prepare_for_testing ${test}.exp ${test} ${srcfile}] } {
+     return -1
+ }
+-gdb_exit
+-gdb_start
+-gdb_reinitialize_dir $srcdir/$subdir
+-gdb_load ${binfile}
+-
+ # Create the watchpoint before the inferior gets started.  Now the native CPU
+ # target is still not active and its `to_can_use_hw_breakpoint' is not
+ # installed, therefore only a software watchpoint gets created.
+@@ -43,10 +36,40 @@ gdb_test "watch watchee" "atchpoint 1: watchee"
+ # `runto_main' or `runto main' would delete the watchpoint created above.
+ if { [gdb_start_cmd] < 0 } {
+-    untested start
++    untested ${test}.exp
+     return -1
+ }
+ gdb_test "" "main .* at .*" "start"
+ # Check it is really a `hw'-watchpoint.
+ gdb_test "info watchpoints" "1 *hw watchpoint .* watchee"
 +
-+int
-+main (void)
-+{
-+  A a(42);
-+  return 0;
-+}
-diff --git a/gdb/testsuite/gdb.cp/abstract-origin.exp b/gdb/testsuite/gdb.cp/abstract-origin.exp
-new file mode 100644
-index 0000000..92cc23c
---- /dev/null
-+++ b/gdb/testsuite/gdb.cp/abstract-origin.exp
-@@ -0,0 +1,40 @@
-+# Copyright 2008 Free Software Foundation, Inc.
++# Before the inferior gets started we would get:
++#     Target does not support this type of hardware watchpoint.
++gdb_test "delete 1"
++gdb_test "rwatch watchee"
 +
-+# This program is free software; you can redistribute it and/or modify
-+# it under the terms of the GNU General Public License as published by
-+# the Free Software Foundation; either version 3 of the License, or
-+# (at your option) any later version.
-+#
-+# This program is distributed in the hope that it will be useful,
-+# but WITHOUT ANY WARRANTY; without even the implied warranty of
-+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-+# GNU General Public License for more details.
-+#
-+# You should have received a copy of the GNU General Public License
-+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
++set breakline [gdb_get_line_number "break-at-exit"]
++gdb_breakpoint $breakline
 +
-+set testfile abstract-origin
-+set srcfile ${testfile}.cc
-+set binfile ${objdir}/${subdir}/${testfile}
-+if  { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug c++}] != "" } {
-+    untested "Couldn't compile test program"
-+    return -1
-+}
++gdb_test "continue" "Continuing.\r\nHardware read watchpoint 3: watchee\r\n\r\nValue = 0\r\n.*"
 +
-+# Get things started.
++# Here should be no repeated notification of the read watchpoint.
++gdb_test "continue" \
++       "Continuing\\.\[ \r\n\]+Breakpoint \[0-9\]+, .*break-at-exit.*" \
++       "continue to break-at-exit after rwatch"
 +
-+gdb_exit
-+gdb_start
-+gdb_reinitialize_dir $srcdir/$subdir
-+gdb_load ${binfile}
++clean_restart ${test}
 +
 +if ![runto_main] {
-+    untested abstract-origin
++    untested ${test}.exp
 +    return -1
 +}
 +
-+gdb_breakpoint [gdb_get_line_number "break-here"]
-+gdb_continue_to_breakpoint "break-here"
++gdb_test "hbreak ${srcfile}:${breakline}" \
++       "Hardware assisted breakpoint 2 at 0x\[0-9a-f\]+: file .*${srcfile}, line ${breakline}\\." \
++       "hbreak"
 +
-+# The Bug was: No symbol "problem" in current context.
-+gdb_test "p problem" " = \\(int \\*\\) 0x.*"
++gdb_test "continue" \
++       "Continuing\\.\[ \r\n\]+Breakpoint \[0-9\]+, .*break-at-exit.*" \
++       "continue to break-at-exit after hbreak"
+diff --git a/gdb/testsuite/gdb.cp/Makefile.in b/gdb/testsuite/gdb.cp/Makefile.in
+index 0a087c7..b4880f2 100644
+--- a/gdb/testsuite/gdb.cp/Makefile.in
++++ b/gdb/testsuite/gdb.cp/Makefile.in
+@@ -4,7 +4,7 @@ srcdir = @srcdir@
+ EXECUTABLES = ambiguous annota2 anon-union cplusfuncs cttiadd \
+       derivation inherit local member-ptr method misc \
+         overload ovldbreak ref-typ ref-typ2 templates userdef virtfunc namespace \
+-      ref-types ref-params method2 pr9594 gdb2495
++      ref-types ref-params method2 pr9594 gdb2495 gdb9593
+ all info install-info dvi install uninstall installcheck check:
+       @echo "Nothing to be done for $@..."
+diff --git a/gdb/testsuite/gdb.cp/cp-relocate.exp b/gdb/testsuite/gdb.cp/cp-relocate.exp
+index 4095ccf..03c07d5 100644
+--- a/gdb/testsuite/gdb.cp/cp-relocate.exp
++++ b/gdb/testsuite/gdb.cp/cp-relocate.exp
+@@ -30,7 +30,7 @@ proc get_func_address { func } {
+     global gdb_prompt hex
+     set rfunc [string_to_regexp $func]
+-    gdb_test_multiple "print '${func}'" "get address of ${func}" {
++    gdb_test_multiple "print ${func}" "get address of ${func}" {
+       -re "\\\$\[0-9\]+ = \\{.*\\} (0|($hex) <${rfunc}>)\[\r\n\]+${gdb_prompt} $" {
+           # $1 = {int ()} 0x24 <function_bar>
+           # But if the function is at zero, the name may be omitted.
+@@ -130,7 +130,7 @@ gdb_test "add-symbol-file ${binfile} 0 -s ${func1_sec} 0x10000 -s ${func2_sec} 0
+       "y"
+ # Make sure the function addresses were updated.
+-gdb_test "break *'$func1_name'" \
++gdb_test "break *$func1_name" \
+     "Breakpoint $decimal at 0x1....: file .*"
+-gdb_test "break *'$func2_name'" \
++gdb_test "break *$func2_name" \
+     "Breakpoint $decimal at 0x2....: file .*"
 diff --git a/gdb/testsuite/gdb.cp/cplusfuncs.cc b/gdb/testsuite/gdb.cp/cplusfuncs.cc
-index 7f033d6..1a50a32 100644
+index 7f033d6..11dba06 100644
 --- a/gdb/testsuite/gdb.cp/cplusfuncs.cc
 +++ b/gdb/testsuite/gdb.cp/cplusfuncs.cc
-@@ -191,6 +191,12 @@ char *    dm_type_char_star (char * p)            { return p; }
+@@ -46,7 +46,9 @@ public:
+   void  operator []     (foo&);
+   void  operator ()     (foo&);
+   void* operator new    (size_t) throw ();
++  void* operator new[]  (size_t) throw ();
+   void  operator delete (void *);
++  void  operator delete[] (void *);
+   /**/  operator int    ();
+   /**/  operator char*  ();
+@@ -115,7 +117,9 @@ void  foo::operator ->*    (foo& afoo) { afoo.ifoo = 0; }
+ void  foo::operator []     (foo& afoo) { afoo.ifoo = 0; }
+ void  foo::operator ()     (foo& afoo) { afoo.ifoo = 0; }
+ void* foo::operator new    (size_t ival) throw () { ival = 0; return 0; }
++void* foo::operator new[]    (size_t ival) throw () { ival = 0; return 0; }
+ void  foo::operator delete (void *ptr) { ptr = 0; }
++void  foo::operator delete[] (void *ptr) { ptr = 0; }
+ /**/  foo::operator int    () { return 0; }
+ /**/  foo::operator char*  () { return 0; }
+@@ -191,6 +195,12 @@ char *    dm_type_char_star (char * p)            { return p; }
  int   dm_type_foo_ref (foo & foo)             { return foo.ifoo; }
  int * dm_type_int_star (int * p)              { return p; }
  long *        dm_type_long_star (long * p)            { return p; }
@@ -37102,11 +21843,15 @@ index 7f033d6..1a50a32 100644
 +typedef int myint;
 +int   dm_type_typedef (myint i)               { return i; }
 diff --git a/gdb/testsuite/gdb.cp/cplusfuncs.exp b/gdb/testsuite/gdb.cp/cplusfuncs.exp
-index 5e08768..8c8e038 100644
+index 5e08768..2ec50ca 100644
 --- a/gdb/testsuite/gdb.cp/cplusfuncs.exp
 +++ b/gdb/testsuite/gdb.cp/cplusfuncs.exp
-@@ -66,9 +66,25 @@ set dm_type_unsigned_int    "unsigned"
- set dm_type_void              ""
+@@ -63,12 +63,28 @@ set dm_type_foo_ref                "foo&"
+ set dm_type_int_star          "int*"
+ set dm_type_long_star         "long*"
+ set dm_type_unsigned_int      "unsigned"
+-set dm_type_void              ""
++set dm_type_void              "void"
  set dm_type_void_star         "void*"
  
 +# Some other vagaries of GDB's type printing machinery.  The integer types
@@ -37131,7 +21876,7 @@ index 5e08768..8c8e038 100644
      global dm_type_char_star
      global dm_type_char_star_quoted
      global dm_type_foo_ref
-@@ -77,6 +93,11 @@ proc probe_demangler { } {
+@@ -77,8 +93,13 @@ proc probe_demangler { } {
      global dm_type_unsigned_int
      global dm_type_void
      global dm_type_void_star
@@ -37141,13 +21886,16 @@ index 5e08768..8c8e038 100644
 +    global dm_type_unsigned_long
 +    global dm_type_typedef
  
-     send_gdb "print &'foo::operator,(foo&)'\n"
+-    send_gdb "print &'foo::operator,(foo&)'\n"
++    send_gdb "print &foo::operator,(foo&)\n"
      gdb_expect {
+       -re ".*foo::operator, \\(.*foo.*&.*\\).*\r\n$gdb_prompt $" {
+           # v2 demangler
 @@ -97,6 +118,26 @@ proc probe_demangler { } {
        }
      }
  
-+    send_gdb "print &'foo::operator char*()'\n"
++    send_gdb "print &foo::operator char*($dm_type_void)\n"
 +    gdb_expect {
 +      -re ".*foo::operator char \\*\\(void\\).*\r\n$gdb_prompt $" {
 +          # v2 demangler or GDB type printer
@@ -37284,7 +22032,50 @@ index 5e08768..8c8e038 100644
  }
  
  #
-@@ -345,8 +486,9 @@ proc print_addr { name } {
+@@ -241,6 +382,7 @@ proc info_func_regexp { name demangled } {
+     global gdb_prompt
+     send_gdb "info function $name\n"
++    set demangled [regsub {\\\(void\\\)} $demangled {\(\)}]
+     gdb_expect {
+       -re ".*File .*:\r\n(class |)$demangled\r\n.*$gdb_prompt $" {
+           pass "info function for \"$name\""
+@@ -277,16 +419,16 @@ proc print_addr_2 { name good } {
+     set good_pattern [string_to_regexp $good]
+-    send_gdb "print &'$name'\n"
++    send_gdb "print &$name\n"
+     gdb_expect {
+       -re ".* = .* $hex <$good_pattern>\r\n$gdb_prompt $" {
+-          pass "print &'$name'"
++          pass "print &$name"
+       }
+       -re ".*$gdb_prompt $" {
+-          fail "print &'$name'"
++          fail "print &$name"
+       }
+       timeout {
+-          fail "print &'$name' (timeout)"
++          fail "print &$name (timeout)"
+       }
+     }
+ }
+@@ -327,7 +469,12 @@ proc print_addr_2_kfail { name good bad bugid } {
+ #
+ proc print_addr { name } {
+-    print_addr_2 "$name" "$name"
++    set expected [regsub {\(void\)} $name {()}]
++    if {[string first "::" $name] == -1} {
++      # C function -- must be qutoed
++      set name "'$name'"
++    }
++    print_addr_2 "$name" $expected
+ }
+ #
+@@ -345,8 +492,9 @@ proc print_addr { name } {
  
  proc test_lookup_operator_functions {} {
      global dm_operator_comma
@@ -37295,7 +22086,7 @@ index 5e08768..8c8e038 100644
      global dm_type_foo_ref
      global dm_type_void
      global dm_type_void_star
-@@ -404,8 +546,8 @@ proc test_lookup_operator_functions {} {
+@@ -404,8 +552,8 @@ proc test_lookup_operator_functions {} {
  
      info_func "operator int(" "int foo::operator int($dm_type_void);"
      info_func "operator()("   "void foo::operator()($dm_type_foo_ref);"
@@ -37306,7 +22097,7 @@ index 5e08768..8c8e038 100644
  
  }
  
-@@ -420,6 +562,7 @@ proc test_paddr_operator_functions {} {
+@@ -420,6 +568,7 @@ proc test_paddr_operator_functions {} {
      global dm_type_unsigned_int
      global dm_type_void
      global dm_type_void_star
@@ -37314,7 +22105,21 @@ index 5e08768..8c8e038 100644
  
      print_addr "foo::operator*($dm_type_foo_ref)"
      print_addr "foo::operator%($dm_type_foo_ref)"
-@@ -470,7 +613,7 @@ proc test_paddr_operator_functions {} {
+@@ -460,17 +609,20 @@ proc test_paddr_operator_functions {} {
+     print_addr "foo::operator\[\]($dm_type_foo_ref)"
+     print_addr "foo::operator()($dm_type_foo_ref)"
+-    gdb_test "print &'foo::operator new'" \
++    gdb_test "print &foo::operator new" \
+       " = .* $hex <foo::operator new\\(.*\\)(| static)>"
++    gdb_test "print &foo::operator new\[\]" \
++      " = .* $hex <foo::operator new\\\[\\\]\\(.*\\)(| static)>"    
+     if { !$hp_aCC_compiler } {
+       print_addr "foo::operator delete($dm_type_void_star)"
++      print_addr "foo::operator delete[]($dm_type_void_star)"
+     } else {
+       gdb_test "print &'foo::operator delete($dm_type_void_star) static'" \
+           " = .*(0x\[0-9a-f\]+|) <foo::operator delete.*>"
      }
  
      print_addr "foo::operator int($dm_type_void)"
@@ -37323,7 +22128,7 @@ index 5e08768..8c8e038 100644
  }
  
  #
-@@ -480,17 +623,21 @@ proc test_paddr_operator_functions {} {
+@@ -480,17 +632,21 @@ proc test_paddr_operator_functions {} {
  proc test_paddr_overloaded_functions {} {
      global dm_type_unsigned_int
      global dm_type_void
@@ -37349,7 +22154,7 @@ index 5e08768..8c8e038 100644
      print_addr "overload1arg(float)"
      print_addr "overload1arg(double)"
  
-@@ -513,17 +660,31 @@ proc test_paddr_hairy_functions {} {
+@@ -513,17 +669,31 @@ proc test_paddr_hairy_functions {} {
      global dm_type_char_star
      global dm_type_int_star
      global dm_type_long_star
@@ -37390,17 +22195,47 @@ index 5e08768..8c8e038 100644
  }
  
  proc do_tests {} {
-diff --git a/gdb/testsuite/gdb.cp/expand-sals.cc b/gdb/testsuite/gdb.cp/expand-sals.cc
+@@ -534,6 +704,7 @@ proc do_tests {} {
+     global srcdir
+     global binfile
+     global gdb_prompt
++    global dm_type_int_star
+     set prms_id 0
+     set bug_id 0
+@@ -557,6 +728,10 @@ proc do_tests {} {
+     test_paddr_operator_functions
+     test_paddr_hairy_functions
+     test_lookup_operator_functions
++
++    # A regression test on errors involving operators
++    gdb_test "list foo::operator $dm_type_int_star" \
++      ".*the class foo does not have any method named operator $dm_type_int_star.*"
+ }
+ do_tests
+diff --git a/gdb/testsuite/gdb.cp/expand-sals.exp b/gdb/testsuite/gdb.cp/expand-sals.exp
+index 3c302c3..cd0496d 100644
+--- a/gdb/testsuite/gdb.cp/expand-sals.exp
++++ b/gdb/testsuite/gdb.cp/expand-sals.exp
+@@ -48,7 +48,7 @@ gdb_continue_to_breakpoint "caller" ".*caller-line.*"
+ # Test GDB caught this return call and not the next one through B::B()
+ gdb_test "bt" \
+-       "#0 \[^\r\n\]* A \[^\r\n\]*\r\n#1 \[^\r\n\]* main \[^\r\n\]*" \
++       "#0 \[^\r\n\]* (A::)?A \[^\r\n\]*\r\n#1 \[^\r\n\]* main \[^\r\n\]*" \
+        "bt from A"
+ gdb_continue_to_breakpoint "next caller func" ".*func-line.*"
+diff --git a/gdb/testsuite/gdb.cp/gdb9593.cc b/gdb/testsuite/gdb.cp/gdb9593.cc
 new file mode 100644
-index 0000000..6169a05
+index 0000000..783c962
 --- /dev/null
-+++ b/gdb/testsuite/gdb.cp/expand-sals.cc
-@@ -0,0 +1,53 @@
++++ b/gdb/testsuite/gdb.cp/gdb9593.cc
+@@ -0,0 +1,180 @@
 +/* This testcase is part of GDB, the GNU debugger.
 +
-+   Copyright (C) 2009 Free Software Foundation, Inc.
-+
-+   This file is part of GDB.
++   Copyright 2008, 2009 Free Software Foundation, Inc.
 +
 +   This program is free software; you can redistribute it and/or modify
 +   it under the terms of the GNU General Public License as published by
@@ -37413,271 +22248,178 @@ index 0000000..6169a05
 +   GNU General Public License for more details.
 +
 +   You should have received a copy of the GNU General Public License
-+   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
-+
-+int
-+func ()
-+{
-+  return 42;  /* func-line */
-+}
++   along with this program.  If not, see <http://www.gnu.org/licenses/>.
++   */
++#include <iostream>
 +
-+volatile int global_x;
++using namespace std;
 +
-+class A
++class NextOverThrowDerivates
 +{
++
 +public:
-+  A ()
-+    {
-+      global_x = func ();     /* caller-line */
-+    }
-+};
 +
-+/* class B is here just to make the `func' calling line above having multiple
-+   instances - multiple locations.  Template cannot be used as its instances
-+   would have different function names which get discarded by GDB
-+   expand_line_sal_maybe.  */
 +
-+class B : public A
-+{
-+};
++  // Single throw an exception in this function.
++  void function1() 
++  {
++    throw 20;
++  }
 +
-+int
-+main (void)
-+{
-+  A a;
-+  B b;
++  // Throw an exception in another function.
++  void function2() 
++  {
++    function1();
++  }
 +
-+  return 0;   /* exit-line */
-+}
-diff --git a/gdb/testsuite/gdb.cp/expand-sals.exp b/gdb/testsuite/gdb.cp/expand-sals.exp
-new file mode 100644
-index 0000000..6e04cbf
---- /dev/null
-+++ b/gdb/testsuite/gdb.cp/expand-sals.exp
-@@ -0,0 +1,100 @@
-+# Copyright 2009 Free Software Foundation, Inc.
++  // Throw an exception in another function, but handle it
++  // locally.
++  void function3 () 
++  {
++    {
++      try
++      {
++        function1 ();
++      }
++      catch (...) 
++      {
++        cout << "Caught and handled function1 exception" << endl;
++      }
++    }
++  }
 +
-+# This program is free software; you can redistribute it and/or modify
-+# it under the terms of the GNU General Public License as published by
-+# the Free Software Foundation; either version 3 of the License, or
-+# (at your option) any later version.
-+#
-+# This program is distributed in the hope that it will be useful,
-+# but WITHOUT ANY WARRANTY; without even the implied warranty of
-+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-+# GNU General Public License for more details.
-+#
-+# You should have received a copy of the GNU General Public License
-+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
-+
-+if { [skip_cplus_tests] } { continue }
-+
-+set srcfile expand-sals.cc
-+if { [prepare_for_testing expand-sals.exp expand-sals $srcfile {debug c++}] } {
-+    return -1
-+}
-+if ![runto_main] {
-+    return -1
-+}
++  void rethrow ()
++  {
++    try
++      {
++      function1 ();
++      }
++    catch (...)
++      {
++      throw;
++      }
++  }
 +
-+gdb_breakpoint [gdb_get_line_number "exit-line"]
++  void finish ()
++  {
++    // We use this to test that a "finish" here does not end up in
++    // this frame, but in the one above.
++    try
++      {
++      function1 ();
++      }
++    catch (int x)
++      {
++      }
++    function1 ();             // marker for until
++  }
 +
-+gdb_breakpoint [gdb_get_line_number "func-line"]
-+gdb_continue_to_breakpoint "func" ".*func-line.*"
++  void until ()
++  {
++    function1 ();
++    function1 ();             // until here
++  }
 +
-+gdb_test "up" "caller-line.*"
++};
++NextOverThrowDerivates next_cases;
 +
-+# PC should not be at the boundary of source lines to make the original bug
-+# exploitable.
 +
-+set test "p/x \$pc"
-+set pc {}
-+gdb_test_multiple $test $test {
-+    -re "\\$\[0-9\]+ = (0x\[0-9a-f\]+)\r\n$gdb_prompt $" {
-+      set pc $expect_out(1,string)
-+      pass $test
++int main () 
++{ 
++  try
++    {
++      next_cases.function1 ();
 +    }
-+}
-+
-+set test "info line"
-+set end {}
-+gdb_test_multiple $test $test {
-+    -re "Line \[0-9\]+ of .* starts at address 0x\[0-9a-f\]+.* and ends at (0x\[0-9a-f\]+).*\\.\r\n$gdb_prompt $" {
-+      set end $expect_out(1,string)
-+      pass $test
++  catch (...)
++    {
++      // Discard
 +    }
-+}
 +
-+set test "caller line has trailing code"
-+if {$pc != $end} {
-+    pass $test
-+} else {
-+    fail $test
-+}
-+
-+# Original problem was an internal error here.  Still sanity multiple locations
-+# were found at this code place as otherwise this test would not test anything.
-+set test "break"
-+gdb_test_multiple $test $test {
-+    -re "Breakpoint \[0-9\]+ at .*, line \[0-9\]+\\. \\(\[2-9\] locations\\)\r\n$gdb_prompt $" {
-+      pass $test
++  try
++    {
++      next_cases.function2 ();
 +    }
-+    -re "Breakpoint \[0-9\]+ at .*, line \[0-9\]+\\.\r\n$gdb_prompt $" {
-+      # It just could not be decided if GDB is OK by this testcase.
-+      setup_xfail *-*-*
-+      fail $test
-+      return 0
++  catch (...)
++    {
++      // Discard
 +    }
-+}
-+
-+gdb_continue_to_breakpoint "caller" ".*caller-line.*"
-+
-+# Test GDB caught this return call and not the next one through B::B()
-+gdb_test "bt" \
-+       "#0 \[^\r\n\]* (A::)?A \[^\r\n\]*\r\n#1 \[^\r\n\]* main \[^\r\n\]*" \
-+       "bt from A"
-+
-+gdb_continue_to_breakpoint "next caller instance" ".*caller-line.*"
-+
-+# Test that GDB caught now already A through B::B() in the other instance.
-+# As discussed in GDB expand_line_sal_maybe it would more match the original
-+# instance behavior to catch here the `func' breakpoint and catch the
-+# multiple-locations breakpoint only during the call return.  This is not the
-+# case, expecting here to catch the breakpoint before the call happens.
-+
-+gdb_test "bt" \
-+       "#0 \[^\r\n\]* (A::)?A \[^\r\n\]*\r\n#1 \[^\r\n\]* (B::)?B \[^\r\n\]*\r\n#2 \[^\r\n\]* main \[^\r\n\]*" \
-+       "bt from B before the call"
-+
-+gdb_continue_to_breakpoint "next caller func" ".*func-line.*"
-+
-+# Verify GDB really could not catch the originally intended point of the return
-+# from func.
-+
-+gdb_continue_to_breakpoint "uncaught return" ".*exit-line.*"
-diff --git a/gdb/testsuite/gdb.cp/gdb1355.exp b/gdb/testsuite/gdb.cp/gdb1355.exp
-index 77687a6..66d16cf 100644
---- a/gdb/testsuite/gdb.cp/gdb1355.exp
-+++ b/gdb/testsuite/gdb.cp/gdb1355.exp
-@@ -68,11 +68,11 @@ set s_tail  ".*"
- set f_i     "${ws}int m_int;"
- set f_c     "${ws}char m_char;"
--set f_li    "${ws}long int m_long_int;"
-+set f_li    "${ws}long m_long_int;"
- set f_ui    "${ws}unsigned int m_unsigned_int;"
--set f_lui   "${ws}long unsigned int m_long_unsigned_int;"
--set f_si    "${ws}short int m_short_int;"
--set f_sui   "${ws}short unsigned int m_short_unsigned_int;"
-+set f_lui   "${ws}unsigned long m_long_unsigned_int;"
-+set f_si    "${ws}short m_short_int;"
-+set f_sui   "${ws}unsigned short m_short_unsigned_int;"
- set f_uc    "${ws}unsigned char m_unsigned_char;"
- set f_f     "${ws}float m_float;"
- set f_d     "${ws}double m_double;"
-diff --git a/gdb/testsuite/gdb.cp/gdb2495.cc b/gdb/testsuite/gdb.cp/gdb2495.cc
-new file mode 100644
-index 0000000..4df265f
---- /dev/null
-+++ b/gdb/testsuite/gdb.cp/gdb2495.cc
-@@ -0,0 +1,90 @@
-+/* This testcase is part of GDB, the GNU debugger.
-+
-+   Copyright 2008 Free Software Foundation, Inc.
-+
-+   This program is free software; you can redistribute it and/or modify
-+   it under the terms of the GNU General Public License as published by
-+   the Free Software Foundation; either version 3 of the License, or
-+   (at your option) any later version.
 +
-+   This program is distributed in the hope that it will be useful,
-+   but WITHOUT ANY WARRANTY; without even the implied warranty of
-+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-+   GNU General Public License for more details.
-+
-+   You should have received a copy of the GNU General Public License
-+   along with this program.  If not, see <http://www.gnu.org/licenses/>.
-+   */
++  try
++    {
++      // This is duplicated so we can next over one but step into
++      // another.
++      next_cases.function2 ();
++    }
++  catch (...)
++    {
++      // Discard
++    }
 +
-+#include <iostream>
-+#include <signal.h>
++  next_cases.function3 ();
 +
-+using namespace std;
++  try
++    {
++      next_cases.rethrow ();
++    }
++  catch (...)
++    {
++      // Discard
++    }
 +
-+class SimpleException 
-+{
++  try
++    {
++      // Another duplicate so we can test "finish".
++      next_cases.function2 ();
++    }
++  catch (...)
++    {
++      // Discard
++    }
 +
-+public:
++  // Another test for "finish".
++  try
++    {
++      next_cases.finish ();
++    }
++  catch (...)
++    {
++    }
 +
-+  void raise_signal (int dummy) 
-+  {
-+    if (dummy > 0)
-+      raise(SIGABRT);
-+  }
++  // Test of "until".
++  try
++    {
++      next_cases.finish ();
++    }
++  catch (...)
++    {
++    }
 +
-+  int  no_throw_function () 
-+  {
-+    return 1;
-+  }
-+  
-+  void throw_function () 
-+  {
-+    throw 1;
-+  }
-+  
-+  int throw_function_with_handler () 
-+  {
-+    try
-+      {
-+      throw 1;
-+      }
-+    catch (...)
-+      {
-+      cout << "Handled" << endl;
-+      } 
-+    
-+    return 2;
-+  }
-+  
-+  void call_throw_function_no_handler () 
-+  {
-+    throw_function ();
-+  }
-+  
-+  void call_throw_function_handler () 
-+  {
-+    throw_function_with_handler ();
-+  }
-+};
-+SimpleException exceptions;
++  // Test of "until" with an argument.
++  try
++    {
++      next_cases.until ();
++    }
++  catch (...)
++    {
++    }
 +
-+int 
-+main()
-+{
-+  // Have to call all these functions
-+  // so not optimized away.
-+  exceptions.raise_signal (-1);
-+  exceptions.no_throw_function ();
-+  exceptions.throw_function_with_handler ();
-+  exceptions.call_throw_function_handler ();
-+  try 
++  // Test of "advance".
++  try
 +    {
-+      exceptions.throw_function ();
-+      exceptions.call_throw_function_no_handler ();
++      next_cases.until ();
 +    }
 +  catch (...)
 +    {
 +    }
-+  return 0;
 +}
 +
-diff --git a/gdb/testsuite/gdb.cp/gdb2495.exp b/gdb/testsuite/gdb.cp/gdb2495.exp
+diff --git a/gdb/testsuite/gdb.cp/gdb9593.exp b/gdb/testsuite/gdb.cp/gdb9593.exp
 new file mode 100644
-index 0000000..62c09c2
+index 0000000..ee9aeff
 --- /dev/null
-+++ b/gdb/testsuite/gdb.cp/gdb2495.exp
-@@ -0,0 +1,160 @@
-+# Copyright 2008 Free Software Foundation, Inc.
++++ b/gdb/testsuite/gdb.cp/gdb9593.exp
+@@ -0,0 +1,185 @@
++# Copyright 2008, 2009 Free Software Foundation, Inc.
 +
 +# This program is free software; you can redistribute it and/or modify
 +# it under the terms of the GNU General Public License as published by
@@ -37693,49 +22435,35 @@ index 0000000..62c09c2
 +# along with this program.  If not, see <http://www.gnu.org/licenses/>.
 +
 +
-+# In gdb inferior function calls, if a C++ exception is raised in the
-+# dummy-frame, and the exception handler is (normally, and expected to
-+# be) out-of-frame, the default C++ handler will (wrongly) be called
-+# in an inferior function call.  
-+# This is incorrect as an exception can normally and legally be handled
-+# out-of-frame. The confines of the dummy frame prevent the unwinder
-+# from finding the correct handler (or any handler, unless it is
-+# in-frame). The default handler calls std::terminate. This will kill
-+# the inferior. Assert that terminate should never be called in an
-+# inferior function call. These tests test the functionality around
-+# unwinding that sequence and also tests the flag behaviour gating this
-+# functionality.
-+
-+# This test is largley based off gdb.base/callfuncs.exp.
-+
 +if $tracelevel then {
 +    strace $tracelevel
 +}
 +
 +if { [skip_cplus_tests] } { continue }
 +
-+set prms_id 2495
++set prms_id 9593
 +set bug_id 0
 +
-+set testfile "gdb2495"
++set testfile "gdb9593"
 +set srcfile ${testfile}.cc
 +set binfile $objdir/$subdir/$testfile
 +
 +# Create and source the file that provides information about the compiler
 +# used to compile the test case.
 +if [get_compiler_info ${binfile} "c++"] {
++    untested gdb9593.exp
 +    return -1
 +}
 +
 +if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug c++}] != "" } {
-+     untested gdb2495.exp
-+     return -1
++    untested gdb9593.exp
++    return -1
 +}
 +
 +# Some targets can't do function calls, so don't even bother with this
 +# test.
 +if [target_info exists gdb,cannot_call_functions] {
-+    setup_xfail "*-*-*" 2416
++    setup_xfail "*-*-*" 9593
 +    fail "This target can not call functions"
 +    continue
 +}
@@ -37750,93 +22478,132 @@ index 0000000..62c09c2
 +    continue
 +} 
 +
-+# See http://sources.redhat.com/gdb/bugs/2495
-+
-+# Test normal baseline behaviour. Call a function that
-+# does not raise an exception ...
-+gdb_test "p exceptions.no_throw_function()" " = 1"
-+# And one that does but handles it in-frame ...
-+gdb_test "p exceptions.throw_function_with_handler()" " = 2"
-+# Both should return normally.
-+
-+# Test basic unwind. Call a function that raises an exception but
-+# does not handle it. It should be rewound ...
-+gdb_test "p exceptions.throw_function()" \
-+    "The program being debugged entered a std::terminate call .*" \
-+    "Call a function that raises an exception without a handler."
-+
-+# Make sure that after rewinding we are back at the call parent.
-+gdb_test "bt" \
-+    "#0  main.*" \
-+    "bt after returning from a popped frame"
-+
-+# Make sure the only breakpoint is the one set via the runto_main
-+# call and that the std::terminate breakpoint has evaporated and
-+# cleaned-up.
-+gdb_test "info breakpoints" \
-+    "gdb.cp/gdb2495\.cc.*"
-+
-+# Turn off this new behaviour ...
-+send_gdb "set unwind-on-terminating-exception off\n" 
-+gdb_expect {
-+    -re "$gdb_prompt $" {pass "set unwind-on-terminating-exception"}
-+    timeout {fail "(timeout) set  unwind-on-terminating-exception"}
++# See whether we have the needed unwinder hooks.
++set ok 1
++gdb_test_multiple "print _Unwind_DebugHook" "check for unwinder hook" {
++    -re "= .*_Unwind_DebugHook.*\r\n$gdb_prompt $" {
++      pass "check for unwinder hook"
++    }
++    -re "No symbol .* in current context.\r\n$gdb_prompt $" {
++      # Pass the test so we don't get bogus fails in the results.
++      pass "check for unwinder hook"
++      set ok 0
++    }
++}
++if {!$ok} {
++    untested gdb9593.exp
++    return -1
 +}
 +
-+# Check that it is turned off ...
-+gdb_test "show unwind-on-terminating-exception" \
-+    "exception is unhandled while in a call dummy is off.*" \
-+    "Turn off unwind on terminating exception flag"
++# See http://sourceware.org/bugzilla/show_bug.cgi?id=9593
 +
-+# Check that the old behaviour is restored.
-+gdb_test "p exceptions.throw_function()" \
-+    "The program being debugged stopped while in a function called .*" \
-+    "Call a function that raises an exception with unwinding off.."
++gdb_test "next" \
++    ".*catch (...).*" \
++    "next over a throw 1"
 +
++gdb_test "next" \
++  ".*next_cases.function2.*" \
++  "next past catch 1"
 +
-+# Restart back at main
-+if ![runto_main] then {
-+    perror "couldn't run to main"
-+    continue
-+} 
++gdb_test "next" \
++    ".*catch (...).*" \
++    "next over a throw 2"
 +
++gdb_test "next" \
++  ".*next_cases.function2.*" \
++  "next past catch 2"
 +
-+# Check to see if our new behaviour alters the unwind signal
-+# behaviour. It should not. Test both on and off states.
++gdb_test "step" \
++  ".*function1().*" \
++  "step into function2 1"
 +
-+# Turn on unwind on signal  behaviour ...
-+send_gdb "set unwindonsignal on\n" 
-+gdb_expect {
-+    -re "$gdb_prompt $" {pass "set unwindonsignal on"}
-+    timeout {fail "(timeout) set  unwindonsignal on"}
-+}
++gdb_test "next" \
++    ".*catch (...).*" \
++    "next over a throw 3"
 +
-+# Check that it is turned on ...
-+gdb_test "show unwindonsignal" \
-+    "signal is received while in a call dummy is on.*" \
-+    "Turn on unwind on signal"
++gdb_test "next" \
++  ".*next_cases.function3.*" \
++  "next past catch 3"
 +
-+# Check to see if new behaviour interferes with
-+# normal signal handling in inferior function calls.
-+gdb_test "p exceptions.raise_signal(1)" \
-+    "To change this behavior use \"set unwindonsignal off\".*"
++gdb_test "next" \
++  ".*next_cases.rethrow.*" \
++    "next over a throw 4"
 +
-+# And reverse. Turn off
-+send_gdb "set unwindonsignal off\n" 
-+gdb_expect {
-+    -re "$gdb_prompt $" {pass "set unwindonsignal off"}
-+    timeout {fail "(timeout) set  unwindonsignal off"}
-+}
++gdb_test "next" \
++  ".*catch (...).*" \
++  "next over a rethrow"
++
++gdb_test "next" \
++  ".*next_cases.function2.*" \
++  "next after a rethrow"
++
++gdb_test "step" \
++  ".*function1().*" \
++  "step into function2 2"
++
++gdb_test "finish" \
++  ".*catch (...).*" \
++  "finish 1"
++
++gdb_test "next" \
++  ".*next_cases.finish ().*" \
++  "next past catch 4"
++
++gdb_test "step" \
++  ".*function1 ().*" \
++  "step into finish method"
++
++gdb_test "finish" \
++  ".*catch (...).*" \
++  "finish 2"
++
++gdb_test "next" \
++  ".*next_cases.finish ().*" \
++  "next past catch 5"
++
++gdb_test "step" \
++  ".*function1 ().*" \
++  "step into finish, for until"
++
++gdb_test "until" \
++  ".*catch .int x.*" \
++  "until with no argument 1"
++
++set line [gdb_get_line_number "marker for until" $testfile.cc]
++
++gdb_test "until $line" \
++  ".*function1 ().*" \
++  "next past catch 6"
++
++gdb_test "until" \
++  ".*catch (...).*" \
++  "until with no argument 2"
 +
-+# Check that it is turned off ...
-+gdb_test "show unwindonsignal" \
-+    "signal is received while in a call dummy is off.*" \
-+    "Turn off unwind on signal"
++set line [gdb_get_line_number "until here" $testfile.cc]
 +
-+# Check to see if new behaviour interferes with
-+# normal signal handling in inferior function calls.
-+gdb_test "p exceptions.raise_signal(1)" \
-+    "To change this behavior use \"set unwindonsignal on\".*"
++gdb_test "next" \
++  ".*next_cases.until ().*" \
++  "next past catch 6"
++
++gdb_test "step" \
++  ".*function1 ().*" \
++  "step into until"
++
++gdb_test "until $line" \
++  ".*catch (...).*" \
++  "until-over-throw"
++
++gdb_test "next" \
++  ".*next_cases.until ().*" \
++  "next past catch 7"
++
++gdb_test "step" \
++  ".*function1 ().*" \
++  "step into until, for advance"
++
++gdb_test "advance $line" \
++  ".*catch (...).*" \
++  "advance-over-throw"
 diff --git a/gdb/testsuite/gdb.cp/member-ptr.cc b/gdb/testsuite/gdb.cp/member-ptr.cc
 index 1dff70a..648b2af 100644
 --- a/gdb/testsuite/gdb.cp/member-ptr.cc
@@ -37899,7 +22666,7 @@ index 1dff70a..648b2af 100644
  
    pmi = &A::jj;
 diff --git a/gdb/testsuite/gdb.cp/member-ptr.exp b/gdb/testsuite/gdb.cp/member-ptr.exp
-index b69d4ad..476711f 100644
+index b69d4ad..83dd0d5 100644
 --- a/gdb/testsuite/gdb.cp/member-ptr.exp
 +++ b/gdb/testsuite/gdb.cp/member-ptr.exp
 @@ -390,6 +390,33 @@ gdb_test_multiple "print ((int) pmi) == ((char *) &a.j - (char *) & a)" $name {
@@ -37936,6 +22703,15 @@ index b69d4ad..476711f 100644
  # ==========================
  # pointer to member function
  # ==========================
+@@ -420,7 +447,7 @@ gdb_test_multiple "ptype pmf" $name {
+ set name "print pmf"
+ gdb_test_multiple "print pmf" $name {
+-    -re "$vhn = $hex <A::bar\\(int\\)>\r\n$gdb_prompt $" {
++    -re "$vhn = \\(int \\(A::\\*\\)\\(A \\*, int\\)\\) $hex <A::bar\\(int\\)>\r\n$gdb_prompt $" {
+       pass $name
+     }
+     -re "$vhn = .*not supported with HP aCC.*\r\n$gdb_prompt $" {
 @@ -608,6 +635,9 @@ gdb_test_multiple "print (a.*pmf)(3)" $name {
      }
  }
@@ -37946,6 +22722,13 @@ index b69d4ad..476711f 100644
  # Print out a pointer to data member which requires looking into
  # a base class.
  gdb_test "print diamond_pmi" "$vhn = &Base::x"
+@@ -658,5 +688,5 @@ gdb_test "print null_pmi = &A::j" "$vhn = &A::j"
+ gdb_test "print null_pmi = 0" "$vhn = NULL"
+ gdb_test "print null_pmf" "$vhn = NULL"
+-gdb_test "print null_pmf = &A::foo" "$vhn = $hex <A::foo ?\\(int\\)>"
++gdb_test "print null_pmf = &A::foo" "$vhn = \\(int \\(A::\\*\\)\\(A \\*, int\\)\\) $hex <A::foo ?\\(int\\)>"
+ gdb_test "print null_pmf = 0" "$vhn = NULL"
 diff --git a/gdb/testsuite/gdb.cp/namespace-multiple-imports.cc b/gdb/testsuite/gdb.cp/namespace-multiple-imports.cc
 new file mode 100644
 index 0000000..6b180d6
@@ -38027,149 +22810,160 @@ index 0000000..e4bb9f8
 +gdb_test "print x" "\\$\[0-9\].* = 11"
 +gdb_test "print xx" "\\$\[0-9\].* = 22"
 +gdb_test "print xxx" "\\$\[0-9\].* = 33"
-diff --git a/gdb/testsuite/gdb.cp/namespace-using.cc b/gdb/testsuite/gdb.cp/namespace-using.cc
+diff --git a/gdb/testsuite/gdb.cp/namespace-nested-imports.cc b/gdb/testsuite/gdb.cp/namespace-nested-imports.cc
 new file mode 100644
-index 0000000..97af850
+index 0000000..9723f87
 --- /dev/null
-+++ b/gdb/testsuite/gdb.cp/namespace-using.cc
-@@ -0,0 +1,131 @@
-+//--------------------------
-+namespace M{
-+  int x = 911;
-+}
-+
-+namespace N{
-+  int x = 912;
-+}
-+
-+int marker10(){
-+  using namespace M;
-+  int y = x+1;       // marker10 stop
-+  using namespace N;
-+  return y;
-+}
-+//--------------------------
-+namespace J {
-+    int jx = 44;
-+}
-+
-+namespace K{
-+  int marker9(){
-+    //x;
-+    return marker10();
-+  }
-+}
-+
-+namespace L{
-+  using namespace J;
-+  int marker8(){
-+    jx;
-+    return K::marker9();
++++ b/gdb/testsuite/gdb.cp/namespace-nested-imports.cc
+@@ -0,0 +1,36 @@
++namespace A
++{
++  namespace B
++  {
++    int ab = 11;
 +  }
 +}
-+//--------------------------
 +
-+//--------------------------
-+namespace G{
-+  namespace H  {
-+    int ghx = 6;
-+  }
-+}
++namespace C
++{
++  namespace D
++  {
++    using namespace A::B;
 +
-+namespace I{
-+  
-+  int marker7(){
-+    using namespace G::H;
-+    ghx;
-+    return L::marker8();
++    int
++    second()
++    {
++      ab;
++      return 0;
++    }
 +  }
-+}
-+//--------------------------
 +
-+//--------------------------
-+namespace E{
-+  namespace F{
-+    int efx = 5;
++  int
++  first()
++  {
++    //ab;
++    return D::second();
 +  }
 +}
-+using namespace E::F;
-+int marker6(){
-+  efx;
-+  return I::marker7();
-+}
-+//--------------------------
 +
-+namespace A
++int
++main()
 +{
-+  int _a = 1;
-+  int x = 2;
-+    
++  //ab;
++  return C::first();
 +}
+diff --git a/gdb/testsuite/gdb.cp/namespace-nested-imports.exp b/gdb/testsuite/gdb.cp/namespace-nested-imports.exp
+new file mode 100644
+index 0000000..d279fb5
+--- /dev/null
++++ b/gdb/testsuite/gdb.cp/namespace-nested-imports.exp
+@@ -0,0 +1,57 @@
++# Copyright 2008 Free Software Foundation, Inc.
 +
-+namespace C
-+{
-+  int cc = 3;
++# This program is free software; you can redistribute it and/or modify
++# it under the terms of the GNU General Public License as published by
++# the Free Software Foundation; either version 3 of the License, or
++# (at your option) any later version.
++#
++# This program is distributed in the hope that it will be useful,
++# but WITHOUT ANY WARRANTY; without even the implied warranty of
++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++# GNU General Public License for more details.
++#
++# You should have received a copy of the GNU General Public License
++# along with this program.  If not, see <http://www.gnu.org/licenses/>.
++
++if $tracelevel then {
++    strace $tracelevel
 +}
 +
-+namespace D
-+{
-+  int dx = 4;
-+}
++set prms_id 0
++set bug_id 0
 +
-+using namespace C;
-+int marker5()
-+{
-+  cc;
-+  return marker6();
++set testfile namespace-nested-imports
++set srcfile ${testfile}.cc
++set binfile ${objdir}/${subdir}/${testfile}
++if  { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug c++}] != "" } {
++    untested "Couldn't compile test program"
++    return -1
 +}
 +
-+int marker4()
-+{
-+  using D::dx;
-+  return marker5();
-+}
++# Get things started.
 +
-+int marker3()
-+{
-+  return marker4();
-+}
++gdb_exit
++gdb_start
++gdb_reinitialize_dir $srcdir/$subdir
++gdb_load ${binfile}
 +
-+int marker2()
-+{
-+  namespace B = A;
-+  B::_a;
-+  return marker3();
++############################################
++if ![runto_main] then {
++    perror "couldn't run to breakpoint main"
++    continue
 +}
 +
-+int marker1()
++gdb_test "print ab" "No symbol .* in current context."
++
++############################################
++gdb_breakpoint C::first
++gdb_continue_to_breakpoint "C::first"
++
++gdb_test "print ab" "No symbol .* in current context."
++gdb_test "print C::D::ab" "= 11"
++
++############################################
++gdb_breakpoint C::D::second
++gdb_continue_to_breakpoint "C::D::second"
++
++gdb_test "print ab" "= 11"
+diff --git a/gdb/testsuite/gdb.cp/namespace-no-imports.cc b/gdb/testsuite/gdb.cp/namespace-no-imports.cc
+new file mode 100644
+index 0000000..d1c68ab
+--- /dev/null
++++ b/gdb/testsuite/gdb.cp/namespace-no-imports.cc
+@@ -0,0 +1,37 @@
++
++namespace A
 +{
-+  int total = 0;
-+    {
-+      int b = 1;
-+        {
-+          using namespace A;
-+          int c = 2;
-+            {
-+              int d = 3;
-+              total = _a + b + c + d + marker2(); // marker1 stop
-+            }
-+        }
++  int _a = 11;
++
++  namespace B{
++
++    int ab = 22;
++
++    namespace C{
++
++      int abc = 33;
++
++      int second(){
++        return 0;
++      }
++
++    }
++
++    int first(){
++      _a;
++      ab;
++      C::abc;
++      return C::second();
 +    }
-+  return total;
++  }
 +}
 +
-+int main()
++
++int
++main()
 +{
-+  using namespace A;
-+  _a;
-+  return marker1();
++  A::_a;
++  A::B::ab;
++  A::B::C::abc;
++  return A::B::first();
 +}
-diff --git a/gdb/testsuite/gdb.cp/namespace-using.exp b/gdb/testsuite/gdb.cp/namespace-using.exp
+diff --git a/gdb/testsuite/gdb.cp/namespace-no-imports.exp b/gdb/testsuite/gdb.cp/namespace-no-imports.exp
 new file mode 100644
-index 0000000..ab6e6a4
+index 0000000..e508103
 --- /dev/null
-+++ b/gdb/testsuite/gdb.cp/namespace-using.exp
-@@ -0,0 +1,183 @@
++++ b/gdb/testsuite/gdb.cp/namespace-no-imports.exp
+@@ -0,0 +1,76 @@
 +# Copyright 2008 Free Software Foundation, Inc.
 +
 +# This program is free software; you can redistribute it and/or modify
@@ -38192,7 +22986,7 @@ index 0000000..ab6e6a4
 +set prms_id 0
 +set bug_id 0
 +
-+set testfile namespace-using
++set testfile namespace-no-imports
 +set srcfile ${testfile}.cc
 +set binfile ${objdir}/${subdir}/${testfile}
 +if  { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug c++}] != "" } {
@@ -38208,1243 +23002,968 @@ index 0000000..ab6e6a4
 +gdb_load ${binfile}
 +
 +############################################
-+# test printing of namespace imported within
-+# the function.
-+
 +if ![runto_main] then {
 +    perror "couldn't run to breakpoint main"
 +    continue
 +}
 +
-+gdb_test "print _a" "= 1"
++gdb_test "print A::_a" "= 11"
++gdb_test "print A::B::ab" "= 22"
++gdb_test "print A::B::C::abc" "= 33"
 +
-+# Test that names are not printed when they 
-+# are not imported
-+
-+gdb_breakpoint marker3
-+gdb_continue_to_breakpoint "marker3"
++gdb_test "print _a" "No symbol .* in current context."
++gdb_test "print ab" "No symbol .* in current context."
++gdb_test "print abc" "No symbol .* in current context."
 +
-+#send_gdb "break marker3\n"
-+#send_gdb "continue\n"
++############################################
++gdb_breakpoint A::B::first
++gdb_continue_to_breakpoint "A::B::first"
 +
-+gdb_test "print _a" "No symbol \"_a\" in current context." "Print _a without import"
++gdb_test "print A::_a" "= 11"
++gdb_test "print A::B::ab" "= 22"
++gdb_test "print A::B::C::abc" "= 33"
 +
-+gdb_exit
-+gdb_start
-+gdb_reinitialize_dir $srcdir/$subdir
-+gdb_load ${binfile}
++gdb_test "print _a" "= 11"
++gdb_test "print ab" "= 22"
++gdb_test "print C::abc" "= 33"
 +
++gdb_test "print abc" "No symbol .* in current context."
 +
 +############################################
-+# test printing of namespace imported into 
-+# a scope containing the pc.
++gdb_breakpoint A::B::C::second
++gdb_continue_to_breakpoint "A::B::C::second"
 +
-+if ![runto_main] then {
-+    perror "couldn't run to breakpoint main"
-+    continue
++gdb_test "print A::_a" "= 11"
++gdb_test "print A::B::ab" "= 22"
++gdb_test "print A::B::C::abc" "= 33"
++
++gdb_test "print _a" "= 11"
++gdb_test "print ab" "= 22"
++gdb_test "print abc" "= 33"
+diff --git a/gdb/testsuite/gdb.cp/namespace-recursive.cc b/gdb/testsuite/gdb.cp/namespace-recursive.cc
+new file mode 100644
+index 0000000..46d4c18
+--- /dev/null
++++ b/gdb/testsuite/gdb.cp/namespace-recursive.cc
+@@ -0,0 +1,47 @@
++namespace A{
++  int ax = 9;
 +}
 +
-+gdb_breakpoint [gdb_get_line_number "marker1 stop"]
-+gdb_continue_to_breakpoint "marker1 stop"
++namespace B{
++  using namespace A;
++}
 +
-+gdb_test "print _a" "= 1" "print _a in a nested scope"
++namespace C{
++  using namespace B;
++}
 +
++using namespace C;
 +
-+gdb_exit
-+gdb_start
-+gdb_reinitialize_dir $srcdir/$subdir
-+gdb_load ${binfile}
++//---------------
++namespace D{
++  using namespace D;
++  int dx = 99;
++}
++using namespace D;
 +
-+############################################
-+# test printing of namespace imported into 
-+# file scope.
++//---------------
++namespace{
++  namespace{
++    int xx = 999;
++  }
++}
 +
++//---------------
++namespace E{
++  int ex = 9999;
++}
 +
-+if ![runto marker5] then {
-+    perror "couldn't run to breakpoint marker5"
-+    continue
++namespace F{
++  namespace FE = E;
 +}
 +
-+gdb_test "print cc" "= 3"
++namespace G{
++  namespace GF = F;
++}
 +
-+gdb_exit
-+gdb_start
-+gdb_reinitialize_dir $srcdir/$subdir
-+gdb_load ${binfile}
++//----------------
++int main(){
++  using namespace D;
++  namespace GX = G;
++  return ax + dx + xx + G::GF::FE::ex;
++}
+diff --git a/gdb/testsuite/gdb.cp/namespace-recursive.exp b/gdb/testsuite/gdb.cp/namespace-recursive.exp
+new file mode 100644
+index 0000000..5543757
+--- /dev/null
++++ b/gdb/testsuite/gdb.cp/namespace-recursive.exp
+@@ -0,0 +1,75 @@
++# Copyright 2008 Free Software Foundation, Inc.
++
++# This program is free software; you can redistribute it and/or modify
++# it under the terms of the GNU General Public License as published by
++# the Free Software Foundation; either version 3 of the License, or
++# (at your option) any later version.
++#
++# This program is distributed in the hope that it will be useful,
++# but WITHOUT ANY WARRANTY; without even the implied warranty of
++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++# GNU General Public License for more details.
++#
++# You should have received a copy of the GNU General Public License
++# along with this program.  If not, see <http://www.gnu.org/licenses/>.
 +
++if $tracelevel then {
++    strace $tracelevel
++}
 +
-+############################################
-+# Test printing of namespace aliases
++set prms_id 0
++set bug_id 0
 +
-+if ![runto marker2] then {
-+    perror "couldn't run to breakpoint marker2"
-+    continue
++set testfile namespace-recursive
++set srcfile ${testfile}.cc
++set binfile ${objdir}/${subdir}/${testfile}
++if  { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug c++}] != "" } {
++    untested "Couldn't compile test program"
++    return -1
 +}
 +
-+gdb_test "print B::_a" "= 1"
++if [get_compiler_info ${binfile}] {
++    return -1;
++}
 +
-+gdb_test "print _a" "No symbol \"_a\" in current context." "print _a in namespace alias scope"
-+gdb_test "print x" "No symbol \"x\" in current context." "print x in namespace alias scope"
++
++# Get things started.
 +
 +gdb_exit
 +gdb_start
 +gdb_reinitialize_dir $srcdir/$subdir
 +gdb_load ${binfile}
 +
-+
-+############################################
-+# Test printing of namespace aliases
-+
-+if ![runto marker4] then {
-+    perror "couldn't run to breakpoint marker4"
++if ![runto_main] then {
++    perror "couldn't run to breakpoint main"
 +    continue
 +}
 +
-+gdb_test "print dx" "= 4"
++############################################
++# test printing from namespace imported into
++# imported namespace
++
++gdb_test "print ax" "= 9"
 +
 +############################################
-+# Test printing of namespace aliases
++# test that gdb can print without falling 
++# into search loop
 +
-+if ![runto marker6] then {
-+    perror "couldn't run to breakpoint marker6"
-+    continue
-+}
++gdb_test "print dx" "= 99"
 +
-+gdb_test "print efx" "= 5"
++############################################
++# test printing from namespace imported into
++# imported namespace where imports are implicit
++# anonymous namespace imports.
++
++gdb_test "print xx" "= 999"
 +
 +############################################
-+# Test printing of variables imported from
-+# nested namespaces
++# Test printing using recursive namespace
++# aliases.
 +
-+if ![runto I::marker7] then {
-+    perror "couldn't run to breakpoint I::marker7"
-+    continue
-+}
++setup_kfail "gdb/10541" "*-*-*"
++gdb_test "ptype G::GF" "= namespace F"
 +
-+gdb_test "print ghx" "= 6"
++setup_kfail "gdb/10541" "*-*-*"
++gdb_test "print G::GF::FE::ex" "= 9999"
+diff --git a/gdb/testsuite/gdb.cp/namespace-stress.cc b/gdb/testsuite/gdb.cp/namespace-stress.cc
+new file mode 100644
+index 0000000..f34083e
+--- /dev/null
++++ b/gdb/testsuite/gdb.cp/namespace-stress.cc
+@@ -0,0 +1,60 @@
++
++namespace A{ int x; }
++namespace B{ int x; }
++namespace C{ int x; }
++namespace D{ int x; }
++namespace E{ int x; }
++namespace F{ int x; }
++namespace G{ int x; }
++namespace H{ int x; }
++namespace I{ int x; }
++namespace J{ int x; }
++namespace K{ int x; }
++namespace L{ int x; }
++namespace M{ int x; }
++namespace N{ int x; }
++namespace O{ int x; }
++namespace P{ int x; }
++namespace Q{ int x; }
++namespace R{ int x; }
++namespace S{ int x; }
++namespace T{ int x; }
++namespace U{ int x; }
++namespace V{ int x; }
++namespace W{ int x; }
++namespace X{ int x; }
++namespace Y{ int x; }
++namespace Z{ int x; }
++
++
++int main(){
 +
-+############################################
-+# Test that variables are not printed in a namespace
-+# that is sibling to the namespace containing an import
++  using namespace A;
++  using namespace B;
++  using namespace C;
++  using namespace D;
++  using namespace E;
++  using namespace F;
++  using namespace G;
++  using namespace H;
++  using namespace I;
++  using namespace J;
++  using namespace K;
++  using namespace L;
++  using namespace M;
++  using namespace N;
++  using namespace O;
++  using namespace P;
++  using namespace Q;
++  using namespace R;
++  using namespace S;
++  using namespace T;
++  using namespace U;
++  using namespace V;
++  using namespace W;
++  using namespace X;
++  using namespace Y;
++  using namespace Z;
 +
-+if ![runto L::marker8] then {
-+    perror "couldn't run to breakpoint L::marker8"
-+    continue
++  return 0;
 +}
+\ No newline at end of file
+diff --git a/gdb/testsuite/gdb.cp/namespace-stress.exp b/gdb/testsuite/gdb.cp/namespace-stress.exp
+new file mode 100644
+index 0000000..1806523
+--- /dev/null
++++ b/gdb/testsuite/gdb.cp/namespace-stress.exp
+@@ -0,0 +1,50 @@
++# Copyright 2008 Free Software Foundation, Inc.
 +
-+gdb_test "print jx" "= 44"
++# 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/>.
 +
-+gdb_breakpoint "K::marker9"
-+gdb_continue_to_breakpoint "K::marker9"
++if $tracelevel then {
++    strace $tracelevel
++}
 +
-+gdb_test "print jx" "No symbol \"jx\" in current context."
++set prms_id 0
++set bug_id 0
 +
-+############################################
-+# Test that variables are only printed after the line
-+# containing the import
++set testfile namespace-stress
++set srcfile ${testfile}.cc
++set binfile ${objdir}/${subdir}/${testfile}
++if  { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug c++}] != "" } {
++    untested "Couldn't compile test program"
++    return -1
++}
++
++if [get_compiler_info ${binfile}] {
++    return -1;
++}
++
++# Get things started.
++
++gdb_exit
++gdb_start
++gdb_reinitialize_dir $srcdir/$subdir
++gdb_load ${binfile}
 +
 +if ![runto_main] then {
 +    perror "couldn't run to breakpoint main"
 +    continue
 +}
 +
-+gdb_breakpoint [gdb_get_line_number "marker10 stop"]
-+gdb_continue_to_breakpoint "marker10 stop"
++############################################
++# Test that the search can fail efficiently 
 +
-+# Assert that M::x is printed and not N::x
-+gdb_test "print x" "= 911" "print x (from M::x)"
-diff --git a/gdb/testsuite/gdb.cp/namespace.exp b/gdb/testsuite/gdb.cp/namespace.exp
-index 76b1b82..2042db2 100644
---- a/gdb/testsuite/gdb.cp/namespace.exp
-+++ b/gdb/testsuite/gdb.cp/namespace.exp
-@@ -24,6 +24,7 @@
- # for namespaces.
- # Note: As of 2000-06-03, they passed under g++ - djb
-+load_lib "cp-support.exp"
- if $tracelevel then {
-         strace $tracelevel
-@@ -259,11 +260,16 @@ gdb_test "ptype E" "type = namespace C::D::E"
- gdb_test "ptype CClass" "type = (class C::CClass \{\r\n  public:|struct C::CClass \{)\r\n    int x;\r\n\}"
- gdb_test "ptype CClass::NestedClass" "type = (class C::CClass::NestedClass \{\r\n  public:|struct C::CClass::NestedClass \{)\r\n    int y;\r\n\}"
- gdb_test "ptype NestedClass" "No symbol \"NestedClass\" in current context."
--setup_kfail "gdb/1448" "*-*-*"
--gdb_test "ptype ::C::CClass" "type = class C::CClass \{\r\n  public:\r\n    int x;\r\n\}"
--setup_kfail "gdb/1448" "*-*-*"
--gdb_test "ptype ::C::CClass::NestedClass" "type = class C::CClass::NestedClass \{\r\n  public:\r\n    int y;\r\n\}"
--setup_kfail "gdb/1448" "*-*-*"
-+cp_test_ptype_class \
-+      "ptype ::C::CClass" "" "class" "C::CClass" \
-+      {
-+          { field public "int x;" }
-+      }
-+cp_test_ptype_class \
-+      "ptype ::C::CClass::NestedClass" "" "class" "C::CClass::NestedClass" \
-+      {
-+          { field public "int y;" }
-+      }
- gdb_test "ptype ::C::NestedClass" "No symbol \"NestedClass\" in namespace \"C\"."
- gdb_test "ptype C::CClass" "No symbol \"CClass\" in namespace \"C::C\"."
- gdb_test "ptype C::CClass::NestedClass" "No type \"CClass\" within class or namespace \"C::C\"."
-@@ -273,8 +279,11 @@ gdb_test "ptype C::NestedClass" "No symbol \"NestedClass\" in namespace \"C::C\"
- gdb_test "print cOtherFile" "\\$\[0-9\].* = 316"
- gdb_test "ptype OtherFileClass" "type = (class C::OtherFileClass \{\r\n  public:|struct C::OtherFileClass \{)\r\n    int z;\r\n\}"
--setup_kfail "gdb/1448" "*-*-*"
--gdb_test "ptype ::C::OtherFileClass" "type = class C::OtherFileClass \{\r\n  public:\r\n    int z;\r\n\}"
-+cp_test_ptype_class \
-+      "ptype ::C::OtherFileClass" "" "class" "C::OtherFileClass" \
-+      {
-+          { field public "int z;" }
-+      }
- gdb_test "ptype C::OtherFileClass" "No symbol \"OtherFileClass\" in namespace \"C::C\"."
- # Some anonymous namespace tests.
-diff --git a/gdb/testsuite/gdb.cp/overload.exp b/gdb/testsuite/gdb.cp/overload.exp
-index 24025a2..a72932e 100644
---- a/gdb/testsuite/gdb.cp/overload.exp
-+++ b/gdb/testsuite/gdb.cp/overload.exp
-@@ -74,12 +74,12 @@ set re_methods     "${re_methods}${ws}int overload1arg\\((void|)\\);"
- set re_methods        "${re_methods}${ws}int overload1arg\\(char\\);"
- set re_methods        "${re_methods}${ws}int overload1arg\\(signed char\\);"
- set re_methods        "${re_methods}${ws}int overload1arg\\(unsigned char\\);"
--set re_methods        "${re_methods}${ws}int overload1arg\\(short\\);"
--set re_methods        "${re_methods}${ws}int overload1arg\\(unsigned short\\);"
-+set re_methods        "${re_methods}${ws}int overload1arg\\(short( int)?\\);"
-+set re_methods        "${re_methods}${ws}int overload1arg\\((unsigned short|short unsigned)( int)?\\);"
- set re_methods        "${re_methods}${ws}int overload1arg\\(int\\);"
- set re_methods        "${re_methods}${ws}int overload1arg\\(unsigned int\\);"
--set re_methods        "${re_methods}${ws}int overload1arg\\(long\\);"
--set re_methods        "${re_methods}${ws}int overload1arg\\(unsigned long\\);"
-+set re_methods        "${re_methods}${ws}int overload1arg\\(long( int)?\\);"
-+set re_methods        "${re_methods}${ws}int overload1arg\\((unsigned long|long unsigned)( int)?\\);"
- set re_methods        "${re_methods}${ws}int overload1arg\\(float\\);"
- set re_methods        "${re_methods}${ws}int overload1arg\\(double\\);"
- set re_methods        "${re_methods}${ws}int overloadfnarg\\((void|)\\);"
-diff --git a/gdb/testsuite/gdb.cp/ovldbreak.exp b/gdb/testsuite/gdb.cp/ovldbreak.exp
-index 8a6b795..897171c 100644
---- a/gdb/testsuite/gdb.cp/ovldbreak.exp
-+++ b/gdb/testsuite/gdb.cp/ovldbreak.exp
-@@ -127,10 +127,24 @@ proc set_bp_overloaded {name expectedmenu mychoice bpnumber linenumber} {
- }
- # This is the expected menu for overload1arg.
--# Note the arg type variations on lines 6 and 13.
-+# Note the arg type variations for void and integer types.
- # This accommodates different versions of g++.
--set menu_overload1arg "\\\[0\\\] cancel\r\n\\\[1\\\] all\r\n\\\[2\\\] foo::overload1arg\\(double\\) at.*$srcfile:121\r\n\\\[3\\\] foo::overload1arg\\(float\\) at.*$srcfile:120\r\n\\\[4\\\] foo::overload1arg\\(unsigned long\\) at.*$srcfile:119\r\n\\\[5\\\] foo::overload1arg\\(long\\) at.*$srcfile:118\r\n\\\[6\\\] foo::overload1arg\\((unsigned int|unsigned)\\) at.*$srcfile:117\r\n\\\[7\\\] foo::overload1arg\\(int\\) at.*$srcfile:116\r\n\\\[8\\\] foo::overload1arg\\(unsigned short\\) at.*$srcfile:115\r\n\\\[9\\\] foo::overload1arg\\(short\\) at.*$srcfile:114\r\n\\\[10\\\] foo::overload1arg\\(unsigned char\\) at.*$srcfile:113\r\n\\\[11\\\] foo::overload1arg\\(signed char\\) at.*$srcfile:112\r\n\\\[12\\\] foo::overload1arg\\(char\\) at.*$srcfile:111\r\n\\\[13\\\] foo::overload1arg\\((void|)\\) at.*$srcfile:110\r\n> $"
-+set    menu_overload1arg "\\\[0\\\] cancel\r\n"
-+append menu_overload1arg "\\\[1\\\] all\r\n"
-+append menu_overload1arg "\\\[2\\\] foo::overload1arg\\(double\\) at.*$srcfile:121\r\n"
-+append menu_overload1arg "\\\[3\\\] foo::overload1arg\\(float\\) at.*$srcfile:120\r\n"
-+append menu_overload1arg "\\\[4\\\] foo::overload1arg\\((unsigned long|long unsigned)( int)?\\) at.*$srcfile:119\r\n"
-+append menu_overload1arg "\\\[5\\\] foo::overload1arg\\(long( int)?\\) at.*$srcfile:118\r\n"
-+append menu_overload1arg "\\\[6\\\] foo::overload1arg\\((unsigned int|unsigned)\\) at.*$srcfile:117\r\n"
-+append menu_overload1arg "\\\[7\\\] foo::overload1arg\\(int\\) at.*$srcfile:116\r\n"
-+append menu_overload1arg "\\\[8\\\] foo::overload1arg\\((unsigned short|short unsigned)( int)?\\) at.*$srcfile:115\r\n"
-+append menu_overload1arg "\\\[9\\\] foo::overload1arg\\(short( int)?\\) at.*$srcfile:114\r\n"
-+append menu_overload1arg "\\\[10\\\] foo::overload1arg\\(unsigned char\\) at.*$srcfile:113\r\n"
-+append menu_overload1arg "\\\[11\\\] foo::overload1arg\\(signed char\\) at.*$srcfile:112\r\n"
-+append menu_overload1arg "\\\[12\\\] foo::overload1arg\\(char\\) at.*$srcfile:111\r\n"
-+append menu_overload1arg "\\\[13\\\] foo::overload1arg\\((void|)\\) at.*$srcfile:110\r\n"
-+append menu_overload1arg "> $"
- # Set multiple-symbols to "ask", to allow us to test the use
- # of the multiple-choice menu when breaking on an overloaded method.
-@@ -157,17 +171,17 @@ set_bp_overloaded "foo::overload1arg" "$menu_overload1arg" 13   13 110
- gdb_test "info break" \
-     "Num     Type\[\t \]+Disp Enb Address\[\t \]+What.*
--\[0-9\]+\[\t \]+breakpoint     keep y\[\t \]+$hex\[\t \]+in main at.*$srcfile:49\r
-+\[0-9\]+\[\t \]+breakpoint     keep y\[\t \]+$hex\[\t \]+in main(\\(void\\))? at.*$srcfile:49\r
- \[\t \]+breakpoint already hit 1 time\r
- \[0-9\]+\[\t \]+breakpoint     keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\(char\\) at.*$srcfile:111\r
- \[0-9\]+\[\t \]+breakpoint     keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\(signed char\\) at.*$srcfile:112\r
- \[0-9\]+\[\t \]+breakpoint     keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\(unsigned char\\) at.*$srcfile:113\r
--\[0-9\]+\[\t \]+breakpoint     keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\(short\\) at.*$srcfile:114\r
--\[0-9\]+\[\t \]+breakpoint     keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\(unsigned short\\) at.*$srcfile:115\r
-+\[0-9\]+\[\t \]+breakpoint     keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\(short( int)?\\) at.*$srcfile:114\r
-+\[0-9\]+\[\t \]+breakpoint     keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\((unsigned short|short unsigned)( int)?\\) at.*$srcfile:115\r
- \[0-9\]+\[\t \]+breakpoint     keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\(int\\) at.*$srcfile:116\r
- \[0-9\]+\[\t \]+breakpoint     keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\((unsigned|unsigned int)\\) at.*$srcfile:117\r
--\[0-9\]+\[\t \]+breakpoint     keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\(long\\) at.*$srcfile:118\r
--\[0-9\]+\[\t \]+breakpoint     keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\(unsigned long\\) at.*$srcfile:119\r
-+\[0-9\]+\[\t \]+breakpoint     keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\(long( int)?\\) at.*$srcfile:118\r
-+\[0-9\]+\[\t \]+breakpoint     keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\((unsigned long|long unsigned)( int)?\\) at.*$srcfile:119\r
- \[0-9\]+\[\t \]+breakpoint     keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\(float\\) at.*$srcfile:120\r
- \[0-9\]+\[\t \]+breakpoint     keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\(double\\) at.*$srcfile:121\r
- \[0-9\]+\[\t \]+breakpoint     keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\((void|)\\) at.*$srcfile:110" \
-@@ -215,17 +229,17 @@ gdb_expect {
- gdb_test "info break" \
-     "Num     Type\[\t \]+Disp Enb Address\[\t \]+What.*
--\[0-9\]+\[\t \]+breakpoint     keep y\[\t \]+$hex\[\t \]+in main at.*$srcfile:49\r
-+\[0-9\]+\[\t \]+breakpoint     keep y\[\t \]+$hex\[\t \]+in main(\\(void\\))? at.*$srcfile:49\r
- \[\t \]+breakpoint already hit 1 time\r
- \[0-9\]+\[\t \]+breakpoint     keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\(char\\) at.*$srcfile:111\r
- \[0-9\]+\[\t \]+breakpoint     keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\(signed char\\) at.*$srcfile:112\r
- \[0-9\]+\[\t \]+breakpoint     keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\(unsigned char\\) at.*$srcfile:113\r
--\[0-9\]+\[\t \]+breakpoint     keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\(short\\) at.*$srcfile:114\r
--\[0-9\]+\[\t \]+breakpoint     keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\(unsigned short\\) at.*$srcfile:115\r
-+\[0-9\]+\[\t \]+breakpoint     keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\(short( int)?\\) at.*$srcfile:114\r
-+\[0-9\]+\[\t \]+breakpoint     keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\((unsigned short|short unsigned)( int)?\\) at.*$srcfile:115\r
- \[0-9\]+\[\t \]+breakpoint     keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\(int\\) at.*$srcfile:116\r
- \[0-9\]+\[\t \]+breakpoint     keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\((unsigned|unsigned int)\\) at.*$srcfile:117\r
--\[0-9\]+\[\t \]+breakpoint     keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\(long\\) at.*$srcfile:118\r
--\[0-9\]+\[\t \]+breakpoint     keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\(unsigned long\\) at.*$srcfile:119\r
-+\[0-9\]+\[\t \]+breakpoint     keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\(long( int)?\\) at.*$srcfile:118\r
-+\[0-9\]+\[\t \]+breakpoint     keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\((unsigned long|long unsigned)( int)?\\) at.*$srcfile:119\r
- \[0-9\]+\[\t \]+breakpoint     keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\(float\\) at.*$srcfile:120\r
- \[0-9\]+\[\t \]+breakpoint     keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\(double\\) at.*$srcfile:121\r
- \[0-9\]+\[\t \]+breakpoint     keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\((void|)\\) at.*$srcfile:110" \
-@@ -296,12 +310,12 @@ gdb_test "info break" \
-     "Num     Type\[\t \]+Disp Enb Address\[\t \]+What.*
- \[0-9\]+\[\t \]+breakpoint     keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\(double\\) at.*$srcfile:121\r
- \[0-9\]+\[\t \]+breakpoint     keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\(float\\) at.*$srcfile:120\r
--\[0-9\]+\[\t \]+breakpoint     keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\(unsigned long\\) at.*$srcfile:119\r
--\[0-9\]+\[\t \]+breakpoint     keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\(long\\) at.*$srcfile:118\r
-+\[0-9\]+\[\t \]+breakpoint     keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\((unsigned long|long unsigned)( int)?\\) at.*$srcfile:119\r
-+\[0-9\]+\[\t \]+breakpoint     keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\(long( int)?\\) at.*$srcfile:118\r
- \[0-9\]+\[\t \]+breakpoint     keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\((unsigned|unsigned int)\\) at.*$srcfile:117\r
- \[0-9\]+\[\t \]+breakpoint     keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\(int\\) at.*$srcfile:116\r
--\[0-9\]+\[\t \]+breakpoint     keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\(unsigned short\\) at.*$srcfile:115\r
--\[0-9\]+\[\t \]+breakpoint     keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\(short\\) at.*$srcfile:114\r
-+\[0-9\]+\[\t \]+breakpoint     keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\((unsigned short|short unsigned)( int)?\\) at.*$srcfile:115\r
-+\[0-9\]+\[\t \]+breakpoint     keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\(short( int)?\\) at.*$srcfile:114\r
- \[0-9\]+\[\t \]+breakpoint     keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\(unsigned char\\) at.*$srcfile:113\r
- \[0-9\]+\[\t \]+breakpoint     keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\(signed char\\) at.*$srcfile:112\r
- \[0-9\]+\[\t \]+breakpoint     keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\(char\\) at.*$srcfile:111\r
-diff --git a/gdb/testsuite/gdb.cp/ref-types.exp b/gdb/testsuite/gdb.cp/ref-types.exp
-index 4784cb2..b2e55cf 100644
---- a/gdb/testsuite/gdb.cp/ref-types.exp
-+++ b/gdb/testsuite/gdb.cp/ref-types.exp
-@@ -284,7 +284,7 @@ gdb_expect {
- send_gdb "print UC\n"
- gdb_expect {
--    -re ".\[0-9\]* = 21 '\.025'\.*$gdb_prompt $" {
-+    -re ".\[0-9\]* = 21 '\.25'\.*$gdb_prompt $" {
-         pass "print value of UC"
-       }
-     -re ".*$gdb_prompt $" { fail "print value of UC" }
-@@ -557,7 +557,7 @@ gdb_expect {
- send_gdb "print rUC\n"
- gdb_expect {
--    -re ".\[0-9\]* = \\(unsigned char &\\) @$hex: 21 \'.025\'.*$gdb_prompt $" {
-+    -re ".\[0-9\]* = \\(unsigned char &\\) @$hex: 21 \'.25\'.*$gdb_prompt $" {
-         pass "print value of rUC"
-       }
-     -re ".*$gdb_prompt $" { fail "print value of rUC" }
-diff --git a/gdb/testsuite/gdb.cp/templates.exp b/gdb/testsuite/gdb.cp/templates.exp
-index cd9b770..f49caff 100644
---- a/gdb/testsuite/gdb.cp/templates.exp
-+++ b/gdb/testsuite/gdb.cp/templates.exp
-@@ -329,13 +329,11 @@ gdb_expect {
- send_gdb "print Foo<volatile char *>::foo\n"   
- gdb_expect {   
--    -re "\\$\[0-9\]* = \\{.*char \\*\\((class |)Foo<volatile char ?\\*> \\*(| const), int, .*char \\*\\)\\} $hex <Foo<.*char.*\\*>::foo\\(int, .*char.*\\*\\)>\r\n$gdb_prompt $" { pass "print Foo<volatile char *>::foo" }
-+    -re "\\$\[0-9\]* = \\{.*char \\*\\((class |)Foo<(volatile char|char volatile) ?\\*> \\*(| const), int, .*char \\*\\)\\} $hex <Foo<.*char.*\\*>::foo\\(int, .*char.*\\*\\)>\r\n$gdb_prompt $" { pass "print Foo<volatile char *>::foo" }
-     -re "No symbol \"Foo<volatile char \\*>\" in current context.\r\n$gdb_prompt $"
-     {
--      # This used to be a kfail gdb/33.  That problem has been
--      # fixed, but now gdb/931 and gdb/1512 are rearing their ugly
--      # heads.
--      kfail "gdb/931" "print Foo<volatile char *>::foo"
-+      # This used to be a kfail gdb/33 and then kfail gdb/931.
-+      fail "print Foo<volatile char *>::foo"
-     }
-     -re "$gdb_prompt $"                     { fail "print Foo<volatile char *>::foo" }
-     timeout                             { fail "(timeout) print Foo<volatile char *>::foo" }
-@@ -343,13 +341,11 @@ gdb_expect {
- send_gdb "print Foo<volatile char*>::foo\n"   
- gdb_expect {   
--    -re "\\$\[0-9\]* = \\{.*char \\*\\((class |)Foo<volatile char ?\\*> \\*(| const), int, .*char \\*\\)\\} $hex <Foo<.*char.*\\*>::foo\\(int, .*char.*\\*\\)>\r\n$gdb_prompt $" { pass "print Foo<volatile char*>::foo" }
-+    -re "\\$\[0-9\]* = \\{.*char \\*\\((class |)Foo<(volatile char|char volatile) ?\\*> \\*(| const), int, .*char \\*\\)\\} $hex <Foo<.*char.*\\*>::foo\\(int, .*char.*\\*\\)>\r\n$gdb_prompt $" { pass "print Foo<volatile char*>::foo" }
-     -re "No symbol \"Foo<volatile char\\*>\" in current context.\r\n$gdb_prompt $"
-     {
--      # This used to be a kfail gdb/33.  That problem has been
--      # fixed, but now gdb/931 and gdb/1512 are rearing their ugly
--      # heads.
--      kfail "gdb/931" "print Foo<volatile char*>::foo"
-+      # This used to be a kfail gdb/33 and then kfail gdb/931.
-+      fail "print Foo<volatile char*>::foo"
-     }
-     -re "$gdb_prompt $"                     { fail "print Foo<volatile char*>::foo" }
-     timeout                             { fail "(timeout) print Foo<volatile char*>::foo" }
-@@ -459,7 +455,7 @@ send_gdb "ptype quxint\n"
- gdb_expect {   
-    -re "type = class Qux<int, ?& ?string> \\{\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\[ \t\]*int t;\r\n\r\n\[ \t\]*.*int qux\\(int, int\\);\r\n\\}\r\n$gdb_prompt $" { pass "ptype quxint" }
-    -re "type = class Qux<int, ?& ?string> \\{\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\[ \t\]*int t;\r\n\r\n\[ \t\]*int qux\\(int, int\\);.*\r\n\\}\r\n$gdb_prompt $" { pass "ptype quxint" }
--   -re "type = class Qux<int, ?\\(char ?\\*\\)\\(& ?string\\)> \\{\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\[ \t\]*int t;\r\n\r\n\[ \t\]*int qux\\(int, int\\);.*\r\n\\}\r\n$gdb_prompt $" { pass "ptype quxint" }
-+   -re "type = class Qux<int, ?\\(char ?\\*\\)\\(& ?\\(?string\\)?\\)> \\{\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\[ \t\]*int t;\r\n\r\n\[ \t\]*int qux\\(int, int\\);.*\r\n\\}\r\n$gdb_prompt $" { pass "ptype quxint" }
-    -re "type = class Qux<int, ?& ?\\(string\\)> \\{\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\[ \t\]*int t;\r\n\r\n\[ \t\]*int qux\\(int, int\\);.*\r\n\\}\r\n$gdb_prompt $" {
-        kfail "gdb/1512" "ptype quxint"
-    }
-diff --git a/gdb/testsuite/gdb.dwarf2/dw2-stripped.c b/gdb/testsuite/gdb.dwarf2/dw2-stripped.c
-new file mode 100644
-index 0000000..1f02d90
---- /dev/null
-+++ b/gdb/testsuite/gdb.dwarf2/dw2-stripped.c
-@@ -0,0 +1,42 @@
-+/* This testcase is part of GDB, the GNU debugger.
++gdb_test "print y" "No symbol \"y\" in current context."
+diff --git a/gdb/testsuite/gdb.cp/namespace-using.cc b/gdb/testsuite/gdb.cp/namespace-using.cc
+index 4786fd5..8ff5622 100644
+--- a/gdb/testsuite/gdb.cp/namespace-using.cc
++++ b/gdb/testsuite/gdb.cp/namespace-using.cc
+@@ -1,26 +1,129 @@
++namespace M
++{
++  int x = 911;
++}
 +
-+   Copyright 2004 Free Software Foundation, Inc.
++namespace N
++{
++  int x = 912;
++}
 +
-+   This program is free software; you can redistribute it and/or modify
-+   it under the terms of the GNU General Public License as published by
-+   the Free Software Foundation; either version 2 of the License, or
-+   (at your option) any later version.
++int marker10 ()
++{
++  using namespace M;
++  int y = x + 1;       // marker10 stop
++  using namespace N;
++  return y;
++}
 +
-+   This program is distributed in the hope that it will be useful,
-+   but WITHOUT ANY WARRANTY; without even the implied warranty of
-+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-+   GNU General Public License for more details.
-+ 
-+   You should have received a copy of the GNU General Public License
-+   along with this program; if not, write to the Free Software
-+   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
-+   USA.  */
++namespace J
++{
++  int jx = 44;
++}
 +
++namespace K
++{
++  int
++  marker9 ()
++  {
++    //x;
++    return marker10 ();
++  }
++}
 +
-+/* The function `func1' traced into must have debug info on offset > 0;
-+   (DW_UNSND (attr)).  This is the reason of `func0' existence.  */
++namespace L
++{
++  using namespace J;
++  int
++  marker8 ()
++  {
++    jx;
++    return K::marker9 ();
++  }
++}
 +
-+void
-+func0(int a, int b)
++namespace G
 +{
++  namespace H
++  {
++    int ghx = 6;
++  }
 +}
 +
-+/* `func1' being traced into must have some arguments to dump.  */
++namespace I
++{  
++  int
++  marker7 ()
++  {
++    using namespace G::H;
++    ghx;
++    return L::marker8 ();
++  }
++}
 +
-+void
-+func1(int a, int b)
++namespace E
 +{
-+  func0 (a,b);
++  namespace F
++  {
++    int efx = 5;
++  }
 +}
 +
++using namespace E::F;
 +int
-+main(void)
++marker6 ()
 +{
-+  func1 (1, 2);
-+  return 0;
++  efx;
++  return I::marker7 ();
 +}
-diff --git a/gdb/testsuite/gdb.dwarf2/dw2-stripped.exp b/gdb/testsuite/gdb.dwarf2/dw2-stripped.exp
-new file mode 100644
-index 0000000..1c6e84a
---- /dev/null
-+++ b/gdb/testsuite/gdb.dwarf2/dw2-stripped.exp
-@@ -0,0 +1,79 @@
-+# Copyright 2006 Free Software Foundation, Inc.
 +
-+# This program is free software; you can redistribute it and/or modify
-+# it under the terms of the GNU General Public License as published by
-+# the Free Software Foundation; either version 2 of the License, or
-+# (at your option) any later version.
-+# 
-+# This program is distributed in the hope that it will be useful,
-+# but WITHOUT ANY WARRANTY; without even the implied warranty of
-+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-+# GNU General Public License for more details.
-+
-+# You should have received a copy of the GNU General Public License
-+# along with this program; if not, write to the Free Software
-+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ namespace A
+ {
+   int _a = 1;
+   int x = 2;
+ }
+-int marker4(){
+-      using A::x;
+-      return 0;
++namespace C
++{
++  int cc = 3;
++}
 +
-+# Minimal DWARF-2 unit test
++namespace D
++{
++  int dx = 4;
++}
 +
-+# This test can only be run on targets which support DWARF-2.
-+# For now pick a sampling of likely targets.
-+if {![istarget *-*-linux*]
-+    && ![istarget *-*-gnu*]
-+    && ![istarget *-*-elf*]
-+    && ![istarget *-*-openbsd*]
-+    && ![istarget arm-*-eabi*]
-+    && ![istarget powerpc-*-eabi*]} {
-+    return 0  
++using namespace C;
++int
++marker5 ()
++{
++  cc;
++  return marker6 ();
 +}
 +
-+set testfile "dw2-stripped"
-+set srcfile ${testfile}.c
-+set binfile ${objdir}/${subdir}/${testfile}.x
-+
-+remote_exec build "rm -f ${binfile}"
-+
-+# get the value of gcc_compiled
++int
++marker4 ()
++{
++  using D::dx;
++  return marker5 ();
+ }
+-int marker3(){
+-      return marker4();
++int
++marker3 ()
++{
++  return marker4 ();
+ }
+-int marker2()
++int
++marker2 ()
+ {
+   namespace B = A;
+   B::_a;
+-  return marker3();
++  return marker3 ();
+ }
+-int marker1()
++int
++marker1 ()
+ {
+   int total = 0;
+   {
+@@ -29,17 +132,18 @@ int marker1()
+       using namespace A;
+       int c = 2;
+       {
+-        int d = 3;
+-        total = _a + b + c + d + marker2(); // marker1 stop
++      int d = 3;
++      total = _a + b + c + d + marker2 (); // marker1 stop
+       }
+     }
+   }
+   return total;
+ }
+-int main()
++int
++main ()
+ {
+   using namespace A;
+   _a;
+-  return marker1();
++  return marker1 ();
+ }
+diff --git a/gdb/testsuite/gdb.cp/namespace-using.exp b/gdb/testsuite/gdb.cp/namespace-using.exp
+index f24973f..fc23115 100644
+--- a/gdb/testsuite/gdb.cp/namespace-using.exp
++++ b/gdb/testsuite/gdb.cp/namespace-using.exp
+@@ -28,6 +28,11 @@ if  { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {deb
+     return -1
+ }
 +if [get_compiler_info ${binfile}] {
-+    return -1
++    return -1;
 +}
 +
-+# This test can only be run on gcc as we use additional_flags=FIXME
-+if {$gcc_compiled == 0} {
-+    return 0
-+}
 +
-+if  { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug additional_flags=-ggdb3}] != "" } {
-+    return -1
-+}
+ # Get things started.
+ gdb_exit
+@@ -46,42 +51,155 @@ if ![runto_main] then {
+ gdb_test "print _a" "= 1"
++# Test that names are not printed when they 
++# are not imported
 +
-+remote_exec build "objcopy -R .debug_loc ${binfile}"
-+set strip_output [remote_exec build "objdump -h ${binfile}"]
++gdb_breakpoint marker3
++gdb_continue_to_breakpoint "marker3"
 +
-+set test "stripping test file preservation"
-+if [ regexp ".debug_info " $strip_output]  {
-+    pass "$test (.debug_info preserved)"
-+} else {
-+    fail "$test (.debug_info got also stripped)"
-+}
++#send_gdb "break marker3\n"
++#send_gdb "continue\n"
 +
-+set test "stripping test file functionality"
-+if [ regexp ".debug_loc " $strip_output]  {
-+    fail "$test (.debug_loc still present)"
-+} else {
-+    pass "$test (.debug_loc stripped)"
-+}
++gdb_test "print _a" "No symbol \"_a\" in current context." "Print _a without import"
 +
 +gdb_exit
 +gdb_start
 +gdb_reinitialize_dir $srcdir/$subdir
 +gdb_load ${binfile}
 +
-+# For C programs, "start" should stop in main().
 +
-+gdb_test "start" \
-+         ".*main \\(\\) at .*" \
-+         "start"
-+gdb_test "step" \
-+         "func.* \\(.*\\) at .*" \
-+         "step"
-diff --git a/gdb/testsuite/gdb.dwarf2/dw2-strp.S b/gdb/testsuite/gdb.dwarf2/dw2-strp.S
-index a1602a5..293cc1b 100644
---- a/gdb/testsuite/gdb.dwarf2/dw2-strp.S
-+++ b/gdb/testsuite/gdb.dwarf2/dw2-strp.S
-@@ -28,7 +28,8 @@
-       /* CU die */
-       .uleb128        1                       /* Abbrev: DW_TAG_compile_unit */
-       .4byte          .Lproducer              /* DW_AT_producer */
--      .byte           1                       /* DW_AT_language (C) */
-+      /* Use C++ to exploit a bug in parsing DW_AT_name "".  */
-+      .byte           4                       /* DW_AT_language (C++) -  */
- .Larray_type:
-       .uleb128        2                       /* Abbrev: DW_TAG_array_type */
-@@ -60,6 +61,10 @@
- .Lconst_type:
-       .uleb128        6                       /* Abbrev: DW_TAG_const_type */
-       .4byte          .Larray_type-.Lcu1_begin/* DW_AT_type */
-+
-+      .uleb128        7                       /* Abbrev: DW_TAG_variable (name "") */
-+      .4byte          .Lemptyname             /* DW_AT_name */
-+
-       .byte           0                       /* End of children of CU */
- .Lcu1_end:
-@@ -126,6 +131,15 @@
-       .uleb128        0x13                    /* DW_FORM_ref4 */
-       .byte           0x0                     /* Terminator */
-       .byte           0x0                     /* Terminator */
-+
-+      .uleb128        7                       /* Abbrev code */
-+      .uleb128        0x34                    /* DW_TAG_variable */
-+      .byte           0x0                     /* DW_children_no */
-+      .uleb128        0x3                     /* DW_AT_name */
-+      .uleb128        0xe                     /* DW_FORM_strp */
-+      .byte           0x0                     /* Terminator */
-+      .byte           0x0                     /* Terminator */
+ ############################################
+ # test printing of namespace imported into 
+ # a scope containing the pc.
++if ![runto_main] then {
++    perror "couldn't run to breakpoint main"
++    continue
++}
 +
-       .byte           0x0                     /* Terminator */
+ gdb_breakpoint [gdb_get_line_number "marker1 stop"]
+ gdb_continue_to_breakpoint "marker1 stop"
+ gdb_test "print _a" "= 1" "print _a in a nested scope"
  
- /* String table */
-@@ -140,3 +154,5 @@
-       .string         "a_string"
- .Lvarcontents:
-       .string         "hello world!\n"
-+.Lemptyname:
-+      .string         ""
-diff --git a/gdb/testsuite/gdb.fortran/common-block.exp b/gdb/testsuite/gdb.fortran/common-block.exp
-new file mode 100644
-index 0000000..888f6c3
---- /dev/null
-+++ b/gdb/testsuite/gdb.fortran/common-block.exp
-@@ -0,0 +1,101 @@
-+# Copyright 2008 Free Software Foundation, Inc.
 +
-+# This program is free software; you can redistribute it and/or modify
-+# it under the terms of the GNU General Public License as published by
-+# the Free Software Foundation; either version 2 of the License, or
-+# (at your option) any later version.
-+# 
-+# This program is distributed in the hope that it will be useful,
-+# but WITHOUT ANY WARRANTY; without even the implied warranty of
-+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-+# GNU General Public License for more details.
-+# 
-+# You should have received a copy of the GNU General Public License
-+# along with this program; if not, write to the Free Software
-+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  
++gdb_exit
++gdb_start
++gdb_reinitialize_dir $srcdir/$subdir
++gdb_load ${binfile}
 +
-+# This file was written by Jan Kratochvil <jan.kratochvil@redhat.com>.
++############################################
++# test printing of namespace imported into 
++# file scope.
 +
-+set testfile "common-block"
-+set srcfile ${testfile}.f90
-+set binfile ${objdir}/${subdir}/${testfile}
 +
-+if  { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug f77 quiet}] != "" } {
-+    untested "Couldn't compile ${srcfile}"
-+    return -1
++if ![runto marker5] then {
++    perror "couldn't run to breakpoint marker5"
++    continue
 +}
 +
++gdb_test "print cc" "= 3"
++
 +gdb_exit
 +gdb_start
 +gdb_reinitialize_dir $srcdir/$subdir
 +gdb_load ${binfile}
 +
-+if ![runto MAIN__] then {
-+    perror "couldn't run to breakpoint MAIN__"
++
+ ############################################
+ # Test printing of namespace aliases
+-setup_kfail "gdb/7935" "*-*-*"
+ if ![runto marker2] then {
+     perror "couldn't run to breakpoint marker2"
+     continue
+ }
+-gdb_test "print B::a" "= 1"
++gdb_test "print B::_a" "= 1"
++
++gdb_test "print _a" "No symbol \"_a\" in current context." "print _a in namespace alias scope"
++gdb_test "print x" "No symbol \"x\" in current context." "print x in namespace alias scope"
++
++gdb_exit
++gdb_start
++gdb_reinitialize_dir $srcdir/$subdir
++gdb_load ${binfile}
++
+ ############################################
+ # Test that names are not printed when they 
+ # are not imported
+-gdb_breakpoint "marker3"
+-gdb_continue_to_breakpoint "marker3"
++if {![runto marker3]} {
++    perror "couldn't run to breakpoint marker3"
++}
+-gdb_test "print _a" "No symbol \"_a\" in current context." "Print a without import"
++# gcc-4-3 puts import statements for aliases in
++# the global scope instead of the corresponding
++# function scope. These wrong import statements throw
++# this test off. This is fixed in gcc-4-4.
++if [test_compiler_info gcc-4-3-*] then { setup_xfail *-*-* }
++
++gdb_test "print _a" "No symbol \"_a\" in current context." "Print _a without import"
+ ############################################
+ # Test printing of individually imported elements
+-setup_kfail "gdb/7936" "*-*-*"
+ if ![runto marker4] then {
+     perror "couldn't run to breakpoint marker4"
+     continue
+ }
+-gdb_test "print x" "= 2"
++gdb_test "print dx" "= 4"
++
++############################################
++# Test printing of namespace aliases
++
++if ![runto marker5] then {
++    perror "couldn't run to marker5"
 +    continue
 +}
 +
-+gdb_breakpoint [gdb_get_line_number "stop-here-out"]
-+gdb_continue_to_breakpoint "stop-here-out"
++gdb_test "print efx" "= 5"
 +
-+# Common block naming with source name /foo/:
-+#                .symtab  DW_TAG_common_block's DW_AT_name
-+# Intel Fortran  foo_     foo_
-+# GNU Fortran    foo_     foo
-+#set suffix "_"
-+set suffix ""
++############################################
++# Test printing of variables imported from
++# nested namespaces
 +
-+set int4 {(integer\(kind=4\)|INTEGER\(4\))}
-+set real4 {(real\(kind=4\)|REAL\(4\))}
-+set real8 {(real\(kind=8\)|REAL\(8\))}
++if ![runto I::marker7] then {
++    perror "couldn't run to breakpoint I::marker7"
++    continue
++}
 +
-+gdb_test "whatis foo$suffix" "No symbol \"foo$suffix\" in current context."
-+gdb_test "ptype foo$suffix" "No symbol \"foo$suffix\" in current context."
-+gdb_test "p foo$suffix" "No symbol \"foo$suffix\" in current context."
-+gdb_test "whatis fo_o$suffix" "No symbol \"fo_o$suffix\" in current context."
-+gdb_test "ptype fo_o$suffix" "No symbol \"fo_o$suffix\" in current context."
-+gdb_test "p fo_o$suffix" "No symbol \"fo_o$suffix\" in current context."
++gdb_test "print ghx" "= 6"
 +
-+gdb_test "info locals" "ix_x = 11\r\niy_y = 22\r\niz_z = 33\r\nix = 1\r\niy = 2\r\niz = 3" "info locals out"
-+gdb_test "info common" "Contents of F77 COMMON block 'fo_o':\r\nix_x = 11\r\niy_y = 22\r\niz_z = 33\r\n\r\nContents of F77 COMMON block 'foo':\r\nix = 1\r\niy = 2\r\niz = 3" "info common out"
++############################################
++# Test that variables are not printed in a namespace
++# that is sibling to the namespace containing an import
 +
-+gdb_test "ptype ix" "type = $int4" "ptype ix out"
-+gdb_test "ptype iy" "type = $real4" "ptype iy out"
-+gdb_test "ptype iz" "type = $real8" "ptype iz out"
-+gdb_test "ptype ix_x" "type = $int4" "ptype ix_x out"
-+gdb_test "ptype iy_y" "type = $real4" "ptype iy_y out"
-+gdb_test "ptype iz_z" "type = $real8" "ptype iz_z out"
++if ![runto L::marker8] then {
++    perror "couldn't run to breakpoint L::marker8"
++    continue
++}
 +
-+gdb_test "p ix" " = 1 *" "p ix out"
-+gdb_test "p iy" " = 2 *" "p iy out"
-+gdb_test "p iz" " = 3 *" "p iz out"
-+gdb_test "p ix_x" " = 11 *" "p ix_x out"
-+gdb_test "p iy_y" " = 22 *" "p iy_y out"
-+gdb_test "p iz_z" " = 33 *" "p iz_z out"
++gdb_test "print jx" "= 44"
 +
-+gdb_breakpoint [gdb_get_line_number "stop-here-in"]
-+gdb_continue_to_breakpoint "stop-here-in"
++gdb_breakpoint "K::marker9"
++gdb_continue_to_breakpoint "K::marker9"
 +
-+gdb_test "whatis foo$suffix" "No symbol \"foo$suffix\" in current context." "whatis foo$suffix in"
-+gdb_test "ptype foo$suffix" "No symbol \"foo$suffix\" in current context." "ptype foo$suffix in"
-+gdb_test "p foo$suffix" "No symbol \"foo$suffix\" in current context." "p foo$suffix in"
-+gdb_test "whatis fo_o$suffix" "No symbol \"fo_o$suffix\" in current context." "whatis fo_o$suffix in"
-+gdb_test "ptype fo_o$suffix" "No symbol \"fo_o$suffix\" in current context." "ptype fo_o$suffix in"
-+gdb_test "p fo_o$suffix" "No symbol \"fo_o$suffix\" in current context." "p fo_o$suffix in"
++gdb_test "print jx" "No symbol \"jx\" in current context."
 +
-+gdb_test "info locals" "ix = 11\r\niy2 = 22\r\niz = 33\r\nix_x = 1\r\niy_y = 2\r\niz_z2 = 3\r\niy = 5\r\niz_z = 55" "info locals in"
-+gdb_test "info common" "Contents of F77 COMMON block 'fo_o':\r\nix = 11\r\niy2 = 22\r\niz = 33\r\n\r\nContents of F77 COMMON block 'foo':\r\nix_x = 1\r\niy_y = 2\r\niz_z2 = 3" "info common in"
++############################################
++# Test that variables are only printed after the line
++# containing the import
 +
-+gdb_test "ptype ix" "type = $int4" "ptype ix in"
-+gdb_test "ptype iy2" "type = $real4" "ptype iy2 in"
-+gdb_test "ptype iz" "type = $real8" "ptype iz in"
-+gdb_test "ptype ix_x" "type = $int4" "ptype ix_x in"
-+gdb_test "ptype iy_y" "type = $real4" "ptype iy_y in"
-+gdb_test "ptype iz_z2" "type = $real8" "ptype iz_z2 in"
++if ![runto_main] then {
++    perror "couldn't run to breakpoint main"
++    continue
++}
 +
-+gdb_test "p ix" " = 11 *" "p ix in"
-+gdb_test "p iy2" " = 22 *" "p iy2 in"
-+gdb_test "p iz" " = 33 *" "p iz in"
-+gdb_test "p ix_x" " = 1 *" "p ix_x in"
-+gdb_test "p iy_y" " = 2 *" "p iy_y in"
-+gdb_test "p iz_z2" " = 3 *" "p iz_z2 in"
-diff --git a/gdb/testsuite/gdb.fortran/common-block.f90 b/gdb/testsuite/gdb.fortran/common-block.f90
-new file mode 100644
-index 0000000..b614e8a
---- /dev/null
-+++ b/gdb/testsuite/gdb.fortran/common-block.f90
-@@ -0,0 +1,67 @@
-+! Copyright 2008 Free Software Foundation, Inc.
-+!
-+! This program is free software; you can redistribute it and/or modify
-+! it under the terms of the GNU General Public License as published by
-+! the Free Software Foundation; either version 2 of the License, or
-+! (at your option) any later version.
-+!
-+! This program is distributed in the hope that it will be useful,
-+! but WITHOUT ANY WARRANTY; without even the implied warranty of
-+! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-+! GNU General Public License for more details.
-+!
-+! You should have received a copy of the GNU General Public License
-+! along with this program; if not, write to the Free Software
-+! Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-+!
-+! Ihis file is the Fortran source file for dynamic.exp.
-+! Original file written by Jakub Jelinek <jakub@redhat.com>.
-+! Modified for the GDB testcase by Jan Kratochvil <jan.kratochvil@redhat.com>.
-+
-+subroutine in
-+
-+   INTEGER*4            ix
-+   REAL*4               iy2
-+   REAL*8               iz
-+
-+   INTEGER*4            ix_x
-+   REAL*4               iy_y
-+   REAL*8               iz_z2
-+
-+   common /fo_o/ix,iy2,iz
-+   common /foo/ix_x,iy_y,iz_z2
-+
-+   iy = 5
-+   iz_z = 55
-+
-+   if (ix .ne. 11 .or. iy2 .ne. 22.0 .or. iz .ne. 33.0) call abort
-+   if (ix_x .ne. 1 .or. iy_y .ne. 2.0 .or. iz_z2 .ne. 3.0) call abort
-+
-+   ix = 0                                     ! stop-here-in
-+
-+end subroutine in
-+
-+program common_test
-+
-+   INTEGER*4            ix
-+   REAL*4               iy
-+   REAL*8               iz
-+
-+   INTEGER*4            ix_x
-+   REAL*4               iy_y
-+   REAL*8               iz_z
-+
-+   common /foo/ix,iy,iz
-+   common /fo_o/ix_x,iy_y,iz_z
-+
-+   ix = 1
-+   iy = 2.0
-+   iz = 3.0
-+
-+   ix_x = 11
-+   iy_y = 22.0
-+   iz_z = 33.0
++gdb_breakpoint [gdb_get_line_number "marker10 stop"]
++gdb_continue_to_breakpoint "marker10 stop"
 +
-+   call in                                    ! stop-here-out
++# Assert that M::x is printed and not N::x
++gdb_test "print x" "= 911" "print x (from M::x)"
 +
-+end program common_test
-diff --git a/gdb/testsuite/gdb.fortran/dynamic.exp b/gdb/testsuite/gdb.fortran/dynamic.exp
+diff --git a/gdb/testsuite/gdb.cp/namespace.exp b/gdb/testsuite/gdb.cp/namespace.exp
+index 76b1b82..2042db2 100644
+--- a/gdb/testsuite/gdb.cp/namespace.exp
++++ b/gdb/testsuite/gdb.cp/namespace.exp
+@@ -24,6 +24,7 @@
+ # for namespaces.
+ # Note: As of 2000-06-03, they passed under g++ - djb
++load_lib "cp-support.exp"
+ if $tracelevel then {
+         strace $tracelevel
+@@ -259,11 +260,16 @@ gdb_test "ptype E" "type = namespace C::D::E"
+ gdb_test "ptype CClass" "type = (class C::CClass \{\r\n  public:|struct C::CClass \{)\r\n    int x;\r\n\}"
+ gdb_test "ptype CClass::NestedClass" "type = (class C::CClass::NestedClass \{\r\n  public:|struct C::CClass::NestedClass \{)\r\n    int y;\r\n\}"
+ gdb_test "ptype NestedClass" "No symbol \"NestedClass\" in current context."
+-setup_kfail "gdb/1448" "*-*-*"
+-gdb_test "ptype ::C::CClass" "type = class C::CClass \{\r\n  public:\r\n    int x;\r\n\}"
+-setup_kfail "gdb/1448" "*-*-*"
+-gdb_test "ptype ::C::CClass::NestedClass" "type = class C::CClass::NestedClass \{\r\n  public:\r\n    int y;\r\n\}"
+-setup_kfail "gdb/1448" "*-*-*"
++cp_test_ptype_class \
++      "ptype ::C::CClass" "" "class" "C::CClass" \
++      {
++          { field public "int x;" }
++      }
++cp_test_ptype_class \
++      "ptype ::C::CClass::NestedClass" "" "class" "C::CClass::NestedClass" \
++      {
++          { field public "int y;" }
++      }
+ gdb_test "ptype ::C::NestedClass" "No symbol \"NestedClass\" in namespace \"C\"."
+ gdb_test "ptype C::CClass" "No symbol \"CClass\" in namespace \"C::C\"."
+ gdb_test "ptype C::CClass::NestedClass" "No type \"CClass\" within class or namespace \"C::C\"."
+@@ -273,8 +279,11 @@ gdb_test "ptype C::NestedClass" "No symbol \"NestedClass\" in namespace \"C::C\"
+ gdb_test "print cOtherFile" "\\$\[0-9\].* = 316"
+ gdb_test "ptype OtherFileClass" "type = (class C::OtherFileClass \{\r\n  public:|struct C::OtherFileClass \{)\r\n    int z;\r\n\}"
+-setup_kfail "gdb/1448" "*-*-*"
+-gdb_test "ptype ::C::OtherFileClass" "type = class C::OtherFileClass \{\r\n  public:\r\n    int z;\r\n\}"
++cp_test_ptype_class \
++      "ptype ::C::OtherFileClass" "" "class" "C::OtherFileClass" \
++      {
++          { field public "int z;" }
++      }
+ gdb_test "ptype C::OtherFileClass" "No symbol \"OtherFileClass\" in namespace \"C::C\"."
+ # Some anonymous namespace tests.
+diff --git a/gdb/testsuite/gdb.cp/overload.exp b/gdb/testsuite/gdb.cp/overload.exp
+index 24025a2..a72932e 100644
+--- a/gdb/testsuite/gdb.cp/overload.exp
++++ b/gdb/testsuite/gdb.cp/overload.exp
+@@ -74,12 +74,12 @@ set re_methods     "${re_methods}${ws}int overload1arg\\((void|)\\);"
+ set re_methods        "${re_methods}${ws}int overload1arg\\(char\\);"
+ set re_methods        "${re_methods}${ws}int overload1arg\\(signed char\\);"
+ set re_methods        "${re_methods}${ws}int overload1arg\\(unsigned char\\);"
+-set re_methods        "${re_methods}${ws}int overload1arg\\(short\\);"
+-set re_methods        "${re_methods}${ws}int overload1arg\\(unsigned short\\);"
++set re_methods        "${re_methods}${ws}int overload1arg\\(short( int)?\\);"
++set re_methods        "${re_methods}${ws}int overload1arg\\((unsigned short|short unsigned)( int)?\\);"
+ set re_methods        "${re_methods}${ws}int overload1arg\\(int\\);"
+ set re_methods        "${re_methods}${ws}int overload1arg\\(unsigned int\\);"
+-set re_methods        "${re_methods}${ws}int overload1arg\\(long\\);"
+-set re_methods        "${re_methods}${ws}int overload1arg\\(unsigned long\\);"
++set re_methods        "${re_methods}${ws}int overload1arg\\(long( int)?\\);"
++set re_methods        "${re_methods}${ws}int overload1arg\\((unsigned long|long unsigned)( int)?\\);"
+ set re_methods        "${re_methods}${ws}int overload1arg\\(float\\);"
+ set re_methods        "${re_methods}${ws}int overload1arg\\(double\\);"
+ set re_methods        "${re_methods}${ws}int overloadfnarg\\((void|)\\);"
+diff --git a/gdb/testsuite/gdb.cp/ovldbreak.exp b/gdb/testsuite/gdb.cp/ovldbreak.exp
+index 8a6b795..9997a45 100644
+--- a/gdb/testsuite/gdb.cp/ovldbreak.exp
++++ b/gdb/testsuite/gdb.cp/ovldbreak.exp
+@@ -127,10 +127,24 @@ proc set_bp_overloaded {name expectedmenu mychoice bpnumber linenumber} {
+ }
+ # This is the expected menu for overload1arg.
+-# Note the arg type variations on lines 6 and 13.
++# Note the arg type variations for void and integer types.
+ # This accommodates different versions of g++.
+-set menu_overload1arg "\\\[0\\\] cancel\r\n\\\[1\\\] all\r\n\\\[2\\\] foo::overload1arg\\(double\\) at.*$srcfile:121\r\n\\\[3\\\] foo::overload1arg\\(float\\) at.*$srcfile:120\r\n\\\[4\\\] foo::overload1arg\\(unsigned long\\) at.*$srcfile:119\r\n\\\[5\\\] foo::overload1arg\\(long\\) at.*$srcfile:118\r\n\\\[6\\\] foo::overload1arg\\((unsigned int|unsigned)\\) at.*$srcfile:117\r\n\\\[7\\\] foo::overload1arg\\(int\\) at.*$srcfile:116\r\n\\\[8\\\] foo::overload1arg\\(unsigned short\\) at.*$srcfile:115\r\n\\\[9\\\] foo::overload1arg\\(short\\) at.*$srcfile:114\r\n\\\[10\\\] foo::overload1arg\\(unsigned char\\) at.*$srcfile:113\r\n\\\[11\\\] foo::overload1arg\\(signed char\\) at.*$srcfile:112\r\n\\\[12\\\] foo::overload1arg\\(char\\) at.*$srcfile:111\r\n\\\[13\\\] foo::overload1arg\\((void|)\\) at.*$srcfile:110\r\n> $"
++set    menu_overload1arg "\\\[0\\\] cancel\r\n"
++append menu_overload1arg "\\\[1\\\] all\r\n"
++append menu_overload1arg "\\\[2\\\] foo::overload1arg\\(double\\) at.*$srcfile:121\r\n"
++append menu_overload1arg "\\\[3\\\] foo::overload1arg\\(float\\) at.*$srcfile:120\r\n"
++append menu_overload1arg "\\\[4\\\] foo::overload1arg\\((unsigned long|long unsigned)( int)?\\) at.*$srcfile:119\r\n"
++append menu_overload1arg "\\\[5\\\] foo::overload1arg\\(long( int)?\\) at.*$srcfile:118\r\n"
++append menu_overload1arg "\\\[6\\\] foo::overload1arg\\((unsigned int|unsigned)\\) at.*$srcfile:117\r\n"
++append menu_overload1arg "\\\[7\\\] foo::overload1arg\\(int\\) at.*$srcfile:116\r\n"
++append menu_overload1arg "\\\[8\\\] foo::overload1arg\\((unsigned short|short unsigned)( int)?\\) at.*$srcfile:115\r\n"
++append menu_overload1arg "\\\[9\\\] foo::overload1arg\\(short( int)?\\) at.*$srcfile:114\r\n"
++append menu_overload1arg "\\\[10\\\] foo::overload1arg\\(unsigned char\\) at.*$srcfile:113\r\n"
++append menu_overload1arg "\\\[11\\\] foo::overload1arg\\(signed char\\) at.*$srcfile:112\r\n"
++append menu_overload1arg "\\\[12\\\] foo::overload1arg\\(char\\) at.*$srcfile:111\r\n"
++append menu_overload1arg "\\\[13\\\] foo::overload1arg\\((void|)\\) at.*$srcfile:110\r\n"
++append menu_overload1arg "> $"
+ # Set multiple-symbols to "ask", to allow us to test the use
+ # of the multiple-choice menu when breaking on an overloaded method.
+@@ -157,17 +171,17 @@ set_bp_overloaded "foo::overload1arg" "$menu_overload1arg" 13   13 110
+ gdb_test "info break" \
+     "Num     Type\[\t \]+Disp Enb Address\[\t \]+What.*
+-\[0-9\]+\[\t \]+breakpoint     keep y\[\t \]+$hex\[\t \]+in main at.*$srcfile:49\r
++\[0-9\]+\[\t \]+breakpoint     keep y\[\t \]+$hex\[\t \]+in main(\\((|void)\\))? at.*$srcfile:49\r
+ \[\t \]+breakpoint already hit 1 time\r
+ \[0-9\]+\[\t \]+breakpoint     keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\(char\\) at.*$srcfile:111\r
+ \[0-9\]+\[\t \]+breakpoint     keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\(signed char\\) at.*$srcfile:112\r
+ \[0-9\]+\[\t \]+breakpoint     keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\(unsigned char\\) at.*$srcfile:113\r
+-\[0-9\]+\[\t \]+breakpoint     keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\(short\\) at.*$srcfile:114\r
+-\[0-9\]+\[\t \]+breakpoint     keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\(unsigned short\\) at.*$srcfile:115\r
++\[0-9\]+\[\t \]+breakpoint     keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\(short( int)?\\) at.*$srcfile:114\r
++\[0-9\]+\[\t \]+breakpoint     keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\((unsigned short|short unsigned)( int)?\\) at.*$srcfile:115\r
+ \[0-9\]+\[\t \]+breakpoint     keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\(int\\) at.*$srcfile:116\r
+ \[0-9\]+\[\t \]+breakpoint     keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\((unsigned|unsigned int)\\) at.*$srcfile:117\r
+-\[0-9\]+\[\t \]+breakpoint     keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\(long\\) at.*$srcfile:118\r
+-\[0-9\]+\[\t \]+breakpoint     keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\(unsigned long\\) at.*$srcfile:119\r
++\[0-9\]+\[\t \]+breakpoint     keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\(long( int)?\\) at.*$srcfile:118\r
++\[0-9\]+\[\t \]+breakpoint     keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\((unsigned long|long unsigned)( int)?\\) at.*$srcfile:119\r
+ \[0-9\]+\[\t \]+breakpoint     keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\(float\\) at.*$srcfile:120\r
+ \[0-9\]+\[\t \]+breakpoint     keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\(double\\) at.*$srcfile:121\r
+ \[0-9\]+\[\t \]+breakpoint     keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\((void|)\\) at.*$srcfile:110" \
+@@ -215,17 +229,17 @@ gdb_expect {
+ gdb_test "info break" \
+     "Num     Type\[\t \]+Disp Enb Address\[\t \]+What.*
+-\[0-9\]+\[\t \]+breakpoint     keep y\[\t \]+$hex\[\t \]+in main at.*$srcfile:49\r
++\[0-9\]+\[\t \]+breakpoint     keep y\[\t \]+$hex\[\t \]+in main(\\((|void)\\))? at.*$srcfile:49\r
+ \[\t \]+breakpoint already hit 1 time\r
+ \[0-9\]+\[\t \]+breakpoint     keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\(char\\) at.*$srcfile:111\r
+ \[0-9\]+\[\t \]+breakpoint     keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\(signed char\\) at.*$srcfile:112\r
+ \[0-9\]+\[\t \]+breakpoint     keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\(unsigned char\\) at.*$srcfile:113\r
+-\[0-9\]+\[\t \]+breakpoint     keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\(short\\) at.*$srcfile:114\r
+-\[0-9\]+\[\t \]+breakpoint     keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\(unsigned short\\) at.*$srcfile:115\r
++\[0-9\]+\[\t \]+breakpoint     keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\(short( int)?\\) at.*$srcfile:114\r
++\[0-9\]+\[\t \]+breakpoint     keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\((unsigned short|short unsigned)( int)?\\) at.*$srcfile:115\r
+ \[0-9\]+\[\t \]+breakpoint     keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\(int\\) at.*$srcfile:116\r
+ \[0-9\]+\[\t \]+breakpoint     keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\((unsigned|unsigned int)\\) at.*$srcfile:117\r
+-\[0-9\]+\[\t \]+breakpoint     keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\(long\\) at.*$srcfile:118\r
+-\[0-9\]+\[\t \]+breakpoint     keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\(unsigned long\\) at.*$srcfile:119\r
++\[0-9\]+\[\t \]+breakpoint     keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\(long( int)?\\) at.*$srcfile:118\r
++\[0-9\]+\[\t \]+breakpoint     keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\((unsigned long|long unsigned)( int)?\\) at.*$srcfile:119\r
+ \[0-9\]+\[\t \]+breakpoint     keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\(float\\) at.*$srcfile:120\r
+ \[0-9\]+\[\t \]+breakpoint     keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\(double\\) at.*$srcfile:121\r
+ \[0-9\]+\[\t \]+breakpoint     keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\((void|)\\) at.*$srcfile:110" \
+@@ -296,12 +310,12 @@ gdb_test "info break" \
+     "Num     Type\[\t \]+Disp Enb Address\[\t \]+What.*
+ \[0-9\]+\[\t \]+breakpoint     keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\(double\\) at.*$srcfile:121\r
+ \[0-9\]+\[\t \]+breakpoint     keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\(float\\) at.*$srcfile:120\r
+-\[0-9\]+\[\t \]+breakpoint     keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\(unsigned long\\) at.*$srcfile:119\r
+-\[0-9\]+\[\t \]+breakpoint     keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\(long\\) at.*$srcfile:118\r
++\[0-9\]+\[\t \]+breakpoint     keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\((unsigned long|long unsigned)( int)?\\) at.*$srcfile:119\r
++\[0-9\]+\[\t \]+breakpoint     keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\(long( int)?\\) at.*$srcfile:118\r
+ \[0-9\]+\[\t \]+breakpoint     keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\((unsigned|unsigned int)\\) at.*$srcfile:117\r
+ \[0-9\]+\[\t \]+breakpoint     keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\(int\\) at.*$srcfile:116\r
+-\[0-9\]+\[\t \]+breakpoint     keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\(unsigned short\\) at.*$srcfile:115\r
+-\[0-9\]+\[\t \]+breakpoint     keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\(short\\) at.*$srcfile:114\r
++\[0-9\]+\[\t \]+breakpoint     keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\((unsigned short|short unsigned)( int)?\\) at.*$srcfile:115\r
++\[0-9\]+\[\t \]+breakpoint     keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\(short( int)?\\) at.*$srcfile:114\r
+ \[0-9\]+\[\t \]+breakpoint     keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\(unsigned char\\) at.*$srcfile:113\r
+ \[0-9\]+\[\t \]+breakpoint     keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\(signed char\\) at.*$srcfile:112\r
+ \[0-9\]+\[\t \]+breakpoint     keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\(char\\) at.*$srcfile:111\r
+diff --git a/gdb/testsuite/gdb.cp/shadowing.cc b/gdb/testsuite/gdb.cp/shadowing.cc
 new file mode 100644
-index 0000000..77a1203
+index 0000000..6d9c2f1
 --- /dev/null
-+++ b/gdb/testsuite/gdb.fortran/dynamic.exp
-@@ -0,0 +1,156 @@
-+# Copyright 2007 Free Software Foundation, Inc.
-+
-+# This program is free software; you can redistribute it and/or modify
-+# it under the terms of the GNU General Public License as published by
-+# the Free Software Foundation; either version 2 of the License, or
-+# (at your option) any later version.
-+# 
-+# This program is distributed in the hope that it will be useful,
-+# but WITHOUT ANY WARRANTY; without even the implied warranty of
-+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-+# GNU General Public License for more details.
-+# 
-+# You should have received a copy of the GNU General Public License
-+# along with this program; if not, write to the Free Software
-+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  
-+
-+# This file was written by Jan Kratochvil <jan.kratochvil@redhat.com>.
-+
-+# This file is part of the gdb testsuite.  It contains tests for dynamically
-+# allocated Fortran arrays.
-+# It depends on the GCC dynamic Fortran arrays DWARF support:
-+#     http://gcc.gnu.org/bugzilla/show_bug.cgi?id=22244
++++ b/gdb/testsuite/gdb.cp/shadowing.cc
+@@ -0,0 +1,48 @@
++namespace A
++{
++  int x = 11;
++}
 +
-+set testfile "dynamic"
-+set srcfile ${testfile}.f90
-+set binfile ${objdir}/${subdir}/${testfile}
++int x = 22;
++int y = 0;
 +
-+if  { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug f77 quiet}] != "" } {
-+    untested "Couldn't compile ${srcfile}"
-+    return -1
-+}
-+
-+gdb_exit
-+gdb_start
-+gdb_reinitialize_dir $srcdir/$subdir
-+gdb_load ${binfile}
-+
-+if ![runto MAIN__] then {
-+    perror "couldn't run to breakpoint MAIN__"
-+    continue
-+}
-+
-+gdb_breakpoint [gdb_get_line_number "varx-init"]
-+gdb_continue_to_breakpoint "varx-init"
-+gdb_test "p varx" "\\$\[0-9\]* = <(object|the array) is not allocated>" "p varx unallocated"
-+gdb_test "ptype varx" "type = <(object|the array) is not allocated>" "ptype varx unallocated"
-+gdb_test "p varx(1,5,17)" "(Cannot access it|Unable to access the object) because the (object|array) is not allocated\\." "p varx(1,5,17) unallocated"
-+gdb_test "p varx(1,5,17)=1" "(Cannot access it|Unable to access the object) because the (object|array) is not allocated\\." "p varx(1,5,17)=1 unallocated"
-+gdb_test "ptype varx(1,5,17)" "(Cannot access it|Unable to access the object) because the (object|array) is not allocated\\." "ptype varx(1,5,17) unallocated"
-+
-+gdb_breakpoint [gdb_get_line_number "varx-allocated"]
-+gdb_continue_to_breakpoint "varx-allocated"
-+# $1 = (( ( 0, 0, 0, 0, 0, 0) ( 0, 0, 0, 0, 0, 0) --- , 0) ) ( ( 0, 0, ...) ...) ...)
-+gdb_test "ptype varx" "type = real(\\(kind=4\\)|\\*4) \\(6,5:15,17:28\\)" "ptype varx allocated"
-+# Intel Fortran Compiler 10.1.008 uses -1 there, GCC uses 1.
-+gdb_test "p l" "\\$\[0-9\]* = (\\.TRUE\\.|4294967295)" "p l if varx allocated"
-+
-+gdb_breakpoint [gdb_get_line_number "varx-filled"]
-+gdb_continue_to_breakpoint "varx-filled"
-+gdb_test "p varx(2, 5, 17)" "\\$\[0-9\]* = 6"
-+gdb_test "p varx(1, 5, 17)" "\\$\[0-9\]* = 7"
-+gdb_test "p varx(2, 6, 18)" "\\$\[0-9\]* = 8"
-+gdb_test "p varx(6, 15, 28)" "\\$\[0-9\]* = 9"
-+# The latter one is for the Intel Fortran Compiler 10.1.008 pointer type.
-+gdb_test "p varv" "\\$\[0-9\]* = (<(object|the array) is not associated>|.*(Cannot access it|Unable to access the object) because the object is not associated.)" "p varv unassociated"
-+gdb_test "ptype varv" "type = (<(object|the array) is not associated>|.*(Cannot access it|Unable to access the object) because the object is not associated.)" "ptype varv unassociated"
-+
-+gdb_breakpoint [gdb_get_line_number "varv-associated"]
-+gdb_continue_to_breakpoint "varv-associated"
-+gdb_test "p varx(3, 7, 19)" "\\$\[0-9\]* = 6" "p varx(3, 7, 19) with varv associated"
-+gdb_test "p varv(3, 7, 19)" "\\$\[0-9\]* = 6" "p varv(3, 7, 19) associated"
-+# Intel Fortran Compiler 10.1.008 uses -1 there, GCC uses 1.
-+gdb_test "p l" "\\$\[0-9\]* = (\\.TRUE\\.|4294967295)" "p l if varv associated"
-+gdb_test "ptype varx" "type = real(\\(kind=4\\)|\\*4) \\(6,5:15,17:28\\)" "ptype varx with varv associated"
-+# Intel Fortran Compiler 10.1.008 uses the pointer type.
-+gdb_test "ptype varv" "type = (PTR TO -> \\( )?real(\\(kind=4\\)|\\*4) \\(6,5:15,17:28\\)\\)?" "ptype varv associated"
-+
-+gdb_breakpoint [gdb_get_line_number "varv-filled"]
-+gdb_continue_to_breakpoint "varv-filled"
-+gdb_test "p varx(3, 7, 19)" "\\$\[0-9\]* = 10" "p varx(3, 7, 19) with varv filled"
-+gdb_test "p varv(3, 7, 19)" "\\$\[0-9\]* = 10" "p varv(3, 7, 19) filled"
-+
-+gdb_breakpoint [gdb_get_line_number "varv-deassociated"]
-+gdb_continue_to_breakpoint "varv-deassociated"
-+# The latter one is for the Intel Fortran Compiler 10.1.008 pointer type.
-+gdb_test "p varv" "\\$\[0-9\]* = (<(object|the array) is not associated>|.*(Cannot access it|Unable to access the object) because the object is not associated.)" "p varv deassociated"
-+gdb_test "ptype varv" "type = (<(object|the array) is not associated>|.*(Cannot access it|Unable to access the object) because the object is not associated.)" "ptype varv deassociated"
-+gdb_test "p l" "\\$\[0-9\]* = \\.FALSE\\." "p l if varv deassociated"
-+gdb_test "p varv(1,5,17)" "(Cannot access it|Unable to access the object) because the (object|array) is not associated\\."
-+gdb_test "ptype varv(1,5,17)" "(Cannot access it|Unable to access the object) because the (object|array) is not associated\\."
-+
-+gdb_breakpoint [gdb_get_line_number "varx-deallocated"]
-+gdb_continue_to_breakpoint "varx-deallocated"
-+gdb_test "p varx" "\\$\[0-9\]* = <(object|the array) is not allocated>" "p varx deallocated"
-+gdb_test "ptype varx" "type = <(object|the array) is not allocated>" "ptype varx deallocated"
-+gdb_test "p l" "\\$\[0-9\]* = \\.FALSE\\." "p l if varx deallocated"
-+gdb_test "p varx(1,5,17)" "(Cannot access it|Unable to access the object) because the (object|array) is not allocated\\." "p varx(1,5,17) deallocated"
-+gdb_test "ptype varx(1,5,17)" "(Cannot access it|Unable to access the object) because the (object|array) is not allocated\\." "ptype varx(1,5,17) deallocated"
-+
-+gdb_breakpoint [gdb_get_line_number "vary-passed"]
-+gdb_continue_to_breakpoint "vary-passed"
-+# $1 = (( ( 1, 1, 1, 1, 1, 1) ( 1, 1, 1, 1, 1, 1) --- , 1) ) ( ( 1, 1, ...) ...) ...)
-+gdb_test "p vary" "\\$\[0-9\]* = \\(\[()1, .\]*\\)"
-+
-+gdb_breakpoint [gdb_get_line_number "vary-filled"]
-+gdb_continue_to_breakpoint "vary-filled"
-+gdb_test "ptype vary" "type = real(\\(kind=4\\)|\\*4) \\(10,10\\)"
-+gdb_test "p vary(1, 1)" "\\$\[0-9\]* = 8"
-+gdb_test "p vary(2, 2)" "\\$\[0-9\]* = 9"
-+gdb_test "p vary(1, 3)" "\\$\[0-9\]* = 10"
-+# $1 = (( ( 3, 3, 3, 3, 3, 3) ( 3, 3, 3, 3, 3, 3) --- , 3) ) ( ( 3, 3, ...) ...) ...)
-+gdb_test "p varw" "\\$\[0-9\]* = \\(\[()3, .\]*\\)"
-+
-+gdb_breakpoint [gdb_get_line_number "varw-almostfilled"]
-+gdb_continue_to_breakpoint "varw-almostfilled"
-+gdb_test "ptype varw" "type = real(\\(kind=4\\)|\\*4) \\(5,4,3\\)"
-+gdb_test "p varw(3,1,1)=1" "\\$\[0-9\]* = 1"
-+# $1 = (( ( 6, 5, 1, 5, 5, 5) ( 5, 5, 5, 5, 5, 5) --- , 5) ) ( ( 5, 5, ...) ...) ...)
-+gdb_test "p varw" "\\$\[0-9\]* = \\( *\\( *\\( *6, *5, *1,\[()5, .\]*\\)" "p varw filled"
-+# "up" works with GCC but other Fortran compilers may copy the values into the
-+# outer function only on the exit of the inner function.
-+gdb_test "finish" ".*call bar \\(y, x\\)"
-+gdb_test "p z(2,4,5)" "\\$\[0-9\]* = 3"
-+gdb_test "p z(2,4,6)" "\\$\[0-9\]* = 6"
-+gdb_test "p z(2,4,7)" "\\$\[0-9\]* = 5"
-+gdb_test "p z(4,4,6)" "\\$\[0-9\]* = 1"
-+
-+gdb_breakpoint [gdb_get_line_number "varz-almostfilled"]
-+gdb_continue_to_breakpoint "varz-almostfilled"
-+# GCC uses the pointer type here, Intel Fortran Compiler 10.1.008 does not.
-+gdb_test "ptype varz" "type = (PTR TO -> \\( )?real(\\(kind=4\\)|\\*4) \\(\\*\\)\\)?"
-+# Intel Fortran Compiler 10.1.008 has a bug here - (2:11,7:7)
-+# as it produces DW_AT_lower_bound == DW_AT_upper_bound == 7.
-+gdb_test "ptype vart" "type = (PTR TO -> \\( )?real(\\(kind=4\\)|\\*4) \\(2:11,7:\\*\\)\\)?"
-+gdb_test "p varz" "\\$\[0-9\]* = \\(\\)"
-+gdb_test "p vart" "\\$\[0-9\]* = \\(\\)"
-+gdb_test "p varz(3)" "\\$\[0-9\]* = 4"
-+# maps to foo::vary(1,1)
-+gdb_test "p vart(2,7)" "\\$\[0-9\]* = 8"
-+# maps to foo::vary(2,2)
-+gdb_test "p vart(3,8)" "\\$\[0-9\]* = 9"
-+# maps to foo::vary(1,3)
-+gdb_test "p vart(2,9)" "\\$\[0-9\]* = 10"
-+
-+set test "quit #1"
-+gdb_test_multiple "quit" $test {
-+    -re "The program is running.  Quit anyway \\(and kill it\\)\\? \\(y or n\\) " {
-+      pass $test
-+    }
-+}
-+set test "quit #2"
-+gdb_test_multiple "y" $test {
-+    eof {
-+      pass $test
-+    }
-+}
-diff --git a/gdb/testsuite/gdb.fortran/dynamic.f90 b/gdb/testsuite/gdb.fortran/dynamic.f90
-new file mode 100644
-index 0000000..0f43564
---- /dev/null
-+++ b/gdb/testsuite/gdb.fortran/dynamic.f90
-@@ -0,0 +1,98 @@
-+! Copyright 2007 Free Software Foundation, Inc.
-+!
-+! This program is free software; you can redistribute it and/or modify
-+! it under the terms of the GNU General Public License as published by
-+! the Free Software Foundation; either version 2 of the License, or
-+! (at your option) any later version.
-+!
-+! This program is distributed in the hope that it will be useful,
-+! but WITHOUT ANY WARRANTY; without even the implied warranty of
-+! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-+! GNU General Public License for more details.
-+!
-+! You should have received a copy of the GNU General Public License
-+! along with this program; if not, write to the Free Software
-+! Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-+!
-+! Ihis file is the Fortran source file for dynamic.exp.
-+! Original file written by Jakub Jelinek <jakub@redhat.com>.
-+! Modified for the GDB testcase by Jan Kratochvil <jan.kratochvil@redhat.com>.
-+
-+subroutine baz
-+  real, target, allocatable :: varx (:, :, :)
-+  real, pointer :: varv (:, :, :)
-+  real, target :: varu (1, 2, 3)
-+  logical :: l
-+  allocate (varx (1:6, 5:15, 17:28))            ! varx-init
-+  l = allocated (varx)
-+  varx(:, :, :) = 6                             ! varx-allocated
-+  varx(1, 5, 17) = 7
-+  varx(2, 6, 18) = 8
-+  varx(6, 15, 28) = 9
-+  varv => varx                                  ! varx-filled
-+  l = associated (varv)
-+  varv(3, 7, 19) = 10                           ! varv-associated
-+  varv => null ()                               ! varv-filled
-+  l = associated (varv)
-+  deallocate (varx)                             ! varv-deassociated
-+  l = allocated (varx)
-+  varu(:, :, :) = 10                            ! varx-deallocated
-+  allocate (varv (1:6, 5:15, 17:28))
-+  l = associated (varv)
-+  varv(:, :, :) = 6
-+  varv(1, 5, 17) = 7
-+  varv(2, 6, 18) = 8
-+  varv(6, 15, 28) = 9
-+  deallocate (varv)
-+  l = associated (varv)
-+  varv => varu
-+  varv(1, 1, 1) = 6
-+  varv(1, 2, 3) = 7
-+  l = associated (varv)
-+end subroutine baz
-+subroutine foo (vary, varw)
-+  real :: vary (:, :)
-+  real :: varw (:, :, :)
-+  vary(:, :) = 4                                ! vary-passed
-+  vary(1, 1) = 8
-+  vary(2, 2) = 9
-+  vary(1, 3) = 10
-+  varw(:, :, :) = 5                             ! vary-filled
-+  varw(1, 1, 1) = 6
-+  varw(2, 2, 2) = 7                             ! varw-almostfilled
-+end subroutine foo
-+subroutine bar (varz, vart)
-+  real :: varz (*)
-+  real :: vart (2:11, 7:*)
-+  varz(1:3) = 4
-+  varz(2) = 5                                   ! varz-almostfilled
-+  vart(2,7) = vart(2,7)
-+end subroutine bar
-+program test
-+  interface
-+    subroutine foo (vary, varw)
-+    real :: vary (:, :)
-+    real :: varw (:, :, :)
-+    end subroutine
-+  end interface
-+  interface
-+    subroutine bar (varz, vart)
-+    real :: varz (*)
-+    real :: vart (2:11, 7:*)
-+    end subroutine
-+  end interface
-+  real :: x (10, 10), y (5), z(8, 8, 8)
-+  x(:,:) = 1
-+  y(:) = 2
-+  z(:,:,:) = 3
-+  call baz
-+  call foo (x, z(2:6, 4:7, 6:8))
-+  call bar (y, x)
-+  if (x (1, 1) .ne. 8 .or. x (2, 2) .ne. 9 .or. x (1, 2) .ne. 4) call abort
-+  if (x (1, 3) .ne. 10) call abort
-+  if (z (2, 4, 6) .ne. 6 .or. z (3, 5, 7) .ne. 7 .or. z (2, 4, 7) .ne. 5) call abort
-+  if (any (y .ne. (/4, 5, 4, 2, 2/))) call abort
-+  call foo (transpose (x), z)
-+  if (x (1, 1) .ne. 8 .or. x (2, 2) .ne. 9 .or. x (1, 2) .ne. 4) call abort
-+  if (x (3, 1) .ne. 10) call abort
-+end
-diff --git a/gdb/testsuite/gdb.fortran/logical.exp b/gdb/testsuite/gdb.fortran/logical.exp
-new file mode 100644
-index 0000000..ef76f43
---- /dev/null
-+++ b/gdb/testsuite/gdb.fortran/logical.exp
-@@ -0,0 +1,44 @@
-+# Copyright 2007 Free Software Foundation, Inc.
-+
-+# This program is free software; you can redistribute it and/or modify
-+# it under the terms of the GNU General Public License as published by
-+# the Free Software Foundation; either version 2 of the License, or
-+# (at your option) any later version.
-+# 
-+# This program is distributed in the hope that it will be useful,
-+# but WITHOUT ANY WARRANTY; without even the implied warranty of
-+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-+# GNU General Public License for more details.
-+# 
-+# You should have received a copy of the GNU General Public License
-+# along with this program; if not, write to the Free Software
-+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  
-+
-+# This file was written by Jan Kratochvil <jan.kratochvil@redhat.com>.
-+
-+set testfile "logical"
-+set srcfile ${testfile}.f90
-+set binfile ${objdir}/${subdir}/${testfile}
-+
-+if  { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug f77 quiet}] != "" } {
-+    untested "Couldn't compile ${srcfile}"
-+    return -1
-+}
-+
-+gdb_exit
-+gdb_start
-+gdb_reinitialize_dir $srcdir/$subdir
-+gdb_load ${binfile}
-+
-+if ![runto MAIN__] then {
-+    perror "couldn't run to breakpoint MAIN__"
-+    continue
-+}
-+
-+gdb_breakpoint [gdb_get_line_number "stop-here"]
-+gdb_continue_to_breakpoint "stop-here"
-+gdb_test "p l" " = \\.TRUE\\."
-+gdb_test "p l1" " = \\.TRUE\\."
-+gdb_test "p l2" " = \\.TRUE\\."
-+gdb_test "p l4" " = \\.TRUE\\."
-+gdb_test "p l8" " = \\.TRUE\\."
-diff --git a/gdb/testsuite/gdb.fortran/logical.f90 b/gdb/testsuite/gdb.fortran/logical.f90
-new file mode 100644
-index 0000000..4229304
---- /dev/null
-+++ b/gdb/testsuite/gdb.fortran/logical.f90
-@@ -0,0 +1,33 @@
-+! Copyright 2008 Free Software Foundation, Inc.
-+!
-+! This program is free software; you can redistribute it and/or modify
-+! it under the terms of the GNU General Public License as published by
-+! the Free Software Foundation; either version 2 of the License, or
-+! (at your option) any later version.
-+!
-+! This program is distributed in the hope that it will be useful,
-+! but WITHOUT ANY WARRANTY; without even the implied warranty of
-+! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-+! GNU General Public License for more details.
-+!
-+! You should have received a copy of the GNU General Public License
-+! along with this program; if not, write to the Free Software
-+! Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-+!
-+! Ihis file is the Fortran source file for dynamic.exp.
-+! Original file written by Jakub Jelinek <jakub@redhat.com>.
-+! Modified for the GDB testcase by Jan Kratochvil <jan.kratochvil@redhat.com>.
-+
-+program test
-+  logical :: l
-+  logical (kind=1) :: l1
-+  logical (kind=2) :: l2
-+  logical (kind=4) :: l4
-+  logical (kind=8) :: l8
-+  l = .TRUE.
-+  l1 = .TRUE.
-+  l2 = .TRUE.
-+  l4 = .TRUE.
-+  l8 = .TRUE.
-+  l = .FALSE.                                 ! stop-here
-+end
-diff --git a/gdb/testsuite/gdb.fortran/string.exp b/gdb/testsuite/gdb.fortran/string.exp
++class B
++{
++public:
++  int x;
++
++  int
++  func()
++  {
++    x = 33;
++    y+=x; // marker1
++
++      {
++        int x = 44;
++        y+=x; // marker2
++
++          {
++            int x = 55;
++            y+=x; // marker3
++
++              {
++                int z = x; //prevent gcc from optimizing away this scope
++                using namespace A;
++                y+=x; // marker4
++
++                using A::x;
++                y+=x; // marker5
++                
++                return this->x;
++              }
++          }
++      }
++  }
++};
++
++int
++main()
++{
++  B theB;
++  return theB.func();
++}
+diff --git a/gdb/testsuite/gdb.cp/shadowing.exp b/gdb/testsuite/gdb.cp/shadowing.exp
 new file mode 100644
-index 0000000..ab72206
+index 0000000..6922eed
 --- /dev/null
-+++ b/gdb/testsuite/gdb.fortran/string.exp
-@@ -0,0 +1,72 @@
++++ b/gdb/testsuite/gdb.cp/shadowing.exp
+@@ -0,0 +1,91 @@
 +# Copyright 2008 Free Software Foundation, Inc.
 +
 +# This program is free software; you can redistribute it and/or modify
 +# it under the terms of the GNU General Public License as published by
-+# the Free Software Foundation; either version 2 of the License, or
++# 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, write to the Free Software
-+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  
++# along with this program.  If not, see <http://www.gnu.org/licenses/>.
 +
-+# This file was written by Jan Kratochvil <jan.kratochvil@redhat.com>.
++if $tracelevel then {
++    strace $tracelevel
++}
 +
-+# This file is part of the gdb testsuite.  It contains tests for Fortran
-+# strings with dynamic length.
++set prms_id 0
++set bug_id 0
 +
-+set testfile "string"
-+set srcfile ${testfile}.f90
++set testfile shadowing
++set srcfile ${testfile}.cc
 +set binfile ${objdir}/${subdir}/${testfile}
-+
-+if  { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug f77 quiet}] != "" } {
-+    untested "Couldn't compile ${srcfile}"
++if  { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug c++}] != "" } {
++    untested "Couldn't compile test program"
 +    return -1
 +}
 +
++if [get_compiler_info ${binfile}] {
++    return -1;
++}
++
++# Get things started.
++
 +gdb_exit
 +gdb_start
 +gdb_reinitialize_dir $srcdir/$subdir
 +gdb_load ${binfile}
 +
-+if ![runto MAIN__] then {
-+    perror "couldn't run to breakpoint MAIN__"
++if ![runto_main] then {
++    perror "couldn't run to breakpoint main"
 +    continue
 +}
 +
-+gdb_breakpoint [gdb_get_line_number "var-init"]
-+gdb_continue_to_breakpoint "var-init"
-+gdb_test "ptype c" "type = character(\\(kind=1\\)|\\*1)"
-+gdb_test "ptype d" "type = character(\\(kind=8\\)|\\*8)"
-+gdb_test "ptype e" "type = character(\\(kind=4\\)|\\*4)"
-+gdb_test "ptype f" "type = character(\\(kind=4\\)|\\*4) \\(7,8:10\\)"
-+gdb_test "ptype *e" "Attempt to take contents of a non-pointer value."
-+gdb_test "ptype *f" "type = character(\\(kind=4\\)|\\*4) \\(7\\)"
-+gdb_test "p c" "\\$\[0-9\]* = 'c'"
-+gdb_test "p d" "\\$\[0-9\]* = 'd       '"
-+gdb_test "p e" "\\$\[0-9\]* = 'g   '"
-+gdb_test "p f" "\\$\[0-9\]* = \\(\\( 'h   ', 'h   ', 'h   ', 'h   ', 'h   ', 'h   ', 'h   '\\) \\( 'h   ', 'h   ', 'h   ', 'h   ', 'h   ', 'h   ', 'h   '\\) \\( 'h   ', 'h   ', 'h   ', 'h   ', 'h   ', 'h   ', 'h   '\\) \\)"
-+gdb_test "p *e" "Attempt to take contents of a non-pointer value."
-+gdb_test "p *f" "Attempt to take contents of a non-pointer value."
++############################################
++# Test printing of class variable is not shadowed
++# by global variable
 +
-+gdb_breakpoint [gdb_get_line_number "var-finish"]
-+gdb_continue_to_breakpoint "var-finish"
-+gdb_test "p e" "\\$\[0-9\]* = 'e   '" "p e re-set"
-+gdb_test "p f" "\\$\[0-9\]* = \\(\\( 'f   ', 'f   ', 'f   ', 'f   ', 'f   ', 'f   ', 'f   '\\) \\( 'f2  ', 'f   ', 'f   ', 'f   ', 'f   ', 'f   ', 'f   '\\) \\( 'f   ', 'f   ', 'f   ', 'f   ', 'f   ', 'f   ', 'f   '\\) \\)" "p *f re-set"
++gdb_breakpoint [gdb_get_line_number "marker1"]
++gdb_continue_to_breakpoint "marker1"
 +
-+set test "quit #1"
-+gdb_test_multiple "quit" $test {
-+    -re "The program is running.  Quit anyway \\(and kill it\\)\\? \\(y or n\\) " {
-+      pass $test
-+    }
-+}
-+set test "quit #2"
-+gdb_test_multiple "y" $test {
-+    eof {
-+      pass $test
-+    }
-+}
-diff --git a/gdb/testsuite/gdb.fortran/string.f90 b/gdb/testsuite/gdb.fortran/string.f90
-new file mode 100644
-index 0000000..226dc5d
---- /dev/null
-+++ b/gdb/testsuite/gdb.fortran/string.f90
-@@ -0,0 +1,37 @@
-+! Copyright 2008 Free Software Foundation, Inc.
-+!
-+! This program is free software; you can redistribute it and/or modify
-+! it under the terms of the GNU General Public License as published by
-+! the Free Software Foundation; either version 2 of the License, or
-+! (at your option) any later version.
-+!
-+! This program is distributed in the hope that it will be useful,
-+! but WITHOUT ANY WARRANTY; without even the implied warranty of
-+! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-+! GNU General Public License for more details.
-+!
-+! You should have received a copy of the GNU General Public License
-+! along with this program; if not, write to the Free Software
-+! Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-+!
-+! Ihis file is the Fortran source file for dynamic.exp.
-+! Original file written by Jakub Jelinek <jakub@redhat.com>.
-+! Modified for the GDB testcase by Jan Kratochvil <jan.kratochvil@redhat.com>.
++gdb_test "print x" "= 33" "Print class x shadowing global x"
 +
-+subroutine foo (e, f)
-+  character (len=1) :: c
-+  character (len=8) :: d
-+  character (len=*) :: e
-+  character (len=*) :: f (1:7, 8:10)
-+  c = 'c'
-+  d = 'd'
-+  e = 'e'                                       ! var-init
-+  f = 'f'
-+  f(1,9) = 'f2'
-+  c = 'c'                                       ! var-finish
-+end subroutine foo
-+  character (len=4) :: g, h (1:7, 8:10)
-+  g = 'g'
-+  h = 'h'
-+  call foo (g, h)
-+end
-diff --git a/gdb/testsuite/gdb.gdb/selftest.exp b/gdb/testsuite/gdb.gdb/selftest.exp
-index 495ae45..d08d7a4 100644
---- a/gdb/testsuite/gdb.gdb/selftest.exp
-+++ b/gdb/testsuite/gdb.gdb/selftest.exp
-@@ -95,6 +95,10 @@ proc do_steps_and_nexts {} {
-               set description "step over ttyarg initialization"
-               set command "step"
-           }
-+          -re ".*python_script = 0.*$gdb_prompt $" {
-+              set description "step over python_script initialization"
-+              set command "step"
-+          }
-           -re ".*time_at_startup = get_run_time.*$gdb_prompt $" {
-               set description "next over get_run_time and everything it calls"
-               set command "next"
-diff --git a/gdb/testsuite/gdb.opt/array-from-register-func.c b/gdb/testsuite/gdb.opt/array-from-register-func.c
++
++############################################
++# Test printing local variable is not shadowed
++# by class variable
++
++gdb_breakpoint [gdb_get_line_number "marker2"]
++gdb_continue_to_breakpoint "marker2"
++
++gdb_test "print x" "= 44" "Print local x shadowing class x"
++
++############################################
++# Test inner scope x is printed not outer scope
++
++gdb_breakpoint [gdb_get_line_number "marker3"]
++gdb_continue_to_breakpoint "marker3"
++
++gdb_test "print x" "= 55" "Print inner scope x"
++
++############################################
++# Test printing local variable is not shadowed
++# by namespace variable
++
++gdb_breakpoint [gdb_get_line_number "marker4"]
++gdb_continue_to_breakpoint "marker4"
++
++gdb_test "print x" "= 55" "Print local x not namespace x"
++
++############################################
++# Test imported namespace element is printed
++
++gdb_breakpoint [gdb_get_line_number "marker5"]
++gdb_continue_to_breakpoint "marker5"
++
++if [test_compiler_info gcc-4-3-*] then { setup_xfail *-*-* }
++
++gdb_test "print x" "= 11" "Print imported namespace x"
+diff --git a/gdb/testsuite/gdb.dwarf2/dw2-aranges.S b/gdb/testsuite/gdb.dwarf2/dw2-aranges.S
 new file mode 100644
-index 0000000..729f457
+index 0000000..d5b9ca5
 --- /dev/null
-+++ b/gdb/testsuite/gdb.opt/array-from-register-func.c
-@@ -0,0 +1,22 @@
-+/* This file is part of GDB, the GNU debugger.
++++ b/gdb/testsuite/gdb.dwarf2/dw2-aranges.S
+@@ -0,0 +1,140 @@
++/* This testcase is part of GDB, the GNU debugger.
 +
-+   Copyright 2009 Free Software Foundation, Inc.
++   Copyright 2004, 2007, 2008, 2009 Free Software Foundation, Inc.
 +
 +   This program is free software; you can redistribute it and/or modify
 +   it under the terms of the GNU General Public License as published by
@@ -39459,105 +23978,315 @@ index 0000000..729f457
 +   You should have received a copy of the GNU General Public License
 +   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 +
-+int
-+func (int *arr)
-+{
-+  return arr[0];
++/* Test .debug_aranges containing zero address_size.  */
++
++/* Dummy function to provide debug information for.  */
++
++      .text
++.Lbegin_text1:
++      .globl main
++      .type main, %function
++main:
++.Lbegin_main:
++      .int 0
++.Lend_main:
++      .size main, .-main
++.Lend_text1:
++
++/* Debug information */
++
++      .section .debug_info
++.Lcu1_begin:
++      /* CU header */
++      .4byte  .Lcu1_end - .Lcu1_start         /* Length of Compilation Unit */
++.Lcu1_start:
++      .2byte  2                               /* DWARF Version */
++      .4byte  .Labbrev1_begin                 /* Offset into abbrev section */
++      .byte   4                               /* Pointer size */
++
++      /* CU die */
++      .uleb128 1                              /* Abbrev: DW_TAG_compile_unit */
++      .4byte  .Lend_text1                     /* DW_AT_high_pc */
++      .4byte  .Lbegin_text1                   /* DW_AT_low_pc */
++      .ascii  "file1.txt\0"                   /* DW_AT_name */
++      .ascii  "GNU C 3.3.3\0"                 /* DW_AT_producer */
++      .byte   1                               /* DW_AT_language (C) */
++
++      /* main */
++      .uleb128        2                       /* Abbrev: DW_TAG_subprogram */
++      .byte           1                       /* DW_AT_external */
++      .byte           1                       /* DW_AT_decl_file */
++      .byte           2                       /* DW_AT_decl_line */
++      .ascii          "main\0"                /* DW_AT_name */
++      .4byte          .Ltype_int-.Lcu1_begin  /* DW_AT_type */
++      .4byte          .Lbegin_main    /* DW_AT_low_pc */
++      .4byte          .Lend_main              /* DW_AT_high_pc */
++      .byte           1                       /* DW_AT_frame_base: length */
++      .byte           0x55                    /* DW_AT_frame_base: DW_OP_reg5 */
++
++.Ltype_int:
++      .uleb128        3                       /* Abbrev: DW_TAG_base_type */
++      .ascii          "int\0"                 /* DW_AT_name */
++      .byte           4                       /* DW_AT_byte_size */
++      .byte           5                       /* DW_AT_encoding */
++
++      .byte           0                       /* End of children of CU */
++
++.Lcu1_end:
++
++/* Abbrev table */
++      .section .debug_abbrev
++.Labbrev1_begin:
++      .uleb128        1                       /* Abbrev code */
++      .uleb128        0x11                    /* DW_TAG_compile_unit */
++      .byte           1                       /* has_children */
++      .uleb128        0x12                    /* DW_AT_high_pc */
++      .uleb128        0x1                     /* DW_FORM_addr */
++      .uleb128        0x11                    /* DW_AT_low_pc */
++      .uleb128        0x1                     /* DW_FORM_addr */
++      .uleb128        0x3                     /* DW_AT_name */
++      .uleb128        0x8                     /* DW_FORM_string */
++      .uleb128        0x25                    /* DW_AT_producer */
++      .uleb128        0x8                     /* DW_FORM_string */
++      .uleb128        0x13                    /* DW_AT_language */
++      .uleb128        0xb                     /* DW_FORM_data1 */
++      .byte           0x0                     /* Terminator */
++      .byte           0x0                     /* Terminator */
++
++      .uleb128        2                       /* Abbrev code */
++      .uleb128        0x2e                    /* DW_TAG_subprogram */
++      .byte           0                       /* has_children */
++      .uleb128        0x3f                    /* DW_AT_external */
++      .uleb128        0xc                     /* DW_FORM_flag */
++      .uleb128        0x3a                    /* DW_AT_decl_file */
++      .uleb128        0xb                     /* DW_FORM_data1 */
++      .uleb128        0x3b                    /* DW_AT_decl_line */
++      .uleb128        0xb                     /* DW_FORM_data1 */
++      .uleb128        0x3                     /* DW_AT_name */
++      .uleb128        0x8                     /* DW_FORM_string */
++      .uleb128        0x49                    /* DW_AT_type */
++      .uleb128        0x13                    /* DW_FORM_ref4 */
++      .uleb128        0x11                    /* DW_AT_low_pc */
++      .uleb128        0x1                     /* DW_FORM_addr */
++      .uleb128        0x12                    /* DW_AT_high_pc */
++      .uleb128        0x1                     /* DW_FORM_addr */
++      .uleb128        0x40                    /* DW_AT_frame_base */
++      .uleb128        0xa                     /* DW_FORM_block1 */
++      .byte           0x0                     /* Terminator */
++      .byte           0x0                     /* Terminator */
++
++      .uleb128        3                       /* Abbrev code */
++      .uleb128        0x24                    /* DW_TAG_base_type */
++      .byte           0                       /* has_children */
++      .uleb128        0x3                     /* DW_AT_name */
++      .uleb128        0x8                     /* DW_FORM_string */
++      .uleb128        0xb                     /* DW_AT_byte_size */
++      .uleb128        0xb                     /* DW_FORM_data1 */
++      .uleb128        0x3e                    /* DW_AT_encoding */
++      .uleb128        0xb                     /* DW_FORM_data1 */
++      .byte           0x0                     /* Terminator */
++      .byte           0x0                     /* Terminator */
++
++      .byte           0x0                     /* Terminator */
++      .byte           0x0                     /* Terminator */
++
++/* aranges table */
++      .section .debug_aranges
++      .long   .Laranges_end - 1f
++1:
++      .2byte  2                               /* aranges Version */
++      .4byte  .Lcu1_begin - .debug_info       /* Offset into .debug_info section */
++      /* The GDB crasher is this zero value.  */
++      .byte           0                       /* aranges address_size */
++      .byte           0                       /* aranges segment_size */
++
++.Laranges_end:
+diff --git a/gdb/testsuite/gdb.dwarf2/dw2-aranges.exp b/gdb/testsuite/gdb.dwarf2/dw2-aranges.exp
+new file mode 100644
+index 0000000..39632d5
+--- /dev/null
++++ b/gdb/testsuite/gdb.dwarf2/dw2-aranges.exp
+@@ -0,0 +1,40 @@
++# Copyright 2004, 2005, 2007, 2008, 2009 Free Software Foundation, Inc.
++
++# This program is free software; you can redistribute it and/or modify
++# it under the terms of the GNU General Public License as published by
++# the Free Software Foundation; either version 3 of the License, or
++# (at your option) any later version.
++#
++# This program is distributed in the hope that it will be useful,
++# but WITHOUT ANY WARRANTY; without even the implied warranty of
++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++# GNU General Public License for more details.
++#
++# You should have received a copy of the GNU General Public License
++# along with this program.  If not, see <http://www.gnu.org/licenses/>.
++
++# Test .debug_aranges containing zero address_size.
++
++# This test can only be run on targets which support DWARF-2 and use gas.
++# For now pick a sampling of likely targets.
++if {![istarget *-*-linux*]
++    && ![istarget *-*-gnu*]
++    && ![istarget *-*-elf*]
++    && ![istarget *-*-openbsd*]
++    && ![istarget arm-*-eabi*]
++    && ![istarget powerpc-*-eabi*]} {
++    return 0  
 +}
-diff --git a/gdb/testsuite/gdb.opt/array-from-register.c b/gdb/testsuite/gdb.opt/array-from-register.c
++
++set testfile "dw2-aranges"
++set srcfile ${testfile}.S
++set binfile ${objdir}/${subdir}/${testfile}
++
++if  { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {nodebug}] != "" } {
++    return -1
++}
++
++clean_restart $testfile
++
++# Failed gdb_load would abort the testcase execution earlier.
++pass "file loaded"
+diff --git a/gdb/testsuite/gdb.dwarf2/dw2-stripped.c b/gdb/testsuite/gdb.dwarf2/dw2-stripped.c
 new file mode 100644
-index 0000000..3090e7e
+index 0000000..1f02d90
 --- /dev/null
-+++ b/gdb/testsuite/gdb.opt/array-from-register.c
-@@ -0,0 +1,28 @@
-+/* This file is part of GDB, the GNU debugger.
++++ b/gdb/testsuite/gdb.dwarf2/dw2-stripped.c
+@@ -0,0 +1,42 @@
++/* This testcase is part of GDB, the GNU debugger.
 +
-+   Copyright 2009 Free Software Foundation, Inc.
++   Copyright 2004 Free Software Foundation, Inc.
 +
 +   This program is free software; you can redistribute it and/or modify
 +   it under the terms of the GNU General Public License as published by
-+   the Free Software Foundation; either version 3 of the License, or
++   the Free Software Foundation; either version 2 of the License, or
 +   (at your option) any later version.
 +
 +   This program is distributed in the hope that it will be useful,
 +   but WITHOUT ANY WARRANTY; without even the implied warranty of
 +   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 +   GNU General Public License for more details.
-+
++ 
 +   You should have received a copy of the GNU General Public License
-+   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
++   along with this program; if not, write to the Free Software
++   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
++   USA.  */
 +
-+extern int func (int *arr);
 +
-+int
-+main (void)
++/* The function `func1' traced into must have debug info on offset > 0;
++   (DW_UNSND (attr)).  This is the reason of `func0' existence.  */
++
++void
++func0(int a, int b)
 +{
-+  int arr[] = { 42 };
++}
 +
-+  func (arr);
++/* `func1' being traced into must have some arguments to dump.  */
 +
++void
++func1(int a, int b)
++{
++  func0 (a,b);
++}
++
++int
++main(void)
++{
++  func1 (1, 2);
 +  return 0;
 +}
-diff --git a/gdb/testsuite/gdb.opt/array-from-register.exp b/gdb/testsuite/gdb.opt/array-from-register.exp
+diff --git a/gdb/testsuite/gdb.dwarf2/dw2-stripped.exp b/gdb/testsuite/gdb.dwarf2/dw2-stripped.exp
 new file mode 100644
-index 0000000..f2de718
+index 0000000..1c6e84a
 --- /dev/null
-+++ b/gdb/testsuite/gdb.opt/array-from-register.exp
-@@ -0,0 +1,33 @@
-+# Copyright 2009 Free Software Foundation, Inc.
-+#
++++ b/gdb/testsuite/gdb.dwarf2/dw2-stripped.exp
+@@ -0,0 +1,79 @@
++# Copyright 2006 Free Software Foundation, Inc.
++
 +# This program is free software; you can redistribute it and/or modify
 +# it under the terms of the GNU General Public License as published by
 +# the Free Software Foundation; either version 2 of the License, or
 +# (at your option) any later version.
-+#
++# 
 +# This program is distributed in the hope that it will be useful,
 +# but WITHOUT ANY WARRANTY; without even the implied warranty of
 +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 +# GNU General Public License for more details.
-+#
++# 
 +# You should have received a copy of the GNU General Public License
 +# along with this program; if not, write to the Free Software
 +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-+#
-+# This file is part of the gdb testsuite.
 +
-+if { [prepare_for_testing array-from-register.exp "array-from-register"      \
-+                        {array-from-register.c array-from-register-func.c} \
-+                        {debug optimize=-O2}] } {
++# Minimal DWARF-2 unit test
++
++# This test can only be run on targets which support DWARF-2.
++# For now pick a sampling of likely targets.
++if {![istarget *-*-linux*]
++    && ![istarget *-*-gnu*]
++    && ![istarget *-*-elf*]
++    && ![istarget *-*-openbsd*]
++    && ![istarget arm-*-eabi*]
++    && ![istarget powerpc-*-eabi*]} {
++    return 0  
++}
++
++set testfile "dw2-stripped"
++set srcfile ${testfile}.c
++set binfile ${objdir}/${subdir}/${testfile}.x
++
++remote_exec build "rm -f ${binfile}"
++
++# get the value of gcc_compiled
++if [get_compiler_info ${binfile}] {
 +    return -1
 +}
 +
-+if ![runto func] then {
++# This test can only be run on gcc as we use additional_flags=FIXME
++if {$gcc_compiled == 0} {
++    return 0
++}
++
++if  { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug additional_flags=-ggdb3}] != "" } {
 +    return -1
 +}
 +
-+gdb_test "p arr" "\\$\[0-9\]+ = \\(int \\*\\) *0x\[0-9a-f\]+"
++remote_exec build "objcopy -R .debug_loc ${binfile}"
++set strip_output [remote_exec build "objdump -h ${binfile}"]
 +
-+# Seen regression:
-+# Address requested for identifier "arr" which is in register $rdi
-+gdb_test "p arr\[0\]" "\\$\[0-9\]+ = 42"
-diff --git a/gdb/testsuite/gdb.python/Makefile.in b/gdb/testsuite/gdb.python/Makefile.in
-index 79be9e7..c49f713 100644
---- a/gdb/testsuite/gdb.python/Makefile.in
-+++ b/gdb/testsuite/gdb.python/Makefile.in
-@@ -1,7 +1,7 @@
- VPATH = @srcdir@
- srcdir = @srcdir@
--EXECUTABLES = python-value
-+EXECUTABLES = python-value python-prettyprint python-template
- all info install-info dvi install uninstall installcheck check:
-       @echo "Nothing to be done for $@..."
-diff --git a/gdb/testsuite/gdb.python/find.c b/gdb/testsuite/gdb.python/find.c
++set test "stripping test file preservation"
++if [ regexp ".debug_info " $strip_output]  {
++    pass "$test (.debug_info preserved)"
++} else {
++    fail "$test (.debug_info got also stripped)"
++}
++
++set test "stripping test file functionality"
++if [ regexp ".debug_loc " $strip_output]  {
++    fail "$test (.debug_loc still present)"
++} else {
++    pass "$test (.debug_loc stripped)"
++}
++
++gdb_exit
++gdb_start
++gdb_reinitialize_dir $srcdir/$subdir
++gdb_load ${binfile}
++
++# For C programs, "start" should stop in main().
++
++gdb_test "start" \
++         ".*main \\(\\) at .*" \
++         "start"
++gdb_test "step" \
++         "func.* \\(.*\\) at .*" \
++         "step"
+diff --git a/gdb/testsuite/gdb.dwarf2/dw2-struct-member-data-location.S b/gdb/testsuite/gdb.dwarf2/dw2-struct-member-data-location.S
 new file mode 100644
-index 0000000..35ddd8c
+index 0000000..5fcdd84
 --- /dev/null
-+++ b/gdb/testsuite/gdb.python/find.c
-@@ -0,0 +1,64 @@
-+/* Testcase for the search_memory Python function.
-+   This testcase is part of GDB, the GNU debugger.
++++ b/gdb/testsuite/gdb.dwarf2/dw2-struct-member-data-location.S
+@@ -0,0 +1,83 @@
++/* This testcase is part of GDB, the GNU debugger.
 +
 +   Copyright 2009 Free Software Foundation, Inc.
 +
@@ -39572,61 +24301,81 @@ index 0000000..35ddd8c
 +   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/>.
++   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 +
-+   Please email any bugs, comments, and/or additions to this file to:
-+   bug-gdb@gnu.org  */
++/* Debug information */
 +
-+/* Based on the gdb.base/find.c testcase.  */
++      .section .debug_info
++.Lcu1_begin:
++      /* CU header */
++      .4byte  .Lcu1_end - .Lcu1_start         /* Length of Compilation Unit */
++.Lcu1_start:
++      .2byte  2                               /* DWARF Version */
++      .4byte  .Labbrev1_begin                 /* Offset into abbrev section */
++      .byte   4                               /* Pointer size */
 +
-+#include <stdlib.h>
-+#include <stdint.h>
++      /* CU die */
++      .uleb128 1                              /* Abbrev: DW_TAG_compile_unit */
++      .ascii  "dw2-struct-member-data-location.c\0"   /* DW_AT_name */
++      .ascii  "GNU C 4.3.2\0"                 /* DW_AT_producer */
++      .byte   1                               /* DW_AT_language (C) */
 +
-+#define CHUNK_SIZE 16000 /* same as findcmd.c's */
-+#define BUF_SIZE (2 * CHUNK_SIZE) /* at least two chunks */
++.Ltype_uchar:
++      .uleb128        2                       /* Abbrev: DW_TAG_structure_type */
++      .ascii          "some_struct\0"         /* DW_AT_name */
 +
-+static int8_t int8_search_buf[100];
-+static int16_t int16_search_buf[100];
-+static int32_t int32_search_buf[100];
-+static int64_t int64_search_buf[100];
++      .uleb128        3                       /* Abbrev: DW_TAG_member */
++      .ascii          "field\0"               /* DW_AT_name */
++      .byte           0                       /* DW_AT_data_member_location */
 +
-+static char *search_buf;
-+static int search_buf_size;
++      .byte           0                       /* End of children of some_struct */
 +
-+static int x;
++      .byte           0                       /* End of children of CU */
 +
-+static void
-+stop_here ()
-+{
-+  x = 1; // stop here
-+}
++.Lcu1_end:
 +
-+static void
-+init_bufs ()
-+{
-+  search_buf_size = BUF_SIZE;
-+  search_buf = malloc (search_buf_size);
-+  if (search_buf == NULL)
-+    exit (1);
-+  memset (search_buf, 'x', search_buf_size);
-+}
++/* Abbrev table */
++      .section .debug_abbrev
++.Labbrev1_begin:
++      .uleb128        1                       /* Abbrev code */
++      .uleb128        0x11                    /* DW_TAG_compile_unit */
++      .byte           1                       /* has_children */
++      .uleb128        0x3                     /* DW_AT_name */
++      .uleb128        0x8                     /* DW_FORM_string */
++      .uleb128        0x25                    /* DW_AT_producer */
++      .uleb128        0x8                     /* DW_FORM_string */
++      .uleb128        0x13                    /* DW_AT_language */
++      .uleb128        0xb                     /* DW_FORM_data1 */
++      .byte           0x0                     /* Terminator */
++      .byte           0x0                     /* Terminator */
 +
-+int
-+main ()
-+{
-+  init_bufs ();
++      .uleb128        2                       /* Abbrev code */
++      .uleb128        0x13                    /* DW_TAG_structure_type */
++      .byte           1                       /* has_children */
++      .uleb128        0x3                     /* DW_AT_name */
++      .uleb128        0x8                     /* DW_FORM_string */
++      .byte           0x0                     /* Terminator */
++      .byte           0x0                     /* Terminator */
 +
-+  stop_here ();
++      .uleb128        3                       /* Abbrev code */
++      .uleb128        0x0d                    /* DW_TAG_member */
++      .byte           0                       /* has_children */
++      .uleb128        0x3                     /* DW_AT_name */
++      .uleb128        0x8                     /* DW_FORM_string */
++      .uleb128        0x38                    /* DW_AT_data_member_location */
++      .uleb128        0x0b                    /* DW_FORM_data1 */
++      .byte           0x0                     /* Terminator */
++      .byte           0x0                     /* Terminator */
 +
-+  return 0;
-+}
-diff --git a/gdb/testsuite/gdb.python/find.exp b/gdb/testsuite/gdb.python/find.exp
++      .byte           0x0                     /* Terminator */
++      .byte           0x0                     /* Terminator */
+diff --git a/gdb/testsuite/gdb.dwarf2/dw2-struct-member-data-location.exp b/gdb/testsuite/gdb.dwarf2/dw2-struct-member-data-location.exp
 new file mode 100644
-index 0000000..dd9aabc
+index 0000000..c41151c
 --- /dev/null
-+++ b/gdb/testsuite/gdb.python/find.exp
-@@ -0,0 +1,203 @@
-+# Copyright 2008, 2009 Free Software Foundation, Inc.
++++ b/gdb/testsuite/gdb.dwarf2/dw2-struct-member-data-location.exp
+@@ -0,0 +1,37 @@
++# Copyright 2009 Free Software Foundation, Inc.
 +
 +# This program is free software; you can redistribute it and/or modify
 +# it under the terms of the GNU General Public License as published by
@@ -39641,37 +24390,58 @@ index 0000000..dd9aabc
 +# You should have received a copy of the GNU General Public License
 +# along with this program.  If not, see <http://www.gnu.org/licenses/>.
 +
-+# This tests the search_memory Python function.
-+# Based on the gdb.base/find.exp testcase.
-+
-+if $tracelevel then {
-+    strace $tracelevel
++# This test can only be run on targets which support DWARF-2 and use gas.
++# For now pick a sampling of likely targets.
++if {![istarget *-*-linux*]
++    && ![istarget *-*-gnu*]
++    && ![istarget *-*-elf*]
++    && ![istarget *-*-openbsd*]
++    && ![istarget arm-*-eabi*]
++    && ![istarget powerpc-*-eabi*]} {
++    return 0  
 +}
 +
-+# Usage: gdb_py_test_multiple NAME INPUT RESULT {INPUT RESULT}...
-+# Run a test named NAME, consisting of multiple lines of input.
-+# After each input line INPUT, search for result line RESULT.
-+# Succeed if all results are seen; fail otherwise.
-+proc gdb_py_test_multiple {name args} {
-+    global gdb_prompt
-+    foreach {input result} $args {
-+      if {[gdb_test_multiple $input "$name - $input" {
-+          -re "\[\r\n\]*($result)\[\r\n\]+($gdb_prompt | *>)$" {
-+              pass "$name - $input"
-+          }
-+      }]} {
-+          return 1
-+      }
-+    }
-+    return 0
++set testfile "dw2-struct-member-data-location"
++set srcfile ${testfile}.S
++set binfile ${testfile}.x
++
++if  { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${objdir}/${subdir}/${binfile}" object {nodebug}] != "" } {
++    return -1
 +}
 +
-+set testfile "find"
-+set srcfile ${testfile}.c
++clean_restart $binfile
++
++gdb_test "ptype struct some_struct" "type = struct some_struct {\[\r\n \t\]*void field;\[\r\n \t\]*}"
+diff --git a/gdb/testsuite/gdb.fortran/common-block.exp b/gdb/testsuite/gdb.fortran/common-block.exp
+new file mode 100644
+index 0000000..888f6c3
+--- /dev/null
++++ b/gdb/testsuite/gdb.fortran/common-block.exp
+@@ -0,0 +1,101 @@
++# Copyright 2008 Free Software Foundation, Inc.
++
++# This program is free software; you can redistribute it and/or modify
++# it under the terms of the GNU General Public License as published by
++# the Free Software Foundation; either version 2 of the License, or
++# (at your option) any later version.
++# 
++# This program is distributed in the hope that it will be useful,
++# but WITHOUT ANY WARRANTY; without even the implied warranty of
++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++# GNU General Public License for more details.
++# 
++# You should have received a copy of the GNU General Public License
++# along with this program; if not, write to the Free Software
++# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  
++
++# This file was written by Jan Kratochvil <jan.kratochvil@redhat.com>.
++
++set testfile "common-block"
++set srcfile ${testfile}.f90
 +set binfile ${objdir}/${subdir}/${testfile}
 +
-+if  { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug nowarnings}] != "" } {
-+    untested find.exp
++if  { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug f77 quiet}] != "" } {
++    untested "Couldn't compile ${srcfile}"
 +    return -1
 +}
 +
@@ -39680,317 +24450,567 @@ index 0000000..dd9aabc
 +gdb_reinitialize_dir $srcdir/$subdir
 +gdb_load ${binfile}
 +
-+gdb_test_multiple "python print 'hello, world!'" "verify python support" {
-+    -re "not supported.*$gdb_prompt $"        {
-+      unsupported "python support is disabled"
-+      return -1
-+    }
-+    -re "$gdb_prompt $"       {}
-+}
-+
-+gdb_test "break $srcfile:stop_here" \
-+    "Breakpoint.*at.* file .*$srcfile, line.*" \
-+    "breakpoint function in file"
-+
-+gdb_run_cmd
-+gdb_expect {
-+    -re "Breakpoint \[0-9\]+,.*stop_here.* at .*$srcfile:.*$gdb_prompt $" {
-+      pass "run until function breakpoint"
-+    }
-+    -re "$gdb_prompt $" {
-+      fail "run until function breakpoint"
-+    }
-+    timeout {
-+      fail "run until function breakpoint (timeout)"
-+    }
++if ![runto MAIN__] then {
++    perror "couldn't run to breakpoint MAIN__"
++    continue
 +}
 +
-+# We've now got the target program in a state where we can test "find".
-+
-+set hex_number {0x[0-9a-fA-F][0-9a-fA-F]*}
-+set dec_number {[0-9]+}
-+set history_prefix {[$][0-9]* = }
-+set newline {[\r\n]+}
-+set pattern_not_found "${newline}.]"
-+set one_pattern_found "${newline}.${dec_number}L]"
-+set two_patterns_found "${newline}.${dec_number}L, ${dec_number}L]"
++gdb_breakpoint [gdb_get_line_number "stop-here-out"]
++gdb_continue_to_breakpoint "stop-here-out"
 +
-+# Test string pattern.
++# Common block naming with source name /foo/:
++#                .symtab  DW_TAG_common_block's DW_AT_name
++# Intel Fortran  foo_     foo_
++# GNU Fortran    foo_     foo
++#set suffix "_"
++set suffix ""
 +
-+gdb_test "set *(int32_t*) &int8_search_buf\[10\] = 0x61616161" "" ""
-+gdb_test "py search_buf = gdb.selected_frame ().read_var ('int8_search_buf')" "" ""
-+gdb_test "py start_addr = search_buf.address ()" "" ""
-+gdb_test "py length = search_buf.type ().sizeof ()" "" ""
++set int4 {(integer\(kind=4\)|INTEGER\(4\))}
++set real4 {(real\(kind=4\)|REAL\(4\))}
++set real8 {(real\(kind=8\)|REAL\(8\))}
 +
-+gdb_test "py print gdb.search_memory (start_addr, length, 'aaa')" \
-+  "${two_patterns_found}" "find string pattern"
++gdb_test "whatis foo$suffix" "No symbol \"foo$suffix\" in current context."
++gdb_test "ptype foo$suffix" "No symbol \"foo$suffix\" in current context."
++gdb_test "p foo$suffix" "No symbol \"foo$suffix\" in current context."
++gdb_test "whatis fo_o$suffix" "No symbol \"fo_o$suffix\" in current context."
++gdb_test "ptype fo_o$suffix" "No symbol \"fo_o$suffix\" in current context."
++gdb_test "p fo_o$suffix" "No symbol \"fo_o$suffix\" in current context."
 +
-+# Test not finding pattern because search range too small, with
-+# potential find at the edge of the range.
++gdb_test "info locals" "ix_x = 11\r\niy_y = 22\r\niz_z = 33\r\nix = 1\r\niy = 2\r\niz = 3" "info locals out"
++gdb_test "info common" "Contents of F77 COMMON block 'fo_o':\r\nix_x = 11\r\niy_y = 22\r\niz_z = 33\r\n\r\nContents of F77 COMMON block 'foo':\r\nix = 1\r\niy = 2\r\niz = 3" "info common out"
 +
-+gdb_test "py print gdb.search_memory (start_addr, 10+3, 'aaaa')" \
-+  "${pattern_not_found}" "pattern not found at end of range"
++gdb_test "ptype ix" "type = $int4" "ptype ix out"
++gdb_test "ptype iy" "type = $real4" "ptype iy out"
++gdb_test "ptype iz" "type = $real8" "ptype iz out"
++gdb_test "ptype ix_x" "type = $int4" "ptype ix_x out"
++gdb_test "ptype iy_y" "type = $real4" "ptype iy_y out"
++gdb_test "ptype iz_z" "type = $real8" "ptype iz_z out"
 +
-+# Increase the search range by 1 and we should find the pattern.
++gdb_test "p ix" " = 1 *" "p ix out"
++gdb_test "p iy" " = 2 *" "p iy out"
++gdb_test "p iz" " = 3 *" "p iz out"
++gdb_test "p ix_x" " = 11 *" "p ix_x out"
++gdb_test "p iy_y" " = 22 *" "p iy_y out"
++gdb_test "p iz_z" " = 33 *" "p iz_z out"
 +
-+gdb_test "py print gdb.search_memory (start_addr, 10+3+1, \['a', 'a', 'a', 'a'\])" \
-+  "${one_pattern_found}" "pattern found at end of range"
++gdb_breakpoint [gdb_get_line_number "stop-here-in"]
++gdb_continue_to_breakpoint "stop-here-in"
 +
-+# Test max-count with size, with different parameter position
++gdb_test "whatis foo$suffix" "No symbol \"foo$suffix\" in current context." "whatis foo$suffix in"
++gdb_test "ptype foo$suffix" "No symbol \"foo$suffix\" in current context." "ptype foo$suffix in"
++gdb_test "p foo$suffix" "No symbol \"foo$suffix\" in current context." "p foo$suffix in"
++gdb_test "whatis fo_o$suffix" "No symbol \"fo_o$suffix\" in current context." "whatis fo_o$suffix in"
++gdb_test "ptype fo_o$suffix" "No symbol \"fo_o$suffix\" in current context." "ptype fo_o$suffix in"
++gdb_test "p fo_o$suffix" "No symbol \"fo_o$suffix\" in current context." "p fo_o$suffix in"
 +
-+gdb_test "py print gdb.search_memory (start_addr, length, \[0x61, 0x61\], 1, 1)" \
-+  "${one_pattern_found}" "size = 1, max_count = 1"
++gdb_test "info locals" "ix = 11\r\niy2 = 22\r\niz = 33\r\nix_x = 1\r\niy_y = 2\r\niz_z2 = 3\r\niy = 5\r\niz_z = 55" "info locals in"
++gdb_test "info common" "Contents of F77 COMMON block 'fo_o':\r\nix = 11\r\niy2 = 22\r\niz = 33\r\n\r\nContents of F77 COMMON block 'foo':\r\nix_x = 1\r\niy_y = 2\r\niz_z2 = 3" "info common in"
 +
-+gdb_test "py print gdb.search_memory (start_addr, length, \[0x61, 0x61\], 1, 2)" \
-+  "${two_patterns_found}" "size = 1, max_count = 2, normal ordering"
++gdb_test "ptype ix" "type = $int4" "ptype ix in"
++gdb_test "ptype iy2" "type = $real4" "ptype iy2 in"
++gdb_test "ptype iz" "type = $real8" "ptype iz in"
++gdb_test "ptype ix_x" "type = $int4" "ptype ix_x in"
++gdb_test "ptype iy_y" "type = $real4" "ptype iy_y in"
++gdb_test "ptype iz_z2" "type = $real8" "ptype iz_z2 in"
 +
-+gdb_test "py print gdb.search_memory (start_addr, length, \[0x61, 0x61\], size = 1, max_count = 2)" \
-+  "${two_patterns_found}" "size = 1, max_count = 2, normal ordering, with keywords"
++gdb_test "p ix" " = 11 *" "p ix in"
++gdb_test "p iy2" " = 22 *" "p iy2 in"
++gdb_test "p iz" " = 33 *" "p iz in"
++gdb_test "p ix_x" " = 1 *" "p ix_x in"
++gdb_test "p iy_y" " = 2 *" "p iy_y in"
++gdb_test "p iz_z2" " = 3 *" "p iz_z2 in"
+diff --git a/gdb/testsuite/gdb.fortran/common-block.f90 b/gdb/testsuite/gdb.fortran/common-block.f90
+new file mode 100644
+index 0000000..b614e8a
+--- /dev/null
++++ b/gdb/testsuite/gdb.fortran/common-block.f90
+@@ -0,0 +1,67 @@
++! Copyright 2008 Free Software Foundation, Inc.
++!
++! This program is free software; you can redistribute it and/or modify
++! it under the terms of the GNU General Public License as published by
++! the Free Software Foundation; either version 2 of the License, or
++! (at your option) any later version.
++!
++! This program is distributed in the hope that it will be useful,
++! but WITHOUT ANY WARRANTY; without even the implied warranty of
++! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++! GNU General Public License for more details.
++!
++! You should have received a copy of the GNU General Public License
++! along with this program; if not, write to the Free Software
++! Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
++!
++! Ihis file is the Fortran source file for dynamic.exp.
++! Original file written by Jakub Jelinek <jakub@redhat.com>.
++! Modified for the GDB testcase by Jan Kratochvil <jan.kratochvil@redhat.com>.
 +
-+gdb_test "py print gdb.search_memory (start_addr, length, \[0x61, 0x61\], max_count = 2, size = 1)" \
-+  "${two_patterns_found}" "size = 1, max_count = 2, inverted ordering"
++subroutine in
 +
-+gdb_test "py print gdb.search_memory (start_addr, length, \['a', 'a'\], max_count = 2)" \
-+  "${two_patterns_found}" "max_count = 2, with keyword"
++   INTEGER*4            ix
++   REAL*4               iy2
++   REAL*8               iz
 +
-+# Test 16-bit pattern.
++   INTEGER*4            ix_x
++   REAL*4               iy_y
++   REAL*8               iz_z2
 +
-+gdb_test "set int16_search_buf\[10\] = 0x1234" "" ""
-+gdb_test "py search_buf = gdb.selected_frame ().read_var ('int16_search_buf')" "" ""
-+gdb_test "py start_addr = search_buf.address ()" "" ""
-+gdb_test "py length = search_buf.type ().sizeof ()" "" ""
-+gdb_test "py pattern = gdb.parse_and_eval ('(int16_t) 0x1234')" "" ""
++   common /fo_o/ix,iy2,iz
++   common /foo/ix_x,iy_y,iz_z2
 +
-+gdb_test "py print gdb.search_memory (start_addr, length, 0x1234, 2)" \
-+  "${one_pattern_found}" "find 16-bit pattern, with python pattern"
++   iy = 5
++   iz_z = 55
 +
-+gdb_test "py print gdb.search_memory (start_addr, length, pattern)" \
-+  "${one_pattern_found}" "find 16-bit pattern, with value pattern"
++   if (ix .ne. 11 .or. iy2 .ne. 22.0 .or. iz .ne. 33.0) call abort
++   if (ix_x .ne. 1 .or. iy_y .ne. 2.0 .or. iz_z2 .ne. 3.0) call abort
 +
-+# Test 32-bit pattern.
++   ix = 0                                     ! stop-here-in
 +
-+gdb_test "set int32_search_buf\[10\] = 0x12345678" "" ""
-+gdb_test "py search_buf = gdb.selected_frame ().read_var ('int32_search_buf')" "" ""
-+gdb_test "py start_addr = search_buf.address ()" "" ""
-+gdb_test "py length = search_buf.type ().sizeof ()" "" ""
-+gdb_test "py pattern = gdb.parse_and_eval ('(int32_t) 0x12345678')" "" ""
++end subroutine in
 +
-+gdb_test "py print gdb.search_memory (start_addr, length, 0x12345678, 4)" \
-+  "${one_pattern_found}" "find 32-bit pattern, with python pattern"
-+gdb_test "py print gdb.search_memory (start_addr, length, pattern)" \
-+  "${one_pattern_found}" "find 32-bit pattern, with value pattern"
++program common_test
 +
-+# Test 64-bit pattern.
++   INTEGER*4            ix
++   REAL*4               iy
++   REAL*8               iz
 +
-+gdb_test "set int64_search_buf\[10\] = 0xfedcba9876543210LL" "" ""
-+gdb_test "py search_buf = gdb.selected_frame ().read_var ('int64_search_buf')" "" ""
-+gdb_test "py start_addr = search_buf.address ()" "" ""
-+gdb_test "py length = search_buf.type ().sizeof ()" "" ""
-+gdb_test "py pattern = gdb.parse_and_eval ('(int64_t) 0xfedcba9876543210LL')" "" ""
++   INTEGER*4            ix_x
++   REAL*4               iy_y
++   REAL*8               iz_z
 +
-+gdb_test "py print gdb.search_memory (start_addr, length, 0xfedcba9876543210, 8)" \
-+  "${one_pattern_found}" "find 64-bit pattern, with python pattern"
-+gdb_test "py print gdb.search_memory (start_addr, length, pattern)" \
-+  "${one_pattern_found}" "find 64-bit pattern, with value pattern"
++   common /foo/ix,iy,iz
++   common /fo_o/ix_x,iy_y,iz_z
 +
-+# Test mixed-sized patterns.
++   ix = 1
++   iy = 2.0
++   iz = 3.0
 +
-+gdb_test "set *(int8_t*) &search_buf\[10\] = 0x62" "" ""
-+gdb_test "set *(int16_t*) &search_buf\[11\] = 0x6363" "" ""
-+gdb_test "set *(int32_t*) &search_buf\[13\] = 0x64646464" "" ""
-+gdb_test "py search_buf = gdb.selected_frame ().read_var ('search_buf')" "" ""
-+gdb_test "py start_addr = search_buf\[0\].address ()" "" ""
-+gdb_test "py pattern1 = gdb.parse_and_eval ('(int8_t) 0x62')" "" ""
-+gdb_test "py pattern2 = gdb.parse_and_eval ('(int16_t) 0x6363')" "" ""
-+gdb_test "py pattern3 = gdb.parse_and_eval ('(int32_t) 0x64646464')" "" ""
++   ix_x = 11
++   iy_y = 22.0
++   iz_z = 33.0
 +
-+gdb_test "py print gdb.search_memory (start_addr, 100, \[pattern1, pattern2, pattern3\])" \
-+    "${one_pattern_found}" "find mixed-sized pattern"
++   call in                                    ! stop-here-out
 +
-+# Test search spanning a large range, in the particular case of native
-+# targets, test the search spanning multiple chunks.
-+# Remote targets may implement the search differently.
++end program common_test
+diff --git a/gdb/testsuite/gdb.fortran/dwarf-stride.exp b/gdb/testsuite/gdb.fortran/dwarf-stride.exp
+new file mode 100644
+index 0000000..cd3486b
+--- /dev/null
++++ b/gdb/testsuite/gdb.fortran/dwarf-stride.exp
+@@ -0,0 +1,42 @@
++# Copyright 2009 Free Software Foundation, Inc.
 +
-+set CHUNK_SIZE 16000 ;
++# This program is free software; you can redistribute it and/or modify
++# it under the terms of the GNU General Public License as published by
++# the Free Software Foundation; either version 2 of the License, or
++# (at your option) any later version.
++# 
++# This program is distributed in the hope that it will be useful,
++# but WITHOUT ANY WARRANTY; without even the implied warranty of
++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++# GNU General Public License for more details.
++# 
++# You should have received a copy of the GNU General Public License
++# along with this program; if not, write to the Free Software
++# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  
 +
-+gdb_test "set *(int32_t*) &search_buf\[0*${CHUNK_SIZE}+100\] = 0x12345678" "" ""
-+gdb_test "set *(int32_t*) &search_buf\[1*${CHUNK_SIZE}+100\] = 0x12345678" "" ""
-+gdb_test "py start_addr = gdb.selected_frame ().read_var ('search_buf')" "" ""
-+gdb_test "py length = gdb.selected_frame ().read_var ('search_buf_size')" "" ""
++# This file was written by Jan Kratochvil <jan.kratochvil@redhat.com>.
 +
-+gdb_test "py print gdb.search_memory (start_addr, length, 0x12345678, 4)" \
-+  "${two_patterns_found}" "search spanning large range"
++# This file is part of the gdb testsuite.  Array element stride must not be
++# specified in the number of elements but in a number of bytes instead.
++# Original problem:
++# (gdb) p c40pt(1)
++# $1 = '0-hello', ' ' <repeats 33 times>
++# (gdb) p c40pt(2)
++# warning: Fortran array stride not divisible by the element size
 +
-+# For native targets, test a pattern straddling a chunk boundary.
++set testfile dwarf-stride
++set srcfile ${testfile}.f90
 +
-+if [isnative] {
-+    gdb_test "set *(int32_t*) &search_buf\[${CHUNK_SIZE}-1\] = 0xfdb97531" "" ""
++if { [prepare_for_testing ${testfile}.exp ${testfile} ${srcfile} {debug f77}] } {
++    return -1
++}
 +
-+    gdb_test "py print gdb.search_memory (start_addr, length, 0xfdb97531, 4)" \
-+      "${one_pattern_found}" "find pattern straddling chunk boundary"
++if ![runto MAIN__] then {
++    perror "couldn't run to breakpoint MAIN__"
++    continue
 +}
-diff --git a/gdb/testsuite/gdb.python/python-cmd.exp b/gdb/testsuite/gdb.python/python-cmd.exp
-index 6c73ff2..f6ef938 100644
---- a/gdb/testsuite/gdb.python/python-cmd.exp
-+++ b/gdb/testsuite/gdb.python/python-cmd.exp
-@@ -92,6 +92,32 @@ gdb_py_test_multiple "input subcommand" \
- gdb_test "prefix_cmd subcmd ugh" "subcmd output, arg = ugh" "call subcmd"
-+# Test prefix command using keyword arguments.
 +
-+gdb_py_test_multiple "input prefix command, keyword arguments" \
-+  "python" "" \
-+  "class prefix_cmd2 (gdb.Command):" "" \
-+  "  def __init__ (self):" "" \
-+  "    super (prefix_cmd2, self).__init__ (\"prefix_cmd2\", gdb.COMMAND_OBSCURE, prefix = True, completer_class = gdb.COMPLETE_FILENAME)" "" \
-+  "  def invoke (self, arg, from_tty):" "" \
-+  "    print \"prefix_cmd2 output, arg = %s\" % arg" "" \
-+  "prefix_cmd2 ()" "" \
-+  "end" ""
++gdb_breakpoint [gdb_get_line_number "break-here"]
++gdb_continue_to_breakpoint "break-here" ".*break-here.*"
++gdb_test "p c40pt(1)" " = '0-hello.*"
++gdb_test "p c40pt(2)" " = '1-hello.*"
+diff --git a/gdb/testsuite/gdb.fortran/dwarf-stride.f90 b/gdb/testsuite/gdb.fortran/dwarf-stride.f90
+new file mode 100644
+index 0000000..e492b3a
+--- /dev/null
++++ b/gdb/testsuite/gdb.fortran/dwarf-stride.f90
+@@ -0,0 +1,40 @@
++! Copyright 2009 Free Software Foundation, Inc.
++!
++! This program is free software; you can redistribute it and/or modify
++! it under the terms of the GNU General Public License as published by
++! the Free Software Foundation; either version 2 of the License, or
++! (at your option) any later version.
++!
++! This program is distributed in the hope that it will be useful,
++! but WITHOUT ANY WARRANTY; without even the implied warranty of
++! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++! GNU General Public License for more details.
++!
++! You should have received a copy of the GNU General Public License
++! along with this program; if not, write to the Free Software
++! Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
++!
++! File written by Alan Matsuoka.
++
++program repro
 +
-+gdb_test "prefix_cmd2 argh" "prefix_cmd2 output, arg = argh" "call prefix command, keyword arguments"
++  type small_stride
++     character*40 long_string
++     integer      small_pad
++  end type small_stride
 +
-+gdb_py_test_multiple "input subcommand under prefix_cmd2" \
-+  "python" "" \
-+  "class subcmd (gdb.Command):" "" \
-+  "  def __init__ (self):" "" \
-+  "    super (subcmd, self).__init__ (\"prefix_cmd2 subcmd\", gdb.COMMAND_OBSCURE)" "" \
-+  "  def invoke (self, arg, from_tty):" "" \
-+  "    print \"subcmd output, arg = %s\" % arg" "" \
-+  "subcmd ()" "" \
-+  "end" ""
++  type(small_stride), dimension (20), target :: unpleasant
++  character*40, pointer, dimension(:):: c40pt
 +
-+gdb_test "prefix_cmd2 subcmd ugh" "subcmd output, arg = ugh" "call subcmd under prefix_cmd2"
++  integer i
 +
- # Test a subcommand in an existing GDB prefix.
- gdb_py_test_multiple "input new subcommand" \
-diff --git a/gdb/testsuite/gdb.python/python-frame.c b/gdb/testsuite/gdb.python/python-frame.c
-new file mode 100644
-index 0000000..22eb9f2
---- /dev/null
-+++ b/gdb/testsuite/gdb.python/python-frame.c
-@@ -0,0 +1,14 @@
-+int f2 (int a)
-+{
-+  return ++a;
-+}
++  do i = 0,19
++     unpleasant(i+1)%small_pad = i+1
++     unpleasant(i+1)%long_string = char (ichar('0') + i) // '-hello'
++  end do
 +
-+int f1 (int a, int b)
-+{
-+  return f2(a) + b;
-+}
++  c40pt => unpleasant%long_string
 +
-+int main (int argc, char *argv[])
-+{
-+  return f1 (1, 2);
-+}
-diff --git a/gdb/testsuite/gdb.python/python-frame.exp b/gdb/testsuite/gdb.python/python-frame.exp
++  print *, c40pt  ! break-here
++
++end program repro
+diff --git a/gdb/testsuite/gdb.fortran/dynamic.exp b/gdb/testsuite/gdb.fortran/dynamic.exp
 new file mode 100644
-index 0000000..674c25e
+index 0000000..0ccebe0
 --- /dev/null
-+++ b/gdb/testsuite/gdb.python/python-frame.exp
-@@ -0,0 +1,92 @@
-+# Copyright (C) 2009 Free Software Foundation, Inc.
++++ b/gdb/testsuite/gdb.fortran/dynamic.exp
+@@ -0,0 +1,145 @@
++# Copyright 2007 Free Software Foundation, Inc.
 +
 +# This program is free software; you can redistribute it and/or modify
 +# it under the terms of the GNU General Public License as published by
-+# the Free Software Foundation; either version 3 of the License, or
++# the Free Software Foundation; either version 2 of the License, or
 +# (at your option) any later version.
-+#
++# 
 +# This program is distributed in the hope that it will be useful,
 +# but WITHOUT ANY WARRANTY; without even the implied warranty of
 +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 +# GNU General Public License for more details.
-+#
++# 
 +# You should have received a copy of the GNU General Public License
-+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
++# along with this program; if not, write to the Free Software
++# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  
 +
-+# This file is part of the GDB testsuite.  It tests the mechanism
-+# exposing values to Python.
++# This file was written by Jan Kratochvil <jan.kratochvil@redhat.com>.
 +
-+if $tracelevel then {
-+    strace $tracelevel
-+}
++# This file is part of the gdb testsuite.  It contains tests for dynamically
++# allocated Fortran arrays.
++# It depends on the GCC dynamic Fortran arrays DWARF support:
++#     http://gcc.gnu.org/bugzilla/show_bug.cgi?id=22244
 +
-+set testfile "python-frame"
-+set srcfile ${testfile}.c
++set testfile "dynamic"
++set srcfile ${testfile}.f90
 +set binfile ${objdir}/${subdir}/${testfile}
-+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
++
++if  { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug f77 quiet}] != "" } {
 +    untested "Couldn't compile ${srcfile}"
 +    return -1
 +}
 +
-+# Run a command in GDB, and report a failure if a Python exception is thrown.
-+# If report_pass is true, report a pass if no exception is thrown.
-+proc gdb_py_test_silent_cmd {cmd name report_pass} {
-+  global gdb_prompt
++gdb_exit
++gdb_start
++gdb_reinitialize_dir $srcdir/$subdir
++gdb_load ${binfile}
 +
-+  gdb_test_multiple $cmd $name {
-+      -re "Traceback.*$gdb_prompt $"  { fail $name }
-+      -re "$gdb_prompt $"           { if $report_pass { pass $name } }
-+  }
++if ![runto MAIN__] then {
++    perror "couldn't run to breakpoint MAIN__"
++    continue
 +}
 +
-+# Start with a fresh gdb.
++gdb_breakpoint [gdb_get_line_number "varx-init"]
++gdb_continue_to_breakpoint "varx-init"
++gdb_test "p varx" "\\$\[0-9\]* = <(object|the array) is not allocated>" "p varx unallocated"
++gdb_test "ptype varx" "type = <(object|the array) is not allocated>" "ptype varx unallocated"
++gdb_test "p varx(1,5,17)" "(Cannot access it|Unable to access the object) because the (object|array) is not allocated\\." "p varx(1,5,17) unallocated"
++gdb_test "p varx(1,5,17)=1" "(Cannot access it|Unable to access the object) because the (object|array) is not allocated\\." "p varx(1,5,17)=1 unallocated"
++gdb_test "ptype varx(1,5,17)" "(Cannot access it|Unable to access the object) because the (object|array) is not allocated\\." "ptype varx(1,5,17) unallocated"
++
++gdb_breakpoint [gdb_get_line_number "varx-allocated"]
++gdb_continue_to_breakpoint "varx-allocated"
++# $1 = (( ( 0, 0, 0, 0, 0, 0) ( 0, 0, 0, 0, 0, 0) --- , 0) ) ( ( 0, 0, ...) ...) ...)
++gdb_test "ptype varx" "type = real(\\(kind=4\\)|\\*4) \\(6,5:15,17:28\\)" "ptype varx allocated"
++# Intel Fortran Compiler 10.1.008 uses -1 there, GCC uses 1.
++gdb_test "p l" "\\$\[0-9\]* = (\\.TRUE\\.|4294967295)" "p l if varx allocated"
++
++gdb_breakpoint [gdb_get_line_number "varx-filled"]
++gdb_continue_to_breakpoint "varx-filled"
++gdb_test "p varx(2, 5, 17)" "\\$\[0-9\]* = 6"
++gdb_test "p varx(1, 5, 17)" "\\$\[0-9\]* = 7"
++gdb_test "p varx(2, 6, 18)" "\\$\[0-9\]* = 8"
++gdb_test "p varx(6, 15, 28)" "\\$\[0-9\]* = 9"
++# The latter one is for the Intel Fortran Compiler 10.1.008 pointer type.
++gdb_test "p varv" "\\$\[0-9\]* = (<(object|the array) is not associated>|.*(Cannot access it|Unable to access the object) because the object is not associated.)" "p varv unassociated"
++gdb_test "ptype varv" "type = (<(object|the array) is not associated>|.*(Cannot access it|Unable to access the object) because the object is not associated.)" "ptype varv unassociated"
++
++gdb_breakpoint [gdb_get_line_number "varv-associated"]
++gdb_continue_to_breakpoint "varv-associated"
++gdb_test "p varx(3, 7, 19)" "\\$\[0-9\]* = 6" "p varx(3, 7, 19) with varv associated"
++gdb_test "p varv(3, 7, 19)" "\\$\[0-9\]* = 6" "p varv(3, 7, 19) associated"
++# Intel Fortran Compiler 10.1.008 uses -1 there, GCC uses 1.
++gdb_test "p l" "\\$\[0-9\]* = (\\.TRUE\\.|4294967295)" "p l if varv associated"
++gdb_test "ptype varx" "type = real(\\(kind=4\\)|\\*4) \\(6,5:15,17:28\\)" "ptype varx with varv associated"
++# Intel Fortran Compiler 10.1.008 uses the pointer type.
++gdb_test "ptype varv" "type = (PTR TO -> \\( )?real(\\(kind=4\\)|\\*4) \\(6,5:15,17:28\\)\\)?" "ptype varv associated"
 +
-+gdb_exit
-+gdb_start
-+gdb_reinitialize_dir $srcdir/$subdir
-+gdb_load ${binfile}
++gdb_breakpoint [gdb_get_line_number "varv-filled"]
++gdb_continue_to_breakpoint "varv-filled"
++gdb_test "p varx(3, 7, 19)" "\\$\[0-9\]* = 10" "p varx(3, 7, 19) with varv filled"
++gdb_test "p varv(3, 7, 19)" "\\$\[0-9\]* = 10" "p varv(3, 7, 19) filled"
 +
-+gdb_test_multiple "python print 'hello, world!'" "verify python support" {
-+    -re "not supported.*$gdb_prompt $"        {
-+      unsupported "python support is disabled"
-+      return -1
-+    }
-+    -re "$gdb_prompt $"       {}
-+}
++gdb_breakpoint [gdb_get_line_number "varv-deassociated"]
++gdb_continue_to_breakpoint "varv-deassociated"
++# The latter one is for the Intel Fortran Compiler 10.1.008 pointer type.
++gdb_test "p varv" "\\$\[0-9\]* = (<(object|the array) is not associated>|.*(Cannot access it|Unable to access the object) because the object is not associated.)" "p varv deassociated"
++gdb_test "ptype varv" "type = (<(object|the array) is not associated>|.*(Cannot access it|Unable to access the object) because the object is not associated.)" "ptype varv deassociated"
++gdb_test "p l" "\\$\[0-9\]* = \\.FALSE\\." "p l if varv deassociated"
++gdb_test "p varv(1,5,17)" "(Cannot access it|Unable to access the object) because the (object|array) is not associated\\."
++gdb_test "ptype varv(1,5,17)" "(Cannot access it|Unable to access the object) because the (object|array) is not associated\\."
 +
-+# The following tests require execution.
++gdb_breakpoint [gdb_get_line_number "varx-deallocated"]
++gdb_continue_to_breakpoint "varx-deallocated"
++gdb_test "p varx" "\\$\[0-9\]* = <(object|the array) is not allocated>" "p varx deallocated"
++gdb_test "ptype varx" "type = <(object|the array) is not allocated>" "ptype varx deallocated"
++gdb_test "p l" "\\$\[0-9\]* = \\.FALSE\\." "p l if varx deallocated"
++gdb_test "p varx(1,5,17)" "(Cannot access it|Unable to access the object) because the (object|array) is not allocated\\." "p varx(1,5,17) deallocated"
++gdb_test "ptype varx(1,5,17)" "(Cannot access it|Unable to access the object) because the (object|array) is not allocated\\." "ptype varx(1,5,17) deallocated"
 +
-+if ![runto_main] then {
-+    fail "Can't run to main"
-+    return 0
-+}
++gdb_breakpoint [gdb_get_line_number "vary-passed"]
++gdb_continue_to_breakpoint "vary-passed"
++# $1 = (( ( 1, 1, 1, 1, 1, 1) ( 1, 1, 1, 1, 1, 1) --- , 1) ) ( ( 1, 1, ...) ...) ...)
++gdb_test "p vary" "\\$\[0-9\]* = \\(\[()1, .\]*\\)"
 +
-+gdb_breakpoint "f2"
-+gdb_continue_to_breakpoint "breakpoint at f2"
-+gdb_test "up" "" ""
++gdb_breakpoint [gdb_get_line_number "vary-filled"]
++gdb_continue_to_breakpoint "vary-filled"
++gdb_test "ptype vary" "type = real(\\(kind=4\\)|\\*4) \\(10,10\\)"
++gdb_test "p vary(1, 1)" "\\$\[0-9\]* = 8"
++gdb_test "p vary(2, 2)" "\\$\[0-9\]* = 9"
++gdb_test "p vary(1, 3)" "\\$\[0-9\]* = 10"
++# $1 = (( ( 3, 3, 3, 3, 3, 3) ( 3, 3, 3, 3, 3, 3) --- , 3) ) ( ( 3, 3, ...) ...) ...)
++gdb_test "p varw" "\\$\[0-9\]* = \\(\[()3, .\]*\\)"
 +
-+gdb_py_test_silent_cmd "python frames = gdb.frames ()" "get frames list" 1
-+gdb_test "python print frames" "\\(<gdb.Frame object at 0x\[\[:xdigit:\]\]+>, <gdb.Frame object at 0x\[\[:xdigit:\]\]+>, <gdb.Frame object at 0x\[\[:xdigit:\]\]+>\\)" "verify frames list"
-+gdb_py_test_silent_cmd "python f0 = frames\[0\]" "get first frame" 0
-+gdb_py_test_silent_cmd "python f1 = frames\[1\]" "get second frame" 0
++gdb_breakpoint [gdb_get_line_number "varw-almostfilled"]
++gdb_continue_to_breakpoint "varw-almostfilled"
++gdb_test "ptype varw" "type = real(\\(kind=4\\)|\\*4) \\(5,4,3\\)"
++gdb_test "p varw(3,1,1)=1" "\\$\[0-9\]* = 1"
++# $1 = (( ( 6, 5, 1, 5, 5, 5) ( 5, 5, 5, 5, 5, 5) --- , 5) ) ( ( 5, 5, ...) ...) ...)
++gdb_test "p varw" "\\$\[0-9\]* = \\( *\\( *\\( *6, *5, *1,\[()5, .\]*\\)" "p varw filled"
++# "up" works with GCC but other Fortran compilers may copy the values into the
++# outer function only on the exit of the inner function.
++# We need both variants as depending on the arch we optionally may still be
++# executing the caller line or not after `finish'.
++gdb_test "finish" ".*(call bar \\(y, x\\)|call foo \\(x, z\\(2:6, 4:7, 6:8\\)\\))"
++gdb_test "p z(2,4,5)" "\\$\[0-9\]* = 3"
++gdb_test "p z(2,4,6)" "\\$\[0-9\]* = 6"
++gdb_test "p z(2,4,7)" "\\$\[0-9\]* = 5"
++gdb_test "p z(4,4,6)" "\\$\[0-9\]* = 1"
 +
-+gdb_test "python print 'result =', f0.equals (f1)" " = False" "test equals (false)"
-+gdb_test "python print 'result =', f0.equals (f0)" " = True" "test equals (true)"
-+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"
-+gdb_test "python print 'result =', f0.unwind_stop_reason () == gdb.FRAME_UNWIND_NO_REASON" " = True" "test Frame.type"
-+gdb_test "python print 'result =', gdb.frame_stop_reason_string (gdb.FRAME_UNWIND_INNER_ID)" " = previous frame inner to this frame \\(corrupt stack\\?\\)" "test gdb.frame_stop_reason_string"
-+gdb_test "python print 'result =', f0.pc ()" " = \[0-9\]+" "test Frame.pc"
-+gdb_test "python print 'result =', f0.addr_in_block ()" " = \[0-9\]+" "test Frame.addr_in_block"
-+gdb_test "python print 'result =', f0.older ().equals (f1)" " = True" "test Frame.older"
-+gdb_test "python print 'result =', f1.newer ().equals (f0)" " = True" "test Frame.newer"
-+gdb_test "python print 'result =', f0.read_var ('variable_which_surely_doesnt_exist')" \
-+  "ValueError: variable 'variable_which_surely_doesnt_exist' not found.*Error while executing Python code." \
-+  "test Frame.read_var - error"
-+gdb_test "python print 'result =', f0.read_var ('a')" " = 1" "test Frame.read_var - success"
-+
-+gdb_test "python print 'result =', gdb.newest_frame ().equals (f0)" " = True" "test gdb.newest_frame"
-+gdb_test "python print 'result =', gdb.selected_frame ().equals (f1)" " = True" "test gdb.selected_frame"
++gdb_breakpoint [gdb_get_line_number "varz-almostfilled"]
++gdb_continue_to_breakpoint "varz-almostfilled"
++# GCC uses the pointer type here, Intel Fortran Compiler 10.1.008 does not.
++gdb_test "ptype varz" "type = (PTR TO -> \\( )?real(\\(kind=4\\)|\\*4) \\(\\*\\)\\)?"
++# Intel Fortran Compiler 10.1.008 has a bug here - (2:11,7:7)
++# as it produces DW_AT_lower_bound == DW_AT_upper_bound == 7.
++gdb_test "ptype vart" "type = (PTR TO -> \\( )?real(\\(kind=4\\)|\\*4) \\(2:11,7:\\*\\)\\)?"
++gdb_test "p varz" "\\$\[0-9\]* = \\(\\)"
++gdb_test "p vart" "\\$\[0-9\]* = \\(\\)"
++gdb_test "p varz(3)" "\\$\[0-9\]* = 4"
++# maps to foo::vary(1,1)
++gdb_test "p vart(2,7)" "\\$\[0-9\]* = 8"
++# maps to foo::vary(2,2)
++gdb_test "p vart(3,8)" "\\$\[0-9\]* = 9"
++# maps to foo::vary(1,3)
++gdb_test "p vart(2,9)" "\\$\[0-9\]* = 10"
+diff --git a/gdb/testsuite/gdb.fortran/dynamic.f90 b/gdb/testsuite/gdb.fortran/dynamic.f90
+new file mode 100644
+index 0000000..0f43564
+--- /dev/null
++++ b/gdb/testsuite/gdb.fortran/dynamic.f90
+@@ -0,0 +1,98 @@
++! Copyright 2007 Free Software Foundation, Inc.
++!
++! This program is free software; you can redistribute it and/or modify
++! it under the terms of the GNU General Public License as published by
++! the Free Software Foundation; either version 2 of the License, or
++! (at your option) any later version.
++!
++! This program is distributed in the hope that it will be useful,
++! but WITHOUT ANY WARRANTY; without even the implied warranty of
++! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++! GNU General Public License for more details.
++!
++! You should have received a copy of the GNU General Public License
++! along with this program; if not, write to the Free Software
++! Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
++!
++! Ihis file is the Fortran source file for dynamic.exp.
++! Original file written by Jakub Jelinek <jakub@redhat.com>.
++! Modified for the GDB testcase by Jan Kratochvil <jan.kratochvil@redhat.com>.
 +
-+gdb_test "python print 'result =', f0.block ()" "<gdb.Block object at 0x\[\[:xdigit:\]\]+>" "test Frame.block"
-diff --git a/gdb/testsuite/gdb.python/python-function.exp b/gdb/testsuite/gdb.python/python-function.exp
++subroutine baz
++  real, target, allocatable :: varx (:, :, :)
++  real, pointer :: varv (:, :, :)
++  real, target :: varu (1, 2, 3)
++  logical :: l
++  allocate (varx (1:6, 5:15, 17:28))            ! varx-init
++  l = allocated (varx)
++  varx(:, :, :) = 6                             ! varx-allocated
++  varx(1, 5, 17) = 7
++  varx(2, 6, 18) = 8
++  varx(6, 15, 28) = 9
++  varv => varx                                  ! varx-filled
++  l = associated (varv)
++  varv(3, 7, 19) = 10                           ! varv-associated
++  varv => null ()                               ! varv-filled
++  l = associated (varv)
++  deallocate (varx)                             ! varv-deassociated
++  l = allocated (varx)
++  varu(:, :, :) = 10                            ! varx-deallocated
++  allocate (varv (1:6, 5:15, 17:28))
++  l = associated (varv)
++  varv(:, :, :) = 6
++  varv(1, 5, 17) = 7
++  varv(2, 6, 18) = 8
++  varv(6, 15, 28) = 9
++  deallocate (varv)
++  l = associated (varv)
++  varv => varu
++  varv(1, 1, 1) = 6
++  varv(1, 2, 3) = 7
++  l = associated (varv)
++end subroutine baz
++subroutine foo (vary, varw)
++  real :: vary (:, :)
++  real :: varw (:, :, :)
++  vary(:, :) = 4                                ! vary-passed
++  vary(1, 1) = 8
++  vary(2, 2) = 9
++  vary(1, 3) = 10
++  varw(:, :, :) = 5                             ! vary-filled
++  varw(1, 1, 1) = 6
++  varw(2, 2, 2) = 7                             ! varw-almostfilled
++end subroutine foo
++subroutine bar (varz, vart)
++  real :: varz (*)
++  real :: vart (2:11, 7:*)
++  varz(1:3) = 4
++  varz(2) = 5                                   ! varz-almostfilled
++  vart(2,7) = vart(2,7)
++end subroutine bar
++program test
++  interface
++    subroutine foo (vary, varw)
++    real :: vary (:, :)
++    real :: varw (:, :, :)
++    end subroutine
++  end interface
++  interface
++    subroutine bar (varz, vart)
++    real :: varz (*)
++    real :: vart (2:11, 7:*)
++    end subroutine
++  end interface
++  real :: x (10, 10), y (5), z(8, 8, 8)
++  x(:,:) = 1
++  y(:) = 2
++  z(:,:,:) = 3
++  call baz
++  call foo (x, z(2:6, 4:7, 6:8))
++  call bar (y, x)
++  if (x (1, 1) .ne. 8 .or. x (2, 2) .ne. 9 .or. x (1, 2) .ne. 4) call abort
++  if (x (1, 3) .ne. 10) call abort
++  if (z (2, 4, 6) .ne. 6 .or. z (3, 5, 7) .ne. 7 .or. z (2, 4, 7) .ne. 5) call abort
++  if (any (y .ne. (/4, 5, 4, 2, 2/))) call abort
++  call foo (transpose (x), z)
++  if (x (1, 1) .ne. 8 .or. x (2, 2) .ne. 9 .or. x (1, 2) .ne. 4) call abort
++  if (x (3, 1) .ne. 10) call abort
++end
+diff --git a/gdb/testsuite/gdb.fortran/library-module-lib.f90 b/gdb/testsuite/gdb.fortran/library-module-lib.f90
 new file mode 100644
-index 0000000..7feca2b
+index 0000000..6369d34
 --- /dev/null
-+++ b/gdb/testsuite/gdb.python/python-function.exp
-@@ -0,0 +1,79 @@
-+# Copyright (C) 2009 Free Software Foundation, Inc.
++++ b/gdb/testsuite/gdb.fortran/library-module-lib.f90
+@@ -0,0 +1,28 @@
++! Copyright 2009 Free Software Foundation, Inc.
++! 
++! This program is free software; you can redistribute it and/or modify
++! it under the terms of the GNU General Public License as published by
++! the Free Software Foundation; either version 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/>.
++
++module lib
++        integer :: var_i = 1
++contains
++        subroutine lib_func
++        if (var_i .ne. 1) call abort
++        var_i = 2
++        end subroutine lib_func
++end module lib
++
++module libmany
++        integer :: var_j = 3
++        integer :: var_k = 4
++end module libmany
+diff --git a/gdb/testsuite/gdb.fortran/library-module-main.f90 b/gdb/testsuite/gdb.fortran/library-module-main.f90
+new file mode 100644
+index 0000000..de63a65
+--- /dev/null
++++ b/gdb/testsuite/gdb.fortran/library-module-main.f90
+@@ -0,0 +1,23 @@
++! Copyright 2009 Free Software Foundation, Inc.
++! 
++! This program is free software; you can redistribute it and/or modify
++! it under the terms of the GNU General Public License as published by
++! the Free Software Foundation; either version 3 of the License, or
++! (at your option) any later version.
++! 
++! This program is distributed in the hope that it will be useful,
++! but WITHOUT ANY WARRANTY; without even the implied warranty of
++! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++! GNU General Public License for more details.
++! 
++! You should have received a copy of the GNU General Public License
++! along with this program.  If not, see <http://www.gnu.org/licenses/>.
++
++        use lib
++      use libmany, only: var_j
++        if (var_i .ne. 1) call abort
++      call lib_func
++        if (var_i .ne. 2) call abort
++        if (var_j .ne. 3) call abort
++        var_i = var_i                 ! i-is-2
++end
+diff --git a/gdb/testsuite/gdb.fortran/library-module.exp b/gdb/testsuite/gdb.fortran/library-module.exp
+new file mode 100644
+index 0000000..4b4ea4c
+--- /dev/null
++++ b/gdb/testsuite/gdb.fortran/library-module.exp
+@@ -0,0 +1,53 @@
++# Copyright 2009 Free Software Foundation, Inc.
 +
 +# This program is free software; you can redistribute it and/or modify
 +# it under the terms of the GNU General Public License as published by
@@ -40005,372 +25025,355 @@ index 0000000..7feca2b
 +# You should have received a copy of the GNU General Public License
 +# along with this program.  If not, see <http://www.gnu.org/licenses/>.
 +
-+# This file is part of the GDB testsuite.  It tests the mechanism
-+# exposing convenience functions to Python.
++set testfile "library-module"
++set srcfile ${testfile}-main.f90
++set srclibfile ${testfile}-lib.f90
++set libfile ${testfile}-lib.so
++set binfile ${testfile}
 +
-+if $tracelevel then {
-+    strace $tracelevel
++# Required for -fPIC by gdb_compile_shlib.
++if [get_compiler_info not-used] {
++   warning "Could not get compiler info"
++   return -1
 +}
 +
-+# Usage: gdb_py_test_multiple NAME INPUT RESULT {INPUT RESULT}...
-+# Run a test named NAME, consisting of multiple lines of input.
-+# After each input line INPUT, search for result line RESULT.
-+# Succeed if all results are seen; fail otherwise.
-+proc gdb_py_test_multiple {name args} {
-+    global gdb_prompt
-+    foreach {input result} $args {
-+      if {[gdb_test_multiple $input "$name - $input" {
-+          -re "\[\r\n\]*($result)\[\r\n\]+($gdb_prompt | *>)$" {
-+              pass "$name - $input"
-+          }
-+      }]} {
-+          return 1
-+      }
-+    }
-+    return 0
++if  { [gdb_compile_shlib "${srcdir}/${subdir}/${srclibfile}" $objdir/$subdir/$libfile {debug f77}] != "" } {
++    untested "Couldn't compile ${srclibfile}"
++    return -1
 +}
 +
-+# Start with a fresh gdb.
++# prepare_for_testing cannot be used as linking with $libfile cannot be passed
++# just for the linking phase (and not the source compilation phase).  And any
++# warnings on ignored $libfile abort the process.
 +
-+gdb_exit
-+gdb_start
-+gdb_reinitialize_dir $srcdir/$subdir
++if  { [gdb_compile [list $srcdir/$subdir/$srcfile $objdir/$subdir/$libfile] $objdir/$subdir/$binfile executable {debug f77}] != "" } {
++    untested "Couldn't compile ${srcfile}"
++    return -1
++}
 +
-+gdb_test_multiple "python print 'hello, world!'" "verify python support" {
-+    -re "not supported.*$gdb_prompt $"        {
-+      unsupported "python support is disabled"
-+      return -1
-+    }
-+    -re "$gdb_prompt $"       {}
-+}
-+
-+gdb_py_test_multiple "input convenience function" \
-+  "python" "" \
-+  "class test_func (gdb.Function):" "" \
-+  "  def __init__ (self):" "" \
-+  "    super (test_func, self).__init__ (\"test_func\")" "" \
-+  "  def invoke (self, arg):" "" \
-+  "    return \"test_func output, arg = %s\" % arg.string ()" "" \
-+  "test_func ()" "" \
-+  "end" ""
-+
-+gdb_test "print \$test_func (\"ugh\")" "= \"test_func output, arg = ugh\"" "call function"
-+
-+# Test returning a gdb.Value from the function. This segfaulted GDB at one point.
-+
-+gdb_py_test_multiple "input value-returning convenience function" \
-+  "python" "" \
-+  "class Double (gdb.Function):" "" \
-+  "  def __init__ (self):" "" \
-+  "    super (Double, self).__init__ (\"double\")" "" \
-+  "  def invoke (self, n):" "" \
-+  "    return n*2" "" \
-+  "Double ()" "" \
-+  "end" ""
-+
-+gdb_test "print \$double (1)" "= 2" "call value-returning function"
-diff --git a/gdb/testsuite/gdb.python/python-mi.exp b/gdb/testsuite/gdb.python/python-mi.exp
++clean_restart $binfile
++
++if ![runto MAIN__] then {
++    perror "couldn't run to breakpoint MAIN__"
++    continue
++}
++
++gdb_breakpoint [gdb_get_line_number "i-is-2"]
++gdb_continue_to_breakpoint "i-is-2" ".*i-is-2.*"
++gdb_test "print var_i" " = 2"
++gdb_test "print var_j" " = 3"
++gdb_test "print var_k" "No symbol \"var_k\" in current context\\."
+diff --git a/gdb/testsuite/gdb.fortran/logical.exp b/gdb/testsuite/gdb.fortran/logical.exp
 new file mode 100644
-index 0000000..5c9f3c7
+index 0000000..ef76f43
 --- /dev/null
-+++ b/gdb/testsuite/gdb.python/python-mi.exp
-@@ -0,0 +1,124 @@
-+# Copyright (C) 2008 Free Software Foundation, Inc.
++++ b/gdb/testsuite/gdb.fortran/logical.exp
+@@ -0,0 +1,44 @@
++# Copyright 2007 Free Software Foundation, Inc.
 +
 +# This program is free software; you can redistribute it and/or modify
 +# it under the terms of the GNU General Public License as published by
-+# the Free Software Foundation; either version 3 of the License, or
++# the Free Software Foundation; either version 2 of the License, or
 +# (at your option) any later version.
-+#
++# 
 +# This program is distributed in the hope that it will be useful,
 +# but WITHOUT ANY WARRANTY; without even the implied warranty of
 +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 +# GNU General Public License for more details.
-+#
++# 
 +# You should have received a copy of the GNU General Public License
-+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
-+
-+# This file is part of the GDB testsuite.  It tests Python-based
-+# pretty-printing for MI.
-+
-+load_lib mi-support.exp
-+set MIFLAGS "-i=mi2"
++# along with this program; if not, write to the Free Software
++# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  
 +
-+gdb_exit
-+if [mi_gdb_start] {
-+    continue
-+}
++# This file was written by Jan Kratochvil <jan.kratochvil@redhat.com>.
 +
-+set testfile "python-prettyprint"
-+set srcfile ${testfile}.c
++set testfile "logical"
++set srcfile ${testfile}.f90
 +set binfile ${objdir}/${subdir}/${testfile}
-+if  { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug additional_flags=-DMI}] != "" } {
-+    untested mi2-var-child.exp
-+    return -1
-+}
 +
-+mi_delete_breakpoints
-+mi_gdb_reinitialize_dir $srcdir/$subdir
-+mi_gdb_load ${binfile}
-+
-+if {[lsearch -exact [mi_get_features] python] < 0} {
-+    unsupported "python support is disabled"
++if  { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug f77 quiet}] != "" } {
++    untested "Couldn't compile ${srcfile}"
 +    return -1
 +}
 +
-+mi_runto main
-+
-+mi_gdb_test "python execfile ('${srcdir}/${subdir}/${testfile}.py')" ""
-+
-+mi_continue_to_line [gdb_get_line_number {MI breakpoint here} ${testfile}.c] \
-+  "step to breakpoint"
-+
-+mi_create_floating_varobj container c "create container varobj"
-+
-+mi_list_varobj_children container {
-+} "examine container children=0"
-+
-+mi_next "next over update 1"
-+
-+mi_varobj_update_dynamic container {
-+    { {container.\[0\]} {\[0\]} 0 int }
-+} "varobj update 1"
-+
-+mi_next "next over update 2"
-+
-+mi_varobj_update_dynamic container {
-+    { {container.\[0\]} {\[0\]} 0 int }
-+    { {container.\[1\]} {\[1\]} 0 int }
-+} "varobj update 2"
-+
-+mi_gdb_test "-var-set-visualizer container None" \
-+  "\\^done" \
-+  "clear visualizer"
-+
-+mi_gdb_test "-var-update container" \
-+  "\\^done,changelist=\\\[\\\]" \
-+  "varobj update after clearing"
-+
-+mi_gdb_test "-var-set-visualizer container gdb.default_visualizer" \
-+  "\\^done" \
-+  "choose default visualizer"
-+
-+mi_varobj_update_dynamic container {
-+    { {container.\[0\]} {\[0\]} 0 int }
-+    { {container.\[1\]} {\[1\]} 0 int }
-+} "varobj update after choosing default"
-+
-+mi_gdb_test "-var-set-visualizer container ContainerPrinter" \
-+  "\\^done" \
-+  "choose visualizer using expression"
-+
-+mi_varobj_update_dynamic container {
-+    { {container.\[0\]} {\[0\]} 0 int }
-+    { {container.\[1\]} {\[1\]} 0 int }
-+} "varobj update after choosing via expression"
-+
-+mi_gdb_test "-var-set-child-range container 1 2" \
-+  "\\^done" \
-+  "select child range"
-+
-+mi_gdb_test "-var-update container" \
-+  "\\^done,changelist=\\\[\\\]" \
-+  "varobj update after selecting child range"
-+
-+mi_list_varobj_children_range container 2 {
-+    { {container.\[1\]} {\[1\]} 0 int }
-+} "list varobj children after selecting child range"
-+
-+mi_gdb_test "-var-set-child-range container -1 -1" \
-+  "\\^done" \
-+  "reset child range"
-+
-+mi_gdb_test "-var-update container" \
-+  "\\^done,changelist=\\\[\\\]" \
-+  "varobj update after resetting child range"
-+
-+mi_list_varobj_children container {
-+    { {container.\[0\]} {\[0\]} 0 int }
-+    { {container.\[1\]} {\[1\]} 0 int }
-+} "list varobj children after resetting child range"
++gdb_exit
++gdb_start
++gdb_reinitialize_dir $srcdir/$subdir
++gdb_load ${binfile}
 +
-+mi_continue_to_line \
-+    [gdb_get_line_number {Another MI breakpoint} ${testfile}.c] \
-+    "step to second breakpoint"
++if ![runto MAIN__] then {
++    perror "couldn't run to breakpoint MAIN__"
++    continue
++}
 +
-+mi_varobj_update_with_type_change container int 0 "update after type change"
-diff --git a/gdb/testsuite/gdb.python/python-prettyprint.c b/gdb/testsuite/gdb.python/python-prettyprint.c
++gdb_breakpoint [gdb_get_line_number "stop-here"]
++gdb_continue_to_breakpoint "stop-here"
++gdb_test "p l" " = \\.TRUE\\."
++gdb_test "p l1" " = \\.TRUE\\."
++gdb_test "p l2" " = \\.TRUE\\."
++gdb_test "p l4" " = \\.TRUE\\."
++gdb_test "p l8" " = \\.TRUE\\."
+diff --git a/gdb/testsuite/gdb.fortran/logical.f90 b/gdb/testsuite/gdb.fortran/logical.f90
 new file mode 100644
-index 0000000..f8c2435
+index 0000000..4229304
 --- /dev/null
-+++ b/gdb/testsuite/gdb.python/python-prettyprint.c
-@@ -0,0 +1,159 @@
-+/* This testcase is part of GDB, the GNU debugger.
-+
-+   Copyright 2008 Free Software Foundation, Inc.
-+
-+   This program is free software; you can redistribute it and/or modify
-+   it under the terms of the GNU General Public License as published by
-+   the Free Software Foundation; either version 3 of the License, or
-+   (at your option) any later version.
-+
-+   This program is distributed in the hope that it will be useful,
-+   but WITHOUT ANY WARRANTY; without even the implied warranty of
-+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-+   GNU General Public License for more details.
-+
-+   You should have received a copy of the GNU General Public License
-+   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
-+
-+struct s
-+{
-+  int a;
-+  int *b;
-+};
-+
-+struct ss
-+{
-+  struct s a;
-+  struct s b;
-+};
-+
-+#ifdef __cplusplus
-+struct S : public s {
-+  int zs;
-+};
-+
-+struct SS {
-+  int zss;
-+  S s;
-+};
-+
-+struct SSS
-+{
-+  SSS (int x, const S& r);
-+  int a;
-+  const S &b;
-+};
-+SSS::SSS (int x, const S& r) : a(x), b(r) { }
-+#endif
-+
-+typedef struct string_repr
-+{
-+  struct whybother
-+  {
-+    const char *contents;
-+  } whybother;
-+} string;
-+
-+/* This lets us avoid malloc.  */
-+int array[100];
-+
-+struct container
-+{
-+  string name;
-+  int len;
-+  int *elements;
-+};
-+
-+typedef struct container zzz_type;
-+
-+string
-+make_string (const char *s)
-+{
-+  string result;
-+  result.whybother.contents = s;
-+  return result;
-+}
++++ b/gdb/testsuite/gdb.fortran/logical.f90
+@@ -0,0 +1,33 @@
++! Copyright 2008 Free Software Foundation, Inc.
++!
++! This program is free software; you can redistribute it and/or modify
++! it under the terms of the GNU General Public License as published by
++! the Free Software Foundation; either version 2 of the License, or
++! (at your option) any later version.
++!
++! This program is distributed in the hope that it will be useful,
++! but WITHOUT ANY WARRANTY; without even the implied warranty of
++! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++! GNU General Public License for more details.
++!
++! You should have received a copy of the GNU General Public License
++! along with this program; if not, write to the Free Software
++! Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
++!
++! Ihis file is the Fortran source file for dynamic.exp.
++! Original file written by Jakub Jelinek <jakub@redhat.com>.
++! Modified for the GDB testcase by Jan Kratochvil <jan.kratochvil@redhat.com>.
 +
-+zzz_type
-+make_container (const char *s)
-+{
-+  zzz_type result;
++program test
++  logical :: l
++  logical (kind=1) :: l1
++  logical (kind=2) :: l2
++  logical (kind=4) :: l4
++  logical (kind=8) :: l8
++  l = .TRUE.
++  l1 = .TRUE.
++  l2 = .TRUE.
++  l4 = .TRUE.
++  l8 = .TRUE.
++  l = .FALSE.                                 ! stop-here
++end
+diff --git a/gdb/testsuite/gdb.fortran/module.exp b/gdb/testsuite/gdb.fortran/module.exp
+index 342ccee..c836c3c 100644
+--- a/gdb/testsuite/gdb.fortran/module.exp
++++ b/gdb/testsuite/gdb.fortran/module.exp
+@@ -15,21 +15,31 @@
+ set testfile "module"
+ set srcfile ${testfile}.f90
+-set binfile ${objdir}/${subdir}/${testfile}
+-if  { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug f77 quiet}] != "" } {
+-    untested "Couldn't compile ${srcfile}"
++if { [prepare_for_testing $testfile.exp $testfile $srcfile {debug f77}] } {
+     return -1
+ }
+-gdb_exit
+-gdb_start
+-gdb_reinitialize_dir $srcdir/$subdir
+-gdb_load ${binfile}
+-
+ if ![runto MAIN__] then {
+     perror "couldn't run to breakpoint MAIN__"
+     continue
+ }
+-gdb_test "print i" " = 42"
++# Do not use simple single-letter names as GDB would pick up for expectedly
++# nonexisting symbols some static variables from system libraries debuginfos.
++
++gdb_breakpoint [gdb_get_line_number "i-is-1"]
++gdb_continue_to_breakpoint "i-is-1" ".*i-is-1.*"
++gdb_test "print var_i" " = 1" "print var_i value 1"
++
++gdb_breakpoint [gdb_get_line_number "i-is-2"]
++gdb_continue_to_breakpoint "i-is-2" ".*i-is-2.*"
++gdb_test "print var_i" " = 2" "print var_i value 2"
++
++gdb_breakpoint [gdb_get_line_number "a-b-c-d"]
++gdb_continue_to_breakpoint "a-b-c-d" ".*a-b-c-d.*"
++gdb_test "print var_a" "No symbol \"var_a\" in current context\\."
++gdb_test "print var_b" " = 11"
++gdb_test "print var_c" "No symbol \"var_c\" in current context\\."
++gdb_test "print var_d" " = 12"
++gdb_test "print var_i" " = 14" "print var_i value 14"
+diff --git a/gdb/testsuite/gdb.fortran/module.f90 b/gdb/testsuite/gdb.fortran/module.f90
+index 501ccc8..118931d 100644
+--- a/gdb/testsuite/gdb.fortran/module.f90
++++ b/gdb/testsuite/gdb.fortran/module.f90
+@@ -13,10 +13,37 @@
+ ! You should have received a copy of the GNU General Public License
+ ! along with this program.  If not, see <http://www.gnu.org/licenses/>.
+-module mod
+-        integer :: i = 42
+-end module mod
++module mod1
++        integer :: var_i = 1
++end module mod1
+-        use mod
+-        print *, i
++module mod2
++        integer :: var_i = 2
++end module mod2
++
++module modmany
++        integer :: var_a = 10, var_b = 11, var_c = 12, var_i = 14
++end module modmany
++
++        subroutine sub1
++        use mod1
++        if (var_i .ne. 1) call abort
++        var_i = var_i                         ! i-is-1
++        end
++
++        subroutine sub2
++        use mod2
++        if (var_i .ne. 2) call abort
++        var_i = var_i                         ! i-is-2
++        end
++
++        use modmany, only: var_b, var_d => var_c, var_i
++
++        call sub1
++        call sub2
++
++        if (var_b .ne. 11) call abort
++        if (var_d .ne. 12) call abort
++        if (var_i .ne. 14) call abort
++        var_b = var_b                         ! a-b-c-d
+ end
+diff --git a/gdb/testsuite/gdb.fortran/string.exp b/gdb/testsuite/gdb.fortran/string.exp
+new file mode 100644
+index 0000000..b1120c3
+--- /dev/null
++++ b/gdb/testsuite/gdb.fortran/string.exp
+@@ -0,0 +1,59 @@
++# Copyright 2008 Free Software Foundation, Inc.
 +
-+  result.name = make_string (s);
-+  result.len = 0;
-+  result.elements = 0;
++# This program is free software; you can redistribute it and/or modify
++# it under the terms of the GNU General Public License as published by
++# the Free Software Foundation; either version 2 of the License, or
++# (at your option) any later version.
++# 
++# This program is distributed in the hope that it will be useful,
++# but WITHOUT ANY WARRANTY; without even the implied warranty of
++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++# GNU General Public License for more details.
++# 
++# You should have received a copy of the GNU General Public License
++# along with this program; if not, write to the Free Software
++# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  
 +
-+  return result;
-+}
++# This file was written by Jan Kratochvil <jan.kratochvil@redhat.com>.
 +
-+void
-+add_item (zzz_type *c, int val)
-+{
-+  if (c->len == 0)
-+    c->elements = array;
-+  c->elements[c->len] = val;
-+  ++c->len;
-+}
++# This file is part of the gdb testsuite.  It contains tests for Fortran
++# strings with dynamic length.
 +
-+void init_s(struct s *s, int a)
-+{
-+  s->a = a;
-+  s->b = &s->a;
-+}
++set testfile "string"
++set srcfile ${testfile}.f90
++set binfile ${objdir}/${subdir}/${testfile}
 +
-+void init_ss(struct ss *s, int a, int b)
-+{
-+  init_s(&s->a, a);
-+  init_s(&s->b, b);
++if  { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug f77 quiet}] != "" } {
++    untested "Couldn't compile ${srcfile}"
++    return -1
 +}
 +
-+void do_nothing(void)
-+{
-+  int c;
++gdb_exit
++gdb_start
++gdb_reinitialize_dir $srcdir/$subdir
++gdb_load ${binfile}
 +
-+  c = 23;                     /* Another MI breakpoint */
++if ![runto MAIN__] then {
++    perror "couldn't run to breakpoint MAIN__"
++    continue
 +}
 +
-+int
-+main ()
-+{
-+  struct ss  ss;
-+  struct ss  ssa[2];
-+  string x = make_string ("this is x");
-+  zzz_type c = make_container ("container");
-+  const struct string_repr cstring = { { "const string" } };
-+
-+  init_ss(&ss, 1, 2);
-+  init_ss(ssa+0, 3, 4);
-+  init_ss(ssa+1, 5, 6);
-+
-+#ifdef __cplusplus
-+  S cps;
-+
-+  cps.zs = 7;
-+  init_s(&cps, 8);
-+
-+  SS cpss;
-+  cpss.zss = 9;
-+  init_s(&cpss.s, 10);
-+
-+  SS cpssa[2];
-+  cpssa[0].zss = 11;
-+  init_s(&cpssa[0].s, 12);
-+  cpssa[1].zss = 13;
-+  init_s(&cpssa[1].s, 14);
-+
-+  SSS sss(15, cps);
-+
-+  SSS& ref (sss);
-+#endif
-+
-+  add_item (&c, 23);          /* MI breakpoint here */
-+  add_item (&c, 72);
++gdb_breakpoint [gdb_get_line_number "var-init"]
++gdb_continue_to_breakpoint "var-init"
++gdb_test "ptype c" "type = character(\\(kind=1\\)|\\*1)"
++gdb_test "ptype d" "type = character(\\(kind=8\\)|\\*8)"
++gdb_test "ptype e" "type = character(\\(kind=4\\)|\\*4)"
++gdb_test "ptype f" "type = character(\\(kind=4\\)|\\*4) \\(7,8:10\\)"
++gdb_test "ptype *e" "Attempt to take contents of a non-pointer value."
++gdb_test "ptype *f" "type = character(\\(kind=4\\)|\\*4) \\(7\\)"
++gdb_test "p c" "\\$\[0-9\]* = 'c'"
++gdb_test "p d" "\\$\[0-9\]* = 'd       '"
++gdb_test "p e" "\\$\[0-9\]* = 'g   '"
++gdb_test "p f" "\\$\[0-9\]* = \\(\\( 'h   ', 'h   ', 'h   ', 'h   ', 'h   ', 'h   ', 'h   '\\) \\( 'h   ', 'h   ', 'h   ', 'h   ', 'h   ', 'h   ', 'h   '\\) \\( 'h   ', 'h   ', 'h   ', 'h   ', 'h   ', 'h   ', 'h   '\\) \\)"
++gdb_test "p *e" "Attempt to take contents of a non-pointer value."
++gdb_test "p *f" "Attempt to take contents of a non-pointer value."
 +
-+#ifdef MI
-+  do_nothing ();
-+#endif
++gdb_breakpoint [gdb_get_line_number "var-finish"]
++gdb_continue_to_breakpoint "var-finish"
++gdb_test "p e" "\\$\[0-9\]* = 'e   '" "p e re-set"
++gdb_test "p f" "\\$\[0-9\]* = \\(\\( 'f   ', 'f   ', 'f   ', 'f   ', 'f   ', 'f   ', 'f   '\\) \\( 'f2  ', 'f   ', 'f   ', 'f   ', 'f   ', 'f   ', 'f   '\\) \\( 'f   ', 'f   ', 'f   ', 'f   ', 'f   ', 'f   ', 'f   '\\) \\)" "p *f re-set"
+diff --git a/gdb/testsuite/gdb.fortran/string.f90 b/gdb/testsuite/gdb.fortran/string.f90
+new file mode 100644
+index 0000000..226dc5d
+--- /dev/null
++++ b/gdb/testsuite/gdb.fortran/string.f90
+@@ -0,0 +1,37 @@
++! Copyright 2008 Free Software Foundation, Inc.
++!
++! This program is free software; you can redistribute it and/or modify
++! it under the terms of the GNU General Public License as published by
++! the Free Software Foundation; either version 2 of the License, or
++! (at your option) any later version.
++!
++! This program is distributed in the hope that it will be useful,
++! but WITHOUT ANY WARRANTY; without even the implied warranty of
++! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++! GNU General Public License for more details.
++!
++! You should have received a copy of the GNU General Public License
++! along with this program; if not, write to the Free Software
++! Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
++!
++! Ihis file is the Fortran source file for dynamic.exp.
++! Original file written by Jakub Jelinek <jakub@redhat.com>.
++! Modified for the GDB testcase by Jan Kratochvil <jan.kratochvil@redhat.com>.
 +
-+  return 0;      /* break to inspect struct and union */
-+}
-diff --git a/gdb/testsuite/gdb.python/python-prettyprint.exp b/gdb/testsuite/gdb.python/python-prettyprint.exp
++subroutine foo (e, f)
++  character (len=1) :: c
++  character (len=8) :: d
++  character (len=*) :: e
++  character (len=*) :: f (1:7, 8:10)
++  c = 'c'
++  d = 'd'
++  e = 'e'                                       ! var-init
++  f = 'f'
++  f(1,9) = 'f2'
++  c = 'c'                                       ! var-finish
++end subroutine foo
++  character (len=4) :: g, h (1:7, 8:10)
++  g = 'g'
++  h = 'h'
++  call foo (g, h)
++end
+diff --git a/gdb/testsuite/gdb.gdb/selftest.exp b/gdb/testsuite/gdb.gdb/selftest.exp
+index 495ae45..d08d7a4 100644
+--- a/gdb/testsuite/gdb.gdb/selftest.exp
++++ b/gdb/testsuite/gdb.gdb/selftest.exp
+@@ -95,6 +95,10 @@ proc do_steps_and_nexts {} {
+               set description "step over ttyarg initialization"
+               set command "step"
+           }
++          -re ".*python_script = 0.*$gdb_prompt $" {
++              set description "step over python_script initialization"
++              set command "step"
++          }
+           -re ".*time_at_startup = get_run_time.*$gdb_prompt $" {
+               set description "next over get_run_time and everything it calls"
+               set command "next"
+diff --git a/gdb/testsuite/gdb.java/jnpe.exp b/gdb/testsuite/gdb.java/jnpe.exp
 new file mode 100644
-index 0000000..b2ccb2b
+index 0000000..74d4d58
 --- /dev/null
-+++ b/gdb/testsuite/gdb.python/python-prettyprint.exp
-@@ -0,0 +1,90 @@
-+# Copyright (C) 2008 Free Software Foundation, Inc.
++++ b/gdb/testsuite/gdb.java/jnpe.exp
+@@ -0,0 +1,72 @@
++# Copyright 2009 Free Software Foundation, Inc.
 +
 +# This program is free software; you can redistribute it and/or modify
 +# it under the terms of the GNU General Public License as published by
@@ -40385,230 +25388,144 @@ index 0000000..b2ccb2b
 +# You should have received a copy of the GNU General Public License
 +# along with this program.  If not, see <http://www.gnu.org/licenses/>.
 +
-+# This file is part of the GDB testsuite.  It tests Python-based
-+# pretty-printing for the CLI.
-+
 +if $tracelevel then {
-+    strace $tracelevel
++  strace $tracelevel
 +}
 +
-+set testfile "python-prettyprint"
-+set srcfile ${testfile}.c
++load_lib "java.exp"
++
++set testfile "jnpe"
++set srcfile ${srcdir}/$subdir/${testfile}.java
 +set binfile ${objdir}/${subdir}/${testfile}
++if  { [compile_java_from_source ${srcfile} ${binfile} "-g"] != "" } {
++    untested "Couldn't compile ${srcfile}"
++    return -1
++}
++
++set prms_id 0
++set bug_id 0
 +
 +# Start with a fresh gdb.
++
 +gdb_exit
 +gdb_start
-+gdb_test_multiple "python print 'hello, world!'" "verify python support" {
-+    -re "not supported.*$gdb_prompt $"        {
-+      unsupported "python support is disabled"
-+      return -1
-+    }
-+    -re "$gdb_prompt $"       {}
-+}
-+
-+proc run_lang_tests {lang} {
-+    global srcdir subdir srcfile binfile testfile hex
-+    if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable "debug $lang"] != "" } {
-+      untested "Couldn't compile ${srcfile} in $lang mode"
-+      return -1
-+    }
-+
-+    set nl "\[\r\n\]+"
++gdb_reinitialize_dir $srcdir/$subdir
++gdb_load ${binfile}
 +
-+    # Start with a fresh gdb.
-+    gdb_exit
-+    gdb_start
-+    gdb_reinitialize_dir $srcdir/$subdir
-+    gdb_load ${binfile}
++set line [gdb_get_line_number "break here" $testfile.java]
++gdb_test "break $testfile.java:$line" ""
 +
++gdb_test "run" \
++  "Current language.*java" \
++  "run java next-over-throw"
 +
-+    if ![runto_main ] then {
-+      perror "couldn't run to breakpoint"
-+      return
++# See whether we have the needed unwinder hooks.
++set ok 1
++gdb_test_multiple "print _Unwind_DebugHook" "check for unwinder hook in java" {
++    -re "= .*_Unwind_DebugHook.*\r\n$gdb_prompt $" {
++      pass "check for unwinder hook in java"
 +    }
-+
-+    gdb_test "set print pretty on" ""
-+
-+    gdb_test "b [gdb_get_line_number {break to inspect} ${testfile}.c ]" \
-+      ".*Breakpoint.*"
-+    gdb_test "continue" ".*Breakpoint.*"
-+    
-+    gdb_test "python execfile ('${srcdir}/${subdir}/${testfile}.py')" ""
-+    
-+    gdb_test "print ss" " = a=< a=<1> b=<$hex>> b=< a=<2> b=<$hex>>"
-+    gdb_test "print ssa\[1\]" " = a=< a=<5> b=<$hex>> b=< a=<6> b=<$hex>>"
-+    gdb_test "print ssa" " = {a=< a=<3> b=<$hex>> b=< a=<4> b=<$hex>>, a=< a=<5> b=<$hex>> b=< a=<6> b=<$hex>>}"
-+    
-+    if {$lang == "c++"} {
-+      gdb_test "print cps" "=  a=<8> b=<$hex>"
-+      gdb_test "print cpss" " = {$nl *zss = 9, *$nl *s =  a=<10> b=<$hex>$nl}"
-+      gdb_test "print cpssa\[0\]" " = {$nl *zss = 11, *$nl *s =  a=<12> b=<$hex>$nl}"
-+      gdb_test "print cpssa\[1\]" " = {$nl *zss = 13, *$nl *s =  a=<14> b=<$hex>$nl}"
-+      gdb_test "print cpssa" " = {{$nl *zss = 11, *$nl *s =  a=<12> b=<$hex>$nl *}, {$nl *zss = 13, *$nl *s =  a=<14> b=<$hex>$nl *}}"
-+      gdb_test "print sss" "= a=<15> b=< a=<8> b=<$hex>>"
-+      gdb_test "print ref" "= a=<15> b=< a=<8> b=<$hex>>"
++    -re "No symbol .* in current context.\r\n$gdb_prompt $" {
++      # Pass the test so we don't get bogus fails in the results.
++      pass "check for unwinder hook in java"
++      set ok 0
 +    }
-+
-+    gdb_test "print x" " = $hex \"this is x\""
-+    gdb_test "print cstring" " = $hex \"const string\""
-+
-+    gdb_test "print c" " = container $hex \"container\" with 2 elements = {$nl *.0. = 23,$nl *.1. = 72$nl}"
-+
-+    gdb_test "continue" "Program exited normally\."
++}
++if {!$ok} {
++    untested jnpe.exp
++    return -1
 +}
 +
-+run_lang_tests "c"
-+run_lang_tests "c++"
-diff --git a/gdb/testsuite/gdb.python/python-prettyprint.py b/gdb/testsuite/gdb.python/python-prettyprint.py
++gdb_test "handle SIGSEGV nostop noprint" \
++  "SIGSEGV.*fault" \
++  "disable SIGSEGV for next-over-NPE"
++
++# We sometimes stop at line 37, not line 35.  This seems to be a gcj
++# oddity -- another next will solve it.
++gdb_test "next" \
++  "3\[57\].*" \
++  "next over NPE"
+diff --git a/gdb/testsuite/gdb.java/jnpe.java b/gdb/testsuite/gdb.java/jnpe.java
 new file mode 100644
-index 0000000..0d9cb87
+index 0000000..ffca3ab
 --- /dev/null
-+++ b/gdb/testsuite/gdb.python/python-prettyprint.py
-@@ -0,0 +1,134 @@
-+# Copyright (C) 2008, 2009 Free Software Foundation, Inc.
-+
-+# This program is free software; you can redistribute it and/or modify
-+# it under the terms of the GNU General Public License as published by
-+# the Free Software Foundation; either version 3 of the License, or
-+# (at your option) any later version.
-+#
-+# This program is distributed in the hope that it will be useful,
-+# but WITHOUT ANY WARRANTY; without even the implied warranty of
-+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-+# GNU General Public License for more details.
-+#
-+# You should have received a copy of the GNU General Public License
-+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
-+
-+# This file is part of the GDB testsuite.  It tests python pretty
-+# printers.
-+
-+import re
-+
-+# Test returning a Value from a printer.
-+class string_print:
-+    def __init__(self, val):
-+        self.val = val
-+
-+    def to_string(self):
-+        return self.val['whybother']['contents']
-+
-+# Test a class-based printer.
-+class ContainerPrinter:
-+    class _iterator:
-+        def __init__ (self, pointer, len):
-+            self.start = pointer
-+            self.pointer = pointer
-+            self.end = pointer + len
-+
-+        def __iter__(self):
-+            return self
-+
-+        def next(self):
-+            if self.pointer == self.end:
-+                raise StopIteration
-+            result = self.pointer
-+            self.pointer = self.pointer + 1
-+            return ('[%d]' % int (result - self.start), result.dereference())
-+
-+    def __init__(self, val):
-+        self.val = val
-+
-+    def to_string(self):
-+        return 'container %s with %d elements' % (self.val['name'], self.val['len'])
-+
-+    def children(self):
-+        return self._iterator(self.val['elements'], self.val['len'])
-+
-+class pp_s:
-+    def __init__(self, val):
-+        self.val = val
-+
-+    def to_string(self):
-+        a = self.val["a"]
-+        b = self.val["b"]
-+        if a.address() != b:
-+            raise Exception("&a(%s) != b(%s)" % (str(a.address()), str(b)))
-+        return " a=<" + str(self.val["a"]) + "> b=<" + str(self.val["b"]) + ">"
-+
-+class pp_ss:
-+    def __init__(self, val):
-+        self.val = val
-+
-+    def to_string(self):
-+        return "a=<" + str(self.val["a"]) + "> b=<" + str(self.val["b"]) + ">"
-+
-+class pp_sss:
-+    def __init__(self, val):
-+        self.val = val
-+
-+    def to_string(self):
-+        return "a=<" + str(self.val['a']) + "> b=<" + str(self.val["b"]) + ">"
-+
-+def lookup_function (val):
-+    "Look-up and return a pretty-printer that can print val."
++++ b/gdb/testsuite/gdb.java/jnpe.java
+@@ -0,0 +1,38 @@
++// Test next-over-NPE.
++/* This testcase is part of GDB, the GNU debugger.
 +
-+    # Get the type.
-+    type = val.type ();
++   Copyright 2009 Free Software Foundation, Inc.
 +
-+    # If it points to a reference, get the reference.
-+    if type.code () == gdb.TYPE_CODE_REF:
-+        type = type.target ()
++   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.
 +
-+    # Get the unqualified type, stripped of typedefs.
-+    type = type.unqualified ().strip_typedefs ()
++   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.
 +
-+    # Get the type name.    
-+    typename = type.tag ()
++   You should have received a copy of the GNU General Public License
++   along with this program.  If not, see <http://www.gnu.org/licenses/>.
++   */
 +
-+    if typename == None:
-+        return None
++public class jnpe
++{
++  public static String npe ()
++  {
++    return ((Object) null).toString();
++  }
 +
-+    # Iterate over local dictionary of types to determine
-+    # if a printer is registered for that type.  Return an
-+    # instantiation of the printer if found.
-+    for function in pretty_printers_dict:
-+        if function.match (typename):
-+            return pretty_printers_dict[function] (val)
-+        
-+    # Cannot find a pretty printer.  Return None.
++  public static void main (String[] args)
++  {
++    try
++      {
++      System.out.println (npe ()); // break here
++      }
++    catch (NullPointerException n)
++      {
++      System.out.println ("success");
++      }
++  }
++}
+diff --git a/gdb/testsuite/gdb.opt/array-from-register-func.c b/gdb/testsuite/gdb.opt/array-from-register-func.c
+new file mode 100644
+index 0000000..729f457
+--- /dev/null
++++ b/gdb/testsuite/gdb.opt/array-from-register-func.c
+@@ -0,0 +1,22 @@
++/* This file is part of GDB, the GNU debugger.
 +
-+    return None
++   Copyright 2009 Free Software Foundation, Inc.
 +
++   This program is free software; you can redistribute it and/or modify
++   it under the terms of the GNU General Public License as published by
++   the Free Software Foundation; either version 3 of the License, or
++   (at your option) any later version.
 +
-+def register_pretty_printers ():
-+    pretty_printers_dict[re.compile ('^struct s$')]   = pp_s
-+    pretty_printers_dict[re.compile ('^s$')]   = pp_s
-+    pretty_printers_dict[re.compile ('^S$')]   = pp_s
++   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.
 +
-+    pretty_printers_dict[re.compile ('^struct ss$')]  = pp_ss
-+    pretty_printers_dict[re.compile ('^ss$')]  = pp_ss
-+    pretty_printers_dict[re.compile ('^const S &$')]   = pp_s
-+    pretty_printers_dict[re.compile ('^SSS$')]  = pp_sss
-+    
-+    # Note that we purposely omit the typedef names here.
-+    # Printer lookup is based on canonical name.
-+    # However, we do need both tagged and untagged variants, to handle
-+    # both the C and C++ cases.
-+    pretty_printers_dict[re.compile ('^struct string_repr$')] = string_print
-+    pretty_printers_dict[re.compile ('^struct container$')] = ContainerPrinter
-+    pretty_printers_dict[re.compile ('^string_repr$')] = string_print
-+    pretty_printers_dict[re.compile ('^container$')] = ContainerPrinter
-+    
-+pretty_printers_dict = {}
++   You should have received a copy of the GNU General Public License
++   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 +
-+register_pretty_printers ()
-+gdb.pretty_printers.append (lookup_function)
-diff --git a/gdb/testsuite/gdb.python/python-template.cc b/gdb/testsuite/gdb.python/python-template.cc
++int
++func (int *arr)
++{
++  return arr[0];
++}
+diff --git a/gdb/testsuite/gdb.opt/array-from-register.c b/gdb/testsuite/gdb.opt/array-from-register.c
 new file mode 100644
-index 0000000..bd6a212
+index 0000000..3090e7e
 --- /dev/null
-+++ b/gdb/testsuite/gdb.python/python-template.cc
-@@ -0,0 +1,30 @@
-+/* This testcase is part of GDB, the GNU debugger.
++++ b/gdb/testsuite/gdb.opt/array-from-register.c
+@@ -0,0 +1,28 @@
++/* This file is part of GDB, the GNU debugger.
 +
-+   Copyright 2008 Free Software Foundation, Inc.
++   Copyright 2009 Free Software Foundation, Inc.
 +
 +   This program is free software; you can redistribute it and/or modify
 +   it under the terms of the GNU General Public License as published by
@@ -40623,30 +25540,28 @@ index 0000000..bd6a212
 +   You should have received a copy of the GNU General Public License
 +   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 +
-+template <typename T>
-+struct Foo {
-+};
-+
-+#ifndef TYPE
-+#define TYPE int
-+#endif
++extern int func (int *arr);
 +
-+int main()
++int
++main (void)
 +{
-+  Foo<TYPE> foo;
-+  return 0; // break here
++  int arr[] = { 42 };
++
++  func (arr);
++
++  return 0;
 +}
-diff --git a/gdb/testsuite/gdb.python/python-template.exp b/gdb/testsuite/gdb.python/python-template.exp
+diff --git a/gdb/testsuite/gdb.opt/array-from-register.exp b/gdb/testsuite/gdb.opt/array-from-register.exp
 new file mode 100644
-index 0000000..561ff73
+index 0000000..f2de718
 --- /dev/null
-+++ b/gdb/testsuite/gdb.python/python-template.exp
-@@ -0,0 +1,75 @@
-+# Copyright (C) 2008 Free Software Foundation, Inc.
-+
++++ b/gdb/testsuite/gdb.opt/array-from-register.exp
+@@ -0,0 +1,33 @@
++# Copyright 2009 Free Software Foundation, Inc.
++#
 +# This program is free software; you can redistribute it and/or modify
 +# it under the terms of the GNU General Public License as published by
-+# the Free Software Foundation; either version 3 of the License, or
++# the Free Software Foundation; either version 2 of the License, or
 +# (at your option) any later version.
 +#
 +# This program is distributed in the hope that it will be useful,
@@ -40655,5563 +25570,3124 @@ index 0000000..561ff73
 +# GNU General Public License for more details.
 +#
 +# You should have received a copy of the GNU General Public License
-+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
-+
-+# This file is part of the GDB testsuite.  It tests the mechanism
-+# exposing values to Python.
-+
-+if $tracelevel then {
-+    strace $tracelevel
-+}
++# along with this program; if not, write to the Free Software
++# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
++#
++# This file is part of the gdb testsuite.
 +
-+set testfile "python-template"
-+set srcfile ${testfile}.cc
-+set binfile ${objdir}/${subdir}/${testfile}
-+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable \
-+        {debug c++}] != "" } {
-+    untested "Couldn't compile ${srcfile}"
++if { [prepare_for_testing array-from-register.exp "array-from-register"      \
++                        {array-from-register.c array-from-register-func.c} \
++                        {debug optimize=-O2}] } {
 +    return -1
 +}
 +
-+# Start with a fresh gdb.
-+
-+gdb_exit
-+gdb_start
-+gdb_reinitialize_dir $srcdir/$subdir
-+
-+gdb_test_multiple "python print 23" "verify python support" {
-+    -re "not supported.*$gdb_prompt $"        {
-+      unsupported "python support is disabled"
-+      return -1
-+    }
-+    -re "$gdb_prompt $"       {}
-+}
-+
-+proc test_template_arg {type} {
-+    global testfile srcdir subdir srcfile binfile
-+    if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" \
-+              executable \
-+              [list debug c++ additional_flags="-DTYPE=$type"]] != "" } {
-+      untested $type
-+      return -1
-+    }
-+    gdb_load ${binfile}
-+    if ![runto_main ] then {
-+      perror "couldn't run to breakpoint"
-+      return
-+    }
-+    # There is no executable code in main(), so we are where we want to be
-+    gdb_test "print foo" ""
-+    gdb_test "python foo = gdb.history(0)" ""
-+
-+    # Replace '*' with '\*' in regex.
-+    regsub -all {\*} $type {\*} t
-+    gdb_test "python print foo.type().template_argument(0)" $t $type
-+}
-+
-+test_template_arg "const int"
-+test_template_arg "volatile int"
-+test_template_arg "const int &"
-+test_template_arg "volatile int &"
-+test_template_arg "volatile int * const"
-+test_template_arg "volatile int * const *"
-+test_template_arg "const int * volatile"
-+test_template_arg "const int * volatile * const * volatile *"
-diff --git a/gdb/testsuite/gdb.python/python-value.c b/gdb/testsuite/gdb.python/python-value.c
-index 17e5c62..9637fe9 100644
---- a/gdb/testsuite/gdb.python/python-value.c
-+++ b/gdb/testsuite/gdb.python/python-value.c
-@@ -33,13 +33,17 @@ enum e
-     TWO = 2
-   };
-+typedef struct s *PTR;
-+
- enum e evalue = TWO;
- int
- main (int argc, char *argv[])
- {
-+  char *cp = argv[0]; /* Prevent gcc from optimizing argv[] out.  */
-   struct s s;
-   union u u;
-+  PTR x = &s;
-   s.a = 3;
-   s.b = 5;
-diff --git a/gdb/testsuite/gdb.python/python-value.exp b/gdb/testsuite/gdb.python/python-value.exp
-index 8f5e0ab..9ca9593 100644
---- a/gdb/testsuite/gdb.python/python-value.exp
-+++ b/gdb/testsuite/gdb.python/python-value.exp
-@@ -227,6 +227,37 @@ proc test_value_in_inferior {} {
-   gdb_test "python print arg0" "0x.*$testfile\"" "verify dereferenced value"
- }
-+proc test_value_after_death {} {
-+  # Construct a type while the inferior is still running.
-+  gdb_py_test_silent_cmd "python ptrtype = gdb.Type('PTR')" \
-+    "create PTR type" 1
-+
-+  # Check the type has the expected name.
-+  gdb_test "python print ptrtype" "PTR" \
-+    "check initial PTR type"
-+
-+  # Kill the inferior and remove the symbols.
-+  gdb_test "kill" "" "kill the inferior" \
-+    "Kill the program being debugged. .y or n. $" \
-+    "y"
-+  gdb_test "file" "" "Discard the symbols" \
-+    "Discard symbol table from.*y or n. $" \
-+    "y"
-+
-+  # Now create a value using that type.  Relies on arg0, created by
-+  # test_value_in_inferior.
-+  gdb_py_test_silent_cmd "python castval = arg0.cast(ptrtype.pointer())" \
-+    "cast arg0 to PTR" 1
-+
-+  # Make sure the type is deleted.
-+  gdb_py_test_silent_cmd "python ptrtype = None" \
-+    "delete PTR type" 1
-+
-+  # Now see if the value's type is still valid.
-+  gdb_test "python print castval.type()" "PTR \\*" \
-+    "print value's type"
-+}
-+
- # Start with a fresh gdb.
-@@ -256,3 +287,4 @@ if ![runto_main] then {
- }
- test_value_in_inferior
-+test_value_after_death
-diff --git a/gdb/testsuite/lib/cp-support.exp b/gdb/testsuite/lib/cp-support.exp
-index dbd2f59..44e1b51 100644
---- a/gdb/testsuite/lib/cp-support.exp
-+++ b/gdb/testsuite/lib/cp-support.exp
-@@ -222,7 +222,7 @@ proc cp_test_ptype_class { in_command in_testname in_key in_tag in_class_table {
-     set parse_okay 0
-     gdb_test_multiple "$in_command" "$in_testname // parse failed" {
--      -re "type = (struct|class)${wsopt}(\[A-Za-z0-9_\]*)${wsopt}((:\[^\{\]*)?)${wsopt}\{(.*)\}${wsopt}(\[^\r\n\]*)\[\r\n\]+$gdb_prompt $" {
-+      -re "type = (struct|class)${wsopt}(\[A-Za-z0-9_:\]*)${wsopt}((:\[^\{\]*)?)${wsopt}\{(.*)\}${wsopt}(\[^\r\n\]*)\[\r\n\]+$gdb_prompt $" {
-           set parse_okay          1
-           set actual_key          $expect_out(1,string)
-           set actual_tag          $expect_out(2,string)
-@@ -231,6 +231,7 @@ proc cp_test_ptype_class { in_command in_testname in_key in_tag in_class_table {
-           set actual_tail         $expect_out(6,string)
-       }
-     }
-+    
-     if { ! $parse_okay } then { return }
-     # Check the actual key.  It would be nice to require that it match
-diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp
-index 820ab20..8b8e7c6 100644
---- a/gdb/testsuite/lib/gdb.exp
-+++ b/gdb/testsuite/lib/gdb.exp
-@@ -1162,9 +1162,12 @@ proc default_gdb_start { } {
-     global gdb_prompt
-     global timeout
-     global gdb_spawn_id;
-+    global env
-     gdb_stop_suppressing_tests;
-+    set env(LC_CTYPE) C
-+
-     verbose "Spawning $GDB $INTERNAL_GDBFLAGS $GDBFLAGS"
-     if [info exists gdb_spawn_id] {
-diff --git a/gdb/testsuite/lib/mi-support.exp b/gdb/testsuite/lib/mi-support.exp
-index f62c240..bda7ea1 100644
---- a/gdb/testsuite/lib/mi-support.exp
-+++ b/gdb/testsuite/lib/mi-support.exp
-@@ -1237,6 +1237,21 @@ proc mi_varobj_update_with_type_change { name new_type new_children testname } {
-     mi_gdb_test "-var-update $name" $er $testname
- }
-+# Update a dynamic varobj named NAME.  CHILDREN is a list of children,
-+# in the same form as mi_list_varobj_children.  TESTNAME is the name
-+# of the test.
-+proc mi_varobj_update_dynamic {name children testname} {
-+    set children_exp_j [mi_child_regexp $children 0]
-+
-+    set er "\\^done,changelist=\\\["
-+
-+    append er "{name=\"$name\",in_scope=\"true\",type_changed=\"false\""
-+    append er ",children=\\\[$children_exp_j.*\\\]}\\\]"
-+
-+    verbose -log "Expecting: $er"
-+    mi_gdb_test "-var-update $name" $er $testname
++if ![runto func] then {
++    return -1
 +}
 +
- proc mi_check_varobj_value { name value testname } {
-     mi_gdb_test "-var-evaluate-expression $name" \
-@@ -1244,6 +1259,42 @@ proc mi_check_varobj_value { name value testname } {
-       $testname
- }
-+# Helper proc which constructs a child regexp for
-+# mi_list_varobj_children and mi_varobj_update_dynamic.
-+proc mi_child_regexp {children add_child} {
-+    set children_exp {}
-+    set whatever "\"\[^\"\]+\""
++gdb_test "p arr" "\\$\[0-9\]+ = \\(int \\*\\) *0x\[0-9a-f\]+"
 +
-+    if {$add_child} {
-+      set pre "child="
-+    } else {
-+      set pre ""
-+    }
++# Seen regression:
++# Address requested for identifier "arr" which is in register $rdi
++gdb_test "p arr\[0\]" "\\$\[0-9\]+ = 42"
+diff --git a/gdb/testsuite/gdb.opt/fortran-string.exp b/gdb/testsuite/gdb.opt/fortran-string.exp
+new file mode 100644
+index 0000000..f997eec
+--- /dev/null
++++ b/gdb/testsuite/gdb.opt/fortran-string.exp
+@@ -0,0 +1,41 @@
++# Copyright 2009 Free Software Foundation, Inc.
 +
-+    foreach item $children {
++# This program is free software; you can redistribute it and/or modify
++# it under the terms of the GNU General Public License as published by
++# the Free Software Foundation; either version 2 of the License, or
++# (at your option) any later version.
++# 
++# This program is distributed in the hope that it will be useful,
++# but WITHOUT ANY WARRANTY; without even the implied warranty of
++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++# GNU General Public License for more details.
++# 
++# You should have received a copy of the GNU General Public License
++# along with this program; if not, write to the Free Software
++# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  
 +
-+        set name [lindex $item 0]
-+        set exp [lindex $item  1]
-+        set numchild [lindex $item 2]
-+        if {[llength $item] == 5} {
-+            set type [lindex $item 3]
-+            set value [lindex $item 4]
++# This file was written by Jan Kratochvil <jan.kratochvil@redhat.com>.
 +
-+            lappend children_exp\
-+                "$pre{name=\"$name\",exp=\"$exp\",numchild=\"$numchild\",value=\"$value\",type=\"$type\"\(,thread-id=\"\[0-9\]+\")?}"
-+        } elseif {[llength $item] == 4} {
-+            set type [lindex $item 3]
++# Test GDB can cope with Fortran strings having their length present in a CPU
++# register.  With -O0 the string length is passed on the stack.  To make this
++# test meaningful the follow assertion should pass.  It is not being checked
++# here as the "_s" symbol is compiler dependent:
++#   (gdb) info address _s
++#   Symbol "_s" is a variable in register XX.
 +
-+            lappend children_exp\
-+                "$pre{name=\"$name\",exp=\"$exp\",numchild=\"$numchild\",type=\"$type\"\(,thread-id=\"\[0-9\]+\")?}"
-+        } else {
-+            lappend children_exp\
-+                "$pre{name=\"$name\",exp=\"$exp\",numchild=\"$numchild\"(,thread-id=\"\[0-9\]+\")?}"
-+        }
-+    }
-+    return [join $children_exp ","]
++set test fortran-string
++set srcfile ${test}.f90
++if { [prepare_for_testing ${test}.exp ${test} ${srcfile} {debug f77 additional_flags=-O2}] } {
++    return -1
 +}
 +
- # Check the results of the:
- #
- #   -var-list-children VARNAME
-@@ -1265,39 +1316,23 @@ proc mi_check_varobj_value { name value testname } {
- # have no value.
- #
- proc mi_list_varobj_children { varname children testname } {
-+    mi_list_varobj_children_range $varname [llength $children] $children \
-+      $testname
-+}
-+# Like mi_list_varobj_children, but assumes that a subrange has been
-+# selected with -var-set-child-range.  NUMCHILDREN is the total number
-+# of children.
-+proc mi_list_varobj_children_range {varname numchildren children testname} {
-     set options ""
-     if {[llength $varname] == 2} {
-         set options [lindex $varname 1]
-         set varname [lindex $varname 0]
-     }
--    set numchildren [llength $children]
--    set children_exp {}
-     set whatever "\"\[^\"\]+\""
--    foreach item $children {
--
--        set name [lindex $item 0]
--        set exp [lindex $item  1]
--        set numchild [lindex $item 2]
--        if {[llength $item] == 5} {
--            set type [lindex $item 3]
--            set value [lindex $item 4]
--
--            lappend children_exp\
--                "child={name=\"$name\",exp=\"$exp\",numchild=\"$numchild\",value=\"$value\",type=\"$type\"\(,thread-id=\"\[0-9\]+\")?}"
--        } elseif {[llength $item] == 4} {
--            set type [lindex $item 3]
--
--            lappend children_exp\
--                "child={name=\"$name\",exp=\"$exp\",numchild=\"$numchild\",type=\"$type\"\(,thread-id=\"\[0-9\]+\")?}"
--        } else {
--            lappend children_exp\
--                "child={name=\"$name\",exp=\"$exp\",numchild=\"$numchild\"(,thread-id=\"\[0-9\]+\")?}"
--        }
--    }
--    set children_exp_j [join $children_exp ","]
-+    set children_exp_j [mi_child_regexp $children 1]
-     if {$numchildren} {
-         set expected "\\^done,numchild=\".*\",children=\\\[$children_exp_j.*\\\]"
-     } {
-@@ -1770,3 +1805,25 @@ proc mi_check_thread_states { xstates test } {
-     verbose -log "expecting: $pattern"
-     mi_gdb_test "-thread-info" $pattern $test
- }
-+
-+# Return a list of MI features supported by this gdb.
-+proc mi_get_features {} {
-+    global expect_out mi_gdb_prompt
++if ![runto MAIN__] then {
++    perror "couldn't run to breakpoint MAIN__"
++    continue
++}
 +
-+    send_gdb "-list-features\n"
++gdb_breakpoint [gdb_get_line_number "s = s"]
++gdb_continue_to_breakpoint "s = s"
++gdb_test "frame" ".*s='foo'.*"
++gdb_test "ptype s" "type = character\\*3"
++gdb_test "p s" "\\$\[0-9\]* = 'foo'"
+diff --git a/gdb/testsuite/gdb.opt/fortran-string.f90 b/gdb/testsuite/gdb.opt/fortran-string.f90
+new file mode 100644
+index 0000000..e48d520
+--- /dev/null
++++ b/gdb/testsuite/gdb.opt/fortran-string.f90
+@@ -0,0 +1,28 @@
++! Copyright 2009 Free Software Foundation, Inc.
++!
++! This program is free software; you can redistribute it and/or modify
++! it under the terms of the GNU General Public License as published by
++! the Free Software Foundation; either version 2 of the License, or
++! (at your option) any later version.
++!
++! This program is distributed in the hope that it will be useful,
++! but WITHOUT ANY WARRANTY; without even the implied warranty of
++! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++! GNU General Public License for more details.
++!
++! You should have received a copy of the GNU General Public License
++! along with this program; if not, write to the Free Software
++! Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
++!
++! Ihis file is the Fortran source file for dynamic.exp.
++! Original file written by Jakub Jelinek <jakub@redhat.com>.
++! Modified for the GDB testcase by Jan Kratochvil <jan.kratochvil@redhat.com>.
 +
-+    gdb_expect {
-+      -re "\\^done,features=\\\[(.*)\\\]\r\n$mi_gdb_prompt$" {
-+          regsub -all -- \" $expect_out(1,string) "" features
-+          return [split $features ,]
-+      }
-+      -re ".*\r\n$mi_gdb_prompt$" {
-+          verbose -log "got $expect_out(buffer)"
-+          return ""
-+      }
-+      timeout {
-+          verbose -log "timeout in mi_gdb_prompt"
-+          return ""
-+      }
-+    }
-+}
-diff --git a/gdb/thread.c b/gdb/thread.c
-index 9dea7c2..326e44e 100644
---- a/gdb/thread.c
-+++ b/gdb/thread.c
-@@ -61,7 +61,6 @@ static int thread_alive (struct thread_info *);
- static void info_threads_command (char *, int);
- static void thread_apply_command (char *, int);
- static void restore_current_thread (ptid_t);
--static void prune_threads (void);
- /* Frontend view of the thread state.  Possible extensions: stepping,
-    finishing, until(ling),...  */
-@@ -459,16 +458,23 @@ thread_alive (struct thread_info *tp)
-   return 1;
- }
--static void
-+void
- prune_threads (void)
- {
--  struct thread_info *tp, *next;
-+  struct thread_info *tp;
-+  struct thread_info **prevp = &thread_list;
--  for (tp = thread_list; tp; tp = next)
-+  for (tp = *prevp; tp; tp = *prevp)
-     {
--      next = tp->next;
-+      /* If the thread has died, free it and unlink it from the list.
-+       Otherwise, advance to the next thread.  */
-       if (!thread_alive (tp))
--      delete_thread (tp->ptid);
-+      {
-+        *prevp = tp->next;
-+        free_thread (tp);
-+      }
-+      else
-+      prevp = &tp->next;
-     }
++  subroutine f(s)
++  character*(*) s
++  s = s
++  end
++
++  program main
++  call f ('foo')
++  end
+diff --git a/gdb/testsuite/gdb.python/py-cmd.exp b/gdb/testsuite/gdb.python/py-cmd.exp
+index f6ef938..1032a2d 100644
+--- a/gdb/testsuite/gdb.python/py-cmd.exp
++++ b/gdb/testsuite/gdb.python/py-cmd.exp
+@@ -20,36 +20,15 @@ if $tracelevel then {
+     strace $tracelevel
  }
  
-diff --git a/gdb/top.c b/gdb/top.c
-index d676f02..d6b17f0 100644
---- a/gdb/top.c
-+++ b/gdb/top.c
-@@ -377,6 +377,7 @@ execute_command (char *p, int from_tty)
-     }
-   
-   free_all_values ();
-+  free_all_types ();
+-# Usage: gdb_py_test_multiple NAME INPUT RESULT {INPUT RESULT}...
+-# Run a test named NAME, consisting of multiple lines of input.
+-# After each input line INPUT, search for result line RESULT.
+-# Succeed if all results are seen; fail otherwise.
+-proc gdb_py_test_multiple {name args} {
+-    global gdb_prompt
+-    foreach {input result} $args {
+-      if {[gdb_test_multiple $input "$name - $input" {
+-          -re "\[\r\n\]*($result)\[\r\n\]+($gdb_prompt | *>)$" {
+-              pass "$name - $input"
+-          }
+-      }]} {
+-          return 1
+-      }
+-    }
+-    return 0
+-}
+-
+ # Start with a fresh gdb.
  
-   /* Force cleanup of any alloca areas if using C alloca instead of
-      a builtin alloca.  */
-@@ -1246,7 +1247,8 @@ quit_target (void *arg)
-   struct qt_args *qt = (struct qt_args *)arg;
-   /* Kill or detach all inferiors.  */
--  iterate_over_inferiors (kill_or_detach, qt);
-+  if (target_has_execution)
-+    iterate_over_inferiors (kill_or_detach, qt);
-   /* Give all pushed targets a chance to do minimal cleanup, and pop
-      them all out.  */
-diff --git a/gdb/tracepoint.c b/gdb/tracepoint.c
-index 83df64e..003ef3a 100644
---- a/gdb/tracepoint.c
-+++ b/gdb/tracepoint.c
-@@ -1587,7 +1587,7 @@ encode_actions (struct tracepoint *t, char ***tdp_actions,
-                   case UNOP_MEMVAL:
-                     /* safe because we know it's a simple expression */
-                     tempval = evaluate_expression (exp);
--                    addr = VALUE_ADDRESS (tempval) + value_offset (tempval);
-+                    addr = value_address (tempval);
-                     len = TYPE_LENGTH (check_typedef (exp->elts[1].type));
-                     add_memrange (collect, memrange_absolute, addr, len);
-                     break;
-diff --git a/gdb/typeprint.c b/gdb/typeprint.c
-index 1f824fa..4a92a13 100644
---- a/gdb/typeprint.c
-+++ b/gdb/typeprint.c
-@@ -35,6 +35,7 @@
- #include "gdb_string.h"
- #include "exceptions.h"
- #include "valprint.h"
-+#include "dwarf2loc.h"
- #include <errno.h>
+ gdb_exit
+ gdb_start
+ gdb_reinitialize_dir $srcdir/$subdir
  
- extern void _initialize_typeprint (void);
-@@ -76,6 +77,9 @@ void
- type_print (struct type *type, char *varstring, struct ui_file *stream,
-           int show)
- {
-+  if (show >= 0)
-+    type = check_typedef (type);
-+
-   LA_PRINT_TYPE (type, varstring, stream, show, 0);
+-gdb_test_multiple "python print 'hello, world!'" "verify python support" {
+-    -re "not supported.*$gdb_prompt $"        {
+-      unsupported "python support is disabled"
+-      return -1
+-    }
+-    -re "$gdb_prompt $"       {}
++if ![python_supported] then {
++  unsupported "python support is disabled"
++  return -1
  }
  
-@@ -115,7 +119,8 @@ whatis_exp (char *exp, int show)
- {
-   struct expression *expr;
-   struct value *val;
--  struct cleanup *old_chain = NULL;
-+  /* Required at least for the object_address_set call.  */
-+  struct cleanup *old_chain = make_cleanup (null_cleanup, NULL);
-   struct type *real_type = NULL;
-   struct type *type;
-   int full = 0;
-@@ -126,12 +131,13 @@ whatis_exp (char *exp, int show)
-   if (exp)
-     {
-       expr = parse_expression (exp);
--      old_chain = make_cleanup (free_current_contents, &expr);
-+      make_cleanup (free_current_contents, &expr);
-       val = evaluate_type (expr);
-     }
-   else
-     val = access_value_history (0);
-+  object_address_set (VALUE_ADDRESS (val));
-   type = value_type (val);
-   get_user_print_options (&opts);
-@@ -168,8 +174,7 @@ whatis_exp (char *exp, int show)
-   type_print (type, "", gdb_stdout, show);
-   printf_filtered ("\n");
--  if (exp)
--    do_cleanups (old_chain);
-+  do_cleanups (old_chain);
+ # Test a simple command.
+diff --git a/gdb/testsuite/gdb.python/py-frame.exp b/gdb/testsuite/gdb.python/py-frame.exp
+index a67eaa3..5380c0f 100644
+--- a/gdb/testsuite/gdb.python/py-frame.exp
++++ b/gdb/testsuite/gdb.python/py-frame.exp
+@@ -20,40 +20,28 @@ if $tracelevel then {
+     strace $tracelevel
  }
  
- static void
-@@ -236,7 +241,7 @@ print_type_scalar (struct type *type, LONGEST val, struct ui_file *stream)
-       break;
-     case TYPE_CODE_CHAR:
--      LA_PRINT_CHAR ((unsigned char) val, stream);
-+      LA_PRINT_CHAR ((unsigned char) val, type, stream);
-       break;
-     case TYPE_CODE_BOOL:
-diff --git a/gdb/typeprint.h b/gdb/typeprint.h
-index f561310..b39fd17 100644
---- a/gdb/typeprint.h
-+++ b/gdb/typeprint.h
-@@ -26,4 +26,6 @@ void print_type_scalar (struct type * type, LONGEST, struct ui_file *);
- void c_type_print_varspec_suffix (struct type *, struct ui_file *, int,
-                                 int, int);
++# Start with a fresh gdb.
 +
-+void c_type_print_args (struct type *, struct ui_file *, int);
- #endif
-diff --git a/gdb/ui-file.c b/gdb/ui-file.c
-index 02a0314..5c8c96e 100644
---- a/gdb/ui-file.c
-+++ b/gdb/ui-file.c
-@@ -22,6 +22,7 @@
- #include "defs.h"
- #include "ui-file.h"
-+#include "gdb_obstack.h"
- #include "gdb_string.h"
- #include <errno.h>
-@@ -263,7 +264,7 @@ set_ui_file_data (struct ui_file *file, void *data,
- }
- /* ui_file utility function for converting a ``struct ui_file'' into
--   a memory buffer''. */
-+   a memory buffer. */
- struct accumulated_ui_file
- {
-@@ -297,6 +298,23 @@ ui_file_xstrdup (struct ui_file *file,
-   *length = acc.length;
-   return acc.buffer;
- }
++gdb_exit
++gdb_start
++gdb_reinitialize_dir $srcdir/$subdir
 +
-+static void
-+do_ui_file_obsavestring (void *context, const char *buffer, long length)
-+{
-+  struct obstack *obstack = (struct obstack *) context;
-+  obstack_grow (obstack, buffer, length);
++if ![python_supported] then {
++  unsupported "python support is disabled"
++  return -1
 +}
 +
-+char *
-+ui_file_obsavestring (struct ui_file *file, struct obstack *obstack,
-+                    long *length)
-+{
-+  ui_file_put (file, do_ui_file_obsavestring, obstack);
-+  *length = obstack_object_size (obstack);
-+  obstack_1grow (obstack, '\0');
-+  return obstack_finish (obstack);
-+}
\f
- /* A pure memory based ``struct ui_file'' that can be used an output
-    buffer. The buffers accumulated contents are available via
-diff --git a/gdb/ui-file.h b/gdb/ui-file.h
-index 1562d5a..d86a7eb 100644
---- a/gdb/ui-file.h
-+++ b/gdb/ui-file.h
-@@ -19,6 +19,7 @@
- #ifndef UI_FILE_H
- #define UI_FILE_H
+ set testfile "py-frame"
+ set srcfile ${testfile}.c
+ set binfile ${objdir}/${subdir}/${testfile}
++
+ if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
+     untested "Couldn't compile ${srcfile}"
+     return -1
+ }
  
-+struct obstack;
- struct ui_file;
+-# Run a command in GDB, and report a failure if a Python exception is thrown.
+-# If report_pass is true, report a pass if no exception is thrown.
+-proc gdb_py_test_silent_cmd {cmd name report_pass} {
+-  global gdb_prompt
+-
+-  gdb_test_multiple $cmd $name {
+-      -re "Traceback.*$gdb_prompt $"  { fail $name }
+-      -re "$gdb_prompt $"           { if $report_pass { pass $name } }
+-  }
+-}
+-
+-# Start with a fresh gdb.
+-
+-gdb_exit
+-gdb_start
+-gdb_reinitialize_dir $srcdir/$subdir
+ gdb_load ${binfile}
  
- /* Create a generic ui_file object with null methods. */
-@@ -77,7 +78,10 @@ extern void ui_file_put (struct ui_file *src, ui_file_put_method_ftype *write, v
-    appended NUL. */
- extern char *ui_file_xstrdup (struct ui_file *file, long *length);
+-gdb_test_multiple "python print 'hello, world!'" "verify python support" {
+-    -re "not supported.*$gdb_prompt $"        {
+-      unsupported "python support is disabled"
+-      return -1
+-    }
+-    -re "$gdb_prompt $"       {}
+-}
+-
+ # The following tests require execution.
+ if ![runto_main] then {
+@@ -65,19 +53,20 @@ gdb_breakpoint "f2"
+ gdb_continue_to_breakpoint "breakpoint at f2"
+ gdb_test "up" "" ""
+-gdb_py_test_silent_cmd "python f1 = gdb.selected_frame ()" "get second frame" 0
+-gdb_py_test_silent_cmd "python f0 = f1.newer ()" "get first frame" 0
++gdb_py_test_silent_cmd "python frames = gdb.selected_thread ().frames ()" "get frames list" 1
++gdb_test "python print frames" "\\(<gdb.Frame object at 0x\[\[:xdigit:\]\]+>, <gdb.Frame object at 0x\[\[:xdigit:\]\]+>, <gdb.Frame object at 0x\[\[:xdigit:\]\]+>\\)" "verify frames list"
++gdb_py_test_silent_cmd "python f0 = frames\[0\]" "get first frame" 0
++gdb_py_test_silent_cmd "python f1 = frames\[1\]" "get second frame" 0
+ gdb_test "python print 'result =', f0 == f1" " = False" "test equality comparison (false)"
+ gdb_test "python print 'result =', f0 == f0" " = True" "test equality comparison (true)"
+-gdb_test "python print 'result =', f0 != f1" " = True" "test inequality comparison (true)"
+-gdb_test "python print 'result =', f0 != f0" " = False" "test inequality comparison (false)"
+ 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"
+ gdb_test "python print 'result =', f0.unwind_stop_reason () == gdb.FRAME_UNWIND_NO_REASON" " = True" "test Frame.type"
+ gdb_test "python print 'result =', gdb.frame_stop_reason_string (gdb.FRAME_UNWIND_INNER_ID)" " = previous frame inner to this frame \\(corrupt stack\\?\\)" "test gdb.frame_stop_reason_string"
+ gdb_test "python print 'result =', f0.pc ()" " = \[0-9\]+" "test Frame.pc"
++gdb_test "python print 'result =', f0.function ()" " = symbol for f2" "test Frame.function"
+ gdb_test "python print 'result =', f0.older () == f1" " = True" "test Frame.older"
+ gdb_test "python print 'result =', f1.newer () == f0" " = True" "test Frame.newer"
+ gdb_test "python print 'result =', f0.read_var ('variable_which_surely_doesnt_exist')" \
+@@ -85,4 +74,7 @@ gdb_test "python print 'result =', f0.read_var ('variable_which_surely_doesnt_ex
+   "test Frame.read_var - error"
+ gdb_test "python print 'result =', f0.read_var ('a')" " = 1" "test Frame.read_var - success"
++gdb_test "python print 'result =', gdb.selected_thread ().newest_frame () == f0" " = True" "test gdb.newest_frame"
+ gdb_test "python print 'result =', gdb.selected_frame () == f1" " = True" "test gdb.selected_frame"
++
++gdb_test "python print 'result =', f0.block ()" "<gdb.Block object at 0x\[\[:xdigit:\]\]+>" "test Frame.block"
+diff --git a/gdb/testsuite/gdb.python/py-function.exp b/gdb/testsuite/gdb.python/py-function.exp
+index 30fde7d..14cd90c 100644
+--- a/gdb/testsuite/gdb.python/py-function.exp
++++ b/gdb/testsuite/gdb.python/py-function.exp
+@@ -20,36 +20,15 @@ if $tracelevel then {
+     strace $tracelevel
+ }
  
+-# Usage: gdb_py_test_multiple NAME INPUT RESULT {INPUT RESULT}...
+-# Run a test named NAME, consisting of multiple lines of input.
+-# After each input line INPUT, search for result line RESULT.
+-# Succeed if all results are seen; fail otherwise.
+-proc gdb_py_test_multiple {name args} {
+-    global gdb_prompt
+-    foreach {input result} $args {
+-      if {[gdb_test_multiple $input "$name - $input" {
+-          -re "\[\r\n\]*($result)\[\r\n\]+($gdb_prompt | *>)$" {
+-              pass "$name - $input"
+-          }
+-      }]} {
+-          return 1
+-      }
+-    }
+-    return 0
+-}
 -
-+/* Similar to ui_file_xstrdup, but return a new string allocated on
-+   OBSTACK.  */
-+extern char *ui_file_obsavestring (struct ui_file *file,
-+                                 struct obstack *obstack, long *length);
+ # Start with a fresh gdb.
  
- extern long ui_file_read (struct ui_file *file, char *buf, long length_buf);
+ gdb_exit
+ gdb_start
+ gdb_reinitialize_dir $srcdir/$subdir
  
-diff --git a/gdb/utils.c b/gdb/utils.c
-index 9224839..88a9a39 100644
---- a/gdb/utils.c
-+++ b/gdb/utils.c
-@@ -272,6 +272,19 @@ make_cleanup_fclose (FILE *file)
+-gdb_test_multiple "python print 'hello, world!'" "verify python support" {
+-    -re "not supported.*$gdb_prompt $"        {
+-      unsupported "python support is disabled"
+-      return -1
+-    }
+-    -re "$gdb_prompt $"       {}
++if ![python_supported] then {
++  unsupported "python support is disabled"
++  return -1
  }
  
- static void
-+do_obstack_free (void *arg)
+ gdb_py_test_multiple "input convenience function" \
+diff --git a/gdb/testsuite/gdb.python/py-inferior.c b/gdb/testsuite/gdb.python/py-inferior.c
+new file mode 100644
+index 0000000..0b48299
+--- /dev/null
++++ b/gdb/testsuite/gdb.python/py-inferior.c
+@@ -0,0 +1,49 @@
++#include <stdio.h>
++#include <stdlib.h>
++#include <stdint.h>
++#include <string.h>
++
++#define CHUNK_SIZE 16000 /* same as findcmd.c's */
++#define BUF_SIZE (2 * CHUNK_SIZE) /* at least two chunks */
++
++static int8_t int8_search_buf[100];
++static int16_t int16_search_buf[100];
++static int32_t int32_search_buf[100];
++static int64_t int64_search_buf[100];
++
++static char *search_buf;
++static int search_buf_size;
++
++static int x;
++
++
++int f2 (int a)
 +{
-+  struct obstack *ob = arg;
-+  obstack_free (ob, NULL);
++  char *str = "hello, testsuite";
++
++  puts (str); /* Break here.  */
++
++  return ++a;
 +}
 +
-+struct cleanup *
-+make_cleanup_obstack_free (struct obstack *obstack)
++int f1 (int a, int b)
 +{
-+  return make_cleanup (do_obstack_free, obstack);
++  return f2(a) + b;
 +}
 +
 +static void
- do_ui_file_delete (void *arg)
- {
-   ui_file_delete (arg);
-@@ -1554,21 +1567,33 @@ query (const char *ctlstr, ...)
-   va_end (args);
- }
--/* Print an error message saying that we couldn't make sense of a
--   \^mumble sequence in a string or character constant.  START and END
--   indicate a substring of some larger string that contains the
--   erroneous backslash sequence, missing the initial backslash.  */
--static NORETURN int
--no_control_char_error (const char *start, const char *end)
-+/* A helper for parse_escape that converts a host character to a
-+   target character.  C is the host character.  If conversion is
-+   possible, then the target character is stored in *TARGET_C and the
-+   function returns 1.  Otherwise, the function returns 0.  */
++init_bufs ()
++{
++  search_buf_size = BUF_SIZE;
++  search_buf = malloc (search_buf_size);
++  if (search_buf == NULL)
++    exit (1);
++  memset (search_buf, 'x', search_buf_size);
++}
 +
-+static int
-+host_char_to_target (int c, int *target_c)
- {
--  int len = end - start;
--  char *copy = alloca (end - start + 1);
-+  struct obstack host_data;
-+  char the_char = c;
-+  struct cleanup *cleanups;
-+  int result = 0;
++int main (int argc, char *argv[])
++{
++  init_bufs ();
 +
-+  obstack_init (&host_data);
-+  cleanups = make_cleanup_obstack_free (&host_data);
++  return f1 (1, 2);
++}
+diff --git a/gdb/testsuite/gdb.python/py-inferior.exp b/gdb/testsuite/gdb.python/py-inferior.exp
+new file mode 100644
+index 0000000..719b178
+--- /dev/null
++++ b/gdb/testsuite/gdb.python/py-inferior.exp
+@@ -0,0 +1,201 @@
++# Copyright (C) 2009 Free Software Foundation, Inc.
 +
-+  convert_between_encodings (target_charset (), host_charset (),
-+                           &the_char, 1, 1, &host_data, translit_none);
--  memcpy (copy, start, len);
--  copy[len] = '\0';
-+  if (obstack_object_size (&host_data) == 1)
-+    {
-+      result = 1;
-+      *target_c = *(char *) obstack_base (&host_data);
-+    }
--  error (_("There is no control character `\\%s' in the `%s' character set."),
--       copy, target_charset ());
-+  do_cleanups (cleanups);
-+  return result;
- }
- /* Parse a C escape sequence.  STRING_PTR points to a variable
-@@ -1591,53 +1616,13 @@ parse_escape (char **string_ptr)
- {
-   int target_char;
-   int c = *(*string_ptr)++;
--  if (c_parse_backslash (c, &target_char))
--    return target_char;
--  else
--    switch (c)
--      {
-+  switch (c)
-+    {
-       case '\n':
-       return -2;
-       case 0:
-       (*string_ptr)--;
-       return 0;
--      case '^':
--      {
--        /* Remember where this escape sequence started, for reporting
--           errors.  */
--        char *sequence_start_pos = *string_ptr - 1;
--
--        c = *(*string_ptr)++;
--
--        if (c == '?')
--          {
--            /* XXXCHARSET: What is `delete' in the host character set?  */
--            c = 0177;
--
--            if (!host_char_to_target (c, &target_char))
--              error (_("There is no character corresponding to `Delete' "
--                     "in the target character set `%s'."), host_charset ());
--
--            return target_char;
--          }
--        else if (c == '\\')
--          target_char = parse_escape (string_ptr);
--        else
--          {
--            if (!host_char_to_target (c, &target_char))
--              no_control_char_error (sequence_start_pos, *string_ptr);
--          }
--
--        /* Now target_char is something like `c', and we want to find
--           its control-character equivalent.  */
--        if (!target_char_to_control_char (target_char, &target_char))
--          no_control_char_error (sequence_start_pos, *string_ptr);
--
--        return target_char;
--      }
--
--      /* XXXCHARSET: we need to use isdigit and value-of-digit
--         methods of the host character set here.  */
-       case '0':
-       case '1':
-@@ -1648,16 +1633,16 @@ parse_escape (char **string_ptr)
-       case '6':
-       case '7':
-       {
--        int i = c - '0';
-+        int i = host_hex_value (c);
-         int count = 0;
-         while (++count < 3)
-           {
-             c = (**string_ptr);
--            if (c >= '0' && c <= '7')
-+            if (isdigit (c) && c != '8' && c != '9')
-               {
-                 (*string_ptr)++;
-                 i *= 8;
--                i += c - '0';
-+                i += host_hex_value (c);
-               }
-             else
-               {
-@@ -1666,14 +1651,39 @@ parse_escape (char **string_ptr)
-           }
-         return i;
-       }
--      default:
--      if (!host_char_to_target (c, &target_char))
--        error
--          ("The escape sequence `\%c' is equivalent to plain `%c', which"
--           " has no equivalent\n" "in the `%s' character set.", c, c,
--           target_charset ());
--      return target_char;
--      }
++# 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/>.
 +
-+    case 'a':
-+      c = '\a';
-+      break;
-+    case 'b':
-+      c = '\b';
-+      break;
-+    case 'f':
-+      c = '\f';
-+      break;
-+    case 'n':
-+      c = '\n';
-+      break;
-+    case 'r':
-+      c = '\r';
-+      break;
-+    case 't':
-+      c = '\t';
-+      break;
-+    case 'v':
-+      c = '\v';
-+      break;
++# This file is part of the GDB testsuite.  It tests the mechanism
++# exposing inferiors to Python.
 +
-+    default:
-+      break;
-+    }
++if $tracelevel then {
++    strace $tracelevel
++}
 +
-+  if (!host_char_to_target (c, &target_char))
-+    error
-+      ("The escape sequence `\%c' is equivalent to plain `%c', which"
-+       " has no equivalent\n" "in the `%s' character set.", c, c,
-+       target_charset ());
-+  return target_char;
- }
\f
- /* Print the character C on STREAM as part of the contents of a literal
-diff --git a/gdb/v850-tdep.c b/gdb/v850-tdep.c
-index 9850de4..285fe3f 100644
---- a/gdb/v850-tdep.c
-+++ b/gdb/v850-tdep.c
-@@ -705,7 +705,7 @@ v850_push_dummy_call (struct gdbarch *gdbarch,
-       if (!v850_type_is_scalar (value_type (*args))
-         && TYPE_LENGTH (value_type (*args)) > E_MAX_RETTYPE_SIZE_IN_REGS)
-       {
--        store_unsigned_integer (valbuf, 4, VALUE_ADDRESS (*args));
-+        store_unsigned_integer (valbuf, 4, value_address (*args));
-         len = 4;
-         val = valbuf;
-       }
-diff --git a/gdb/valarith.c b/gdb/valarith.c
-index f38cdb8..8e103cf 100644
---- a/gdb/valarith.c
-+++ b/gdb/valarith.c
-@@ -164,9 +164,9 @@ an integer nor a pointer of the same type."));
- struct value *
- value_subscript (struct value *array, struct value *idx)
- {
--  struct value *bound;
-   int c_style = current_language->c_style_arrays;
-   struct type *tarray;
-+  LONGEST index = value_as_long (idx);
-   array = coerce_ref (array);
-   tarray = check_typedef (value_type (array));
-@@ -179,13 +179,26 @@ value_subscript (struct value *array, struct value *idx)
-       get_discrete_bounds (range_type, &lowerbound, &upperbound);
-       if (VALUE_LVAL (array) != lval_memory)
--      return value_subscripted_rvalue (array, idx, lowerbound);
-+      {
-+        if (index >= lowerbound && index <= upperbound)
-+          {
-+            CORE_ADDR element_size = TYPE_LENGTH (TYPE_TARGET_TYPE (tarray));
-+            CORE_ADDR offset = (index - lowerbound) * element_size;
++# Start with a fresh gdb.
++
++gdb_exit
++gdb_start
++gdb_reinitialize_dir $srcdir/$subdir
++
++if ![python_supported] then {
++  unsupported "python support is disabled"
++  return -1
++}
++
++set testfile "py-inferior"
++set srcfile ${testfile}.c
++set binfile ${objdir}/${subdir}/${testfile}
++
++if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
++    untested "Couldn't compile ${srcfile}"
++    return -1
++}
++
++gdb_load ${binfile}
++
++# The following tests require execution.
++
++if ![runto_main] then {
++    fail "Can't run to main"
++    return 0
++}
++
++runto [gdb_get_line_number "Break here."]
++
++# Test basic gdb.Inferior attributes and methods.
++
++gdb_py_test_silent_cmd "python inferiors = gdb.inferiors ()" "get inferiors list" 1
++gdb_test "python print inferiors" "\\(<gdb.Inferior object at 0x\[\[:xdigit:\]\]+>,\\)" "verify inferiors list"
++gdb_py_test_silent_cmd "python i0 = inferiors\[0\]" "get first inferior" 0
++
++gdb_test "python print 'result =', i0 == inferiors\[0\]" " = True" "test equality comparison (true)"
++gdb_test "python print 'result =', i0.num" " = \[0-9\]+" "test Inferior.num"
++gdb_test "python print 'result =', i0.pid" " = \[0-9\]+" "test Inferior.pid"
++gdb_test "python print 'result =', i0.was_attached" " = False" "test Inferior.was_attached"
++gdb_test "python print i0.threads ()" "\\(<gdb.InferiorThread object at 0x\[\[:xdigit:\]\]+>,\\)" "test Inferior.threads"
++
++# Test memory read and write operations.
++
++gdb_py_test_silent_cmd "python addr = gdb.selected_frame ().read_var ('str')" \
++  "read str address" 0
++gdb_py_test_silent_cmd "python str = gdb.inferiors()\[0\].read_memory (addr, 5)" \
++  "read str contents" 1
++gdb_py_test_silent_cmd "python str\[1\] = 'a'" "change str" 0
++gdb_py_test_silent_cmd "python gdb.inferiors()\[0\].write_memory (addr, str)" \
++  "write str" 1
++gdb_test "print str" " = 0x\[\[:xdigit:\]\]+ \"hallo, testsuite\"" \
++  "ensure str was changed in the inferior"
++
++# Test memory search.
++
++set hex_number {0x[0-9a-fA-F][0-9a-fA-F]*}
++set dec_number {[0-9]+}
++set history_prefix {[$][0-9]* = }
++set newline {[\r\n]+}
++set pattern_not_found "${newline}.]"
++set one_pattern_found "${newline}.${dec_number}L]"
++set two_patterns_found "${newline}.${dec_number}L, ${dec_number}L]"
++
++# Test string pattern.
++
++gdb_test "set *(int32_t*) &int8_search_buf\[10\] = 0x61616161" "" ""
++gdb_test "py search_buf = gdb.selected_frame ().read_var ('int8_search_buf')" "" ""
++gdb_test "py start_addr = search_buf.address" "" ""
++gdb_test "py length = search_buf.type.sizeof" "" ""
++
++gdb_test "py print gdb.inferiors()\[0\].search_memory (start_addr, length, 'aaa')" \
++  "${two_patterns_found}" "find string pattern"
++
++# Test not finding pattern because search range too small, with
++# potential find at the edge of the range.
++
++gdb_test "py print gdb.inferiors()\[0\].search_memory (start_addr, 10+3, 'aaaa')" \
++  "${pattern_not_found}" "pattern not found at end of range"
++
++# Increase the search range by 1 and we should find the pattern.
++
++gdb_test "py print gdb.inferiors()\[0\].search_memory (start_addr, 10+3+1, \['a', 'a', 'a', 'a'\])" \
++  "${one_pattern_found}" "pattern found at end of range"
++
++# Test max-count with size, with different parameter position
++
++gdb_test "py print gdb.inferiors()\[0\].search_memory (start_addr, length, \[0x61, 0x61\], 1, 1)" \
++  "${one_pattern_found}" "size = 1, max_count = 1"
++
++gdb_test "py print gdb.inferiors()\[0\].search_memory (start_addr, length, \[0x61, 0x61\], 1, 2)" \
++  "${two_patterns_found}" "size = 1, max_count = 2, normal ordering"
++
++gdb_test "py print gdb.inferiors()\[0\].search_memory (start_addr, length, \[0x61, 0x61\], size = 1, max_count = 2)" \
++  "${two_patterns_found}" "size = 1, max_count = 2, normal ordering, with keywords"
++
++gdb_test "py print gdb.inferiors()\[0\].search_memory (start_addr, length, \[0x61, 0x61\], max_count = 2, size = 1)" \
++  "${two_patterns_found}" "size = 1, max_count = 2, inverted ordering"
++
++gdb_test "py print gdb.inferiors()\[0\].search_memory (start_addr, length, \['a', 'a'\], max_count = 2)" \
++  "${two_patterns_found}" "max_count = 2, with keyword"
++
++# Test 16-bit pattern.
++
++gdb_test "set int16_search_buf\[10\] = 0x1234" "" ""
++gdb_test "py search_buf = gdb.selected_frame ().read_var ('int16_search_buf')" "" ""
++gdb_test "py start_addr = search_buf.address" "" ""
++gdb_test "py length = search_buf.type.sizeof" "" ""
++gdb_test "py pattern = gdb.parse_and_eval ('(int16_t) 0x1234')" "" ""
++
++gdb_test "py print gdb.inferiors()\[0\].search_memory (start_addr, length, 0x1234, 2)" \
++  "${one_pattern_found}" "find 16-bit pattern, with python pattern"
++
++gdb_test "py print gdb.inferiors()\[0\].search_memory (start_addr, length, pattern)" \
++  "${one_pattern_found}" "find 16-bit pattern, with value pattern"
++
++# Test 32-bit pattern.
++
++gdb_test "set int32_search_buf\[10\] = 0x12345678" "" ""
++gdb_test "py search_buf = gdb.selected_frame ().read_var ('int32_search_buf')" "" ""
++gdb_test "py start_addr = search_buf.address" "" ""
++gdb_test "py length = search_buf.type.sizeof" "" ""
++gdb_test "py pattern = gdb.parse_and_eval ('(int32_t) 0x12345678')" "" ""
++
++gdb_test "py print gdb.inferiors()\[0\].search_memory (start_addr, length, 0x12345678, 4)" \
++  "${one_pattern_found}" "find 32-bit pattern, with python pattern"
++gdb_test "py print gdb.inferiors()\[0\].search_memory (start_addr, length, pattern)" \
++  "${one_pattern_found}" "find 32-bit pattern, with value pattern"
++
++# Test 64-bit pattern.
++
++gdb_test "set int64_search_buf\[10\] = 0xfedcba9876543210LL" "" ""
++gdb_test "py search_buf = gdb.selected_frame ().read_var ('int64_search_buf')" "" ""
++gdb_test "py start_addr = search_buf.address" "" ""
++gdb_test "py length = search_buf.type.sizeof" "" ""
++gdb_test "py pattern = gdb.parse_and_eval ('(int64_t) 0xfedcba9876543210LL')" "" ""
++
++gdb_test "py print gdb.inferiors()\[0\].search_memory (start_addr, length, 0xfedcba9876543210, 8)" \
++  "${one_pattern_found}" "find 64-bit pattern, with python pattern"
++gdb_test "py print gdb.inferiors()\[0\].search_memory (start_addr, length, pattern)" \
++  "${one_pattern_found}" "find 64-bit pattern, with value pattern"
++
++# Test mixed-sized patterns.
++
++gdb_test "set *(int8_t*) &search_buf\[10\] = 0x62" "" ""
++gdb_test "set *(int16_t*) &search_buf\[11\] = 0x6363" "" ""
++gdb_test "set *(int32_t*) &search_buf\[13\] = 0x64646464" "" ""
++gdb_test "py search_buf = gdb.selected_frame ().read_var ('search_buf')" "" ""
++gdb_test "py start_addr = search_buf\[0\].address" "" ""
++gdb_test "py pattern1 = gdb.parse_and_eval ('(int8_t) 0x62')" "" ""
++gdb_test "py pattern2 = gdb.parse_and_eval ('(int16_t) 0x6363')" "" ""
++gdb_test "py pattern3 = gdb.parse_and_eval ('(int32_t) 0x64646464')" "" ""
++
++gdb_test "py print gdb.inferiors()\[0\].search_memory (start_addr, 100, \[pattern1, pattern2, pattern3\])" \
++    "${one_pattern_found}" "find mixed-sized pattern"
 +
-+            return value_subscripted_rvalue (array, offset);
-+          }
-+        error (_("array or string index out of range"));
-+      }
-       if (c_style == 0)
-       {
--        LONGEST index = value_as_long (idx);
-         if (index >= lowerbound && index <= upperbound)
--          return value_subscripted_rvalue (array, idx, lowerbound);
-+          {
-+            CORE_ADDR element_size = TYPE_LENGTH (TYPE_TARGET_TYPE (tarray));
-+            CORE_ADDR offset = (index - lowerbound) * element_size;
++# Test search spanning a large range, in the particular case of native
++# targets, test the search spanning multiple chunks.
++# Remote targets may implement the search differently.
 +
-+            return value_subscripted_rvalue (array, offset);
-+          }
-         /* Emit warning unless we have an array of unknown size.
-            An array of unknown size has lowerbound 0 and upperbound -1.  */
-         if (upperbound > -1)
-@@ -194,49 +207,52 @@ value_subscript (struct value *array, struct value *idx)
-         c_style = 1;
-       }
--      if (lowerbound != 0)
--      {
--        bound = value_from_longest (value_type (idx), (LONGEST) lowerbound);
--        idx = value_binop (idx, bound, BINOP_SUB);
--      }
--
-+      index -= lowerbound;
-       array = value_coerce_array (array);
-     }
-   if (c_style)
--    return value_ind (value_ptradd (array, idx));
-+    {
-+      struct value *idx;
++set CHUNK_SIZE 16000 ;
 +
-+      idx = value_from_longest (builtin_type_int32, index);
-+      return value_ind (value_ptradd (array, idx));
-+    }
-   else
-     error (_("not an array or string"));
- }
--/* Return the value of EXPR[IDX], expr an aggregate rvalue
--   (eg, a vector register).  This routine used to promote floats
--   to doubles, but no longer does.  */
-+/* Return the value of *((void *) ARRAY + ELEMENT), ARRAY an aggregate rvalue
-+   (eg, a vector register).  This routine used to promote floats to doubles,
-+   but no longer does.  OFFSET is zero-based with 0 for the lowermost existing
-+   element, it must be expressed in bytes (therefore multiplied by
-+   check_typedef (TYPE_TARGET_TYPE (array_type)).  */
- struct value *
--value_subscripted_rvalue (struct value *array, struct value *idx, int lowerbound)
-+value_subscripted_rvalue (struct value *array, CORE_ADDR offset)
- {
-   struct type *array_type = check_typedef (value_type (array));
-   struct type *elt_type = check_typedef (TYPE_TARGET_TYPE (array_type));
--  unsigned int elt_size = TYPE_LENGTH (elt_type);
--  LONGEST index = value_as_long (idx);
--  unsigned int elt_offs = elt_size * longest_to_int (index - lowerbound);
-   struct value *v;
--  if (index < lowerbound || elt_offs >= TYPE_LENGTH (array_type))
--    error (_("no such vector element"));
-+  /* Do not check TYPE_LENGTH (array_type) as we may have been given the
-+     innermost dimension of a multi-dimensional Fortran array where its length
-+     is shorter than the possibly accessed element offset.  */
-   v = allocate_value (elt_type);
-   if (VALUE_LVAL (array) == lval_memory && value_lazy (array))
-     set_value_lazy (v, 1);
-   else
--    memcpy (value_contents_writeable (v),
--          value_contents (array) + elt_offs, elt_size);
-+    {
-+      unsigned int elt_size = TYPE_LENGTH (elt_type);
-+      memcpy (value_contents_writeable (v),
-+            value_contents (array) + offset, elt_size);
-+    }
-   set_value_component_location (v, array);
-   VALUE_REGNUM (v) = VALUE_REGNUM (array);
-   VALUE_FRAME_ID (v) = VALUE_FRAME_ID (array);
--  set_value_offset (v, value_offset (array) + elt_offs);
-+  set_value_offset (v, value_offset (array) + offset);
-   return v;
- }
-diff --git a/gdb/valops.c b/gdb/valops.c
-index 9810f2b..14c562e 100644
---- a/gdb/valops.c
-+++ b/gdb/valops.c
-@@ -38,6 +38,7 @@
- #include "cp-support.h"
- #include "dfp.h"
- #include "user-regs.h"
-+#include "dwarf2loc.h"
- #include <errno.h>
- #include "gdb_string.h"
-@@ -254,9 +255,8 @@ value_cast_structs (struct type *type, struct value *v2)
-       if (v)
-       {
-         /* Downcasting is possible (t1 is superclass of v2).  */
--        CORE_ADDR addr2 = VALUE_ADDRESS (v2);
--        addr2 -= (VALUE_ADDRESS (v)
--                  + value_offset (v)
-+        CORE_ADDR addr2 = value_address (v2);
-+        addr2 -= (value_address (v)
-                   + value_embedded_offset (v));
-         return value_at (type, addr2);
-       }
-@@ -371,8 +371,6 @@ value_cast (struct type *type, struct value *arg2)
-         new_length = val_length / element_length;
-         if (val_length % element_length != 0)
-           warning (_("array element type size does not divide object size in cast"));
--        /* FIXME-type-allocation: need a way to free this type when
--           we are done with it.  */
-         range_type = create_range_type ((struct type *) NULL,
-                                         TYPE_TARGET_TYPE (range_type),
-                                         low_bound,
-@@ -511,7 +509,7 @@ value_cast (struct type *type, struct value *arg2)
-     }
-   else if (VALUE_LVAL (arg2) == lval_memory)
-     return value_at_lazy (type, 
--                        VALUE_ADDRESS (arg2) + value_offset (arg2));
-+                        value_address (arg2));
-   else if (code1 == TYPE_CODE_VOID)
-     {
-       return value_zero (builtin_type_void, not_lval);
-@@ -568,6 +566,64 @@ value_one (struct type *type, enum lval_type lv)
-   return val;
- }
-+/* object_address_set must be already called before this function.  */
++gdb_test "set *(int32_t*) &search_buf\[0*${CHUNK_SIZE}+100\] = 0x12345678" "" ""
++gdb_test "set *(int32_t*) &search_buf\[1*${CHUNK_SIZE}+100\] = 0x12345678" "" ""
++gdb_test "py start_addr = gdb.selected_frame ().read_var ('search_buf')" "" ""
++gdb_test "py length = gdb.selected_frame ().read_var ('search_buf_size')" "" ""
 +
-+const char *
-+object_address_data_not_valid (struct type *type)
-+{
-+  /* Attributes are present only at the target type of a typedef.  Make the
-+     call conditional as it would otherwise loop through type_length_get.  */
-+  if (TYPE_CODE (type) == TYPE_CODE_TYPEDEF)
-+    CHECK_TYPEDEF (type);
++gdb_test "py print gdb.inferiors()\[0\].search_memory (start_addr, length, 0x12345678, 4)" \
++  "${two_patterns_found}" "search spanning large range"
 +
-+  /* DW_AT_associated has a preference over DW_AT_allocated.  */
-+  if (TYPE_NOT_ASSOCIATED (type)
-+      || (TYPE_ASSOCIATED (type) != NULL
-+        && 0 == dwarf_locexpr_baton_eval (TYPE_ASSOCIATED (type))))
-+    return N_("object is not associated");
++# For native targets, test a pattern straddling a chunk boundary.
 +
-+  if (TYPE_NOT_ALLOCATED (type)
-+      || (TYPE_ALLOCATED (type) != NULL
-+        && 0 == dwarf_locexpr_baton_eval (TYPE_ALLOCATED (type))))
-+    return N_("object is not allocated");
++if [isnative] {
++    gdb_test "set *(int32_t*) &search_buf\[${CHUNK_SIZE}-1\] = 0xfdb97531" "" ""
 +
-+  return NULL;
++    gdb_test "py print gdb.inferiors()\[0\].search_memory (start_addr, length, 0xfdb97531, 4)" \
++      "${one_pattern_found}" "find pattern straddling chunk boundary"
++}
+diff --git a/gdb/testsuite/gdb.python/py-infthread.c b/gdb/testsuite/gdb.python/py-infthread.c
+new file mode 100644
+index 0000000..22eb9f2
+--- /dev/null
++++ b/gdb/testsuite/gdb.python/py-infthread.c
+@@ -0,0 +1,14 @@
++int f2 (int a)
++{
++  return ++a;
 +}
 +
-+/* Return non-zero if the variable is valid.  If it is valid the function
-+   may store the data address (DW_AT_DATA_LOCATION) of TYPE at *ADDRESS_RETURN.
-+   You must set *ADDRESS_RETURN as VALUE_ADDRESS (VAL) before calling this
-+   function.  If no DW_AT_DATA_LOCATION is present for TYPE the address at
-+   *ADDRESS_RETURN is left unchanged.  ADDRESS_RETURN must not be NULL, use
-+   object_address_data_not_valid () for just the data validity check.  */
++int f1 (int a, int b)
++{
++  return f2(a) + b;
++}
 +
-+int
-+object_address_get_data (struct type *type, CORE_ADDR *address_return)
++int main (int argc, char *argv[])
 +{
-+  gdb_assert (address_return != NULL);
++  return f1 (1, 2);
++}
+diff --git a/gdb/testsuite/gdb.python/py-infthread.exp b/gdb/testsuite/gdb.python/py-infthread.exp
+new file mode 100644
+index 0000000..e9d18b7
+--- /dev/null
++++ b/gdb/testsuite/gdb.python/py-infthread.exp
+@@ -0,0 +1,58 @@
++# Copyright (C) 2009 Free Software Foundation, Inc.
 +
-+  object_address_set (*address_return);
++# 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/>.
 +
-+  /* TYPE_DATA_LOCATION_DWARF_BLOCK / TYPE_DATA_LOCATION_ADDR are present only
-+     at the target type of a typedef.  */
-+  CHECK_TYPEDEF (type);
++# This file is part of the GDB testsuite.  It tests the mechanism
++# exposing inferior threads to Python.
 +
-+  if (object_address_data_not_valid (type) != NULL)
-+    {
-+      /* Do not try to evaluate DW_AT_data_location as it may even crash
-+       (it would just return the value zero in the gfortran case).  */
-+      return 0;
-+    }
++if $tracelevel then {
++    strace $tracelevel
++}
 +
-+  if (TYPE_DATA_LOCATION_IS_ADDR (type))
-+    *address_return = TYPE_DATA_LOCATION_ADDR (type);
-+  else if (TYPE_DATA_LOCATION_DWARF_BLOCK (type) != NULL)
-+    *address_return
-+      = dwarf_locexpr_baton_eval (TYPE_DATA_LOCATION_DWARF_BLOCK (type));
++# Start with a fresh gdb.
 +
-+  return 1;
++gdb_exit
++gdb_start
++gdb_reinitialize_dir $srcdir/$subdir
++
++if ![python_supported] then {
++  unsupported "python support is disabled"
++  return -1
 +}
 +
- /* Return a value with type TYPE located at ADDR.
-    Call value_at only if the data needs to be fetched immediately;
-@@ -593,7 +649,7 @@ value_at (struct type *type, CORE_ADDR addr)
-   read_memory (addr, value_contents_all_raw (val), TYPE_LENGTH (type));
-   VALUE_LVAL (val) = lval_memory;
--  VALUE_ADDRESS (val) = addr;
-+  set_value_address (val, addr);
-   return val;
- }
-@@ -611,7 +667,7 @@ value_at_lazy (struct type *type, CORE_ADDR addr)
-   val = allocate_value_lazy (type);
-   VALUE_LVAL (val) = lval_memory;
--  VALUE_ADDRESS (val) = addr;
-+  set_value_address (val, addr);
-   return val;
- }
-@@ -637,11 +693,19 @@ value_fetch_lazy (struct value *val)
-   allocate_value_contents (val);
-   if (VALUE_LVAL (val) == lval_memory)
-     {
--      CORE_ADDR addr = VALUE_ADDRESS (val) + value_offset (val);
--      int length = TYPE_LENGTH (check_typedef (value_enclosing_type (val)));
-+      CORE_ADDR addr = VALUE_ADDRESS (val);
++set testfile "py-infthread"
++set srcfile ${testfile}.c
++set binfile ${objdir}/${subdir}/${testfile}
 +
-+      if (object_address_get_data (value_type (val), &addr))
-+      {
-+        struct type *type = value_enclosing_type (val);
-+        int length = TYPE_LENGTH (check_typedef (type));
--      if (length)
--      read_memory (addr, value_contents_all_raw (val), length);
-+        if (length)
-+          {
-+            addr += value_offset (val);
-+            read_memory (addr, value_contents_all_raw (val), length);
-+          }
-+      }
-     }
-   else if (VALUE_LVAL (val) == lval_register)
-     {
-@@ -709,7 +773,7 @@ value_fetch_lazy (struct value *val)
-                                   VALUE_REGNUM (new_val));
-             else if (VALUE_LVAL (new_val) == lval_memory)
-               fprintf_unfiltered (gdb_stdlog, " address=0x%s",
--                                  paddr_nz (VALUE_ADDRESS (new_val)));
-+                                  paddr_nz (value_address (new_val)));
-             else
-               fprintf_unfiltered (gdb_stdlog, " computed");
-@@ -813,16 +877,15 @@ value_assign (struct value *toval, struct value *fromval)
-             error (_("Can't handle bitfields which don't fit in a %d bit word."),
-                    (int) sizeof (LONGEST) * HOST_CHAR_BIT);
--          read_memory (VALUE_ADDRESS (toval) + value_offset (toval),
--                       buffer, changed_len);
-+          read_memory (value_address (toval), buffer, changed_len);
-           modify_field (buffer, value_as_long (fromval),
-                         value_bitpos (toval), value_bitsize (toval));
--          changed_addr = VALUE_ADDRESS (toval) + value_offset (toval);
-+          changed_addr = value_address (toval);
-           dest_buffer = buffer;
-         }
-       else
-         {
--          changed_addr = VALUE_ADDRESS (toval) + value_offset (toval);
-+          changed_addr = value_address (toval);
-           changed_len = TYPE_LENGTH (type);
-           dest_buffer = value_contents (fromval);
-         }
-@@ -985,11 +1048,11 @@ value_repeat (struct value *arg1, int count)
-   val = allocate_repeat_value (value_enclosing_type (arg1), count);
--  read_memory (VALUE_ADDRESS (arg1) + value_offset (arg1),
-+  read_memory (value_address (arg1),
-              value_contents_all_raw (val),
-              TYPE_LENGTH (value_enclosing_type (val)));
-   VALUE_LVAL (val) = lval_memory;
--  VALUE_ADDRESS (val) = VALUE_ADDRESS (arg1) + value_offset (arg1);
-+  set_value_address (val, value_address (arg1));
-   return val;
- }
-@@ -1036,10 +1099,11 @@ address_of_variable (struct symbol *var, struct block *b)
-   val = value_of_variable (var, b);
--  if ((VALUE_LVAL (val) == lval_memory && value_lazy (val))
-+  if ((VALUE_LVAL (val) == lval_memory && value_lazy (val)
-+       && object_address_get_data (type, &VALUE_ADDRESS (val)))
-       || TYPE_CODE (type) == TYPE_CODE_FUNC)
-     {
--      CORE_ADDR addr = VALUE_ADDRESS (val);
-+      CORE_ADDR addr = value_address (val);
-       return value_from_pointer (lookup_pointer_type (type), addr);
-     }
-@@ -1145,6 +1209,7 @@ struct value *
- value_coerce_array (struct value *arg1)
- {
-   struct type *type = check_typedef (value_type (arg1));
-+  CORE_ADDR address;
-   /* If the user tries to do something requiring a pointer with an
-      array that has not yet been pushed to the target, then this would
-@@ -1154,8 +1219,12 @@ value_coerce_array (struct value *arg1)
-   if (VALUE_LVAL (arg1) != lval_memory)
-     error (_("Attempt to take address of value not located in memory."));
-+  address = VALUE_ADDRESS (arg1);
-+  if (!object_address_get_data (type, &address))
-+    error (_("Attempt to take address of non-valid value."));
++if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
++    untested "Couldn't compile ${srcfile}"
++    return -1
++}
++
++gdb_load ${binfile}
 +
-   return value_from_pointer (lookup_pointer_type (TYPE_TARGET_TYPE (type)),
--                           (VALUE_ADDRESS (arg1) + value_offset (arg1)));
-+                           address + value_offset (arg1));
- }
- /* Given a value which is a function, return a value which is a pointer
-@@ -1170,7 +1239,7 @@ value_coerce_function (struct value *arg1)
-     error (_("Attempt to take address of value not located in memory."));
-   retval = value_from_pointer (lookup_pointer_type (value_type (arg1)),
--                             (VALUE_ADDRESS (arg1) + value_offset (arg1)));
-+                             (value_address (arg1)));
-   return retval;
- }
-@@ -1205,8 +1274,7 @@ value_addr (struct value *arg1)
-   /* Get target memory address */
-   arg2 = value_from_pointer (lookup_pointer_type (value_type (arg1)),
--                           (VALUE_ADDRESS (arg1)
--                            + value_offset (arg1)
-+                           (value_address (arg1)
-                             + value_embedded_offset (arg1)));
-   /* This may be a pointer to a base subobject; so remember the
-@@ -1352,6 +1420,24 @@ value_array (int lowbound, int highbound, struct value **elemvec)
-   return val;
- }
-+struct value *
-+value_typed_string (char *ptr, int len, struct type *char_type)
-+{
-+  struct value *val;
-+  int lowbound = current_language->string_lower_bound;
-+  int highbound = len / TYPE_LENGTH (char_type);
-+  struct type *rangetype = create_range_type ((struct type *) NULL,
-+                                            builtin_type_int32,
-+                                            lowbound, 
-+                                            highbound + lowbound - 1);
-+  struct type *stringtype
-+    = create_array_type ((struct type *) NULL, char_type, rangetype);
-+
-+  val = allocate_value (stringtype);
-+  memcpy (value_contents_raw (val), ptr, len);
-+  return val;
++# The following tests require execution.
++
++if ![runto_main] then {
++    fail "Can't run to main"
++    return 0
 +}
 +
- /* Create a value for a string constant by allocating space in the
-    inferior, copying the data into that space, and returning the
-    address with type TYPE_CODE_STRING.  PTR points to the string
-@@ -1600,8 +1686,7 @@ search_struct_field (char *name, struct value *arg1, int offset,
-         boffset = baseclass_offset (type, i,
-                                     value_contents (arg1) + offset,
--                                    VALUE_ADDRESS (arg1)
--                                    + value_offset (arg1) + offset);
-+                                    value_address (arg1) + offset);
-         if (boffset == -1)
-           error (_("virtual baseclass botch"));
-@@ -1616,13 +1701,13 @@ search_struct_field (char *name, struct value *arg1, int offset,
-             v2  = allocate_value (basetype);
-             base_addr = 
--              VALUE_ADDRESS (arg1) + value_offset (arg1) + boffset;
-+              value_address (arg1) + boffset;
-             if (target_read_memory (base_addr, 
-                                     value_contents_raw (v2),
-                                     TYPE_LENGTH (basetype)) != 0)
-               error (_("virtual baseclass botch"));
-             VALUE_LVAL (v2) = lval_memory;
--            VALUE_ADDRESS (v2) = base_addr;
-+            set_value_address (v2, base_addr);
-           }
-         else
-           {
-@@ -1745,8 +1830,7 @@ search_struct_method (char *name, struct value **arg1p,
-         if (offset < 0 || offset >= TYPE_LENGTH (type))
-           {
-             gdb_byte *tmp = alloca (TYPE_LENGTH (baseclass));
--            if (target_read_memory (VALUE_ADDRESS (*arg1p)
--                                    + value_offset (*arg1p) + offset,
-+            if (target_read_memory (value_address (*arg1p) + offset,
-                                     tmp, TYPE_LENGTH (baseclass)) != 0)
-               error (_("virtual baseclass botch"));
-             base_valaddr = tmp;
-@@ -1755,8 +1839,7 @@ search_struct_method (char *name, struct value **arg1p,
-           base_valaddr = value_contents (*arg1p) + offset;
-         base_offset = baseclass_offset (type, i, base_valaddr,
--                                        VALUE_ADDRESS (*arg1p)
--                                        + value_offset (*arg1p) + offset);
-+                                        value_address (*arg1p) + offset);
-         if (base_offset == -1)
-           error (_("virtual baseclass botch"));
-       }
-@@ -1965,7 +2048,7 @@ find_method_list (struct value **argp, char *method,
-         base_offset = value_offset (*argp) + offset;
-         base_offset = baseclass_offset (type, i,
-                                         value_contents (*argp) + base_offset,
--                                        VALUE_ADDRESS (*argp) + base_offset);
-+                                        value_address (*argp) + base_offset);
-         if (base_offset == -1)
-           error (_("virtual baseclass botch"));
-       }
-@@ -2083,12 +2166,25 @@ find_overload_match (struct type **arg_types, int nargs,
-   if (method)
-     {
-       gdb_assert (obj);
++runto [gdb_get_line_number "Break here."]
 +
-+      /* OBJ may be a pointer value rather than the object itself.  */
-+      obj = coerce_ref (obj);
-+      while (TYPE_CODE (check_typedef (value_type (obj))) == TYPE_CODE_PTR)
-+      obj = coerce_ref (value_ind (obj));
-       obj_type_name = TYPE_NAME (value_type (obj));
--      /* Hack: evaluate_subexp_standard often passes in a pointer
--         value rather than the object itself, so try again.  */
--      if ((!obj_type_name || !*obj_type_name) 
--        && (TYPE_CODE (value_type (obj)) == TYPE_CODE_PTR))
--      obj_type_name = TYPE_NAME (TYPE_TARGET_TYPE (value_type (obj)));
++# Test basic gdb.Inferior attributes and methods.
 +
-+      /* First check whether this is a data member, e.g. a pointer to
-+       a function.  */
-+      if (TYPE_CODE (check_typedef (value_type (obj))) == TYPE_CODE_STRUCT)
-+      {
-+        *valp = search_struct_field (name, obj, 0,
-+                                     check_typedef (value_type (obj)), 0);
-+        if (*valp)
-+          {
-+            *staticp = 1;
-+            return 0;
-+          }
-+      }
-       fns_ptr = value_find_oload_method_list (&temp, name, 
-                                             0, &num_fns, 
-@@ -2108,16 +2204,29 @@ find_overload_match (struct type **arg_types, int nargs,
-     }
-   else
-     {
--      const char *qualified_name = SYMBOL_CPLUS_DEMANGLED_NAME (fsym);
-+      const char *qualified_name = SYMBOL_NATURAL_NAME (fsym);
--      /* If we have a C++ name, try to extract just the function
--       part.  */
--      if (qualified_name)
--      func_name = cp_func_name (qualified_name);
-+      /* If we have a function with a C++ name, try to extract just
-+       the function part.  Do not try this for non-functions (e.g.
-+       function pointers).  */
-+      if (qualified_name
-+        && TYPE_CODE (check_typedef (SYMBOL_TYPE (fsym))) == TYPE_CODE_FUNC)
-+      {
-+        func_name = cp_func_name (qualified_name);
++gdb_py_test_silent_cmd "python t0 = gdb.selected_thread ()" "test gdb.selected_thread" 1
++gdb_test "python print t0" "\\<gdb.InferiorThread object at 0x\[\[:xdigit:\]\]+>" "verify InferiorThread object"
++gdb_test "python print 'result =', t0.num" " = \[0-9\]+" "test Inferior.num"
+diff --git a/gdb/testsuite/gdb.python/py-prettyprint.exp b/gdb/testsuite/gdb.python/py-prettyprint.exp
+index b4b3776..359c4ed 100644
+--- a/gdb/testsuite/gdb.python/py-prettyprint.exp
++++ b/gdb/testsuite/gdb.python/py-prettyprint.exp
+@@ -27,12 +27,20 @@ set binfile ${objdir}/${subdir}/${testfile}
+ # Start with a fresh gdb.
+ gdb_exit
+ gdb_start
+-gdb_test_multiple "python print 'hello, world!'" "verify python support" {
+-    -re "not supported.*$gdb_prompt $"        {
+-      unsupported "python support is disabled"
+-      return -1
+-    }
+-    -re "$gdb_prompt $"       {}
++if ![python_supported] then {
++  unsupported "python support is disabled"
++  return -1
++}
 +
-+        /* If cp_func_name did not remove anything, the name of the
-+           symbol did not include scope or argument types - it was
-+           probably a C-style function.  */
-+        if (func_name && strcmp (func_name, qualified_name) == 0)
-+          {
-+            xfree (func_name);
-+            func_name = NULL;
-+          }
-+      }
--      /* If there was no C++ name, this must be a C-style function.
--       Just return the same symbol.  Do the same if cp_func_name
--       fails for some reason.  */
-+      /* If there was no C++ name, this must be a C-style function or
-+       not a function at all.  Just return the same symbol.  Do the
-+       same if cp_func_name fails for some reason.  */
-       if (func_name == NULL)
-         {
-         *symp = fsym;
-@@ -2558,8 +2667,8 @@ check_field (struct type *type, const char *name)
-    the comment before value_struct_elt_for_reference.  */
- struct value *
--value_aggregate_elt (struct type *curtype,
--                   char *name, int want_address,
-+value_aggregate_elt (struct type *curtype, char *name,
-+                   struct type *expect_type, int want_address,
-                    enum noside noside)
- {
-   switch (TYPE_CODE (curtype))
-@@ -2567,7 +2676,7 @@ value_aggregate_elt (struct type *curtype,
-     case TYPE_CODE_STRUCT:
-     case TYPE_CODE_UNION:
-       return value_struct_elt_for_reference (curtype, 0, curtype, 
--                                           name, NULL,
-+                                           name, expect_type,
-                                            want_address, noside);
-     case TYPE_CODE_NAMESPACE:
-       return value_namespace_elt (curtype, name, 
-@@ -2671,7 +2780,7 @@ value_struct_elt_for_reference (struct type *domain, int offset,
-         if (intype)
-           {
-             while (j--)
--              if (TYPE_FN_FIELD_TYPE (f, j) == intype)
-+              if (compare_parameters (TYPE_FN_FIELD_TYPE (f, j), intype))
-                 break;
-             if (j < 0)
-               error (_("no member function matches that type instantiation"));
-@@ -2725,7 +2834,7 @@ value_struct_elt_for_reference (struct type *domain, int offset,
-                 result = allocate_value (lookup_methodptr_type (TYPE_FN_FIELD_TYPE (f, j)));
-                 cplus_make_method_ptr (value_type (result),
-                                        value_contents_writeable (result),
--                                       VALUE_ADDRESS (v), 0);
-+                                       value_address (v), 0);
-               }
-           }
-         return result;
-@@ -2791,7 +2900,7 @@ value_maybe_namespace_elt (const struct type *curtype,
-   struct symbol *sym;
-   struct value *result;
--  sym = cp_lookup_symbol_namespace (namespace_name, name, NULL,
-+  sym = cp_lookup_symbol_namespace_incremental (namespace_name, name, NULL,
-                                   get_selected_block (0), 
-                                   VAR_DOMAIN);
-@@ -2884,7 +2993,7 @@ value_full_object (struct value *argp,
-   /* Go back by the computed top_offset from the beginning of the
-      object, adjusting for the embedded offset of argp if that's what
-      value_rtti_type used for its computation.  */
--  new_val = value_at_lazy (real_type, VALUE_ADDRESS (argp) - top +
-+  new_val = value_at_lazy (real_type, value_address (argp) - top +
-                          (using_enc ? 0 : value_embedded_offset (argp)));
-   deprecated_set_value_type (new_val, value_type (argp));
-   set_value_embedded_offset (new_val, (using_enc
-@@ -2989,8 +3098,6 @@ value_slice (struct value *array, int lowbound, int length)
-       || lowbound + length - 1 > upperbound)
-     error (_("slice out of range"));
++# Run a command in GDB, and report a failure if a Python exception is thrown.
++# If report_pass is true, report a pass if no exception is thrown.
++proc gdb_py_test_silent_cmd {cmd name report_pass} {
++  global gdb_prompt
++
++  gdb_test_multiple $cmd $name {
++      -re "Traceback.*$gdb_prompt $"  { fail $name }
++      -re "$gdb_prompt $"           { if $report_pass { pass $name } }
++  }
+ }
  
--  /* FIXME-type-allocation: need a way to free this type when we are
--     done with it.  */
-   slice_range_type = create_range_type ((struct type *) NULL,
-                                       TYPE_TARGET_TYPE (range_type),
-                                       lowbound, 
-diff --git a/gdb/valprint.c b/gdb/valprint.c
-index b02e9df..a9e8227 100644
---- a/gdb/valprint.c
-+++ b/gdb/valprint.c
-@@ -34,6 +34,7 @@
- #include "doublest.h"
- #include "exceptions.h"
- #include "dfp.h"
-+#include "python/python.h"
+ # Run a command in GDB, and report a failure if a Python exception is thrown.
+@@ -102,6 +110,8 @@ proc run_lang_tests {lang} {
  
- #include <errno.h>
+     gdb_test "print c" " = container $hex \"container\" with 2 elements = {$nl *.0. = 23,$nl *.1. = 72$nl}"
  
-@@ -80,7 +81,9 @@ struct value_print_options user_print_options =
-   0,                          /* print_array_indexes */
-   0,                          /* deref_ref */
-   1,                          /* static_field_print */
--  1                           /* pascal_static_field_print */
-+  1,                          /* pascal_static_field_print */
-+  0,                          /* raw */
-+  0                           /* summary */
- };
++    gdb_test "print nullstr" "RuntimeError: Error reading string from inferior.*"
++
+     gdb_test "continue" "Program exited normally\."
+ }
  
- /* Initialize *OPTS to be a copy of the user print options.  */
-@@ -257,6 +260,15 @@ val_print (struct type *type, const gdb_byte *valaddr, int embedded_offset,
-       return (0);
-     }
+diff --git a/gdb/testsuite/gdb.python/py-template.exp b/gdb/testsuite/gdb.python/py-template.exp
+index cea6ae0..c9a63d4 100644
+--- a/gdb/testsuite/gdb.python/py-template.exp
++++ b/gdb/testsuite/gdb.python/py-template.exp
+@@ -20,6 +20,17 @@ if $tracelevel then {
+     strace $tracelevel
+ }
  
-+  if (!options->raw)
-+    {
-+      ret = apply_val_pretty_printer (type, valaddr, embedded_offset,
-+                                    address, stream, recurse, options,
-+                                    language);
-+      if (ret)
-+      return ret;
-+    }
++# Start with a fresh gdb.
 +
-   TRY_CATCH (except, RETURN_MASK_ERROR)
-     {
-       ret = language->la_val_print (type, valaddr, embedded_offset, address,
-@@ -287,6 +299,13 @@ value_check_printable (struct value *val, struct ui_file *stream)
-       return 0;
-     }
-+  if (TYPE_CODE (value_type (val)) == TYPE_CODE_INTERNAL_FUNCTION)
-+    {
-+      fprintf_filtered (stream, _("<internal function %s>"),
-+                      value_internal_function_name (val));
-+      return 0;
-+    }
++gdb_exit
++gdb_start
++gdb_reinitialize_dir $srcdir/$subdir
 +
-   return 1;
++if ![python_supported] then {
++  unsupported "python support is disabled"
++  return -1
++}
++
+ set testfile "py-template"
+ set srcfile ${testfile}.cc
+ set binfile ${objdir}/${subdir}/${testfile}
+@@ -29,20 +40,6 @@ if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable \
+     return -1
  }
  
-@@ -308,7 +327,7 @@ common_val_print (struct value *val, struct ui_file *stream, int recurse,
-     return 0;
-   return val_print (value_type (val), value_contents_all (val),
--                  value_embedded_offset (val), VALUE_ADDRESS (val),
-+                  value_embedded_offset (val), value_address (val),
-                   stream, recurse, options, language);
+-# Start with a fresh gdb.
+-
+-gdb_exit
+-gdb_start
+-gdb_reinitialize_dir $srcdir/$subdir
+-
+-gdb_test_multiple "python print 23" "verify python support" {
+-    -re "not supported.*$gdb_prompt $"        {
+-      unsupported "python support is disabled"
+-      return -1
+-    }
+-    -re "$gdb_prompt $"       {}
+-}
+-
+ proc test_template_arg {type} {
+     global testfile srcdir subdir srcfile binfile
+     if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" \
+diff --git a/gdb/testsuite/gdb.python/py-value.exp b/gdb/testsuite/gdb.python/py-value.exp
+index 2958233..0de1cae 100644
+--- a/gdb/testsuite/gdb.python/py-value.exp
++++ b/gdb/testsuite/gdb.python/py-value.exp
+@@ -292,6 +292,15 @@ proc test_value_after_death {} {
+     "print value's type"
  }
  
-@@ -324,6 +343,18 @@ value_print (struct value *val, struct ui_file *stream,
-   if (!value_check_printable (val, stream))
-     return 0;
-+  if (!options->raw)
-+    {
-+      int r = apply_val_pretty_printer (value_type (val),
-+                                      value_contents_all (val),
-+                                      value_embedded_offset (val),
-+                                      value_address (val),
-+                                      stream, 0, options,
-+                                      current_language);
-+      if (r)
-+      return r;
-+    }
++# Regression test for a cast failure.  The bug was that if we cast a
++# value to its own type, gdb could crash.  This happened because we
++# could end up double-freeing a struct value.
++proc test_cast_regression {} {
++  gdb_test "python v = gdb.Value(5)" "" "create value for cast test"
++  gdb_test "python v = v.cast(v.type)" "" "cast value for cast test"
++  gdb_test "python print v" "5" "print value for cast test"
++}
 +
-   return LA_VALUE_PRINT (val, stream, options);
+ # Regression test for invalid subscript operations.  The bug was that
+ # the type of the value was not being checked before allowing a
+ # subscript operation to proceed.
+@@ -366,16 +375,23 @@ proc test_subscript_regression {lang} {
+ gdb_exit
+ gdb_start
+ gdb_reinitialize_dir $srcdir/$subdir
+-gdb_load ${binfile}
+-gdb_test_multiple "python print 'hello, world!'" "verify python support" {
+-    -re "not supported.*$gdb_prompt $"        {
+-      unsupported "python support is disabled"
+-      return -1
+-    }
+-    -re "$gdb_prompt $"       {}
++if ![python_supported] then {
++  unsupported "python support is disabled"
++  return -1
  }
  
-@@ -919,7 +950,8 @@ print_hex_chars (struct ui_file *stream, const gdb_byte *valaddr,
-    Omit any leading zero chars.  */
- void
--print_char_chars (struct ui_file *stream, const gdb_byte *valaddr,
-+print_char_chars (struct ui_file *stream, struct type *type,
-+                const gdb_byte *valaddr,
-                 unsigned len, enum bfd_endian byte_order)
- {
-   const gdb_byte *p;
-@@ -932,7 +964,7 @@ print_char_chars (struct ui_file *stream, const gdb_byte *valaddr,
-       while (p < valaddr + len)
-       {
--        LA_EMIT_CHAR (*p, stream, '\'');
-+        LA_EMIT_CHAR (*p, type, stream, '\'');
-         ++p;
-       }
-     }
-@@ -944,7 +976,7 @@ print_char_chars (struct ui_file *stream, const gdb_byte *valaddr,
-       while (p >= valaddr)
-       {
--        LA_EMIT_CHAR (*p, stream, '\'');
-+        LA_EMIT_CHAR (*p, type, stream, '\'');
-         --p;
-       }
-     }
-@@ -1085,6 +1117,7 @@ val_print_array_elements (struct type *type, const gdb_byte *valaddr,
-   for (; i < len && things_printed < options->print_max; i++)
-     {
-+      size_t elt_offset = i * eltlen;
-       if (i != 0)
-       {
-         if (options->prettyprint_arrays)
-@@ -1104,7 +1137,7 @@ val_print_array_elements (struct type *type, const gdb_byte *valaddr,
-       rep1 = i + 1;
-       reps = 1;
-       while ((rep1 < len) &&
--           !memcmp (valaddr + i * eltlen, valaddr + rep1 * eltlen, eltlen))
-+           !memcmp (valaddr + elt_offset, valaddr + rep1 * eltlen, eltlen))
-       {
-         ++reps;
-         ++rep1;
-@@ -1112,7 +1145,7 @@ val_print_array_elements (struct type *type, const gdb_byte *valaddr,
-       if (reps > options->repeat_count_threshold)
-       {
--        val_print (elttype, valaddr + i * eltlen, 0, address + i * eltlen,
-+        val_print (elttype, valaddr + elt_offset, 0, address + elt_offset,
-                    stream, recurse + 1, options, current_language);
-         annotate_elt_rep (reps);
-         fprintf_filtered (stream, " <repeats %u times>", reps);
-@@ -1123,7 +1156,7 @@ val_print_array_elements (struct type *type, const gdb_byte *valaddr,
-       }
-       else
-       {
--        val_print (elttype, valaddr + i * eltlen, 0, address + i * eltlen,
-+        val_print (elttype, valaddr + elt_offset, 0, address + elt_offset,
-                    stream, recurse + 1, options, current_language);
-         annotate_elt ();
-         things_printed++;
-@@ -1315,7 +1348,8 @@ read_string (CORE_ADDR addr, int len, int width, unsigned int fetchlimit,
-    whichever is smaller.  */
- int
--val_print_string (CORE_ADDR addr, int len, int width, struct ui_file *stream,
-+val_print_string (struct type *elttype, CORE_ADDR addr, int len,
-+                struct ui_file *stream,
-                 const struct value_print_options *options)
- {
-   int force_ellipsis = 0;     /* Force ellipsis to be printed if nonzero.  */
-@@ -1325,6 +1359,7 @@ val_print_string (CORE_ADDR addr, int len, int width, struct ui_file *stream,
-   int bytes_read;
-   gdb_byte *buffer = NULL;    /* Dynamically growable fetch buffer.  */
-   struct cleanup *old_chain = NULL;   /* Top of the old cleanup chain.  */
-+  int width = TYPE_LENGTH (elttype);
-   /* First we need to figure out the limit on the number of characters we are
-      going to attempt to fetch and print.  This is actually pretty simple.  If
-@@ -1378,7 +1413,7 @@ val_print_string (CORE_ADDR addr, int len, int width, struct ui_file *stream,
-       {
-         fputs_filtered (" ", stream);
-       }
--      LA_PRINT_STRING (stream, buffer, bytes_read / width, width, force_ellipsis, options);
-+      LA_PRINT_STRING (stream, elttype, buffer, bytes_read / width, force_ellipsis, options);
-     }
-   if (errcode != 0)
-diff --git a/gdb/valprint.h b/gdb/valprint.h
-index 8b65af6..4f63fa6 100644
---- a/gdb/valprint.h
-+++ b/gdb/valprint.h
-@@ -84,6 +84,12 @@ struct value_print_options
-   /* If nonzero, print static fields for Pascal.  FIXME: C++ and Java
-      share one flag, why not Pascal too?  */
-   int pascal_static_field_print;
-+
-+  /* Controls Python pretty-printing.  */
-+  int raw;
-+
-+  /* If nonzero, print the value in "summary" form.  */
-+  int summary;
- };
- /* The global print options set by the user.  In general this should
-@@ -134,9 +140,10 @@ extern void print_decimal_chars (struct ui_file *, const gdb_byte *,
- extern void print_hex_chars (struct ui_file *, const gdb_byte *,
-                            unsigned int, enum bfd_endian);
--extern void print_char_chars (struct ui_file *, const gdb_byte *,
--                            unsigned int, enum bfd_endian);
-+extern void print_char_chars (struct ui_file *, struct type *,
-+                            const gdb_byte *, unsigned int, enum bfd_endian);
- int read_string (CORE_ADDR addr, int len, int width, unsigned int fetchlimit,
-                gdb_byte **buffer, int *bytes_read);
++set testfile "py-value"
++set srcfile ${testfile}.c
++set binfile ${objdir}/${subdir}/${testfile}
 +
- #endif
-diff --git a/gdb/value.c b/gdb/value.c
-index 4d4329e..5c81d83 100644
---- a/gdb/value.c
-+++ b/gdb/value.c
-@@ -36,6 +36,7 @@
- #include "block.h"
- #include "dfp.h"
- #include "objfiles.h"
-+#include "cli/cli-decode.h"
- #include "valprint.h"
- #include "python/python.h"
-@@ -44,6 +45,23 @@
++if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
++    untested "Couldn't compile ${srcfile}"
++    return -1
++}
++
++gdb_load ${binfile}
++
+ test_value_creation
+ test_value_numeric_ops
+ test_value_boolean
+@@ -391,6 +407,7 @@ if ![runto_main] then {
  
- void _initialize_values (void);
+ test_value_in_inferior
+ test_value_after_death
++test_cast_regression
+ # The following test recompiles the binary to test either C or C++
+ # values. 
+diff --git a/gdb/testsuite/gdb.python/python.exp b/gdb/testsuite/gdb.python/python.exp
+index 5223fc8..03e1eab 100644
+--- a/gdb/testsuite/gdb.python/python.exp
++++ b/gdb/testsuite/gdb.python/python.exp
+@@ -26,30 +26,9 @@ gdb_exit
+ gdb_start
+ gdb_reinitialize_dir $srcdir/$subdir
+-gdb_test_multiple "python print 23" "verify python support" {
+-    -re "not supported.*$gdb_prompt $"        {
+-      unsupported "python support is disabled"
+-      return -1
+-    }
+-    -re "$gdb_prompt $"       {}
+-}
+-
+-# Usage: gdb_py_test_multiple NAME INPUT RESULT {INPUT RESULT}...
+-# Run a test named NAME, consisting of multiple lines of input.
+-# After each input line INPUT, search for result line RESULT.
+-# Succeed if all results are seen; fail otherwise.
+-proc gdb_py_test_multiple {name args} {
+-    global gdb_prompt
+-    foreach {input result} $args {
+-      if {[gdb_test_multiple $input "$name - $input" {
+-          -re "\[\r\n\]*($result)\[\r\n\]+($gdb_prompt | *>)$" {
+-              pass "$name - $input"
+-          }
+-      }]} {
+-          return 1
+-      }
+-    }
+-    return 0
++if ![python_supported] then {
++  unsupported "python support is disabled"
++  return -1
+ }
  
-+/* Definition of a user function.  */
-+struct internal_function
-+{
-+  /* The name of the function.  It is a bit odd to have this in the
-+     function itself -- the user might use a differently-named
-+     convenience variable to hold the function.  */
-+  char *name;
+ gdb_py_test_multiple "multi-line python command" \
+diff --git a/gdb/testsuite/gdb.threads/watchpoint-fork-forkoff.c b/gdb/testsuite/gdb.threads/watchpoint-fork-forkoff.c
+new file mode 100644
+index 0000000..4dc308b
+--- /dev/null
++++ b/gdb/testsuite/gdb.threads/watchpoint-fork-forkoff.c
+@@ -0,0 +1,175 @@
++/* Test case for forgotten hw-watchpoints after fork()-off of a process.
 +
-+  /* The handler.  */
-+  internal_function_fn handler;
++   Copyright 2008, 2009 Free Software Foundation, Inc.
 +
-+  /* User data for the handler.  */
-+  void *cookie;
-+};
++   This file is part of GDB.
 +
-+static struct cmd_list_element *functionlist;
++   This program is free software; you can redistribute it and/or modify
++   it under the terms of the GNU General Public License as published by
++   the Free Software Foundation; either version 2 of the License, or
++   (at your option) any later version.
 +
- struct value
- {
-   /* Type of value; either not an lval, or one of the various
-@@ -203,6 +221,10 @@ struct value_history_chunk
- static struct value_history_chunk *value_history_chain;
- static int value_history_count;       /* Abs number of last entry stored */
++   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.
 +
-+/* The type of internal functions.  */
++   You should have received a copy of the GNU General Public License
++   along with this program; if not, write to the Free Software
++   Foundation, Inc., 59 Temple Place - Suite 330,
++   Boston, MA 02111-1307, USA.  */
 +
-+static struct type *internal_fn_type;
\f
- /* List of all value objects currently allocated
-    (except for those released by calls to release_value)
-@@ -225,9 +247,11 @@ allocate_value_lazy (struct type *type)
-   val->next = all_values;
-   all_values = val;
-   val->type = type;
-+  type_incref (type);
-   val->enclosing_type = type;
-+  type_incref (type);
-   VALUE_LVAL (val) = not_lval;
--  VALUE_ADDRESS (val) = 0;
-+  val->location.address = 0;
-   VALUE_FRAME_ID (val) = null_frame_id;
-   val->offset = 0;
-   val->bitpos = 0;
-@@ -269,13 +293,9 @@ struct value *
- allocate_repeat_value (struct type *type, int count)
- {
-   int low_bound = current_language->string_lower_bound;               /* ??? */
--  /* FIXME-type-allocation: need a way to free this type when we are
--     done with it.  */
-   struct type *range_type
-   = create_range_type ((struct type *) NULL, builtin_type_int32,
-                      low_bound, count + low_bound - 1);
--  /* FIXME-type-allocation: need a way to free this type when we are
--     done with it.  */
-   return allocate_value (create_array_type ((struct type *) NULL,
-                                           type, range_type));
- }
-@@ -335,6 +355,8 @@ value_type (struct value *value)
- void
- deprecated_set_value_type (struct value *value, struct type *type)
- {
-+  type_incref (type);
-+  type_decref (value->type);
-   value->type = type;
- }
-@@ -509,6 +531,32 @@ deprecated_value_address_hack (struct value *value)
-   return &value->location.address;
- }
-+CORE_ADDR
-+value_address (struct value *value)
++#include <string.h>
++#include <errno.h>
++
++static void
++delay (void)
 +{
-+  if (value->lval == lval_internalvar
-+      || value->lval == lval_internalvar_component)
-+    return 0;
-+  return value->location.address + value->offset;
++  int i = usleep (1000000 / 100);
++  assert (i == 0 || errno == EINTR);
 +}
 +
-+CORE_ADDR
-+value_raw_address (struct value *value)
++#if defined FOLLOW_PARENT
++
++static void
++forkoff (int nr)
++{
++  pid_t child, pid_got;
++  int exit_code = 42 + nr;
++  int status, i;
++
++  child = fork ();
++  switch (child)
++    {
++    case -1:
++      assert (0);
++    case 0:
++      printf ("child%d: %d\n", nr, (int) getpid ());
++      /* Delay to get both the "child%d" and "parent%d" message printed without
++       a race breaking expect by its endless wait on `$gdb_prompt$':
++       Breakpoint 3, breakpoint () at ../../../gdb/testsuite/gdb.threads/watchpoint-fork.c:33
++       33      }
++       (gdb) parent2: 14223  */
++      i = sleep (1);
++      assert (i == 0);
++
++      /* We must not get caught here (against a forgotten breakpoint).  */
++      var++;
++      breakpoint ();
++
++      _exit (exit_code);
++    default:
++      printf ("parent%d: %d\n", nr, (int) child);
++      /* Delay to get both the "child%d" and "parent%d" message printed, see
++       above.  */
++      i = sleep (1);
++      assert (i == 0);
++
++      pid_got = wait (&status);
++      assert (pid_got == child);
++      assert (WIFEXITED (status));
++      assert (WEXITSTATUS (status) == exit_code);
++
++      /* We must get caught here (against a false watchpoint removal).  */
++      breakpoint ();
++    }
++}
++
++#elif defined FOLLOW_CHILD
++
++static volatile int usr1_got;
++
++static void
++handler_usr1 (int signo)
 +{
-+  if (value->lval == lval_internalvar
-+      || value->lval == lval_internalvar_component)
-+    return 0;
-+  return value->location.address;
++  usr1_got++;
 +}
 +
-+void
-+set_value_address (struct value *value, CORE_ADDR addr)
++static void
++forkoff (int nr)
 +{
-+  gdb_assert (value->lval != lval_internalvar
-+            && value->lval != lval_internalvar_component);
-+  value->location.address = addr;
++  pid_t child;
++  int i, loop;
++  struct sigaction act, oldact;
++#ifdef THREAD
++  void *thread_result;
++#endif
++
++  memset (&act, 0, sizeof act);
++  act.sa_flags = SA_RESTART;
++  act.sa_handler = handler_usr1;
++  sigemptyset (&act.sa_mask);
++  i = sigaction (SIGUSR1, &act, &oldact);
++  assert (i == 0);
++
++  child = fork ();
++  switch (child)
++    {
++    case -1:
++      assert (0);
++    default:
++      printf ("parent%d: %d\n", nr, (int) child);
++
++      /* Sleep for a while to possibly get incorrectly ATTACH_THREADed by GDB
++       tracing the child fork with no longer valid thread/lwp entries of the
++       parent.  */
++
++      i = sleep (2);
++      assert (i == 0);
++
++      /* We must not get caught here (against a forgotten breakpoint).  */
++
++      var++;
++      breakpoint ();
++
++#ifdef THREAD
++      /* And neither got caught our thread.  */
++
++      step = 99;
++      i = pthread_join (thread, &thread_result);
++      assert (i == 0);
++      assert (thread_result == (void *) 99UL);
++#endif
++
++      /* Be sure our child knows we did not get caught above.  */
++
++      i = kill (child, SIGUSR1);
++      assert (i == 0);
++
++      /* Sleep for a while to check GDB's `info threads' no longer tracks us in
++       the child fork.  */
++
++      i = sleep (2);
++      assert (i == 0);
++
++      _exit (0);
++    case 0:
++      printf ("child%d: %d\n", nr, (int) getpid ());
++
++      /* Let the parent signal us about its success.  Be careful of races.  */
++
++      for (loop = 0; loop < 1000; loop++)
++      {
++        /* Parent either died (and USR1_GOT is zero) or it succeeded.  */
++        if (kill (getppid (), 0) != 0)
++          break;
++        /* Parent succeeded?  */
++        if (usr1_got)
++          break;
++
++        delay ();
++      }
++      assert (usr1_got);
++
++      /* We must get caught here (against a false watchpoint removal).  */
++
++      breakpoint ();
++    }
++
++  i = sigaction (SIGUSR1, &oldact, NULL);
++  assert (i == 0);
 +}
 +
- struct internalvar **
- deprecated_value_internalvar_hack (struct value *value)
- {
-@@ -547,11 +595,16 @@ value_mark (void)
-   return all_values;
- }
-+/* Deallocate a value and run destructors if needed.  */
++#else
++# error "!FOLLOW_PARENT && !FOLLOW_CHILD"
++#endif
+diff --git a/gdb/testsuite/gdb.threads/watchpoint-fork-mt.c b/gdb/testsuite/gdb.threads/watchpoint-fork-mt.c
+new file mode 100644
+index 0000000..edacfc0
+--- /dev/null
++++ b/gdb/testsuite/gdb.threads/watchpoint-fork-mt.c
+@@ -0,0 +1,157 @@
++/* Test case for forgotten hw-watchpoints after fork()-off of a process.
 +
- void
- value_free (struct value *val)
- {
-   if (val)
-     {
-+      type_decref (val->type);
-+      type_decref (val->enclosing_type);
++   Copyright 2008, 2009 Free Software Foundation, Inc.
 +
-       if (VALUE_LVAL (val) == lval_computed)
-       {
-         struct lval_funcs *funcs = val->location.computed.funcs;
-@@ -655,6 +708,8 @@ value_copy (struct value *arg)
-     val = allocate_value_lazy (encl_type);
-   else
-     val = allocate_value (encl_type);
-+  type_incref (arg->type);
-+  type_decref (val->type);
-   val->type = arg->type;
-   VALUE_LVAL (val) = VALUE_LVAL (arg);
-   val->location = arg->location;
-@@ -693,6 +748,7 @@ set_value_component_location (struct value *component, struct value *whole)
-     VALUE_LVAL (component) = VALUE_LVAL (whole);
-   component->location = whole->location;
++   This file is part of GDB.
 +
-   if (VALUE_LVAL (whole) == lval_computed)
-     {
-       struct lval_funcs *funcs = whole->location.computed.funcs;
-@@ -700,6 +756,8 @@ set_value_component_location (struct value *component, struct value *whole)
-       if (funcs->copy_closure)
-         component->location.computed.closure = funcs->copy_closure (whole);
-     }
++   This program is free software; you can redistribute it and/or modify
++   it under the terms of the GNU General Public License as published by
++   the Free Software Foundation; either version 2 of the License, or
++   (at your option) any later version.
 +
-+  object_address_get_data (value_type (whole), &VALUE_ADDRESS (component));
- }
\f
-@@ -830,6 +888,25 @@ show_values (char *num_exp, int from_tty)
-       num_exp[1] = '\0';
-     }
- }
++   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.
 +
-+/* Sanity check for memory leaks and proper types reference counting.  */
++   You should have received a copy of the GNU General Public License
++   along with this program; if not, write to the Free Software
++   Foundation, Inc., 59 Temple Place - Suite 330,
++   Boston, MA 02111-1307, USA.  */
++
++#include <assert.h>
++#include <unistd.h>
++#include <sys/wait.h>
++#include <stdio.h>
++#include <stdlib.h>
++#include <pthread.h>
++
++#include <asm/unistd.h>
++#include <unistd.h>
++#define gettid() syscall (__NR_gettid)
++
++/* Non-atomic `var++' should not hurt as we synchronize the threads by the STEP
++   variable.  Hit-comments need to be duplicite there to catch both at-stops
++   and behind-stops, depending on the target.  */
++
++static volatile int var;
 +
 +static void
-+value_history_cleanup (void *unused)
++dummy (void)
 +{
-+  while (value_history_chain)
++}
++
++static void
++breakpoint (void)
++{
++}
++
++/* Include here the functions:
++   static void forkoff (int nr);
++   static void delay (void);  */
++
++static pthread_t thread;
++static volatile int step;
++#define THREAD
++
++#include "watchpoint-fork-forkoff.c"
++
++static void *
++start (void *arg)
++{
++  if (step >= 3)
++    goto step_3;
++
++  while (step != 1)
++    delay ();
++
++  var++;      /* validity-thread-B */
++  dummy ();   /* validity-thread-B */
++  step = 2;
++  while (step != 3)
 +    {
-+      struct value_history_chunk *chunk = value_history_chain;
-+      int i;
++      if (step == 99)
++      goto step_99;
++      delay ();
++    }
 +
-+      for (i = 0; i < ARRAY_SIZE (chunk->values); i++)
-+              value_free (chunk->values[i]);
++step_3:
++  if (step >= 5)
++    goto step_5;
 +
-+      value_history_chain = chunk->next;
-+      xfree (chunk);
++  var++;      /* after-fork1-B */
++  dummy ();   /* after-fork1-B */
++  step = 4;
++  while (step != 5)
++    {
++      if (step == 99)
++      goto step_99;
++      delay ();
 +    }
-+  value_history_count = 0;
-+}
\f
- /* Internal variables.  These are variables within the debugger
-    that hold values assigned by debugger commands.
-@@ -878,7 +955,7 @@ init_if_undefined_command (char* args, int from_tty)
-    the return value is NULL.  */
- struct internalvar *
--lookup_only_internalvar (char *name)
-+lookup_only_internalvar (const char *name)
- {
-   struct internalvar *var;
-@@ -894,7 +971,7 @@ lookup_only_internalvar (char *name)
-    NAME should not normally include a dollar sign.  */
- struct internalvar *
--create_internalvar (char *name)
-+create_internalvar (const char *name)
- {
-   struct internalvar *var;
-   var = (struct internalvar *) xmalloc (sizeof (struct internalvar));
-@@ -902,6 +979,7 @@ create_internalvar (char *name)
-   var->value = allocate_value (builtin_type_void);
-   var->endian = gdbarch_byte_order (current_gdbarch);
-   var->make_value = NULL;
-+  var->canonical = 0;
-   release_value (var->value);
-   var->next = internalvars;
-   internalvars = var;
-@@ -934,7 +1012,7 @@ create_internalvar_type_lazy (char *name, internalvar_make_value fun)
-    one is created, with a void value.  */
- struct internalvar *
--lookup_internalvar (char *name)
-+lookup_internalvar (const char *name)
- {
-   struct internalvar *var;
-@@ -1031,6 +1109,9 @@ set_internalvar (struct internalvar *var, struct value *val)
- {
-   struct value *newval;
-+  if (var->canonical)
-+    error (_("Cannot overwrite convenience function %s"), var->name);
 +
-   newval = value_copy (val);
-   newval->modifiable = 1;
-@@ -1042,7 +1123,7 @@ set_internalvar (struct internalvar *var, struct value *val)
-   /* Begin code which must not call error().  If var->value points to
-      something free'd, an error() obviously leaves a dangling pointer.
--     But we also get a danling pointer if var->value points to
-+     But we also get a dangling pointer if var->value points to
-      something in the value chain (i.e., before release_value is
-      called), because after the error free_all_values will get called before
-      long.  */
-@@ -1059,6 +1140,76 @@ internalvar_name (struct internalvar *var)
-   return var->name;
- }
-+static struct value *
-+value_create_internal_function (const char *name,
-+                              internal_function_fn handler,
-+                              void *cookie)
-+{
-+  struct value *result = allocate_value (internal_fn_type);
-+  gdb_byte *addr = value_contents_writeable (result);
-+  struct internal_function **fnp = (struct internal_function **) addr;
-+  struct internal_function *ifn = XNEW (struct internal_function);
-+  ifn->name = xstrdup (name);
-+  ifn->handler = handler;
-+  ifn->cookie = cookie;
-+  *fnp = ifn;
-+  return result;
-+}
++step_5:
++  var++;      /* after-fork2-B */
++  dummy ();   /* after-fork2-B */
++  return (void *) 5UL;
 +
-+char *
-+value_internal_function_name (struct value *val)
-+{
-+  gdb_byte *addr = value_contents_writeable (val);
-+  struct internal_function *ifn = * (struct internal_function **) addr;
-+  return ifn->name;
++step_99:
++  /* We must not get caught here (against a forgotten breakpoint).  */
++  var++;
++  breakpoint ();
++  return (void *) 99UL;
 +}
 +
-+struct value *
-+call_internal_function (struct value *func, int argc, struct value **argv)
++int
++main (void)
 +{
-+  gdb_byte *addr = value_contents_writeable (func);
-+  struct internal_function *ifn = * (struct internal_function **) addr;
-+  return (*ifn->handler) (ifn->cookie, argc, argv);
++  int i;
++  void *thread_result;
++
++  setbuf (stdout, NULL);
++  printf ("main: %d\n", (int) gettid ());
++
++  /* General watchpoints validity.  */
++  var++;      /* validity-first */
++  dummy ();   /* validity-first */
++
++  i = pthread_create (&thread, NULL, start, NULL);
++  assert (i == 0);
++
++  var++;      /* validity-thread-A */
++  dummy ();   /* validity-thread-A */
++  step = 1;
++  while (step != 2)
++    delay ();
++
++  /* Hardware watchpoints got disarmed here.  */
++  forkoff (1);
++
++  var++;      /* after-fork1-A */
++  dummy ();   /* after-fork1-A */
++  step = 3;
++#ifdef FOLLOW_CHILD
++  /* Spawn new thread as it was deleted in the child of FORK.  */
++  i = pthread_create (&thread, NULL, start, NULL);
++  assert (i == 0);
++#endif
++  while (step != 4)
++    delay ();
++
++  /* A sanity check for double hardware watchpoints removal.  */
++  forkoff (2);
++
++  var++;      /* after-fork2-A */
++  dummy ();   /* after-fork2-A */
++  step = 5;
++#ifdef FOLLOW_CHILD
++  /* Spawn new thread as it was deleted in the child of FORK.  */
++  i = pthread_create (&thread, NULL, start, NULL);
++  assert (i == 0);
++#endif
++
++  i = pthread_join (thread, &thread_result);
++  assert (i == 0);
++  assert (thread_result == (void *) 5UL);
++
++  return 0;
 +}
+diff --git a/gdb/testsuite/gdb.threads/watchpoint-fork.c b/gdb/testsuite/gdb.threads/watchpoint-fork.c
+new file mode 100644
+index 0000000..5f62e7f
+--- /dev/null
++++ b/gdb/testsuite/gdb.threads/watchpoint-fork.c
+@@ -0,0 +1,57 @@
++/* Test case for forgotten hw-watchpoints after fork()-off of a process.
++
++   Copyright 2008, 2009 Free Software Foundation, Inc.
++
++   This file is part of GDB.
++
++   This program is free software; you can redistribute it and/or modify
++   it under the terms of the GNU General Public License as published by
++   the Free Software Foundation; either version 2 of the License, or
++   (at your option) any later version.
++
++   This program is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++   GNU General Public License for more details.
++
++   You should have received a copy of the GNU General Public License
++   along with this program; if not, write to the Free Software
++   Foundation, Inc., 59 Temple Place - Suite 330,
++   Boston, MA 02111-1307, USA.  */
++
++#include <assert.h>
++#include <unistd.h>
++#include <sys/wait.h>
++#include <stdio.h>
++#include <stdlib.h>
++
++static volatile int var;
 +
-+/* 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
-+   registering an internal function.  */
 +static void
-+function_command (char *command, int from_tty)
++breakpoint (void)
 +{
-+  /* Do nothing.  */
 +}
 +
-+/* Clean up if an internal function's command is destroyed.  */
-+static void
-+function_destroyer (struct cmd_list_element *self, void *ignore)
++/* Include here the function:
++   static void forkoff (int nr);  */
++
++#include "watchpoint-fork-forkoff.c"
++
++int
++main (void)
 +{
-+  xfree (self->name);
-+  xfree (self->doc);
++  setbuf (stdout, NULL);
++  printf ("main: %d\n", (int) getpid ());
++
++  /* General watchpoints validity.  */
++  var++;
++  /* Hardware watchpoints got disarmed here.  */
++  forkoff (1);
++  /* This watchpoint got lost before.  */
++  var++;
++  /* A sanity check for double hardware watchpoints removal.  */
++  forkoff (2);
++  var++;
++
++  return 0;
 +}
+diff --git a/gdb/testsuite/gdb.threads/watchpoint-fork.exp b/gdb/testsuite/gdb.threads/watchpoint-fork.exp
+new file mode 100644
+index 0000000..1dc93ab
+--- /dev/null
++++ b/gdb/testsuite/gdb.threads/watchpoint-fork.exp
+@@ -0,0 +1,130 @@
++# Copyright 2008, 2009 Free Software Foundation, Inc.
++
++# This program is free software; you can redistribute it and/or modify
++# it under the terms of the GNU General Public License as published by
++# the Free Software Foundation; either version 3 of the License, or
++# (at your option) any later version.
++#
++# This program is distributed in the hope that it will be useful,
++# but WITHOUT ANY WARRANTY; without even the implied warranty of
++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++# GNU General Public License for more details.
++#
++# You should have received a copy of the GNU General Public License
++# along with this program.  If not, see <http://www.gnu.org/licenses/>.
++
++# Test case for forgotten hw-watchpoints after fork()-off of a process.
++
++proc test {type symbol} {
++    global objdir subdir srcdir
 +
-+/* Add a new internal function.  NAME is the name of the function; DOC
-+   is a documentation string describing the function.  HANDLER is
-+   called when the function is invoked.  COOKIE is an arbitrary
-+   pointer which is passed to HANDLER and is intended for "user
-+   data".  */
-+void
-+add_internal_function (const char *name, const char *doc,
-+                     internal_function_fn handler, void *cookie)
-+{
-+  struct cmd_list_element *cmd;
-+  struct internalvar *var = lookup_internalvar (name);
-+  struct value *fnval = value_create_internal_function (name, handler, cookie);
-+  set_internalvar (var, fnval);
-+  var->canonical = 1;
++    set test watchpoint-fork
 +
-+  cmd = add_cmd (xstrdup (name), no_class, function_command, (char *) doc,
-+               &functionlist);
-+  cmd->destroyer = function_destroyer;
-+}
++    global pf_prefix
++    set prefix_test $pf_prefix
++    lappend pf_prefix "$type:"
++    set prefix_mt $pf_prefix
 +
- /* Update VALUE before discarding OBJFILE.  COPIED_TYPES is used to
-    prevent cycles / duplicates.  */
-@@ -1067,12 +1218,21 @@ preserve_one_value (struct value *value, struct objfile *objfile,
-                   htab_t copied_types)
- {
-   if (TYPE_OBJFILE (value->type) == objfile)
--    value->type = copy_type_recursive (objfile, value->type, copied_types);
-+    {
-+      /* No need to decref the old type here, since we know it has no
-+       reference count.  */
-+      value->type = copy_type_recursive (value->type, copied_types);
-+      type_incref (value->type);
++    # no threads
++
++    set pf_prefix $prefix_mt
++    lappend pf_prefix "singlethreaded:"
++
++    set executable ${test}-${type}
++    if { [gdb_compile ${srcdir}/${subdir}/${test}.c ${objdir}/${subdir}/${executable} executable [list debug additional_flags=-D$symbol]] != "" } {
++      untested ${test}.exp
++      return -1
 +    }
-   if (TYPE_OBJFILE (value->enclosing_type) == objfile)
--    value->enclosing_type = copy_type_recursive (objfile,
--                                               value->enclosing_type,
--                                               copied_types);
-+    {
-+      /* No need to decref the old type here, since we know it has no
-+       reference count.  */
-+      value->enclosing_type = copy_type_recursive (value->enclosing_type,
-+                                                 copied_types);
-+      type_incref (value->enclosing_type);
++    clean_restart $executable
++
++    gdb_test "show detach-on-fork" "Whether gdb will detach the child of a fork is on."
++    gdb_test "set follow-fork-mode $type"
++    gdb_test "show follow-fork-mode" "Debugger response to a program call of fork or vfork is \"$type\"."
++    # Testcase uses it for the `follow-fork-mode child' type.
++    gdb_test "handle SIGUSR1 nostop noprint pass"
++
++    if { ![runto_main] } then {
++      gdb_suppress_tests
++      return
 +    }
- }
- /* Update the internal variables and value history when OBJFILE is
-@@ -1196,7 +1356,7 @@ value_as_address (struct value *val)
-      Upon entry to this function, if VAL is a value of type `function'
-      (that is, TYPE_CODE (VALUE_TYPE (val)) == TYPE_CODE_FUNC), then
--     VALUE_ADDRESS (val) is the address of the function.  This is what
-+     value_address (val) is the address of the function.  This is what
-      you'll get if you evaluate an expression like `main'.  The call
-      to COERCE_ARRAY below actually does all the usual unary
-      conversions, which includes converting values of type `function'
-@@ -1216,7 +1376,7 @@ value_as_address (struct value *val)
-      function, just return its address directly.  */
-   if (TYPE_CODE (value_type (val)) == TYPE_CODE_FUNC
-       || TYPE_CODE (value_type (val)) == TYPE_CODE_METHOD)
--    return VALUE_ADDRESS (val);
-+    return value_address (val);
-   val = coerce_array (val);
-@@ -1447,7 +1607,7 @@ value_static_field (struct type *type, int fieldno)
-       }
-       if (retval && VALUE_LVAL (retval) == lval_memory)
-       SET_FIELD_PHYSADDR (TYPE_FIELD (type, fieldno),
--                          VALUE_ADDRESS (retval));
-+                          value_address (retval));
-     }
-   return retval;
- }
-@@ -1465,6 +1625,8 @@ value_change_enclosing_type (struct value *val, struct type *new_encl_type)
-     val->contents =
-       (gdb_byte *) xrealloc (val->contents, TYPE_LENGTH (new_encl_type));
-+  type_incref (new_encl_type);
-+  type_decref (val->enclosing_type);
-   val->enclosing_type = new_encl_type;
-   return val;
- }
-@@ -1516,6 +1678,8 @@ value_primitive_field (struct value *arg1, int offset,
-         memcpy (value_contents_all_raw (v), value_contents_all_raw (arg1),
-                 TYPE_LENGTH (value_enclosing_type (arg1)));
-       }
-+      type_incref (type);
-+      type_decref (v->type);
-       v->type = type;
-       v->offset = value_offset (arg1);
-       v->embedded_offset = (offset + value_embedded_offset (arg1)
-@@ -1592,7 +1756,7 @@ value_fn_field (struct value **arg1p, struct fn_field *f, int j, struct type *ty
-   v = allocate_value (ftype);
-   if (sym)
-     {
--      VALUE_ADDRESS (v) = BLOCK_START (SYMBOL_BLOCK_VALUE (sym));
-+      set_value_address (v, BLOCK_START (SYMBOL_BLOCK_VALUE (sym)));
-     }
-   else
-     {
-@@ -1601,9 +1765,9 @@ value_fn_field (struct value **arg1p, struct fn_field *f, int j, struct type *ty
-       struct objfile *objfile = msymbol_objfile (msym);
-       struct gdbarch *gdbarch = get_objfile_arch (objfile);
--      VALUE_ADDRESS (v)
--      = gdbarch_convert_from_func_ptr_addr
--         (gdbarch, SYMBOL_VALUE_ADDRESS (msym), &current_target);
-+      set_value_address (v,
-+      gdbarch_convert_from_func_ptr_addr
-+         (gdbarch, SYMBOL_VALUE_ADDRESS (msym), &current_target));
-     }
-   if (arg1p)
-@@ -1750,6 +1914,41 @@ pack_long (gdb_byte *buf, struct type *type, LONGEST num)
- }
-+/* Pack NUM into BUF using a target format of TYPE.  */
 +
-+void
-+pack_unsigned_long (gdb_byte *buf, struct type *type, ULONGEST num)
-+{
-+  int len;
++    # Install the watchpoint only after getting into MAIN - workaround some PPC
++    # problem.
++    gdb_test "watch var" "atchpoint 2: var" "Set the watchpoint"
 +
-+  type = check_typedef (type);
-+  len = TYPE_LENGTH (type);
++    # It is never hit but it should not be left over in the fork()ed-off child.
++    gdb_breakpoint "breakpoint"
 +
-+  switch (TYPE_CODE (type))
-+    {
-+    case TYPE_CODE_INT:
-+    case TYPE_CODE_CHAR:
-+    case TYPE_CODE_ENUM:
-+    case TYPE_CODE_FLAGS:
-+    case TYPE_CODE_BOOL:
-+    case TYPE_CODE_RANGE:
-+    case TYPE_CODE_MEMBERPTR:
-+      store_unsigned_integer (buf, len, num);
-+      break;
++    gdb_test "continue" \
++           "atchpoint 2: var.*Old value = 0.*New value = 1.*forkoff *\\(1\\).*" "watchpoints work"
++    gdb_test "continue" \
++           "reakpoint 3, breakpoint.*" "breakpoint after the first fork"
++    gdb_test "continue" \
++           "atchpoint 2: var.*Old value = 1.*New value = 2.*forkoff *\\(2\\).*" "watchpoint after the first fork"
++    gdb_test "continue" \
++           "reakpoint 3, breakpoint.*" "breakpoint after the second fork"
++    gdb_test "continue" \
++           "atchpoint 2: var.*Old value = 2.*New value = 3.*return *0;" "watchpoint after the second fork"
++    gdb_test "continue" "Continuing..*Program exited normally." "finish"
 +
-+    case TYPE_CODE_REF:
-+    case TYPE_CODE_PTR:
-+      store_typed_address (buf, type, (CORE_ADDR) num);
-+      break;
 +
-+    default:
-+      error (_("\
-+Unexpected type (%d) encountered for unsigned integer constant."),
-+           TYPE_CODE (type));
++    # threads
++
++    set pf_prefix $prefix_mt
++    lappend pf_prefix "multithreaded:"
++
++    set executable ${test}-mt-${type}
++    if { [gdb_compile_pthreads ${srcdir}/${subdir}/${test}-mt.c ${objdir}/${subdir}/${executable} executable [list debug additional_flags=-D$symbol]] != "" } {
++      untested ${test}.exp
++      return -1
 +    }
-+}
++    clean_restart $executable
 +
++    gdb_test "set follow-fork-mode $type"
++    # Testcase uses it for the `follow-fork-mode child' type.
++    gdb_test "handle SIGUSR1 nostop noprint pass"
 +
- /* Convert C numbers into newly allocated values.  */
- struct value *
-@@ -1763,6 +1962,19 @@ value_from_longest (struct type *type, LONGEST num)
- }
-+/* Convert C unsigned numbers into newly allocated values.  */
++    if { ![runto_main] } then {
++      gdb_suppress_tests
++      return
++    }
 +
-+struct value *
-+value_from_ulongest (struct type *type, ULONGEST num)
-+{
-+  struct value *val = allocate_value (type);
++    # Install the watchpoint only after getting into MAIN - workaround some PPC
++    # problem.
++    gdb_test "watch var" "atchpoint 2: var" "Set the watchpoint"
 +
-+  pack_unsigned_long (value_contents_raw (val), type, num);
++    # It is never hit but it should not be left over in the fork()ed-off child.
++    gdb_breakpoint "breakpoint"
 +
-+  return val;
-+}
++    gdb_test "continue" \
++           "atchpoint 2: var.*Old value = 0.*New value = 1.*validity-first.*" "singlethread watchpoints work"
++    gdb_test "continue" \
++           "atchpoint 2: var.*Old value = 1.*New value = 2.*validity-thread-A.*" "multithreaded watchpoints work at A"
++    gdb_test "continue" \
++           "atchpoint 2: var.*Old value = 2.*New value = 3.*validity-thread-B.*" "multithreaded watchpoints work at B"
++    gdb_test "continue" \
++           "reakpoint 3, breakpoint.*" "breakpoint (A) after the first fork"
++    gdb_test "continue" \
++           "atchpoint 2: var.*Old value = 3.*New value = 4.*after-fork1-A.*" "watchpoint A after the first fork"
++    gdb_test "continue" \
++           "atchpoint 2: var.*Old value = 4.*New value = 5.*after-fork1-B.*" "watchpoint B after the first fork"
++    gdb_test "continue" \
++           "reakpoint 3, breakpoint.*" "breakpoint (A) after the second fork"
++    gdb_test "continue" \
++           "atchpoint 2: var.*Old value = 5.*New value = 6.*after-fork2-A.*" "watchpoint A after the second fork"
++    gdb_test "continue" \
++           "atchpoint 2: var.*Old value = 6.*New value = 7.*after-fork2-B.*" "watchpoint B after the second fork"
++    gdb_test "continue" "Continuing..*Program exited normally." "finish"
 +
 +
- /* Create a value representing a pointer of type TYPE to the address
-    ADDR.  */
- struct value *
-@@ -1816,8 +2028,9 @@ value_from_contents_and_address (struct type *type,
-     set_value_lazy (v, 1);
-   else
-     memcpy (value_contents_raw (v), valaddr, TYPE_LENGTH (type));
--  VALUE_ADDRESS (v) = address;
--  VALUE_LVAL (v) = lval_memory;
-+  set_value_address (v, address);
-+  if (address != 0)
-+    VALUE_LVAL (v) = lval_memory;
-   return v;
- }
-@@ -1944,4 +2157,15 @@ init-if-undefined VARIABLE = EXPRESSION\n\
- Set an internal VARIABLE to the result of the EXPRESSION if it does not\n\
- exist or does not contain a value.  The EXPRESSION is not evaluated if the\n\
- VARIABLE is already initialized."));
++    # cleanup
 +
-+  add_prefix_cmd ("function", no_class, function_command, _("\
-+Placeholder command for showing help on convenience functions."),
-+                &functionlist, "function ", 0, &cmdlist);
++    set pf_prefix $prefix_test
++}
 +
-+  internal_fn_type = alloc_type (OBJFILE_INTERNAL, NULL);
-+  TYPE_CODE (internal_fn_type) = TYPE_CODE_INTERNAL_FUNCTION;
-+  TYPE_LENGTH (internal_fn_type) = sizeof (struct internal_function *);
-+  TYPE_NAME (internal_fn_type) = "<internal function>";
++test parent FOLLOW_PARENT
 +
-+  make_final_cleanup (value_history_cleanup, NULL);
- }
-diff --git a/gdb/value.h b/gdb/value.h
-index aa43365..1ad3c75 100644
---- a/gdb/value.h
-+++ b/gdb/value.h
-@@ -272,12 +272,23 @@ extern void set_value_component_location (struct value *component,
- extern enum lval_type *deprecated_value_lval_hack (struct value *);
- #define VALUE_LVAL(val) (*deprecated_value_lval_hack (val))
--/* If lval == lval_memory, this is the address in the inferior.  If
--   lval == lval_register, this is the byte offset into the registers
--   structure.  */
-+/* Backward compatibility for the Fedora merge branch.  */
- extern CORE_ADDR *deprecated_value_address_hack (struct value *);
- #define VALUE_ADDRESS(val) (*deprecated_value_address_hack (val))
-+/* If lval == lval_memory, return the address in the inferior.  If
-+   lval == lval_register, return the byte offset into the registers
-+   structure.  Otherwise, return 0.  The returned address
-+   includes the offset, if any.  */
-+extern CORE_ADDR value_address (struct value *);
-+
-+/* Like value_address, except the result does not include value's
-+   offset.  */
-+extern CORE_ADDR value_raw_address (struct value *);
-+
-+/* Set the address of a value.  */
-+extern void set_value_address (struct value *, CORE_ADDR);
-+
- /* Pointer to internal variable.  */
- extern struct internalvar **deprecated_value_internalvar_hack (struct value *);
- #define VALUE_INTERNALVAR(val) (*deprecated_value_internalvar_hack (val))
-@@ -314,6 +325,9 @@ struct internalvar
-   struct value *value;
-   internalvar_make_value make_value;
-   int endian;
-+  /* True if this internalvar is the canonical name for a convenience
-+     function.  */
-+  int canonical;
- };
\f
-@@ -342,12 +356,17 @@ extern LONGEST unpack_field_as_long (struct type *type,
- extern void pack_long (gdb_byte *buf, struct type *type, LONGEST num);
- extern struct value *value_from_longest (struct type *type, LONGEST num);
-+extern struct value *value_from_ulongest (struct type *type, ULONGEST num);
- extern struct value *value_from_pointer (struct type *type, CORE_ADDR addr);
- extern struct value *value_from_double (struct type *type, DOUBLEST num);
- extern struct value *value_from_decfloat (struct type *type,
-                                         const gdb_byte *decbytes);
- extern struct value *value_from_string (char *string);
-+extern const char *object_address_data_not_valid (struct type *type);
-+extern int object_address_get_data (struct type *type,
-+                                  CORE_ADDR *address_return);
++# Only GNU/Linux is known to support `set follow-fork-mode child'.
++if {[istarget "*-*-linux*"]} {
++    test child FOLLOW_CHILD
++}
+diff --git a/gdb/testsuite/gdb.threads/watchthreads-reorder.c b/gdb/testsuite/gdb.threads/watchthreads-reorder.c
+new file mode 100644
+index 0000000..14f42d6
+--- /dev/null
++++ b/gdb/testsuite/gdb.threads/watchthreads-reorder.c
+@@ -0,0 +1,366 @@
++/* This testcase is part of GDB, the GNU debugger.
 +
- extern struct value *value_at (struct type *type, CORE_ADDR addr);
- extern struct value *value_at_lazy (struct type *type, CORE_ADDR addr);
-@@ -388,6 +407,8 @@ extern struct value *value_mark (void);
- extern void value_free_to_mark (struct value *mark);
-+extern struct value *value_typed_string (char *ptr, int len,
-+                                       struct type *char_type);
- extern struct value *value_string (char *ptr, int len);
- extern struct value *value_bitstring (char *ptr, int len);
-@@ -435,6 +456,7 @@ extern struct value *value_struct_elt (struct value **argp,
- extern struct value *value_aggregate_elt (struct type *curtype,
-                                         char *name,
-+                                        struct type *expect_type,
-                                         int want_address,
-                                         enum noside noside);
-@@ -533,14 +555,14 @@ extern void set_internalvar_component (struct internalvar *var,
-                                      int bitpos, int bitsize,
-                                      struct value *newvalue);
--extern struct internalvar *lookup_only_internalvar (char *name);
-+extern struct internalvar *lookup_only_internalvar (const char *name);
--extern struct internalvar *create_internalvar (char *name);
-+extern struct internalvar *create_internalvar (const char *name);
- extern struct internalvar *
-   create_internalvar_type_lazy (char *name, internalvar_make_value fun);
--extern struct internalvar *lookup_internalvar (char *name);
-+extern struct internalvar *lookup_internalvar (const char *name);
- extern int value_equal (struct value *arg1, struct value *arg2);
-@@ -619,7 +641,7 @@ extern int common_val_print (struct value *val,
-                            const struct value_print_options *options,
-                            const struct language_defn *language);
--extern int val_print_string (CORE_ADDR addr, int len, int width,
-+extern int val_print_string (struct type *elttype, CORE_ADDR addr, int len,
-                            struct ui_file *stream,
-                            const struct value_print_options *options);
-@@ -658,5 +680,22 @@ extern struct value *value_allocate_space_in_inferior (int);
- extern struct value *value_of_local (const char *name, int complain);
--extern struct value * value_subscripted_rvalue (struct value *array, struct value *idx, int lowerbound);
-+extern struct value *value_subscripted_rvalue (struct value *array,
-+                                             CORE_ADDR offset);
++   Copyright 2009 Free Software Foundation, Inc.
 +
-+/* User function handler.  */
++   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.
 +
-+typedef struct value *(*internal_function_fn) (void *cookie,
-+                                             int argc,
-+                                             struct value **argv);
++   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.
 +
-+void add_internal_function (const char *name, const char *doc,
-+                          internal_function_fn handler,
-+                          void *cookie);
++   You should have received a copy of the GNU General Public License
++   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 +
-+struct value *call_internal_function (struct value *function,
-+                                    int argc, struct value **argv);
++#define _GNU_SOURCE
++#include <pthread.h>
++#include <stdio.h>
++#include <limits.h>
++#include <errno.h>
++#include <stdlib.h>
++#include <string.h>
++#include <assert.h>
++#include <sys/types.h>
++#include <signal.h>
++#include <unistd.h>
++#include <asm/unistd.h>
 +
-+char *value_internal_function_name (struct value *);
++#define gettid() syscall (__NR_gettid)
 +
- #endif /* !defined (VALUE_H) */
-diff --git a/gdb/varobj.c b/gdb/varobj.c
-index 2ec6d90..1237c96 100644
---- a/gdb/varobj.c
-+++ b/gdb/varobj.c
-@@ -29,11 +29,20 @@
- #include "gdb_assert.h"
- #include "gdb_string.h"
-+#include "gdb_regex.h"
- #include "varobj.h"
- #include "vec.h"
- #include "gdbthread.h"
- #include "inferior.h"
-+#include "valprint.h"
++/* Terminate always in the main task, it can lock up with SIGSTOPped GDB
++   otherwise.  */
++#define TIMEOUT (gettid () == getpid() ? 10 : 15)
 +
-+#if HAVE_PYTHON
-+#include "python/python.h"
-+#include "python/python-internal.h"
-+#else
-+typedef int PyObject;
-+#endif
- /* Non-zero if we want to see trace of varobj level stuff.  */
-@@ -138,6 +147,12 @@ struct varobj
-   /* Children of this object.  */
-   VEC (varobj_p) *children;
-+  /* Whether the children of this varobj were requested.  This field is
-+     used to decide if dynamic varobj should recompute their children.
-+     In the event that the frontend never asked for the children, we
-+     can avoid that.  */
-+  int children_requested;
++static pthread_mutex_t gdbstop_mutex = PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP;
 +
-   /* Description of the root variable. Points to root variable for children. */
-   struct varobj_root *root;
-@@ -159,6 +174,16 @@ struct varobj
-      not fetched if either the variable is frozen, or any parents is
-      frozen.  */
-   int not_fetched;
++static pid_t thread1_tid;
++static pthread_cond_t thread1_tid_cond = PTHREAD_COND_INITIALIZER;
++static pthread_mutex_t thread1_tid_mutex = PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP;
 +
-+  /* Sub-range of children which the MI consumer has requested.  If
-+     FROM < 0 or TO < 0, means that all children have been
-+     requested.  */
-+  int from;
-+  int to;
++static pid_t thread2_tid;
++static pthread_cond_t thread2_tid_cond = PTHREAD_COND_INITIALIZER;
++static pthread_mutex_t thread2_tid_mutex = PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP;
 +
-+  /* The pretty-printer that has been constructed.  If NULL, then a
-+     new printer object is needed, and one will be constructed.  */
-+  PyObject *pretty_printer;
- };
- struct cpstack
-@@ -190,6 +215,10 @@ static void uninstall_variable (struct varobj *);
- static struct varobj *create_child (struct varobj *, int, char *);
-+static struct varobj *
-+create_child_with_value (struct varobj *parent, int index, const char *name,
-+                       struct value *value);
++static pthread_mutex_t terminate_mutex = PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP;
 +
- /* Utility routines */
- static struct varobj *new_variable (void);
-@@ -200,6 +229,8 @@ static void free_variable (struct varobj *var);
- static struct cleanup *make_cleanup_free_variable (struct varobj *var);
-+static struct cleanup *make_cleanup_uninstall_variable (struct varobj *var);
++static volatile int thread1_rwatch;
++static volatile int thread2_rwatch;
 +
- static struct type *get_type (struct varobj *var);
- static struct type *get_value_type (struct varobj *var);
-@@ -215,6 +246,8 @@ static char *cppop (struct cpstack **pstack);
- static int install_new_value (struct varobj *var, struct value *value, 
-                             int initial);
-+static void install_default_visualizer (struct varobj *var);
++static int unused1_rwatch;
++static int unused2_rwatch;
 +
- /* Language-specific routines. */
- static enum varobj_languages variable_language (struct varobj *var);
-@@ -232,13 +265,17 @@ static struct value *value_of_child (struct varobj *parent, int index);
- static char *my_value_of_variable (struct varobj *var,
-                                  enum varobj_display_formats format);
--static char *value_get_print_value (struct value *value,
--                                  enum varobj_display_formats format);
-+char *value_get_print_value (struct value *value,
-+                           enum varobj_display_formats format,
-+                           PyObject *value_formatter);
- static int varobj_value_is_changeable_p (struct varobj *var);
- static int is_root_p (struct varobj *var);
-+static struct varobj *
-+varobj_add_child (struct varobj *var, const char *name, struct value *value);
++/* Do not use alarm as it would create a ptrace event which would hang up us if
++ * we are being traced by GDB which we stopped ourselves.  */
 +
- /* C implementation */
- static int c_number_of_children (struct varobj *var);
-@@ -570,8 +607,10 @@ varobj_create (char *objname,
-         do_cleanups (old_chain);
-         return NULL;
-       }
-+      make_cleanup_uninstall_variable (var);
-     }
-+  install_default_visualizer (var);
-   discard_cleanups (old_chain);
-   return var;
- }
-@@ -678,6 +717,33 @@ varobj_delete (struct varobj *var, char ***dellist, int only_children)
-   return delcount;
- }
-+/* Convenience function for varobj_set_visualizer.  Instantiate a
-+   pretty-printer for a given value.  */
-+static PyObject *
-+instantiate_pretty_printer (PyObject *constructor, struct value *value)
++static void timed_mutex_lock (pthread_mutex_t *mutex)
 +{
-+#if HAVE_PYTHON
-+  PyObject *val_obj = NULL; 
-+  PyObject *printer;
-+  volatile struct gdb_exception except;
++  int i;
++  struct timespec start, now;
 +
-+  TRY_CATCH (except, RETURN_MASK_ALL)
++  i = clock_gettime (CLOCK_MONOTONIC, &start);
++  assert (i == 0);
++
++  do
 +    {
-+      value = value_copy (value);
-+    }
-+  GDB_PY_HANDLE_EXCEPTION (except);
-+  val_obj = value_to_value_object (value);
++      i = pthread_mutex_trylock (mutex);
++      if (i == 0)
++      return;
++      assert (i == EBUSY);
 +
-+  if (! val_obj)
-+    return NULL;
++      i = clock_gettime (CLOCK_MONOTONIC, &now);
++      assert (i == 0);
++      assert (now.tv_sec >= start.tv_sec);
++    }
++  while (now.tv_sec - start.tv_sec < TIMEOUT);
 +
-+  printer = gdbpy_instantiate_printer (constructor, val_obj);
-+  Py_DECREF (val_obj);
-+  return printer;
-+#endif
-+  return NULL;
++  fprintf (stderr, "Timed out waiting for internal lock!\n");
++  exit (EXIT_FAILURE);
 +}
 +
- /* Set/Get variable object display format */
- enum varobj_display_formats
-@@ -702,7 +768,8 @@ varobj_set_display_format (struct varobj *var,
-       && var->value && !value_lazy (var->value))
-     {
-       xfree (var->print_value);
--      var->print_value = value_get_print_value (var->value, var->format);
-+      var->print_value = value_get_print_value (var->value, var->format,
-+                                              var->pretty_printer);
-     }
-   return var->format;
-@@ -714,6 +781,21 @@ varobj_get_display_format (struct varobj *var)
-   return var->format;
- }
-+char *
-+varobj_get_display_hint (struct varobj *var)
++static void *
++thread1_func (void *unused)
 +{
-+  char *result = NULL;
++  int i;
++  volatile int rwatch_store;
 +
-+#if HAVE_PYTHON
-+  PyGILState_STATE state = PyGILState_Ensure ();
-+  if (var->pretty_printer)
-+    result = gdbpy_get_display_hint (var->pretty_printer);
-+  PyGILState_Release (state);
-+#endif
++  thread1_tid = gettid ();
++  i = pthread_cond_signal (&thread1_tid_cond);
++  assert (i == 0);
 +
-+  return result;
-+}
++  /* Be sure GDB is already stopped before continuing.  */
++  timed_mutex_lock (&gdbstop_mutex);
++  i = pthread_mutex_unlock (&gdbstop_mutex);
++  assert (i == 0);
 +
- /* If the variable object is bound to a specific thread, that
-    is its evaluation can always be done in context of a frame
-    inside that thread, returns GDB id of the thread -- which
-@@ -746,12 +828,141 @@ varobj_get_frozen (struct varobj *var)
-   return var->frozen;
- }
-+static int
-+update_dynamic_varobj_children (struct varobj *var,
-+                              VEC (varobj_p) **changed,
-+                              VEC (varobj_p) **new_and_unchanged,
-+                              int *cchanged)
++  rwatch_store = thread1_rwatch;
 +
-+{
-+#if HAVE_PYTHON
-+  /* FIXME: we *might* want to provide this functionality as
-+     a standalone function, so that other interested parties
-+     than varobj code can benefit for this.  */
-+  struct cleanup *back_to;
-+  PyObject *children;
-+  PyObject *iterator;
++  /* Be sure the "T (tracing stop)" test can proceed for both threads.  */
++  timed_mutex_lock (&terminate_mutex);
++  i = pthread_mutex_unlock (&terminate_mutex);
++  assert (i == 0);
++
++  return NULL;
++}
++
++static void *
++thread2_func (void *unused)
++{
 +  int i;
-+  int children_changed = 0;
-+  PyObject *printer = var->pretty_printer;
-+  PyGILState_STATE state;
++  volatile int rwatch_store;
 +
-+  state = PyGILState_Ensure ();
-+  back_to = make_cleanup_py_restore_gil (&state);
++  thread2_tid = gettid ();
++  i = pthread_cond_signal (&thread2_tid_cond);
++  assert (i == 0);
 +
-+  *cchanged = 0;
-+  if (!PyObject_HasAttr (printer, gdbpy_children_cst))
-+    {
-+      do_cleanups (back_to);
-+      return 0;
-+    }
++  /* Be sure GDB is already stopped before continuing.  */
++  timed_mutex_lock (&gdbstop_mutex);
++  i = pthread_mutex_unlock (&gdbstop_mutex);
++  assert (i == 0);
 +
-+  children = PyObject_CallMethodObjArgs (printer, gdbpy_children_cst,
-+                                       NULL);
++  rwatch_store = thread2_rwatch;
 +
-+  if (!children)
-+    {
-+      gdbpy_print_stack ();
-+      error ("Null value returned for children");
-+    }
++  /* Be sure the "T (tracing stop)" test can proceed for both threads.  */
++  timed_mutex_lock (&terminate_mutex);
++  i = pthread_mutex_unlock (&terminate_mutex);
++  assert (i == 0);
 +
-+  make_cleanup_py_decref (children);
++  return NULL;
++}
 +
-+  if (!PyIter_Check (children))
-+    error ("Returned value is not iterable");
++static const char *
++proc_string (const char *filename, const char *line)
++{
++  FILE *f;
++  static char buf[LINE_MAX];
++  size_t line_len = strlen (line);
 +
-+  iterator = PyObject_GetIter (children);
-+  if (!iterator)
++  f = fopen (filename, "r");
++  if (f == NULL)
 +    {
-+      gdbpy_print_stack ();
-+      error ("Could not get children iterator");
++      fprintf (stderr, "fopen (\"%s\") for \"%s\": %s\n", filename, line,
++             strerror (errno));
++      exit (EXIT_FAILURE);
 +    }
-+  make_cleanup_py_decref (iterator);
-+
-+  for (i = 0; ; ++i)
++  while (errno = 0, fgets (buf, sizeof (buf), f))
 +    {
-+      PyObject *item = PyIter_Next (iterator);
-+      PyObject *py_v;
-+      struct value *v;
-+      char *name;
-+      struct cleanup *inner;
-+      
-+      if (!item)
-+      break;
-+      inner = make_cleanup_py_decref (item);
++      char *s;
 +
-+      if (!PyArg_ParseTuple (item, "sO", &name, &py_v))
-+      error ("Invalid item from the child list");
-+      
-+      if (PyObject_TypeCheck (py_v, &value_object_type))
-+      {
-+        /* If we just call convert_value_from_python for this type,
-+           we won't know who owns the result.  For this one case we
-+           need to copy the resulting value.  */
-+        v = value_object_to_value (py_v);
-+        v = value_copy (v);
-+      }
-+      else
-+      v = convert_value_from_python (py_v);
++      s = strchr (buf, '\n');
++      assert (s != NULL);
++      *s = 0;
 +
-+      /* TODO: This assume the name of the i-th child never changes.  */
++      if (strncmp (buf, line, line_len) != 0)
++      continue;
 +
-+      /* Now see what to do here.  */
-+      if (VEC_length (varobj_p, var->children) < i + 1)
-+      {
-+        /* There's no child yet.  */
-+        struct varobj *child = varobj_add_child (var, name, v);
-+        if (new_and_unchanged)
-+          VEC_safe_push (varobj_p, *new_and_unchanged, child);
-+        children_changed = 1;
-+      }
-+      else 
++      if (fclose (f))
 +      {
-+        varobj_p existing = VEC_index (varobj_p, var->children, i);
-+        if (install_new_value (existing, v, 0) && changed)
-+          {
-+            if (changed)
-+              VEC_safe_push (varobj_p, *changed, existing);
-+          }
-+        else
-+          {
-+            if (new_and_unchanged)
-+              VEC_safe_push (varobj_p, *new_and_unchanged, existing);
-+          }
++        fprintf (stderr, "fclose (\"%s\") for \"%s\": %s\n", filename, line,
++                 strerror (errno));
++        exit (EXIT_FAILURE);
 +      }
 +
-+      do_cleanups (inner);
++      return &buf[line_len];
 +    }
-+
-+  if (i < VEC_length (varobj_p, var->children))
++  if (errno != 0)
 +    {
-+      int i;
-+      children_changed = 1;
-+      for (i = 0; i < VEC_length (varobj_p, var->children); ++i)
-+      varobj_delete (VEC_index (varobj_p, var->children, i), NULL, 0);
++      fprintf (stderr, "fgets (\"%s\": %s\n", filename, strerror (errno));
++      exit (EXIT_FAILURE);
 +    }
-+  VEC_truncate (varobj_p, var->children, i);
-+  var->num_children = VEC_length (varobj_p, var->children);
-+ 
-+  do_cleanups (back_to);
-+
-+  *cchanged = children_changed;
-+  return 1;
-+#else
-+  gdb_assert (0 && "should never be called if Python is not enabled");
-+#endif
++  fprintf (stderr, "\"%s\": No line \"%s\" found.\n", filename, line);
++  exit (EXIT_FAILURE);
 +}
- int
- varobj_get_num_children (struct varobj *var)
- {
-   if (var->num_children == -1)
--    var->num_children = number_of_children (var);
++
++static unsigned long
++proc_ulong (const char *filename, const char *line)
++{
++  const char *s = proc_string (filename, line);
++  long retval;
++  char *end;
++
++  errno = 0;
++  retval = strtol (s, &end, 10);
++  if (retval < 0 || retval >= LONG_MAX || (end && *end))
 +    {
-+      int changed;
-+      if (!var->pretty_printer
-+        || !update_dynamic_varobj_children (var, NULL, NULL, &changed))
-+      var->num_children = number_of_children (var);
++      fprintf (stderr, "\"%s\":\"%s\": %ld, %s\n", filename, line, retval,
++             strerror (errno));
++      exit (EXIT_FAILURE);
 +    }
-   return var->num_children;
- }
-@@ -764,7 +975,16 @@ varobj_list_children (struct varobj *var)
- {
-   struct varobj *child;
-   char *name;
--  int i;
-+  int i, children_changed;
-+
-+  var->children_requested = 1;
-+
-+  if (var->pretty_printer
-+      /* This, in theory, can result in the number of children changing without
-+       frontend noticing.  But well, calling -var-list-children on the same
-+       varobj twice is not something a sane frontend would do.  */
-+      && update_dynamic_varobj_children (var, NULL, NULL, &children_changed))
-+    return var->children;
-   if (var->num_children == -1)
-     var->num_children = number_of_children (var);
-@@ -790,12 +1010,24 @@ varobj_list_children (struct varobj *var)
-         name = name_of_child (var, i);
-         existing = create_child (var, i, name);
-         VEC_replace (varobj_p, var->children, i, existing);
-+        install_default_visualizer (existing);
-       }
-     }
-   return var->children;
- }
-+static struct varobj *
-+varobj_add_child (struct varobj *var, const char *name, struct value *value)
-+{
-+  varobj_p v = create_child_with_value (var, 
-+                                      VEC_length (varobj_p, var->children), 
-+                                      name, value);
-+  VEC_safe_push (varobj_p, var->children, v);
-+  install_default_visualizer (v);
-+  return v;
++  return retval;
 +}
 +
- /* Obtain the type of an object Variable as a string similar to the one gdb
-    prints on the console */
-@@ -1002,6 +1234,13 @@ install_new_value (struct varobj *var, struct value *value, int initial)
-      a type. */
-   gdb_assert (var->type || CPLUS_FAKE_CHILD (var));
-   changeable = varobj_value_is_changeable_p (var);
++static void
++state_wait (pid_t process, const char *wanted)
++{
++  char *filename;
++  int i;
++  struct timespec start, now;
++  const char *state;
 +
-+  /* If the type has custom visualizer, we consider it to be always
-+     changeable. FIXME: need to make sure this behaviour will not
-+     mess up read-sensitive values.  */
-+  if (var->pretty_printer)
-+    changeable = 1;
++  i = asprintf (&filename, "/proc/%lu/status", (unsigned long) process);
++  assert (i > 0);
 +
-   need_to_fetch = changeable;
-   /* We are not interested in the address of references, and given
-@@ -1053,12 +1292,14 @@ install_new_value (struct varobj *var, struct value *value, int initial)
-       }
-     }
++  i = clock_gettime (CLOCK_MONOTONIC, &start);
++  assert (i == 0);
 +
-   /* Below, we'll be comparing string rendering of old and new
-      values.  Don't get string rendering if the value is
-      lazy -- if it is, the code above has decided that the value
-      should not be fetched.  */
-   if (value && !value_lazy (value))
--      print_value = value_get_print_value (value, var->format);
-+    print_value = value_get_print_value (value, var->format, 
-+                                       var->pretty_printer);
-   /* If the type is changeable, compare the old and the new values.
-      If this is the initial assignment, we don't have any old value
-@@ -1123,6 +1364,150 @@ install_new_value (struct varobj *var, struct value *value, int initial)
-   return changed;
- }
-+/* Return the effective requested range for a varobj.  VAR is the
-+   varobj.  CHILDREN is the computed list of children.  FROM and TO
-+   are out parameters.  If VAR has no bounds selected, *FROM and *TO
-+   will be set to the full range of CHILDREN.  Otherwise, *FROM and
-+   *TO will be set to the selected sub-range of VAR, clipped to be in
-+   range of CHILDREN.  */
-+void
-+varobj_get_child_range (struct varobj *var, VEC (varobj_p) *children,
-+                      int *from, int *to)
-+{
-+  if (var->from < 0 || var->to < 0)
-+    {
-+      *from = 0;
-+      *to = VEC_length (varobj_p, children);
-+    }
-+  else
++  do
 +    {
-+      *from = var->from;
-+      if (*from > VEC_length (varobj_p, children))
-+      *from = VEC_length (varobj_p, children);
-+      *to = var->to;
-+      if (*to > VEC_length (varobj_p, children))
-+      *to = VEC_length (varobj_p, children);
++      state = proc_string (filename, "State:\t");
++      if (strcmp (state, wanted) == 0)
++      {
++        free (filename);
++        return;
++      }
++
++      if (sched_yield ())
++      {
++        perror ("sched_yield()");
++        exit (EXIT_FAILURE);
++      }
++
++      i = clock_gettime (CLOCK_MONOTONIC, &now);
++      assert (i == 0);
++      assert (now.tv_sec >= start.tv_sec);
 +    }
-+}
++  while (now.tv_sec - start.tv_sec < TIMEOUT);
 +
-+/* Set the selected sub-range of children of VAR to start at index
-+   FROM and end at index TO.  If either FROM or TO is less than zero,
-+   this is interpreted as a request for all children.  */
-+void
-+varobj_set_child_range (struct varobj *var, int from, int to)
-+{
-+  var->from = from;
-+  var->to = to;
++  fprintf (stderr, "Timed out waiting for PID %lu \"%s\" (now it is \"%s\")!\n",
++         (unsigned long) process, wanted, state);
++  exit (EXIT_FAILURE);
 +}
 +
++static volatile pid_t tracer = 0;
++static pthread_t thread1, thread2;
++
 +static void
-+install_visualizer (struct varobj *var, PyObject *visualizer)
++cleanup (void)
 +{
-+#if HAVE_PYTHON
-+  /* If there are any children now, wipe them.  */
-+  varobj_delete (var, NULL, 1 /* children only */);
-+  var->num_children = -1;
++  printf ("Resuming GDB PID %lu.\n", (unsigned long) tracer);
 +
-+  Py_XDECREF (var->pretty_printer);
-+  var->pretty_printer = visualizer;
++  if (tracer)
++    {
++      int i;
++      int tracer_save = tracer;
 +
-+  install_new_value (var, var->value, 1);
++      tracer = 0;
 +
-+  /* If we removed the visualizer, and the user ever requested the
-+     object's children, then we must compute the list of children.
-+     Note that we needn't do this when installing a visualizer,
-+     because updating will recompute dynamic children.  */
-+  if (!visualizer && var->children_requested)
-+    varobj_list_children (var);
-+#else
-+  error ("Python support required");
-+#endif
++      i = kill (tracer_save, SIGCONT);
++      assert (i == 0);
++    }
 +}
 +
-+static void
-+install_default_visualizer (struct varobj *var)
++int
++main (int argc, char **argv)
 +{
-+#if HAVE_PYTHON
-+  struct cleanup *cleanup;
-+  PyGILState_STATE state;
-+  PyObject *pretty_printer = NULL;
++  int i;
++  int standalone = 0;
 +
-+  state = PyGILState_Ensure ();
-+  cleanup = make_cleanup_py_restore_gil (&state);
++  if (argc == 2 && strcmp (argv[1], "-s") == 0)
++    standalone = 1;
++  else
++    assert (argc == 1);
 +
-+  if (var->value)
++  setbuf (stdout, NULL);
++
++  timed_mutex_lock (&gdbstop_mutex);
++
++  timed_mutex_lock (&terminate_mutex);
++
++  i = pthread_create (&thread1, NULL, thread1_func, NULL);
++  assert (i == 0);
++
++  i = pthread_create (&thread2, NULL, thread2_func, NULL);
++  assert (i == 0);
++
++  if (!standalone)
 +    {
-+      pretty_printer = gdbpy_get_varobj_pretty_printer (var->value);
-+      if (! pretty_printer)
++      tracer = proc_ulong ("/proc/self/status", "TracerPid:\t");
++      if (tracer == 0)
++      {
++        fprintf (stderr, "The testcase must be run by GDB!\n");
++        exit (EXIT_FAILURE);
++      }
++      if (tracer != getppid ())
 +      {
-+        gdbpy_print_stack ();
-+        error (_("Cannot instantiate printer for default visualizer"));
++        fprintf (stderr, "The testcase parent must be our GDB tracer!\n");
++        exit (EXIT_FAILURE);
 +      }
 +    }
-+      
-+  if (pretty_printer == Py_None)
++
++  /* SIGCONT our debugger in the case of our crash as we would deadlock
++     otherwise.  */
++
++  atexit (cleanup);
++
++  printf ("Stopping GDB PID %lu.\n", (unsigned long) tracer);
++
++  if (tracer)
 +    {
-+      Py_DECREF (pretty_printer);
-+      pretty_printer = NULL;
++      i = kill (tracer, SIGSTOP);
++      assert (i == 0);
++      state_wait (tracer, "T (stopped)");
 +    }
-+  
-+  install_visualizer (var, pretty_printer);
-+  do_cleanups (cleanup);
-+#else
-+  /* No error is right as this function is inserted just as a hook.  */
-+#endif
-+}
 +
-+void 
-+varobj_set_visualizer (struct varobj *var, const char *visualizer)
-+{
-+#if HAVE_PYTHON
-+  PyObject *mainmod, *globals, *pretty_printer, *constructor;
-+  struct cleanup *back_to, *value;
-+  PyGILState_STATE state;
++  timed_mutex_lock (&thread1_tid_mutex);
++  timed_mutex_lock (&thread2_tid_mutex);
 +
++  /* Let the threads start.  */
++  i = pthread_mutex_unlock (&gdbstop_mutex);
++  assert (i == 0);
 +
-+  state = PyGILState_Ensure ();
-+  back_to = make_cleanup_py_restore_gil (&state);
++  printf ("Waiting till the threads initialize their TIDs.\n");
 +
-+  mainmod = PyImport_AddModule ("__main__");
-+  globals = PyModule_GetDict (mainmod);
-+  Py_INCREF (globals);
-+  make_cleanup_py_decref (globals);
++  if (thread1_tid == 0)
++    {
++      i = pthread_cond_wait (&thread1_tid_cond, &thread1_tid_mutex);
++      assert (i == 0);
 +
-+  constructor = PyRun_String (visualizer, Py_eval_input, globals, globals);
-+  
-+  /* Do not instantiate NoneType. */
-+  if (constructor == Py_None)
++      assert (thread1_tid > 0);
++    }
++
++  if (thread2_tid == 0)
 +    {
-+      pretty_printer = Py_None;
-+      Py_INCREF (pretty_printer);
++      i = pthread_cond_wait (&thread2_tid_cond, &thread2_tid_mutex);
++      assert (i == 0);
++
++      assert (thread2_tid > 0);
 +    }
-+  else
-+    pretty_printer = instantiate_pretty_printer (constructor, var->value);
 +
-+  Py_XDECREF (constructor);
++  printf ("Thread 1 TID = %lu, thread 2 TID = %lu, PID = %lu.\n",
++        (unsigned long) thread1_tid, (unsigned long) thread2_tid,
++        (unsigned long) getpid ());
++
++  printf ("Waiting till the threads get trapped by the watchpoints.\n");
 +
-+  if (! pretty_printer)
++  if (tracer)
 +    {
-+      gdbpy_print_stack ();
-+      error ("Could not evaluate visualizer expression: %s", visualizer);
++      /* s390x-unknown-linux-gnu will fail with "R (running)".  */
++
++      state_wait (thread1_tid, "T (tracing stop)");
++
++      state_wait (thread2_tid, "T (tracing stop)");
 +    }
 +
-+  if (pretty_printer == Py_None)
-+    {
-+      Py_DECREF (pretty_printer);
-+      pretty_printer = NULL;
++  cleanup ();
++
++  printf ("Joining the threads.\n");
++
++  i = pthread_mutex_unlock (&terminate_mutex);
++  assert (i == 0);
++
++  i = pthread_join (thread1, NULL);
++  assert (i == 0);
++
++  i = pthread_join (thread2, NULL);
++  assert (i == 0);
++
++  printf ("Exiting.\n");      /* break-at-exit */
++
++  /* Just prevent compiler `warning: \e$B!F\e(BunusedX_rwatch\e$B!G\e(B defined but not used'.  */
++  unused1_rwatch = 1;
++  unused2_rwatch = 2;
++
++  return EXIT_SUCCESS;
++}
+diff --git a/gdb/testsuite/gdb.threads/watchthreads-reorder.exp b/gdb/testsuite/gdb.threads/watchthreads-reorder.exp
+new file mode 100644
+index 0000000..8f65364
+--- /dev/null
++++ b/gdb/testsuite/gdb.threads/watchthreads-reorder.exp
+@@ -0,0 +1,101 @@
++# This testcase is part of GDB, the GNU debugger.
++
++# Copyright 2009 Free Software Foundation, Inc.
++
++# This program is free software; you can redistribute it and/or modify
++# it under the terms of the GNU General Public License as published by
++# the Free Software Foundation; either version 3 of the License, or
++# (at your option) any later version.
++#
++# This program is distributed in the hope that it will be useful,
++# but WITHOUT ANY WARRANTY; without even the implied warranty of
++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++# GNU General Public License for more details.
++#
++# You should have received a copy of the GNU General Public License
++# along with this program.  If not, see <http://www.gnu.org/licenses/>.
++
++# Test GDB can cope with two watchpoints being hit by different threads at the
++# same time, GDB reports one of them and after "continue" to report the other
++# one GDB should not be confused by differently set watchpoints that time.
++# This is the goal of "reorder1".  "reorder0" tests the basic functionality of
++# two watchpoint being hit at the same time, without reordering them during the
++# stop.  The formerly broken functionality is due to the all-stop mode default
++# "show breakpoint always-inserted" being "off".  Formerly the remembered hit
++# could be assigned during continuation of a thread with pending SIGTRAP to the
++# different/new watchpoint, just based on the watchpoint/debug register number.
++
++if {[target_info exists gdb,no_hardware_watchpoints]
++    || ![istarget *-*-linux*]} {
++    return 0;
++}
++
++set testfile "watchthreads-reorder"
++set srcfile ${testfile}.c
++set binfile ${objdir}/${subdir}/${testfile}
++if {[gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" ${binfile} executable [list debug additional_flags=-lrt]] != "" } {
++    return -1
++}
++
++foreach reorder {0 1} {
++
++    global pf_prefix
++    set prefix_test $pf_prefix
++    lappend pf_prefix "reorder$reorder:"
++
++    clean_restart $testfile
++
++    gdb_test "set can-use-hw-watchpoints 1"
++
++    if ![runto_main] {
++      gdb_suppress_tests
 +    }
 +
-+  install_visualizer (var, pretty_printer);
++    # Use "rwatch" as "watch" would report the watchpoint changed just based on its
++    # read memory value during a stop by unrelated event.  We are interested to not
++    # to lose the hardware watchpoint trigger.
 +
-+  do_cleanups (back_to);
-+#else
-+  error ("Python support required");
-+#endif
++    gdb_test "rwatch thread1_rwatch" "Hardware read watchpoint \[0-9\]+: thread1_rwatch"
++    gdb_test {set $rwatch1=$bpnum}
++    set test "rwatch thread2_rwatch"
++    gdb_test_multiple $test $test {
++      -re "Target does not support this type of hardware watchpoint\\.\r\n$gdb_prompt $" {
++          # ppc64 supports at most 1 hw watchpoints.
++          unsupported $test
++          return
++      }
++      -re "Hardware read watchpoint \[0-9\]+: thread2_rwatch\r\n$gdb_prompt $" {
++          pass $test
++      }
++    }
++    gdb_test {set $rwatch2=$bpnum}
++    gdb_breakpoint [gdb_get_line_number "break-at-exit"]
++
++    # The watchpoints can happen in arbitrary order depending on random:
++    # SEL: Found 2 SIGTRAP events, selecting #[01]
++    # As GDB contains no srand() on the specific host/OS it will behave always the
++    # same.  Such order cannot be guaranteed for GDB in general.
++
++    gdb_test "continue" \
++           "Hardware read watchpoint \[0-9\]+: thread\[12\]_rwatch\r\n\r\nValue = 0\r\n0x\[0-9a-f\]+ in thread\[12\]_func .*" \
++           "continue a"
++
++    if $reorder {
++      gdb_test {delete $rwatch1}
++      gdb_test {delete $rwatch2}
++
++      gdb_test "rwatch unused1_rwatch" "Hardware read watchpoint \[0-9\]+: unused1_rwatch"
++      gdb_test "rwatch unused2_rwatch" "Hardware read watchpoint \[0-9\]+: unused2_rwatch"
++
++      gdb_test "rwatch thread1_rwatch" "Hardware read watchpoint \[0-9\]+: thread1_rwatch"
++      gdb_test "rwatch thread2_rwatch" "Hardware read watchpoint \[0-9\]+: thread2_rwatch"
++    }
++
++    gdb_test "continue" \
++           "Hardware read watchpoint \[0-9\]+: thread\[12\]_rwatch\r\n\r\nValue = 0\r\n0x\[0-9a-f\]+ in thread\[12\]_func .*" \
++           "continue b"
++
++    gdb_continue_to_breakpoint "break-at-exit" ".*break-at-exit.*"
++
++    set pf_prefix $prefix_test
++}
+diff --git a/gdb/testsuite/lib/cp-support.exp b/gdb/testsuite/lib/cp-support.exp
+index dbd2f59..44e1b51 100644
+--- a/gdb/testsuite/lib/cp-support.exp
++++ b/gdb/testsuite/lib/cp-support.exp
+@@ -222,7 +222,7 @@ proc cp_test_ptype_class { in_command in_testname in_key in_tag in_class_table {
+     set parse_okay 0
+     gdb_test_multiple "$in_command" "$in_testname // parse failed" {
+-      -re "type = (struct|class)${wsopt}(\[A-Za-z0-9_\]*)${wsopt}((:\[^\{\]*)?)${wsopt}\{(.*)\}${wsopt}(\[^\r\n\]*)\[\r\n\]+$gdb_prompt $" {
++      -re "type = (struct|class)${wsopt}(\[A-Za-z0-9_:\]*)${wsopt}((:\[^\{\]*)?)${wsopt}\{(.*)\}${wsopt}(\[^\r\n\]*)\[\r\n\]+$gdb_prompt $" {
+           set parse_okay          1
+           set actual_key          $expect_out(1,string)
+           set actual_tag          $expect_out(2,string)
+@@ -231,6 +231,7 @@ proc cp_test_ptype_class { in_command in_testname in_key in_tag in_class_table {
+           set actual_tail         $expect_out(6,string)
+       }
+     }
++    
+     if { ! $parse_okay } then { return }
+     # Check the actual key.  It would be nice to require that it match
+diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp
+index 0c93a73..d0c3493 100644
+--- a/gdb/testsuite/lib/gdb.exp
++++ b/gdb/testsuite/lib/gdb.exp
+@@ -27,6 +27,7 @@ if {$tool == ""} {
+ }
+ load_lib libgloss.exp
++load_lib python-support.exp
+ global GDB
+diff --git a/gdb/testsuite/lib/python-support.exp b/gdb/testsuite/lib/python-support.exp
+new file mode 100644
+index 0000000..b8e9836
+--- /dev/null
++++ b/gdb/testsuite/lib/python-support.exp
+@@ -0,0 +1,53 @@
++global python_supported_saved
++
++# Return 1 if Python scripting is supported in GDB, 0 if not.
++proc python_supported { } {
++  global gdb_prompt
++  global python_supported_saved
++
++  if [info exists python_supported_saved] {
++      verbose "python_supported:  returning saved $python_supported_saved" 2
++      return $python_supported_saved
++  }
++
++  gdb_test_multiple "python print 'hello, world!'" "verify python support" {
++    -re "not supported.*$gdb_prompt $"        {
++      return [set python_supported_saved 0]
++    }
++    -re "$gdb_prompt $"       {
++      return [set python_supported_saved 1]
++    }
++  }
++
++  return [set python_supported_saved 0]
++}
++
++# Run a command in GDB, and report a failure if a Python exception is thrown.
++# If report_pass is true, report a pass if no exception is thrown.
++proc gdb_py_test_silent_cmd {cmd name report_pass} {
++  global gdb_prompt
++
++  gdb_test_multiple $cmd $name {
++      -re "Traceback.*$gdb_prompt $"  { fail $name }
++      -re "$gdb_prompt $"           { if $report_pass { pass $name } }
++  }
++}
++
++# Usage: gdb_py_test_multiple NAME INPUT RESULT {INPUT RESULT}...
++# Run a test named NAME, consisting of multiple lines of input.
++# After each input line INPUT, search for result line RESULT.
++# Succeed if all results are seen; fail otherwise.
++proc gdb_py_test_multiple {name args} {
++    global gdb_prompt
++
++    foreach {input result} $args {
++      if {[gdb_test_multiple $input "$name - $input" {
++          -re "\[\r\n\]*($result)\[\r\n\]+($gdb_prompt | *>)$" {
++              pass "$name - $input"
++          }
++      }]} {
++          return 1
++      }
++    }
++    return 0
 +}
-+
- /* Update the values for a variable and its children.  This is a
-    two-pronged attack.  First, re-parse the value for the root's
-    expression to see if it's changed.  Then go all the way
-@@ -1148,7 +1533,7 @@ VEC(varobj_update_result) *varobj_update (struct varobj **varp, int explicit)
-   struct varobj **cv;
-   struct varobj **templist = NULL;
-   struct value *new;
--  VEC (varobj_p) *stack = NULL;
-+  VEC (varobj_update_result) *stack = NULL;
-   VEC (varobj_update_result) *result = NULL;
-   struct frame_info *fi;
+diff --git a/gdb/thread.c b/gdb/thread.c
+index 55b4b96..e0ad2d3 100644
+--- a/gdb/thread.c
++++ b/gdb/thread.c
+@@ -61,7 +61,6 @@ static int thread_alive (struct thread_info *);
+ static void info_threads_command (char *, int);
+ static void thread_apply_command (char *, int);
+ static void restore_current_thread (ptid_t);
+-static void prune_threads (void);
  
-@@ -1187,20 +1572,85 @@ VEC(varobj_update_result) *varobj_update (struct varobj **varp, int explicit)
-       
-       if (new == NULL)
-       r.status = VAROBJ_NOT_IN_SCOPE;
--
--      if (r.type_changed || r.changed)
--      VEC_safe_push (varobj_update_result, result, &r);
-+      r.value_installed = 1;
+ /* Frontend view of the thread state.  Possible extensions: stepping,
+    finishing, until(ling),...  */
+@@ -497,16 +496,23 @@ thread_alive (struct thread_info *tp)
+   return 1;
+ }
  
-       if (r.status == VAROBJ_NOT_IN_SCOPE)
--      return result;
-+      {
-+        VEC_safe_push (varobj_update_result, result, &r);
-+        return result;
-+      }
-+            
-+      VEC_safe_push (varobj_update_result, stack, &r);
-+    }
-+  else
-+    {
-+      varobj_update_result r = {*varp};
-+      VEC_safe_push (varobj_update_result, stack, &r);
-     }
--
--  VEC_safe_push (varobj_p, stack, *varp);
+-static void
++void
+ prune_threads (void)
+ {
+-  struct thread_info *tp, *next;
++  struct thread_info *tp;
++  struct thread_info **prevp = &thread_list;
  
-   /* Walk through the children, reconstructing them all.  */
--  while (!VEC_empty (varobj_p, stack))
-+  while (!VEC_empty (varobj_update_result, stack))
+-  for (tp = thread_list; tp; tp = next)
++  for (tp = *prevp; tp; tp = *prevp)
      {
--      v = VEC_pop (varobj_p, stack);
-+      varobj_update_result r = *(VEC_last (varobj_update_result, stack));
-+      struct varobj *v = r.varobj;
-+
-+      VEC_pop (varobj_update_result, stack);
-+
-+      /* Update this variable, unless it's a root, which is already
-+       updated.  */
-+      if (!r.value_installed)
-+      {         
-+        new = value_of_child (v->parent, v->index);
-+        if (install_new_value (v, new, 0 /* type not changed */))
-+          {
-+            r.changed = 1;
-+            v->updated = 0;
-+          }
-+      }
-+
-+      /* We probably should not get children of a varobj that has a
-+       pretty-printer, but for which -var-list-children was never
-+       invoked.  Presumably, such varobj is not yet expanded in the
-+       UI, so we need not bother getting it.  */
-+      if (v->pretty_printer)
+-      next = tp->next;
++      /* If the thread has died, free it and unlink it from the list.
++       Otherwise, advance to the next thread.  */
+       if (!thread_alive (tp))
+-      delete_thread (tp->ptid);
 +      {
-+        VEC (varobj_p) *changed = 0, *new_and_unchanged = 0;
-+        int i, children_changed;
-+        varobj_p tmp;
-+
-+        if (!v->children_requested)
-+          continue;
-+
-+        if (v->frozen)
-+          continue;
-+
-+        /* If update_dynamic_varobj_children returns 0, then we have
-+           a non-conforming pretty-printer, so we skip it.  */
-+        if (update_dynamic_varobj_children (v, &changed, &new_and_unchanged,
-+                                            &children_changed))
-+          {
-+            if (children_changed)
-+              r.children_changed = 1;
-+            for (i = 0; VEC_iterate (varobj_p, changed, i, tmp); ++i)
-+              {
-+                varobj_update_result r = {tmp};
-+                r.changed = 1;
-+                r.value_installed = 1;
-+                VEC_safe_push (varobj_update_result, stack, &r);
-+              }
-+            for (i = 0;
-+                 VEC_iterate (varobj_p, new_and_unchanged, i, tmp);
-+                 ++i)
-+              {
-+                varobj_update_result r = {tmp};
-+                r.value_installed = 1;
-+                VEC_safe_push (varobj_update_result, stack, &r);
-+              }
-+            if (r.changed || r.children_changed)
-+              VEC_safe_push (varobj_update_result, result, &r);
-+            continue;
-+          }
++        *prevp = tp->next;
++        free_thread (tp);
 +      }
++      else
++      prevp = &tp->next;
+     }
+ }
  
-       /* Push any children.  Use reverse order so that the first
-        child is popped from the work stack first, and so
-@@ -1211,26 +1661,18 @@ VEC(varobj_update_result) *varobj_update (struct varobj **varp, int explicit)
-         varobj_p c = VEC_index (varobj_p, v->children, i);
-         /* Child may be NULL if explicitly deleted by -var-delete.  */
-         if (c != NULL && !c->frozen)
--          VEC_safe_push (varobj_p, stack, c);
--      }
--
--      /* Update this variable, unless it's a root, which is already
--       updated.  */
--      if (v->root->rootvar != v)
--      {         
--        new = value_of_child (v->parent, v->index);
--        if (install_new_value (v, new, 0 /* type not changed */))
-           {
--            /* Note that it's changed */
--            varobj_update_result r = {v};
--            r.changed = 1;
--            VEC_safe_push (varobj_update_result, result, &r);
--            v->updated = 0;
-+            varobj_update_result r = {c};
-+            VEC_safe_push (varobj_update_result, stack, &r);
-           }
-       }
+diff --git a/gdb/top.c b/gdb/top.c
+index 1b4aa9d..3cfe57e 100644
+--- a/gdb/top.c
++++ b/gdb/top.c
+@@ -349,6 +349,7 @@ void
+ prepare_execute_command (void)
+ {
+   free_all_values ();
++  free_all_types ();
+   /* With multiple threads running while the one we're examining is stopped,
+      the dcache can get stale without us being able to detect it.
+diff --git a/gdb/typeprint.c b/gdb/typeprint.c
+index f090231..fc15ec1 100644
+--- a/gdb/typeprint.c
++++ b/gdb/typeprint.c
+@@ -35,6 +35,8 @@
+ #include "gdb_string.h"
+ #include "exceptions.h"
+ #include "valprint.h"
++#include "dwarf2loc.h"
 +
-+      if (r.changed || r.type_changed)
-+      VEC_safe_push (varobj_update_result, result, &r);
-     }
+ #include <errno.h>
  
--  VEC_free (varobj_p, stack);
-+  VEC_free (varobj_update_result, stack);
+ extern void _initialize_typeprint (void);
+@@ -76,6 +78,9 @@ void
+ type_print (struct type *type, char *varstring, struct ui_file *stream,
+           int show)
+ {
++  if (show >= 0)
++    type = check_typedef (type);
 +
-   return result;
+   LA_PRINT_TYPE (type, varstring, stream, show, 0);
  }
\f
-@@ -1429,16 +1871,23 @@ uninstall_variable (struct varobj *var)
- static struct varobj *
- create_child (struct varobj *parent, int index, char *name)
+@@ -114,7 +119,8 @@ whatis_exp (char *exp, int show)
  {
-+  return create_child_with_value (parent, index, name, 
-+                                value_of_child (parent, index));
-+}
-+
-+static struct varobj *
-+create_child_with_value (struct varobj *parent, int index, const char *name,
-+                       struct value *value)
-+{
-   struct varobj *child;
-   char *childs_name;
--  struct value *value;
-   child = new_variable ();
-   /* name is allocated by name_of_child */
--  child->name = name;
-+  /* FIXME: xstrdup should not be here.  */
-+  child->name = xstrdup (name);
-   child->index = index;
--  value = value_of_child (parent, index);
-   child->parent = parent;
-   child->root = parent->root;
-   childs_name = xstrprintf ("%s.%s", parent->obj_name, name);
-@@ -1487,6 +1936,10 @@ new_variable (void)
-   var->print_value = NULL;
-   var->frozen = 0;
-   var->not_fetched = 0;
-+  var->children_requested = 0;
-+  var->from = -1;
-+  var->to = -1;
-+  var->pretty_printer = 0;
-   return var;
- }
-@@ -1519,6 +1972,14 @@ free_variable (struct varobj *var)
-       xfree (var->root);
+   struct expression *expr;
+   struct value *val;
+-  struct cleanup *old_chain = NULL;
++  /* Required at least for the object_address_set call.  */
++  struct cleanup *old_chain = make_cleanup (null_cleanup, NULL);
+   struct type *real_type = NULL;
+   struct type *type;
+   int full = 0;
+@@ -125,12 +131,13 @@ whatis_exp (char *exp, int show)
+   if (exp)
+     {
+       expr = parse_expression (exp);
+-      old_chain = make_cleanup (free_current_contents, &expr);
++      make_cleanup (free_current_contents, &expr);
+       val = evaluate_type (expr);
      }
+   else
+     val = access_value_history (0);
  
-+#if HAVE_PYTHON
-+  {
-+    PyGILState_STATE state = PyGILState_Ensure ();
-+    Py_XDECREF (var->pretty_printer);
-+    PyGILState_Release (state);
-+  }
-+#endif
++  object_address_set (value_raw_address (val));
+   type = value_type (val);
+   get_user_print_options (&opts);
+@@ -167,8 +174,7 @@ whatis_exp (char *exp, int show)
+   type_print (type, "", gdb_stdout, show);
+   printf_filtered ("\n");
+-  if (exp)
+-    do_cleanups (old_chain);
++  do_cleanups (old_chain);
+ }
+ static void
+diff --git a/gdb/typeprint.h b/gdb/typeprint.h
+index f561310..d261c79 100644
+--- a/gdb/typeprint.h
++++ b/gdb/typeprint.h
+@@ -20,10 +20,13 @@
+ #ifndef TYPEPRINT_H
+ #define TYPEPRINT_H
++enum language;
+ struct ui_file;
+ void print_type_scalar (struct type * type, LONGEST, struct ui_file *);
+ void c_type_print_varspec_suffix (struct type *, struct ui_file *, int,
+                                 int, int);
 +
-   xfree (var->name);
-   xfree (var->obj_name);
-   xfree (var->print_value);
-@@ -1538,6 +1999,18 @@ make_cleanup_free_variable (struct varobj *var)
-   return make_cleanup (do_free_variable_cleanup, var);
++void c_type_print_args (struct type *, struct ui_file *, int, enum language);
+ #endif
+diff --git a/gdb/ui-file.c b/gdb/ui-file.c
+index 527917c..07d959a 100644
+--- a/gdb/ui-file.c
++++ b/gdb/ui-file.c
+@@ -22,6 +22,7 @@
+ #include "defs.h"
+ #include "ui-file.h"
++#include "gdb_obstack.h"
+ #include "gdb_string.h"
+ #include <errno.h>
+@@ -263,7 +264,7 @@ set_ui_file_data (struct ui_file *file, void *data,
  }
  
+ /* ui_file utility function for converting a ``struct ui_file'' into
+-   a memory buffer''. */
++   a memory buffer. */
+ struct accumulated_ui_file
+ {
+@@ -297,6 +298,23 @@ ui_file_xstrdup (struct ui_file *file, long *length)
+     *length = acc.length;
+   return acc.buffer;
+ }
++
 +static void
-+do_uninstall_variable_cleanup (void *var)
++do_ui_file_obsavestring (void *context, const char *buffer, long length)
 +{
-+  uninstall_variable (var);
++  struct obstack *obstack = (struct obstack *) context;
++  obstack_grow (obstack, buffer, length);
 +}
 +
-+static struct cleanup *
-+make_cleanup_uninstall_variable (struct varobj *var)
++char *
++ui_file_obsavestring (struct ui_file *file, struct obstack *obstack,
++                    long *length)
 +{
-+  return make_cleanup (do_uninstall_variable_cleanup, var);
++  ui_file_put (file, do_ui_file_obsavestring, obstack);
++  *length = obstack_object_size (obstack);
++  obstack_1grow (obstack, '\0');
++  return obstack_finish (obstack);
 +}
\f
+ /* A pure memory based ``struct ui_file'' that can be used an output
+    buffer. The buffers accumulated contents are available via
+diff --git a/gdb/ui-file.h b/gdb/ui-file.h
+index bf9915c..233206c 100644
+--- a/gdb/ui-file.h
++++ b/gdb/ui-file.h
+@@ -19,6 +19,7 @@
+ #ifndef UI_FILE_H
+ #define UI_FILE_H
++struct obstack;
+ struct ui_file;
+ /* Create a generic ui_file object with null methods. */
+@@ -77,7 +78,10 @@ extern void ui_file_put (struct ui_file *src, ui_file_put_method_ftype *write, v
+    minus that appended NUL. */
+ extern char *ui_file_xstrdup (struct ui_file *file, long *length);
+-
++/* Similar to ui_file_xstrdup, but return a new string allocated on
++   OBSTACK.  */
++extern char *ui_file_obsavestring (struct ui_file *file,
++                                 struct obstack *obstack, long *length);
+ extern long ui_file_read (struct ui_file *file, char *buf, long length_buf);
+diff --git a/gdb/utils.c b/gdb/utils.c
+index 16ad084..3021a43 100644
+--- a/gdb/utils.c
++++ b/gdb/utils.c
+@@ -2610,7 +2610,10 @@ fprintf_symbol_filtered (struct ui_file *stream, char *name,
+    As an extra hack, string1=="FOO(ARGS)" matches string2=="FOO".
+    This "feature" is useful when searching for matching C++ function names
+    (such as if the user types 'break FOO', where FOO is a mangled C++
+-   function). */
++   function).
 +
- /* This returns the type of the variable. It also skips past typedefs
-    to return the real type of the variable.
++   As an extra-special hack, we do the same with ' ', so that
++   "FOO(ARGS) const" can match "FOO", too.  */
  
-@@ -1792,24 +2265,71 @@ my_value_of_variable (struct varobj *var, enum varobj_display_formats format)
-     return NULL;
+ int
+ strcmp_iw (const char *string1, const char *string2)
+@@ -2635,7 +2638,7 @@ strcmp_iw (const char *string1, const char *string2)
+         string2++;
+       }
+     }
+-  return (*string1 != '\0' && *string1 != '(') || (*string2 != '\0');
++  return (*string1 != ' ' && *string1 != '\0' && *string1 != '(') || (*string2 != '\0' && *string2 != '(');
  }
  
--static char *
--value_get_print_value (struct value *value, enum varobj_display_formats format)
-+char *
-+value_get_print_value (struct value *value, enum varobj_display_formats format,
-+                     PyObject *value_formatter)
+ /* This is like strcmp except that it ignores whitespace and treats
+diff --git a/gdb/valarith.c b/gdb/valarith.c
+index a9c875d..12f6f07 100644
+--- a/gdb/valarith.c
++++ b/gdb/valarith.c
+@@ -139,7 +139,6 @@ an integer nor a pointer of the same type."));
+ struct value *
+ value_subscript (struct value *array, LONGEST index)
  {
-   long dummy;
-   struct ui_file *stb;
-   struct cleanup *old_chain;
--  char *thevalue;
-+  char *thevalue = NULL;
-   struct value_print_options opts;
+-  struct value *bound;
+   int c_style = current_language->c_style_arrays;
+   struct type *tarray;
  
-   if (value == NULL)
-     return NULL;
+@@ -154,12 +153,26 @@ value_subscript (struct value *array, LONGEST index)
+       get_discrete_bounds (range_type, &lowerbound, &upperbound);
  
-+#if HAVE_PYTHON
-+  {
-+    PyGILState_STATE state = PyGILState_Ensure ();
-+    if (value_formatter && PyObject_HasAttr (value_formatter,
-+                                           gdbpy_to_string_cst))
-+      {
-+      char *hint;
-+      struct value *replacement;
-+      int string_print = 0;
-+
-+      hint = gdbpy_get_display_hint (value_formatter);
-+      if (hint)
-+        {
-+          if (!strcmp (hint, "string"))
-+            string_print = 1;
-+          xfree (hint);
-+        }
-+
-+      thevalue = apply_varobj_pretty_printer (value_formatter,
-+                                              &replacement);
-+      if (thevalue && !string_print)
-+        {
-+          PyGILState_Release (state);
-+          return thevalue;
-+        }
-+      if (replacement)
-+        value = replacement;
-+      }
-+    PyGILState_Release (state);
-+  }
-+#endif
+       if (VALUE_LVAL (array) != lval_memory)
+-      return value_subscripted_rvalue (array, index, lowerbound);
++      {
++        if (index >= lowerbound && index <= upperbound)
++          {
++            CORE_ADDR element_size = TYPE_LENGTH (TYPE_TARGET_TYPE (tarray));
++            CORE_ADDR offset = (index - lowerbound) * element_size;
 +
-   stb = mem_fileopen ();
-   old_chain = make_cleanup_ui_file_delete (stb);
++            return value_subscripted_rvalue (array, offset);
++          }
++        error (_("array or string index out of range"));
++      }
  
-   get_formatted_print_options (&opts, format_code[(int) format]);
-   opts.deref_ref = 0;
--  common_val_print (value, stb, 0, &opts, current_language);
-+  opts.raw = 1;
-+  if (thevalue)
-+    {
-+      struct type *string_char_type;
+       if (c_style == 0)
+       {
+         if (index >= lowerbound && index <= upperbound)
+-          return value_subscripted_rvalue (array, index, lowerbound);
++          {
++            CORE_ADDR element_size = TYPE_LENGTH (TYPE_TARGET_TYPE (tarray));
++            CORE_ADDR offset = (index - lowerbound) * element_size;
 +
-+      make_cleanup (xfree, thevalue);
-+      
-+      /* OUTPUT is already in the hosts's charset.  */
-+      string_char_type = language_string_char_type (current_language,
-+                                                  current_gdbarch);
-+      LA_PRINT_STRING (stb, string_char_type, (gdb_byte *) thevalue,
-+                     strlen (thevalue), 0, &opts);
-+    }
-+  else
-+    common_val_print (value, stb, 0, &opts, current_language);
-   thevalue = ui_file_xstrdup (stb, &dummy);
++            return value_subscripted_rvalue (array, offset);
++          }
+         /* Emit warning unless we have an array of unknown size.
+            An array of unknown size has lowerbound 0 and upperbound -1.  */
+         if (upperbound > -1)
+@@ -178,33 +191,37 @@ value_subscript (struct value *array, LONGEST index)
+     error (_("not an array or string"));
+ }
  
-   do_cleanups (old_chain);
-@@ -1900,7 +2420,7 @@ varobj_floating_p (struct varobj *var)
-    value is not known.  
+-/* Return the value of EXPR[IDX], expr an aggregate rvalue
+-   (eg, a vector register).  This routine used to promote floats
+-   to doubles, but no longer does.  */
++/* Return the value of *((void *) ARRAY + ELEMENT), ARRAY an aggregate rvalue
++   (eg, a vector register).  This routine used to promote floats to doubles,
++   but no longer does.  OFFSET is zero-based with 0 for the lowermost existing
++   element, it must be expressed in bytes (therefore multiplied by
++   check_typedef (TYPE_TARGET_TYPE (array_type)).  */
  
-    If WAS_PTR is not NULL, set *WAS_PTR to 0 or 1
--   depending on whether pointer was deferenced
-+   depending on whether pointer was dereferenced
-    in this function.  */
- static void
- adjust_value_for_child_access (struct value **value,
-@@ -2269,6 +2789,11 @@ c_value_of_variable (struct varobj *var, enum varobj_display_formats format)
-      catch that case explicitly.  */
-   struct type *type = get_type (var);
-+  /* If we have a custom formatter, return whatever string it has
-+     produced.  */
-+  if (var->pretty_printer && var->print_value)
-+    return xstrdup (var->print_value);
-+  
-   /* Strip top-level references. */
-   while (TYPE_CODE (type) == TYPE_CODE_REF)
-     type = check_typedef (TYPE_TARGET_TYPE (type));
-@@ -2313,7 +2838,8 @@ c_value_of_variable (struct varobj *var, enum varobj_display_formats format)
-           if (format == var->format)
-             return xstrdup (var->print_value);
-           else
--            return value_get_print_value (var->value, format);
-+            return value_get_print_value (var->value, format, 
-+                                          var->pretty_printer);
-         }
-       }
-     }
-diff --git a/gdb/varobj.h b/gdb/varobj.h
-index f2cdcf8..10758d6 100644
---- a/gdb/varobj.h
-+++ b/gdb/varobj.h
-@@ -72,7 +72,12 @@ typedef struct varobj_update_result_t
-   struct varobj *varobj;
-   int type_changed;
-   int changed;
-+  int children_changed;
-   enum varobj_scope_status status;
-+  /* This variable is used internally by varobj_update to indicate if the
-+     new value of varobj is already computed and installed, or has to
-+     be yet installed.  Don't use this outside varobj.c */
-+  int value_installed;  
- } varobj_update_result;
+ struct value *
+-value_subscripted_rvalue (struct value *array, LONGEST index, int lowerbound)
++value_subscripted_rvalue (struct value *array, CORE_ADDR offset)
+ {
+   struct type *array_type = check_typedef (value_type (array));
+   struct type *elt_type = check_typedef (TYPE_TARGET_TYPE (array_type));
+-  unsigned int elt_size = TYPE_LENGTH (elt_type);
+-  unsigned int elt_offs = elt_size * longest_to_int (index - lowerbound);
+   struct value *v;
  
- DEF_VEC_O (varobj_update_result);
-@@ -107,6 +112,14 @@ extern void varobj_set_frozen (struct varobj *var, int frozen);
+-  if (index < lowerbound || elt_offs >= TYPE_LENGTH (array_type))
+-    error (_("no such vector element"));
++  /* Do not check TYPE_LENGTH (array_type) as we may have been given the
++     innermost dimension of a multi-dimensional Fortran array where its length
++     is shorter than the possibly accessed element offset.  */
  
- extern int varobj_get_frozen (struct varobj *var);
+   v = allocate_value (elt_type);
+   if (VALUE_LVAL (array) == lval_memory && value_lazy (array))
+     set_value_lazy (v, 1);
+   else
+-    memcpy (value_contents_writeable (v),
+-          value_contents (array) + elt_offs, elt_size);
++    {
++      unsigned int elt_size = TYPE_LENGTH (elt_type);
++      memcpy (value_contents_writeable (v),
++            value_contents (array) + offset, elt_size);
++    }
  
-+extern void varobj_get_child_range (struct varobj *var,
-+                                  VEC (varobj_p) *children,
-+                                  int *from, int *to);
-+
-+extern void varobj_set_child_range (struct varobj *var, int from, int to);
-+
-+extern char *varobj_get_display_hint (struct varobj *var);
-+
- extern int varobj_get_num_children (struct varobj *var);
+   set_value_component_location (v, array);
+   VALUE_REGNUM (v) = VALUE_REGNUM (array);
+   VALUE_FRAME_ID (v) = VALUE_FRAME_ID (array);
+-  set_value_offset (v, value_offset (array) + elt_offs);
++  set_value_offset (v, value_offset (array) + offset);
+   return v;
+ }
  
- /* Return the list of children of VAR.  The returned vector
-@@ -141,4 +154,13 @@ extern int varobj_editable_p (struct varobj *var);
+diff --git a/gdb/valops.c b/gdb/valops.c
+index b64cb21..b7d31cc 100644
+--- a/gdb/valops.c
++++ b/gdb/valops.c
+@@ -38,6 +38,7 @@
+ #include "cp-support.h"
+ #include "dfp.h"
+ #include "user-regs.h"
++#include "dwarf2loc.h"
  
- extern int varobj_floating_p (struct varobj *var);
+ #include <errno.h>
+ #include "gdb_string.h"
+@@ -369,8 +370,6 @@ value_cast (struct type *type, struct value *arg2)
+         new_length = val_length / element_length;
+         if (val_length % element_length != 0)
+           warning (_("array element type size does not divide object size in cast"));
+-        /* FIXME-type-allocation: need a way to free this type when
+-           we are done with it.  */
+         range_type = create_range_type ((struct type *) NULL,
+                                         TYPE_TARGET_TYPE (range_type),
+                                         low_bound,
+@@ -565,6 +564,64 @@ value_one (struct type *type, enum lval_type lv)
+   return val;
+ }
  
-+extern void 
-+varobj_set_visualizer (struct varobj *var, const char *visualizer);
-+
-+extern void 
-+varobj_clear_type_visualizers ();
-+
-+extern void 
-+varobj_set_visualizer (struct varobj *var, const char *visualizer);
-+
- #endif /* VAROBJ_H */
-diff --git a/gdb/xcoffread.c b/gdb/xcoffread.c
-index aab3e48..d41738b 100644
---- a/gdb/xcoffread.c
-+++ b/gdb/xcoffread.c
-@@ -3021,6 +3021,7 @@ static struct sym_fns xcoff_sym_fns =
-   xcoff_new_init,             /* sym_new_init: init anything gbl to entire symtab */
-   xcoff_symfile_init,         /* sym_init: read initial info, setup for sym_read() */
-   xcoff_initial_scan,         /* sym_read: read a symbol file into symtab */
-+  NULL,                               /* sym_read_psymbols */
-   xcoff_symfile_finish,               /* sym_finish: finished with file, cleanup */
-   xcoff_symfile_offsets,      /* sym_offsets: xlate offsets ext->int form */
-   default_symfile_segments,   /* sym_segments: Get segment information from
-diff --git a/gdb/xml-syscall.c b/gdb/xml-syscall.c
-new file mode 100644
-index 0000000..498f58a
---- /dev/null
-+++ b/gdb/xml-syscall.c
-@@ -0,0 +1,423 @@
-+/* Functions that provide the mechanism to parse a syscall XML file
-+   and get its values.
-+
-+   Copyright (C) 1986, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996,
-+   1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006, 2007, 2008
-+   Free Software Foundation, Inc.
-+
-+   This file is part of GDB.
-+
-+   This program is free software; you can redistribute it and/or modify
-+   it under the terms of the GNU General Public License as published by
-+   the Free Software Foundation; either version 3 of the License, or
-+   (at your option) any later version.
-+
-+   This program is distributed in the hope that it will be useful,
-+   but WITHOUT ANY WARRANTY; without even the implied warranty of
-+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-+   GNU General Public License for more details.
-+
-+   You should have received a copy of the GNU General Public License
-+   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
-+
-+#include "defs.h"
-+#include "gdbtypes.h"
-+#include "xml-support.h"
-+#include "xml-syscall.h"
-+
-+#include "filenames.h"
-+
-+#include "gdb_assert.h"
-+
-+#ifndef HAVE_LIBEXPAT
-+
-+/* Dummy functions to indicate that there's no support for fetching
-+   syscalls information.  */
-+
-+static void
-+syscall_warn_user (void)
-+{
-+  static int have_warned = 0;
-+  if (!have_warned)
-+    {
-+      have_warned = 1;
-+      warning (_("Can not parse XML syscalls information; XML support was "
-+               "disabled at compile time"));
-+    }
-+}
-+
-+const struct syscalls_info *
-+xml_init_syscalls_info (const char *filename)
-+{
-+  syscall_warn_user ();
-+  return NULL;
-+}
-+
-+int
-+xml_get_syscall_number (const struct syscalls_info *sysinfo,
-+                        const char *syscall_name)
-+{
-+  syscall_warn_user ();
-+  return UNKNOWN_SYSCALL;
-+}
++/* object_address_set must be already called before this function.  */
 +
 +const char *
-+xml_get_syscall_name (const struct syscalls_info *sysinfo,
-+                      int syscall_number)
++object_address_data_not_valid (struct type *type)
 +{
-+  syscall_warn_user ();
-+  return NULL;
-+}
++  /* Attributes are present only at the target type of a typedef.  Make the
++     call conditional as it would otherwise loop through type_length_get.  */
++  if (TYPE_CODE (type) == TYPE_CODE_TYPEDEF)
++    CHECK_TYPEDEF (type);
 +
-+int
-+xml_number_of_syscalls (const struct syscalls_info *sysinfo)
-+{
-+  syscall_warn_user ();
-+  return 0;
-+}
++  /* DW_AT_associated has a preference over DW_AT_allocated.  */
++  if (TYPE_NOT_ASSOCIATED (type)
++      || (TYPE_ASSOCIATED (type) != NULL
++        && 0 == dwarf_locexpr_baton_eval (TYPE_ASSOCIATED (type))))
++    return N_("object is not associated");
++
++  if (TYPE_NOT_ALLOCATED (type)
++      || (TYPE_ALLOCATED (type) != NULL
++        && 0 == dwarf_locexpr_baton_eval (TYPE_ALLOCATED (type))))
++    return N_("object is not allocated");
 +
-+const char **
-+xml_list_of_syscalls (const struct syscalls_info *sysinfo)
-+{
-+  syscall_warn_user ();
 +  return NULL;
 +}
 +
-+#else
-+
-+/* Structure which describes a syscall.  */
++/* Return non-zero if the variable is valid.  If it is valid the function
++   may store the data address (DW_AT_DATA_LOCATION) of TYPE at *ADDRESS_RETURN.
++   You must set *ADDRESS_RETURN from value_raw_address (VAL) before calling this
++   function.  If no DW_AT_DATA_LOCATION is present for TYPE the address at
++   *ADDRESS_RETURN is left unchanged.  ADDRESS_RETURN must not be NULL, use
++   object_address_data_not_valid () for just the data validity check.  */
 +
-+typedef struct syscall_desc
++int
++object_address_get_data (struct type *type, CORE_ADDR *address_return)
 +{
-+  /* The syscall number.  */
-+
-+  int number;
-+
-+  /* The syscall name.  */
++  gdb_assert (address_return != NULL);
 +
-+  char *name;
-+} *syscall_desc_p;
-+DEF_VEC_P(syscall_desc_p);
++  object_address_set (*address_return);
 +
-+/* Structure that represents syscalls information.  */
++  /* TYPE_DATA_LOCATION_DWARF_BLOCK / TYPE_DATA_LOCATION_ADDR are present only
++     at the target type of a typedef.  */
++  CHECK_TYPEDEF (type);
 +
-+struct syscalls_info
-+{
-+  /* The syscalls.  */
++  if (object_address_data_not_valid (type) != NULL)
++    {
++      /* Do not try to evaluate DW_AT_data_location as it may even crash
++       (it would just return the value zero in the gfortran case).  */
++      return 0;
++    }
 +
-+  VEC(syscall_desc_p) *syscalls;
-+};
++  if (TYPE_DATA_LOCATION_IS_ADDR (type))
++    *address_return = TYPE_DATA_LOCATION_ADDR (type);
++  else if (TYPE_DATA_LOCATION_DWARF_BLOCK (type) != NULL)
++    *address_return
++      = dwarf_locexpr_baton_eval (TYPE_DATA_LOCATION_DWARF_BLOCK (type));
 +
-+/* Callback data for syscall information parsing.  */
++  return 1;
++}
 +
-+struct syscall_parsing_data
-+{
-+  /* The syscalls_info we are building.  */
+ /* Helper function for value_at, value_at_lazy, and value_at_lazy_stack.  */
+ static struct value *
+@@ -656,15 +713,21 @@ value_fetch_lazy (struct value *val)
+     }
+   else if (VALUE_LVAL (val) == lval_memory)
+     {
+-      CORE_ADDR addr = value_address (val);
+-      int length = TYPE_LENGTH (check_typedef (value_enclosing_type (val)));
++      CORE_ADDR addr = value_raw_address (val);
+-      if (length)
++      if (object_address_get_data (value_type (val), &addr))
+       {
+-        if (value_stack (val))
+-          read_stack (addr, value_contents_all_raw (val), length);
+-        else
+-          read_memory (addr, value_contents_all_raw (val), length);
++        struct type *type = value_enclosing_type (val);
++        int length = TYPE_LENGTH (check_typedef (type));
 +
-+  struct syscalls_info *sysinfo;
-+};
++        if (length)
++          {
++            addr += value_offset (val);
++            if (value_stack (val))
++              read_stack (addr, value_contents_all_raw (val), length);
++            else
++              read_memory (addr, value_contents_all_raw (val), length);
++          }
+       }
+     }
+   else if (VALUE_LVAL (val) == lval_register)
+@@ -1070,7 +1133,18 @@ address_of_variable (struct symbol *var, struct block *b)
+   if ((VALUE_LVAL (val) == lval_memory && value_lazy (val))
+       || TYPE_CODE (type) == TYPE_CODE_FUNC)
+     {
+-      CORE_ADDR addr = value_address (val);
++      CORE_ADDR addr;
 +
++      if (VALUE_LVAL (val) == lval_memory)
++      {
++        addr = value_raw_address (val);
++        if (!object_address_get_data (type, &addr))
++          error (_("Can't take address of memory lvalue \"%s\"."),
++                 SYMBOL_PRINT_NAME (var));
++        set_value_address (val, addr);
++      }
 +
-+static struct syscalls_info *
-+allocate_syscalls_info (void)
-+{
-+  return XZALLOC (struct syscalls_info);
-+}
++      addr = value_address (val);
+       return value_from_pointer (lookup_pointer_type (type), addr);
+     }
+@@ -1176,6 +1250,7 @@ struct value *
+ value_coerce_array (struct value *arg1)
+ {
+   struct type *type = check_typedef (value_type (arg1));
++  CORE_ADDR address;
+   /* If the user tries to do something requiring a pointer with an
+      array that has not yet been pushed to the target, then this would
+@@ -1185,8 +1260,12 @@ value_coerce_array (struct value *arg1)
+   if (VALUE_LVAL (arg1) != lval_memory)
+     error (_("Attempt to take address of value not located in memory."));
++  address = value_raw_address (arg1);
++  if (!object_address_get_data (type, &address))
++    error (_("Attempt to take address of non-valid value."));
 +
-+static void
-+sysinfo_free_syscalls_desc (struct syscall_desc *sd)
-+{
-+  xfree (sd->name);
-+}
+   return value_from_pointer (lookup_pointer_type (TYPE_TARGET_TYPE (type)),
+-                           value_address (arg1));
++                           address + value_offset (arg1));
+ }
+ /* Given a value which is a function, return a value which is a pointer
+@@ -2069,12 +2148,25 @@ find_overload_match (struct type **arg_types, int nargs,
+   if (method)
+     {
+       gdb_assert (obj);
 +
-+static void
-+free_syscalls_info (void *arg)
-+{
-+  struct syscalls_info *sysinfo = arg;
-+  struct syscall_desc *sysdesc;
-+  int i;
++      /* OBJ may be a pointer value rather than the object itself.  */
++      obj = coerce_ref (obj);
++      while (TYPE_CODE (check_typedef (value_type (obj))) == TYPE_CODE_PTR)
++      obj = coerce_ref (value_ind (obj));
+       obj_type_name = TYPE_NAME (value_type (obj));
+-      /* Hack: evaluate_subexp_standard often passes in a pointer
+-         value rather than the object itself, so try again.  */
+-      if ((!obj_type_name || !*obj_type_name) 
+-        && (TYPE_CODE (value_type (obj)) == TYPE_CODE_PTR))
+-      obj_type_name = TYPE_NAME (TYPE_TARGET_TYPE (value_type (obj)));
 +
-+  for (i = 0;
-+       VEC_iterate (syscall_desc_p, sysinfo->syscalls, i, sysdesc);
-+       i++)
-+    sysinfo_free_syscalls_desc (sysdesc);
-+  VEC_free (syscall_desc_p, sysinfo->syscalls);
++      /* First check whether this is a data member, e.g. a pointer to
++       a function.  */
++      if (TYPE_CODE (check_typedef (value_type (obj))) == TYPE_CODE_STRUCT)
++      {
++        *valp = search_struct_field (name, obj, 0,
++                                     check_typedef (value_type (obj)), 0);
++        if (*valp)
++          {
++            *staticp = 1;
++            return 0;
++          }
++      }
+       fns_ptr = value_find_oload_method_list (&temp, name, 
+                                             0, &num_fns, 
+@@ -2094,16 +2186,29 @@ find_overload_match (struct type **arg_types, int nargs,
+     }
+   else
+     {
+-      const char *qualified_name = SYMBOL_CPLUS_DEMANGLED_NAME (fsym);
++      const char *qualified_name = SYMBOL_NATURAL_NAME (fsym);
 +
-+  xfree (sysinfo);
-+}
++      /* If we have a function with a C++ name, try to extract just
++       the function part.  Do not try this for non-functions (e.g.
++       function pointers).  */
++      if (qualified_name
++        && TYPE_CODE (check_typedef (SYMBOL_TYPE (fsym))) == TYPE_CODE_FUNC)
++      {
++        func_name = cp_func_name (qualified_name);
+-      /* If we have a C++ name, try to extract just the function
+-       part.  */
+-      if (qualified_name)
+-      func_name = cp_func_name (qualified_name);
++        /* If cp_func_name did not remove anything, the name of the
++           symbol did not include scope or argument types - it was
++           probably a C-style function.  */
++        if (func_name && strcmp (func_name, qualified_name) == 0)
++          {
++            xfree (func_name);
++            func_name = NULL;
++          }
++      }
+-      /* If there was no C++ name, this must be a C-style function.
+-       Just return the same symbol.  Do the same if cp_func_name
+-       fails for some reason.  */
++      /* If there was no C++ name, this must be a C-style function or
++       not a function at all.  Just return the same symbol.  Do the
++       same if cp_func_name fails for some reason.  */
+       if (func_name == NULL)
+         {
+         *symp = fsym;
+@@ -2534,8 +2639,8 @@ check_field (struct type *type, const char *name)
+    the comment before value_struct_elt_for_reference.  */
+ struct value *
+-value_aggregate_elt (struct type *curtype,
+-                   char *name, int want_address,
++value_aggregate_elt (struct type *curtype, char *name,
++                   struct type *expect_type, int want_address,
+                    enum noside noside)
+ {
+   switch (TYPE_CODE (curtype))
+@@ -2543,7 +2648,7 @@ value_aggregate_elt (struct type *curtype,
+     case TYPE_CODE_STRUCT:
+     case TYPE_CODE_UNION:
+       return value_struct_elt_for_reference (curtype, 0, curtype, 
+-                                           name, NULL,
++                                           name, expect_type,
+                                            want_address, noside);
+     case TYPE_CODE_NAMESPACE:
+       return value_namespace_elt (curtype, name, 
+@@ -2554,6 +2659,56 @@ value_aggregate_elt (struct type *curtype,
+     }
+ }
++/* Compares the two method/function types T1 and T2 for "equality" 
++   with respect to the the methods' parameters. If the types of the
++   two parameter lists are the same, returns 1; 0 otherwise. This
++   comparison may ignore any artificial parameters in T1 if
++   SKIP_ARTIFICIAL is non-zero. This function will ALWAYS skip
++   the first artificial parameter in T1, assumed to be a 'this' pointer.
 +
-+struct cleanup *
-+make_cleanup_free_syscalls_info (struct syscalls_info *sysinfo)
++   The type T2 is expected to have come from make_params (in eval.c). */
++static int
++compare_parameters (struct type *t1, struct type *t2, int skip_artificial)
 +{
-+  return make_cleanup (free_syscalls_info, sysinfo);
-+}
-+
-+/* Open FILENAME, read all its text into memory, close it, and return
-+   the text.  If something goes wrong, return NULL and warn.  */
++  int start = 0;
 +
-+static char *
-+fetch_xml_from_file (const char *filename, void *baton)
-+{
-+  const char *dirname = baton;
-+  FILE *file;
-+  struct cleanup *back_to;
-+  char *text;
-+  size_t len, offset;
++  if (TYPE_FIELD_ARTIFICIAL (t1, 0))
++    ++start;
 +
-+  if (dirname && *dirname)
++  /* If skipping artificial fields, find the first real field
++     in T1. */
++  if (skip_artificial)
 +    {
-+      char *fullname = concat (dirname, "/", filename, (char *) NULL);
-+      if (fullname == NULL)
-+      nomem (0);
-+      file = fopen (fullname, FOPEN_RT);
-+      xfree (fullname);
++      while (start < TYPE_NFIELDS (t1)
++           && TYPE_FIELD_ARTIFICIAL (t1, start))
++      ++start;
 +    }
-+  else
-+    file = fopen (filename, FOPEN_RT);
 +
-+  if (file == NULL)
-+    return NULL;
++  /* Now compare parameters */
 +
-+  back_to = make_cleanup_fclose (file);
++  /* Special case: a method taking void. T1 will contain no
++     non-artificial fields, and T2 will contain TYPE_CODE_VOID. */
++  if ((TYPE_NFIELDS (t1) - start) == 0 && TYPE_NFIELDS (t2) == 1
++      && TYPE_CODE (TYPE_FIELD_TYPE (t2, 0)) == TYPE_CODE_VOID)
++    return 1;
 +
-+  /* Read in the whole file, one chunk at a time.  */
-+  len = 4096;
-+  offset = 0;
-+  text = xmalloc (len);
-+  make_cleanup (free_current_contents, &text);
-+  while (1)
++  if ((TYPE_NFIELDS (t1) - start) == TYPE_NFIELDS (t2))
 +    {
-+      size_t bytes_read;
-+
-+      /* Continue reading where the last read left off.  Leave at least
-+       one byte so that we can NUL-terminate the result.  */
-+      bytes_read = fread (text + offset, 1, len - offset - 1, file);
-+      if (ferror (file))
++      int i;
++      for (i = 0; i < TYPE_NFIELDS (t2); ++i)
 +      {
-+        warning (_("Read error from \"%s\""), filename);
-+        do_cleanups (back_to);
-+        return NULL;
++        if (rank_one_type (TYPE_FIELD_TYPE (t1, start + i),
++                            TYPE_FIELD_TYPE (t2, i))
++            != 0)
++          return 0;
 +      }
 +
-+      offset += bytes_read;
-+
-+      if (feof (file))
-+      break;
-+
-+      len = len * 2;
-+      text = xrealloc (text, len);
-+    }
-+
-+  fclose (file);
-+  discard_cleanups (back_to);
-+
-+  text[offset] = '\0';
-+  return text;
-+}
-+
-+static void
-+syscall_create_syscall_desc (struct syscalls_info *sysinfo,
-+                             const char *name, int number)
-+{
-+  struct syscall_desc *sysdesc = XZALLOC (struct syscall_desc);
-+
-+  sysdesc->name = xstrdup (name);
-+  sysdesc->number = number;
-+
-+  VEC_safe_push (syscall_desc_p, sysinfo->syscalls, sysdesc);
-+}
-+
-+/* Handle the start of a <syscalls_info> element.  */
-+
-+static void
-+syscall_start_syscalls_info (struct gdb_xml_parser *parser,
-+                             const struct gdb_xml_element *element,
-+                             void *user_data,
-+                             VEC(gdb_xml_value_s) *attributes)
-+{
-+  struct syscall_parsing_data *data = user_data;
-+  struct syscalls_info *sysinfo = data->sysinfo;
-+}
-+
-+/* Handle the start of a <syscall> element.  */
-+
-+static void
-+syscall_start_syscall (struct gdb_xml_parser *parser,
-+                       const struct gdb_xml_element *element,
-+                       void *user_data, VEC(gdb_xml_value_s) *attributes)
-+{
-+  struct syscall_parsing_data *data = user_data;
-+  struct gdb_xml_value *attrs = VEC_address (gdb_xml_value_s, attributes);
-+  int len, i;
-+  /* syscall info.  */
-+  char *name = NULL;
-+  int number = 0;
-+
-+  len = VEC_length (gdb_xml_value_s, attributes);
-+
-+  for (i = 0; i < len; i++)
-+    {
-+      if (strcmp (attrs[i].name, "name") == 0)
-+        name = attrs[i].value;
-+      else if (strcmp (attrs[i].name, "number") == 0)
-+        number = * (ULONGEST *) attrs[i].value;
-+      else
-+        internal_error (__FILE__, __LINE__,
-+                        _("Unknown attribute name '%s'."), attrs[i].name);
++      return 1;
 +    }
 +
-+  syscall_create_syscall_desc (data->sysinfo, name, number);
++  return 0;
 +}
 +
+ /* C++: Given an aggregate type CURTYPE, and a member name NAME,
+    return the address of this member as a "pointer to member" type.
+    If INTYPE is non-null, then it will be the type of the member we
+@@ -2631,23 +2786,46 @@ value_struct_elt_for_reference (struct type *domain, int offset,
+       }
+       if (t_field_name && strcmp (t_field_name, name) == 0)
+       {
+-        int j = TYPE_FN_FIELDLIST_LENGTH (t, i);
++        int j;
++        int len = TYPE_FN_FIELDLIST_LENGTH (t, i);
+         struct fn_field *f = TYPE_FN_FIELDLIST1 (t, i);
+         check_stub_method_group (t, i);
+-        if (intype == 0 && j > 1)
+-          error (_("non-unique member `%s' requires type instantiation"), name);
+         if (intype)
+           {
+-            while (j--)
+-              if (TYPE_FN_FIELD_TYPE (f, j) == intype)
+-                break;
+-            if (j < 0)
+-              error (_("no member function matches that type instantiation"));
+-          }
++            for (j = 0; j < len; ++j)
++              {
++                if (compare_parameters (TYPE_FN_FIELD_TYPE (f, j), intype, 0)
++                    || compare_parameters (TYPE_FN_FIELD_TYPE (f, j), intype, 1))
++                  break;
++              }
 +
-+/* The elements and attributes of an XML syscall document.  */
-+
-+static const struct gdb_xml_attribute syscall_attr[] = {
-+  { "number", GDB_XML_AF_NONE, gdb_xml_parse_attr_ulongest, NULL },
-+  { "name", GDB_XML_AF_NONE, NULL, NULL },
-+  { NULL, GDB_XML_AF_NONE, NULL, NULL }
-+};
-+
-+static const struct gdb_xml_element syscalls_info_children[] = {
-+  { "syscall", syscall_attr, NULL,
-+    GDB_XML_EF_OPTIONAL | GDB_XML_EF_REPEATABLE,
-+    syscall_start_syscall, NULL },
-+  { NULL, NULL, NULL, GDB_XML_EF_NONE, NULL, NULL }
-+};
-+
-+static const struct gdb_xml_element syselements[] = {
-+  { "syscalls_info", NULL, syscalls_info_children,
-+    GDB_XML_EF_NONE, syscall_start_syscalls_info, NULL },
-+  { NULL, NULL, NULL, GDB_XML_EF_NONE, NULL, NULL }
-+};
-+
-+static struct syscalls_info *
-+syscall_parse_xml (const char *document, xml_fetch_another fetcher,
-+                   void *fetcher_baton)
-+{
-+  struct cleanup *result_cleanup;
-+  struct gdb_xml_parser *parser;
-+  struct syscall_parsing_data data;
-+  char *expanded_text;
-+  int i;
-+
-+  parser = gdb_xml_create_parser_and_cleanup (_("syscalls info"),
-+                                            syselements, &data);
-+
-+  memset (&data, 0, sizeof (struct syscall_parsing_data));
-+  data.sysinfo = allocate_syscalls_info ();
-+  result_cleanup = make_cleanup_free_syscalls_info (data.sysinfo);
-+
-+  if (gdb_xml_parse (parser, document) == 0)
-+    {
-+      /* Parsed successfully.  */
-+      discard_cleanups (result_cleanup);
-+      return data.sysinfo;
-+    }
-+  else
-+    {
-+      warning (_("Could not load XML syscalls info; ignoring"));
-+      do_cleanups (result_cleanup);
-+      return NULL;
-+    }
-+}
-+
-+const struct syscalls_info *
-+xml_init_syscalls_info (const char *filename)
-+{
-+  char *full_file;
-+  char *dirname;
-+  struct syscalls_info *sysinfo;
-+  struct cleanup *back_to;
++            if (j == len)
++              error (_("no member function matches that type instantiation"));            }
+         else
+-          j = 0;
++          {
++            int ii;
++            /* Skip artificial methods. This is necessary if, for example,
++               the user wants to "print subclass::subclass" with only
++               one defined user constructor. There is no ambiguity in this
++               case. */
++            for (ii = 0; ii < TYPE_FN_FIELDLIST_LENGTH (t, i);
++                 ++ii)
++              {
++                if (TYPE_FN_FIELD_ARTIFICIAL (f, ii))
++                  --len;
++              }
 +
-+  full_file = fetch_xml_from_file (filename, gdb_datadir);
-+  if (full_file == NULL)
-+    {
-+      warning (_("Could not open \"%s\""), filename);
-+      return NULL;
-+    }
++            /* Desired method is ambiguous if more than one method is
++               defined. */
++            if (len > 1)
++              error (_("non-unique member `%s' requires type instantiation"), name);
 +
-+  back_to = make_cleanup (xfree, full_file);
++            /* This assumes, of course, that all artificial methods appear
++               BEFORE any concrete methods. */
++            j = TYPE_FN_FIELDLIST_LENGTH (t, i) - 1;
++          }
+         if (TYPE_FN_FIELD_STATIC_P (f, j))
+           {
+@@ -2761,7 +2939,7 @@ value_maybe_namespace_elt (const struct type *curtype,
+   struct symbol *sym;
+   struct value *result;
+-  sym = cp_lookup_symbol_namespace (namespace_name, name, NULL,
++  sym = cp_lookup_symbol_namespace(namespace_name, name,
+                                   get_selected_block (0), 
+                                   VAR_DOMAIN);
+@@ -2905,7 +3083,7 @@ value_of_local (const char *name, int complain)
+   /* Calling lookup_block_symbol is necessary to get the LOC_REGISTER
+      symbol instead of the LOC_ARG one (if both exist).  */
+-  sym = lookup_block_symbol (b, name, NULL, VAR_DOMAIN);
++  sym = lookup_block_symbol (b, name, VAR_DOMAIN);
+   if (sym == NULL)
+     {
+       if (complain)
+@@ -2959,8 +3137,6 @@ value_slice (struct value *array, int lowbound, int length)
+       || lowbound + length - 1 > upperbound)
+     error (_("slice out of range"));
+-  /* FIXME-type-allocation: need a way to free this type when we are
+-     done with it.  */
+   slice_range_type = create_range_type ((struct type *) NULL,
+                                       TYPE_TARGET_TYPE (range_type),
+                                       lowbound, 
+diff --git a/gdb/valprint.c b/gdb/valprint.c
+index cbb5d94..f9634ea 100644
+--- a/gdb/valprint.c
++++ b/gdb/valprint.c
+@@ -236,7 +236,6 @@ scalar_type_p (struct type *type)
+     case TYPE_CODE_STRUCT:
+     case TYPE_CODE_UNION:
+     case TYPE_CODE_SET:
+-    case TYPE_CODE_STRING:
+     case TYPE_CODE_BITSTRING:
+       return 0;
+     default:
+@@ -1153,6 +1152,7 @@ val_print_array_elements (struct type *type, const gdb_byte *valaddr,
+   for (; i < len && things_printed < options->print_max; i++)
+     {
++      size_t elt_offset = i * eltlen;
+       if (i != 0)
+       {
+         if (options->prettyprint_arrays)
+@@ -1172,7 +1172,7 @@ val_print_array_elements (struct type *type, const gdb_byte *valaddr,
+       rep1 = i + 1;
+       reps = 1;
+       while ((rep1 < len) &&
+-           !memcmp (valaddr + i * eltlen, valaddr + rep1 * eltlen, eltlen))
++           !memcmp (valaddr + elt_offset, valaddr + rep1 * eltlen, eltlen))
+       {
+         ++reps;
+         ++rep1;
+diff --git a/gdb/value.c b/gdb/value.c
+index 589e03b..66013b7 100644
+--- a/gdb/value.c
++++ b/gdb/value.c
+@@ -37,8 +37,10 @@
+ #include "block.h"
+ #include "dfp.h"
+ #include "objfiles.h"
++#include "cli/cli-decode.h"
+ #include "valprint.h"
+ #include "cli/cli-decode.h"
++#include "observer.h"
+ #include "python/python.h"
+@@ -170,6 +172,14 @@ struct value
+      taken off this list.  */
+   struct value *next;
++  /* The reference count.  A value that is still on the `all_values'
++     list will have a reference count of 0.  A call to `release_value'
++     will increment the reference count (and remove the value from the
++     list, the first time).  A call to `value_free' will decrement the
++     reference count, and will free the value when there are no more
++     references.  */
++  int refcount;
 +
-+  dirname = ldirname (filename);
-+  if (dirname != NULL)
-+    make_cleanup (xfree, dirname);
+   /* Register number if the value is from a register.  */
+   short regnum;
+@@ -261,7 +271,9 @@ allocate_value_lazy (struct type *type)
+   val->next = all_values;
+   all_values = val;
+   val->type = type;
++  type_incref (type);
+   val->enclosing_type = type;
++  type_incref (type);
+   VALUE_LVAL (val) = not_lval;
+   val->location.address = 0;
+   VALUE_FRAME_ID (val) = null_frame_id;
+@@ -346,6 +358,8 @@ value_type (struct value *value)
+ void
+ deprecated_set_value_type (struct value *value, struct type *type)
+ {
++  type_incref (type);
++  type_decref (value->type);
+   value->type = type;
+ }
+@@ -624,6 +638,9 @@ value_free (struct value *val)
+       if (val->parent != NULL)
+       value_free (val->parent);
++      type_decref (val->type);
++      type_decref (val->enclosing_type);
 +
-+  sysinfo = syscall_parse_xml (full_file, fetch_xml_from_file, dirname);
-+  do_cleanups (back_to);
+       if (VALUE_LVAL (val) == lval_computed)
+       {
+         struct lval_funcs *funcs = val->location.computed.funcs;
+@@ -728,6 +745,9 @@ value_copy (struct value *arg)
+     val = allocate_value_lazy (encl_type);
+   else
+     val = allocate_value (encl_type);
 +
-+  return sysinfo;
-+}
++  type_incref (arg->type);
++  type_decref (val->type);
+   val->type = arg->type;
+   VALUE_LVAL (val) = VALUE_LVAL (arg);
+   val->location = arg->location;
+@@ -763,12 +783,15 @@ value_copy (struct value *arg)
+ void
+ set_value_component_location (struct value *component, struct value *whole)
+ {
++  CORE_ADDR addr;
 +
-+int
-+xml_get_syscall_number (const struct syscalls_info *sysinfo,
-+                        const char *syscall_name)
-+{
-+  struct syscall_desc *sysdesc;
-+  int i;
+   if (VALUE_LVAL (whole) == lval_internalvar)
+     VALUE_LVAL (component) = lval_internalvar_component;
+   else
+     VALUE_LVAL (component) = VALUE_LVAL (whole);
+   component->location = whole->location;
 +
-+  if (sysinfo == NULL
-+      || syscall_name == NULL)
-+    return UNKNOWN_SYSCALL;
+   if (VALUE_LVAL (whole) == lval_computed)
+     {
+       struct lval_funcs *funcs = whole->location.computed.funcs;
+@@ -776,6 +799,10 @@ set_value_component_location (struct value *component, struct value *whole)
+       if (funcs->copy_closure)
+         component->location.computed.closure = funcs->copy_closure (whole);
+     }
 +
-+  for (i = 0;
-+       VEC_iterate(syscall_desc_p, sysinfo->syscalls, i, sysdesc);
-+       i++)
-+    if (strcmp (sysdesc->name, syscall_name) == 0)
-+      return sysdesc->number;
++  addr = value_raw_address (component);
++  object_address_get_data (value_type (whole), &addr);
++  set_value_address (component, addr);
+ }
\f
+@@ -906,6 +933,29 @@ show_values (char *num_exp, int from_tty)
+       num_exp[1] = '\0';
+     }
+ }
 +
-+  return UNKNOWN_SYSCALL;
-+}
++/* Sanity check for memory leaks and proper types reference counting.  */
 +
-+const char *
-+xml_get_syscall_name (const struct syscalls_info *sysinfo,
-+                      int syscall_number)
++static void
++value_history_cleanup (void *unused)
 +{
-+  struct syscall_desc *sysdesc;
-+  int i;
-+
-+  if (sysinfo == NULL
-+      || syscall_number < 0)
-+    return NULL;
++  while (value_history_chain)
++    {
++      struct value_history_chunk *chunk = value_history_chain;
++      int i;
 +
-+  for (i = 0;
-+       VEC_iterate(syscall_desc_p, sysinfo->syscalls, i, sysdesc);
-+       i++)
-+    if (sysdesc->number == syscall_number)
-+      return sysdesc->name;
++      for (i = 0; i < ARRAY_SIZE (chunk->values); i++)
++              value_free (chunk->values[i]);
 +
-+  return NULL;
-+}
++      value_history_chain = chunk->next;
++      xfree (chunk);
++    }
++  value_history_count = 0;
 +
-+int
-+xml_number_of_syscalls (const struct syscalls_info *sysinfo)
-+{
-+  return (sysinfo == NULL ? 0 : VEC_length(syscall_desc_p,
-+                                           sysinfo->syscalls));
++  /* Free the unreferenced types above.  */
++  free_all_values ();
++  free_all_types ();
 +}
\f
+ /* Internal variables.  These are variables within the debugger
+    that hold values assigned by debugger commands.
+@@ -1381,6 +1431,40 @@ call_internal_function (struct gdbarch *gdbarch,
+   return (*ifn->handler) (gdbarch, language, ifn->cookie, argc, argv);
+ }
++/* Call type_mark_used for any TYPEs referenced from this GDB source file.  */
 +
-+const char **
-+xml_list_of_syscalls (const struct syscalls_info *sysinfo)
++static void
++value_types_mark_used (void)
 +{
-+  struct syscall_desc *sysdesc;
-+  const char **names = NULL;
-+  int nsyscalls;
-+  int i;
++  struct internalvar *var;
++  struct value_history_chunk *chunk;
 +
-+  if (sysinfo == NULL)
-+    return NULL;
++  for (var = internalvars; var != NULL; var = var->next)
++    switch (var->kind)
++      {
++      case INTERNALVAR_VALUE:
++      type_mark_used (value_type (var->u.value));
++      break;
 +
-+  nsyscalls = VEC_length (syscall_desc_p, sysinfo->syscalls);
-+  names = xmalloc ((nsyscalls + 1) * sizeof (char *));
++      case INTERNALVAR_INTEGER:
++      type_mark_used (var->u.integer.type);
++      break;
 +
-+  for (i = 0;
-+       VEC_iterate (syscall_desc_p, sysinfo->syscalls, i, sysdesc);
-+       i++)
-+    names[i] = sysdesc->name;
++      case INTERNALVAR_POINTER:
++      type_mark_used (var->u.pointer.type);
++      break;
++      }
 +
-+  names[i] = NULL;
++  for (chunk = value_history_chain; chunk != NULL; chunk = chunk->next)
++    {
++      int i;
 +
-+  return names;
++      for (i = 0; i < ARRAY_SIZE (chunk->values); i++)
++      if (chunk->values[i])
++        type_mark_used (value_type (chunk->values[i]));
++    }
 +}
 +
-+#endif /* HAVE_LIBEXPAT */
-diff --git a/gdb/xml-syscall.h b/gdb/xml-syscall.h
-new file mode 100644
-index 0000000..ff11f20
---- /dev/null
-+++ b/gdb/xml-syscall.h
-@@ -0,0 +1,64 @@
-+/* Functions that provide the mechanism to parse a syscall XML file
-+   and get its values.
-+
-+   Copyright (C) 1986, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996,
-+   1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006, 2007, 2008
-+   Free Software Foundation, Inc.
-+
-+   This file is part of GDB.
+ /* 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
+@@ -1428,11 +1512,10 @@ preserve_one_value (struct value *value, struct objfile *objfile,
+                   htab_t copied_types)
+ {
+   if (TYPE_OBJFILE (value->type) == objfile)
+-    value->type = copy_type_recursive (objfile, value->type, copied_types);
++    value->type = copy_type_recursive (value->type, copied_types);
+   if (TYPE_OBJFILE (value->enclosing_type) == objfile)
+-    value->enclosing_type = copy_type_recursive (objfile,
+-                                               value->enclosing_type,
++    value->enclosing_type = copy_type_recursive (value->enclosing_type,
+                                                copied_types);
+ }
+@@ -1447,13 +1530,13 @@ 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
+-        = copy_type_recursive (objfile, var->u.integer.type, copied_types);
++        = copy_type_recursive (var->u.integer.type, copied_types);
+       break;
+     case INTERNALVAR_POINTER:
+       if (TYPE_OBJFILE (var->u.pointer.type) == objfile)
+       var->u.pointer.type
+-        = copy_type_recursive (objfile, var->u.pointer.type, copied_types);
++        = copy_type_recursive (var->u.pointer.type, copied_types);
+       break;
+     case INTERNALVAR_VALUE:
+@@ -1855,6 +1938,8 @@ value_change_enclosing_type (struct value *val, struct type *new_encl_type)
+     val->contents =
+       (gdb_byte *) xrealloc (val->contents, TYPE_LENGTH (new_encl_type));
++  type_incref (new_encl_type);
++  type_decref (val->enclosing_type);
+   val->enclosing_type = new_encl_type;
+   return val;
+ }
+@@ -1919,6 +2004,8 @@ value_primitive_field (struct value *arg1, int offset,
+         memcpy (value_contents_all_raw (v), value_contents_all_raw (arg1),
+                 TYPE_LENGTH (value_enclosing_type (arg1)));
+       }
++      type_incref (type);
++      type_decref (v->type);
+       v->type = type;
+       v->offset = value_offset (arg1);
+       v->embedded_offset = (offset + value_embedded_offset (arg1)
+@@ -2177,6 +2264,42 @@ pack_long (gdb_byte *buf, struct type *type, LONGEST num)
+ }
++/* Pack NUM into BUF using a target format of TYPE.  */
 +
-+   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.
++void
++pack_unsigned_long (gdb_byte *buf, struct type *type, ULONGEST num)
++{
++  enum bfd_endian byte_order = gdbarch_byte_order (get_type_arch (type));
++  int len;
 +
-+   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.
++  type = check_typedef (type);
++  len = TYPE_LENGTH (type);
 +
-+   You should have received a copy of the GNU General Public License
-+   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
++  switch (TYPE_CODE (type))
++    {
++    case TYPE_CODE_INT:
++    case TYPE_CODE_CHAR:
++    case TYPE_CODE_ENUM:
++    case TYPE_CODE_FLAGS:
++    case TYPE_CODE_BOOL:
++    case TYPE_CODE_RANGE:
++    case TYPE_CODE_MEMBERPTR:
++      store_unsigned_integer (buf, len, byte_order, num);
++      break;
 +
-+#ifndef XML_SYSCALL_H
-+#define XML_SYSCALL_H 1
++    case TYPE_CODE_REF:
++    case TYPE_CODE_PTR:
++      store_typed_address (buf, type, (CORE_ADDR) num);
++      break;
 +
-+/* Structure that stores information about the system's
-+   syscalls.  */
++    default:
++      error (_("\
++Unexpected type (%d) encountered for unsigned integer constant."),
++           TYPE_CODE (type));
++    }
++}
 +
-+struct syscalls_info;
 +
+ /* Convert C numbers into newly allocated values.  */
+ struct value *
+@@ -2190,6 +2313,19 @@ value_from_longest (struct type *type, LONGEST num)
+ }
++/* Convert C unsigned numbers into newly allocated values.  */
 +
-+/* Function responsible for initializing the information
-+   about the syscalls.  It reads the XML file and fills the
-+   struct syscalls_info with the values.
-+   
-+   Returns the struct syscalls_info if the file is valid, NULL otherwise.  */
-+
-+const struct syscalls_info *xml_init_syscalls_info (const char *);
-+
-+/* Function that retrieves the syscall number corresponding to the given
-+   name.
-+
-+   Returns the syscall number if found, or  otherwise.  */
-+
-+int xml_get_syscall_number (const struct syscalls_info *, const char *);
-+
-+/* Function that retrieves the syscall name corresponding to the given
-+   number.
-+
-+   Returns the syscall name if found, NULL otherwise.  */
-+const char *xml_get_syscall_name (const struct syscalls_info *, int);
-+
-+/* Function that returns the number of syscalls defined in the system.
-+
-+   Returns the number of syscalls, or zero otherwise.  */
-+int xml_number_of_syscalls (const struct syscalls_info *);
-+
-+/* Function used to retrieve the list of syscalls in the system.  This list
-+   is returned as an array of strings.
-+
-+   Returns the list of syscalls in the system, or NULL otherwise.  */
-+const char **xml_list_of_syscalls (const struct syscalls_info *sysinfo);
-+
-+#endif /* XML_SYSCALL_H */
-diff --git a/include/elf/common.h b/include/elf/common.h
-index 3ba44d9..764141e 100644
---- a/include/elf/common.h
-+++ b/include/elf/common.h
-@@ -803,6 +803,7 @@
- #define       AT_SECURE       23              /* Boolean, was exec setuid-like?  */
- #define AT_BASE_PLATFORM 24           /* String identifying real platform,
-                                          may differ from AT_PLATFORM.  */
-+#define AT_RANDOM     25              /* Address of 16 random bytes.  */
- #define AT_EXECFN     31              /* Filename of executable.  */
- /* Pointer to the global system page used for system calls and other
-    nice things.  */
-diff --git a/opcodes/po/es.po b/opcodes/po/es.po
-index 873be13..40bea5c 100644
---- a/opcodes/po/es.po
-+++ b/opcodes/po/es.po
-@@ -1,13 +1,14 @@
--# Mensajes en español para opcodes-2.17.90.
--# Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
--# Cristian Othón Martínez Vera <cfuga@itam.mx>, 2002, 2003, 2004, 2005, 2006, 2007.
-+# Mensajes en español para opcodes-2.18.90.
-+# Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
-+# This file is distributed under the same license as the binutils package.
-+# Cristian Othón Martínez Vera <cfuga@itam.mx>, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009.
- #
- msgid ""
- msgstr ""
--"Project-Id-Version: opcodes 2.17.90\n"
--"Report-Msgid-Bugs-To: \n"
--"POT-Creation-Date: 2007-07-05 09:17+0100\n"
--"PO-Revision-Date: 2007-09-08 09:17-0500\n"
-+"Project-Id-Version: opcodes 2.18.90\n"
-+"Report-Msgid-Bugs-To: bug-binutils@gnu.org\n"
-+"POT-Creation-Date: 2008-09-09 15:56+0930\n"
-+"PO-Revision-Date: 2009-03-03 21:46-0600\n"
- "Last-Translator: Cristian Othón Martínez Vera <cfuga@itam.mx>\n"
- "Language-Team: Spanish <es@li.org>\n"
- "MIME-Version: 1.0\n"
-@@ -52,7 +53,7 @@ msgid "too many long constants"
- msgstr "demasiadas constantes long"
- #: arc-opc.c:668
--msgid "to many shimms in load"
-+msgid "too many shimms in load"
- msgstr "demasiados shimms en load"
- #. Do we have a limm already?
-@@ -124,7 +125,7 @@ msgstr "No se reconoce el conjunto de nombres de registro: %s\n"
- msgid "Unrecognised disassembler option: %s\n"
- msgstr "No se reconoce la opción de desensamblador: %s\n"
--#: arm-dis.c:4226
-+#: arm-dis.c:4238
- #, c-format
- msgid ""
- "\n"
-@@ -196,14 +197,14 @@ msgstr "La lista de registros no es v
- #: fr30-asm.c:310 frv-asm.c:1263 ip2k-asm.c:511 iq2000-asm.c:459
- #: m32c-asm.c:1589 m32r-asm.c:328 mep-asm.c:1001 mt-asm.c:595
--#: openrisc-asm.c:241 xc16x-asm.c:375 xstormy16-asm.c:276
-+#: openrisc-asm.c:241 xc16x-asm.c:376 xstormy16-asm.c:276
- #, c-format
- msgid "Unrecognized field %d while parsing.\n"
- msgstr "No se reconoció el campo %d durante la decodificación.\n"
- #: fr30-asm.c:361 frv-asm.c:1314 ip2k-asm.c:562 iq2000-asm.c:510
- #: m32c-asm.c:1640 m32r-asm.c:379 mep-asm.c:1052 mt-asm.c:646
--#: openrisc-asm.c:292 xc16x-asm.c:426 xstormy16-asm.c:327
-+#: openrisc-asm.c:292 xc16x-asm.c:427 xstormy16-asm.c:327
- msgid "missing mnemonic in syntax string"
- msgstr "falta el mnemónico en la cadena sintáctica"
-@@ -216,7 +217,7 @@ msgstr "falta el mnem
- #: m32r-asm.c:605 m32r-asm.c:706 mep-asm.c:1187 mep-asm.c:1191 mep-asm.c:1278
- #: mep-asm.c:1379 mt-asm.c:781 mt-asm.c:785 mt-asm.c:872 mt-asm.c:973
- #: openrisc-asm.c:427 openrisc-asm.c:431 openrisc-asm.c:518 openrisc-asm.c:619
--#: xc16x-asm.c:561 xc16x-asm.c:565 xc16x-asm.c:652 xc16x-asm.c:753
-+#: xc16x-asm.c:562 xc16x-asm.c:566 xc16x-asm.c:653 xc16x-asm.c:754
- #: xstormy16-asm.c:462 xstormy16-asm.c:466 xstormy16-asm.c:553
- #: xstormy16-asm.c:654
- msgid "unrecognized instruction"
-@@ -224,40 +225,40 @@ msgstr "no se reconoce la instrucci
- #: fr30-asm.c:543 frv-asm.c:1496 ip2k-asm.c:744 iq2000-asm.c:692
- #: m32c-asm.c:1822 m32r-asm.c:561 mep-asm.c:1234 mt-asm.c:828
--#: openrisc-asm.c:474 xc16x-asm.c:608 xstormy16-asm.c:509
-+#: openrisc-asm.c:474 xc16x-asm.c:609 xstormy16-asm.c:509
- #, c-format
- msgid "syntax error (expected char `%c', found `%c')"
- msgstr "error sintáctico (se esperaba el carácter `%c', se encontró `%c')"
- #: fr30-asm.c:553 frv-asm.c:1506 ip2k-asm.c:754 iq2000-asm.c:702
- #: m32c-asm.c:1832 m32r-asm.c:571 mep-asm.c:1244 mt-asm.c:838
--#: openrisc-asm.c:484 xc16x-asm.c:618 xstormy16-asm.c:519
-+#: openrisc-asm.c:484 xc16x-asm.c:619 xstormy16-asm.c:519
- #, c-format
- msgid "syntax error (expected char `%c', found end of instruction)"
- msgstr "error sintáctico (se esperaba el carácter `%c', se encontró el final de la instrucción)"
- #: fr30-asm.c:581 frv-asm.c:1534 ip2k-asm.c:782 iq2000-asm.c:730
- #: m32c-asm.c:1860 m32r-asm.c:599 mep-asm.c:1272 mt-asm.c:866
--#: openrisc-asm.c:512 xc16x-asm.c:646 xstormy16-asm.c:547
-+#: openrisc-asm.c:512 xc16x-asm.c:647 xstormy16-asm.c:547
- msgid "junk at end of line"
- msgstr "basura al final de la línea"
- #: fr30-asm.c:687 frv-asm.c:1640 ip2k-asm.c:888 iq2000-asm.c:836
- #: m32c-asm.c:1966 m32r-asm.c:705 mep-asm.c:1378 mt-asm.c:972
--#: openrisc-asm.c:618 xc16x-asm.c:752 xstormy16-asm.c:653
-+#: openrisc-asm.c:618 xc16x-asm.c:753 xstormy16-asm.c:653
- msgid "unrecognized form of instruction"
- msgstr "no se reconoce la forma de instrucción"
- #: fr30-asm.c:699 frv-asm.c:1652 ip2k-asm.c:900 iq2000-asm.c:848
- #: m32c-asm.c:1978 m32r-asm.c:717 mep-asm.c:1390 mt-asm.c:984
--#: openrisc-asm.c:630 xc16x-asm.c:764 xstormy16-asm.c:665
-+#: openrisc-asm.c:630 xc16x-asm.c:765 xstormy16-asm.c:665
- #, c-format
- msgid "bad instruction `%.50s...'"
- msgstr "instrucción errónea `%.50s...'"
- #: fr30-asm.c:702 frv-asm.c:1655 ip2k-asm.c:903 iq2000-asm.c:851
- #: m32c-asm.c:1981 m32r-asm.c:720 mep-asm.c:1393 mt-asm.c:987
--#: openrisc-asm.c:633 xc16x-asm.c:767 xstormy16-asm.c:668
-+#: openrisc-asm.c:633 xc16x-asm.c:768 xstormy16-asm.c:668
- #, c-format
- msgid "bad instruction `%.50s'"
- msgstr "instrucción errónea `%.50s'"
-@@ -377,11 +378,11 @@ msgstr "no se puede lidiar con insert %d\n"
- msgid "%02x\t\t*unknown*"
- msgstr "%02x\t\t*desconocido*"
--#: i386-dis.c:3196
-+#: i386-dis.c:9545
- msgid "<internal disassembler error>"
- msgstr "<error interno del desensamblador>"
--#: i386-dis.c:3423
-+#: i386-dis.c:9776
- #, c-format
- msgid ""
- "\n"
-@@ -392,79 +393,124 @@ msgstr ""
- "Se admiten las siguientes opciones de desensamblador específicas de i386/x86-64\n"
- "con el interruptor -M (las opciones múltiples se deben separar con comas):\n"
--#: i386-dis.c:3427
-+#: i386-dis.c:9780
- #, c-format
- msgid "  x86-64      Disassemble in 64bit mode\n"
- msgstr "  x86-64      Desensambla en modo 64bit\n"
--#: i386-dis.c:3428
-+#: i386-dis.c:9781
- #, c-format
- msgid "  i386        Disassemble in 32bit mode\n"
- msgstr "  i386        Desensambla en modo 32bit\n"
--#: i386-dis.c:3429
-+#: i386-dis.c:9782
- #, c-format
- msgid "  i8086       Disassemble in 16bit mode\n"
- msgstr "  i8086       Desensambla en modo 16bit\n"
--#: i386-dis.c:3430
-+#: i386-dis.c:9783
- #, c-format
- msgid "  att         Display instruction in AT&T syntax\n"
- msgstr "  att         Muestra las instrucciones con sintaxis AT&T\n"
--#: i386-dis.c:3431
-+#: i386-dis.c:9784
- #, c-format
- msgid "  intel       Display instruction in Intel syntax\n"
- msgstr "  intel       Muestra las instrucciones con sintaxis Intel\n"
--#: i386-dis.c:3432
-+#: i386-dis.c:9785
-+#, c-format
-+msgid ""
-+"  att-mnemonic\n"
-+"              Display instruction in AT&T mnemonic\n"
-+msgstr ""
-+"  att-mnemonic\n"
-+"              Muestra las instrucciones con mnemónicos AT&T\n"
-+
-+#: i386-dis.c:9787
-+#, c-format
-+msgid ""
-+"  intel-mnemonic\n"
-+"              Display instruction in Intel mnemonic\n"
-+msgstr ""
-+"  intel-mnemonic\n"
-+"              Muestra las instrucciones con mnemónicos Intel\n"
-+
-+#: i386-dis.c:9789
- #, c-format
- msgid "  addr64      Assume 64bit address size\n"
- msgstr "  addr64      Asume un tamaño de dirección de 64bit\n"
--#: i386-dis.c:3433
-+#: i386-dis.c:9790
- #, c-format
- msgid "  addr32      Assume 32bit address size\n"
- msgstr "  addr32      Asume un tamaño de dirección de 32bit\n"
--#: i386-dis.c:3434
-+#: i386-dis.c:9791
- #, c-format
- msgid "  addr16      Assume 16bit address size\n"
- msgstr "  addr16      Asume un tamaño de dirección de 16bit\n"
--#: i386-dis.c:3435
-+#: i386-dis.c:9792
- #, c-format
- msgid "  data32      Assume 32bit data size\n"
- msgstr "  data32      Asume un tamaño de datos de 32bit\n"
--#: i386-dis.c:3436
-+#: i386-dis.c:9793
- #, c-format
- msgid "  data16      Assume 16bit data size\n"
- msgstr "  data16      Asume un tamaño de datos de 16bit\n"
--#: i386-dis.c:3437
-+#: i386-dis.c:9794
- #, c-format
- msgid "  suffix      Always display instruction suffix in AT&T syntax\n"
- msgstr "  suffix      Siempre muestra el sufijo de instrucción con sintaxis AT&T\n"
--#: i386-gen.c:42 ia64-gen.c:307
-+#: i386-gen.c:411 ia64-gen.c:307
- #, c-format
- msgid "%s: Error: "
- msgstr "%s: Error: "
--#: i386-gen.c:109
--msgid "can't find i386-opc.tbl for reading\n"
--msgstr "no se puede encontrar i386-opc.tbl para lectura\n"
-+#: i386-gen.c:510
-+#, c-format
-+msgid "%s: %d: Unknown bitfield: %s\n"
-+msgstr "%s: %d: Campo de bits desconocido: %s\n"
-+
-+#: i386-gen.c:674
-+#, c-format
-+msgid "can't find i386-opc.tbl for reading, errno = %s\n"
-+msgstr "no se puede encontrar i386-opc.tbl para lectura, errno =%s\n"
--#: i386-gen.c:260
--msgid "can't find i386-reg.tbl for reading\n"
--msgstr "no se puede encontrar i386-reg.tbl para lectura\n"
-+#: i386-gen.c:851
-+#, c-format
-+msgid "can't find i386-reg.tbl for reading, errno = %s\n"
-+msgstr "no se puede encontrar i386-reg.tbl para lectura, errno = %s\n"
-+
-+#: i386-gen.c:943
-+#, c-format
-+msgid "can't create i386-init.h, errno = %s\n"
-+msgstr "no se puede crear i386-init.h, errno = %s\n"
--#: i386-gen.c:386 ia64-gen.c:2841
-+#: i386-gen.c:1032 ia64-gen.c:2850
- #, c-format
- msgid "unable to change directory to \"%s\", errno = %s\n"
- msgstr "no se puede cambiar el directorio a \"%s\", errno = %s\n"
-+#: i386-gen.c:1039
-+#, c-format
-+msgid "%d unused bits in i386_cpu_flags.\n"
-+msgstr "%d bits sin usar en i386_cpu_flags.\n"
-+
-+#: i386-gen.c:1046
-+#, c-format
-+msgid "%d unused bits in i386_operand_type.\n"
-+msgstr "%d bits sin usar en i386_operand_type.\n"
-+
-+#: i386-gen.c:1060
-+#, c-format
-+msgid "can't create i386-tbl.h, errno = %s\n"
-+msgstr "no se puede crear i386-tbl.h, errno = %s\n"
-+
- #: ia64-gen.c:320
- #, c-format
- msgid "%s: Warning: "
-@@ -503,62 +549,67 @@ msgstr "campo solapado %s->%s\n"
- msgid "overwriting note %d with note %d (IC:%s)\n"
- msgstr "se sobreescribe la nota %d con la nota %d (IC:%s)\n"
--#: ia64-gen.c:1455
-+#: ia64-gen.c:1459
- #, c-format
- msgid "don't know how to specify %% dependency %s\n"
- msgstr "no se sabe cómo especificar la dependencia %% %s\n"
--#: ia64-gen.c:1477
-+#: ia64-gen.c:1481
- #, c-format
- msgid "Don't know how to specify # dependency %s\n"
- msgstr "No se sabe cómo especificar la dependencia # %s\n"
--#: ia64-gen.c:1516
-+#: ia64-gen.c:1520
- #, c-format
- msgid "IC:%s [%s] has no terminals or sub-classes\n"
- msgstr "IC:%s [%s] no tiene terminales o sub-clases\n"
--#: ia64-gen.c:1519
-+#: ia64-gen.c:1523
- #, c-format
- msgid "IC:%s has no terminals or sub-classes\n"
- msgstr "IC:%s no tiene terminales o sub-clases\n"
--#: ia64-gen.c:1528
-+#: ia64-gen.c:1532
- #, c-format
- msgid "no insns mapped directly to terminal IC %s [%s]"
- msgstr "no hay insns mapeadas directamente al IC terminal %s [%s]"
--#: ia64-gen.c:1531
-+#: ia64-gen.c:1535
- #, c-format
- msgid "no insns mapped directly to terminal IC %s\n"
- msgstr "no hay insns mapeadas directamente al IC terminal %s\n"
--#: ia64-gen.c:1542
-+#: ia64-gen.c:1546
- #, c-format
- msgid "class %s is defined but not used\n"
- msgstr "se define la clase %s pero no se utiliza\n"
--#: ia64-gen.c:1553
-+#: ia64-gen.c:1559
- #, c-format
--msgid "Warning: rsrc %s (%s) has no chks%s\n"
--msgstr "Aviso: el rsrc %s (%s) no tiene chks%s\n"
-+msgid "Warning: rsrc %s (%s) has no chks\n"
-+msgstr "Aviso: el rsrc %s (%s) no tiene chks\n"
--#: ia64-gen.c:1557
-+#: ia64-gen.c:1562
-+#, c-format
-+msgid "Warning: rsrc %s (%s) has no chks or regs\n"
-+msgstr "Aviso: el rsrc %s (%s) no tiene chks o regs\n"
-+
-+#: ia64-gen.c:1566
- #, c-format
- msgid "rsrc %s (%s) has no regs\n"
- msgstr "el rsrc %s (%s) no tiene registros\n"
--#: ia64-gen.c:2469
-+#: ia64-gen.c:2478
- #, c-format
- msgid "IC note %d in opcode %s (IC:%s) conflicts with resource %s note %d\n"
- msgstr "la nota IC %d en el código de operación %s (IC:%s) tiene conflictos con el recurso %s nota %d\n"
--#: ia64-gen.c:2497
-+#: ia64-gen.c:2506
- #, c-format
- msgid "IC note %d for opcode %s (IC:%s) conflicts with resource %s note %d\n"
- msgstr "la nota IC %d para el código de operación %s (IC:%s) tiene conflictos con el recurso %s nota %d\n"
--#: ia64-gen.c:2511
-+#: ia64-gen.c:2520
- #, c-format
- msgid "opcode %s has no class (ops %d %d %d)\n"
- msgstr "el código de operación %s no tiene clase (ops %d %d %d)\n"
-@@ -739,26 +790,26 @@ msgstr "S
- msgid "invalid %function() here"
- msgstr "%funcion() inválida aquí"
--#: mips-dis.c:745
-+#: mips-dis.c:781
- msgid "# internal error, incomplete extension sequence (+)"
- msgstr "# error interno, secuencia de extensión incompleta (+)"
--#: mips-dis.c:852
-+#: mips-dis.c:915
- #, c-format
- msgid "# internal error, undefined extension sequence (+%c)"
- msgstr "# error interno, secuencia de extensión sin definir (+%c)"
--#: mips-dis.c:1211
-+#: mips-dis.c:1274
- #, c-format
--msgid "# internal error, undefined modifier(%c)"
--msgstr "# error interno, modificador(%c) sin definir"
-+msgid "# internal error, undefined modifier (%c)"
-+msgstr "# error interno, modificador (%c) sin definir"
--#: mips-dis.c:1818
-+#: mips-dis.c:1881
- #, c-format
- msgid "# internal disassembler error, unrecognised modifier (%c)"
- msgstr "# error interno del desensamblador, no se reconoce el modificador (%c)"
--#: mips-dis.c:2049
-+#: mips-dis.c:2112
- #, c-format
- msgid ""
- "\n"
-@@ -769,7 +820,7 @@ msgstr ""
- "Las siguientes opciones de desensamblador específicas de MIPS se admiten\n"
- "para usarse con el interruptor -M (las opciones múltiples se deben separar con comas):\n"
--#: mips-dis.c:2053
-+#: mips-dis.c:2116
- #, c-format
- msgid ""
- "\n"
-@@ -780,7 +831,7 @@ msgstr ""
- "  gpr-names=ABI            Muestra los nombres GPR de acuerdo a la ABI especificada.\n"
- "                           Por defecto: basado en el binario a desensamblar.\n"
--#: mips-dis.c:2057
-+#: mips-dis.c:2120
- #, c-format
- msgid ""
- "\n"
-@@ -791,7 +842,7 @@ msgstr ""
- "  fpr-names=ABI            Muestra los nombres FPR de acuerdo a la ABI especificada.\n"
- "                           Por defecto: numérico.\n"
--#: mips-dis.c:2061
-+#: mips-dis.c:2124
- #, c-format
- msgid ""
- "\n"
-@@ -804,7 +855,7 @@ msgstr ""
- "                           la arquitectura especificada.\n"
- "                           Por defecto: basado en el binario a desensamblar.\n"
--#: mips-dis.c:2066
-+#: mips-dis.c:2129
- #, c-format
- msgid ""
- "\n"
-@@ -817,7 +868,7 @@ msgstr ""
- "                           especificada.\n"
- "                           Por defecto: basado en el binario a desensamblar.\n"
--#: mips-dis.c:2071
-+#: mips-dis.c:2134
- #, c-format
- msgid ""
- "\n"
-@@ -828,7 +879,7 @@ msgstr ""
- "  reg-names=ABI            Muestra los nombres GPR y FPR de acuerdo a\n"
- "                           la ABI especificada.\n"
--#: mips-dis.c:2075
-+#: mips-dis.c:2138
- #, c-format
- msgid ""
- "\n"
-@@ -839,7 +890,7 @@ msgstr ""
- "  reg-names=ARCH           Muestra el registro CP0 y los nombres HWR de acuerdo a\n"
- "                           la arquitectura especificada.\n"
--#: mips-dis.c:2079
-+#: mips-dis.c:2142
- #, c-format
- msgid ""
- "\n"
-@@ -850,12 +901,12 @@ msgstr ""
- "  Para las opciones anteriores, se admiten los siguientes valores de \"ABI\":\n"
- "   "
--#: mips-dis.c:2084 mips-dis.c:2092 mips-dis.c:2094
-+#: mips-dis.c:2147 mips-dis.c:2155 mips-dis.c:2157
- #, c-format
- msgid "\n"
- msgstr "\n"
--#: mips-dis.c:2086
-+#: mips-dis.c:2149
- #, c-format
- msgid ""
- "\n"
-@@ -894,9 +945,8 @@ msgid "Biiiig Trouble in parse_imm16!"
- msgstr "¡Graaaan Problema en parse_imm16!"
- #: mt-asm.c:157
--#, c-format
--msgid "%operator operand is not a symbol"
--msgstr "el operando %operator no es un símbolo"
-+msgid "The percent-operator's operand is not a symbol"
-+msgstr "el operando de operador-porcentaje no es un símbolo"
- #: mt-asm.c:395
- msgid "invalid operand.  type may have values 0,1,2 only."
-@@ -912,42 +962,64 @@ msgstr "operando inv
- msgid "$<undefined>"
- msgstr "$<sin definir>"
--#: ppc-opc.c:782 ppc-opc.c:810
-+#: ppc-opc.c:862 ppc-opc.c:890
- msgid "invalid conditional option"
- msgstr "opción condicional inválida"
--#: ppc-opc.c:812
-+#: ppc-opc.c:892
- msgid "attempt to set y bit when using + or - modifier"
- msgstr "intento de establecer el bit y cuando se usaba el modificador + ó -"
--#: ppc-opc.c:844
-+#: ppc-opc.c:924
- msgid "invalid mask field"
- msgstr "campo de máscara inválido"
--#: ppc-opc.c:870
-+#: ppc-opc.c:950
- msgid "ignoring invalid mfcr mask"
- msgstr "se descarta la máscara mfcr inválida"
--#: ppc-opc.c:920 ppc-opc.c:955
-+#: ppc-opc.c:1000 ppc-opc.c:1035
- msgid "illegal bitmask"
- msgstr "máscara de bits ilegal"
--#: ppc-opc.c:1075
-+#: ppc-opc.c:1155
- msgid "index register in load range"
- msgstr "registro índice en el rango de carga"
--#: ppc-opc.c:1091
-+#: ppc-opc.c:1171
- msgid "source and target register operands must be different"
- msgstr "los operandos de registros fuente y objetivo deben ser diferentes"
--#: ppc-opc.c:1106
-+#: ppc-opc.c:1186
- msgid "invalid register operand when updating"
- msgstr "operando de registro inválido mientras se actualizaba"
--#: ppc-opc.c:1188
-+#: ppc-opc.c:1265
- msgid "invalid sprg number"
- msgstr "número sprg inválido"
-+#: s390-dis.c:276
-+#, c-format
-+msgid ""
-+"\n"
-+"The following S/390 specific disassembler options are supported for use\n"
-+"with the -M switch (multiple options should be separated by commas):\n"
-+msgstr ""
-+"\n"
-+"Las siguientes opciones de desensamblador específicas de S/390 se admiten\n"
-+"para usarse con el interruptor -M (las opciones múltiples se deben\n"
-+"separar con comas):\n"
-+
-+#: s390-dis.c:280
-+#, c-format
-+msgid "  esa         Disassemble in ESA architecture mode\n"
-+msgstr "  esa         Desensambla en modo de arquitectura ESA\n"
-+
-+#: s390-dis.c:281
-+#, c-format
-+msgid "  zarch       Disassemble in z/Architecture mode\n"
-+msgstr "  zarch       Desensambla en modo de z/Architecture\n"
-+
- #: score-dis.c:220 score-dis.c:383
- msgid "<illegal instruction>"
- msgstr "<instrucción ilegal>"
-@@ -1031,27 +1103,27 @@ msgstr "el valor inmediato no est
- msgid "immediate value must be even"
- msgstr "el valor inmediato debe ser par"
--#: xc16x-asm.c:65
-+#: xc16x-asm.c:66
- msgid "Missing '#' prefix"
- msgstr "Falta el prefijo '#'"
--#: xc16x-asm.c:81
-+#: xc16x-asm.c:82
- msgid "Missing '.' prefix"
- msgstr "Falta el prefijo '.'"
--#: xc16x-asm.c:97
-+#: xc16x-asm.c:98
- msgid "Missing 'pof:' prefix"
- msgstr "Falta el prefijo 'pof:'"
--#: xc16x-asm.c:113
-+#: xc16x-asm.c:114
- msgid "Missing 'pag:' prefix"
- msgstr "Falta el prefijo 'pag:'"
--#: xc16x-asm.c:129
-+#: xc16x-asm.c:130
- msgid "Missing 'sof:' prefix"
- msgstr "Falta el prefijo 'sof:'"
--#: xc16x-asm.c:145
-+#: xc16x-asm.c:146
- msgid "Missing 'seg:' prefix"
- msgstr "Falta el prefijo 'seg:'"
-@@ -1095,6 +1167,9 @@ msgstr "El operando no es un s
- msgid "Syntax error: No trailing ')'"
- msgstr "Error sintáctico: No hay ')' al final"
-+#~ msgid "%operator operand is not a symbol"
-+#~ msgstr "el operando %operator no es un símbolo"
-+
- #~ msgid "offset not a multiple of 16"
- #~ msgstr "el desplazamiento no es un múltiplo de 16"
-diff --git a/opcodes/po/id.po b/opcodes/po/id.po
-index 3edf294..0f6c063 100644
---- a/opcodes/po/id.po
-+++ b/opcodes/po/id.po
-@@ -1,46 +1,133 @@
--# opcodes 2.12.1 (Indonesian)
--# Copyright (C) 2002 Free Software Foundation, Inc.
-+# Pesan bahasa indonesia untuk opcodes
-+# Copyright (C) 2009 Free Software Foundation, Inc.
-+# This file is distributed under the same license as the binutils package.
- # Tedi Heriyanto <tedi_h@gmx.net>, 2002.
-+# Arif E. Nugroho <arif_endro@yahoo.com>, 2009.
- #
- msgid ""
- msgstr ""
--"Project-Id-Version: opcodes 2.12.1\n"
--"POT-Creation-Date: 2002-02-08 03:24-0200\n"
--"PO-Revision-Date: 2002-07-23 12:35GMT+0700\n"
--"Last-Translator: Tedi Heriyanto <tedi_h@gmx.net>\n"
-+"Project-Id-Version: opcodes 2.18.90\n"
-+"Report-Msgid-Bugs-To: bug-binutils@gnu.org\n"
-+"POT-Creation-Date: 2008-09-09 15:56+0930\n"
-+"PO-Revision-Date: 2009-03-10 13:30+0700\n"
-+"Last-Translator: Arif E. Nugroho <arif_endro@yahoo.com>\n"
- "Language-Team: Indonesian <translation-team-id@lists.sourceforge.net>\n"
- "MIME-Version: 1.0\n"
- "Content-Type: text/plain; charset=UTF-8\n"
- "Content-Transfer-Encoding: 8bit\n"
--"X-Generator: KBabel 0.9.5\n"
--#: alpha-opc.c:335
-+#: alpha-opc.c:155
- msgid "branch operand unaligned"
- msgstr "operand cabang tidak rata"
--#: alpha-opc.c:358 alpha-opc.c:380
-+#: alpha-opc.c:171 alpha-opc.c:187
- msgid "jump hint unaligned"
- msgstr "petunjuk lompat tidak rata"
--#: arc-dis.c:52
-+#: arc-dis.c:77
- msgid "Illegal limm reference in last instruction!\n"
- msgstr "referensi limm ilegal dalam instruksi terakhir!\n"
--#: arm-dis.c:502
-+#: arc-opc.c:386
-+msgid "unable to fit different valued constants into instruction"
-+msgstr "tidak dapat memasukan nilai konstanta berbeda kedalam instruksi"
-+
-+#: arc-opc.c:395
-+msgid "auxiliary register not allowed here"
-+msgstr "register tambahan tidak diperbolehkan disini"
-+
-+#: arc-opc.c:401 arc-opc.c:418
-+msgid "attempt to set readonly register"
-+msgstr "mencoba untuk menset register baca-saja"
-+
-+#: arc-opc.c:406 arc-opc.c:423
-+msgid "attempt to read writeonly register"
-+msgstr "mencoba untuk membaca register tulis-saja"
-+
-+#: arc-opc.c:428
-+#, c-format
-+msgid "invalid register number `%d'"
-+msgstr "nomor register tidak valid `%d'"
-+
-+#: arc-opc.c:594 arc-opc.c:645 arc-opc.c:673
-+msgid "too many long constants"
-+msgstr "terlalu banyak konstanta panjang"
-+
-+#: arc-opc.c:668
-+msgid "too many shimms in load"
-+msgstr "terlalu banyak shimm dalam load"
-+
-+#. Do we have a limm already?
-+#: arc-opc.c:781
-+msgid "impossible store"
-+msgstr "store tidak memungkinkan"
-+
-+#: arc-opc.c:814
-+msgid "st operand error"
-+msgstr "operand st error"
-+
-+#: arc-opc.c:818 arc-opc.c:860
-+msgid "address writeback not allowed"
-+msgstr "alamat writeback tidak diijinkan"
-+
-+#: arc-opc.c:822
-+msgid "store value must be zero"
-+msgstr "nilai simpan harus nol"
-+
-+#: arc-opc.c:847
-+msgid "invalid load/shimm insn"
-+msgstr "insn load/shimm tidak valid"
-+
-+#: arc-opc.c:856
-+msgid "ld operand error"
-+msgstr "operand ld error"
-+
-+#: arc-opc.c:943
-+msgid "jump flags, but no .f seen"
-+msgstr "tanda jump, tetapi tidak ada .f yang terlihat"
-+
-+#: arc-opc.c:946
-+msgid "jump flags, but no limm addr"
-+msgstr "tanda jump, tetapi tidak ada alamat limm"
-+
-+#: arc-opc.c:949
-+msgid "flag bits of jump address limm lost"
-+msgstr "tanda bit dari alamat jump limm hilang"
-+
-+#: arc-opc.c:952
-+msgid "attempt to set HR bits"
-+msgstr "mencoba menset bit HR"
-+
-+#: arc-opc.c:955
-+msgid "bad jump flags value"
-+msgstr "nilai tanda jump buruk"
-+
-+#: arc-opc.c:988
-+msgid "branch address not on 4 byte boundary"
-+msgstr "alamat cabang tidak dalam kelipatan 4 byte"
-+
-+#: arc-opc.c:1024
-+msgid "must specify .jd or no nullify suffix"
-+msgstr "harus menspesifikasikan .jd atau tidak ada akhiran nullify"
-+
-+#: arm-dis.c:1808
- msgid "<illegal precision>"
- msgstr "<presisi ilegal>"
--#: arm-dis.c:1012
-+#. XXX - should break 'option' at following delimiter.
-+#: arm-dis.c:3818
- #, c-format
- msgid "Unrecognised register name set: %s\n"
- msgstr "Set nama register tidak dikenal: %s\n"
--#: arm-dis.c:1019
-+#. XXX - should break 'option' at following delimiter.
-+#: arm-dis.c:3826
- #, c-format
- msgid "Unrecognised disassembler option: %s\n"
- msgstr "Option disasembler tidak dikenal: %s\n"
--#: arm-dis.c:1191
-+#: arm-dis.c:4238
-+#, c-format
- msgid ""
- "\n"
- "The following ARM specific disassembler options are supported for use with\n"
-@@ -50,297 +137,919 @@ msgstr ""
- "Option disablembler khusus ARM berikut ini didukung untuk digunakan dengan\n"
- "switch -M:\n"
--#: avr-dis.c:118 avr-dis.c:128
-+#: avr-dis.c:115 avr-dis.c:125
-+#, c-format
- msgid "undefined"
- msgstr "tidak didefinisikan"
--#: avr-dis.c:180
-+#: avr-dis.c:187
-+#, c-format
- msgid "Internal disassembler error"
- msgstr "Kesalahan disasembler internal"
--#: avr-dis.c:228
-+#: avr-dis.c:236
- #, c-format
- msgid "unknown constraint `%c'"
- msgstr "konstrain tidak dikenal `%c'"
--#: cgen-asm.c:346 fr30-ibld.c:195 m32r-ibld.c:195 openrisc-ibld.c:195 xstormy16-ibld.c:195
-+#: cgen-asm.c:336 fr30-ibld.c:200 frv-ibld.c:200 ip2k-ibld.c:200
-+#: iq2000-ibld.c:200 m32c-ibld.c:200 m32r-ibld.c:200 mep-ibld.c:200
-+#: mt-ibld.c:200 openrisc-ibld.c:200 xc16x-ibld.c:200 xstormy16-ibld.c:200
- #, c-format
- msgid "operand out of range (%ld not between %ld and %ld)"
- msgstr "operand keluar batas (%ld tidak antara %ld dan %ld)"
--#: cgen-asm.c:367
-+#: cgen-asm.c:358
- #, c-format
- msgid "operand out of range (%lu not between %lu and %lu)"
- msgstr "operand keluar batas (%lu tidak antara %lu dan %lu)"
--#: d30v-dis.c:312
-+#: d30v-dis.c:255
- #, c-format
- msgid "<unknown register %d>"
- msgstr "<register tidak dikenal %d>"
- #. Can't happen.
--#: dis-buf.c:57
-+#: dis-buf.c:59
- #, c-format
- msgid "Unknown error %d\n"
- msgstr "Kesalahan tidak dikenal %d\n"
--#: dis-buf.c:62
-+#: dis-buf.c:68
- #, c-format
--msgid "Address 0x%x is out of bounds.\n"
--msgstr "Alamat 0x%x di luar batas.\n"
-+msgid "Address 0x%s is out of bounds.\n"
-+msgstr "Alamat 0x%s di luar jangkauan.\n"
--#: fr30-asm.c:323 m32r-asm.c:325 openrisc-asm.c:244 xstormy16-asm.c:231
-+#: fr30-asm.c:93 m32c-asm.c:877 m32c-asm.c:884
-+msgid "Register number is not valid"
-+msgstr "Nomor register tidak valid"
-+
-+#: fr30-asm.c:95
-+msgid "Register must be between r0 and r7"
-+msgstr "Register harus berada diantara r0 dan r7"
-+
-+#: fr30-asm.c:97
-+msgid "Register must be between r8 and r15"
-+msgstr "Register harus berada diantara r8 dan r15"
-+
-+#: fr30-asm.c:116 m32c-asm.c:915
-+msgid "Register list is not valid"
-+msgstr "Daftar register tidak valid"
-+
-+#: fr30-asm.c:310 frv-asm.c:1263 ip2k-asm.c:511 iq2000-asm.c:459
-+#: m32c-asm.c:1589 m32r-asm.c:328 mep-asm.c:1001 mt-asm.c:595
-+#: openrisc-asm.c:241 xc16x-asm.c:376 xstormy16-asm.c:276
- #, c-format
- msgid "Unrecognized field %d while parsing.\n"
- msgstr "Field tidak dikenal %d saat parsing.\n"
--#: fr30-asm.c:373 m32r-asm.c:375 openrisc-asm.c:294 xstormy16-asm.c:281
-+#: fr30-asm.c:361 frv-asm.c:1314 ip2k-asm.c:562 iq2000-asm.c:510
-+#: m32c-asm.c:1640 m32r-asm.c:379 mep-asm.c:1052 mt-asm.c:646
-+#: openrisc-asm.c:292 xc16x-asm.c:427 xstormy16-asm.c:327
- msgid "missing mnemonic in syntax string"
- msgstr "mnemonik hilang dalam string sintaks"
- #. We couldn't parse it.
--#: fr30-asm.c:509 fr30-asm.c:513 fr30-asm.c:600 fr30-asm.c:702 m32r-asm.c:511 m32r-asm.c:515 m32r-asm.c:602 m32r-asm.c:704 openrisc-asm.c:430 openrisc-asm.c:434 openrisc-asm.c:521 openrisc-asm.c:623 xstormy16-asm.c:417 xstormy16-asm.c:421 xstormy16-asm.c:508 xstormy16-asm.c:610
-+#: fr30-asm.c:496 fr30-asm.c:500 fr30-asm.c:587 fr30-asm.c:688 frv-asm.c:1449
-+#: frv-asm.c:1453 frv-asm.c:1540 frv-asm.c:1641 ip2k-asm.c:697 ip2k-asm.c:701
-+#: ip2k-asm.c:788 ip2k-asm.c:889 iq2000-asm.c:645 iq2000-asm.c:649
-+#: iq2000-asm.c:736 iq2000-asm.c:837 m32c-asm.c:1775 m32c-asm.c:1779
-+#: m32c-asm.c:1866 m32c-asm.c:1967 m32r-asm.c:514 m32r-asm.c:518
-+#: m32r-asm.c:605 m32r-asm.c:706 mep-asm.c:1187 mep-asm.c:1191 mep-asm.c:1278
-+#: mep-asm.c:1379 mt-asm.c:781 mt-asm.c:785 mt-asm.c:872 mt-asm.c:973
-+#: openrisc-asm.c:427 openrisc-asm.c:431 openrisc-asm.c:518 openrisc-asm.c:619
-+#: xc16x-asm.c:562 xc16x-asm.c:566 xc16x-asm.c:653 xc16x-asm.c:754
-+#: xstormy16-asm.c:462 xstormy16-asm.c:466 xstormy16-asm.c:553
-+#: xstormy16-asm.c:654
- msgid "unrecognized instruction"
- msgstr "instruksti tidak dikenal"
--#: fr30-asm.c:556 m32r-asm.c:558 openrisc-asm.c:477 xstormy16-asm.c:464
-+#: fr30-asm.c:543 frv-asm.c:1496 ip2k-asm.c:744 iq2000-asm.c:692
-+#: m32c-asm.c:1822 m32r-asm.c:561 mep-asm.c:1234 mt-asm.c:828
-+#: openrisc-asm.c:474 xc16x-asm.c:609 xstormy16-asm.c:509
- #, c-format
- msgid "syntax error (expected char `%c', found `%c')"
- msgstr "kesalahan sintaks (diharapkan karakter `%c', ditemukan `%c')"
--#: fr30-asm.c:566 m32r-asm.c:568 openrisc-asm.c:487 xstormy16-asm.c:474
-+#: fr30-asm.c:553 frv-asm.c:1506 ip2k-asm.c:754 iq2000-asm.c:702
-+#: m32c-asm.c:1832 m32r-asm.c:571 mep-asm.c:1244 mt-asm.c:838
-+#: openrisc-asm.c:484 xc16x-asm.c:619 xstormy16-asm.c:519
- #, c-format
- msgid "syntax error (expected char `%c', found end of instruction)"
- msgstr "kesalahan sintaks (diharapkan karakter `%c', ditemukan akhir instruksi)"
--#: fr30-asm.c:594 m32r-asm.c:596 openrisc-asm.c:515 xstormy16-asm.c:502
-+#: fr30-asm.c:581 frv-asm.c:1534 ip2k-asm.c:782 iq2000-asm.c:730
-+#: m32c-asm.c:1860 m32r-asm.c:599 mep-asm.c:1272 mt-asm.c:866
-+#: openrisc-asm.c:512 xc16x-asm.c:647 xstormy16-asm.c:547
- msgid "junk at end of line"
- msgstr "sampah di akhir baris"
--#: fr30-asm.c:701 m32r-asm.c:703 openrisc-asm.c:622 xstormy16-asm.c:609
-+#: fr30-asm.c:687 frv-asm.c:1640 ip2k-asm.c:888 iq2000-asm.c:836
-+#: m32c-asm.c:1966 m32r-asm.c:705 mep-asm.c:1378 mt-asm.c:972
-+#: openrisc-asm.c:618 xc16x-asm.c:753 xstormy16-asm.c:653
- msgid "unrecognized form of instruction"
- msgstr "bentuk instruksi tidak dikenal"
--#: fr30-asm.c:713 m32r-asm.c:715 openrisc-asm.c:634 xstormy16-asm.c:621
-+#: fr30-asm.c:699 frv-asm.c:1652 ip2k-asm.c:900 iq2000-asm.c:848
-+#: m32c-asm.c:1978 m32r-asm.c:717 mep-asm.c:1390 mt-asm.c:984
-+#: openrisc-asm.c:630 xc16x-asm.c:765 xstormy16-asm.c:665
- #, c-format
- msgid "bad instruction `%.50s...'"
- msgstr "instruksi buruk `%.50s...'"
--#: fr30-asm.c:716 m32r-asm.c:718 openrisc-asm.c:637 xstormy16-asm.c:624
-+#: fr30-asm.c:702 frv-asm.c:1655 ip2k-asm.c:903 iq2000-asm.c:851
-+#: m32c-asm.c:1981 m32r-asm.c:720 mep-asm.c:1393 mt-asm.c:987
-+#: openrisc-asm.c:633 xc16x-asm.c:768 xstormy16-asm.c:668
- #, c-format
- msgid "bad instruction `%.50s'"
- msgstr "instruksi buruk `%.50s'"
- #. Default text to print if an instruction isn't recognized.
--#: fr30-dis.c:39 m32r-dis.c:39 mmix-dis.c:282 openrisc-dis.c:39 xstormy16-dis.c:39
-+#: fr30-dis.c:41 frv-dis.c:41 ip2k-dis.c:41 iq2000-dis.c:41 m32c-dis.c:41
-+#: m32r-dis.c:41 mep-dis.c:41 mmix-dis.c:278 mt-dis.c:41 openrisc-dis.c:41
-+#: xc16x-dis.c:41 xstormy16-dis.c:41
- msgid "*unknown*"
- msgstr "*tidak dikenal*"
--#: fr30-dis.c:318 m32r-dis.c:249 openrisc-dis.c:136 xstormy16-dis.c:169
-+#: fr30-dis.c:299 frv-dis.c:396 ip2k-dis.c:288 iq2000-dis.c:189 m32c-dis.c:891
-+#: m32r-dis.c:256 mep-dis.c:776 mt-dis.c:290 openrisc-dis.c:135
-+#: xc16x-dis.c:375 xstormy16-dis.c:168
- #, c-format
- msgid "Unrecognized field %d while printing insn.\n"
- msgstr "Field tidak dikenal %d saat mencetak insn.\n"
--#: fr30-ibld.c:166 m32r-ibld.c:166 openrisc-ibld.c:166 xstormy16-ibld.c:166
-+#: fr30-ibld.c:163 frv-ibld.c:163 ip2k-ibld.c:163 iq2000-ibld.c:163
-+#: m32c-ibld.c:163 m32r-ibld.c:163 mep-ibld.c:163 mt-ibld.c:163
-+#: openrisc-ibld.c:163 xc16x-ibld.c:163 xstormy16-ibld.c:163
- #, c-format
- msgid "operand out of range (%ld not between %ld and %lu)"
- msgstr "operand di luar batas (%ld tidak antara %ld dan %lu)"
--#: fr30-ibld.c:179 m32r-ibld.c:179 openrisc-ibld.c:179 xstormy16-ibld.c:179
-+#: fr30-ibld.c:184 frv-ibld.c:184 ip2k-ibld.c:184 iq2000-ibld.c:184
-+#: m32c-ibld.c:184 m32r-ibld.c:184 mep-ibld.c:184 mt-ibld.c:184
-+#: openrisc-ibld.c:184 xc16x-ibld.c:184 xstormy16-ibld.c:184
- #, c-format
--msgid "operand out of range (%lu not between 0 and %lu)"
--msgstr "operand di luar batas (%lu tidak antara 0 dan %lu)"
-+msgid "operand out of range (0x%lx not between 0 and 0x%lx)"
-+msgstr "operand di luar batas (0x%lx tidak antara 0 dan 0x%lx)"
--#: fr30-ibld.c:730 m32r-ibld.c:659 openrisc-ibld.c:633 xstormy16-ibld.c:678
-+#: fr30-ibld.c:726 frv-ibld.c:852 ip2k-ibld.c:603 iq2000-ibld.c:709
-+#: m32c-ibld.c:1727 m32r-ibld.c:661 mep-ibld.c:1024 mt-ibld.c:745
-+#: openrisc-ibld.c:629 xc16x-ibld.c:748 xstormy16-ibld.c:674
- #, c-format
- msgid "Unrecognized field %d while building insn.\n"
- msgstr "Field tidak dikenal %d saat membuild insn.\n"
--#: fr30-ibld.c:937 m32r-ibld.c:792 openrisc-ibld.c:735 xstormy16-ibld.c:826
-+#: fr30-ibld.c:931 frv-ibld.c:1169 ip2k-ibld.c:678 iq2000-ibld.c:884
-+#: m32c-ibld.c:2888 m32r-ibld.c:798 mep-ibld.c:1444 mt-ibld.c:965
-+#: openrisc-ibld.c:729 xc16x-ibld.c:968 xstormy16-ibld.c:820
- #, c-format
- msgid "Unrecognized field %d while decoding insn.\n"
- msgstr "Field tidak dikenal %d saat mendekode insn.\n"
--#: fr30-ibld.c:1086 m32r-ibld.c:902 openrisc-ibld.c:815 xstormy16-ibld.c:939
-+#: fr30-ibld.c:1077 frv-ibld.c:1447 ip2k-ibld.c:752 iq2000-ibld.c:1015
-+#: m32c-ibld.c:3505 m32r-ibld.c:911 mep-ibld.c:1737 mt-ibld.c:1165
-+#: openrisc-ibld.c:806 xc16x-ibld.c:1189 xstormy16-ibld.c:930
- #, c-format
- msgid "Unrecognized field %d while getting int operand.\n"
- msgstr "Field tidak dikenal %d saat memperoleh operand int.\n"
--#: fr30-ibld.c:1215 m32r-ibld.c:992 openrisc-ibld.c:875 xstormy16-ibld.c:1032
-+#: fr30-ibld.c:1205 frv-ibld.c:1707 ip2k-ibld.c:808 iq2000-ibld.c:1128
-+#: m32c-ibld.c:4104 m32r-ibld.c:1006 mep-ibld.c:2012 mt-ibld.c:1347
-+#: openrisc-ibld.c:865 xc16x-ibld.c:1392 xstormy16-ibld.c:1022
- #, c-format
- msgid "Unrecognized field %d while getting vma operand.\n"
- msgstr "Field tidak dikenal %d saat memperoleh operand vma.\n"
--#: fr30-ibld.c:1349 m32r-ibld.c:1090 openrisc-ibld.c:944 xstormy16-ibld.c:1134
-+#: fr30-ibld.c:1336 frv-ibld.c:1974 ip2k-ibld.c:867 iq2000-ibld.c:1248
-+#: m32c-ibld.c:4691 m32r-ibld.c:1107 mep-ibld.c:2271 mt-ibld.c:1536
-+#: openrisc-ibld.c:931 xc16x-ibld.c:1596 xstormy16-ibld.c:1121
- #, c-format
- msgid "Unrecognized field %d while setting int operand.\n"
- msgstr "Field tidak dikenal %d saat menset operand int.\n"
--#: fr30-ibld.c:1471 m32r-ibld.c:1176 openrisc-ibld.c:1001 xstormy16-ibld.c:1224
-+#: fr30-ibld.c:1457 frv-ibld.c:2231 ip2k-ibld.c:916 iq2000-ibld.c:1358
-+#: m32c-ibld.c:5268 m32r-ibld.c:1198 mep-ibld.c:2520 mt-ibld.c:1715
-+#: openrisc-ibld.c:987 xc16x-ibld.c:1790 xstormy16-ibld.c:1210
- #, c-format
- msgid "Unrecognized field %d while setting vma operand.\n"
- msgstr "Field tidak dikenal %d saat menset operand vma.\n"
--#: h8300-dis.c:384
-+#: frv-asm.c:608
-+msgid "missing `]'"
-+msgstr "hilang `]'"
-+
-+#: frv-asm.c:611 frv-asm.c:621
-+msgid "Special purpose register number is out of range"
-+msgstr "Nomor register tujuan spesial di luar batas"
-+
-+#: frv-asm.c:908
-+msgid "Value of A operand must be 0 or 1"
-+msgstr "Nilai dari operand A harus berupa 0 atau 1"
-+
-+#: frv-asm.c:944
-+msgid "register number must be even"
-+msgstr "nomor register harus genap"
-+
-+#. -- assembler routines inserted here.
-+#. -- asm.c
-+#: frv-asm.c:972 iq2000-asm.c:56 m32c-asm.c:141 m32c-asm.c:237 m32c-asm.c:279
-+#: m32c-asm.c:338 m32c-asm.c:360 m32r-asm.c:53 mep-asm.c:232 mep-asm.c:250
-+#: mep-asm.c:265 mep-asm.c:280 mep-asm.c:292 openrisc-asm.c:54
-+msgid "missing `)'"
-+msgstr "hilang `)'"
-+
-+#: h8300-dis.c:327
- #, c-format
--msgid "Hmmmm %x"
--msgstr "Hmmmm %x"
-+msgid "Hmmmm 0x%x"
-+msgstr "Hmmmm 0x%x"
--#: h8300-dis.c:395
-+#: h8300-dis.c:708
- #, c-format
--msgid "Don't understand %x \n"
--msgstr "Tidak mengerti %x \n"
-+msgid "Don't understand 0x%x \n"
-+msgstr "Tidak mengerti 0x%x \n"
--#: h8500-dis.c:143
-+#: h8500-dis.c:124
- #, c-format
- msgid "can't cope with insert %d\n"
- msgstr "tidak dapat menangani insert %d\n"
- #. Couldn't understand anything.
--#: h8500-dis.c:350
-+#: h8500-dis.c:324
- #, c-format
- msgid "%02x\t\t*unknown*"
- msgstr "%02x\t\t*tidak dikenal*"
--#: i386-dis.c:1649
-+#: i386-dis.c:9545
- msgid "<internal disassembler error>"
- msgstr "<kesalahan asembler internal>"
--#: m10200-dis.c:199
-+#: i386-dis.c:9776
-+#, c-format
-+msgid ""
-+"\n"
-+"The following i386/x86-64 specific disassembler options are supported for use\n"
-+"with the -M switch (multiple options should be separated by commas):\n"
-+msgstr ""
-+"\n"
-+"Option disablembler khusus i386/x86-64 berikut ini didukung untuk digunakan dengan\n"
-+"pilihan -M (pilihan double seharusnya dipisahkan dengan koma):\n"
-+
-+#: i386-dis.c:9780
-+#, c-format
-+msgid "  x86-64      Disassemble in 64bit mode\n"
-+msgstr "  x86-64      Disasemble dalam mode 64bit\n"
-+
-+#: i386-dis.c:9781
-+#, c-format
-+msgid "  i386        Disassemble in 32bit mode\n"
-+msgstr "  i386        Disassemble dalam mode 32bit\n"
-+
-+#: i386-dis.c:9782
-+#, c-format
-+msgid "  i8086       Disassemble in 16bit mode\n"
-+msgstr "  i8086       Disassemble dalam mode 16bit\n"
-+
-+#: i386-dis.c:9783
-+#, c-format
-+msgid "  att         Display instruction in AT&T syntax\n"
-+msgstr "  att         Tampilkan instruksi dalam sintaks AT&T\n"
-+
-+#: i386-dis.c:9784
-+#, c-format
-+msgid "  intel       Display instruction in Intel syntax\n"
-+msgstr "  intel       Tampilkan instruksi dalam sintaks Intel\n"
-+
-+#: i386-dis.c:9785
-+#, c-format
-+msgid ""
-+"  att-mnemonic\n"
-+"              Display instruction in AT&T mnemonic\n"
-+msgstr ""
-+"  att-mnemonic\n"
-+"              Tampilkan instruksi dalam mnemonic AT&T\n"
-+
-+#: i386-dis.c:9787
-+#, c-format
-+msgid ""
-+"  intel-mnemonic\n"
-+"              Display instruction in Intel mnemonic\n"
-+msgstr ""
-+"  intel-mnemonic\n"
-+"              Tampilkan instruksi dalam mnemonic Intel\n"
-+
-+#: i386-dis.c:9789
-+#, c-format
-+msgid "  addr64      Assume 64bit address size\n"
-+msgstr "  addr64      Asumsikan ukuran alamat 64bit\n"
-+
-+#: i386-dis.c:9790
-+#, c-format
-+msgid "  addr32      Assume 32bit address size\n"
-+msgstr "  addr32      Asumsikan ukuran alamat 32bit\n"
-+
-+#: i386-dis.c:9791
-+#, c-format
-+msgid "  addr16      Assume 16bit address size\n"
-+msgstr "  addr16      Asumsikan ukuran alamat 16bit\n"
-+
-+#: i386-dis.c:9792
- #, c-format
--msgid "unknown\t0x%02x"
--msgstr "tidak dikenal\t0x%02x"
-+msgid "  data32      Assume 32bit data size\n"
-+msgstr "  data32      Asumsikan ukuran data 32bit\n"
--#: m10200-dis.c:339
-+#: i386-dis.c:9793
-+#, c-format
-+msgid "  data16      Assume 16bit data size\n"
-+msgstr "  data16      Asumsikan ukuran data 16bit\n"
-+
-+#: i386-dis.c:9794
-+#, c-format
-+msgid "  suffix      Always display instruction suffix in AT&T syntax\n"
-+msgstr "  akhiran     Selalu tampilkan akhiran instruksi dalam sintaks AT&T\n"
-+
-+#: i386-gen.c:411 ia64-gen.c:307
-+#, c-format
-+msgid "%s: Error: "
-+msgstr "%s: Error: "
-+
-+#: i386-gen.c:510
-+#, c-format
-+msgid "%s: %d: Unknown bitfield: %s\n"
-+msgstr "%s: %d: bitfield tidak diketahui: %s\n"
-+
-+#: i386-gen.c:674
-+#, c-format
-+msgid "can't find i386-opc.tbl for reading, errno = %s\n"
-+msgstr "tidak dapat menemukan i386-opc.tbl untuk pembacaan, nomor error = %s\n"
-+
-+#: i386-gen.c:851
-+#, c-format
-+msgid "can't find i386-reg.tbl for reading, errno = %s\n"
-+msgstr "tidak dapat menemukan i386-reg.tbl untuk pembacaan, nomor error = %s\n"
-+
-+#: i386-gen.c:943
-+#, c-format
-+msgid "can't create i386-init.h, errno = %s\n"
-+msgstr "tidak dapat membuat i386-init.h, nomor error = %s\n"
-+
-+#: i386-gen.c:1032 ia64-gen.c:2850
-+#, c-format
-+msgid "unable to change directory to \"%s\", errno = %s\n"
-+msgstr "tidak dapat mengubah direktori ke \"%s\", nomor error = %s\n"
-+
-+#: i386-gen.c:1039
-+#, c-format
-+msgid "%d unused bits in i386_cpu_flags.\n"
-+msgstr "%d bit tidak digunakan dalam i386_cpu_flags.\n"
-+
-+#: i386-gen.c:1046
-+#, c-format
-+msgid "%d unused bits in i386_operand_type.\n"
-+msgstr "%d bit tidak digunakan dalam i386_operand_type.\n"
-+
-+#: i386-gen.c:1060
-+#, c-format
-+msgid "can't create i386-tbl.h, errno = %s\n"
-+msgstr "tidak dapat membuat i386-tbl.h, nomor error = %s\n"
-+
-+#: ia64-gen.c:320
-+#, c-format
-+msgid "%s: Warning: "
-+msgstr "%s: Peringatan: "
-+
-+#: ia64-gen.c:506 ia64-gen.c:740
-+#, c-format
-+msgid "multiple note %s not handled\n"
-+msgstr "catatan ganda %s tidak ditangani\n"
-+
-+#: ia64-gen.c:617
-+msgid "can't find ia64-ic.tbl for reading\n"
-+msgstr "tidak dapat menemukan ia64-ic.tbl untuk pembacaan\n"
-+
-+#: ia64-gen.c:822
-+#, c-format
-+msgid "can't find %s for reading\n"
-+msgstr "tidak dapat menemukan %s untuk pembacaan\n"
-+
-+#: ia64-gen.c:1046
-+#, c-format
-+msgid ""
-+"most recent format '%s'\n"
-+"appears more restrictive than '%s'\n"
-+msgstr ""
-+"format paling baru '%s'\n"
-+"tampak lebih terbatas dari '%s'\n"
-+
-+#: ia64-gen.c:1057
-+#, c-format
-+msgid "overlapping field %s->%s\n"
-+msgstr "daerah saling menimpa %s->%s\n"
-+
-+#: ia64-gen.c:1254
-+#, c-format
-+msgid "overwriting note %d with note %d (IC:%s)\n"
-+msgstr "catatan saling menulis %d dengan catatan %d (IC:%s)\n"
-+
-+#: ia64-gen.c:1459
-+#, c-format
-+msgid "don't know how to specify %% dependency %s\n"
-+msgstr "tidak tahu bagaimana menspesifikasikan %% ketergantungan %s\n"
-+
-+#: ia64-gen.c:1481
-+#, c-format
-+msgid "Don't know how to specify # dependency %s\n"
-+msgstr "Tidak tahu bagaimana menspesifikasikan # ketergantungan %s\n"
-+
-+#: ia64-gen.c:1520
-+#, c-format
-+msgid "IC:%s [%s] has no terminals or sub-classes\n"
-+msgstr "IC:%s [%s] tidak memiliki terminal atau sub-kelas\n"
-+
-+#: ia64-gen.c:1523
-+#, c-format
-+msgid "IC:%s has no terminals or sub-classes\n"
-+msgstr "IC:%s tidak memiliki terminal atau sub-kelas\n"
-+
-+#: ia64-gen.c:1532
-+#, c-format
-+msgid "no insns mapped directly to terminal IC %s [%s]"
-+msgstr "tidak ada insns terpetakan secara langsung ke terminal IC %s [%s]"
-+
-+#: ia64-gen.c:1535
-+#, c-format
-+msgid "no insns mapped directly to terminal IC %s\n"
-+msgstr "tidak ada insns terpetakan langsung ke terminal IC %s\n"
-+
-+#: ia64-gen.c:1546
-+#, c-format
-+msgid "class %s is defined but not used\n"
-+msgstr "kelas %s didefinisikan tetapi tidak digunakan\n"
-+
-+#: ia64-gen.c:1559
-+#, c-format
-+msgid "Warning: rsrc %s (%s) has no chks\n"
-+msgstr "Peringatan: rsrc %s (%s) tidak memiliki chks\n"
-+
-+#: ia64-gen.c:1562
-+#, c-format
-+msgid "Warning: rsrc %s (%s) has no chks or regs\n"
-+msgstr "Peringatan: rsrc %s (%s) tidak memiliki chks atau regs\n"
-+
-+#: ia64-gen.c:1566
-+#, c-format
-+msgid "rsrc %s (%s) has no regs\n"
-+msgstr "rsrc %s (%s) tidak memiliki regs\n"
-+
-+#: ia64-gen.c:2478
-+#, c-format
-+msgid "IC note %d in opcode %s (IC:%s) conflicts with resource %s note %d\n"
-+msgstr "IC catatan %d dalam opcode %s (IC:%s) konflik dengan sumber daya %s catatan %d\n"
-+
-+#: ia64-gen.c:2506
-+#, c-format
-+msgid "IC note %d for opcode %s (IC:%s) conflicts with resource %s note %d\n"
-+msgstr "IC catatan %d untuk opcode %s (IC:%s) konflik dengan sumber data %s catatan %d\n"
-+
-+#: ia64-gen.c:2520
-+#, c-format
-+msgid "opcode %s has no class (ops %d %d %d)\n"
-+msgstr "opcode %s tidak memiliki kelas (ops %d %d %d)\n"
-+
-+#. We've been passed a w.  Return with an error message so that
-+#. cgen will try the next parsing option.
-+#: ip2k-asm.c:81
-+msgid "W keyword invalid in FR operand slot."
-+msgstr "W kata kunci tidak valid dalam FR operand slot."
-+
-+#. Invalid offset present.
-+#: ip2k-asm.c:106
-+msgid "offset(IP) is not a valid form"
-+msgstr "offset(IP) bukan sebuah bentuk valid"
-+
-+#. Found something there in front of (DP) but it's out
-+#. of range.
-+#: ip2k-asm.c:154
-+msgid "(DP) offset out of range."
-+msgstr "(DP) ofset di luar batas."
-+
-+#. Found something there in front of (SP) but it's out
-+#. of range.
-+#: ip2k-asm.c:195
-+msgid "(SP) offset out of range."
-+msgstr "(SP) ofset di luar batas."
-+
-+#: ip2k-asm.c:211
-+msgid "illegal use of parentheses"
-+msgstr "penggunaan tidak legal dari tanda petik"
-+
-+#: ip2k-asm.c:218
-+msgid "operand out of range (not between 1 and 255)"
-+msgstr "operand di luar batas (tidak antara 1 dan 255)"
-+
-+#. Something is very wrong. opindex has to be one of the above.
-+#: ip2k-asm.c:242
-+msgid "parse_addr16: invalid opindex."
-+msgstr "parse_addr16: opindex tidak valid."
-+
-+#: ip2k-asm.c:296
-+msgid "Byte address required. - must be even."
-+msgstr "Alamat byte dibutuhkan. - harus genap."
-+
-+#: ip2k-asm.c:305
-+msgid "cgen_parse_address returned a symbol. Literal required."
-+msgstr "cgen_parse_address mengembalikan sebuah simbol. Literal dibutuhkan."
-+
-+#: ip2k-asm.c:360
-+msgid "percent-operator operand is not a symbol"
-+msgstr "percent-operator operand bukan sebuah simbol"
-+
-+#: ip2k-asm.c:413
-+msgid "Attempt to find bit index of 0"
-+msgstr "Mencoba untuk menemukan bit index dari 0"
-+
-+#: iq2000-asm.c:112 iq2000-asm.c:142
-+msgid "immediate value cannot be register"
-+msgstr "nilai langsung tidak dapat berupa register"
-+
-+#: iq2000-asm.c:123 iq2000-asm.c:153
-+msgid "immediate value out of range"
-+msgstr "nilai langsung di luar batas"
-+
-+#: iq2000-asm.c:182
-+msgid "21-bit offset out of range"
-+msgstr "21-bit ofset di luar batas"
-+
-+#: m10200-dis.c:158 m10300-dis.c:582
- #, c-format
- msgid "unknown\t0x%04lx"
- msgstr "tidak dikenal\t0x%04lx"
--#: m10300-dis.c:685
-+#: m10200-dis.c:328
- #, c-format
--msgid "unknown\t0x%04x"
--msgstr "tidak dikenal\t0x%04x"
-+msgid "unknown\t0x%02lx"
-+msgstr "tidak dikenal\t0x%02lx"
-+
-+#: m32c-asm.c:117
-+msgid "imm:6 immediate is out of range"
-+msgstr "imm:6 nilai langsung di luar batas"
--#: m68k-dis.c:429
-+#: m32c-asm.c:147
- #, c-format
--msgid "<internal error in opcode table: %s %s>\n"
--msgstr "<kesalahan internal dalam tabel opcode: %s %s>\n"
-+msgid "%dsp8() takes a symbolic address, not a number"
-+msgstr "%dsp8() mengambil sebuah alamat simbolik, bukan sebuah angka"
-+
-+#: m32c-asm.c:160 m32c-asm.c:164 m32c-asm.c:255
-+msgid "dsp:8 immediate is out of range"
-+msgstr "dsp:8 nilai langsung di luar batas"
-+
-+#: m32c-asm.c:185 m32c-asm.c:189
-+msgid "Immediate is out of range -8 to 7"
-+msgstr "nilai langsung di luar dari jangkauan -8 ke 7"
-+
-+#: m32c-asm.c:210 m32c-asm.c:214
-+msgid "Immediate is out of range -7 to 8"
-+msgstr "nilai langsung di luar dari jangkauan -7 ke 8"
-+
-+#: m32c-asm.c:285
-+#, c-format
-+msgid "%dsp16() takes a symbolic address, not a number"
-+msgstr "%dsp16() mengambil sebuah alamat simbolik, tetapi bukan sebuah angka"
-+
-+#: m32c-asm.c:308 m32c-asm.c:315 m32c-asm.c:378
-+msgid "dsp:16 immediate is out of range"
-+msgstr "dsp:16 nilai langsung di luar batas"
-+
-+#: m32c-asm.c:404
-+msgid "dsp:20 immediate is out of range"
-+msgstr "dsp:20 nilai langsung di luar batas"
-+
-+#: m32c-asm.c:430 m32c-asm.c:450
-+msgid "dsp:24 immediate is out of range"
-+msgstr "dsp:24 nilai langsung di luar batas"
-+
-+#: m32c-asm.c:483
-+msgid "immediate is out of range 1-2"
-+msgstr "nilai langsung di luar dari jangkauan 1-2"
-+
-+#: m32c-asm.c:501
-+msgid "immediate is out of range 1-8"
-+msgstr "nilai langsung di luar dari jangkauan 1-8"
-+
-+#: m32c-asm.c:519
-+msgid "immediate is out of range 0-7"
-+msgstr "nilai langsung di luar dari jangkauan 0-7"
-+
-+#: m32c-asm.c:555
-+msgid "immediate is out of range 2-9"
-+msgstr "nilai langsung di luar dari jangkauan 2-9"
--#: m68k-dis.c:1007
-+#: m32c-asm.c:573
-+msgid "Bit number for indexing general register is out of range 0-15"
-+msgstr "Nomor bit untuk register umum pengindeksan diluar dari jangkauan 0-15"
-+
-+#: m32c-asm.c:611 m32c-asm.c:667
-+msgid "bit,base is out of range"
-+msgstr "bit,bas di luar batas"
-+
-+#: m32c-asm.c:618 m32c-asm.c:623 m32c-asm.c:671
-+msgid "bit,base out of range for symbol"
-+msgstr "bit,base di luar dari jangkauan untuk simbol"
-+
-+#: m32c-asm.c:807
-+msgid "not a valid r0l/r0h pair"
-+msgstr "bukan sebuah valid pasangan r0l/r0h"
-+
-+#: m32c-asm.c:837
-+msgid "Invalid size specifier"
-+msgstr "Ukuran penspesifikasi tidak valid"
-+
-+#: m68k-dis.c:1163
- #, c-format
- msgid "<function code %d>"
- msgstr "<kode fungsi %d>"
--#: m88k-dis.c:255
-+#: m68k-dis.c:1320
-+#, c-format
-+msgid "<internal error in opcode table: %s %s>\n"
-+msgstr "<kesalahan internal dalam tabel opcode: %s %s>\n"
-+
-+#: m88k-dis.c:679
-+#, c-format
-+msgid "# <dis error: %08lx>"
-+msgstr "# <kesalahan dis: %08lx>"
-+
-+#: mep-asm.c:114
-+msgid "Only $tp or $13 allowed for this opcode"
-+msgstr "Hanya $tp atau $13 diperbolehkan untuk opcode ini"
-+
-+#: mep-asm.c:128
-+msgid "Only $sp or $15 allowed for this opcode"
-+msgstr "Hanya $sp atau $15 diperbolehkan untuk opcode ini"
-+
-+#: mep-asm.c:299 mep-asm.c:455
-+#, c-format
-+msgid "invalid %function() here"
-+msgstr "%function disini tidak valid"
-+
-+#: mips-dis.c:781
-+msgid "# internal error, incomplete extension sequence (+)"
-+msgstr "# internal error, urutan ekstensi (+) tidak lengkap"
-+
-+#: mips-dis.c:915
- #, c-format
--msgid "# <dis error: %08x>"
--msgstr "# <kesalahan dis: %08x>"
-+msgid "# internal error, undefined extension sequence (+%c)"
-+msgstr "# kesalahan internal, tidak terdefinisi urutan ekstensi(+%c)"
--#: mips-dis.c:290
-+#: mips-dis.c:1274
- #, c-format
--msgid "# internal error, undefined modifier(%c)"
--msgstr "# kesalahan internal, modifier tidak didefinisikan(%c)"
-+msgid "# internal error, undefined modifier (%c)"
-+msgstr "# kesalahan internal, tidak terdefinisi pemodifikasi(%c)"
--#: mips-dis.c:1154
-+#: mips-dis.c:1881
- #, c-format
- msgid "# internal disassembler error, unrecognised modifier (%c)"
- msgstr "# kesalahan internal disasembler, modifier tidak dikenal (%c)"
--#: mmix-dis.c:34
-+#: mips-dis.c:2112
-+#, c-format
-+msgid ""
-+"\n"
-+"The following MIPS specific disassembler options are supported for use\n"
-+"with the -M switch (multiple options should be separated by commas):\n"
-+msgstr ""
-+"\n"
-+"Pilihan disablembler khusus MIPS berikut ini didukung untuk digunakan dengan\n"
-+"pilihan -M (pilihan ganda seharusnya dipisahkan dengan koma):\n"
-+
-+#: mips-dis.c:2116
-+#, c-format
-+msgid ""
-+"\n"
-+"  gpr-names=ABI            Print GPR names according to  specified ABI.\n"
-+"                           Default: based on binary being disassembled.\n"
-+msgstr ""
-+"\n"
-+"  gpr-names=ABI            Tampilkan nama GPR menurut ABI yang dispesifikasikan.\n"
-+"                           Baku: berdasar dari binari yang sedang diassembled.\n"
-+
-+#: mips-dis.c:2120
-+#, c-format
-+msgid ""
-+"\n"
-+"  fpr-names=ABI            Print FPR names according to specified ABI.\n"
-+"                           Default: numeric.\n"
-+msgstr ""
-+"\n"
-+"  fpr-names=ABI            Tampilkan nama FPR menurut ABI yang dispesifikasikan.\n"
-+"                           Baku: numerik.\n"
-+
-+#: mips-dis.c:2124
-+#, c-format
-+msgid ""
-+"\n"
-+"  cp0-names=ARCH           Print CP0 register names according to\n"
-+"                           specified architecture.\n"
-+"                           Default: based on binary being disassembled.\n"
-+msgstr ""
-+"\n"
-+"  cp0-names=ARCH           Tampilkan nama register CP0 menurut arsitektur\n"
-+"                           yang dispesifikasikan.\n"
-+"                           Baku: berdasar dari binari yang sedang diassembled.\n"
-+
-+#: mips-dis.c:2129
-+#, c-format
-+msgid ""
-+"\n"
-+"  hwr-names=ARCH           Print HWR names according to specified \n"
-+"\t\t\t   architecture.\n"
-+"                           Default: based on binary being disassembled.\n"
-+msgstr ""
-+"\n"
-+"  hwr-names=ARCH           Tampilkan nama HWR menurut arsitektur\n"
-+"\t\t\t  yang dispesifikasikan.\n"
-+"                           Baku: berdasar dari binari yang sedang diassembled.\n"
-+
-+#: mips-dis.c:2134
-+#, c-format
-+msgid ""
-+"\n"
-+"  reg-names=ABI            Print GPR and FPR names according to\n"
-+"                           specified ABI.\n"
-+msgstr ""
-+"\n"
-+"  reg-names=ABI            Tampilkan nama GPR dan FPR menurut ABI yang\n"
-+"                           dispesifikasikan.\n"
-+
-+#: mips-dis.c:2138
-+#, c-format
-+msgid ""
-+"\n"
-+"  reg-names=ARCH           Print CP0 register and HWR names according to\n"
-+"                           specified architecture.\n"
-+msgstr ""
-+"\n"
-+"  reg-names=ARCH           Tampilkan nama register CP0 dan HWR menurut\n"
-+"                           arsitektur yang dispesifikasikan.\n"
-+
-+#: mips-dis.c:2142
-+#, c-format
-+msgid ""
-+"\n"
-+"  For the options above, the following values are supported for \"ABI\":\n"
-+"   "
-+msgstr ""
-+"\n"
-+"  Untuk pilihan diatas, nilai berikut didukung untuk \"ABI\":\n"
-+"   "
-+
-+#: mips-dis.c:2147 mips-dis.c:2155 mips-dis.c:2157
-+#, c-format
-+msgid "\n"
-+msgstr "\n"
-+
-+#: mips-dis.c:2149
-+#, c-format
-+msgid ""
-+"\n"
-+"  For the options above, The following values are supported for \"ARCH\":\n"
-+"   "
-+msgstr ""
-+"\n"
-+"  Untuk pilihan diatas, nilai berikut didukung untuk \"ARCH\":\n"
-+"   "
-+
-+#: mmix-dis.c:35
- #, c-format
- msgid "Bad case %d (%s) in %s:%d\n"
- msgstr "Case buruk %d (%s) dalam %s:%d\n"
--#: mmix-dis.c:44
-+#: mmix-dis.c:45
- #, c-format
- msgid "Internal: Non-debugged code (test-case missing): %s:%d"
- msgstr "Internal: Kode belum didebug (tidak ada test-case): %s:%d"
--#: mmix-dis.c:53
-+#: mmix-dis.c:54
- msgid "(unknown)"
- msgstr "(tidak dikenal)"
--#: mmix-dis.c:517
-+#: mmix-dis.c:513
- #, c-format
- msgid "*unknown operands type: %d*"
- msgstr "*tipe operand tidak dikenal: %d*"
-+#: mt-asm.c:110 mt-asm.c:190
-+msgid "Operand out of range. Must be between -32768 and 32767."
-+msgstr "Operand di luar batas. Harus berada diantara -32768 dan 32767."
-+
-+#: mt-asm.c:149
-+msgid "Biiiig Trouble in parse_imm16!"
-+msgstr "Masalah BESAR dalam parse_imm16!"
-+
-+#: mt-asm.c:157
-+msgid "The percent-operator's operand is not a symbol"
-+msgstr "Operand percent-operator bukan sebuah simbol"
-+
-+#: mt-asm.c:395
-+msgid "invalid operand.  type may have values 0,1,2 only."
-+msgstr "operand tidak valid. tipe mungkin hanya memiliki nilai 0,1,2."
-+
- #. I and Z are output operands and can`t be immediate
--#. * A is an address and we can`t have the address of
--#. * an immediate either. We don't know how much to increase
--#. * aoffsetp by since whatever generated this is broken
--#. * anyway!
--#.
--#: ns32k-dis.c:628
-+#. A is an address and we can`t have the address of
-+#. an immediate either. We don't know how much to increase
-+#. aoffsetp by since whatever generated this is broken
-+#. anyway!
-+#: ns32k-dis.c:534
-+#, c-format
- msgid "$<undefined>"
- msgstr "$<tidak didefinisikan>"
--#: ppc-opc.c:765 ppc-opc.c:798
-+#: ppc-opc.c:862 ppc-opc.c:890
- msgid "invalid conditional option"
- msgstr "option kondisional tidak valid"
--#: ppc-opc.c:800
-+#: ppc-opc.c:892
- msgid "attempt to set y bit when using + or - modifier"
- msgstr "berusaha menset bit y saat menggunakan modifier + atau -"
--#: ppc-opc.c:832 ppc-opc.c:884
--msgid "offset not a multiple of 4"
--msgstr "offset bukan kelipatan 4"
--
--#: ppc-opc.c:857
--msgid "offset not between -2048 and 2047"
--msgstr "offset tidak berada antara -2048 dan 2047"
--
--#: ppc-opc.c:882
--msgid "offset not between -8192 and 8191"
--msgstr "offset tidak berada antara -8192 dan 8191"
-+#: ppc-opc.c:924
-+msgid "invalid mask field"
-+msgstr "topeng daerah tidak valid"
--#: ppc-opc.c:910
--msgid "ignoring least significant bits in branch offset"
--msgstr "mengabaikan least significant bit dalam offset cabang"
-+#: ppc-opc.c:950
-+msgid "ignoring invalid mfcr mask"
-+msgstr "mengabaikan topeng mfcr tidak valid"
--#: ppc-opc.c:944 ppc-opc.c:981
-+#: ppc-opc.c:1000 ppc-opc.c:1035
- msgid "illegal bitmask"
- msgstr "bitmask ilegal"
--#: ppc-opc.c:1054
--msgid "value out of range"
--msgstr "nilai di luar batas"
--
--#: ppc-opc.c:1130
-+#: ppc-opc.c:1155
- msgid "index register in load range"
- msgstr "register indeks dalam daerah pemuatan"
--#: ppc-opc.c:1146
-+#: ppc-opc.c:1171
-+msgid "source and target register operands must be different"
-+msgstr "sumber dan target operand register harus berbeda"
-+
-+#: ppc-opc.c:1186
- msgid "invalid register operand when updating"
- msgstr "operand register tidak valid saat mengupdate"
--#. Mark as non-valid instruction
--#: sparc-dis.c:750
--msgid "unknown"
--msgstr "tidak dikenal"
-+#: ppc-opc.c:1265
-+msgid "invalid sprg number"
-+msgstr "nomor sprg tidak valid"
-+
-+#: s390-dis.c:276
-+#, c-format
-+msgid ""
-+"\n"
-+"The following S/390 specific disassembler options are supported for use\n"
-+"with the -M switch (multiple options should be separated by commas):\n"
-+msgstr ""
-+"\n"
-+"Pilihan disablembler khusus S/390 berikut ini didukung untuk digunakan dengan\n"
-+"pilihan -M (pilihan ganda seharusnya dipisahkan dengan koma):\n"
-+
-+#: s390-dis.c:280
-+#, c-format
-+msgid "  esa         Disassemble in ESA architecture mode\n"
-+msgstr "  esa         Disassemble dalam mode arsitektur ESA\n"
--#: sparc-dis.c:825
-+#: s390-dis.c:281
-+#, c-format
-+msgid "  zarch       Disassemble in z/Architecture mode\n"
-+msgstr "  zarch       Disassemble dalam mode z/Architecture\n"
-+
-+#: score-dis.c:220 score-dis.c:383
-+msgid "<illegal instruction>"
-+msgstr "<instruksi tidak legal>"
-+
-+#: sparc-dis.c:282
- #, c-format
- msgid "Internal error:  bad sparc-opcode.h: \"%s\", %#.8lx, %#.8lx\n"
- msgstr "Kesalahan internal:  sparc-opcode.h buruk: \"%s\", %#.8lx, %#.8lx\n"
--#: sparc-dis.c:836
-+#: sparc-dis.c:293
- #, c-format
- msgid "Internal error: bad sparc-opcode.h: \"%s\", %#.8lx, %#.8lx\n"
- msgstr "Kesalahan internal: sparc-opcode.h buruk: \"%s\", %#.8lx, %#.8lx\n"
--#: sparc-dis.c:885
-+#: sparc-dis.c:343
- #, c-format
- msgid "Internal error: bad sparc-opcode.h: \"%s\" == \"%s\"\n"
- msgstr "Kesalahan internal: sparc-opcode.h buruk: \"%s\" == \"%s\"\n"
--#: v850-dis.c:224
-+#. Mark as non-valid instruction.
-+#: sparc-dis.c:1013
-+msgid "unknown"
-+msgstr "tidak dikenal"
-+
-+#: v850-dis.c:239
- #, c-format
- msgid "unknown operand shift: %x\n"
- msgstr "shift operand tidak dikenal: %x\n"
--#: v850-dis.c:236
-+#: v850-dis.c:253
- #, c-format
- msgid "unknown pop reg: %d\n"
- msgstr "reg pop tidak dikenal: %d\n"
-@@ -350,74 +1059,122 @@ msgstr "reg pop tidak dikenal: %d\n"
- #. v850_insert_operand() in gas/config/tc-v850.c.  Error messages
- #. containing the string 'out of range' will be ignored unless a
- #. specific command line option is given to GAS.
--#: v850-opc.c:68
-+#: v850-opc.c:48
- msgid "displacement value is not in range and is not aligned"
- msgstr "nilai displacement tidak dalam jangkauan dan tidak rata"
--#: v850-opc.c:69
-+#: v850-opc.c:49
- msgid "displacement value is out of range"
- msgstr "nilai displacement di luar batas"
--#: v850-opc.c:70
-+#: v850-opc.c:50
- msgid "displacement value is not aligned"
- msgstr "nilai displacement tidak rata"
--#: v850-opc.c:72
-+#: v850-opc.c:52
- msgid "immediate value is out of range"
- msgstr "nilai langsung di luar batas"
--#: v850-opc.c:83
-+#: v850-opc.c:60
- msgid "branch value not in range and to odd offset"
- msgstr "nilai cabang tidak dalam jangkauan"
--#: v850-opc.c:85 v850-opc.c:117
-+#: v850-opc.c:62 v850-opc.c:89
- msgid "branch value out of range"
- msgstr "nilai cabang di luar jangkauan"
--#: v850-opc.c:88 v850-opc.c:120
-+#: v850-opc.c:65 v850-opc.c:92
- msgid "branch to odd offset"
- msgstr "cabang offset ganjil"
--#: v850-opc.c:115
-+#: v850-opc.c:87
- msgid "branch value not in range and to an odd offset"
- msgstr "nilai cabang di luar jangkauan dan offset ganjil"
--#: v850-opc.c:346
-+#: v850-opc.c:279
- msgid "invalid register for stack adjustment"
- msgstr "register tidak valid untuk penyesuaian stack"
--#: v850-opc.c:370
-+#: v850-opc.c:299
- msgid "immediate value not in range and not even"
- msgstr "nilai langsung tidak dalam jangkauan dan tidak genap"
--#: v850-opc.c:375
-+#: v850-opc.c:304
- msgid "immediate value must be even"
- msgstr "nilai langsung harus genap"
--#: xstormy16-asm.c:74
-+#: xc16x-asm.c:66
-+msgid "Missing '#' prefix"
-+msgstr "Hilang awalan '#'"
-+
-+#: xc16x-asm.c:82
-+msgid "Missing '.' prefix"
-+msgstr "Hilang awalan '.'"
-+
-+#: xc16x-asm.c:98
-+msgid "Missing 'pof:' prefix"
-+msgstr "Hilang awalan 'pof:'"
-+
-+#: xc16x-asm.c:114
-+msgid "Missing 'pag:' prefix"
-+msgstr "Hilang awalan 'pag:'"
-+
-+#: xc16x-asm.c:130
-+msgid "Missing 'sof:' prefix"
-+msgstr "Hilang awalan 'sof:'"
-+
-+#: xc16x-asm.c:146
-+msgid "Missing 'seg:' prefix"
-+msgstr "Hilanga awalan 'seg:'"
-+
-+#: xstormy16-asm.c:71
- msgid "Bad register in preincrement"
- msgstr "register buruk dalam preinkremen"
--#: xstormy16-asm.c:79
-+#: xstormy16-asm.c:76
- msgid "Bad register in postincrement"
- msgstr "Register buruk dalam pascainkremen"
--#: xstormy16-asm.c:81
-+#: xstormy16-asm.c:78
- msgid "Bad register name"
- msgstr "Nama register buruk"
--#: xstormy16-asm.c:85
-+#: xstormy16-asm.c:82
- msgid "Label conflicts with register name"
- msgstr "Label konflik dengan nama register"
--#: xstormy16-asm.c:89
-+#: xstormy16-asm.c:86
- msgid "Label conflicts with `Rx'"
- msgstr "Label konflik dengan `Rx'"
--#: xstormy16-asm.c:91
-+#: xstormy16-asm.c:88
- msgid "Bad immediate expression"
- msgstr "Ekspresi langsung yang buruk"
--#: xstormy16-asm.c:120
-+#: xstormy16-asm.c:109
-+msgid "No relocation for small immediate"
-+msgstr "Tidak ada relokasi untuk immediate kecil"
++struct value *
++value_from_ulongest (struct type *type, ULONGEST num)
++{
++  struct value *val = allocate_value (type);
 +
-+#: xstormy16-asm.c:119
- msgid "Small operand was not an immediate number"
- msgstr "Operand kecil bukan sebuah angka immediate"
++  pack_unsigned_long (value_contents_raw (val), type, num);
 +
-+#: xstormy16-asm.c:157
-+msgid "Operand is not a symbol"
-+msgstr "Operand bukan sebuah simbol"
++  return val;
++}
 +
-+#: xstormy16-asm.c:165
-+msgid "Syntax error: No trailing ')'"
-+msgstr "Sintaks error: Tidak ada akhiran ')'"
 +
-+#~ msgid "unknown\t0x%04x"
-+#~ msgstr "tidak dikenal\t0x%04x"
+ /* Create a value representing a pointer of type TYPE to the address
+    ADDR.  */
+ struct value *
+@@ -2348,4 +2484,8 @@ VARIABLE is already initialized."));
+   add_prefix_cmd ("function", no_class, function_command, _("\
+ Placeholder command for showing help on convenience functions."),
+                 &functionlist, "function ", 0, &cmdlist);
 +
-+#~ msgid "offset not between -2048 and 2047"
-+#~ msgstr "offset tidak berada antara -2048 dan 2047"
++  make_final_cleanup (value_history_cleanup, NULL);
 +
-+#~ msgid "offset not between -8192 and 8191"
-+#~ msgstr "offset tidak berada antara -8192 dan 8191"
++  observer_attach_mark_used (value_types_mark_used);
+ }
+diff --git a/gdb/value.h b/gdb/value.h
+index 51e6960..48b30e4 100644
+--- a/gdb/value.h
++++ b/gdb/value.h
+@@ -342,11 +342,16 @@ extern LONGEST unpack_field_as_long (struct type *type,
+ extern void pack_long (gdb_byte *buf, struct type *type, LONGEST num);
+ extern struct value *value_from_longest (struct type *type, LONGEST num);
++extern struct value *value_from_ulongest (struct type *type, ULONGEST num);
+ extern struct value *value_from_pointer (struct type *type, CORE_ADDR addr);
+ extern struct value *value_from_double (struct type *type, DOUBLEST num);
+ extern struct value *value_from_decfloat (struct type *type,
+                                         const gdb_byte *decbytes);
++extern const char *object_address_data_not_valid (struct type *type);
++extern int object_address_get_data (struct type *type,
++                                  CORE_ADDR *address_return);
 +
-+#~ msgid "ignoring least significant bits in branch offset"
-+#~ msgstr "mengabaikan least significant bit dalam offset cabang"
-diff --git a/opcodes/ppc-opc.c b/opcodes/ppc-opc.c
-index c872db5..5e70395 100644
---- a/opcodes/ppc-opc.c
-+++ b/opcodes/ppc-opc.c
-@@ -4560,8 +4560,8 @@ const struct powerpc_opcode powerpc_opcodes[] = {
+ extern struct value *value_at (struct type *type, CORE_ADDR addr);
+ extern struct value *value_at_lazy (struct type *type, CORE_ADDR addr);
+@@ -436,6 +441,7 @@ extern struct value *value_struct_elt (struct value **argp,
+ extern struct value *value_aggregate_elt (struct type *curtype,
+                                         char *name,
++                                        struct type *expect_type,
+                                         int want_address,
+                                         enum noside noside);
  
- {"lhbrx",     X(31,790),      X_MASK,      COM,       PPCNONE,        {RT, RA0, RB}},
+@@ -681,7 +687,7 @@ extern struct value *value_allocate_space_in_inferior (int);
+ extern struct value *value_of_local (const char *name, int complain);
  
--{"lfqx",      X(31,791),      X_MASK,      POWER2,    PPCNONE,        {FRT, RA, RB}},
- {"lfdpx",     X(31,791),      X_MASK,      POWER6,    POWER7,         {FRT, RA, RB}},
-+{"lfqx",      X(31,791),      X_MASK,      POWER2,    PPCNONE,        {FRT, RA, RB}},
+ extern struct value *value_subscripted_rvalue (struct value *array,
+-                                             LONGEST index, int lowerbound);
++                                             CORE_ADDR offset);
  
- {"sraw",      XRC(31,792,0),  X_MASK,      PPCCOM,    PPCNONE,        {RA, RS, RB}},
- {"sra",               XRC(31,792,0),  X_MASK,      PWRCOM,    PPCNONE,        {RA, RS, RB}},
-@@ -4638,8 +4638,8 @@ const struct powerpc_opcode powerpc_opcodes[] = {
+ /* User function handler.  */
  
- {"sthbrx",    X(31,918),      X_MASK,      COM,       PPCNONE,        {RS, RA0, RB}},
+diff --git a/gdb/varobj.c b/gdb/varobj.c
+index 8f22156..8fe72ca 100644
+--- a/gdb/varobj.c
++++ b/gdb/varobj.c
+@@ -26,6 +26,8 @@
+ #include "gdbcmd.h"
+ #include "block.h"
+ #include "valprint.h"
++#include "objfiles.h"
++#include "parser-defs.h"
  
--{"stfqx",     X(31,919),      X_MASK,      POWER2,    PPCNONE,        {FRS, RA, RB}},
- {"stfdpx",    X(31,919),      X_MASK,      POWER6,    PPCNONE,        {FRS, RA, RB}},
-+{"stfqx",     X(31,919),      X_MASK,      POWER2,    PPCNONE,        {FRS, RA, RB}},
+ #include "gdb_assert.h"
+ #include "gdb_string.h"
+@@ -253,6 +255,8 @@ static void free_variable (struct varobj *var);
  
- {"sraq",      XRC(31,920,0),  X_MASK,      M601,      PPCNONE,        {RA, RS, RB}},
- {"sraq.",     XRC(31,920,1),  X_MASK,      M601,      PPCNONE,        {RA, RS, RB}},
-@@ -4801,12 +4801,12 @@ const struct powerpc_opcode powerpc_opcodes[] = {
+ static struct cleanup *make_cleanup_free_variable (struct varobj *var);
  
- {"psq_l",     OP(56),         OP_MASK,     PPCPS,     PPCNONE,        {FRT,PSD,RA,PSW,PSQ}},
++static struct cleanup *make_cleanup_uninstall_variable (struct varobj *var);
++
+ static struct type *get_type (struct varobj *var);
  
-+{"lfdp",      OP(57),         OP_MASK,     POWER6,    POWER7,         {FRT, D, RA0}},
+ static struct type *get_value_type (struct varobj *var);
+@@ -480,6 +484,8 @@ is_root_p (struct varobj *var)
+ struct cleanup *
+ varobj_ensure_python_env (struct varobj *var)
+ {
++  gdb_assert (var->root->is_valid);
 +
- {"lfqu",      OP(57),         OP_MASK,     POWER2,    PPCNONE,        {FRT, D, RA0}},
+   return ensure_python_env (var->root->exp->gdbarch,
+                           var->root->exp->language_defn);
+ }
+@@ -651,6 +657,7 @@ varobj_create (char *objname,
+         do_cleanups (old_chain);
+         return NULL;
+       }
++      make_cleanup_uninstall_variable (var);
+     }
  
- {"psq_lu",    OP(57),         OP_MASK,     PPCPS,     PPCNONE,        {FRT,PSD,RA,PSW,PSQ}},
+   discard_cleanups (old_chain);
+@@ -821,7 +828,12 @@ varobj_get_display_hint (struct varobj *var)
+   char *result = NULL;
  
--{"lfdp",      OP(57),         OP_MASK,     POWER6,    POWER7,         {FRT, D, RA0}},
--
- {"ld",                DSO(58,0),      DS_MASK,     PPC64,     PPCNONE,        {RT, DS, RA0}},
- {"ldu",               DSO(58,1),      DS_MASK,     PPC64,     PPCNONE,        {RT, DS, RAL}},
- {"lwa",               DSO(58,2),      DS_MASK,     PPC64,     PPCNONE,        {RT, DS, RA0}},
-@@ -4921,10 +4921,6 @@ const struct powerpc_opcode powerpc_opcodes[] = {
- {"fcfidus",   XRC(59,974,0),  XRA_MASK,    POWER7,    PPCNONE,        {FRT, FRB}},
- {"fcfidus.",  XRC(59,974,1),  XRA_MASK,    POWER7,    PPCNONE,        {FRT, FRB}},
--{"stfq",      OP(60),         OP_MASK,     POWER2,    PPCNONE,        {FRS, D, RA}},
--
--{"psq_st",    OP(60),         OP_MASK,     PPCPS,     PPCNONE,        {FRS,PSD,RA,PSW,PSQ}},
--
- {"xxsldwi",   XX3(60,2),      XX3SHW_MASK, PPCVSX,    PPCNONE,        {XT6, XA6, XB6, SHW}},
- {"xxsel",     XX4(60,3),      XX4_MASK,    PPCVSX,    PPCNONE,        {XT6, XA6, XB6, XC6}},
- {"xxspltd",   XX3(60,10),     XX3DM_MASK,  PPCVSX,    PPCNONE,        {XT6, XA6, XB6S, DMEX}},
-@@ -5067,12 +5063,16 @@ const struct powerpc_opcode powerpc_opcodes[] = {
- {"xvcvsxddp", XX2(60,504),    XX2_MASK,    PPCVSX,    PPCNONE,        {XT6, XB6}},
- {"xvnegdp",   XX2(60,505),    XX2_MASK,    PPCVSX,    PPCNONE,        {XT6, XB6}},
+ #if HAVE_PYTHON
+-  struct cleanup *back_to = varobj_ensure_python_env (var);
++  struct cleanup *back_to;
++  
++  if (!var->root->is_valid)
++    return NULL;
++
++  back_to = varobj_ensure_python_env (var);
+   if (var->pretty_printer)
+     result = gdbpy_get_display_hint (var->pretty_printer);
+@@ -2186,6 +2198,18 @@ make_cleanup_free_variable (struct varobj *var)
+   return make_cleanup (do_free_variable_cleanup, var);
+ }
  
--{"psq_stu",   OP(61),         OP_MASK,     PPCPS,     PPCNONE,        {FRS,PSD,RA,PSW,PSQ}},
-+{"stfq",      OP(60),         OP_MASK,     POWER2,    PPCNONE,        {FRS, D, RA}},
++static void
++do_uninstall_variable_cleanup (void *var)
++{
++  uninstall_variable (var);
++}
++
++static struct cleanup *
++make_cleanup_uninstall_variable (struct varobj *var)
++{
++  return make_cleanup (do_uninstall_variable_cleanup, var);
++}
++
+ /* This returns the type of the variable. It also skips past typedefs
+    to return the real type of the variable.
  
--{"stfqu",     OP(61),         OP_MASK,     POWER2,    PPCNONE,        {FRS, D, RA}},
-+{"psq_st",    OP(60),         OP_MASK,     PPCPS,     PPCNONE,        {FRS,PSD,RA,PSW,PSQ}},
+@@ -3442,6 +3466,19 @@ java_value_of_variable (struct varobj *var, enum varobj_display_formats format)
+   return cplus_value_of_variable (var, format);
+ }
  
- {"stfdp",     OP(61),         OP_MASK,     POWER6,    PPCNONE,        {FRT, D, RA0}},
++/* Iterate all the existing VAROBJs and call the FUNC callback for them with an
++   arbitrary caller supplied DATA pointer.  */
++
++static void
++all_varobjs (void (*func) (struct varobj *var, void *data), void *data)
++{
++  struct vlist **vlp, *vl;
++
++  for (vlp = varobj_table; vlp < varobj_table + VAROBJ_TABLE_SIZE; vlp++)
++    for (vl = *vlp; vl != NULL; vl = vl->next)
++      (*func) (vl->var, data);
++}
++
+ /* Iterate all the existing _root_ VAROBJs and call the FUNC callback for them
+    with an arbitrary caller supplied DATA pointer.  */
  
-+{"stfqu",     OP(61),         OP_MASK,     POWER2,    PPCNONE,        {FRS, D, RA}},
+@@ -3459,6 +3496,43 @@ all_root_varobjs (void (*func) (struct varobj *var, void *data), void *data)
+       (*func) (var_root->rootvar, data);
+     }
+ }
++
++/* Helper for varobj_types_mark_used.  Call type_mark_used for any TYPEs
++   referenced from this VAR.  */
++
++static void
++varobj_types_mark_used_iter (struct varobj *var, void *unused)
++{
++  /* Even FLOATING or IS_INVALID VARs with non-NULL TYPE references will
++     free them in free_variable.  Still EXP may also reference TYPEs
++     but these belong to SYMBOLs which should be always associated with
++     an OBJFILE (and therefore not useful to be type_mark_used).  */
++
++  type_mark_used (var->type);
++  if (var->value)
++    type_mark_used (value_type (var->value));
++
++  /* Check VAROBJROOTs only once during the varobj_types_mark_used pass.  */
++
++  if (var->root->rootvar == var)
++    {
++      if (var->root->exp)
++      exp_types_mark_used (var->root->exp);
++    }
++}
 +
-+{"psq_stu",   OP(61),         OP_MASK,     PPCPS,     PPCNONE,        {FRS,PSD,RA,PSW,PSQ}},
++/* Call type_mark_used for any TYPEs referenced from this GDB source file.  */
 +
- {"std",               DSO(62,0),      DS_MASK,     PPC64,     PPCNONE,        {RS, DS, RA0}},
- {"stdu",      DSO(62,1),      DS_MASK,     PPC64,     PPCNONE,        {RS, DS, RAS}},
- {"stq",               DSO(62,2),      DS_MASK,     POWER4,    PPCNONE,        {RSQ, DS, RA0}},
++static void
++varobj_types_mark_used (void)
++{
++  /* Check all the VAROBJs, even non-root ones.  Child VAROBJs can reference
++     types from other OBJFILEs through TYPE_IS_OPAQUE resolutions by
++     check_typedef.  Such types references will not be interconnected into the
++     same TYPE_GROUP.  */
++
++  all_varobjs (varobj_types_mark_used_iter, NULL);
++}
\f
+ extern void _initialize_varobj (void);
+ void
+diff --git a/gdb/xcoffread.c b/gdb/xcoffread.c
+index c56ab86..dacf913 100644
+--- a/gdb/xcoffread.c
++++ b/gdb/xcoffread.c
+@@ -3038,6 +3038,7 @@ static struct sym_fns xcoff_sym_fns =
+   xcoff_new_init,             /* sym_new_init: init anything gbl to entire symtab */
+   xcoff_symfile_init,         /* sym_init: read initial info, setup for sym_read() */
+   xcoff_initial_scan,         /* sym_read: read a symbol file into symtab */
++  NULL,                               /* sym_read_psymbols */
+   xcoff_symfile_finish,               /* sym_finish: finished with file, cleanup */
+   xcoff_symfile_offsets,      /* sym_offsets: xlate offsets ext->int form */
+   default_symfile_segments,   /* sym_segments: Get segment information from
diff --git a/gdb-readline-6.0.patch b/gdb-readline-6.0.patch
new file mode 100644 (file)
index 0000000..2d0060b
--- /dev/null
@@ -0,0 +1,123 @@
+gdb/
+2009-07-31  Jan Kratochvil  <jan.kratochvil@redhat.com>
+
+       Fix compatibility of --with-system-readline and readline-6.0+.
+       * configure.ac <--with-system-readline> (for readline_echoing_p): New
+       test.
+       * config.in: Regenerate.
+       * configure: Regenerate.
+
+Index: gdb-6.8.50.20090909/gdb/configure.ac
+===================================================================
+--- gdb-6.8.50.20090909.orig/gdb/configure.ac  2009-09-09 20:11:04.000000000 +0200
++++ gdb-6.8.50.20090909/gdb/configure.ac       2009-09-09 20:11:54.000000000 +0200
+@@ -773,6 +773,21 @@ if test "$with_system_readline" = yes; t
+   READLINE=-lreadline
+   READLINE_DEPS=
+   READLINE_CFLAGS=
++
++  # readline-6.0 started to use the name `_rl_echoing_p'.
++  # `$(READLINE_DIR)/' of bundled readline would not resolve in configure.
++
++  AC_MSG_CHECKING([for readline_echoing_p])
++  save_LIBS=$LIBS
++  LIBS="$LIBS $READLINE"
++  AC_LINK_IFELSE(AC_LANG_PROGRAM(,[[extern int readline_echoing_p;
++                                  return readline_echoing_p;]]),
++               [READLINE_ECHOING_P=yes],
++               [READLINE_ECHOING_P=no
++                AC_DEFINE([readline_echoing_p], [_rl_echoing_p],
++                          [readline-6.0 started to use different name.])])
++  LIBS="$save_LIBS"
++  AC_MSG_RESULT([$READLINE_ECHOING_P])
+ else
+   READLINE='$(READLINE_DIR)/libreadline.a'
+   READLINE_DEPS='$(READLINE)'
+Index: gdb-6.8.50.20090909/gdb/config.in
+===================================================================
+--- gdb-6.8.50.20090909.orig/gdb/config.in     2009-09-09 20:11:33.000000000 +0200
++++ gdb-6.8.50.20090909/gdb/config.in  2009-09-09 20:12:00.000000000 +0200
+@@ -815,6 +815,9 @@
+ /* Define to `int' if <sys/types.h> does not define. */
+ #undef pid_t
++/* readline-6.0 started to use different name. */
++#undef readline_echoing_p
++
+ /* Define to the equivalent of the C99 'restrict' keyword, or to
+    nothing if this is not supported.  Do not define if restrict is
+    supported directly.  */
+Index: gdb-6.8.50.20090909/gdb/configure
+===================================================================
+--- gdb-6.8.50.20090909.orig/gdb/configure     2009-09-09 20:11:07.000000000 +0200
++++ gdb-6.8.50.20090909/gdb/configure  2009-09-09 20:11:54.000000000 +0200
+@@ -9197,6 +9197,69 @@ if test "$with_system_readline" = yes; t
+   READLINE=-lreadline
+   READLINE_DEPS=
+   READLINE_CFLAGS=
++
++  # readline-6.0 started to use the name `_rl_echoing_p'.
++  # `$(READLINE_DIR)/' of bundled readline would not resolve in configure.
++
++  echo "$as_me:$LINENO: checking for readline_echoing_p" >&5
++echo $ECHO_N "checking for readline_echoing_p... $ECHO_C" >&6
++  save_LIBS=$LIBS
++  LIBS="$LIBS $READLINE"
++  cat >conftest.$ac_ext <<_ACEOF
++/* confdefs.h.  */
++_ACEOF
++cat confdefs.h >>conftest.$ac_ext
++cat >>conftest.$ac_ext <<_ACEOF
++/* end confdefs.h.  */
++
++int
++main ()
++{
++extern int readline_echoing_p;
++                                  return readline_echoing_p;
++  ;
++  return 0;
++}
++_ACEOF
++rm -f conftest.$ac_objext conftest$ac_exeext
++if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
++  (eval $ac_link) 2>conftest.er1
++  ac_status=$?
++  grep -v '^ *+' conftest.er1 >conftest.err
++  rm -f conftest.er1
++  cat conftest.err >&5
++  echo "$as_me:$LINENO: \$? = $ac_status" >&5
++  (exit $ac_status); } &&
++       { ac_try='test -z "$ac_c_werror_flag"
++                       || test ! -s conftest.err'
++  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++  (eval $ac_try) 2>&5
++  ac_status=$?
++  echo "$as_me:$LINENO: \$? = $ac_status" >&5
++  (exit $ac_status); }; } &&
++       { ac_try='test -s conftest$ac_exeext'
++  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++  (eval $ac_try) 2>&5
++  ac_status=$?
++  echo "$as_me:$LINENO: \$? = $ac_status" >&5
++  (exit $ac_status); }; }; then
++  READLINE_ECHOING_P=yes
++else
++  echo "$as_me: failed program was:" >&5
++sed 's/^/| /' conftest.$ac_ext >&5
++
++READLINE_ECHOING_P=no
++
++cat >>confdefs.h <<\_ACEOF
++#define readline_echoing_p _rl_echoing_p
++_ACEOF
++
++fi
++rm -f conftest.err conftest.$ac_objext \
++      conftest$ac_exeext conftest.$ac_ext
++  LIBS="$save_LIBS"
++  echo "$as_me:$LINENO: result: $READLINE_ECHOING_P" >&5
++echo "${ECHO_T}$READLINE_ECHOING_P" >&6
+ else
+   READLINE='$(READLINE_DIR)/libreadline.a'
+   READLINE_DEPS='$(READLINE)'
diff --git a/gdb-simultaneous-step-resume-breakpoint-test.patch b/gdb-simultaneous-step-resume-breakpoint-test.patch
new file mode 100644 (file)
index 0000000..e6e53bb
--- /dev/null
@@ -0,0 +1,150 @@
+--- /dev/null  2009-09-25 12:44:54.497650251 +0200
++++ ./gdb/testsuite/gdb.threads/simultaneous-step-resume-breakpoint.exp        2009-09-25 17:27:12.000000000 +0200
+@@ -0,0 +1,65 @@
++# Copyright (C) 2009 Free Software Foundation, Inc.
++
++# This program is free software; you can redistribute it and/or modify
++# it under the terms of the GNU General Public License as published by
++# the Free Software Foundation; either version 3 of the License, or
++# (at your option) any later version.
++#
++# This program is distributed in the hope that it will be useful,
++# but WITHOUT ANY WARRANTY; without even the implied warranty of
++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++# GNU General Public License for more details.
++#
++# You should have received a copy of the GNU General Public License
++# along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
++
++# Test multiple threads stepping into a .debug_line-less function with
++# a breakpoint placed on its return-to-caller point.
++
++set testfile simultaneous-step-resume-breakpoint
++set srcfile ${testfile}.c
++set binfile ${objdir}/${subdir}/${testfile}
++
++if {[gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
++    return -1
++}
++
++gdb_exit
++gdb_start
++gdb_reinitialize_dir $srcdir/$subdir
++
++# Ensure we have no debuginfo for the `sleep' call itself (=for libc).
++gdb_test "set debug-file-directory /DoesNotExist"
++
++gdb_load ${binfile}
++if ![runto_main] {
++   return -1
++}
++
++# Red Hat vendor patch does set it to "step" by default.
++gdb_test "set scheduler-locking off"
++
++gdb_breakpoint [gdb_get_line_number "final-exit"]
++
++gdb_breakpoint [gdb_get_line_number "sleep-call"]
++gdb_continue_to_breakpoint "sleep-call"
++
++gdb_test "step" "sleep-call.*" "step thread 1"
++gdb_test "step" "sleep-call.*" "step thread 2"
++gdb_test "step" "sleep-after.*" "step thread 3"
++
++set test "first continue"
++gdb_test_multiple "continue" $test {
++    -re "final-exit.*$gdb_prompt $" {
++      # gdb-7.0.
++      pass $test
++      return
++    }
++    -re "sleep-after.*$gdb_prompt $" {
++      # Fedora/RHEL branch.
++      pass $test
++    }
++}
++
++gdb_test "continue" "sleep-after.*" "second continue"
++gdb_test "continue" "final-exit.*" "third continue"
+--- /dev/null  2009-09-25 12:44:54.497650251 +0200
++++ ./gdb/testsuite/gdb.threads/simultaneous-step-resume-breakpoint.c  2009-09-25 17:29:42.000000000 +0200
+@@ -0,0 +1,79 @@
++/* Copyright 2009 Free Software Foundation, Inc.
++
++   Written by Fred Fish of Cygnus Support
++   Contributed by Cygnus Support
++
++   This file is part of GDB.
++
++   This program is free software; you can redistribute it and/or modify
++   it under the terms of the GNU General Public License as published by
++   the Free Software Foundation; either version 3 of the License, or
++   (at your option) any later version.
++
++   This program is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++   GNU General Public License for more details.
++
++   You should have received a copy of the GNU General Public License
++   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
++
++/* Test multiple threads stepping into a .debug_line-less function with
++   a breakpoint placed on its return-to-caller point.  */
++
++#include <pthread.h>
++#include <assert.h>
++#include <unistd.h>
++#include <errno.h>
++#include <stdio.h>
++
++#define THREADS 3
++
++static void *
++func (void *unused)
++{
++  int i;
++
++  errno = 0;
++  i = 0xdeadf00d;
++  i = sleep (THREADS);        /* sleep-call */
++  if (errno != 0)     /* sleep-after */
++    perror ("sleep");
++
++  /* The GDB bug with forgotten step-resume breakpoint could leave stale
++     breakpoint on the I assignment making it a nop.  */
++  if (i == 0xdeadf00d)
++    assert (0);
++
++  assert (i == 0);
++
++  pthread_exit (NULL);
++}
++
++int
++main (void)
++{
++  pthread_t threads[THREADS];
++  int threadi;
++
++  for (threadi = 0; threadi < THREADS; threadi++)
++    {
++      int i;
++
++      i = pthread_create (&threads[threadi], NULL, func, NULL);
++      assert (i == 0);
++
++      i = sleep (1);
++      assert (i == 0);
++    }
++
++  for (threadi = 0; threadi < THREADS; threadi++)
++    {
++      int i;
++
++      i = pthread_join (threads[threadi], NULL);
++      assert (i == 0);
++    }
++
++  return 0;   /* final-exit */
++}
index b152e60882e7fae008e4349340d06119ec84f340..0d2d7b1a902943aa873821e4955511f4af40c3f4 100644 (file)
--- a/gdb.spec
+++ b/gdb.spec
@@ -1,6 +1,15 @@
+# NOTE
+# - Do not remove -lib package, it is required by FPC
+
+# TODO
+# - python subpkg
+# - gdbtui is as big as gdb, but different md5, some kind of duplicate?
 #
-# NOTE:        Do not remove -lib package, it is required by FPC
-#
+# Conditional build:
+%bcond_without python          # build without python support
+
+%define                snap    20090930
+%define                rel             0.1
 Summary:       A GNU source-level debugger for C, C++ and Fortran
 Summary(de.UTF-8):     Symbolischer Debugger für C und andere Sprachen
 Summary(es.UTF-8):     Depurador de programas C y otras lenguajes
@@ -12,53 +21,41 @@ Summary(tr.UTF-8):  C ve diğer diller için sembolik hata ayıklayıcı
 Summary(uk.UTF-8):     Символьний відладчик для С та інших мов
 Summary(zh_CN.UTF-8):  [开发]C和其他语言的调试器
 Summary(zh_TW.UTF-8):  [.-A開發]C和.$)B其.-A他語.$)B言的調試器
-%define        snap    20090302
 Name:          gdb
-Version:       6.8.50
-Release:       1.%{snap}.4
+Version:       6.8.91
+Release:       1.%{snap}.%{rel}
 License:       GPL v3+
 Group:         Development/Debuggers
-# Source0:     http://ftp.gnu.org/gnu/gdb/%{name}-%{version}.tar.bz2
-# Source0:     ftp://sourceware.org/pub/gdb/snapshots/current/gdb-%{version}.%{snap}.tar.bz2
-Source0:       gdb-%{version}.%{snap}.tar.bz2
-# Source0-md5: a8eae0d4ef955ebcecfc7511af31070a
+Source0:       ftp://sourceware.org/pub/gdb/snapshots/branch/%{name}-%{version}.%{snap}.tar.bz2
+# Source0-md5: 729517cc8e6ca6e25cf4be343ffc4c3d
 Source1:       http://www.mif.pg.gda.pl/homepages/ankry/man-PLD/%{name}-non-english-man-pages.tar.bz2
 # Source1-md5: 2e8a48939ae282c12bbacdd54e398247
+# libstdc++ pretty printers from GCC SVN HEAD (4.5 experimental).
+Source4:       libstdc++-v3-python-r151798.tar.bz2
+# Source4-md5: 7507540c50a1edeb2fc22a37bc4a08b8
 
 # PLD
-
 Patch1000:     %{name}-readline.patch
 Patch1001:     %{name}-info.patch
 Patch1002:     %{name}-passflags.patch
 Patch1005:     %{name}-pretty-print-by-default.patch
 
 # FEDORA
-
-# Work around out-of-date dejagnu that does not have KFAIL
 Patch1:                %{name}-6.3-rh-dummykfail-20041202.patch
-
-# Match the Fedora's version info.
 Patch2:                %{name}-6.3-rh-testversion-20041202.patch
-
-# Check that libunwind works - new test then fix
 Patch3:                %{name}-6.3-rh-testlibunwind-20041202.patch
-Patch4:                %{name}-6.3-rh-testlibunwind1fix-20041202.patch
-
 Patch104:      %{name}-6.3-ppcdotsolib-20041022.patch
 Patch105:      %{name}-6.3-ppc64syscall-20040622.patch
 Patch106:      %{name}-6.3-framepczero-20040927.patch
 Patch111:      %{name}-6.3-ppc64displaysymbol-20041124.patch
 Patch112:      %{name}-6.6-scheduler_locking-step-sw-watchpoints2.patch
 Patch260:      %{name}-6.6-scheduler_locking-step-is-default.patch
-Patch116:      %{name}-6.3-linespec-20041213.patch
-Patch117:      %{name}-6.3-removebp-20041130.patch
 Patch118:      %{name}-6.3-gstack-20050411.patch
 Patch122:      %{name}-6.3-test-pie-20050107.patch
 Patch124:      %{name}-6.3-pie-20050110.patch
 Patch125:      %{name}-6.3-test-self-20050110.patch
 Patch128:      %{name}-6.3-nonthreaded-wp-20050117.patch
 Patch133:      %{name}-6.3-test-dtorfix-20050121.patch
-Patch134:      %{name}-6.3-dtorfix-20050121.patch
 Patch136:      %{name}-6.3-test-movedir-20050125.patch
 Patch140:      %{name}-6.3-gcore-thread-20050204.patch
 Patch141:      %{name}-6.6-step-thread-exit.patch
@@ -76,7 +73,6 @@ Patch161:     %{name}-6.3-inferior-notification-20050721.patch
 Patch162:      %{name}-6.3-ia64-info-frame-fix-20050725.patch
 Patch163:      %{name}-6.3-inheritancetest-20050726.patch
 Patch164:      %{name}-6.3-readnever-20050907.patch
-Patch166:      %{name}-6.3-ia64-sigtramp-fp-20050926.patch
 Patch169:      %{name}-6.3-ia64-sigill-20051115.patch
 Patch170:      %{name}-6.3-bt-past-zero-20051201.patch
 Patch176:      %{name}-6.3-large-core-20051206.patch
@@ -87,7 +83,6 @@ Patch194:     %{name}-6.5-bz185337-resolve-tls-without-debuginfo-v2.patch
 Patch195:      %{name}-6.5-tls-of-separate-debuginfo.patch
 Patch196:      %{name}-6.5-sharedlibrary-path.patch
 Patch199:      %{name}-6.5-bz190810-gdbserver-arch-advice.patch
-Patch200:      %{name}-6.5-bz181390-memory-address-width.patch
 Patch201:      %{name}-6.5-gcore-i386-on-amd64.patch
 Patch211:      %{name}-6.5-last-address-space-byte-test.patch
 Patch208:      %{name}-6.5-BEA-testsuite.patch
@@ -116,7 +111,6 @@ Patch266:   %{name}-6.6-bz247354-leader-exit-test.patch
 Patch271:      %{name}-6.5-bz243845-stale-testing-zombie-test.patch
 Patch274:      %{name}-6.6-buildid-locate.patch
 Patch353:      %{name}-6.6-buildid-locate-rpm.patch
-Patch280:      %{name}-6.6-multifork-debugreg.patch
 Patch282:      %{name}-6.7-charsign-test.patch
 Patch284:      %{name}-6.7-ppc-clobbered-registers-O2-test.patch
 Patch287:      %{name}-6.7-testsuite-stable-results.patch
@@ -137,19 +131,21 @@ Patch320: %{name}-6.5-section-num-fixup-test.patch
 Patch322:      %{name}-6.8-constant-watchpoints.patch
 Patch324:      %{name}-6.8-glibc-headers-compat.patch
 Patch326:      %{name}-6.8-tui-singlebinary.patch
-Patch327:      %{name}-6.8-inlining.patch
 Patch350:      %{name}-6.8-inlining-addon.patch
 Patch328:      %{name}-6.8-inlining-by-name.patch
 Patch329:      %{name}-6.8-bz254229-gcore-prpsinfo.patch
 Patch330:      %{name}-6.8-bz436037-reg-no-longer-active.patch
 Patch331:      %{name}-6.8-quit-never-aborts.patch
 Patch332:      %{name}-6.8-fortran-tag-constant.patch
-Patch334:      %{name}-6.8-ctors-dtors-unique.patch
 Patch337:      %{name}-6.8-attach-signalled-detach-stopped.patch
 Patch343:      %{name}-6.8-watchpoint-conditionals-test.patch
 Patch348:      %{name}-6.8-bz466901-backtrace-full-prelinked.patch
 Patch349:      %{name}-archer.patch
 Patch352:      %{name}-6.8-bz457187-largefile.patch
+Patch360:      %{name}-6.8-bz457187-largefile-test.patch
+Patch375:      %{name}-readline-6.0.patch
+Patch376:      libstdc++-v3-python-common-prefix.patch
+Patch381:      %{name}-simultaneous-step-resume-breakpoint-test.patch
 URL:           http://www.gnu.org/software/gdb/
 BuildRequires: autoconf >= 2.53
 BuildRequires: automake
@@ -161,6 +157,7 @@ BuildRequires:      python-devel
 BuildRequires: readline-devel >= 6.0
 BuildRequires: rpm-pythonprov
 BuildRequires: texinfo >= 4.4
+%{?with_python:Requires: python-libs}
 BuildRoot:     %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
 %description
@@ -215,6 +212,19 @@ verir.
 момент часу. Працює з програмами на C та C++, зкомпільованими
 компіляторами GNU C (gcc, egcs, pgcc).
 
+%package gdbserver
+Summary:       A standalone server for GDB (the GNU source-level debugger)
+Group:         Development/Debuggers
+
+%description gdbserver
+GDB, the GNU debugger, allows you to debug programs written in C, C++,
+Java, and other languages, by executing them in a controlled fashion
+and printing their data.
+
+This package provides a program that allows you to run GDB on a
+different machine than the one which is running the program being
+debugged.
+
 %package lib
 Summary:       GDB in the form of a static library
 Summary(pl.UTF-8):     GDB w postaci biblioteki statycznej
@@ -230,6 +240,9 @@ GDB w postaci biblioteki statycznej.
 %prep
 %setup -q -n %{name}-%{version}.%{snap}
 
+# libstdc++ pretty printers.
+bzip2 -dc %{SOURCE4} | tar xf -
+
 %patch1000 -p1
 %patch1001 -p1
 %patch1002 -p1
@@ -239,30 +252,20 @@ GDB w postaci biblioteki statycznej.
 rm -f gdb/ada-exp.c gdb/ada-lex.c gdb/c-exp.c gdb/cp-name-parser.c gdb/f-exp.c
 rm -f gdb/jv-exp.c gdb/m2-exp.c gdb/objc-exp.c gdb/p-exp.c
 
-# Apply patches defined above.
-
-# Match the Fedora's version info.
 %patch2 -p1
-
-###patch232 -p1
 %patch349 -p1
 %patch1 -p1
 %patch3 -p1
-%patch4 -p1
-
 %patch104 -p1
 %patch105 -p1
 %patch106 -p1
 %patch111 -p1
 %patch112 -p1
-%patch116 -p1
-%patch117 -p1
 %patch118 -p1
 %patch122 -p1
 %patch125 -p1
 %patch128 -p1
 %patch133 -p1
-%patch134 -p1
 %patch136 -p1
 %patch140 -p1
 %patch141 -p1
@@ -280,7 +283,6 @@ rm -f gdb/jv-exp.c gdb/m2-exp.c gdb/objc-exp.c gdb/p-exp.c
 %patch162 -p1
 %patch163 -p1
 %patch164 -p1
-%patch166 -p1
 %patch169 -p1
 %patch170 -p1
 %patch176 -p1
@@ -291,7 +293,6 @@ rm -f gdb/jv-exp.c gdb/m2-exp.c gdb/objc-exp.c gdb/p-exp.c
 %patch195 -p1
 %patch196 -p1
 %patch199 -p1
-%patch200 -p1
 %patch201 -p1
 %patch208 -p1
 %patch209 -p1
@@ -321,7 +322,6 @@ rm -f gdb/jv-exp.c gdb/m2-exp.c gdb/objc-exp.c gdb/p-exp.c
 %patch271 -p1
 %patch274 -p1
 %patch353 -p1
-%patch280 -p1
 %patch282 -p1
 %patch284 -p1
 %patch287 -p1
@@ -342,22 +342,26 @@ rm -f gdb/jv-exp.c gdb/m2-exp.c gdb/objc-exp.c gdb/p-exp.c
 %patch322 -p1
 %patch324 -p1
 %patch326 -p1
-%patch327 -p1
 %patch350 -p1
 %patch328 -p1
 %patch329 -p1
 %patch330 -p1
 %patch331 -p1
 %patch332 -p1
-%patch334 -p1
 %patch337 -p1
 %patch343 -p1
 %patch348 -p1
 %patch352 -p1
 %patch124 -p1
+%patch360 -p1
+%patch375 -p1
+%patch376 -p1
+%patch381 -p1
+
+mv $(basename %{SOURCE4} .tar.bz2) libstdcxxpython
 
 %build
-for dir in `find gdb/ -name 'configure.in'`; do
+for dir in $(find gdb -name 'configure.in'); do
        dir=$(dirname "$dir")
        olddir=$(pwd)
        cd $dir
@@ -372,7 +376,12 @@ cp -f /usr/share/automake/config.* .
 %configure \
        --with-gdb-datadir=%{_datadir}/gdb \
        --with-separate-debug-dir=/usr/lib/debug \
-       --with-pythondir=%{py_sitedir} \
+%if %{with python}
+       --with-python \
+       --with-pythondir=%{py_sitescriptdir} \
+%else
+       --without-python \
+%endif
        --disable-gdbtk \
        --disable-shared \
        --enable-gdbcli \
@@ -400,8 +409,36 @@ install -d $RPM_BUILD_ROOT%{_infodir}
        DESTDIR=$RPM_BUILD_ROOT
 
 bzip2 -dc %{SOURCE1} | tar xf - -C $RPM_BUILD_ROOT%{_mandir}
+cp -a gdb/libgdb.a $RPM_BUILD_ROOT%{_libdir}
+
+rm -f $RPM_BUILD_ROOT%{_infodir}/dir
+rm -f $RPM_BUILD_ROOT%{_mandir}/README.gdb-non-english-man-pages
+
+%if %{with python}
+# Temporarily now:
+for LIB in lib lib64; do
+       LIBPATH="$RPM_BUILD_ROOT%{_datadir}/gdb/auto-load%{_prefix}/$LIB"
+       install -d $LIBPATH
+       # basename is being run only for the native (non-biarch) file.
+       sed -e 's,@pythondir@,%{_datadir}/gdb/python,'          \
+         -e 's,@toolexeclibdir@,%{_prefix}/'"$LIB,"            \
+         < libstdcxxpython/hook.in     \
+         > $LIBPATH/$(basename %{_prefix}/%{_lib}/libstdc++.so.6.*)-gdb.py
+done
+test ! -e $RPM_BUILD_ROOT%{_datadir}/gdb/python/libstdcxx
+install -d $RPM_BUILD_ROOT%{_datadir}/gdb/python
+cp -a libstdcxxpython/libstdcxx        $RPM_BUILD_ROOT%{_datadir}/gdb/python/libstdcxx
+%endif
 
-install gdb/libgdb.a $RPM_BUILD_ROOT%{_libdir}
+# Remove the files that are part of a gdb build but that are owned and provided by other packages.
+# These are part of binutils
+rm -rf $RPM_BUILD_ROOT%{_datadir}/locale
+rm -f $RPM_BUILD_ROOT%{_infodir}/bfd*
+rm -f $RPM_BUILD_ROOT%{_infodir}/standard*
+rm -f $RPM_BUILD_ROOT%{_infodir}/mmalloc*
+rm -f $RPM_BUILD_ROOT%{_infodir}/configure*
+rm -rf $RPM_BUILD_ROOT%{_includedir}
+rm -rf $RPM_BUILD_ROOT%{_libdir}/lib{bfd*,opcodes*,iberty*,mmalloc*}
 
 %clean
 rm -rf $RPM_BUILD_ROOT
@@ -415,17 +452,33 @@ rm -rf $RPM_BUILD_ROOT
 %files
 %defattr(644,root,root,755)
 %doc gdb/{ChangeLog,NEWS,PROBLEMS,README}
-%attr(755,root,root) %{_bindir}/*
-%{_datadir}/gdb
-%{py_sitedir}/gdb
-%{_mandir}/man1/*
+%attr(755,root,root) %{_bindir}/gdb
+%attr(755,root,root) %{_bindir}/gdbtui
+%attr(755,root,root) %{_bindir}/gstack
+%dir %{_datadir}/gdb
+%{_datadir}/gdb/syscalls
+%{_mandir}/man1/gdb.1*
+%{_mandir}/man1/gdbtui.1*
 %lang(es) %{_mandir}/es/man1/*
 %lang(fr) %{_mandir}/fr/man1/*
 %lang(hu) %{_mandir}/hu/man1/*
 %lang(ja) %{_mandir}/ja/man1/*
 %lang(pl) %{_mandir}/pl/man1/*
-%{_infodir}/gdb*.info*
-%{_infodir}/stabs*.info*
+%{_infodir}/annotate.info*
+%{_infodir}/gdb.info*
+%{_infodir}/gdbint.info*
+%{_infodir}/stabs.info*
+
+%if %{with python}
+%{py_sitescriptdir}/gdb
+%{_datadir}/gdb/auto-load
+%{_datadir}/gdb/python
+%endif
+
+%files gdbserver
+%defattr(644,root,root,755)
+%attr(755,root,root) %{_bindir}/gdbserver
+%{_mandir}/man1/gdbserver.1*
 
 %files lib
 %defattr(644,root,root,755)
diff --git a/libstdc++-v3-python-common-prefix.patch b/libstdc++-v3-python-common-prefix.patch
new file mode 100644 (file)
index 0000000..7409c9a
--- /dev/null
@@ -0,0 +1,18 @@
+On x86_64 host with:
+pythondir: /usr/lib/python2.6/site-packages/gdb
+libdir:    /usr/lib64
+
+prefix got set to "/usr/lib" but the code expects a trailing "/" (missing then
+one "../" path component).
+
+--- ./libstdc++-v3-python-r151798/hook.in-orig 2009-06-18 21:12:37.000000000 +0200
++++ ./libstdc++-v3-python-r151798/hook.in      2009-09-17 23:37:35.000000000 +0200
+@@ -40,7 +40,7 @@ if gdb.current_objfile () is not None:
+     # In some bizarre configuration we might have found a match in the
+     # middle of a directory name.
+     if prefix[-1] != '/':
+-        prefix = os.path.dirname (prefix)
++        prefix = os.path.dirname (prefix) + '/'
+     # Strip off the prefix.
+     pythondir = pythondir[len (prefix):]
This page took 3.278334 seconds and 4 git commands to generate.