bug 835456 - Update Breakpad to SVN r1106. r=upstream
authorTed Mielczarek <ted@mielczarek.org>
Mon, 28 Jan 2013 14:12:12 -0500
changeset 129965 b8f1cd485c5853c3aeda7f7d854e7e723a53c377
parent 129964 c7fa9c31135d84b22a23f76f6e7062657c4793f3
child 129966 2f3dd2be7a8bab35819e1cf4e5465851c03ea756
push id2323
push userbbajaj@mozilla.com
push dateMon, 01 Apr 2013 19:47:02 +0000
treeherdermozilla-beta@7712be144d91 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersupstream
bugs835456
milestone21.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
bug 835456 - Update Breakpad to SVN r1106. r=upstream
toolkit/crashreporter/google-breakpad/Makefile.am
toolkit/crashreporter/google-breakpad/SVN-INFO
toolkit/crashreporter/google-breakpad/aclocal.m4
toolkit/crashreporter/google-breakpad/android/google_breakpad/Android.mk
toolkit/crashreporter/google-breakpad/android/run-checks.sh
toolkit/crashreporter/google-breakpad/android/sample_app/jni/Android.mk
toolkit/crashreporter/google-breakpad/configure
toolkit/crashreporter/google-breakpad/src/client/ios/Breakpad.mm
toolkit/crashreporter/google-breakpad/src/client/ios/BreakpadController.h
toolkit/crashreporter/google-breakpad/src/client/ios/BreakpadController.mm
toolkit/crashreporter/google-breakpad/src/client/ios/handler/ios_exception_minidump_generator.mm
toolkit/crashreporter/google-breakpad/src/client/linux/handler/exception_handler.cc
toolkit/crashreporter/google-breakpad/src/client/linux/handler/exception_handler.h
toolkit/crashreporter/google-breakpad/src/client/linux/handler/exception_handler_unittest.cc
toolkit/crashreporter/google-breakpad/src/client/linux/handler/minidump_descriptor.cc
toolkit/crashreporter/google-breakpad/src/client/linux/handler/minidump_descriptor.h
toolkit/crashreporter/google-breakpad/src/client/linux/minidump_writer/line_reader_unittest.cc
toolkit/crashreporter/google-breakpad/src/client/linux/minidump_writer/linux_core_dumper.cc
toolkit/crashreporter/google-breakpad/src/client/linux/minidump_writer/linux_core_dumper_unittest.cc
toolkit/crashreporter/google-breakpad/src/client/linux/minidump_writer/linux_dumper.h
toolkit/crashreporter/google-breakpad/src/client/linux/minidump_writer/linux_dumper_unittest_helper.cc
toolkit/crashreporter/google-breakpad/src/client/linux/minidump_writer/linux_ptrace_dumper.cc
toolkit/crashreporter/google-breakpad/src/client/linux/minidump_writer/linux_ptrace_dumper_unittest.cc
toolkit/crashreporter/google-breakpad/src/client/linux/minidump_writer/minidump_writer.cc
toolkit/crashreporter/google-breakpad/src/client/linux/minidump_writer/minidump_writer.h
toolkit/crashreporter/google-breakpad/src/client/linux/minidump_writer/minidump_writer_unittest.cc
toolkit/crashreporter/google-breakpad/src/client/mac/Framework/Breakpad.mm
toolkit/crashreporter/google-breakpad/src/client/mac/handler/dynamic_images.cc
toolkit/crashreporter/google-breakpad/src/client/mac/handler/exception_handler.cc
toolkit/crashreporter/google-breakpad/src/client/mac/handler/exception_handler.h
toolkit/crashreporter/google-breakpad/src/client/windows/crash_generation/client_info.h
toolkit/crashreporter/google-breakpad/src/client/windows/crash_generation/crash_generation.gyp
toolkit/crashreporter/google-breakpad/src/client/windows/crash_generation/crash_generation_client.h
toolkit/crashreporter/google-breakpad/src/client/windows/crash_generation/crash_generation_server.cc
toolkit/crashreporter/google-breakpad/src/client/windows/crash_generation/crash_generation_server.h
toolkit/crashreporter/google-breakpad/src/client/windows/handler/exception_handler.cc
toolkit/crashreporter/google-breakpad/src/client/windows/handler/exception_handler.gyp
toolkit/crashreporter/google-breakpad/src/client/windows/handler/exception_handler.h
toolkit/crashreporter/google-breakpad/src/client/windows/sender/crash_report_sender.gyp
toolkit/crashreporter/google-breakpad/src/client/windows/unittests/client_tests.gyp
toolkit/crashreporter/google-breakpad/src/client/windows/unittests/dump_analysis.cc
toolkit/crashreporter/google-breakpad/src/client/windows/unittests/dump_analysis.h
toolkit/crashreporter/google-breakpad/src/client/windows/unittests/exception_handler_death_test.cc
toolkit/crashreporter/google-breakpad/src/client/windows/unittests/exception_handler_nesting_test.cc
toolkit/crashreporter/google-breakpad/src/client/windows/unittests/exception_handler_test.cc
toolkit/crashreporter/google-breakpad/src/client/windows/unittests/exception_handler_test.h
toolkit/crashreporter/google-breakpad/src/client/windows/unittests/minidump_test.cc
toolkit/crashreporter/google-breakpad/src/client/windows/unittests/testing.gyp
toolkit/crashreporter/google-breakpad/src/common/dwarf/dwarf2diehandler.cc
toolkit/crashreporter/google-breakpad/src/common/dwarf/dwarf2diehandler.h
toolkit/crashreporter/google-breakpad/src/common/dwarf/dwarf2diehandler_unittest.cc
toolkit/crashreporter/google-breakpad/src/common/dwarf/dwarf2reader.cc
toolkit/crashreporter/google-breakpad/src/common/dwarf/dwarf2reader.h
toolkit/crashreporter/google-breakpad/src/common/dwarf/dwarf2reader_die_unittest.cc
toolkit/crashreporter/google-breakpad/src/common/dwarf/functioninfo.cc
toolkit/crashreporter/google-breakpad/src/common/dwarf/functioninfo.h
toolkit/crashreporter/google-breakpad/src/common/dwarf_cu_to_module.cc
toolkit/crashreporter/google-breakpad/src/common/dwarf_cu_to_module.h
toolkit/crashreporter/google-breakpad/src/common/dwarf_cu_to_module_unittest.cc
toolkit/crashreporter/google-breakpad/src/common/dwarf_line_to_module.cc
toolkit/crashreporter/google-breakpad/src/common/dwarf_line_to_module.h
toolkit/crashreporter/google-breakpad/src/common/dwarf_line_to_module_unittest.cc
toolkit/crashreporter/google-breakpad/src/common/linux/dump_symbols.cc
toolkit/crashreporter/google-breakpad/src/common/linux/dump_symbols.h
toolkit/crashreporter/google-breakpad/src/common/linux/dump_symbols_unittest.cc
toolkit/crashreporter/google-breakpad/src/common/linux/elf_core_dump_unittest.cc
toolkit/crashreporter/google-breakpad/src/common/linux/file_id_unittest.cc
toolkit/crashreporter/google-breakpad/src/common/linux/linux_libc_support_unittest.cc
toolkit/crashreporter/google-breakpad/src/common/linux/memory_mapped_file_unittest.cc
toolkit/crashreporter/google-breakpad/src/common/linux/safe_readlink_unittest.cc
toolkit/crashreporter/google-breakpad/src/common/linux/synth_elf_unittest.cc
toolkit/crashreporter/google-breakpad/src/common/mac/dump_syms.mm
toolkit/crashreporter/google-breakpad/src/common/mac/string_utilities.cc
toolkit/crashreporter/google-breakpad/src/common/memory_range_unittest.cc
toolkit/crashreporter/google-breakpad/src/common/scoped_ptr.h
toolkit/crashreporter/google-breakpad/src/common/solaris/dump_symbols.cc
toolkit/crashreporter/google-breakpad/src/common/string_conversion.cc
toolkit/crashreporter/google-breakpad/src/google_breakpad/processor/minidump.h
toolkit/crashreporter/google-breakpad/src/google_breakpad/processor/minidump_processor.h
toolkit/crashreporter/google-breakpad/src/google_breakpad/processor/stack_frame.h
toolkit/crashreporter/google-breakpad/src/google_breakpad/processor/stack_frame_cpu.h
toolkit/crashreporter/google-breakpad/src/google_breakpad/processor/stack_frame_symbolizer.h
toolkit/crashreporter/google-breakpad/src/google_breakpad/processor/stackwalker.h
toolkit/crashreporter/google-breakpad/src/processor/basic_source_line_resolver_types.h
toolkit/crashreporter/google-breakpad/src/processor/basic_source_line_resolver_unittest.cc
toolkit/crashreporter/google-breakpad/src/processor/binarystream_unittest.cc
toolkit/crashreporter/google-breakpad/src/processor/cfi_frame_info.cc
toolkit/crashreporter/google-breakpad/src/processor/disassembler_x86_unittest.cc
toolkit/crashreporter/google-breakpad/src/processor/exploitability.cc
toolkit/crashreporter/google-breakpad/src/processor/exploitability_win.cc
toolkit/crashreporter/google-breakpad/src/processor/fast_source_line_resolver.cc
toolkit/crashreporter/google-breakpad/src/processor/fast_source_line_resolver_unittest.cc
toolkit/crashreporter/google-breakpad/src/processor/minidump.cc
toolkit/crashreporter/google-breakpad/src/processor/minidump_dump.cc
toolkit/crashreporter/google-breakpad/src/processor/minidump_processor.cc
toolkit/crashreporter/google-breakpad/src/processor/minidump_processor_unittest.cc
toolkit/crashreporter/google-breakpad/src/processor/minidump_stackwalk.cc
toolkit/crashreporter/google-breakpad/src/processor/minidump_unittest.cc
toolkit/crashreporter/google-breakpad/src/processor/module_comparer.cc
toolkit/crashreporter/google-breakpad/src/processor/module_serializer.h
toolkit/crashreporter/google-breakpad/src/processor/range_map_unittest.cc
toolkit/crashreporter/google-breakpad/src/processor/scoped_ptr.h
toolkit/crashreporter/google-breakpad/src/processor/stack_frame_symbolizer.cc
toolkit/crashreporter/google-breakpad/src/processor/stackwalker.cc
toolkit/crashreporter/google-breakpad/src/processor/stackwalker_amd64.cc
toolkit/crashreporter/google-breakpad/src/processor/stackwalker_amd64.h
toolkit/crashreporter/google-breakpad/src/processor/stackwalker_amd64_unittest.cc
toolkit/crashreporter/google-breakpad/src/processor/stackwalker_arm.cc
toolkit/crashreporter/google-breakpad/src/processor/stackwalker_arm.h
toolkit/crashreporter/google-breakpad/src/processor/stackwalker_arm_unittest.cc
toolkit/crashreporter/google-breakpad/src/processor/stackwalker_ppc.cc
toolkit/crashreporter/google-breakpad/src/processor/stackwalker_ppc.h
toolkit/crashreporter/google-breakpad/src/processor/stackwalker_selftest.cc
toolkit/crashreporter/google-breakpad/src/processor/stackwalker_sparc.cc
toolkit/crashreporter/google-breakpad/src/processor/stackwalker_sparc.h
toolkit/crashreporter/google-breakpad/src/processor/stackwalker_x86.cc
toolkit/crashreporter/google-breakpad/src/processor/stackwalker_x86.h
toolkit/crashreporter/google-breakpad/src/processor/stackwalker_x86_unittest.cc
toolkit/crashreporter/google-breakpad/src/processor/static_contained_range_map_unittest.cc
toolkit/crashreporter/google-breakpad/src/processor/static_map.h
toolkit/crashreporter/google-breakpad/src/processor/static_range_map.h
toolkit/crashreporter/google-breakpad/src/processor/static_range_map_unittest.cc
toolkit/crashreporter/google-breakpad/src/processor/synth_minidump.cc
toolkit/crashreporter/google-breakpad/src/processor/synth_minidump.h
toolkit/crashreporter/google-breakpad/src/processor/synth_minidump_unittest.cc
toolkit/crashreporter/google-breakpad/src/processor/testdata/minidump2.stackwalk.machine_readable.out
toolkit/crashreporter/google-breakpad/src/processor/testdata/minidump2.stackwalk.out
toolkit/crashreporter/google-breakpad/src/tools/linux/dump_syms/dump_syms.cc
toolkit/crashreporter/google-breakpad/src/tools/linux/md2core/minidump-2-core.cc
toolkit/crashreporter/google-breakpad/src/tools/linux/md2core/minidump_memory_range_unittest.cc
toolkit/crashreporter/google-breakpad/src/tools/mac/crash_report/crash_report.mm
toolkit/crashreporter/google-breakpad/src/tools/python/filter_syms.py
toolkit/crashreporter/google-breakpad/src/tools/python/tests/filter_syms_unittest.py
--- a/toolkit/crashreporter/google-breakpad/Makefile.am
+++ b/toolkit/crashreporter/google-breakpad/Makefile.am
@@ -41,21 +41,23 @@ AM_CXXFLAGS += -I$(top_srcdir)/src/commo
 # This is only necessary for building the unit tests until GTest is upgraded
 # to a future version.
 AM_CXXFLAGS += -I$(top_srcdir)/src/common/android/testing/include
 endif
 
 if GCC
 # These are good warnings to be treated as errors
 AM_CXXFLAGS += \
+	-Werror=missing-braces \
 	-Werror=non-virtual-dtor \
-	-Werror=vla \
+	-Werror=overloaded-virtual \
+	-Werror=reorder \
+	-Werror=sign-compare \
 	-Werror=unused-variable \
-	-Werror=missing-braces \
-	-Werror=overloaded-virtual
+	-Werror=vla
 endif
 
 if LINUX_HOST
 # Build as PIC on Linux, for linux_client_unittest_shlib
 AM_CFLAGS += -fPIC
 AM_CXXFLAGS += -fPIC
 endif
 
@@ -127,16 +129,17 @@ src_libbreakpad_a_SOURCES = \
 	src/google_breakpad/processor/memory_region.h \
 	src/google_breakpad/processor/minidump.h \
 	src/google_breakpad/processor/minidump_processor.h \
 	src/google_breakpad/processor/process_state.h \
 	src/google_breakpad/processor/source_line_resolver_base.h \
 	src/google_breakpad/processor/source_line_resolver_interface.h \
 	src/google_breakpad/processor/stack_frame.h \
 	src/google_breakpad/processor/stack_frame_cpu.h \
+	src/google_breakpad/processor/stack_frame_symbolizer.h \
 	src/google_breakpad/processor/stackwalker.h \
 	src/google_breakpad/processor/symbol_supplier.h \
 	src/google_breakpad/processor/system_info.h \
 	src/processor/address_map-inl.h \
 	src/processor/address_map.h \
 	src/processor/basic_code_module.h \
 	src/processor/basic_code_modules.cc \
 	src/processor/basic_code_modules.h \
@@ -170,24 +173,24 @@ src_libbreakpad_a_SOURCES = \
 	src/processor/module_serializer.h \
 	src/processor/pathname_stripper.cc \
 	src/processor/pathname_stripper.h \
 	src/processor/postfix_evaluator-inl.h \
 	src/processor/postfix_evaluator.h \
 	src/processor/process_state.cc \
 	src/processor/range_map-inl.h \
 	src/processor/range_map.h \
-	src/processor/scoped_ptr.h \
 	src/processor/simple_serializer-inl.h \
 	src/processor/simple_serializer.h \
 	src/processor/simple_symbol_supplier.cc \
 	src/processor/simple_symbol_supplier.h \
 	src/processor/windows_frame_info.h \
 	src/processor/source_line_resolver_base_types.h \
 	src/processor/source_line_resolver_base.cc \
+	src/processor/stack_frame_symbolizer.cc \
 	src/processor/stackwalker.cc \
 	src/processor/stackwalker_amd64.cc \
 	src/processor/stackwalker_amd64.h \
 	src/processor/stackwalker_arm.cc \
 	src/processor/stackwalker_arm.h \
 	src/processor/stackwalker_ppc.cc \
 	src/processor/stackwalker_ppc.h \
 	src/processor/stackwalker_sparc.cc \
@@ -383,27 +386,31 @@ src_client_linux_linux_client_unittest_s
 	src/common/linux/memory_mapped_file.o \
 	src/common/linux/safe_readlink.o \
 	src/common/string_conversion.o \
 	$(PTHREAD_CFLAGS) $(PTHREAD_LIBS)
 if ANDROID_HOST
 src_client_linux_linux_client_unittest_shlib_SOURCES += \
 	src/common/android/breakpad_getcontext_unittest.cc
 src_client_linux_linux_client_unittest_shlib_LDFLAGS += \
-	-llog
+	-llog -lm
 endif
 
 src_client_linux_linux_client_unittest_shlib_DEPENDENCIES = \
 	src/client/linux/linux_dumper_unittest_helper \
 	src/client/linux/libbreakpad_client.a \
 	src/libbreakpad.a
 
 src_client_linux_linux_client_unittest_SOURCES =
 src_client_linux_linux_client_unittest_LDFLAGS = \
 	-Wl,-rpath,'$$ORIGIN'
+if ANDROID_HOST
+src_client_linux_linux_client_unittest_LDFLAGS += \
+        -llog
+endif
 
 src_client_linux_linux_client_unittest_LDADD = \
 	src/client/linux/linux_client_unittest_shlib
 
 src_client_linux_linux_client_unittest_DEPENDENCIES = \
 	src/client/linux/linux_client_unittest_shlib
 
 if !DISABLE_TOOLS
@@ -604,16 +611,17 @@ src_processor_exploitability_unittest_LD
 	src/processor/basic_code_modules.o \
 	src/processor/basic_source_line_resolver.o \
 	src/processor/call_stack.o \
 	src/processor/cfi_frame_info.o \
 	src/processor/logging.o \
 	src/processor/minidump.o \
 	src/processor/pathname_stripper.o \
 	src/processor/source_line_resolver_base.o \
+	src/processor/stack_frame_symbolizer.o \
 	src/processor/stackwalker.o \
 	src/processor/stackwalker_amd64.o \
 	src/processor/stackwalker_arm.o \
 	src/processor/stackwalker_ppc.o \
 	src/processor/stackwalker_sparc.o \
 	src/processor/stackwalker_x86.o \
 	src/processor/tokenize.o \
 	src/third_party/libdisasm/libdisasm.a \
@@ -691,16 +699,17 @@ src_processor_minidump_processor_unittes
 	src/processor/exploitability.o \
 	src/processor/exploitability_win.o \
 	src/processor/logging.o \
 	src/processor/minidump_processor.o \
 	src/processor/minidump.o \
 	src/processor/pathname_stripper.o \
 	src/processor/process_state.o \
 	src/processor/source_line_resolver_base.o \
+	src/processor/stack_frame_symbolizer.o \
 	src/processor/stackwalker.o \
 	src/processor/stackwalker_amd64.o \
 	src/processor/stackwalker_arm.o \
 	src/processor/stackwalker_ppc.o \
 	src/processor/stackwalker_sparc.o \
 	src/processor/stackwalker_x86.o \
 	src/processor/tokenize.o \
 	src/third_party/libdisasm/libdisasm.a \
@@ -814,16 +823,17 @@ src_processor_stackwalker_selftest_LDADD
 	src/processor/call_stack.o \
 	src/processor/disassembler_x86.o \
 	src/processor/exploitability.o \
 	src/processor/exploitability_win.o \
 	src/processor/logging.o \
 	src/processor/minidump.o \
 	src/processor/pathname_stripper.o \
 	src/processor/source_line_resolver_base.o \
+	src/processor/stack_frame_symbolizer.o \
 	src/processor/stackwalker.o \
 	src/processor/stackwalker_amd64.o \
 	src/processor/stackwalker_arm.o \
 	src/processor/stackwalker_ppc.o \
 	src/processor/stackwalker_sparc.o \
 	src/processor/stackwalker_x86.o \
 	src/processor/tokenize.o \
 	$(PTHREAD_CFLAGS) $(PTHREAD_LIBS)
@@ -933,16 +943,17 @@ src_processor_minidump_stackwalk_LDADD =
 	src/processor/exploitability_win.o \
 	src/processor/logging.o \
 	src/processor/minidump.o \
 	src/processor/minidump_processor.o \
 	src/processor/pathname_stripper.o \
 	src/processor/process_state.o \
 	src/processor/simple_symbol_supplier.o \
 	src/processor/source_line_resolver_base.o \
+	src/processor/stack_frame_symbolizer.o \
 	src/processor/stackwalker.o \
 	src/processor/stackwalker_amd64.o \
 	src/processor/stackwalker_arm.o \
 	src/processor/stackwalker_ppc.o \
 	src/processor/stackwalker_sparc.o \
 	src/processor/stackwalker_x86.o \
 	src/processor/tokenize.o \
 	src/third_party/libdisasm/libdisasm.a
@@ -1025,16 +1036,17 @@ EXTRA_DIST = \
 	src/common/mac/macho_utilities.cc \
 	src/common/mac/macho_utilities.h \
 	src/common/mac/macho_walker.cc \
 	src/common/mac/macho_walker.h \
 	src/common/mac/string_utilities.cc \
 	src/common/mac/string_utilities.h \
 	src/common/md5.cc \
 	src/common/md5.h \
+	src/common/scoped_ptr.h \
 	src/common/solaris/dump_symbols.cc \
 	src/common/solaris/dump_symbols.h \
 	src/common/solaris/file_id.cc \
 	src/common/solaris/file_id.h \
 	src/common/solaris/guid_creator.cc \
 	src/common/solaris/guid_creator.h \
 	src/common/solaris/message_output.h \
 	src/common/string_conversion.cc \
--- a/toolkit/crashreporter/google-breakpad/SVN-INFO
+++ b/toolkit/crashreporter/google-breakpad/SVN-INFO
@@ -1,11 +1,11 @@
 Path: ../google-breakpad-svn
 URL: https://google-breakpad.googlecode.com/svn/trunk
 Repository Root: https://google-breakpad.googlecode.com/svn
 Repository UUID: 4c0a9323-5329-0410-9bdc-e9ce6186880e
-Revision: 1064
+Revision: 1106
 Node Kind: directory
 Schedule: normal
-Last Changed Author: jimblandy
-Last Changed Rev: 1064
-Last Changed Date: 2012-10-05 18:07:48 -0400 (Fri, 05 Oct 2012)
+Last Changed Author: ted.mielczarek@gmail.com
+Last Changed Rev: 1106
+Last Changed Date: 2013-01-23 13:01:28 -0500 (Wed, 23 Jan 2013)
 
--- a/toolkit/crashreporter/google-breakpad/aclocal.m4
+++ b/toolkit/crashreporter/google-breakpad/aclocal.m4
@@ -1,65 +1,61 @@
-# generated automatically by aclocal 1.11.6 -*- Autoconf -*-
+# generated automatically by aclocal 1.11.1 -*- Autoconf -*-
 
 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
-# 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation,
-# Inc.
+# 2005, 2006, 2007, 2008, 2009  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.
 
 # This program is distributed in the hope that it will be useful,
 # but WITHOUT ANY WARRANTY, to the extent permitted by law; without
 # even the implied warranty of MERCHANTABILITY or FITNESS FOR A
 # PARTICULAR PURPOSE.
 
 m4_ifndef([AC_AUTOCONF_VERSION],
   [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
-m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.69],,
-[m4_warning([this file was generated for autoconf 2.69.
+m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.65],,
+[m4_warning([this file was generated for autoconf 2.65.
 You have another version of autoconf.  It may work, but is not guaranteed to.
 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'.])])
 
-# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008, 2011 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
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
 
-# serial 1
-
 # AM_AUTOMAKE_VERSION(VERSION)
 # ----------------------------
 # Automake X.Y traces this macro to ensure aclocal.m4 has been
 # generated from the m4 files accompanying Automake X.Y.
 # (This private macro should not be called outside this file.)
 AC_DEFUN([AM_AUTOMAKE_VERSION],
 [am__api_version='1.11'
 dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
 dnl require some minimum version.  Point them to the right macro.
-m4_if([$1], [1.11.6], [],
+m4_if([$1], [1.11.1], [],
       [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
 ])
 
 # _AM_AUTOCONF_VERSION(VERSION)
 # -----------------------------
 # aclocal traces this macro to find the Autoconf version.
 # This is a private macro too.  Using m4_define simplifies
 # the logic in aclocal, which can simply ignore this definition.
 m4_define([_AM_AUTOCONF_VERSION], [])
 
 # AM_SET_CURRENT_AUTOMAKE_VERSION
 # -------------------------------
 # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
 # This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
 AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
-[AM_AUTOMAKE_VERSION([1.11.6])dnl
+[AM_AUTOMAKE_VERSION([1.11.1])dnl
 m4_ifndef([AC_AUTOCONF_VERSION],
   [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
 _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
 
 # Figure out how to run the assembler.                      -*- Autoconf -*-
 
 # Copyright (C) 2001, 2003, 2004, 2005, 2006  Free Software Foundation, Inc.
 #
@@ -78,24 +74,22 @@ test "${CCAS+set}" = set || CCAS=$CC
 test "${CCASFLAGS+set}" = set || CCASFLAGS=$CFLAGS
 AC_ARG_VAR([CCAS],      [assembler compiler command (defaults to CC)])
 AC_ARG_VAR([CCASFLAGS], [assembler compiler flags (defaults to CFLAGS)])
 _AM_IF_OPTION([no-dependencies],, [_AM_DEPENDENCIES([CCAS])])dnl
 ])
 
 # AM_AUX_DIR_EXPAND                                         -*- Autoconf -*-
 
-# Copyright (C) 2001, 2003, 2005, 2011 Free Software Foundation, Inc.
+# Copyright (C) 2001, 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 1
-
 # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
 # $ac_aux_dir to `$srcdir/foo'.  In other projects, it is set to
 # `$srcdir', `$srcdir/..', or `$srcdir/../..'.
 #
 # Of course, Automake must honor this variable whenever it calls a
 # tool from the auxiliary directory.  The problem is that $srcdir (and
 # therefore $ac_aux_dir as well) can be either absolute or relative,
 # depending on how configure is run.  This is pretty annoying, since
@@ -167,24 +161,24 @@ else
   $1_FALSE=
 fi
 AC_CONFIG_COMMANDS_PRE(
 [if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
   AC_MSG_ERROR([[conditional "$1" was never defined.
 Usually this means the macro was only invoked conditionally.]])
 fi])])
 
-# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009,
-# 2010, 2011 Free Software Foundation, Inc.
+# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009
+# 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 12
+# serial 10
 
 # There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
 # written in clear, in which case automake, when reading aclocal.m4,
 # will think it sees a *use*, and therefore will trigger all it's
 # C support machinery.  Also note that it means that autoscan, seeing
 # CC etc. in the Makefile, will ask for an AC_PROG_CC use...
 
 
@@ -214,17 +208,16 @@ ifelse([$1], CC,   [depcc="$CC"   am_com
 AC_CACHE_CHECK([dependency style of $depcc],
                [am_cv_$1_dependencies_compiler_type],
 [if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
   # We make a subdir and do the tests there.  Otherwise we can end up
   # making bogus files that we don't know about and never remove.  For
   # instance it was reported that on HP-UX the gcc test will end up
   # making a dummy file named `D' -- because `-MD' means `put the output
   # in D'.
-  rm -rf conftest.dir
   mkdir conftest.dir
   # Copy depcomp to subdir because otherwise we won't find it if we're
   # using a relative directory.
   cp "$am_depcomp" conftest.dir
   cd conftest.dir
   # We will build objects and dependencies in a subdirectory because
   # it helps to detect inapplicable dependency modes.  For instance
   # both Tru64's cc and ICC support -MD to output dependencies as a
@@ -279,17 +272,17 @@ AC_CACHE_CHECK([dependency style of $dep
       # after this tag, mechanisms are not by side-effect, so they'll
       # only be used when explicitly requested
       if test "x$enable_dependency_tracking" = xyes; then
 	continue
       else
 	break
       fi
       ;;
-    msvc7 | msvc7msys | msvisualcpp | msvcmsys)
+    msvisualcpp | msvcmsys)
       # This compiler won't grok `-c -o', but also, the minuso test has
       # not run yet.  These depmodes are late enough in the game, and
       # so weak that their functioning should not be impacted.
       am__obj=conftest.${OBJEXT-o}
       am__minus_obj=
       ;;
     none) break ;;
     esac
@@ -344,23 +337,20 @@ AC_SUBST([DEPDIR], ["${am__leading_dot}d
 # ------------
 AC_DEFUN([AM_DEP_TRACK],
 [AC_ARG_ENABLE(dependency-tracking,
 [  --disable-dependency-tracking  speeds up one-time build
   --enable-dependency-tracking   do not reject slow dependency extractors])
 if test "x$enable_dependency_tracking" != xno; then
   am_depcomp="$ac_aux_dir/depcomp"
   AMDEPBACKSLASH='\'
-  am__nodep='_no'
 fi
 AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
 AC_SUBST([AMDEPBACKSLASH])dnl
 _AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
-AC_SUBST([am__nodep])dnl
-_AM_SUBST_NOTMAKE([am__nodep])dnl
 ])
 
 # Generate code to set up dependency tracking.              -*- Autoconf -*-
 
 # Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008
 # Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
@@ -584,25 +574,22 @@ for _am_header in $config_headers :; do
     $_am_arg | $_am_arg:* )
       break ;;
     * )
       _am_stamp_count=`expr $_am_stamp_count + 1` ;;
   esac
 done
 echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
 
-# Copyright (C) 2001, 2003, 2005, 2008, 2011 Free Software Foundation,
-# Inc.
+# Copyright (C) 2001, 2003, 2005, 2008  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 1
-
 # AM_PROG_INSTALL_SH
 # ------------------
 # Define $install_sh.
 AC_DEFUN([AM_PROG_INSTALL_SH],
 [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
 if test x"${install_sh}" != xset; then
   case $am_aux_dir in
   *\ * | *\	*)
@@ -759,25 +746,22 @@ fi
 if eval "$MISSING --run true"; then
   am_missing_run="$MISSING --run "
 else
   am_missing_run=
   AC_MSG_WARN([`missing' script is too old or missing])
 fi
 ])
 
-# Copyright (C) 2003, 2004, 2005, 2006, 2011 Free Software Foundation,
-# Inc.
+# Copyright (C) 2003, 2004, 2005, 2006  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 1
-
 # AM_PROG_MKDIR_P
 # ---------------
 # Check for `mkdir -p'.
 AC_DEFUN([AM_PROG_MKDIR_P],
 [AC_PREREQ([2.60])dnl
 AC_REQUIRE([AC_PROG_MKDIR_P])dnl
 dnl Automake 1.8 to 1.9.6 used to define mkdir_p.  We now use MKDIR_P,
 dnl while keeping a definition of mkdir_p for backward compatibility.
@@ -790,56 +774,53 @@ AC_SUBST([mkdir_p], ["$MKDIR_P"])dnl
 case $mkdir_p in
   [[\\/$]]* | ?:[[\\/]]*) ;;
   */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
 esac
 ])
 
 # Helper functions for option handling.                     -*- Autoconf -*-
 
-# Copyright (C) 2001, 2002, 2003, 2005, 2008, 2010 Free Software
-# Foundation, Inc.
+# Copyright (C) 2001, 2002, 2003, 2005, 2008  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 5
+# serial 4
 
 # _AM_MANGLE_OPTION(NAME)
 # -----------------------
 AC_DEFUN([_AM_MANGLE_OPTION],
 [[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
 
 # _AM_SET_OPTION(NAME)
-# --------------------
+# ------------------------------
 # Set option NAME.  Presently that only means defining a flag for this option.
 AC_DEFUN([_AM_SET_OPTION],
 [m4_define(_AM_MANGLE_OPTION([$1]), 1)])
 
 # _AM_SET_OPTIONS(OPTIONS)
-# ------------------------
+# ----------------------------------
 # OPTIONS is a space-separated list of Automake options.
 AC_DEFUN([_AM_SET_OPTIONS],
 [m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
 
 # _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
 # -------------------------------------------
 # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
 AC_DEFUN([_AM_IF_OPTION],
 [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
 
-# Copyright (C) 2001, 2003, 2005, 2011 Free Software Foundation, Inc.
+# Copyright (C) 2001, 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 1
-
 # AM_RUN_LOG(COMMAND)
 # -------------------
 # Run COMMAND, save the exit status in ac_status, and log it.
 # (This has been adapted from Autoconf's _AC_RUN_LOG macro.)
 AC_DEFUN([AM_RUN_LOG],
 [{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD
    ($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD
    ac_status=$?
@@ -906,24 +887,22 @@ then
    # Ok.
    :
 else
    AC_MSG_ERROR([newly created file is older than distributed files!
 Check your system clock])
 fi
 AC_MSG_RESULT(yes)])
 
-# Copyright (C) 2001, 2003, 2005, 2011 Free Software Foundation, Inc.
+# Copyright (C) 2001, 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 1
-
 # AM_PROG_INSTALL_STRIP
 # ---------------------
 # One issue with vendor `install' (even GNU) is that you can't
 # specify the program used to strip binaries.  This is especially
 # annoying in cross-compiling environments, where the build's strip
 # is unlikely to handle the host's binaries.
 # Fortunately install-sh will honor a STRIPPROG variable, so we
 # always use install-sh in `make install-strip', and initialize
@@ -936,38 +915,38 @@ AC_DEFUN([AM_PROG_INSTALL_STRIP],
 # will honor the `STRIP' environment variable to overrule this program.
 dnl Don't test for $cross_compiling = yes, because it might be `maybe'.
 if test "$cross_compiling" != no; then
   AC_CHECK_TOOL([STRIP], [strip], :)
 fi
 INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
 AC_SUBST([INSTALL_STRIP_PROGRAM])])
 
-# Copyright (C) 2006, 2008, 2010 Free Software Foundation, Inc.
+# Copyright (C) 2006, 2008  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 3
+# serial 2
 
 # _AM_SUBST_NOTMAKE(VARIABLE)
 # ---------------------------
 # Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
 # This macro is traced by Automake.
 AC_DEFUN([_AM_SUBST_NOTMAKE])
 
 # AM_SUBST_NOTMAKE(VARIABLE)
-# --------------------------
+# ---------------------------
 # Public sister of _AM_SUBST_NOTMAKE.
 AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
 
 # Check how to create a tarball.                            -*- Autoconf -*-
 
-# Copyright (C) 2004, 2005, 2012 Free Software Foundation, Inc.
+# Copyright (C) 2004, 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
 
 # _AM_PROG_TAR(FORMAT)
@@ -979,21 +958,20 @@ AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_
 # writing to stdout a FORMAT-tarball containing the directory
 # $tardir.
 #     tardir=directory && $(am__tar) > result.tar
 #
 # Substitute a variable $(am__untar) that extract such
 # a tarball read from stdin.
 #     $(am__untar) < result.tar
 AC_DEFUN([_AM_PROG_TAR],
-[# Always define AMTAR for backward compatibility.  Yes, it's still used
-# in the wild :-(  We should find a proper way to deprecate it ...
-AC_SUBST([AMTAR], ['$${TAR-tar}'])
+[# Always define AMTAR for backward compatibility.
+AM_MISSING_PROG([AMTAR], [tar])
 m4_if([$1], [v7],
-     [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'],
+     [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'],
      [m4_case([$1], [ustar],, [pax],,
               [m4_fatal([Unknown tar format])])
 AC_MSG_CHECKING([how to create a $1 tar archive])
 # Loop over all known methods to create a tar archive until one works.
 _am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
 _am_tools=${am_cv_prog_tar_$1-$_am_tools}
 # Do not fold the above two line into one, because Tru64 sh and
 # Solaris sh will not grok spaces in the rhs of `-'.
new file mode 100644
--- /dev/null
+++ b/toolkit/crashreporter/google-breakpad/android/google_breakpad/Android.mk
@@ -0,0 +1,104 @@
+# Copyright (c) 2012, Google Inc.
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+#     * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+#     * Redistributions in binary form must reproduce the above
+# copyright notice, this list of conditions and the following disclaimer
+# in the documentation and/or other materials provided with the
+# distribution.
+#     * Neither the name of Google Inc. nor the names of its
+# contributors may be used to endorse or promote products derived from
+# this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+# ndk-build module definition for the Google Breakpad client library
+#
+# To use this file, do the following:
+#
+#   1/ Include this file from your own Android.mk, either directly
+#      or with through the NDK's import-module function.
+#
+#   2/ Use the client static library in your project with:
+#
+#      LOCAL_STATIC_LIBRARIES += breakpad_client
+#
+#   3/ In your source code, include "src/client/linux/exception_handler.h"
+#      and use the Linux instructions to use it.
+#
+# This module works with either the STLport or GNU libstdc++, but you need
+# to select one in your Application.mk
+#
+
+# Sanity check. We can only build for ARM for now.
+ifneq (,$(filter-out armeabi armeabi-v7a x86,$(TARGET_ARCH_ABI)))
+$(error Sorry, Google Breakpad only works on Android ARM and x86 for now!)
+endif
+
+# The top Google Breakpad directory.
+# We assume this Android.mk to be under 'android/google_breakpad'
+
+LOCAL_PATH := $(call my-dir)/../..
+
+# Defube the client library module, as a simple static library that
+# exports the right include path / linker flags to its users.
+
+include $(CLEAR_VARS)
+
+LOCAL_MODULE := breakpad_client
+
+LOCAL_CPP_EXTENSION := .cc
+
+# Breakpad uses inline ARM assembly that requires the library
+# to be built in ARM mode. Otherwise, the build will fail with
+# cryptic assembler messages like:
+#   Compile++ thumb  : google_breakpad_client <= crash_generation_client.cc
+#   /tmp/cc8aMSoD.s: Assembler messages:
+#   /tmp/cc8aMSoD.s:132: Error: invalid immediate: 288 is out of range
+#   /tmp/cc8aMSoD.s:244: Error: invalid immediate: 296 is out of range
+LOCAL_ARM_MODE := arm
+
+# List of client source files, directly taken from Makefile.am
+LOCAL_SRC_FILES := \
+    src/client/linux/crash_generation/crash_generation_client.cc \
+    src/client/linux/handler/exception_handler.cc \
+    src/client/linux/handler/minidump_descriptor.cc \
+    src/client/linux/log/log.cc \
+    src/client/linux/minidump_writer/linux_dumper.cc \
+    src/client/linux/minidump_writer/linux_ptrace_dumper.cc \
+    src/client/linux/minidump_writer/minidump_writer.cc \
+    src/client/minidump_file_writer.cc \
+    src/common/android/breakpad_getcontext.S \
+    src/common/convert_UTF.c \
+    src/common/md5.cc src/common/string_conversion.cc \
+    src/common/linux/elfutils.cc \
+    src/common/linux/file_id.cc \
+    src/common/linux/guid_creator.cc \
+    src/common/linux/linux_libc_support.cc \
+    src/common/linux/memory_mapped_file.cc \
+    src/common/linux/safe_readlink.cc
+
+LOCAL_C_INCLUDES        := $(LOCAL_PATH)/src/common/android/include \
+                           $(LOCAL_PATH)/src
+
+LOCAL_EXPORT_C_INCLUDES := $(LOCAL_C_INCLUDES)
+LOCAL_EXPORT_LDLIBS     := -llog
+
+include $(BUILD_STATIC_LIBRARY)
+
+# Done.
\ No newline at end of file
--- a/toolkit/crashreporter/google-breakpad/android/run-checks.sh
+++ b/toolkit/crashreporter/google-breakpad/android/run-checks.sh
@@ -364,38 +364,43 @@ fail_panic "Could not rebuild Android bi
 if [ "$NO_DEVICE" ]; then
   ACTION="Building"
   # This is a trick to force the Makefile to ignore running the scripts.
   TESTS_ENVIRONMENT="TESTS_ENVIRONMENT=true"
 else
   ACTION="Running"
   TESTS_ENVIRONMENT=
 fi
-if [ "$ALL_TESTS" ]; then
-  dump "$ACTION full Android unit tests."
-else
-  dump "$ACTION Android client library unit tests."
-fi
 
 (
   PATH="$NDK_STANDALONE/bin:$PATH"
   run cd "$TMPDIR"/build-target &&
-  if [ -z "$ALL_TESTS" ]; then
-    # Reconfigure to avoid building the unit tests for the tools
-    # and processor, unless --all-tests is used.
+  # Reconfigure to only run the client unit test suite.
+  # This one should _never_ fail.
+  dump "$ACTION Android client library unit tests."
+  run2 "$PROGDIR"/../configure --prefix="$TMPTARGET" \
+                               --host="$GNU_CONFIG" \
+                               --disable-tools \
+                               --disable-processor &&
+  run make -j$NUM_JOBS check $TESTS_ENVIRONMENT || exit $?
+
+  if [ "$ALL_TESTS" ]; then
+    dump "$ACTION Tools and processor unit tests."
+    # Reconfigure to run the processor and tools tests.
+    # Most of these fail for now, so do not worry about it.
     run2 "$PROGDIR"/../configure --prefix="$TMPTARGET" \
-                                  --host="$GNU_CONFIG" \
-                                  --disable-tools \
-                                  --disable-processor
-  fi &&
-  run make -j$NUM_JOBS check $TESTS_ENVIRONMENT
+                                 --host="$GNU_CONFIG" &&
+    run make -j$NUM_JOBS check $TESTS_ENVIRONMENT
+    if [ $? != 0 ]; then
+      dump "Tools and processor unit tests failed as expected. \
+Use --verbose for results."
+    fi                           
+  fi
 )
-if [ -z "$NO_DEVICE" ] && verbosity_is_lower_than 2; then
-  dump "  Unit tests failed as expected. Use --verbose to see results."
-fi
+fail_panic "Client library unit test suite failed!"
 
 # Copy sources to temporary directory
 PROJECT_DIR=$TMPDIR/project
 dump "Copying test program sources to: $PROJECT_DIR"
 run cp -r "$TESTAPP_DIR" "$PROJECT_DIR" &&
 run rm -rf "$PROJECT_DIR/obj" &&
 run rm -rf "$PROJECT_DIR/libs"
 fail_panic "Could not copy test program sources to: $PROJECT_DIR"
new file mode 100644
--- /dev/null
+++ b/toolkit/crashreporter/google-breakpad/android/sample_app/jni/Android.mk
@@ -0,0 +1,44 @@
+# Copyright (c) 2012, Google Inc.
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+#     * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+#     * Redistributions in binary form must reproduce the above
+# copyright notice, this list of conditions and the following disclaimer
+# in the documentation and/or other materials provided with the
+# distribution.
+#     * Neither the name of Google Inc. nor the names of its
+# contributors may be used to endorse or promote products derived from
+# this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+LOCAL_PATH := $(call my-dir)
+
+include $(CLEAR_VARS)
+LOCAL_MODULE := test_google_breakpad
+LOCAL_SRC_FILES := test_breakpad.cpp
+LOCAL_STATIC_LIBRARIES += breakpad_client
+include $(BUILD_EXECUTABLE)
+
+# If NDK_MODULE_PATH is defined, import the module, otherwise do a direct
+# includes. This allows us to build in all scenarios easily.
+ifneq ($(NDK_MODULE_PATH),)
+  $(call import-module,google_breakpad)
+else
+  include $(LOCAL_PATH)/../../google_breakpad/Android.mk
+endif
--- a/toolkit/crashreporter/google-breakpad/configure
+++ b/toolkit/crashreporter/google-breakpad/configure
@@ -1,16 +1,18 @@
 #! /bin/sh
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.69 for breakpad 0.1.
+# Generated by GNU Autoconf 2.65 for breakpad 0.1.
 #
 # Report bugs to <google-breakpad-dev@googlegroups.com>.
 #
 #
-# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc.
+# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
+# 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation,
+# Inc.
 #
 #
 # This configure script is free software; the Free Software Foundation
 # gives unlimited permission to copy, distribute and modify it.
 ## -------------------- ##
 ## M4sh Initialization. ##
 ## -------------------- ##
 
@@ -84,17 +86,16 @@ fi
 # IFS
 # We need space, tab and new line, in precisely that order.  Quoting is
 # there to prevent editors from complaining about space-tab.
 # (If _AS_PATH_WALK were called with IFS unset, it would disable word
 # splitting by setting IFS to empty value.)
 IFS=" ""	$as_nl"
 
 # Find who we are.  Look in the path if we contain no directory separator.
-as_myself=
 case $0 in #((
   *[\\/]* ) as_myself=$0 ;;
   *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
 for as_dir in $PATH
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
@@ -129,41 +130,16 @@ PS4='+ '
 LC_ALL=C
 export LC_ALL
 LANGUAGE=C
 export LANGUAGE
 
 # CDPATH.
 (unset CDPATH) >/dev/null 2>&1 && unset CDPATH
 
-# Use a proper internal environment variable to ensure we don't fall
-  # into an infinite loop, continuously re-executing ourselves.
-  if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then
-    _as_can_reexec=no; export _as_can_reexec;
-    # We cannot yet assume a decent shell, so we have to provide a
-# neutralization value for shells without unset; and this also
-# works around shells that cannot unset nonexistent variables.
-# Preserve -v and -x to the replacement shell.
-BASH_ENV=/dev/null
-ENV=/dev/null
-(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
-case $- in # ((((
-  *v*x* | *x*v* ) as_opts=-vx ;;
-  *v* ) as_opts=-v ;;
-  *x* ) as_opts=-x ;;
-  * ) as_opts= ;;
-esac
-exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"}
-# Admittedly, this is quite paranoid, since all the known shells bail
-# out after a failed `exec'.
-$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2
-as_fn_exit 255
-  fi
-  # We don't want this to propagate to other subprocesses.
-          { _as_can_reexec=; unset _as_can_reexec;}
 if test "x$CONFIG_SHELL" = x; then
   as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then :
   emulate sh
   NULLCMD=:
   # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which
   # is contrary to our usage.  Disable this feature.
   alias -g '\${1+\"\$@\"}'='\"\$@\"'
   setopt NO_GLOB_SUBST
@@ -187,18 +163,17 @@ as_fn_success || { exitcode=1; echo as_f
 as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; }
 as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; }
 as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; }
 if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then :
 
 else
   exitcode=1; echo positional parameters were not saved.
 fi
-test x\$exitcode = x0 || exit 1
-test -x / || exit 1"
+test x\$exitcode = x0 || exit 1"
   as_suggested="  as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO
   as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO
   eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" &&
   test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1
 test \$(( 1 + 1 )) = 2 || exit 1"
   if (eval "$as_required") 2>/dev/null; then :
   as_have_required=yes
 else
@@ -233,35 +208,24 @@ done
 $as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } &&
 	      { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then :
   CONFIG_SHELL=$SHELL as_have_required=yes
 fi; }
 IFS=$as_save_IFS
 
 
       if test "x$CONFIG_SHELL" != x; then :
-  export CONFIG_SHELL
-             # We cannot yet assume a decent shell, so we have to provide a
-# neutralization value for shells without unset; and this also
-# works around shells that cannot unset nonexistent variables.
-# Preserve -v and -x to the replacement shell.
-BASH_ENV=/dev/null
-ENV=/dev/null
-(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
-case $- in # ((((
-  *v*x* | *x*v* ) as_opts=-vx ;;
-  *v* ) as_opts=-v ;;
-  *x* ) as_opts=-x ;;
-  * ) as_opts= ;;
-esac
-exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"}
-# Admittedly, this is quite paranoid, since all the known shells bail
-# out after a failed `exec'.
-$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2
-exit 255
+  # We cannot yet assume a decent shell, so we have to provide a
+	# neutralization value for shells without unset; and this also
+	# works around shells that cannot unset nonexistent variables.
+	BASH_ENV=/dev/null
+	ENV=/dev/null
+	(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
+	export CONFIG_SHELL
+	exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"}
 fi
 
     if test x$as_have_required = xno; then :
   $as_echo "$0: This script requires a shell more modern than all"
   $as_echo "$0: the shells that I found on your system."
   if test x${ZSH_VERSION+set} = xset ; then
     $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should"
     $as_echo "$0: be upgraded to zsh 4.3.4 or later."
@@ -350,28 +314,20 @@ as_fn_mkdir_p ()
 	  /^X\(\/\).*/{
 	    s//\1/
 	    q
 	  }
 	  s/.*/./; q'`
       test -d "$as_dir" && break
     done
     test -z "$as_dirs" || eval "mkdir $as_dirs"
-  } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir"
+  } || test -d "$as_dir" || as_fn_error "cannot create directory $as_dir"
 
 
 } # as_fn_mkdir_p
-
-# as_fn_executable_p FILE
-# -----------------------
-# Test if FILE is an executable regular file.
-as_fn_executable_p ()
-{
-  test -f "$1" && test -x "$1"
-} # as_fn_executable_p
 # as_fn_append VAR VALUE
 # ----------------------
 # Append the text in VALUE to the end of the definition contained in VAR. Take
 # advantage of any shell optimizations that allow amortized linear growth over
 # repeated appends, instead of the typical quadratic growth present in naive
 # implementations.
 if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then :
   eval 'as_fn_append ()
@@ -398,29 +354,29 @@ if (eval "test \$(( 1 + 1 )) = 2") 2>/de
 else
   as_fn_arith ()
   {
     as_val=`expr "$@" || test $? -eq 1`
   }
 fi # as_fn_arith
 
 
-# as_fn_error STATUS ERROR [LINENO LOG_FD]
-# ----------------------------------------
+# as_fn_error ERROR [LINENO LOG_FD]
+# ---------------------------------
 # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are
 # provided, also output the error to LOG_FD, referencing LINENO. Then exit the
-# script with STATUS, using 1 if that was 0.
+# script with status $?, using 1 if that was 0.
 as_fn_error ()
 {
-  as_status=$1; test $as_status -eq 0 && as_status=1
-  if test "$4"; then
-    as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
-    $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4
+  as_status=$?; test $as_status -eq 0 && as_status=1
+  if test "$3"; then
+    as_lineno=${as_lineno-"$2"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+    $as_echo "$as_me:${as_lineno-$LINENO}: error: $1" >&$3
   fi
-  $as_echo "$as_me: error: $2" >&2
+  $as_echo "$as_me: error: $1" >&2
   as_fn_exit $as_status
 } # as_fn_error
 
 if expr a : '\(a\)' >/dev/null 2>&1 &&
    test "X`expr 00001 : '.*\(...\)'`" = X001; then
   as_expr=expr
 else
   as_expr=false
@@ -483,20 +439,16 @@ as_cr_alnum=$as_cr_Letters$as_cr_digits
       :loop
       s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/
       t loop
       s/-\n.*//
     ' >$as_me.lineno &&
   chmod +x "$as_me.lineno" ||
     { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; }
 
-  # If we had to re-execute with $CONFIG_SHELL, we're ensured to have
-  # already done that, so ensure we don't try to do so again and fall
-  # in an infinite loop.  This has already happened in practice.
-  _as_can_reexec=no; export _as_can_reexec
   # Don't try to exec as it changes $[0], causing all sort of problems
   # (the dirname of $[0] is not the place where we might find the
   # original and so on.  Autoconf is especially sensitive to this).
   . "./$as_me.lineno"
   # Exit status is that of the last command.
   exit
 }
 
@@ -521,52 +473,72 @@ else
   mkdir conf$$.dir 2>/dev/null
 fi
 if (echo >conf$$.file) 2>/dev/null; then
   if ln -s conf$$.file conf$$ 2>/dev/null; then
     as_ln_s='ln -s'
     # ... but there are two gotchas:
     # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
     # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
-    # In both cases, we have to default to `cp -pR'.
+    # In both cases, we have to default to `cp -p'.
     ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
-      as_ln_s='cp -pR'
+      as_ln_s='cp -p'
   elif ln conf$$.file conf$$ 2>/dev/null; then
     as_ln_s=ln
   else
-    as_ln_s='cp -pR'
+    as_ln_s='cp -p'
   fi
 else
-  as_ln_s='cp -pR'
+  as_ln_s='cp -p'
 fi
 rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
 rmdir conf$$.dir 2>/dev/null
 
 if mkdir -p . 2>/dev/null; then
   as_mkdir_p='mkdir -p "$as_dir"'
 else
   test -d ./-p && rmdir ./-p
   as_mkdir_p=false
 fi
 
-as_test_x='test -x'
-as_executable_p=as_fn_executable_p
+if test -x / >/dev/null 2>&1; then
+  as_test_x='test -x'
+else
+  if ls -dL / >/dev/null 2>&1; then
+    as_ls_L_option=L
+  else
+    as_ls_L_option=
+  fi
+  as_test_x='
+    eval sh -c '\''
+      if test -d "$1"; then
+	test -d "$1/.";
+      else
+	case $1 in #(
+	-*)set "./$1";;
+	esac;
+	case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #((
+	???[sx]*):;;*)false;;esac;fi
+    '\'' sh
+  '
+fi
+as_executable_p=$as_test_x
 
 # Sed expression to map a string onto a valid CPP name.
 as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
 
 # Sed expression to map a string onto a valid variable name.
 as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
 
 
 test -n "$DJDIR" || exec 7<&0 </dev/null
 exec 6>&1
 
 # Name of the host.
-# hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status,
+# hostname on some systems (SVR3.2, Linux) returns a bogus exit status,
 # so uname gets run too.
 ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
 
 #
 # Initializations.
 #
 ac_default_prefix=/usr/local
 ac_clean_files=
@@ -655,17 +627,16 @@ CPP
 am__fastdepCCAS_FALSE
 am__fastdepCCAS_TRUE
 CCASDEPMODE
 CCASFLAGS
 CCAS
 am__fastdepCC_FALSE
 am__fastdepCC_TRUE
 CCDEPMODE
-am__nodep
 AMDEPBACKSLASH
 AMDEP_FALSE
 AMDEP_TRUE
 am__quote
 am__include
 DEPDIR
 OBJEXT
 EXEEXT
@@ -823,19 +794,18 @@ do
   # If the previous option needs an argument, assign it.
   if test -n "$ac_prev"; then
     eval $ac_prev=\$ac_option
     ac_prev=
     continue
   fi
 
   case $ac_option in
-  *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;;
-  *=)   ac_optarg= ;;
-  *)    ac_optarg=yes ;;
+  *=*)	ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;;
+  *)	ac_optarg=yes ;;
   esac
 
   # Accept the important Cygnus configure options, so we can diagnose typos.
 
   case $ac_dashdash$ac_option in
   --)
     ac_dashdash=yes ;;
 
@@ -870,17 +840,17 @@ do
   -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \
   | --dataroot=* | --dataroo=* | --dataro=* | --datar=*)
     datarootdir=$ac_optarg ;;
 
   -disable-* | --disable-*)
     ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
     # Reject names that are not valid shell variable names.
     expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
-      as_fn_error $? "invalid feature name: $ac_useropt"
+      as_fn_error "invalid feature name: $ac_useropt"
     ac_useropt_orig=$ac_useropt
     ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
     case $ac_user_opts in
       *"
 "enable_$ac_useropt"
 "*) ;;
       *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig"
 	 ac_unrecognized_sep=', ';;
@@ -896,17 +866,17 @@ do
     ac_prev=dvidir ;;
   -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*)
     dvidir=$ac_optarg ;;
 
   -enable-* | --enable-*)
     ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
     # Reject names that are not valid shell variable names.
     expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
-      as_fn_error $? "invalid feature name: $ac_useropt"
+      as_fn_error "invalid feature name: $ac_useropt"
     ac_useropt_orig=$ac_useropt
     ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
     case $ac_user_opts in
       *"
 "enable_$ac_useropt"
 "*) ;;
       *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig"
 	 ac_unrecognized_sep=', ';;
@@ -1100,33 +1070,33 @@ do
 
   -version | --version | --versio | --versi | --vers | -V)
     ac_init_version=: ;;
 
   -with-* | --with-*)
     ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
     # Reject names that are not valid shell variable names.
     expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
-      as_fn_error $? "invalid package name: $ac_useropt"
+      as_fn_error "invalid package name: $ac_useropt"
     ac_useropt_orig=$ac_useropt
     ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
     case $ac_user_opts in
       *"
 "with_$ac_useropt"
 "*) ;;
       *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig"
 	 ac_unrecognized_sep=', ';;
     esac
     eval with_$ac_useropt=\$ac_optarg ;;
 
   -without-* | --without-*)
     ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'`
     # Reject names that are not valid shell variable names.
     expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
-      as_fn_error $? "invalid package name: $ac_useropt"
+      as_fn_error "invalid package name: $ac_useropt"
     ac_useropt_orig=$ac_useropt
     ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
     case $ac_user_opts in
       *"
 "with_$ac_useropt"
 "*) ;;
       *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig"
 	 ac_unrecognized_sep=', ';;
@@ -1146,50 +1116,50 @@ do
 
   -x-libraries | --x-libraries | --x-librarie | --x-librari \
   | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
     ac_prev=x_libraries ;;
   -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
   | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
     x_libraries=$ac_optarg ;;
 
-  -*) as_fn_error $? "unrecognized option: \`$ac_option'
-Try \`$0 --help' for more information"
+  -*) as_fn_error "unrecognized option: \`$ac_option'
+Try \`$0 --help' for more information."
     ;;
 
   *=*)
     ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
     # Reject names that are not valid shell variable names.
     case $ac_envvar in #(
       '' | [0-9]* | *[!_$as_cr_alnum]* )
-      as_fn_error $? "invalid variable name: \`$ac_envvar'" ;;
+      as_fn_error "invalid variable name: \`$ac_envvar'" ;;
     esac
     eval $ac_envvar=\$ac_optarg
     export $ac_envvar ;;
 
   *)
     # FIXME: should be removed in autoconf 3.0.
     $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2
     expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
       $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2
-    : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}"
+    : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}
     ;;
 
   esac
 done
 
 if test -n "$ac_prev"; then
   ac_option=--`echo $ac_prev | sed 's/_/-/g'`
-  as_fn_error $? "missing argument to $ac_option"
+  as_fn_error "missing argument to $ac_option"
 fi
 
 if test -n "$ac_unrecognized_opts"; then
   case $enable_option_checking in
     no) ;;
-    fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;;
+    fatal) as_fn_error "unrecognized options: $ac_unrecognized_opts" ;;
     *)     $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;;
   esac
 fi
 
 # Check all directory arguments for consistency.
 for ac_var in	exec_prefix prefix bindir sbindir libexecdir datarootdir \
 		datadir sysconfdir sharedstatedir localstatedir includedir \
 		oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
@@ -1202,47 +1172,49 @@ do
       ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'`
       eval $ac_var=\$ac_val;;
   esac
   # Be sure to have absolute directory names.
   case $ac_val in
     [\\/$]* | ?:[\\/]* )  continue;;
     NONE | '' ) case $ac_var in *prefix ) continue;; esac;;
   esac
-  as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val"
+  as_fn_error "expected an absolute directory name for --$ac_var: $ac_val"
 done
 
 # There might be people who depend on the old broken behavior: `$host'
 # used to hold the argument of --host etc.
 # FIXME: To remove some day.
 build=$build_alias
 host=$host_alias
 target=$target_alias
 
 # FIXME: To remove some day.
 if test "x$host_alias" != x; then
   if test "x$build_alias" = x; then
     cross_compiling=maybe
+    $as_echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host.
+    If a cross compiler is detected then cross compile mode will be used." >&2
   elif test "x$build_alias" != "x$host_alias"; then
     cross_compiling=yes
   fi
 fi
 
 ac_tool_prefix=
 test -n "$host_alias" && ac_tool_prefix=$host_alias-
 
 test "$silent" = yes && exec 6>/dev/null
 
 
 ac_pwd=`pwd` && test -n "$ac_pwd" &&
 ac_ls_di=`ls -di .` &&
 ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` ||
-  as_fn_error $? "working directory cannot be determined"
+  as_fn_error "working directory cannot be determined"
 test "X$ac_ls_di" = "X$ac_pwd_ls_di" ||
-  as_fn_error $? "pwd does not report name of working directory"
+  as_fn_error "pwd does not report name of working directory"
 
 
 # Find the source files, if location was not specified.
 if test -z "$srcdir"; then
   ac_srcdir_defaulted=yes
   # Try the directory containing this script, then the parent directory.
   ac_confdir=`$as_dirname -- "$as_myself" ||
 $as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
@@ -1271,21 +1243,21 @@ if test -z "$srcdir"; then
   if test ! -r "$srcdir/$ac_unique_file"; then
     srcdir=..
   fi
 else
   ac_srcdir_defaulted=no
 fi
 if test ! -r "$srcdir/$ac_unique_file"; then
   test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .."
-  as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir"
+  as_fn_error "cannot find sources ($ac_unique_file) in $srcdir"
 fi
 ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work"
 ac_abs_confdir=`(
-	cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg"
+	cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error "$ac_msg"
 	pwd)`
 # When building in place, set srcdir=.
 if test "$ac_abs_confdir" = "$ac_pwd"; then
   srcdir=.
 fi
 # Remove unnecessary trailing slashes from srcdir.
 # Double slashes in file names in object file debugging info
 # mess up M-x gdb in Emacs.
@@ -1315,17 +1287,17 @@ VAR=VALUE.  See below for descriptions o
 
 Defaults for the options are specified in brackets.
 
 Configuration:
   -h, --help              display this help and exit
       --help=short        display options specific to this package
       --help=recursive    display the short help of all the included packages
   -V, --version           display version information and exit
-  -q, --quiet, --silent   do not print \`checking ...' messages
+  -q, --quiet, --silent   do not print \`checking...' messages
       --cache-file=FILE   cache test results in FILE [disabled]
   -C, --config-cache      alias for \`--cache-file=config.cache'
   -n, --no-create         do not create output files
       --srcdir=DIR        find the sources in DIR [configure dir or \`..']
 
 Installation directories:
   --prefix=PREFIX         install architecture-independent files in PREFIX
                           [$ac_default_prefix]
@@ -1468,19 +1440,19 @@ ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_
     cd "$ac_pwd" || { ac_status=$?; break; }
   done
 fi
 
 test -n "$ac_init_help" && exit $ac_status
 if $ac_init_version; then
   cat <<\_ACEOF
 breakpad configure 0.1
-generated by GNU Autoconf 2.69
-
-Copyright (C) 2012 Free Software Foundation, Inc.
+generated by GNU Autoconf 2.65
+
+Copyright (C) 2009 Free Software Foundation, Inc.
 This configure script is free software; the Free Software Foundation
 gives unlimited permission to copy, distribute and modify it.
 _ACEOF
   exit
 fi
 
 ## ------------------------ ##
 ## Autoconf initialization. ##
@@ -1514,17 +1486,17 @@ eval ac_try_echo="\"\$as_me:${as_lineno-
        } && test -s conftest.$ac_objext; then :
   ac_retval=0
 else
   $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	ac_retval=1
 fi
-  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+  eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
   as_fn_set_status $ac_retval
 
 } # ac_fn_c_try_compile
 
 # ac_fn_c_try_cpp LINENO
 # ----------------------
 # Try to preprocess conftest.$ac_ext, and return whether this succeeded.
 ac_fn_c_try_cpp ()
@@ -1540,28 +1512,28 @@ eval ac_try_echo="\"\$as_me:${as_lineno-
   (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err
   ac_status=$?
   if test -s conftest.err; then
     grep -v '^ *+' conftest.err >conftest.er1
     cat conftest.er1 >&5
     mv -f conftest.er1 conftest.err
   fi
   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; } > conftest.i && {
+  test $ac_status = 0; } >/dev/null && {
 	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
 	 test ! -s conftest.err
        }; then :
   ac_retval=0
 else
   $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
     ac_retval=1
 fi
-  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+  eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
   as_fn_set_status $ac_retval
 
 } # ac_fn_c_try_cpp
 
 # ac_fn_cxx_try_compile LINENO
 # ----------------------------
 # Try to compile conftest.$ac_ext, and return whether this succeeded.
 ac_fn_cxx_try_compile ()
@@ -1589,17 +1561,17 @@ eval ac_try_echo="\"\$as_me:${as_lineno-
        } && test -s conftest.$ac_objext; then :
   ac_retval=0
 else
   $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	ac_retval=1
 fi
-  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+  eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
   as_fn_set_status $ac_retval
 
 } # ac_fn_cxx_try_compile
 
 # ac_fn_c_try_run LINENO
 # ----------------------
 # Try to link conftest.$ac_ext, and return whether this succeeded. Assumes
 # that executables *can* be run.
@@ -1631,17 +1603,17 @@ eval ac_try_echo="\"\$as_me:${as_lineno-
 else
   $as_echo "$as_me: program exited with status $ac_status" >&5
        $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
        ac_retval=$ac_status
 fi
   rm -rf conftest.dSYM conftest_ipa8_conftest.oo
-  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+  eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
   as_fn_set_status $ac_retval
 
 } # ac_fn_c_try_run
 
 # ac_fn_c_try_link LINENO
 # -----------------------
 # Try to link conftest.$ac_ext, and return whether this succeeded.
 ac_fn_c_try_link ()
@@ -1663,47 +1635,47 @@ eval ac_try_echo="\"\$as_me:${as_lineno-
     mv -f conftest.er1 conftest.err
   fi
   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
   test $ac_status = 0; } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
        } && test -s conftest$ac_exeext && {
 	 test "$cross_compiling" = yes ||
-	 test -x conftest$ac_exeext
+	 $as_test_x conftest$ac_exeext
        }; then :
   ac_retval=0
 else
   $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	ac_retval=1
 fi
   # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information
   # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would
   # interfere with the next link command; also delete a directory that is
   # left behind by Apple's compiler.  We do this before executing the actions.
   rm -rf conftest.dSYM conftest_ipa8_conftest.oo
-  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+  eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
   as_fn_set_status $ac_retval
 
 } # ac_fn_c_try_link
 
 # ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES
 # -------------------------------------------------------
 # Tests whether HEADER exists, giving a warning if it cannot be compiled using
 # the include files in INCLUDES and setting the cache variable VAR
 # accordingly.
 ac_fn_c_check_header_mongrel ()
 {
   as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
-  if eval \${$3+:} false; then :
+  if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then :
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
 $as_echo_n "checking for $2... " >&6; }
-if eval \${$3+:} false; then :
+if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then :
   $as_echo_n "(cached) " >&6
 fi
 eval ac_res=\$$3
 	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
 $as_echo "$ac_res" >&6; }
 else
   # Is the header compilable?
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5
@@ -1729,17 +1701,17 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_
 /* end confdefs.h.  */
 #include <$2>
 _ACEOF
 if ac_fn_c_try_cpp "$LINENO"; then :
   ac_header_preproc=yes
 else
   ac_header_preproc=no
 fi
-rm -f conftest.err conftest.i conftest.$ac_ext
+rm -f conftest.err conftest.$ac_ext
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5
 $as_echo "$ac_header_preproc" >&6; }
 
 # So?  What about this header?
 case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #((
   yes:no: )
     { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5
 $as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;}
@@ -1752,47 +1724,49 @@ case $ac_header_compiler:$ac_header_prep
     { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2:     check for missing prerequisite headers?" >&5
 $as_echo "$as_me: WARNING: $2:     check for missing prerequisite headers?" >&2;}
     { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5
 $as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;}
     { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2:     section \"Present But Cannot Be Compiled\"" >&5
 $as_echo "$as_me: WARNING: $2:     section \"Present But Cannot Be Compiled\"" >&2;}
     { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5
 $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;}
-( $as_echo "## --------------------------------------------------- ##
+( cat <<\_ASBOX
+## --------------------------------------------------- ##
 ## Report this to google-breakpad-dev@googlegroups.com ##
-## --------------------------------------------------- ##"
+## --------------------------------------------------- ##
+_ASBOX
      ) | sed "s/^/$as_me: WARNING:     /" >&2
     ;;
 esac
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
 $as_echo_n "checking for $2... " >&6; }
-if eval \${$3+:} false; then :
+if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then :
   $as_echo_n "(cached) " >&6
 else
   eval "$3=\$ac_header_compiler"
 fi
 eval ac_res=\$$3
 	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
 $as_echo "$ac_res" >&6; }
 fi
-  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+  eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
 
 } # ac_fn_c_check_header_mongrel
 
 # ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES
 # -------------------------------------------------------
 # Tests whether HEADER exists and can be compiled using the include files in
 # INCLUDES, setting the cache variable VAR accordingly.
 ac_fn_c_check_header_compile ()
 {
   as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
 $as_echo_n "checking for $2... " >&6; }
-if eval \${$3+:} false; then :
+if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then :
   $as_echo_n "(cached) " >&6
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 $4
 #include <$2>
 _ACEOF
 if ac_fn_c_try_compile "$LINENO"; then :
@@ -1800,25 +1774,25 @@ if ac_fn_c_try_compile "$LINENO"; then :
 else
   eval "$3=no"
 fi
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
 eval ac_res=\$$3
 	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
 $as_echo "$ac_res" >&6; }
-  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+  eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
 
 } # ac_fn_c_check_header_compile
 cat >config.log <<_ACEOF
 This file contains any messages produced by compilers while
 running configure, to aid debugging if configure makes a mistake.
 
 It was created by breakpad $as_me 0.1, which was
-generated by GNU Autoconf 2.69.  Invocation command line was
+generated by GNU Autoconf 2.65.  Invocation command line was
 
   $ $0 $@
 
 _ACEOF
 exec 5>>config.log
 {
 cat <<_ASUNAME
 ## --------- ##
@@ -1918,19 +1892,21 @@ done
 # would cause problems or look ugly.
 # WARNING: Use '\'' to represent an apostrophe within the trap.
 # WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug.
 trap 'exit_status=$?
   # Save into config.log some information that might help in debugging.
   {
     echo
 
-    $as_echo "## ---------------- ##
+    cat <<\_ASBOX
+## ---------------- ##
 ## Cache variables. ##
-## ---------------- ##"
+## ---------------- ##
+_ASBOX
     echo
     # The following way of writing the cache mishandles newlines in values,
 (
   for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do
     eval ac_val=\$$ac_var
     case $ac_val in #(
     *${as_nl}*)
       case $ac_var in #(
@@ -1954,50 +1930,56 @@ trap 'exit_status=$?
     *)
       sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
       ;;
     esac |
     sort
 )
     echo
 
-    $as_echo "## ----------------- ##
+    cat <<\_ASBOX
+## ----------------- ##
 ## Output variables. ##
-## ----------------- ##"
+## ----------------- ##
+_ASBOX
     echo
     for ac_var in $ac_subst_vars
     do
       eval ac_val=\$$ac_var
       case $ac_val in
       *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
       esac
       $as_echo "$ac_var='\''$ac_val'\''"
     done | sort
     echo
 
     if test -n "$ac_subst_files"; then
-      $as_echo "## ------------------- ##
+      cat <<\_ASBOX
+## ------------------- ##
 ## File substitutions. ##
-## ------------------- ##"
+## ------------------- ##
+_ASBOX
       echo
       for ac_var in $ac_subst_files
       do
 	eval ac_val=\$$ac_var
 	case $ac_val in
 	*\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
 	esac
 	$as_echo "$ac_var='\''$ac_val'\''"
       done | sort
       echo
     fi
 
     if test -s confdefs.h; then
-      $as_echo "## ----------- ##
+      cat <<\_ASBOX
+## ----------- ##
 ## confdefs.h. ##
-## ----------- ##"
+## ----------- ##
+_ASBOX
       echo
       cat confdefs.h
       echo
     fi
     test "$ac_signal" != 0 &&
       $as_echo "$as_me: caught signal $ac_signal"
     $as_echo "$as_me: exit $exit_status"
   } >&5
@@ -2042,41 +2024,32 @@ cat >>confdefs.h <<_ACEOF
 _ACEOF
 
 
 # Let the site file select an alternate cache file if it wants to.
 # Prefer an explicitly selected file to automatically selected ones.
 ac_site_file1=NONE
 ac_site_file2=NONE
 if test -n "$CONFIG_SITE"; then
-  # We do not want a PATH search for config.site.
-  case $CONFIG_SITE in #((
-    -*)  ac_site_file1=./$CONFIG_SITE;;
-    */*) ac_site_file1=$CONFIG_SITE;;
-    *)   ac_site_file1=./$CONFIG_SITE;;
-  esac
+  ac_site_file1=$CONFIG_SITE
 elif test "x$prefix" != xNONE; then
   ac_site_file1=$prefix/share/config.site
   ac_site_file2=$prefix/etc/config.site
 else
   ac_site_file1=$ac_default_prefix/share/config.site
   ac_site_file2=$ac_default_prefix/etc/config.site
 fi
 for ac_site_file in "$ac_site_file1" "$ac_site_file2"
 do
   test "x$ac_site_file" = xNONE && continue
   if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then
     { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5
 $as_echo "$as_me: loading site script $ac_site_file" >&6;}
     sed 's/^/| /' "$ac_site_file" >&5
-    . "$ac_site_file" \
-      || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error $? "failed to load site script $ac_site_file
-See \`config.log' for more details" "$LINENO" 5; }
+    . "$ac_site_file"
   fi
 done
 
 if test -r "$cache_file"; then
   # Some versions of bash will fail to source /dev/null (special files
   # actually), so we avoid doing that.  DJGPP emulates it as a regular file.
   if test /dev/null != "$cache_file" && test -f "$cache_file"; then
     { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5
@@ -2142,83 +2115,77 @@ for ac_var in $ac_precious_vars; do
     esac
   fi
 done
 if $ac_cache_corrupted; then
   { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
   { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5
 $as_echo "$as_me: error: changes in the environment can compromise the build" >&2;}
-  as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5
+  as_fn_error "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5
 fi
 ## -------------------- ##
 ## Main body of script. ##
 ## -------------------- ##
 
 ac_ext=c
 ac_cpp='$CPP $CPPFLAGS'
 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
 ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
 
 
 ac_aux_dir=
 for ac_dir in autotools "$srcdir"/autotools; do
-  if test -f "$ac_dir/install-sh"; then
-    ac_aux_dir=$ac_dir
-    ac_install_sh="$ac_aux_dir/install-sh -c"
-    break
-  elif test -f "$ac_dir/install.sh"; then
-    ac_aux_dir=$ac_dir
-    ac_install_sh="$ac_aux_dir/install.sh -c"
-    break
-  elif test -f "$ac_dir/shtool"; then
-    ac_aux_dir=$ac_dir
-    ac_install_sh="$ac_aux_dir/shtool install -c"
-    break
-  fi
+  for ac_t in install-sh install.sh shtool; do
+    if test -f "$ac_dir/$ac_t"; then
+      ac_aux_dir=$ac_dir
+      ac_install_sh="$ac_aux_dir/$ac_t -c"
+      break 2
+    fi
+  done
 done
 if test -z "$ac_aux_dir"; then
-  as_fn_error $? "cannot find install-sh, install.sh, or shtool in autotools \"$srcdir\"/autotools" "$LINENO" 5
+  as_fn_error "cannot find install-sh, install.sh, or shtool in autotools \"$srcdir\"/autotools" "$LINENO" 5
 fi
 
 # These three variables are undocumented and unsupported,
 # and are intended to be withdrawn in a future Autoconf release.
 # They can cause serious problems if a builder's source tree is in a directory
 # whose full name contains unusual characters.
 ac_config_guess="$SHELL $ac_aux_dir/config.guess"  # Please don't use this var.
 ac_config_sub="$SHELL $ac_aux_dir/config.sub"  # Please don't use this var.
 ac_configure="$SHELL $ac_aux_dir/configure"  # Please don't use this var.
 
 
 
 # Make sure we can run config.sub.
 $SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 ||
-  as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5
+  as_fn_error "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5
 $as_echo_n "checking build system type... " >&6; }
-if ${ac_cv_build+:} false; then :
+if test "${ac_cv_build+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   ac_build_alias=$build_alias
 test "x$ac_build_alias" = x &&
   ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"`
 test "x$ac_build_alias" = x &&
-  as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5
+  as_fn_error "cannot guess build type; you must specify one" "$LINENO" 5
 ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` ||
-  as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5
+  as_fn_error "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5
 
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5
 $as_echo "$ac_cv_build" >&6; }
 case $ac_cv_build in
 *-*-*) ;;
-*) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;;
+*) as_fn_error "invalid value of canonical build" "$LINENO" 5;;
 esac
 build=$ac_cv_build
 ac_save_IFS=$IFS; IFS='-'
 set x $ac_cv_build
 shift
 build_cpu=$1
 build_vendor=$2
 shift; shift
@@ -2226,32 +2193,32 @@ shift; shift
 # except with old shells:
 build_os=$*
 IFS=$ac_save_IFS
 case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac
 
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5
 $as_echo_n "checking host system type... " >&6; }
-if ${ac_cv_host+:} false; then :
+if test "${ac_cv_host+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   if test "x$host_alias" = x; then
   ac_cv_host=$ac_cv_build
 else
   ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` ||
-    as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5
+    as_fn_error "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5
 fi
 
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5
 $as_echo "$ac_cv_host" >&6; }
 case $ac_cv_host in
 *-*-*) ;;
-*) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;;
+*) as_fn_error "invalid value of canonical host" "$LINENO" 5;;
 esac
 host=$ac_cv_host
 ac_save_IFS=$IFS; IFS='-'
 set x $ac_cv_host
 shift
 host_cpu=$1
 host_vendor=$2
 shift; shift
@@ -2277,17 +2244,17 @@ am__api_version='1.11'
 # AFS /usr/afsws/bin/install, which mishandles nonexistent args
 # 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.
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5
 $as_echo_n "checking for a BSD-compatible install... " >&6; }
 if test -z "$INSTALL"; then
-if ${ac_cv_path_install+:} false; then :
+if test "${ac_cv_path_install+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
 for as_dir in $PATH
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     # Account for people who put trailing slashes in PATH elements.
@@ -2297,17 +2264,17 @@ case $as_dir/ in #((
   ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \
   /usr/ucb/* ) ;;
   *)
     # OSF1 and SCO ODT 3.0 have their own names for install.
     # Don't use installbsd from OSF since it installs stuff as root
     # by default.
     for ac_prog in ginstall scoinst install; do
       for ac_exec_ext in '' $ac_executable_extensions; do
-	if as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then
+	if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then
 	  if test $ac_prog = install &&
 	    grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
 	    # AIX install.  It has an incompatible calling convention.
 	    :
 	  elif test $ac_prog = install &&
 	    grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
 	    # program-specific install script used by HP pwplus--don't use.
 	    :
@@ -2364,21 +2331,21 @@ test -z "$INSTALL_DATA" && INSTALL_DATA=
 sleep 1
 echo timestamp > conftest.file
 # Reject unsafe characters in $srcdir or the absolute working directory
 # name.  Accept space and tab only in the latter.
 am_lf='
 '
 case `pwd` in
   *[\\\"\#\$\&\'\`$am_lf]*)
-    as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;;
+    as_fn_error "unsafe absolute working directory name" "$LINENO" 5;;
 esac
 case $srcdir in
   *[\\\"\#\$\&\'\`$am_lf\ \	]*)
-    as_fn_error $? "unsafe srcdir value: \`$srcdir'" "$LINENO" 5;;
+    as_fn_error "unsafe srcdir value: \`$srcdir'" "$LINENO" 5;;
 esac
 
 # Do `set' in a subshell so we don't clobber the current shell's
 # arguments.  Must try -L first in case configure is actually a
 # symlink; some systems play weird games with the mod time of symlinks
 # (eg FreeBSD returns the mod time of the symlink's containing
 # directory).
 if (
@@ -2390,27 +2357,27 @@ if (
    rm -f conftest.file
    if test "$*" != "X $srcdir/configure conftest.file" \
       && test "$*" != "X conftest.file $srcdir/configure"; then
 
       # If neither matched, then we have a broken ls.  This can happen
       # if, for instance, CONFIG_SHELL is bash and it inherits a
       # broken ls alias from the environment.  This has actually
       # happened.  Such a system could not be considered "sane".
-      as_fn_error $? "ls -t appears to fail.  Make sure there is not a broken
+      as_fn_error "ls -t appears to fail.  Make sure there is not a broken
 alias in your environment" "$LINENO" 5
    fi
 
    test "$2" = conftest.file
    )
 then
    # Ok.
    :
 else
-   as_fn_error $? "newly created file is older than distributed files!
+   as_fn_error "newly created file is older than distributed files!
 Check your system clock" "$LINENO" 5
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
 $as_echo "yes" >&6; }
 test "$program_prefix" != NONE &&
   program_transform_name="s&^&$program_prefix&;$program_transform_name"
 # Use a double $ so make ignores it.
 test "$program_suffix" != NONE &&
@@ -2454,29 +2421,29 @@ fi
 # tool to use in cross-compilation environments, therefore Automake
 # will honor the `STRIP' environment variable to overrule this program.
 if test "$cross_compiling" != no; then
   if test -n "$ac_tool_prefix"; then
   # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
 set dummy ${ac_tool_prefix}strip; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_STRIP+:} false; then :
+if test "${ac_cv_prog_STRIP+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$STRIP"; then
   ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
 else
 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
 for as_dir in $PATH
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_prog_STRIP="${ac_tool_prefix}strip"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
   done
 IFS=$as_save_IFS
 
@@ -2494,29 +2461,29 @@ fi
 
 fi
 if test -z "$ac_cv_prog_STRIP"; then
   ac_ct_STRIP=$STRIP
   # Extract the first word of "strip", so it can be a program name with args.
 set dummy strip; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_STRIP+:} false; then :
+if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$ac_ct_STRIP"; then
   ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test.
 else
 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
 for as_dir in $PATH
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_prog_ac_ct_STRIP="strip"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
   done
 IFS=$as_save_IFS
 
@@ -2547,27 +2514,27 @@ else
 fi
 
 fi
 INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5
 $as_echo_n "checking for a thread-safe mkdir -p... " >&6; }
 if test -z "$MKDIR_P"; then
-  if ${ac_cv_path_mkdir+:} false; then :
+  if test "${ac_cv_path_mkdir+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
 for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_prog in mkdir gmkdir; do
 	 for ac_exec_ext in '' $ac_executable_extensions; do
-	   as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext" || continue
+	   { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; } || continue
 	   case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #(
 	     'mkdir (GNU coreutils) '* | \
 	     'mkdir (coreutils) '* | \
 	     'mkdir (fileutils) '4.1*)
 	       ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext
 	       break 3;;
 	   esac
 	 done
@@ -2598,29 +2565,29 @@ case $mkdir_p in
 esac
 
 for ac_prog in gawk mawk nawk awk
 do
   # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_AWK+:} false; then :
+if test "${ac_cv_prog_AWK+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$AWK"; then
   ac_cv_prog_AWK="$AWK" # Let the user override the test.
 else
 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
 for as_dir in $PATH
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_prog_AWK="$ac_prog"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
   done
 IFS=$as_save_IFS
 
@@ -2638,25 +2605,25 @@ fi
 
   test -n "$AWK" && break
 done
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5
 $as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; }
 set x ${MAKE-make}
 ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'`
-if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then :
+if { as_var=ac_cv_prog_make_${ac_make}_set; eval "test \"\${$as_var+set}\" = set"; }; then :
   $as_echo_n "(cached) " >&6
 else
   cat >conftest.make <<\_ACEOF
 SHELL = /bin/sh
 all:
 	@echo '@@@%%%=$(MAKE)=@@@%%%'
 _ACEOF
-# GNU make sometimes prints "make[1]: Entering ...", which would confuse us.
+# GNU make sometimes prints "make[1]: Entering...", which would confuse us.
 case `${MAKE-make} -f conftest.make 2>/dev/null` in
   *@@@%%%=?*=@@@%%%*)
     eval ac_cv_prog_make_${ac_make}_set=yes;;
   *)
     eval ac_cv_prog_make_${ac_make}_set=no;;
 esac
 rm -f conftest.make
 fi
@@ -2680,17 +2647,17 @@ fi
 rmdir .tst 2>/dev/null
 
 if test "`cd $srcdir && pwd`" != "`pwd`"; then
   # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
   # is not polluted with repeated "-I."
   am__isrc=' -I$(srcdir)'
   # test to see if srcdir already configured
   if test -f $srcdir/config.status; then
-    as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5
+    as_fn_error "source directory already configured; run \"make distclean\" there first" "$LINENO" 5
   fi
 fi
 
 # test whether we have cygpath
 if test -z "$CYGPATH_W"; then
   if (cygpath --version) >/dev/null 2>/dev/null; then
     CYGPATH_W='cygpath -w'
   else
@@ -2726,19 +2693,19 @@ AUTOMAKE=${AUTOMAKE-"${am_missing_run}au
 
 AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"}
 
 
 MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"}
 
 # We need awk for the "check" target.  The system "awk" is bad on
 # some platforms.
-# Always define AMTAR for backward compatibility.  Yes, it's still used
-# in the wild :-(  We should find a proper way to deprecate it ...
-AMTAR='$${TAR-tar}'
+# Always define AMTAR for backward compatibility.
+
+AMTAR=${AMTAR-"${am_missing_run}tar"}
 
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to create a ustar tar archive" >&5
 $as_echo_n "checking how to create a ustar tar archive... " >&6; }
 # Loop over all known methods to create a tar archive until one works.
 _am_tools='gnutar plaintar pax cpio none'
 _am_tools=${am_cv_prog_tar_ustar-$_am_tools}
 # Do not fold the above two line into one, because Tru64 sh and
@@ -2804,17 +2771,17 @@ do
    ac_status=$?
    echo "$as_me:$LINENO: \$? = $ac_status" >&5
    (exit $ac_status); }
     grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
   fi
 done
 rm -rf conftest.dir
 
-if ${am_cv_prog_tar_ustar+:} false; then :
+if test "${am_cv_prog_tar_ustar+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   am_cv_prog_tar_ustar=$_am_tool
 fi
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_tar_ustar" >&5
 $as_echo "$am_cv_prog_tar_ustar" >&6; }
 
@@ -2872,17 +2839,16 @@ rm -f confinc confmf
 # Check whether --enable-dependency-tracking was given.
 if test "${enable_dependency_tracking+set}" = set; then :
   enableval=$enable_dependency_tracking;
 fi
 
 if test "x$enable_dependency_tracking" != xno; then
   am_depcomp="$ac_aux_dir/depcomp"
   AMDEPBACKSLASH='\'
-  am__nodep='_no'
 fi
  if test "x$enable_dependency_tracking" != xno; then
   AMDEP_TRUE=
   AMDEP_FALSE='#'
 else
   AMDEP_TRUE='#'
   AMDEP_FALSE=
 fi
@@ -2893,29 +2859,29 @@ ac_cpp='$CPP $CPPFLAGS'
 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
 ac_compiler_gnu=$ac_cv_c_compiler_gnu
 if test -n "$ac_tool_prefix"; then
   # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
 set dummy ${ac_tool_prefix}gcc; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_CC+:} false; then :
+if test "${ac_cv_prog_CC+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$CC"; then
   ac_cv_prog_CC="$CC" # Let the user override the test.
 else
 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
 for as_dir in $PATH
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_prog_CC="${ac_tool_prefix}gcc"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
   done
 IFS=$as_save_IFS
 
@@ -2933,29 +2899,29 @@ fi
 
 fi
 if test -z "$ac_cv_prog_CC"; then
   ac_ct_CC=$CC
   # Extract the first word of "gcc", so it can be a program name with args.
 set dummy gcc; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_CC+:} false; then :
+if test "${ac_cv_prog_ac_ct_CC+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$ac_ct_CC"; then
   ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
 else
 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
 for as_dir in $PATH
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_prog_ac_ct_CC="gcc"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
   done
 IFS=$as_save_IFS
 
@@ -2986,29 +2952,29 @@ else
 fi
 
 if test -z "$CC"; then
           if test -n "$ac_tool_prefix"; then
     # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
 set dummy ${ac_tool_prefix}cc; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_CC+:} false; then :
+if test "${ac_cv_prog_CC+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$CC"; then
   ac_cv_prog_CC="$CC" # Let the user override the test.
 else
 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
 for as_dir in $PATH
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_prog_CC="${ac_tool_prefix}cc"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
   done
 IFS=$as_save_IFS
 
@@ -3026,30 +2992,30 @@ fi
 
   fi
 fi
 if test -z "$CC"; then
   # Extract the first word of "cc", so it can be a program name with args.
 set dummy cc; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_CC+:} false; then :
+if test "${ac_cv_prog_CC+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$CC"; then
   ac_cv_prog_CC="$CC" # Let the user override the test.
 else
   ac_prog_rejected=no
 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
 for as_dir in $PATH
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
        ac_prog_rejected=yes
        continue
      fi
     ac_cv_prog_CC="cc"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
@@ -3085,29 +3051,29 @@ fi
 if test -z "$CC"; then
   if test -n "$ac_tool_prefix"; then
   for ac_prog in cl.exe
   do
     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_CC+:} false; then :
+if test "${ac_cv_prog_CC+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$CC"; then
   ac_cv_prog_CC="$CC" # Let the user override the test.
 else
 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
 for as_dir in $PATH
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
   done
 IFS=$as_save_IFS
 
@@ -3129,29 +3095,29 @@ fi
 if test -z "$CC"; then
   ac_ct_CC=$CC
   for ac_prog in cl.exe
 do
   # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_CC+:} false; then :
+if test "${ac_cv_prog_ac_ct_CC+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$ac_ct_CC"; then
   ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
 else
 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
 for as_dir in $PATH
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_prog_ac_ct_CC="$ac_prog"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
   done
 IFS=$as_save_IFS
 
@@ -3183,18 +3149,18 @@ esac
   fi
 fi
 
 fi
 
 
 test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error $? "no acceptable C compiler found in \$PATH
-See \`config.log' for more details" "$LINENO" 5; }
+as_fn_error "no acceptable C compiler found in \$PATH
+See \`config.log' for more details." "$LINENO" 5; }
 
 # Provide some information about the compiler.
 $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5
 set X $ac_compile
 ac_compiler=$2
 for ac_option in --version -v -V -qversion; do
   { { ac_try="$ac_compiler $ac_option >&5"
 case "(($ac_try" in
@@ -3298,18 +3264,19 @@ fi
 if test -z "$ac_file"; then :
   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 $as_echo "no" >&6; }
 $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error 77 "C compiler cannot create executables
-See \`config.log' for more details" "$LINENO" 5; }
+{ as_fn_set_status 77
+as_fn_error "C compiler cannot create executables
+See \`config.log' for more details." "$LINENO" 5; }; }
 else
   { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
 $as_echo "yes" >&6; }
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5
 $as_echo_n "checking for C compiler default output file name... " >&6; }
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5
 $as_echo "$ac_file" >&6; }
@@ -3341,18 +3308,18 @@ for ac_file in conftest.exe conftest con
     *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
 	  break;;
     * ) break;;
   esac
 done
 else
   { { $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 compute suffix of executables: cannot compile and link
-See \`config.log' for more details" "$LINENO" 5; }
+as_fn_error "cannot compute suffix of executables: cannot compile and link
+See \`config.log' for more details." "$LINENO" 5; }
 fi
 rm -f conftest conftest$ac_cv_exeext
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5
 $as_echo "$ac_cv_exeext" >&6; }
 
 rm -f conftest.$ac_ext
 EXEEXT=$ac_cv_exeext
 ac_exeext=$EXEEXT
@@ -3399,30 +3366,30 @@ eval ac_try_echo="\"\$as_me:${as_lineno-
   test $ac_status = 0; }; }; then
     cross_compiling=no
   else
     if test "$cross_compiling" = maybe; then
 	cross_compiling=yes
     else
 	{ { $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 C compiled programs.
+as_fn_error "cannot run C compiled programs.
 If you meant to cross compile, use \`--host'.
-See \`config.log' for more details" "$LINENO" 5; }
+See \`config.log' for more details." "$LINENO" 5; }
     fi
   fi
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5
 $as_echo "$cross_compiling" >&6; }
 
 rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out
 ac_clean_files=$ac_clean_files_save
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5
 $as_echo_n "checking for suffix of object files... " >&6; }
-if ${ac_cv_objext+:} false; then :
+if test "${ac_cv_objext+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
 int
 main ()
 {
@@ -3452,28 +3419,28 @@ eval ac_try_echo="\"\$as_me:${as_lineno-
   esac
 done
 else
   $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 { { $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 compute suffix of object files: cannot compile
-See \`config.log' for more details" "$LINENO" 5; }
+as_fn_error "cannot compute suffix of object files: cannot compile
+See \`config.log' for more details." "$LINENO" 5; }
 fi
 rm -f conftest.$ac_cv_objext conftest.$ac_ext
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5
 $as_echo "$ac_cv_objext" >&6; }
 OBJEXT=$ac_cv_objext
 ac_objext=$OBJEXT
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5
 $as_echo_n "checking whether we are using the GNU C compiler... " >&6; }
-if ${ac_cv_c_compiler_gnu+:} false; then :
+if test "${ac_cv_c_compiler_gnu+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
 int
 main ()
 {
@@ -3500,17 +3467,17 @@ if test $ac_compiler_gnu = yes; then
   GCC=yes
 else
   GCC=
 fi
 ac_test_CFLAGS=${CFLAGS+set}
 ac_save_CFLAGS=$CFLAGS
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5
 $as_echo_n "checking whether $CC accepts -g... " >&6; }
-if ${ac_cv_prog_cc_g+:} false; then :
+if test "${ac_cv_prog_cc_g+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   ac_save_c_werror_flag=$ac_c_werror_flag
    ac_c_werror_flag=yes
    ac_cv_prog_cc_g=no
    CFLAGS="-g"
    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
@@ -3578,26 +3545,27 @@ else
   if test "$GCC" = yes; then
     CFLAGS="-O2"
   else
     CFLAGS=
   fi
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5
 $as_echo_n "checking for $CC option to accept ISO C89... " >&6; }
-if ${ac_cv_prog_cc_c89+:} false; then :
+if test "${ac_cv_prog_cc_c89+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   ac_cv_prog_cc_c89=no
 ac_save_CC=$CC
 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #include <stdarg.h>
 #include <stdio.h>
-struct stat;
+#include <sys/types.h>
+#include <sys/stat.h>
 /* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
 struct buf { int x; };
 FILE * (*rcsopen) (struct buf *, struct stat *, int);
 static char *e (p, i)
      char **p;
      int i;
 {
   return p[i];
@@ -3676,26 +3644,25 @@ ac_cpp='$CPP $CPPFLAGS'
 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
 ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
 depcc="$CC"   am_compiler_list=
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5
 $as_echo_n "checking dependency style of $depcc... " >&6; }
-if ${am_cv_CC_dependencies_compiler_type+:} false; then :
+if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
   # We make a subdir and do the tests there.  Otherwise we can end up
   # making bogus files that we don't know about and never remove.  For
   # instance it was reported that on HP-UX the gcc test will end up
   # making a dummy file named `D' -- because `-MD' means `put the output
   # in D'.
-  rm -rf conftest.dir
   mkdir conftest.dir
   # Copy depcomp to subdir because otherwise we won't find it if we're
   # using a relative directory.
   cp "$am_depcomp" conftest.dir
   cd conftest.dir
   # We will build objects and dependencies in a subdirectory because
   # it helps to detect inapplicable dependency modes.  For instance
   # both Tru64's cc and ICC support -MD to output dependencies as a
@@ -3745,17 +3712,17 @@ else
       # after this tag, mechanisms are not by side-effect, so they'll
       # only be used when explicitly requested
       if test "x$enable_dependency_tracking" = xyes; then
 	continue
       else
 	break
       fi
       ;;
-    msvc7 | msvc7msys | msvisualcpp | msvcmsys)
+    msvisualcpp | msvcmsys)
       # This compiler won't grok `-c -o', but also, the minuso test has
       # not run yet.  These depmodes are late enough in the game, and
       # so weak that their functioning should not be impacted.
       am__obj=conftest.${OBJEXT-o}
       am__minus_obj=
       ;;
     none) break ;;
     esac
@@ -3811,26 +3778,25 @@ test "${CCAS+set}" = set || CCAS=$CC
 test "${CCASFLAGS+set}" = set || CCASFLAGS=$CFLAGS
 
 
 
 depcc="$CCAS"   am_compiler_list=
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5
 $as_echo_n "checking dependency style of $depcc... " >&6; }
-if ${am_cv_CCAS_dependencies_compiler_type+:} false; then :
+if test "${am_cv_CCAS_dependencies_compiler_type+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
   # We make a subdir and do the tests there.  Otherwise we can end up
   # making bogus files that we don't know about and never remove.  For
   # instance it was reported that on HP-UX the gcc test will end up
   # making a dummy file named `D' -- because `-MD' means `put the output
   # in D'.
-  rm -rf conftest.dir
   mkdir conftest.dir
   # Copy depcomp to subdir because otherwise we won't find it if we're
   # using a relative directory.
   cp "$am_depcomp" conftest.dir
   cd conftest.dir
   # We will build objects and dependencies in a subdirectory because
   # it helps to detect inapplicable dependency modes.  For instance
   # both Tru64's cc and ICC support -MD to output dependencies as a
@@ -3878,17 +3844,17 @@ else
       # after this tag, mechanisms are not by side-effect, so they'll
       # only be used when explicitly requested
       if test "x$enable_dependency_tracking" = xyes; then
 	continue
       else
 	break
       fi
       ;;
-    msvc7 | msvc7msys | msvisualcpp | msvcmsys)
+    msvisualcpp | msvcmsys)
       # This compiler won't grok `-c -o', but also, the minuso test has
       # not run yet.  These depmodes are late enough in the game, and
       # so weak that their functioning should not be impacted.
       am__obj=conftest.${OBJEXT-o}
       am__minus_obj=
       ;;
     none) break ;;
     esac
@@ -3943,29 +3909,29 @@ ac_cpp='$CPP $CPPFLAGS'
 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
 ac_compiler_gnu=$ac_cv_c_compiler_gnu
 if test -n "$ac_tool_prefix"; then
   # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
 set dummy ${ac_tool_prefix}gcc; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_CC+:} false; then :
+if test "${ac_cv_prog_CC+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$CC"; then
   ac_cv_prog_CC="$CC" # Let the user override the test.
 else
 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
 for as_dir in $PATH
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_prog_CC="${ac_tool_prefix}gcc"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
   done
 IFS=$as_save_IFS
 
@@ -3983,29 +3949,29 @@ fi
 
 fi
 if test -z "$ac_cv_prog_CC"; then
   ac_ct_CC=$CC
   # Extract the first word of "gcc", so it can be a program name with args.
 set dummy gcc; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_CC+:} false; then :
+if test "${ac_cv_prog_ac_ct_CC+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$ac_ct_CC"; then
   ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
 else
 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
 for as_dir in $PATH
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_prog_ac_ct_CC="gcc"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
   done
 IFS=$as_save_IFS
 
@@ -4036,29 +4002,29 @@ else
 fi
 
 if test -z "$CC"; then
           if test -n "$ac_tool_prefix"; then
     # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
 set dummy ${ac_tool_prefix}cc; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_CC+:} false; then :
+if test "${ac_cv_prog_CC+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$CC"; then
   ac_cv_prog_CC="$CC" # Let the user override the test.
 else
 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
 for as_dir in $PATH
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_prog_CC="${ac_tool_prefix}cc"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
   done
 IFS=$as_save_IFS
 
@@ -4076,30 +4042,30 @@ fi
 
   fi
 fi
 if test -z "$CC"; then
   # Extract the first word of "cc", so it can be a program name with args.
 set dummy cc; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_CC+:} false; then :
+if test "${ac_cv_prog_CC+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$CC"; then
   ac_cv_prog_CC="$CC" # Let the user override the test.
 else
   ac_prog_rejected=no
 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
 for as_dir in $PATH
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
        ac_prog_rejected=yes
        continue
      fi
     ac_cv_prog_CC="cc"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
@@ -4135,29 +4101,29 @@ fi
 if test -z "$CC"; then
   if test -n "$ac_tool_prefix"; then
   for ac_prog in cl.exe
   do
     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_CC+:} false; then :
+if test "${ac_cv_prog_CC+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$CC"; then
   ac_cv_prog_CC="$CC" # Let the user override the test.
 else
 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
 for as_dir in $PATH
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
   done
 IFS=$as_save_IFS
 
@@ -4179,29 +4145,29 @@ fi
 if test -z "$CC"; then
   ac_ct_CC=$CC
   for ac_prog in cl.exe
 do
   # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_CC+:} false; then :
+if test "${ac_cv_prog_ac_ct_CC+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$ac_ct_CC"; then
   ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
 else
 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
 for as_dir in $PATH
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_prog_ac_ct_CC="$ac_prog"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
   done
 IFS=$as_save_IFS
 
@@ -4233,18 +4199,18 @@ esac
   fi
 fi
 
 fi
 
 
 test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error $? "no acceptable C compiler found in \$PATH
-See \`config.log' for more details" "$LINENO" 5; }
+as_fn_error "no acceptable C compiler found in \$PATH
+See \`config.log' for more details." "$LINENO" 5; }
 
 # Provide some information about the compiler.
 $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5
 set X $ac_compile
 ac_compiler=$2
 for ac_option in --version -v -V -qversion; do
   { { ac_try="$ac_compiler $ac_option >&5"
 case "(($ac_try" in
@@ -4263,17 +4229,17 @@ eval ac_try_echo="\"\$as_me:${as_lineno-
   fi
   rm -f conftest.er1 conftest.err
   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
   test $ac_status = 0; }
 done
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5
 $as_echo_n "checking whether we are using the GNU C compiler... " >&6; }
-if ${ac_cv_c_compiler_gnu+:} false; then :
+if test "${ac_cv_c_compiler_gnu+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
 int
 main ()
 {
@@ -4300,17 +4266,17 @@ if test $ac_compiler_gnu = yes; then
   GCC=yes
 else
   GCC=
 fi
 ac_test_CFLAGS=${CFLAGS+set}
 ac_save_CFLAGS=$CFLAGS
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5
 $as_echo_n "checking whether $CC accepts -g... " >&6; }
-if ${ac_cv_prog_cc_g+:} false; then :
+if test "${ac_cv_prog_cc_g+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   ac_save_c_werror_flag=$ac_c_werror_flag
    ac_c_werror_flag=yes
    ac_cv_prog_cc_g=no
    CFLAGS="-g"
    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
@@ -4378,26 +4344,27 @@ else
   if test "$GCC" = yes; then
     CFLAGS="-O2"
   else
     CFLAGS=
   fi
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5
 $as_echo_n "checking for $CC option to accept ISO C89... " >&6; }
-if ${ac_cv_prog_cc_c89+:} false; then :
+if test "${ac_cv_prog_cc_c89+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   ac_cv_prog_cc_c89=no
 ac_save_CC=$CC
 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #include <stdarg.h>
 #include <stdio.h>
-struct stat;
+#include <sys/types.h>
+#include <sys/stat.h>
 /* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
 struct buf { int x; };
 FILE * (*rcsopen) (struct buf *, struct stat *, int);
 static char *e (p, i)
      char **p;
      int i;
 {
   return p[i];
@@ -4476,26 +4443,25 @@ ac_cpp='$CPP $CPPFLAGS'
 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
 ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
 depcc="$CC"   am_compiler_list=
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5
 $as_echo_n "checking dependency style of $depcc... " >&6; }
-if ${am_cv_CC_dependencies_compiler_type+:} false; then :
+if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
   # We make a subdir and do the tests there.  Otherwise we can end up
   # making bogus files that we don't know about and never remove.  For
   # instance it was reported that on HP-UX the gcc test will end up
   # making a dummy file named `D' -- because `-MD' means `put the output
   # in D'.
-  rm -rf conftest.dir
   mkdir conftest.dir
   # Copy depcomp to subdir because otherwise we won't find it if we're
   # using a relative directory.
   cp "$am_depcomp" conftest.dir
   cd conftest.dir
   # We will build objects and dependencies in a subdirectory because
   # it helps to detect inapplicable dependency modes.  For instance
   # both Tru64's cc and ICC support -MD to output dependencies as a
@@ -4545,17 +4511,17 @@ else
       # after this tag, mechanisms are not by side-effect, so they'll
       # only be used when explicitly requested
       if test "x$enable_dependency_tracking" = xyes; then
 	continue
       else
 	break
       fi
       ;;
-    msvc7 | msvc7msys | msvisualcpp | msvcmsys)
+    msvisualcpp | msvcmsys)
       # This compiler won't grok `-c -o', but also, the minuso test has
       # not run yet.  These depmodes are late enough in the game, and
       # so weak that their functioning should not be impacted.
       am__obj=conftest.${OBJEXT-o}
       am__minus_obj=
       ;;
     none) break ;;
     esac
@@ -4609,17 +4575,17 @@ if test "x$CC" != xcc; then
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC and cc understand -c and -o together" >&5
 $as_echo_n "checking whether $CC and cc understand -c and -o together... " >&6; }
 else
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether cc understands -c and -o together" >&5
 $as_echo_n "checking whether cc understands -c and -o together... " >&6; }
 fi
 set dummy $CC; ac_cc=`$as_echo "$2" |
 		      sed 's/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/'`
-if eval \${ac_cv_prog_cc_${ac_cc}_c_o+:} false; then :
+if { as_var=ac_cv_prog_cc_${ac_cc}_c_o; eval "test \"\${$as_var+set}\" = set"; }; then :
   $as_echo_n "(cached) " >&6
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
 int
 main ()
 {
@@ -4738,17 +4704,17 @@ ac_link='$CC -o conftest$ac_exeext $CFLA
 ac_compiler_gnu=$ac_cv_c_compiler_gnu
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5
 $as_echo_n "checking how to run the C preprocessor... " >&6; }
 # On Suns, sometimes $CPP names a directory.
 if test -n "$CPP" && test -d "$CPP"; then
   CPP=
 fi
 if test -z "$CPP"; then
-  if ${ac_cv_prog_CPP+:} false; then :
+  if test "${ac_cv_prog_CPP+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
       # Double quotes because CPP needs to be expanded
     for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
     do
       ac_preproc_ok=false
 for ac_c_preproc_warn_flag in '' yes
 do
@@ -4768,37 +4734,37 @@ do
 		     Syntax error
 _ACEOF
 if ac_fn_c_try_cpp "$LINENO"; then :
 
 else
   # Broken: fails on valid input.
 continue
 fi
-rm -f conftest.err conftest.i conftest.$ac_ext
+rm -f conftest.err conftest.$ac_ext
 
   # OK, works on sane cases.  Now check whether nonexistent headers
   # can be detected and how.
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #include <ac_nonexistent.h>
 _ACEOF
 if ac_fn_c_try_cpp "$LINENO"; then :
   # Broken: success on invalid input.
 continue
 else
   # Passes both tests.
 ac_preproc_ok=:
 break
 fi
-rm -f conftest.err conftest.i conftest.$ac_ext
+rm -f conftest.err conftest.$ac_ext
 
 done
 # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
-rm -f conftest.i conftest.err conftest.$ac_ext
+rm -f conftest.err conftest.$ac_ext
 if $ac_preproc_ok; then :
   break
 fi
 
     done
     ac_cv_prog_CPP=$CPP
 
 fi
@@ -4827,44 +4793,44 @@ do
 		     Syntax error
 _ACEOF
 if ac_fn_c_try_cpp "$LINENO"; then :
 
 else
   # Broken: fails on valid input.
 continue
 fi
-rm -f conftest.err conftest.i conftest.$ac_ext
+rm -f conftest.err conftest.$ac_ext
 
   # OK, works on sane cases.  Now check whether nonexistent headers
   # can be detected and how.
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #include <ac_nonexistent.h>
 _ACEOF
 if ac_fn_c_try_cpp "$LINENO"; then :
   # Broken: success on invalid input.
 continue
 else
   # Passes both tests.
 ac_preproc_ok=:
 break
 fi
-rm -f conftest.err conftest.i conftest.$ac_ext
+rm -f conftest.err conftest.$ac_ext
 
 done
 # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
-rm -f conftest.i conftest.err conftest.$ac_ext
+rm -f conftest.err conftest.$ac_ext
 if $ac_preproc_ok; then :
 
 else
   { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error $? "C preprocessor \"$CPP\" fails sanity check
-See \`config.log' for more details" "$LINENO" 5; }
+as_fn_error "C preprocessor \"$CPP\" fails sanity check
+See \`config.log' for more details." "$LINENO" 5; }
 fi
 
 ac_ext=c
 ac_cpp='$CPP $CPPFLAGS'
 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
 ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
@@ -4879,29 +4845,29 @@ if test -z "$CXX"; then
   else
     if test -n "$ac_tool_prefix"; then
   for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC
   do
     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_CXX+:} false; then :
+if test "${ac_cv_prog_CXX+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$CXX"; then
   ac_cv_prog_CXX="$CXX" # Let the user override the test.
 else
 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
 for as_dir in $PATH
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_prog_CXX="$ac_tool_prefix$ac_prog"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
   done
 IFS=$as_save_IFS
 
@@ -4923,29 +4889,29 @@ fi
 if test -z "$CXX"; then
   ac_ct_CXX=$CXX
   for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC
 do
   # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_CXX+:} false; then :
+if test "${ac_cv_prog_ac_ct_CXX+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$ac_ct_CXX"; then
   ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test.
 else
 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
 for as_dir in $PATH
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_prog_ac_ct_CXX="$ac_prog"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
   done
 IFS=$as_save_IFS
 
@@ -5001,17 +4967,17 @@ eval ac_try_echo="\"\$as_me:${as_lineno-
   fi
   rm -f conftest.er1 conftest.err
   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
   test $ac_status = 0; }
 done
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C++ compiler" >&5
 $as_echo_n "checking whether we are using the GNU C++ compiler... " >&6; }
-if ${ac_cv_cxx_compiler_gnu+:} false; then :
+if test "${ac_cv_cxx_compiler_gnu+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
 int
 main ()
 {
@@ -5038,17 +5004,17 @@ if test $ac_compiler_gnu = yes; then
   GXX=yes
 else
   GXX=
 fi
 ac_test_CXXFLAGS=${CXXFLAGS+set}
 ac_save_CXXFLAGS=$CXXFLAGS
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX accepts -g" >&5
 $as_echo_n "checking whether $CXX accepts -g... " >&6; }
-if ${ac_cv_prog_cxx_g+:} false; then :
+if test "${ac_cv_prog_cxx_g+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   ac_save_cxx_werror_flag=$ac_cxx_werror_flag
    ac_cxx_werror_flag=yes
    ac_cv_prog_cxx_g=no
    CXXFLAGS="-g"
    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
@@ -5124,26 +5090,25 @@ ac_cpp='$CPP $CPPFLAGS'
 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
 ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
 depcc="$CXX"  am_compiler_list=
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5
 $as_echo_n "checking dependency style of $depcc... " >&6; }
-if ${am_cv_CXX_dependencies_compiler_type+:} false; then :
+if test "${am_cv_CXX_dependencies_compiler_type+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
   # We make a subdir and do the tests there.  Otherwise we can end up
   # making bogus files that we don't know about and never remove.  For
   # instance it was reported that on HP-UX the gcc test will end up
   # making a dummy file named `D' -- because `-MD' means `put the output
   # in D'.
-  rm -rf conftest.dir
   mkdir conftest.dir
   # Copy depcomp to subdir because otherwise we won't find it if we're
   # using a relative directory.
   cp "$am_depcomp" conftest.dir
   cd conftest.dir
   # We will build objects and dependencies in a subdirectory because
   # it helps to detect inapplicable dependency modes.  For instance
   # both Tru64's cc and ICC support -MD to output dependencies as a
@@ -5193,17 +5158,17 @@ else
       # after this tag, mechanisms are not by side-effect, so they'll
       # only be used when explicitly requested
       if test "x$enable_dependency_tracking" = xyes; then
 	continue
       else
 	break
       fi
       ;;
-    msvc7 | msvc7msys | msvisualcpp | msvcmsys)
+    msvisualcpp | msvcmsys)
       # This compiler won't grok `-c -o', but also, the minuso test has
       # not run yet.  These depmodes are late enough in the game, and
       # so weak that their functioning should not be impacted.
       am__obj=conftest.${OBJEXT-o}
       am__minus_obj=
       ;;
     none) break ;;
     esac
@@ -5253,29 +5218,29 @@ else
 fi
 
 
 if test -n "$ac_tool_prefix"; then
   # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
 set dummy ${ac_tool_prefix}ranlib; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_RANLIB+:} false; then :
+if test "${ac_cv_prog_RANLIB+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$RANLIB"; then
   ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
 else
 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
 for as_dir in $PATH
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
   done
 IFS=$as_save_IFS
 
@@ -5293,29 +5258,29 @@ fi
 
 fi
 if test -z "$ac_cv_prog_RANLIB"; then
   ac_ct_RANLIB=$RANLIB
   # Extract the first word of "ranlib", so it can be a program name with args.
 set dummy ranlib; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_RANLIB+:} false; then :
+if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$ac_ct_RANLIB"; then
   ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test.
 else
 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
 for as_dir in $PATH
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_prog_ac_ct_RANLIB="ranlib"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
   done
 IFS=$as_save_IFS
 
@@ -5353,31 +5318,31 @@ else
   GCC_FALSE=
 fi
    # let the Makefile know if we're gcc
 
 
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5
 $as_echo_n "checking for grep that handles long lines and -e... " >&6; }
-if ${ac_cv_path_GREP+:} false; then :
+if test "${ac_cv_path_GREP+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   if test -z "$GREP"; then
   ac_path_GREP_found=false
   # Loop through the user's path and test for each of PROGNAME-LIST
   as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
 for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_prog in grep ggrep; do
     for ac_exec_ext in '' $ac_executable_extensions; do
       ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext"
-      as_fn_executable_p "$ac_path_GREP" || continue
+      { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue
 # Check for GNU ac_path_GREP and select it if it is found.
   # Check for GNU $ac_path_GREP
 case `"$ac_path_GREP" --version 2>&1` in
 *GNU*)
   ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;;
 *)
   ac_count=0
   $as_echo_n 0123456789 >"conftest.in"
@@ -5402,48 +5367,48 @@ case `"$ac_path_GREP" --version 2>&1` in
 esac
 
       $ac_path_GREP_found && break 3
     done
   done
   done
 IFS=$as_save_IFS
   if test -z "$ac_cv_path_GREP"; then
-    as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
+    as_fn_error "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
   fi
 else
   ac_cv_path_GREP=$GREP
 fi
 
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5
 $as_echo "$ac_cv_path_GREP" >&6; }
  GREP="$ac_cv_path_GREP"
 
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5
 $as_echo_n "checking for egrep... " >&6; }
-if ${ac_cv_path_EGREP+:} false; then :
+if test "${ac_cv_path_EGREP+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   if echo a | $GREP -E '(a|b)' >/dev/null 2>&1
    then ac_cv_path_EGREP="$GREP -E"
    else
      if test -z "$EGREP"; then
   ac_path_EGREP_found=false
   # Loop through the user's path and test for each of PROGNAME-LIST
   as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
 for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_prog in egrep; do
     for ac_exec_ext in '' $ac_executable_extensions; do
       ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext"
-      as_fn_executable_p "$ac_path_EGREP" || continue
+      { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue
 # Check for GNU ac_path_EGREP and select it if it is found.
   # Check for GNU $ac_path_EGREP
 case `"$ac_path_EGREP" --version 2>&1` in
 *GNU*)
   ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;;
 *)
   ac_count=0
   $as_echo_n 0123456789 >"conftest.in"
@@ -5468,32 +5433,32 @@ case `"$ac_path_EGREP" --version 2>&1` i
 esac
 
       $ac_path_EGREP_found && break 3
     done
   done
   done
 IFS=$as_save_IFS
   if test -z "$ac_cv_path_EGREP"; then
-    as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
+    as_fn_error "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
   fi
 else
   ac_cv_path_EGREP=$EGREP
 fi
 
    fi
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5
 $as_echo "$ac_cv_path_EGREP" >&6; }
  EGREP="$ac_cv_path_EGREP"
 
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5
 $as_echo_n "checking for ANSI C header files... " >&6; }
-if ${ac_cv_header_stdc+:} false; then :
+if test "${ac_cv_header_stdc+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #include <stdlib.h>
 #include <stdarg.h>
 #include <string.h>
 #include <float.h>
@@ -5820,29 +5785,29 @@ for flag in $ax_pthread_flags; do
                 PTHREAD_CFLAGS="$flag"
                 ;;
 
 		pthread-config)
 		# Extract the first word of "pthread-config", so it can be a program name with args.
 set dummy pthread-config; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ax_pthread_config+:} false; then :
+if test "${ac_cv_prog_ax_pthread_config+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$ax_pthread_config"; then
   ac_cv_prog_ax_pthread_config="$ax_pthread_config" # Let the user override the test.
 else
 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
 for as_dir in $PATH
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_prog_ax_pthread_config="yes"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
   done
 IFS=$as_save_IFS
 
@@ -5981,29 +5946,29 @@ cat >>confdefs.h <<_ACEOF
         # More AIX lossage: must compile with xlc_r or cc_r
 	if test x"$GCC" != xyes; then
           for ac_prog in xlc_r cc_r
 do
   # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_PTHREAD_CC+:} false; then :
+if test "${ac_cv_prog_PTHREAD_CC+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$PTHREAD_CC"; then
   ac_cv_prog_PTHREAD_CC="$PTHREAD_CC" # Let the user override the test.
 else
 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
 for as_dir in $PATH
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_prog_PTHREAD_CC="$ac_prog"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
   done
 IFS=$as_save_IFS
 
@@ -6053,30 +6018,31 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
 # On IRIX 5.3, sys/types and inttypes.h are conflicting.
 for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
 		  inttypes.h stdint.h unistd.h
 do :
   as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
 ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default
 "
-if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
+eval as_val=\$$as_ac_Header
+   if test "x$as_val" = x""yes; then :
   cat >>confdefs.h <<_ACEOF
 #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
 _ACEOF
 
 fi
 
 done
 
 
 for ac_header in a.out.h
 do :
   ac_fn_c_check_header_mongrel "$LINENO" "a.out.h" "ac_cv_header_a_out_h" "$ac_includes_default"
-if test "x$ac_cv_header_a_out_h" = xyes; then :
+if test "x$ac_cv_header_a_out_h" = x""yes; then :
   cat >>confdefs.h <<_ACEOF
 #define HAVE_A_OUT_H 1
 _ACEOF
 
 fi
 
 done
 
@@ -6118,17 +6084,17 @@ if test "${enable_m32+set}" = set; then 
                    CFLAGS="${CFLAGS} -m32"
                    CXXFLAGS="${CXXFLAGS} -m32"
                    usem32=true
                    ;;
                  no)
                    usem32=false
                    ;;
                  *)
-                   as_fn_error $? "bad value ${enableval} for --enable-m32" "$LINENO" 5
+                   as_fn_error "bad value ${enableval} for --enable-m32" "$LINENO" 5
                    ;;
                esac
 else
   usem32=false
 fi
 
 
 # Check whether --enable-processor was given.
@@ -6136,17 +6102,17 @@ if test "${enable_processor+set}" = set;
   enableval=$enable_processor; case "${enableval}" in
                  yes)
                    disable_processor=false
                    ;;
                  no)
                    disable_processor=true
                    ;;
                  *)
-                   as_fn_error $? "bad value ${enableval} for --disable-processor" "$LINENO" 5
+                   as_fn_error "bad value ${enableval} for --disable-processor" "$LINENO" 5
                    ;;
                esac
 else
   disable_processor=false
 fi
 
  if test x$disable_processor = xtrue; then
   DISABLE_PROCESSOR_TRUE=
@@ -6162,47 +6128,47 @@ if test "${enable_tools+set}" = set; the
   enableval=$enable_tools; case "${enableval}" in
                  yes)
                    disable_tools=false
                    ;;
                  no)
                    disable_tools=true
                    ;;
                  *)
-                   as_fn_error $? "bad value ${enableval} for --disable-tools" "$LINENO" 5
+                   as_fn_error "bad value ${enableval} for --disable-tools" "$LINENO" 5
                    ;;
                esac
 else
   disable_tools=false
 fi
 
  if test x$disable_tools = xtrue; then
   DISABLE_TOOLS_TRUE=
   DISABLE_TOOLS_FALSE='#'
 else
   DISABLE_TOOLS_TRUE='#'
   DISABLE_TOOLS_FALSE=
 fi
 
 
 if test x$LINUX_HOST = xfalse -a x$disable_processor = xtrue -a x$disable_tools = xtrue; then
-   as_fn_error $? "--disable-processor and --disable-tools were specified, and not building for Linux. Nothing to build!" "$LINENO" 5
+   as_fn_error "--disable-processor and --disable-tools were specified, and not building for Linux. Nothing to build!" "$LINENO" 5
 fi
 
 # Check whether --enable-selftest was given.
 if test "${enable_selftest+set}" = set; then :
   enableval=$enable_selftest; case "${enableval}" in
                  yes)
                    selftest=true
                    ;;
                  no)
                    selftest=false
                    ;;
                  *)
-                   as_fn_error $? "bad value ${enableval} for --enable-selftest" "$LINENO" 5
+                   as_fn_error "bad value ${enableval} for --enable-selftest" "$LINENO" 5
                    ;;
                esac
 else
   selftest=false
 fi
 
  if test x$selftest = xtrue; then
   SELFTEST_TRUE=
@@ -6274,47 +6240,35 @@ cat >confcache <<\_ACEOF
      t clear
      :clear
      s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
      t end
      s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
      :end' >>confcache
 if diff "$cache_file" confcache >/dev/null 2>&1; then :; else
   if test -w "$cache_file"; then
-    if test "x$cache_file" != "x/dev/null"; then
+    test "x$cache_file" != "x/dev/null" &&
       { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5
 $as_echo "$as_me: updating cache $cache_file" >&6;}
-      if test ! -f "$cache_file" || test -h "$cache_file"; then
-	cat confcache >"$cache_file"
-      else
-        case $cache_file in #(
-        */* | ?:*)
-	  mv -f confcache "$cache_file"$$ &&
-	  mv -f "$cache_file"$$ "$cache_file" ;; #(
-        *)
-	  mv -f confcache "$cache_file" ;;
-	esac
-      fi
-    fi
+    cat confcache >$cache_file
   else
     { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5
 $as_echo "$as_me: not updating unwritable cache $cache_file" >&6;}
   fi
 fi
 rm -f confcache
 
 test "x$prefix" = xNONE && prefix=$ac_default_prefix
 # Let make expand exec_prefix.
 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
 
 DEFS=-DHAVE_CONFIG_H
 
 ac_libobjs=
 ac_ltlibobjs=
-U=
 for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue
   # 1. Remove the extension, and $U if already installed.
   ac_script='s/\$U\././;s/\.o$//;s/\.obj$//'
   ac_i=`$as_echo "$ac_i" | sed "$ac_script"`
   # 2. Prepend LIBOBJDIR.  When used with automake>=1.10 LIBOBJDIR
   #    will be set to the directory where LIBOBJS objects are built.
   as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext"
   as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo'
@@ -6328,61 +6282,61 @@ LTLIBOBJS=$ac_ltlibobjs
   am__EXEEXT_TRUE=
   am__EXEEXT_FALSE='#'
 else
   am__EXEEXT_TRUE='#'
   am__EXEEXT_FALSE=
 fi
 
 if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then
-  as_fn_error $? "conditional \"AMDEP\" was never defined.
+  as_fn_error "conditional \"AMDEP\" was never defined.
 Usually this means the macro was only invoked conditionally." "$LINENO" 5
 fi
 if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then
-  as_fn_error $? "conditional \"am__fastdepCC\" was never defined.
+  as_fn_error "conditional \"am__fastdepCC\" was never defined.
 Usually this means the macro was only invoked conditionally." "$LINENO" 5
 fi
 if test -z "${am__fastdepCCAS_TRUE}" && test -z "${am__fastdepCCAS_FALSE}"; then
-  as_fn_error $? "conditional \"am__fastdepCCAS\" was never defined.
+  as_fn_error "conditional \"am__fastdepCCAS\" was never defined.
 Usually this means the macro was only invoked conditionally." "$LINENO" 5
 fi
 if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then
-  as_fn_error $? "conditional \"am__fastdepCC\" was never defined.
+  as_fn_error "conditional \"am__fastdepCC\" was never defined.
 Usually this means the macro was only invoked conditionally." "$LINENO" 5
 fi
 if test -z "${am__fastdepCXX_TRUE}" && test -z "${am__fastdepCXX_FALSE}"; then
-  as_fn_error $? "conditional \"am__fastdepCXX\" was never defined.
+  as_fn_error "conditional \"am__fastdepCXX\" was never defined.
 Usually this means the macro was only invoked conditionally." "$LINENO" 5
 fi
 if test -z "${GCC_TRUE}" && test -z "${GCC_FALSE}"; then
-  as_fn_error $? "conditional \"GCC\" was never defined.
+  as_fn_error "conditional \"GCC\" was never defined.
 Usually this means the macro was only invoked conditionally." "$LINENO" 5
 fi
 if test -z "${LINUX_HOST_TRUE}" && test -z "${LINUX_HOST_FALSE}"; then
-  as_fn_error $? "conditional \"LINUX_HOST\" was never defined.
+  as_fn_error "conditional \"LINUX_HOST\" was never defined.
 Usually this means the macro was only invoked conditionally." "$LINENO" 5
 fi
 if test -z "${ANDROID_HOST_TRUE}" && test -z "${ANDROID_HOST_FALSE}"; then
-  as_fn_error $? "conditional \"ANDROID_HOST\" was never defined.
+  as_fn_error "conditional \"ANDROID_HOST\" was never defined.
 Usually this means the macro was only invoked conditionally." "$LINENO" 5
 fi
 if test -z "${DISABLE_PROCESSOR_TRUE}" && test -z "${DISABLE_PROCESSOR_FALSE}"; then
-  as_fn_error $? "conditional \"DISABLE_PROCESSOR\" was never defined.
+  as_fn_error "conditional \"DISABLE_PROCESSOR\" was never defined.
 Usually this means the macro was only invoked conditionally." "$LINENO" 5
 fi
 if test -z "${DISABLE_TOOLS_TRUE}" && test -z "${DISABLE_TOOLS_FALSE}"; then
-  as_fn_error $? "conditional \"DISABLE_TOOLS\" was never defined.
+  as_fn_error "conditional \"DISABLE_TOOLS\" was never defined.
 Usually this means the macro was only invoked conditionally." "$LINENO" 5
 fi
 if test -z "${SELFTEST_TRUE}" && test -z "${SELFTEST_FALSE}"; then
-  as_fn_error $? "conditional \"SELFTEST\" was never defined.
+  as_fn_error "conditional \"SELFTEST\" was never defined.
 Usually this means the macro was only invoked conditionally." "$LINENO" 5
 fi
 
-: "${CONFIG_STATUS=./config.status}"
+: ${CONFIG_STATUS=./config.status}
 ac_write_fail=0
 ac_clean_files_save=$ac_clean_files
 ac_clean_files="$ac_clean_files $CONFIG_STATUS"
 { $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5
 $as_echo "$as_me: creating $CONFIG_STATUS" >&6;}
 as_write_fail=0
 cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1
 #! $SHELL
@@ -6473,17 +6427,16 @@ fi
 # IFS
 # We need space, tab and new line, in precisely that order.  Quoting is
 # there to prevent editors from complaining about space-tab.
 # (If _AS_PATH_WALK were called with IFS unset, it would disable word
 # splitting by setting IFS to empty value.)
 IFS=" ""	$as_nl"
 
 # Find who we are.  Look in the path if we contain no directory separator.
-as_myself=
 case $0 in #((
   *[\\/]* ) as_myself=$0 ;;
   *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
 for as_dir in $PATH
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
@@ -6519,29 +6472,29 @@ LC_ALL=C
 export LC_ALL
 LANGUAGE=C
 export LANGUAGE
 
 # CDPATH.
 (unset CDPATH) >/dev/null 2>&1 && unset CDPATH
 
 
-# as_fn_error STATUS ERROR [LINENO LOG_FD]
-# ----------------------------------------
+# as_fn_error ERROR [LINENO LOG_FD]
+# ---------------------------------
 # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are
 # provided, also output the error to LOG_FD, referencing LINENO. Then exit the
-# script with STATUS, using 1 if that was 0.
+# script with status $?, using 1 if that was 0.
 as_fn_error ()
 {
-  as_status=$1; test $as_status -eq 0 && as_status=1
-  if test "$4"; then
-    as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
-    $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4
+  as_status=$?; test $as_status -eq 0 && as_status=1
+  if test "$3"; then
+    as_lineno=${as_lineno-"$2"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+    $as_echo "$as_me:${as_lineno-$LINENO}: error: $1" >&$3
   fi
-  $as_echo "$as_me: error: $2" >&2
+  $as_echo "$as_me: error: $1" >&2
   as_fn_exit $as_status
 } # as_fn_error
 
 
 # as_fn_set_status STATUS
 # -----------------------
 # Set $? to STATUS, without forking.
 as_fn_set_status ()
@@ -6669,26 +6622,26 @@ else
   mkdir conf$$.dir 2>/dev/null
 fi
 if (echo >conf$$.file) 2>/dev/null; then
   if ln -s conf$$.file conf$$ 2>/dev/null; then
     as_ln_s='ln -s'
     # ... but there are two gotchas:
     # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
     # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
-    # In both cases, we have to default to `cp -pR'.
+    # In both cases, we have to default to `cp -p'.
     ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
-      as_ln_s='cp -pR'
+      as_ln_s='cp -p'
   elif ln conf$$.file conf$$ 2>/dev/null; then
     as_ln_s=ln
   else
-    as_ln_s='cp -pR'
+    as_ln_s='cp -p'
   fi
 else
-  as_ln_s='cp -pR'
+  as_ln_s='cp -p'
 fi
 rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
 rmdir conf$$.dir 2>/dev/null
 
 
 # as_fn_mkdir_p
 # -------------
 # Create "$as_dir" as a directory, including parents if necessary.
@@ -6727,37 +6680,49 @@ as_fn_mkdir_p ()
 	  /^X\(\/\).*/{
 	    s//\1/
 	    q
 	  }
 	  s/.*/./; q'`
       test -d "$as_dir" && break
     done
     test -z "$as_dirs" || eval "mkdir $as_dirs"
-  } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir"
+  } || test -d "$as_dir" || as_fn_error "cannot create directory $as_dir"
 
 
 } # as_fn_mkdir_p
 if mkdir -p . 2>/dev/null; then
   as_mkdir_p='mkdir -p "$as_dir"'
 else
   test -d ./-p && rmdir ./-p
   as_mkdir_p=false
 fi
 
-
-# as_fn_executable_p FILE
-# -----------------------
-# Test if FILE is an executable regular file.
-as_fn_executable_p ()
-{
-  test -f "$1" && test -x "$1"
-} # as_fn_executable_p
-as_test_x='test -x'
-as_executable_p=as_fn_executable_p
+if test -x / >/dev/null 2>&1; then
+  as_test_x='test -x'
+else
+  if ls -dL / >/dev/null 2>&1; then
+    as_ls_L_option=L
+  else
+    as_ls_L_option=
+  fi
+  as_test_x='
+    eval sh -c '\''
+      if test -d "$1"; then
+	test -d "$1/.";
+      else
+	case $1 in #(
+	-*)set "./$1";;
+	esac;
+	case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #((
+	???[sx]*):;;*)false;;esac;fi
+    '\'' sh
+  '
+fi
+as_executable_p=$as_test_x
 
 # Sed expression to map a string onto a valid CPP name.
 as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
 
 # Sed expression to map a string onto a valid variable name.
 as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
 
 
@@ -6769,17 +6734,17 @@ exec 6>&1
 test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1
 
 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
 # Save the log message, to keep $0 and so on meaningful, and to
 # report actual input values of CONFIG_FILES etc. instead of their
 # values after options handling.
 ac_log="
 This file was extended by breakpad $as_me 0.1, which was
-generated by GNU Autoconf 2.69.  Invocation command line was
+generated by GNU Autoconf 2.65.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
   CONFIG_HEADERS  = $CONFIG_HEADERS
   CONFIG_LINKS    = $CONFIG_LINKS
   CONFIG_COMMANDS = $CONFIG_COMMANDS
   $ $0 $@
 
 on `(hostname || uname -n) 2>/dev/null | sed 1q`
@@ -6835,20 +6800,20 @@ Configuration commands:
 
 Report bugs to <google-breakpad-dev@googlegroups.com>."
 
 _ACEOF
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
 ac_cs_version="\\
 breakpad config.status 0.1
-configured by $0, generated by GNU Autoconf 2.69,
+configured by $0, generated by GNU Autoconf 2.65,
   with options \\"\$ac_cs_config\\"
 
-Copyright (C) 2012 Free Software Foundation, Inc.
+Copyright (C) 2009 Free Software Foundation, Inc.
 This config.status script is free software; the Free Software Foundation
 gives unlimited permission to copy, distribute and modify it."
 
 ac_pwd='$ac_pwd'
 srcdir='$srcdir'
 INSTALL='$INSTALL'
 MKDIR_P='$MKDIR_P'
 AWK='$AWK'
@@ -6856,26 +6821,21 @@ test -n "\$AWK" || AWK=awk
 _ACEOF
 
 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
 # The default lists apply if the user does not specify any file.
 ac_need_defaults=:
 while test $# != 0
 do
   case $1 in
-  --*=?*)
+  --*=*)
     ac_option=`expr "X$1" : 'X\([^=]*\)='`
     ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'`
     ac_shift=:
     ;;
-  --*=)
-    ac_option=`expr "X$1" : 'X\([^=]*\)='`
-    ac_optarg=
-    ac_shift=:
-    ;;
   *)
     ac_option=$1
     ac_optarg=$2
     ac_shift=shift
     ;;
   esac
 
   case $ac_option in
@@ -6887,39 +6847,38 @@ do
   --config | --confi | --conf | --con | --co | --c )
     $as_echo "$ac_cs_config"; exit ;;
   --debug | --debu | --deb | --de | --d | -d )
     debug=: ;;
   --file | --fil | --fi | --f )
     $ac_shift
     case $ac_optarg in
     *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
-    '') as_fn_error $? "missing file argument" ;;
     esac
     as_fn_append CONFIG_FILES " '$ac_optarg'"
     ac_need_defaults=false;;
   --header | --heade | --head | --hea )
     $ac_shift
     case $ac_optarg in
     *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
     esac
     as_fn_append CONFIG_HEADERS " '$ac_optarg'"
     ac_need_defaults=false;;
   --he | --h)
     # Conflict between --help and --header
-    as_fn_error $? "ambiguous option: \`$1'
+    as_fn_error "ambiguous option: \`$1'
 Try \`$0 --help' for more information.";;
   --help | --hel | -h )
     $as_echo "$ac_cs_usage"; exit ;;
   -q | -quiet | --quiet | --quie | --qui | --qu | --q \
   | -silent | --silent | --silen | --sile | --sil | --si | --s)
     ac_cs_silent=: ;;
 
   # This is an error.
-  -*) as_fn_error $? "unrecognized option: \`$1'
+  -*) as_fn_error "unrecognized option: \`$1'
 Try \`$0 --help' for more information." ;;
 
   *) as_fn_append ac_config_targets " $1"
      ac_need_defaults=false ;;
 
   esac
   shift
 done
@@ -6929,17 +6888,17 @@ ac_configure_extra_args=
 if $ac_cs_silent; then
   exec 6>/dev/null
   ac_configure_extra_args="$ac_configure_extra_args --silent"
 fi
 
 _ACEOF
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 if \$ac_cs_recheck; then
-  set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
+  set X '$SHELL' '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
   shift
   \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6
   CONFIG_SHELL='$SHELL'
   export CONFIG_SHELL
   exec "\$@"
 fi
 
 _ACEOF
@@ -6967,17 +6926,17 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_wri
 # Handling of arguments.
 for ac_config_target in $ac_config_targets
 do
   case $ac_config_target in
     "src/config.h") CONFIG_HEADERS="$CONFIG_HEADERS src/config.h" ;;
     "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;;
     "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
 
-  *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
+  *) as_fn_error "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
   esac
 done
 
 
 # If the user did not use the arguments to specify the items to instantiate,
 # then the envvar interface is used.  Set only those that are not.
 # We use the long form for the default assignment because of an extremely
 # bizarre bug on SunOS 4.1.3.
@@ -6990,84 +6949,82 @@ fi
 # Have a temporary directory for convenience.  Make it in the build tree
 # simply because there is no reason against having it here, and in addition,
 # creating and moving files from /tmp can sometimes cause problems.
 # Hook for its removal unless debugging.
 # Note that there is a small window in which the directory will not be cleaned:
 # after its creation but before its name has been assigned to `$tmp'.
 $debug ||
 {
-  tmp= ac_tmp=
+  tmp=
   trap 'exit_status=$?
-  : "${ac_tmp:=$tmp}"
-  { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status
+  { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status
 ' 0
   trap 'as_fn_exit 1' 1 2 13 15
 }
 # Create a (secure) tmp directory for tmp files.
 
 {
   tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` &&
-  test -d "$tmp"
+  test -n "$tmp" && test -d "$tmp"
 }  ||
 {
   tmp=./conf$$-$RANDOM
   (umask 077 && mkdir "$tmp")
-} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5
-ac_tmp=$tmp
+} || as_fn_error "cannot create a temporary directory in ." "$LINENO" 5
 
 # Set up the scripts for CONFIG_FILES section.
 # No need to generate them if there are no CONFIG_FILES.
 # This happens for instance with `./config.status config.h'.
 if test -n "$CONFIG_FILES"; then
 
 
 ac_cr=`echo X | tr X '\015'`
 # On cygwin, bash can eat \r inside `` if the user requested igncr.
 # But we know of no other shell where ac_cr would be empty at this
 # point, so we can use a bashism as a fallback.
 if test "x$ac_cr" = x; then
   eval ac_cr=\$\'\\r\'
 fi
 ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' </dev/null 2>/dev/null`
 if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then
-  ac_cs_awk_cr='\\r'
+  ac_cs_awk_cr='\r'
 else
   ac_cs_awk_cr=$ac_cr
 fi
 
-echo 'BEGIN {' >"$ac_tmp/subs1.awk" &&
+echo 'BEGIN {' >"$tmp/subs1.awk" &&
 _ACEOF
 
 
 {
   echo "cat >conf$$subs.awk <<_ACEOF" &&
   echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' &&
   echo "_ACEOF"
 } >conf$$subs.sh ||
-  as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
-ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'`
+  as_fn_error "could not make $CONFIG_STATUS" "$LINENO" 5
+ac_delim_num=`echo "$ac_subst_vars" | grep -c '$'`
 ac_delim='%!_!# '
 for ac_last_try in false false false false false :; do
   . ./conf$$subs.sh ||
-    as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
+    as_fn_error "could not make $CONFIG_STATUS" "$LINENO" 5
 
   ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X`
   if test $ac_delim_n = $ac_delim_num; then
     break
   elif $ac_last_try; then
-    as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
+    as_fn_error "could not make $CONFIG_STATUS" "$LINENO" 5
   else
     ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
   fi
 done
 rm -f conf$$subs.sh
 
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
-cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK &&
+cat >>"\$tmp/subs1.awk" <<\\_ACAWK &&
 _ACEOF
 sed -n '
 h
 s/^/S["/; s/!.*/"]=/
 p
 g
 s/^[^!]*!//
 :repl
@@ -7105,17 +7062,17 @@ t delim
 /^[^""]/{
   N
   s/\n//
 }
 ' >>$CONFIG_STATUS || ac_write_fail=1
 rm -f conf$$subs.awk
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 _ACAWK
-cat >>"\$ac_tmp/subs1.awk" <<_ACAWK &&
+cat >>"\$tmp/subs1.awk" <<_ACAWK &&
   for (key in S) S_is_set[key] = 1
   FS = ""
 
 }
 {
   line = $ 0
   nfields = split(line, field, "@")
   substed = 0
@@ -7137,67 +7094,59 @@ cat >>"\$ac_tmp/subs1.awk" <<_ACAWK &&
 
 _ACAWK
 _ACEOF
 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
 if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then
   sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g"
 else
   cat
-fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \
-  || as_fn_error $? "could not setup config files machinery" "$LINENO" 5
+fi < "$tmp/subs1.awk" > "$tmp/subs.awk" \
+  || as_fn_error "could not setup config files machinery" "$LINENO" 5
 _ACEOF
 
-# VPATH may cause trouble with some makes, so we remove sole $(srcdir),
-# ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and
+# VPATH may cause trouble with some makes, so we remove $(srcdir),
+# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
 # trailing colons and then remove the whole line if VPATH becomes empty
 # (actually we leave an empty line to preserve line numbers).
 if test "x$srcdir" = x.; then
-  ac_vpsub='/^[	 ]*VPATH[	 ]*=[	 ]*/{
-h
-s///
-s/^/:/
-s/[	 ]*$/:/
-s/:\$(srcdir):/:/g
-s/:\${srcdir}:/:/g
-s/:@srcdir@:/:/g
-s/^:*//
+  ac_vpsub='/^[	 ]*VPATH[	 ]*=/{
+s/:*\$(srcdir):*/:/
+s/:*\${srcdir}:*/:/
+s/:*@srcdir@:*/:/
+s/^\([^=]*=[	 ]*\):*/\1/
 s/:*$//
-x
-s/\(=[	 ]*\).*/\1/
-G
-s/\n//
 s/^[^=]*=[	 ]*$//
 }'
 fi
 
 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
 fi # test -n "$CONFIG_FILES"
 
 # Set up the scripts for CONFIG_HEADERS section.
 # No need to generate them if there are no CONFIG_HEADERS.
 # This happens for instance with `./config.status Makefile'.
 if test -n "$CONFIG_HEADERS"; then
-cat >"$ac_tmp/defines.awk" <<\_ACAWK ||
+cat >"$tmp/defines.awk" <<\_ACAWK ||
 BEGIN {
 _ACEOF
 
 # Transform confdefs.h into an awk script `defines.awk', embedded as
 # here-document in config.status, that substitutes the proper values into
 # config.h.in to produce config.h.
 
 # Create a delimiter string that does not exist in confdefs.h, to ease
 # handling of long lines.
 ac_delim='%!_!# '
 for ac_last_try in false false :; do
-  ac_tt=`sed -n "/$ac_delim/p" confdefs.h`
-  if test -z "$ac_tt"; then
+  ac_t=`sed -n "/$ac_delim/p" confdefs.h`
+  if test -z "$ac_t"; then
     break
   elif $ac_last_try; then
-    as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5
+    as_fn_error "could not make $CONFIG_HEADERS" "$LINENO" 5
   else
     ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
   fi
 done
 
 # For the awk script, D is an array of macro values keyed by name,
 # likewise P contains macro parameters if any.  Preserve backslash
 # newline sequences.
@@ -7272,30 +7221,30 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_writ
       next
     }
   }
 }
 { print }
 _ACAWK
 _ACEOF
 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
-  as_fn_error $? "could not setup config headers machinery" "$LINENO" 5
+  as_fn_error "could not setup config headers machinery" "$LINENO" 5
 fi # test -n "$CONFIG_HEADERS"
 
 
 eval set X "  :F $CONFIG_FILES  :H $CONFIG_HEADERS    :C $CONFIG_COMMANDS"
 shift
 for ac_tag
 do
   case $ac_tag in
   :[FHLC]) ac_mode=$ac_tag; continue;;
   esac
   case $ac_mode$ac_tag in
   :[FHL]*:*);;
-  :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;;
+  :L* | :C*:*) as_fn_error "invalid tag \`$ac_tag'" "$LINENO" 5;;
   :[FH]-) ac_tag=-:-;;
   :[FH]*) ac_tag=$ac_tag:$ac_tag.in;;
   esac
   ac_save_IFS=$IFS
   IFS=:
   set x $ac_tag
   IFS=$ac_save_IFS
   shift
@@ -7304,26 +7253,26 @@ do
 
   case $ac_mode in
   :L) ac_source=$1;;
   :[FH])
     ac_file_inputs=
     for ac_f
     do
       case $ac_f in
-      -) ac_f="$ac_tmp/stdin";;
+      -) ac_f="$tmp/stdin";;
       *) # Look for the file first in the build tree, then in the source tree
 	 # (if the path is not absolute).  The absolute path cannot be DOS-style,
 	 # because $ac_f cannot contain `:'.
 	 test -f "$ac_f" ||
 	   case $ac_f in
 	   [\\/$]*) false;;
 	   *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";;
 	   esac ||
-	   as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;;
+	   as_fn_error "cannot find input file: \`$ac_f'" "$LINENO" 5;;
       esac
       case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac
       as_fn_append ac_file_inputs " '$ac_f'"
     done
 
     # Let's still pretend it is `configure' which instantiates (i.e., don't
     # use $as_me), people would be surprised to read:
     #    /* config.h.  Generated by config.status.  */
@@ -7339,18 +7288,18 @@ do
     case $configure_input in #(
     *\&* | *\|* | *\\* )
        ac_sed_conf_input=`$as_echo "$configure_input" |
        sed 's/[\\\\&|]/\\\\&/g'`;; #(
     *) ac_sed_conf_input=$configure_input;;
     esac
 
     case $ac_tag in
-    *:-:* | *:-) cat >"$ac_tmp/stdin" \
-      || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;;
+    *:-:* | *:-) cat >"$tmp/stdin" \
+      || as_fn_error "could not create $ac_file" "$LINENO" 5 ;;
     esac
     ;;
   esac
 
   ac_dir=`$as_dirname -- "$ac_file" ||
 $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
 	 X"$ac_file" : 'X\(//\)[^/]' \| \
 	 X"$ac_file" : 'X\(//\)$' \| \
@@ -7476,57 +7425,56 @@ s&@top_srcdir@&$ac_top_srcdir&;t t
 s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t
 s&@builddir@&$ac_builddir&;t t
 s&@abs_builddir@&$ac_abs_builddir&;t t
 s&@abs_top_builddir@&$ac_abs_top_builddir&;t t
 s&@INSTALL@&$ac_INSTALL&;t t
 s&@MKDIR_P@&$ac_MKDIR_P&;t t
 $ac_datarootdir_hack
 "
-eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \
-  >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5
+eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$tmp/subs.awk" >$tmp/out \
+  || as_fn_error "could not create $ac_file" "$LINENO" 5
 
 test -z "$ac_datarootdir_hack$ac_datarootdir_seen" &&
-  { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } &&
-  { ac_out=`sed -n '/^[	 ]*datarootdir[	 ]*:*=/p' \
-      "$ac_tmp/out"`; test -z "$ac_out"; } &&
+  { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } &&
+  { ac_out=`sed -n '/^[	 ]*datarootdir[	 ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } &&
   { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir'
-which seems to be undefined.  Please make sure it is defined" >&5
+which seems to be undefined.  Please make sure it is defined." >&5
 $as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir'
-which seems to be undefined.  Please make sure it is defined" >&2;}
-
-  rm -f "$ac_tmp/stdin"
+which seems to be undefined.  Please make sure it is defined." >&2;}
+
+  rm -f "$tmp/stdin"
   case $ac_file in
-  -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";;
-  *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";;
+  -) cat "$tmp/out" && rm -f "$tmp/out";;
+  *) rm -f "$ac_file" && mv "$tmp/out" "$ac_file";;
   esac \
-  || as_fn_error $? "could not create $ac_file" "$LINENO" 5
+  || as_fn_error "could not create $ac_file" "$LINENO" 5
  ;;
   :H)
   #
   # CONFIG_HEADER
   #
   if test x"$ac_file" != x-; then
     {
       $as_echo "/* $configure_input  */" \
-      && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs"
-    } >"$ac_tmp/config.h" \
-      || as_fn_error $? "could not create $ac_file" "$LINENO" 5
-    if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then
+      && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs"
+    } >"$tmp/config.h" \
+      || as_fn_error "could not create $ac_file" "$LINENO" 5
+    if diff "$ac_file" "$tmp/config.h" >/dev/null 2>&1; then
       { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5
 $as_echo "$as_me: $ac_file is unchanged" >&6;}
     else
       rm -f "$ac_file"
-      mv "$ac_tmp/config.h" "$ac_file" \
-	|| as_fn_error $? "could not create $ac_file" "$LINENO" 5
+      mv "$tmp/config.h" "$ac_file" \
+	|| as_fn_error "could not create $ac_file" "$LINENO" 5
     fi
   else
     $as_echo "/* $configure_input  */" \
-      && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \
-      || as_fn_error $? "could not create -" "$LINENO" 5
+      && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs" \
+      || as_fn_error "could not create -" "$LINENO" 5
   fi
 # Compute "$ac_file"'s index in $config_headers.
 _am_arg="$ac_file"
 _am_stamp_count=1
 for _am_header in $config_headers :; do
   case $_am_header in
     $_am_arg | $_am_arg:* )
       break ;;
@@ -7666,17 +7614,17 @@ echo "timestamp for $_am_arg" >`$as_dirn
 done # for ac_tag
 
 
 as_fn_exit 0
 _ACEOF
 ac_clean_files=$ac_clean_files_save
 
 test $ac_write_fail = 0 ||
-  as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5
+  as_fn_error "write failure creating $CONFIG_STATUS" "$LINENO" 5
 
 
 # configure is writing to config.log, and then calls config.status.
 # config.status does its own redirection, appending to config.log.
 # Unfortunately, on DOS this fails, as config.log is still kept open
 # by configure, so config.status won't be able to write to it; its
 # output is simply discarded.  So we exec the FD to /dev/null,
 # effectively closing config.log, so it can be properly (re)opened and
@@ -7687,15 +7635,15 @@ if test "$no_create" != yes; then
   ac_config_status_args=
   test "$silent" = yes &&
     ac_config_status_args="$ac_config_status_args --quiet"
   exec 5>/dev/null
   $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false
   exec 5>>config.log
   # Use ||, not &&, to avoid exiting from the if with $? = 1, which
   # would make configure fail if this is the last instruction.
-  $ac_cs_success || as_fn_exit 1
+  $ac_cs_success || as_fn_exit $?
 fi
 if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then
   { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5
 $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;}
 fi
 
--- a/toolkit/crashreporter/google-breakpad/src/client/ios/Breakpad.mm
+++ b/toolkit/crashreporter/google-breakpad/src/client/ios/Breakpad.mm
@@ -33,30 +33,42 @@
   static bool gDebugLog = true;
 #else
   static bool gDebugLog = false;
 #endif
 
 #define DEBUGLOG if (gDebugLog) fprintf
 #define IGNORE_DEBUGGER "BREAKPAD_IGNORE_DEBUGGER"
 
-#import "common/mac/SimpleStringDictionary.h"
+#import "client/ios/Breakpad.h"
+
+#import <Foundation/Foundation.h>
+#include <pthread.h>
+#include <sys/stat.h>
+#include <sys/sysctl.h>
 
 #import "client/mac/crash_generation/ConfigFile.h"
-#import "client/mac/sender/uploader.h"
 #import "client/mac/handler/exception_handler.h"
 #import "client/mac/handler/minidump_generator.h"
-#import "client/ios/Breakpad.h"
+#import "client/mac/sender/uploader.h"
+#import "common/mac/SimpleStringDictionary.h"
 #import "client/ios/handler/ios_exception_minidump_generator.h"
 #import "client/mac/handler/protected_memory_allocator.h"
 
-#import <sys/stat.h>
-#import <sys/sysctl.h>
-
-#import <Foundation/Foundation.h>
+#ifndef __EXCEPTIONS
+// This file uses C++ try/catch (but shouldn't). Duplicate the macros from
+// <c++/4.2.1/exception_defines.h> allowing this file to work properly with
+// exceptions disabled even when other C++ libraries are used. #undef the try
+// and catch macros first in case libstdc++ is in use and has already provided
+// its own definitions.
+#undef try
+#define try       if (true)
+#undef catch
+#define catch(X)  if (false)
+#endif  // __EXCEPTIONS
 
 using google_breakpad::ConfigFile;
 using google_breakpad::EnsureDirectoryPathExists;
 using google_breakpad::KeyValueEntry;
 using google_breakpad::SimpleStringDictionary;
 using google_breakpad::SimpleStringDictionaryIterator;
 
 //=============================================================================
--- a/toolkit/crashreporter/google-breakpad/src/client/ios/BreakpadController.h
+++ b/toolkit/crashreporter/google-breakpad/src/client/ios/BreakpadController.h
@@ -50,16 +50,20 @@
   // The dictionary that contains configuration for breakpad. Modifying it
   // should only happen when the controller is not started. The initial value
   // is the infoDictionary of the bundle of the application.
   NSMutableDictionary* configuration_;
 
   // Whether or not crash reports should be uploaded.
   BOOL enableUploads_;
 
+  // Whether the controller has been started on the main thread. This is only
+  // used to assert the initialization order is correct.
+  BOOL started_;
+
   // The interval to wait between two uploads. Value is 0 if no upload must be
   // done.
   int uploadIntervalInSeconds_;
 }
 
 // Singleton.
 + (BreakpadController*)sharedInstance;
 
--- a/toolkit/crashreporter/google-breakpad/src/client/ios/BreakpadController.mm
+++ b/toolkit/crashreporter/google-breakpad/src/client/ios/BreakpadController.mm
@@ -31,17 +31,17 @@
 
 #import <UIKit/UIKit.h>
 #include <asl.h>
 #include <execinfo.h>
 #include <signal.h>
 #include <unistd.h>
 #include <sys/sysctl.h>
 
-#include <processor/scoped_ptr.h>
+#include <common/scoped_ptr.h>
 
 #pragma mark -
 #pragma mark Private Methods
 
 @interface BreakpadController ()
 
 // Init the singleton instance.
 - (id)initSingleton;
@@ -105,16 +105,17 @@ NSString* GetPlatform() {
 }
 
 - (id)initSingleton {
   self = [super init];
   if (self) {
     queue_ = dispatch_queue_create("com.google.BreakpadQueue", NULL);
     configuration_ = [[[NSBundle mainBundle] infoDictionary] mutableCopy];
     enableUploads_ = NO;
+    started_ = NO;
     NSString* uploadInterval =
         [configuration_ valueForKey:@BREAKPAD_REPORT_INTERVAL];
     [self setUploadInterval:[uploadInterval intValue]];
   }
   return self;
 }
 
 // Since this class is a singleton, this method is not expected to be called.
@@ -123,39 +124,47 @@ NSString* GetPlatform() {
   dispatch_release(queue_);
   [configuration_ release];
   [super dealloc];
 }
 
 #pragma mark -
 
 - (void)start:(BOOL)onCurrentThread {
+  if (started_)
+    return;
+  started_ = YES;
   void(^startBlock)() = ^{
       assert(!breakpadRef_);
       breakpadRef_ = BreakpadCreate(configuration_);
       if (breakpadRef_) {
         BreakpadAddUploadParameter(breakpadRef_, @"platform", GetPlatform());
       }
   };
   if (onCurrentThread)
     startBlock();
   else
     dispatch_async(queue_, startBlock);
 }
 
 - (void)stop {
+  if (!started_)
+    return;
+  started_ = NO;
   dispatch_sync(queue_, ^{
       if (breakpadRef_) {
         BreakpadRelease(breakpadRef_);
         breakpadRef_ = NULL;
       }
   });
 }
 
 - (void)setUploadingEnabled:(BOOL)enabled {
+  NSAssert(started_,
+      @"The controller must be started before setUploadingEnabled is called");
   dispatch_async(queue_, ^{
       if (enabled == enableUploads_)
         return;
       if (enabled) {
         // Set this before calling doSendStoredCrashReport, because that
         // calls sendDelay, which in turn checks this flag.
         enableUploads_ = YES;
         [self sendStoredCrashReports];
@@ -164,49 +173,61 @@ NSString* GetPlatform() {
         [NSObject cancelPreviousPerformRequestsWithTarget:self
             selector:@selector(sendStoredCrashReports)
             object:nil];
       }
   });
 }
 
 - (void)updateConfiguration:(NSDictionary*)configuration {
+  NSAssert(!started_,
+      @"The controller must not be started when updateConfiguration is called");
   [configuration_ addEntriesFromDictionary:configuration];
   NSString* uploadInterval =
       [configuration_ valueForKey:@BREAKPAD_REPORT_INTERVAL];
   if (uploadInterval)
     [self setUploadInterval:[uploadInterval intValue]];
 }
 
 - (void)setUploadingURL:(NSString*)url {
+  NSAssert(!started_,
+      @"The controller must not be started when setUploadingURL is called");
   [configuration_ setValue:url forKey:@BREAKPAD_URL];
 }
 
 - (void)setUploadInterval:(int)intervalInSeconds {
+  NSAssert(!started_,
+      @"The controller must not be started when setUploadInterval is called");
   [configuration_ removeObjectForKey:@BREAKPAD_REPORT_INTERVAL];
   uploadIntervalInSeconds_ = intervalInSeconds;
   if (uploadIntervalInSeconds_ < 0)
     uploadIntervalInSeconds_ = 0;
 }
 
 - (void)addUploadParameter:(NSString*)value forKey:(NSString*)key {
+  NSAssert(started_,
+      @"The controller must be started before addUploadParameter is called");
   dispatch_async(queue_, ^{
       if (breakpadRef_)
         BreakpadAddUploadParameter(breakpadRef_, key, value);
   });
 }
 
 - (void)removeUploadParameterForKey:(NSString*)key {
+  NSAssert(started_, @"The controller must be started before "
+                     "removeUploadParameterForKey is called");
   dispatch_async(queue_, ^{
       if (breakpadRef_)
         BreakpadRemoveUploadParameter(breakpadRef_, key);
   });
 }
 
 - (void)withBreakpadRef:(void(^)(BreakpadRef))callback {
+  NSAssert(started_,
+      @"The controller must be started before withBreakpadRef is called");
   dispatch_async(queue_, ^{
       callback(breakpadRef_);
   });
 }
 
 
 #pragma mark -
 
--- a/toolkit/crashreporter/google-breakpad/src/client/ios/handler/ios_exception_minidump_generator.mm
+++ b/toolkit/crashreporter/google-breakpad/src/client/ios/handler/ios_exception_minidump_generator.mm
@@ -26,17 +26,17 @@
 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
 #include "client/ios/handler/ios_exception_minidump_generator.h"
 
 #include "google_breakpad/common/minidump_exception_mac.h"
 #include "client/minidump_file_writer-inl.h"
-#include "processor/scoped_ptr.h"
+#include "common/scoped_ptr.h"
 
 namespace {
 
 const uint32_t kExpectedFinalFp = 4;
 const uint32_t kExpectedFinalSp = 0;
 const int kExceptionType = EXC_SOFTWARE;
 const int kExceptionCode = MD_EXCEPTION_CODE_MAC_NS_EXCEPTION;
 
--- a/toolkit/crashreporter/google-breakpad/src/client/linux/handler/exception_handler.cc
+++ b/toolkit/crashreporter/google-breakpad/src/client/linux/handler/exception_handler.cc
@@ -235,50 +235,50 @@ ExceptionHandler::~ExceptionHandler() {
 
 // Runs before crashing: normal context.
 // static
 bool ExceptionHandler::InstallHandlersLocked() {
   if (handlers_installed)
     return false;
 
   // Fail if unable to store all the old handlers.
-  for (unsigned i = 0; i < kNumHandledSignals; ++i) {
+  for (int i = 0; i < kNumHandledSignals; ++i) {
     if (sigaction(kExceptionSignals[i], NULL, &old_handlers[i]) == -1)
       return false;
   }
 
   struct sigaction sa;
   memset(&sa, 0, sizeof(sa));
   sigemptyset(&sa.sa_mask);
 
   // Mask all exception signals when we're handling one of them.
-  for (unsigned i = 0; i < kNumHandledSignals; ++i)
+  for (int i = 0; i < kNumHandledSignals; ++i)
     sigaddset(&sa.sa_mask, kExceptionSignals[i]);
 
   sa.sa_sigaction = SignalHandler;
   sa.sa_flags = SA_ONSTACK | SA_SIGINFO;
 
-  for (unsigned i = 0; i < kNumHandledSignals; ++i) {
+  for (int i = 0; i < kNumHandledSignals; ++i) {
     if (sigaction(kExceptionSignals[i], &sa, NULL) == -1) {
       // At this point it is impractical to back out changes, and so failure to
       // install a signal is intentionally ignored.
     }
   }
   handlers_installed = true;
   return true;
 }
 
 // This function runs in a compromised context: see the top of the file.
 // Runs on the crashing thread.
 // static
 void ExceptionHandler::RestoreHandlersLocked() {
   if (!handlers_installed)
     return;
 
-  for (unsigned i = 0; i < kNumHandledSignals; ++i) {
+  for (int i = 0; i < kNumHandledSignals; ++i) {
     if (sigaction(kExceptionSignals[i], &old_handlers[i], NULL) == -1) {
       signal(kExceptionSignals[i], SIG_DFL);
     }
   }
   handlers_installed = false;
 }
 
 // void ExceptionHandler::set_crash_handler(HandlerCallback callback) {
@@ -287,16 +287,45 @@ void ExceptionHandler::RestoreHandlersLo
 
 // This function runs in a compromised context: see the top of the file.
 // Runs on the crashing thread.
 // static
 void ExceptionHandler::SignalHandler(int sig, siginfo_t* info, void* uc) {
   // All the exception signals are blocked at this point.
   pthread_mutex_lock(&handler_stack_mutex_);
 
+  // Sometimes, Breakpad runs inside a process where some other buggy code
+  // saves and restores signal handlers temporarily with 'signal'
+  // instead of 'sigaction'. This loses the SA_SIGINFO flag associated
+  // with this function. As a consequence, the values of 'info' and 'uc'
+  // become totally bogus, generally inducing a crash.
+  //
+  // The following code tries to detect this case. When it does, it
+  // resets the signal handlers with sigaction + SA_SIGINFO and returns.
+  // This forces the signal to be thrown again, but this time the kernel
+  // will call the function with the right arguments.
+  struct sigaction cur_handler;
+  if (sigaction(sig, NULL, &cur_handler) == 0 &&
+      (cur_handler.sa_flags & SA_SIGINFO) == 0) {
+    // Reset signal handler with the right flags.
+    sigemptyset(&cur_handler.sa_mask);
+    sigaddset(&cur_handler.sa_mask, sig);
+
+    cur_handler.sa_sigaction = SignalHandler;
+    cur_handler.sa_flags = SA_ONSTACK | SA_SIGINFO;
+
+    if (sigaction(sig, &cur_handler, NULL) == -1) {
+      // When resetting the handler fails, try to reset the
+      // default one to avoid an infinite loop here.
+      signal(sig, SIG_DFL);
+    }
+    pthread_mutex_unlock(&handler_stack_mutex_);
+    return;
+  }
+
   bool handled = false;
   for (int i = handler_stack_->size() - 1; !handled && i >= 0; --i) {
     handled = (*handler_stack_)[i]->HandleSignal(sig, info, uc);
   }
 
   // Upon returning from this signal handler, sig will become unmasked and then
   // it will be retriggered. If one of the ExceptionHandlers handled it
   // successfully, restore the default handler. Otherwise, restore the
@@ -381,18 +410,21 @@ bool ExceptionHandler::HandleSignal(int 
     }
   }
   return GenerateDump(&context);
 }
 
 // This is a public interface to HandleSignal that allows the client to
 // generate a crash dump. This function may run in a compromised context.
 bool ExceptionHandler::SimulateSignalDelivery(int sig) {
-  siginfo_t siginfo;
-  my_memset(&siginfo, 0, sizeof(siginfo_t));
+  siginfo_t siginfo = {};
+  // Mimic a trusted signal to allow tracing the process (see
+  // ExceptionHandler::HandleSignal().
+  siginfo.si_code = SI_USER;
+  siginfo.si_pid = getpid();
   struct ucontext context;
   getcontext(&context);
   return HandleSignal(sig, &siginfo, &context);
 }
 
 // This function may run in a compromised context: see the top of the file.
 bool ExceptionHandler::GenerateDump(CrashContext *context) {
   if (IsOutOfProcess())
@@ -487,23 +519,25 @@ void ExceptionHandler::WaitForContinueSi
 }
 
 // This function runs in a compromised context: see the top of the file.
 // Runs on the cloned process.
 bool ExceptionHandler::DoDump(pid_t crashing_process, const void* context,
                               size_t context_size) {
   if (minidump_descriptor_.IsFD()) {
     return google_breakpad::WriteMinidump(minidump_descriptor_.fd(),
+                                          minidump_descriptor_.size_limit(),
                                           crashing_process,
                                           context,
                                           context_size,
                                           mapping_list_,
                                           app_memory_list_);
   }
   return google_breakpad::WriteMinidump(minidump_descriptor_.path(),
+                                        minidump_descriptor_.size_limit(),
                                         crashing_process,
                                         context,
                                         context_size,
                                         mapping_list_,
                                         app_memory_list_);
 }
 
 // static
--- a/toolkit/crashreporter/google-breakpad/src/client/linux/handler/exception_handler.h
+++ b/toolkit/crashreporter/google-breakpad/src/client/linux/handler/exception_handler.h
@@ -37,19 +37,19 @@
 #include <signal.h>
 #include <stdint.h>
 #include <stdio.h>
 #include <sys/ucontext.h>
 
 #include "client/linux/crash_generation/crash_generation_client.h"
 #include "client/linux/handler/minidump_descriptor.h"
 #include "client/linux/minidump_writer/minidump_writer.h"
+#include "common/scoped_ptr.h"
 #include "common/using_std_string.h"
 #include "google_breakpad/common/minidump_format.h"
-#include "processor/scoped_ptr.h"
 
 namespace google_breakpad {
 
 // ExceptionHandler
 //
 // ExceptionHandler can write a minidump file when an exception occurs,
 // or when WriteMinidump() is called explicitly by your program.
 //
--- a/toolkit/crashreporter/google-breakpad/src/client/linux/handler/exception_handler_unittest.cc
+++ b/toolkit/crashreporter/google-breakpad/src/client/linux/handler/exception_handler_unittest.cc
@@ -103,19 +103,19 @@ void ReadMinidumpPathFromPipe(int fd, st
   memset(&pfd, 0, sizeof(pfd));
   pfd.fd = fd;
   pfd.events = POLLIN | POLLERR;
 
   const int r = HANDLE_EINTR(poll(&pfd, 1, 0));
   ASSERT_EQ(1, r);
   ASSERT_TRUE(pfd.revents & POLLIN);
 
-  uint32_t len;
+  int32_t len;
   ASSERT_EQ(static_cast<ssize_t>(sizeof(len)), read(fd, &len, sizeof(len)));
-  ASSERT_LT(len, static_cast<uint32_t>(2048));
+  ASSERT_LT(len, 2048);
   char* filename = static_cast<char*>(malloc(len + 1));
   ASSERT_EQ(len, read(fd, filename, len));
   filename[len] = 0;
   close(fd);
   *path = filename;
   free(filename);
 }
 
@@ -189,17 +189,17 @@ void ChildCrash(bool use_fd) {
 
   ASSERT_NO_FATAL_FAILURE(WaitForProcessToTerminate(child, SIGSEGV));
 
   if (!use_fd)
     ASSERT_NO_FATAL_FAILURE(ReadMinidumpPathFromPipe(fds[0], &minidump_path));
 
   struct stat st;
   ASSERT_EQ(0, stat(minidump_path.c_str(), &st));
-  ASSERT_GT(st.st_size, 0u);
+  ASSERT_GT(st.st_size, 0);
   unlink(minidump_path.c_str());
 }
 
 TEST(ExceptionHandlerTest, ChildCrashWithPath) {
   ASSERT_NO_FATAL_FAILURE(ChildCrash(false));
 }
 
 TEST(ExceptionHandlerTest, ChildCrashWithFD) {
@@ -312,16 +312,49 @@ TEST(ExceptionHandlerTest, RedeliveryToD
     CrashWithCallbacks(FilterCallbackReturnFalse, NULL, temp_dir.path());
   }
 
   // As RaiseSIGKILL wasn't installed, the redelivery should just kill the child
   // with SIGSEGV.
   ASSERT_NO_FATAL_FAILURE(WaitForProcessToTerminate(child, SIGSEGV));
 }
 
+// Check that saving and restoring the signal handler with 'signal'
+// instead of 'sigaction' doesn't make the Breakpad signal handler
+// crash. See comments in ExceptionHandler::SignalHandler for full
+// details.
+TEST(ExceptionHandlerTest, RedeliveryOnBadSignalHandlerFlag) {
+  AutoTempDir temp_dir;
+  const pid_t child = fork();
+  if (child == 0) {
+    // Install the RaiseSIGKILL handler for SIGSEGV.
+    ASSERT_TRUE(InstallRaiseSIGKILL());
+
+    // Create a new exception handler, this installs a new SIGSEGV
+    // handler, after saving the old one.
+    ExceptionHandler handler(
+        MinidumpDescriptor(temp_dir.path()), NULL,
+        DoneCallbackReturnFalse, NULL, true, -1);
+
+    // Install the default SIGSEGV handler, saving the current one.
+    // Then re-install the current one with 'signal', this loses the
+    // SA_SIGINFO flag associated with the Breakpad handler.
+    sighandler_t old_handler = signal(SIGSEGV, SIG_DFL);
+    ASSERT_NE(reinterpret_cast<void*>(old_handler),
+              reinterpret_cast<void*>(SIG_ERR));
+    ASSERT_NE(reinterpret_cast<void*>(signal(SIGSEGV, old_handler)),
+              reinterpret_cast<void*>(SIG_ERR));
+
+    // Crash with the exception handler in scope.
+    *reinterpret_cast<volatile int*>(NULL) = 0;
+  }
+  // SIGKILL means Breakpad's signal handler didn't crash.
+  ASSERT_NO_FATAL_FAILURE(WaitForProcessToTerminate(child, SIGKILL));
+}
+
 TEST(ExceptionHandlerTest, StackedHandlersDeliveredToTop) {
   AutoTempDir temp_dir;
 
   const pid_t child = fork();
   if (child == 0) {
     ExceptionHandler bottom(MinidumpDescriptor(temp_dir.path()),
                             NULL,
                             NULL,
@@ -427,30 +460,30 @@ TEST(ExceptionHandlerTest, InstructionPo
 
   ASSERT_NO_FATAL_FAILURE(WaitForProcessToTerminate(child, SIGILL));
 
   string minidump_path;
   ASSERT_NO_FATAL_FAILURE(ReadMinidumpPathFromPipe(fds[0], &minidump_path));
 
   struct stat st;
   ASSERT_EQ(0, stat(minidump_path.c_str(), &st));
-  ASSERT_GT(st.st_size, 0u);
+  ASSERT_GT(st.st_size, 0);
 
   // Read the minidump. Locate the exception record and the
   // memory list, and then ensure that there is a memory region
   // in the memory list that covers the instruction pointer from
   // the exception record.
   Minidump minidump(minidump_path);
   ASSERT_TRUE(minidump.Read());
 
   MinidumpException* exception = minidump.GetException();
   MinidumpMemoryList* memory_list = minidump.GetMemoryList();
   ASSERT_TRUE(exception);
   ASSERT_TRUE(memory_list);
-  ASSERT_LT(0, memory_list->region_count());
+  ASSERT_LT(0U, memory_list->region_count());
 
   MinidumpContext* context = exception->GetContext();
   ASSERT_TRUE(context);
 
   u_int64_t instruction_pointer;
   ASSERT_TRUE(context->GetInstructionPointer(&instruction_pointer));
 
   MinidumpMemoryRegion* region =
@@ -519,30 +552,30 @@ TEST(ExceptionHandlerTest, InstructionPo
 
   ASSERT_NO_FATAL_FAILURE(WaitForProcessToTerminate(child, SIGILL));
 
   string minidump_path;
   ASSERT_NO_FATAL_FAILURE(ReadMinidumpPathFromPipe(fds[0], &minidump_path));
 
   struct stat st;
   ASSERT_EQ(0, stat(minidump_path.c_str(), &st));
-  ASSERT_GT(st.st_size, 0u);
+  ASSERT_GT(st.st_size, 0);
 
   // Read the minidump. Locate the exception record and the
   // memory list, and then ensure that there is a memory region
   // in the memory list that covers the instruction pointer from
   // the exception record.
   Minidump minidump(minidump_path);
   ASSERT_TRUE(minidump.Read());
 
   MinidumpException* exception = minidump.GetException();
   MinidumpMemoryList* memory_list = minidump.GetMemoryList();
   ASSERT_TRUE(exception);
   ASSERT_TRUE(memory_list);
-  ASSERT_LT(0, memory_list->region_count());
+  ASSERT_LT(0U, memory_list->region_count());
 
   MinidumpContext* context = exception->GetContext();
   ASSERT_TRUE(context);
 
   u_int64_t instruction_pointer;
   ASSERT_TRUE(context->GetInstructionPointer(&instruction_pointer));
 
   MinidumpMemoryRegion* region =
@@ -610,29 +643,29 @@ TEST(ExceptionHandlerTest, InstructionPo
 
   ASSERT_NO_FATAL_FAILURE(WaitForProcessToTerminate(child, SIGILL));
 
   string minidump_path;
   ASSERT_NO_FATAL_FAILURE(ReadMinidumpPathFromPipe(fds[0], &minidump_path));
 
   struct stat st;
   ASSERT_EQ(0, stat(minidump_path.c_str(), &st));
-  ASSERT_GT(st.st_size, 0u);
+  ASSERT_GT(st.st_size, 0);
 
   // Read the minidump. Locate the exception record and the memory list, and
   // then ensure that there is a memory region in the memory list that covers
   // the instruction pointer from the exception record.
   Minidump minidump(minidump_path);
   ASSERT_TRUE(minidump.Read());
 
   MinidumpException* exception = minidump.GetException();
   MinidumpMemoryList* memory_list = minidump.GetMemoryList();
   ASSERT_TRUE(exception);
   ASSERT_TRUE(memory_list);
-  ASSERT_LT(0, memory_list->region_count());
+  ASSERT_LT(0U, memory_list->region_count());
 
   MinidumpContext* context = exception->GetContext();
   ASSERT_TRUE(context);
 
   u_int64_t instruction_pointer;
   ASSERT_TRUE(context->GetInstructionPointer(&instruction_pointer));
 
   MinidumpMemoryRegion* region =
@@ -681,17 +714,17 @@ TEST(ExceptionHandlerTest, InstructionPo
 
   ASSERT_NO_FATAL_FAILURE(WaitForProcessToTerminate(child, SIGSEGV));
 
   string minidump_path;
   ASSERT_NO_FATAL_FAILURE(ReadMinidumpPathFromPipe(fds[0], &minidump_path));
 
   struct stat st;
   ASSERT_EQ(0, stat(minidump_path.c_str(), &st));
-  ASSERT_GT(st.st_size, 0u);
+  ASSERT_GT(st.st_size, 0);
 
   // Read the minidump. Locate the exception record and the
   // memory list, and then ensure that there is a memory region
   // in the memory list that covers the instruction pointer from
   // the exception record.
   Minidump minidump(minidump_path);
   ASSERT_TRUE(minidump.Read());
 
@@ -849,17 +882,17 @@ TEST(ExceptionHandlerTest, ExternalDumpe
   iov.iov_base = context;
   iov.iov_len = kCrashContextSize;
   msg.msg_iov = &iov;
   msg.msg_iovlen = 1;
   msg.msg_control = control;
   msg.msg_controllen = kControlMsgSize;
 
   const ssize_t n = HANDLE_EINTR(recvmsg(fds[0], &msg, 0));
-  ASSERT_EQ(kCrashContextSize, n);
+  ASSERT_EQ(static_cast<ssize_t>(kCrashContextSize), n);
   ASSERT_EQ(kControlMsgSize, msg.msg_controllen);
   ASSERT_EQ(0, msg.msg_flags);
   ASSERT_EQ(0, close(fds[0]));
 
   pid_t crashing_pid = -1;
   int signal_fd = -1;
   for (struct cmsghdr *hdr = CMSG_FIRSTHDR(&msg); hdr;
        hdr = CMSG_NXTHDR(&msg, hdr)) {
@@ -880,24 +913,24 @@ TEST(ExceptionHandlerTest, ExternalDumpe
   ASSERT_NE(crashing_pid, -1);
   ASSERT_NE(signal_fd, -1);
 
   AutoTempDir temp_dir;
   string templ = temp_dir.path() + "/exception-handler-unittest";
   ASSERT_TRUE(WriteMinidump(templ.c_str(), crashing_pid, context,
                             kCrashContextSize));
   static const char b = 0;
-  ASSERT_EQ(1U, (HANDLE_EINTR(write(signal_fd, &b, 1))));
+  ASSERT_EQ(1, (HANDLE_EINTR(write(signal_fd, &b, 1))));
   ASSERT_EQ(0, close(signal_fd));
 
   ASSERT_NO_FATAL_FAILURE(WaitForProcessToTerminate(child, SIGSEGV));
 
   struct stat st;
   ASSERT_EQ(0, stat(templ.c_str(), &st));
-  ASSERT_GT(st.st_size, 0U);
+  ASSERT_GT(st.st_size, 0);
   unlink(templ.c_str());
 }
 
 TEST(ExceptionHandlerTest, WriteMinidumpExceptionStream) {
   AutoTempDir temp_dir;
   ExceptionHandler handler(MinidumpDescriptor(temp_dir.path()), NULL, NULL,
                            NULL, false, -1);
   ASSERT_TRUE(handler.WriteMinidump());
@@ -936,28 +969,28 @@ TEST(ExceptionHandlerTest, GenerateMulti
   AutoTempDir temp_dir;
   ExceptionHandler handler(MinidumpDescriptor(temp_dir.path()), NULL, NULL,
                            NULL, false, -1);
   ASSERT_TRUE(handler.WriteMinidump());
 
   const MinidumpDescriptor& minidump_1 = handler.minidump_descriptor();
   struct stat st;
   ASSERT_EQ(0, stat(minidump_1.path(), &st));
-  ASSERT_GT(st.st_size, 0U);
+  ASSERT_GT(st.st_size, 0);
   string minidump_1_path(minidump_1.path());
   // Check it is a valid minidump.
   Minidump minidump1(minidump_1_path);
   ASSERT_TRUE(minidump1.Read());
   unlink(minidump_1.path());
 
   // Generate another minidump, it should go to a different file.
   ASSERT_TRUE(handler.WriteMinidump());
   const MinidumpDescriptor& minidump_2 = handler.minidump_descriptor();
   ASSERT_EQ(0, stat(minidump_2.path(), &st));
-  ASSERT_GT(st.st_size, 0U);
+  ASSERT_GT(st.st_size, 0);
   string minidump_2_path(minidump_2.path());
   // Check it is a valid minidump.
   Minidump minidump2(minidump_2_path);
   ASSERT_TRUE(minidump2.Read());
   unlink(minidump_2.path());
 
   // 2 distinct files should be produced.
   ASSERT_STRNE(minidump_1_path.c_str(), minidump_2_path.c_str());
@@ -1073,17 +1106,17 @@ TEST(ExceptionHandlerTest, WriteMinidump
 
   Minidump minidump(minidump_filename);
   ASSERT_TRUE(minidump.Read());
   // Check that the crashing thread is the main thread of |child|
   MinidumpException* exception = minidump.GetException();
   ASSERT_TRUE(exception);
   u_int32_t thread_id;
   ASSERT_TRUE(exception->GetThreadID(&thread_id));
-  EXPECT_EQ(child, thread_id);
+  EXPECT_EQ(child, static_cast<int32_t>(thread_id));
 
   const MDRawExceptionStream* raw = exception->exception();
   ASSERT_TRUE(raw);
   EXPECT_EQ(MD_EXCEPTION_CODE_LIN_DUMP_REQUESTED,
             raw->exception_record.exception_code);
 
   close(fds[1]);
   unlink(minidump_filename.c_str());
--- a/toolkit/crashreporter/google-breakpad/src/client/linux/handler/minidump_descriptor.cc
+++ b/toolkit/crashreporter/google-breakpad/src/client/linux/handler/minidump_descriptor.cc
@@ -60,17 +60,18 @@ MinidumpDescriptor& MinidumpDescriptor::
   return *this;
 }
 
 void MinidumpDescriptor::UpdatePath() {
   assert(fd_ == -1 && !directory_.empty());
 
   GUID guid;
   char guid_str[kGUIDStringLength + 1];
-  bool r = CreateGUID(&guid) && GUIDToString(&guid, guid_str, sizeof(guid_str));
-  assert(r);
+  if (!CreateGUID(&guid) || !GUIDToString(&guid, guid_str, sizeof(guid_str))) {
+    assert(false);
+  }
 
   path_.clear();
   path_ = directory_ + "/" + guid_str + ".dmp";  
   c_path_ = path_.c_str();
 }
 
 }  // namespace google_breakpad
--- a/toolkit/crashreporter/google-breakpad/src/client/linux/handler/minidump_descriptor.h
+++ b/toolkit/crashreporter/google-breakpad/src/client/linux/handler/minidump_descriptor.h
@@ -26,16 +26,18 @@
 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
 #ifndef CLIENT_LINUX_HANDLER_MINIDUMP_DESCRIPTOR_H_
 #define CLIENT_LINUX_HANDLER_MINIDUMP_DESCRIPTOR_H_
 
 #include <assert.h>
+#include <sys/types.h>
+
 #include <string>
 
 #include "common/using_std_string.h"
 
 // The MinidumpDescriptor describes how to access a minidump: it can contain
 // either a file descriptor or a path.
 // Note that when using files, it is created with the path to a directory.
 // The actual path where the minidump is generated is created by this class.
@@ -43,21 +45,25 @@ namespace google_breakpad {
 
 class MinidumpDescriptor {
  public:
   MinidumpDescriptor() : fd_(-1) {}
 
   explicit MinidumpDescriptor(const string& directory)
       : fd_(-1),
         directory_(directory),
-        c_path_(NULL) {
+        c_path_(NULL),
+        size_limit_(-1) {
     assert(!directory.empty());
   }
 
-  explicit MinidumpDescriptor(int fd) : fd_(fd), c_path_(NULL) {
+  explicit MinidumpDescriptor(int fd)
+      : fd_(fd),
+        c_path_(NULL),
+        size_limit_(-1) {
     assert(fd != -1);
   }
 
   explicit MinidumpDescriptor(const MinidumpDescriptor& descriptor);
   MinidumpDescriptor& operator=(const MinidumpDescriptor& descriptor);
 
   bool IsFD() const { return fd_ != -1; }
 
@@ -66,24 +72,29 @@ class MinidumpDescriptor {
   string directory() const { return directory_; }
 
   const char* path() const { return c_path_; }
 
   // Updates the path so it is unique.
   // Should be called from a normal context: this methods uses the heap.
   void UpdatePath();
 
+  off_t size_limit() const { return size_limit_; }
+  void set_size_limit(off_t limit) { size_limit_ = limit; }
+
  private:
   // The file descriptor where the minidump is generated.
   int fd_;
 
   // The directory where the minidump should be generated.
   string directory_;
   // The full path to the generated minidump.
   string path_;
   // The C string of |path_|. Precomputed so it can be access from a compromised
   // context.
   const char* c_path_;
+
+  off_t size_limit_;
 };
 
 }  // namespace google_breakpad
 
 #endif  // CLIENT_LINUX_HANDLER_MINIDUMP_DESCRIPTOR_H_
--- a/toolkit/crashreporter/google-breakpad/src/client/linux/minidump_writer/line_reader_unittest.cc
+++ b/toolkit/crashreporter/google-breakpad/src/client/linux/minidump_writer/line_reader_unittest.cc
@@ -161,17 +161,17 @@ TEST(LineReaderTest, TwoLines) {
   close(fd);
 }
 
 TEST(LineReaderTest, MaxLength) {
   const int fd = TemporaryFile();
   char l[LineReader::kMaxLineLen - 1];
   memset(l, 'a', sizeof(l));
   const int r = HANDLE_EINTR(write(fd, l, sizeof(l)));
-  ASSERT_EQ(sizeof(l), r);
+  ASSERT_EQ(static_cast<ssize_t>(sizeof(l)), r);
   lseek(fd, 0, SEEK_SET);
   LineReader reader(fd);
 
   const char *line;
   unsigned len;
   ASSERT_TRUE(reader.GetNextLine(&line, &len));
   ASSERT_EQ(sizeof(l), len);
   ASSERT_TRUE(memcmp(l, line, sizeof(l)) == 0);
@@ -180,17 +180,17 @@ TEST(LineReaderTest, MaxLength) {
   close(fd);
 }
 
 TEST(LineReaderTest, TooLong) {
   const int fd = TemporaryFile();
   char l[LineReader::kMaxLineLen];
   memset(l, 'a', sizeof(l));
   const int r = HANDLE_EINTR(write(fd, l, sizeof(l)));
-  ASSERT_EQ(sizeof(l), r);
+  ASSERT_EQ(static_cast<ssize_t>(sizeof(l)), r);
   lseek(fd, 0, SEEK_SET);
   LineReader reader(fd);
 
   const char *line;
   unsigned len;
   ASSERT_FALSE(reader.GetNextLine(&line, &len));
 
   close(fd);
--- a/toolkit/crashreporter/google-breakpad/src/client/linux/minidump_writer/linux_core_dumper.cc
+++ b/toolkit/crashreporter/google-breakpad/src/client/linux/minidump_writer/linux_core_dumper.cc
@@ -97,19 +97,18 @@ bool LinuxCoreDumper::GetThreadInfoByInd
   memcpy(&stack_pointer, &info->regs.esp, sizeof(info->regs.esp));
 #elif defined(__x86_64)
   memcpy(&stack_pointer, &info->regs.rsp, sizeof(info->regs.rsp));
 #elif defined(__ARM_EABI__)
   memcpy(&stack_pointer, &info->regs.ARM_sp, sizeof(info->regs.ARM_sp));
 #else
 #error "This code hasn't been ported to your platform yet."
 #endif
-
-  return GetStackInfo(&info->stack, &info->stack_len,
-                      reinterpret_cast<uintptr_t>(stack_pointer));
+  info->stack_pointer = reinterpret_cast<uintptr_t>(stack_pointer);
+  return true;
 }
 
 bool LinuxCoreDumper::IsPostMortem() const {
   return true;
 }
 
 bool LinuxCoreDumper::ThreadsSuspend() {
   return true;
--- a/toolkit/crashreporter/google-breakpad/src/client/linux/minidump_writer/linux_core_dumper_unittest.cc
+++ b/toolkit/crashreporter/google-breakpad/src/client/linux/minidump_writer/linux_core_dumper_unittest.cc
@@ -91,20 +91,23 @@ TEST(LinuxCoreDumperTest, VerifyDumpWith
   EXPECT_TRUE(dumper.IsPostMortem());
 
   // These are no-ops and should always return true.
   EXPECT_TRUE(dumper.ThreadsSuspend());
   EXPECT_TRUE(dumper.ThreadsResume());
 
   // LinuxCoreDumper cannot determine the crash address and thus it always
   // sets the crash address to 0.
-  EXPECT_EQ(0, dumper.crash_address());
+  EXPECT_EQ(0U, dumper.crash_address());
   EXPECT_EQ(kCrashSignal, dumper.crash_signal());
   EXPECT_EQ(crash_generator.GetThreadId(kCrashThread),
             dumper.crash_thread());
 
   EXPECT_EQ(kNumOfThreads, dumper.threads().size());
   for (unsigned i = 0; i < kNumOfThreads; ++i) {
     ThreadInfo info;
     EXPECT_TRUE(dumper.GetThreadInfoByIndex(i, &info));
+    const void* stack;
+    size_t stack_len;
+    EXPECT_TRUE(dumper.GetStackInfo(&stack, &stack_len, info.stack_pointer));
     EXPECT_EQ(getpid(), info.ppid);
   }
 }
--- a/toolkit/crashreporter/google-breakpad/src/client/linux/minidump_writer/linux_dumper.h
+++ b/toolkit/crashreporter/google-breakpad/src/client/linux/minidump_writer/linux_dumper.h
@@ -67,20 +67,17 @@ typedef typeof(((elf_aux_entry*) 0)->a_u
 // This should always be less than NAME_MAX!
 const char kLinuxGateLibraryName[] = "linux-gate.so";
 
 // We produce one of these structures for each thread in the crashed process.
 struct ThreadInfo {
   pid_t tgid;   // thread group id
   pid_t ppid;   // parent process
 
-  // Even on platforms where the stack grows down, the following will point to
-  // the smallest address in the stack.
-  const void* stack;  // pointer to the stack area
-  size_t stack_len;  // length of the stack to copy
+  uintptr_t stack_pointer;  // thread stack pointer
 
 
 #if defined(__i386) || defined(__x86_64)
   user_regs_struct regs;
   user_fpregs_struct fpregs;
   static const unsigned kNumDebugRegisters = 8;
   debugreg_t dregs[8];
 #if defined(__i386)
--- a/toolkit/crashreporter/google-breakpad/src/client/linux/minidump_writer/linux_dumper_unittest_helper.cc
+++ b/toolkit/crashreporter/google-breakpad/src/client/linux/minidump_writer/linux_dumper_unittest_helper.cc
@@ -33,17 +33,17 @@
 
 #include <pthread.h>
 #include <stdint.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <sys/syscall.h>
 #include <unistd.h>
 
-#include "processor/scoped_ptr.h"
+#include "common/scoped_ptr.h"
 #include "third_party/lss/linux_syscall_support.h"
 
 #if defined(__ARM_EABI__)
 #define TID_PTR_REGISTER "r3"
 #elif defined(__i386)
 #define TID_PTR_REGISTER "ecx"
 #elif defined(__x86_64)
 #define TID_PTR_REGISTER "rcx"
--- a/toolkit/crashreporter/google-breakpad/src/client/linux/minidump_writer/linux_ptrace_dumper.cc
+++ b/toolkit/crashreporter/google-breakpad/src/client/linux/minidump_writer/linux_ptrace_dumper.cc
@@ -213,19 +213,19 @@ bool LinuxPtraceDumper::GetThreadInfoByI
   my_memcpy(&stack_pointer, &info->regs.esp, sizeof(info->regs.esp));
 #elif defined(__x86_64)
   my_memcpy(&stack_pointer, &info->regs.rsp, sizeof(info->regs.rsp));
 #elif defined(__ARM_EABI__)
   my_memcpy(&stack_pointer, &info->regs.ARM_sp, sizeof(info->regs.ARM_sp));
 #else
 #error "This code hasn't been ported to your platform yet."
 #endif
+  info->stack_pointer = reinterpret_cast<uintptr_t>(stack_pointer);
 
-  return GetStackInfo(&info->stack, &info->stack_len,
-                      (uintptr_t) stack_pointer);
+  return true;
 }
 
 bool LinuxPtraceDumper::IsPostMortem() const {
   return false;
 }
 
 bool LinuxPtraceDumper::ThreadsSuspend() {
   if (threads_suspended_)
--- a/toolkit/crashreporter/google-breakpad/src/client/linux/minidump_writer/linux_ptrace_dumper_unittest.cc
+++ b/toolkit/crashreporter/google-breakpad/src/client/linux/minidump_writer/linux_ptrace_dumper_unittest.cc
@@ -155,17 +155,17 @@ TEST(LinuxPtraceDumperTest, MergedMappin
   int mapping_count = 0;
   for (unsigned i = 0; i < dumper.mappings().size(); ++i) {
     const MappingInfo& mapping = *dumper.mappings()[i];
     if (strcmp(mapping.name, helper_path.c_str()) == 0) {
       // This mapping should encompass the entire original mapped
       // range.
       EXPECT_EQ(kMappingAddress, mapping.start_addr);
       EXPECT_EQ(kMappingSize, mapping.size);
-      EXPECT_EQ(0, mapping.offset);
+      EXPECT_EQ(0U, mapping.offset);
       mapping_count++;
     }
   }
   EXPECT_EQ(1, mapping_count);
 }
 
 TEST(LinuxPtraceDumperTest, VerifyStackReadWithMultipleThreads) {
   static const int kNumberOfThreadsInHelperProgram = 5;
@@ -207,17 +207,18 @@ TEST(LinuxPtraceDumperTest, VerifyStackR
     memset(&pfd, 0, sizeof(pfd));
     pfd.fd = fds[0];
     pfd.events = POLLIN | POLLERR;
 
     const int r = HANDLE_EINTR(poll(&pfd, 1, 1000));
     ASSERT_EQ(1, r);
     ASSERT_TRUE(pfd.revents & POLLIN);
     uint8_t junk;
-    ASSERT_EQ(read(fds[0], &junk, sizeof(junk)), sizeof(junk));
+    ASSERT_EQ(read(fds[0], &junk, sizeof(junk)), 
+              static_cast<ssize_t>(sizeof(junk)));
   }
   close(fds[0]);
 
   // There is a race here because we may stop a child thread before
   // it is actually running the busy loop. Empirically this sleep
   // is sufficient to avoid the race.
   usleep(100000);
 
@@ -225,16 +226,20 @@ TEST(LinuxPtraceDumperTest, VerifyStackR
   LinuxPtraceDumper dumper(child_pid);
   ASSERT_TRUE(dumper.Init());
   EXPECT_EQ((size_t)kNumberOfThreadsInHelperProgram, dumper.threads().size());
   EXPECT_TRUE(dumper.ThreadsSuspend());
 
   ThreadInfo one_thread;
   for (size_t i = 0; i < dumper.threads().size(); ++i) {
     EXPECT_TRUE(dumper.GetThreadInfoByIndex(i, &one_thread));
+    const void* stack;
+    size_t stack_len;
+    EXPECT_TRUE(dumper.GetStackInfo(&stack, &stack_len,
+        one_thread.stack_pointer));
     // In the helper program, we stored a pointer to the thread id in a
     // specific register. Check that we can recover its value.
 #if defined(__ARM_EABI__)
     pid_t *process_tid_location = (pid_t *)(one_thread.regs.uregs[3]);
 #elif defined(__i386)
     pid_t *process_tid_location = (pid_t *)(one_thread.regs.ecx);
 #elif defined(__x86_64)
     pid_t *process_tid_location = (pid_t *)(one_thread.regs.rcx);
--- a/toolkit/crashreporter/google-breakpad/src/client/linux/minidump_writer/minidump_writer.cc
+++ b/toolkit/crashreporter/google-breakpad/src/client/linux/minidump_writer/minidump_writer.cc
@@ -50,16 +50,17 @@
 #include <ctype.h>
 #include <errno.h>
 #include <fcntl.h>
 #include <link.h>
 #include <stdio.h>
 #if defined(__ANDROID__)
 #include <sys/system_properties.h>
 #endif
+#include <sys/types.h>
 #include <sys/ucontext.h>
 #include <sys/user.h>
 #include <sys/utsname.h>
 #include <unistd.h>
 
 #include <algorithm>
 
 #include "client/linux/handler/exception_handler.h"
@@ -370,32 +371,49 @@ void CPUFillFromUContext(MDRawContextARM
 }
 
 #else
 #error "This code has not been ported to your platform yet."
 #endif
 
 class MinidumpWriter {
  public:
+  // The following kLimit* constants are for when minidump_size_limit_ is set
+  // and the minidump size might exceed it.
+  //
+  // Estimate for how big each thread's stack will be (in bytes).
+  static const unsigned kLimitAverageThreadStackLength = 8 * 1024;
+  // Number of threads whose stack size we don't want to limit.  These base
+  // threads will simply be the first N threads returned by the dumper (although
+  // the crashing thread will never be limited).  Threads beyond this count are
+  // the extra threads.
+  static const unsigned kLimitBaseThreadCount = 20;
+  // Maximum stack size to dump for any extra thread (in bytes).
+  static const unsigned kLimitMaxExtraThreadStackLen = 2 * 1024;
+  // Make sure this number of additional bytes can fit in the minidump
+  // (exclude the stack data).
+  static const unsigned kLimitMinidumpFudgeFactor = 64 * 1024;
+
   MinidumpWriter(const char* minidump_path,
                  int minidump_fd,
                  const ExceptionHandler::CrashContext* context,
                  const MappingList& mappings,
                  const AppMemoryList& appmem,
                  LinuxDumper* dumper)
       : fd_(minidump_fd),
         path_(minidump_path),
         ucontext_(context ? &context->context : NULL),
 #if !defined(__ARM_EABI__)
         float_state_(context ? &context->float_state : NULL),
 #else
         // TODO: fix this after fixing ExceptionHandler
         float_state_(NULL),
 #endif
         dumper_(dumper),
+        minidump_size_limit_(-1),
         memory_blocks_(dumper_->allocator()),
         mapping_list_(mappings),
         app_memory_list_(appmem) {
     // Assert there should be either a valid fd or a valid path, not both.
     assert(fd_ != -1 || minidump_path);
     assert(fd_ == -1 || !minidump_path);
   }
 
@@ -623,54 +641,88 @@ class MinidumpWriter {
         cpu->esp = top + 4*sizeof(void*);
         cpu->eip = seccomp_stackframe.fakeret;
         return;
       }
     }
 #endif
   }
 
+  bool FillThreadStack(MDRawThread* thread, uintptr_t stack_pointer,
+                       int max_stack_len, uint8_t** stack_copy) {
+    *stack_copy = NULL;
+    const void* stack;
+    size_t stack_len;
+    if (dumper_->GetStackInfo(&stack, &stack_len, stack_pointer)) {
+      UntypedMDRVA memory(&minidump_writer_);
+      if (max_stack_len >= 0 &&
+          stack_len > static_cast<unsigned int>(max_stack_len)) {
+        stack_len = max_stack_len;
+      }
+      if (!memory.Allocate(stack_len))
+        return false;
+      *stack_copy = reinterpret_cast<uint8_t*>(Alloc(stack_len));
+      dumper_->CopyFromProcess(*stack_copy, thread->thread_id, stack,
+                               stack_len);
+      memory.Copy(*stack_copy, stack_len);
+      thread->stack.start_of_memory_range =
+          reinterpret_cast<uintptr_t>(stack);
+      thread->stack.memory = memory.location();
+      memory_blocks_.push_back(thread->stack);
+    } else {
+      thread->stack.start_of_memory_range = stack_pointer;
+      thread->stack.memory.data_size = 0;
+      thread->stack.memory.rva = minidump_writer_.position();
+    }
+    return true;
+  }
+
   // Write information about the threads.
   bool WriteThreadListStream(MDRawDirectory* dirent) {
     const unsigned num_threads = dumper_->threads().size();
 
     TypedMDRVA<uint32_t> list(&minidump_writer_);
     if (!list.AllocateObjectAndArray(num_threads, sizeof(MDRawThread)))
       return false;
 
     dirent->stream_type = MD_THREAD_LIST_STREAM;
     dirent->location = list.location();
 
     *list.get() = num_threads;
 
+    // If there's a minidump size limit, check if it might be exceeded.  Since
+    // most of the space is filled with stack data, just check against that.
+    // If this expects to exceed the limit, set extra_thread_stack_len such
+    // that any thread beyond the first kLimitBaseThreadCount threads will
+    // have only kLimitMaxExtraThreadStackLen bytes dumped.
+    int extra_thread_stack_len = -1;  // default to no maximum
+    if (minidump_size_limit_ >= 0) {
+      const unsigned estimated_total_stack_size = num_threads *
+          kLimitAverageThreadStackLength;
+      const off_t estimated_minidump_size = minidump_writer_.position() +
+          estimated_total_stack_size + kLimitMinidumpFudgeFactor;
+      if (estimated_minidump_size > minidump_size_limit_)
+        extra_thread_stack_len = kLimitMaxExtraThreadStackLen;
+    }
+
     for (unsigned i = 0; i < num_threads; ++i) {
       MDRawThread thread;
       my_memset(&thread, 0, sizeof(thread));
       thread.thread_id = dumper_->threads()[i];
+
       // We have a different source of information for the crashing thread. If
       // we used the actual state of the thread we would find it running in the
       // signal handler with the alternative stack, which would be deeply
       // unhelpful.
       if (static_cast<pid_t>(thread.thread_id) == GetCrashThread() &&
           ucontext_ &&
           !dumper_->IsPostMortem()) {
-        const void* stack;
-        size_t stack_len;
-        if (!dumper_->GetStackInfo(&stack, &stack_len, GetStackPointer()))
-          return false;
-        UntypedMDRVA memory(&minidump_writer_);
-        if (!memory.Allocate(stack_len))
+        uint8_t* stack_copy;
+        if (!FillThreadStack(&thread, GetStackPointer(), -1, &stack_copy))
           return false;
-        uint8_t* stack_copy = reinterpret_cast<uint8_t*>(Alloc(stack_len));
-        dumper_->CopyFromProcess(stack_copy, thread.thread_id, stack,
-                                 stack_len);
-        memory.Copy(stack_copy, stack_len);
-        thread.stack.start_of_memory_range = (uintptr_t) (stack);
-        thread.stack.memory = memory.location();
-        memory_blocks_.push_back(thread.stack);
 
         // Copy 256 bytes around crashing instruction pointer to minidump.
         const size_t kIPMemorySize = 256;
         u_int64_t ip = GetInstructionPointer();
         // Bound it to the upper and lower bounds of the memory map
         // it's contained within. If it's not in mapped memory,
         // don't bother trying to write it.
         bool ip_is_mapped = false;
@@ -710,40 +762,40 @@ class MinidumpWriter {
           memory_blocks_.push_back(ip_memory_d);
         }
 
         TypedMDRVA<RawContextCPU> cpu(&minidump_writer_);
         if (!cpu.Allocate())
           return false;
         my_memset(cpu.get(), 0, sizeof(RawContextCPU));
         CPUFillFromUContext(cpu.get(), ucontext_, float_state_);
-        PopSeccompStackFrame(cpu.get(), thread, stack_copy);
+        if (stack_copy)
+          PopSeccompStackFrame(cpu.get(), thread, stack_copy);
         thread.thread_context = cpu.location();
         crashing_thread_context_ = cpu.location();
       } else {
         ThreadInfo info;
         if (!dumper_->GetThreadInfoByIndex(i, &info))
           return false;
-        UntypedMDRVA memory(&minidump_writer_);
-        if (!memory.Allocate(info.stack_len))
+
+        uint8_t* stack_copy;
+        int max_stack_len = -1;  // default to no maximum for this thread
+        if (minidump_size_limit_ >= 0 && i >= kLimitBaseThreadCount)
+          max_stack_len = extra_thread_stack_len;
+        if (!FillThreadStack(&thread, info.stack_pointer, max_stack_len,
+            &stack_copy))
           return false;
-        uint8_t* stack_copy = reinterpret_cast<uint8_t*>(Alloc(info.stack_len));
-        dumper_->CopyFromProcess(stack_copy, thread.thread_id, info.stack,
-                                 info.stack_len);
-        memory.Copy(stack_copy, info.stack_len);
-        thread.stack.start_of_memory_range = (uintptr_t)(info.stack);
-        thread.stack.memory = memory.location();
-        memory_blocks_.push_back(thread.stack);
 
         TypedMDRVA<RawContextCPU> cpu(&minidump_writer_);
         if (!cpu.Allocate())
           return false;
         my_memset(cpu.get(), 0, sizeof(RawContextCPU));
         CPUFillFromThreadInfo(cpu.get(), info);
-        PopSeccompStackFrame(cpu.get(), thread, stack_copy);
+        if (stack_copy)
+          PopSeccompStackFrame(cpu.get(), thread, stack_copy);
         thread.thread_context = cpu.location();
         if (dumper_->threads()[i] == GetCrashThread()) {
           crashing_thread_context_ = cpu.location();
           if (!dumper_->IsPostMortem()) {
             // This is the crashing thread of a live process, but
             // no context was provided, so set the crash address
             // while the instruction pointer is already here.
             dumper_->set_crash_address(GetInstructionPointer(info));
@@ -818,18 +870,25 @@ class MinidumpWriter {
 
     for (unsigned i = 0; i < dumper_->mappings().size(); ++i) {
       const MappingInfo& mapping = *dumper_->mappings()[i];
       if (ShouldIncludeMapping(mapping) && !HaveMappingInfo(mapping))
         num_output_mappings++;
     }
 
     TypedMDRVA<uint32_t> list(&minidump_writer_);
-    if (!list.AllocateObjectAndArray(num_output_mappings, MD_MODULE_SIZE))
-      return false;
+    if (num_output_mappings) {
+      if (!list.AllocateObjectAndArray(num_output_mappings, MD_MODULE_SIZE))
+        return false;
+    } else {
+      // Still create the module list stream, although it will have zero
+      // modules.
+      if (!list.Allocate())
+        return false;
+    }
 
     dirent->stream_type = MD_MODULE_LIST_STREAM;
     dirent->location = list.location();
     *list.get() = num_output_mappings;
 
     // First write all the mappings from the dumper
     unsigned int j = 0;
     for (unsigned i = 0; i < num_mappings; ++i) {
@@ -911,19 +970,26 @@ class MinidumpWriter {
     if (!minidump_writer_.WriteString(mapping.name, filepath_len, &ld))
       return false;
     mod.module_name_rva = ld.rva;
     return true;
   }
 
   bool WriteMemoryListStream(MDRawDirectory* dirent) {
     TypedMDRVA<uint32_t> list(&minidump_writer_);
-    if (!list.AllocateObjectAndArray(memory_blocks_.size(),
-                                     sizeof(MDMemoryDescriptor)))
-      return false;
+    if (memory_blocks_.size()) {
+      if (!list.AllocateObjectAndArray(memory_blocks_.size(),
+                                       sizeof(MDMemoryDescriptor)))
+        return false;
+    } else {
+      // Still create the memory list stream, although it will have zero
+      // memory blocks.
+      if (!list.Allocate())
+        return false;
+    }
 
     dirent->stream_type = MD_MEMORY_LIST_STREAM;
     dirent->location = list.location();
 
     *list.get() = memory_blocks_.size();
 
     for (size_t i = 0; i < memory_blocks_.size(); ++i) {
       list.CopyIndexAfterObject(i, &memory_blocks_[i],
@@ -960,19 +1026,16 @@ class MinidumpWriter {
 
     WriteCPUInformation(si.get());
     WriteOSInformation(si.get());
 
     return true;
   }
 
   bool WriteDSODebugStream(MDRawDirectory* dirent) {
-#if defined(__ANDROID__)
-    return false;
-#else
     ElfW(Phdr)* phdr = reinterpret_cast<ElfW(Phdr) *>(dumper_->auxv()[AT_PHDR]);
     char* base;
     int phnum = dumper_->auxv()[AT_PHNUM];
     if (!phnum || !phdr)
       return false;
 
     // Assume the program base is at the beginning of the same page as the PHDR
     base = reinterpret_cast<char *>(reinterpret_cast<uintptr_t>(phdr) & ~0xfff);
@@ -1083,19 +1146,20 @@ class MinidumpWriter {
 
     char* dso_debug_data = new char[dynamic_length];
     dumper_->CopyFromProcess(dso_debug_data, GetCrashThread(), dynamic,
                              dynamic_length);
     debug.CopyIndexAfterObject(0, dso_debug_data, dynamic_length);
     delete[] dso_debug_data;
 
     return true;
-#endif
   }
 
+  void set_minidump_size_limit(off_t limit) { minidump_size_limit_ = limit; }
+
  private:
   void* Alloc(unsigned bytes) {
     return dumper_->allocator()->Alloc(bytes);
   }
 
   pid_t GetCrashThread() const {
     return dumper_->crash_thread();
   }
@@ -1231,22 +1295,20 @@ class MinidumpWriter {
           do {
             value++;
           } while (my_isspace(*value));
 
           if (*value) {
             size_t length = my_strlen(value);
             if (length == 0)
               goto popline;
+            my_strlcpy(vendor_id, value, sizeof(vendor_id));
             // we don't want the trailing newline
-            if (value[length - 1] == '\n')
-              length--;
-            // ensure we have space for the value
-            if (length < sizeof(vendor_id))
-              my_strlcpy(vendor_id, value, length);
+            if (length < sizeof(vendor_id) && vendor_id[length - 1] == '\n')
+              vendor_id[length - 1] = '\0';
           }
         }
 
  popline:
         line_reader->PopLine(line_len);
       }
       sys_close(fd);
     }
@@ -1413,64 +1475,72 @@ class MinidumpWriter {
   // Only one of the 2 member variables below should be set to a valid value.
   const int fd_;  // File descriptor where the minidum should be written.
   const char* path_;  // Path to the file where the minidum should be written.
 
   const struct ucontext* const ucontext_;  // also from the signal handler
   const struct _libc_fpstate* const float_state_;  // ditto
   LinuxDumper* dumper_;
   MinidumpFileWriter minidump_writer_;
+  off_t minidump_size_limit_;
   MDLocationDescriptor crashing_thread_context_;
   // Blocks of memory written to the dump. These are all currently
   // written while writing the thread list stream, but saved here
   // so a memory list stream can be written afterwards.
   wasteful_vector<MDMemoryDescriptor> memory_blocks_;
   // Additional information about some mappings provided by the caller.
   const MappingList& mapping_list_;
   // Additional memory regions to be included in the dump,
   // provided by the caller.
   const AppMemoryList& app_memory_list_;
 };
 
 
 bool WriteMinidumpImpl(const char* minidump_path,
                        int minidump_fd,
+                       off_t minidump_size_limit,
                        pid_t crashing_process,
                        const void* blob, size_t blob_size,
                        const MappingList& mappings,
                        const AppMemoryList& appmem) {
-  if (blob_size != sizeof(ExceptionHandler::CrashContext))
-    return false;
-  const ExceptionHandler::CrashContext* context =
-      reinterpret_cast<const ExceptionHandler::CrashContext*>(blob);
   LinuxPtraceDumper dumper(crashing_process);
-  dumper.set_crash_address(
-      reinterpret_cast<uintptr_t>(context->siginfo.si_addr));
-  dumper.set_crash_signal(context->siginfo.si_signo);
-  dumper.set_crash_thread(context->tid);
+  const ExceptionHandler::CrashContext* context = NULL;
+  if (blob) {
+    if (blob_size != sizeof(ExceptionHandler::CrashContext))
+      return false;
+    context = reinterpret_cast<const ExceptionHandler::CrashContext*>(blob);
+    dumper.set_crash_address(
+        reinterpret_cast<uintptr_t>(context->siginfo.si_addr));
+    dumper.set_crash_signal(context->siginfo.si_signo);
+    dumper.set_crash_thread(context->tid);
+  }
   MinidumpWriter writer(minidump_path, minidump_fd, context, mappings,
                         appmem, &dumper);
+  // Set desired limit for file size of minidump (-1 means no limit).
+  writer.set_minidump_size_limit(minidump_size_limit);
   if (!writer.Init())
     return false;
   return writer.Dump();
 }
 
 }  // namespace
 
 namespace google_breakpad {
 
 bool WriteMinidump(const char* minidump_path, pid_t crashing_process,
                    const void* blob, size_t blob_size) {
-  return WriteMinidumpImpl(minidump_path, -1, crashing_process, blob, blob_size,
+  return WriteMinidumpImpl(minidump_path, -1, -1,
+                           crashing_process, blob, blob_size,
                            MappingList(), AppMemoryList());
 }
 
 bool WriteMinidump(int minidump_fd, pid_t crashing_process,
                    const void* blob, size_t blob_size) {
-  return WriteMinidumpImpl(NULL, minidump_fd, crashing_process, blob, blob_size,
+  return WriteMinidumpImpl(NULL, minidump_fd, -1,
+                           crashing_process, blob, blob_size,
                            MappingList(), AppMemoryList());
 }
 
 bool WriteMinidump(const char* minidump_path, pid_t process,
                    pid_t process_blamed_thread) {
   LinuxPtraceDumper dumper(process);
   // MinidumpWriter will set crash address
   dumper.set_crash_signal(MD_EXCEPTION_CODE_LIN_DUMP_REQUESTED);
@@ -1481,25 +1551,47 @@ bool WriteMinidump(const char* minidump_
     return false;
   return writer.Dump();
 }
 
 bool WriteMinidump(const char* minidump_path, pid_t crashing_process,
                    const void* blob, size_t blob_size,
                    const MappingList& mappings,
                    const AppMemoryList& appmem) {
-  return WriteMinidumpImpl(minidump_path, -1, crashing_process, blob, blob_size,
+  return WriteMinidumpImpl(minidump_path, -1, -1, crashing_process,
+                           blob, blob_size,
                            mappings, appmem);
 }
 
 bool WriteMinidump(int minidump_fd, pid_t crashing_process,
                    const void* blob, size_t blob_size,
                    const MappingList& mappings,
                    const AppMemoryList& appmem) {
-  return WriteMinidumpImpl(NULL, minidump_fd, crashing_process, blob, blob_size,
+  return WriteMinidumpImpl(NULL, minidump_fd, -1, crashing_process,
+                           blob, blob_size,
+                           mappings, appmem);
+}
+
+bool WriteMinidump(const char* minidump_path, off_t minidump_size_limit,
+                   pid_t crashing_process,
+                   const void* blob, size_t blob_size,
+                   const MappingList& mappings,
+                   const AppMemoryList& appmem) {
+  return WriteMinidumpImpl(minidump_path, -1, minidump_size_limit,
+                           crashing_process, blob, blob_size,
+                           mappings, appmem);
+}
+
+bool WriteMinidump(int minidump_fd, off_t minidump_size_limit,
+                   pid_t crashing_process,
+                   const void* blob, size_t blob_size,
+                   const MappingList& mappings,
+                   const AppMemoryList& appmem) {
+  return WriteMinidumpImpl(NULL, minidump_fd, minidump_size_limit,
+                           crashing_process, blob, blob_size,
                            mappings, appmem);
 }
 
 bool WriteMinidump(const char* filename,
                    const MappingList& mappings,
                    const AppMemoryList& appmem,
                    LinuxDumper* dumper) {
   MinidumpWriter writer(filename, -1, NULL, mappings, appmem, dumper);
--- a/toolkit/crashreporter/google-breakpad/src/client/linux/minidump_writer/minidump_writer.h
+++ b/toolkit/crashreporter/google-breakpad/src/client/linux/minidump_writer/minidump_writer.h
@@ -26,16 +26,17 @@
 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
 #ifndef CLIENT_LINUX_MINIDUMP_WRITER_MINIDUMP_WRITER_H_
 #define CLIENT_LINUX_MINIDUMP_WRITER_MINIDUMP_WRITER_H_
 
 #include <stdint.h>
+#include <sys/types.h>
 #include <unistd.h>
 
 #include <list>
 #include <utility>
 
 #include "client/linux/minidump_writer/linux_dumper.h"
 #include "google_breakpad/common/minidump_format.h"
 
@@ -97,16 +98,28 @@ bool WriteMinidump(const char* minidump_
                    const void* blob, size_t blob_size,
                    const MappingList& mappings,
                    const AppMemoryList& appdata);
 bool WriteMinidump(int minidump_fd, pid_t crashing_process,
                    const void* blob, size_t blob_size,
                    const MappingList& mappings,
                    const AppMemoryList& appdata);
 
+// These overloads also allow passing a file size limit for the minidump.
+bool WriteMinidump(const char* minidump_path, off_t minidump_size_limit,
+                   pid_t crashing_process,
+                   const void* blob, size_t blob_size,
+                   const MappingList& mappings,
+                   const AppMemoryList& appdata);
+bool WriteMinidump(int minidump_fd, off_t minidump_size_limit,
+                   pid_t crashing_process,
+                   const void* blob, size_t blob_size,
+                   const MappingList& mappings,
+                   const AppMemoryList& appdata);
+
 bool WriteMinidump(const char* filename,
                    const MappingList& mappings,
                    const AppMemoryList& appdata,
                    LinuxDumper* dumper);
 
 }  // namespace google_breakpad
 
 #endif  // CLIENT_LINUX_MINIDUMP_WRITER_MINIDUMP_WRITER_H_
--- a/toolkit/crashreporter/google-breakpad/src/client/linux/minidump_writer/minidump_writer_unittest.cc
+++ b/toolkit/crashreporter/google-breakpad/src/client/linux/minidump_writer/minidump_writer_unittest.cc
@@ -29,44 +29,45 @@
 
 #include <fcntl.h>
 #include <sys/poll.h>
 #include <sys/stat.h>
 #include <sys/syscall.h>
 #include <sys/types.h>
 #include <ucontext.h>
 #include <unistd.h>
-#include <ucontext.h>
 
 #include <string>
 
 #include "breakpad_googletest_includes.h"
 #include "client/linux/handler/exception_handler.h"
 #include "client/linux/minidump_writer/linux_dumper.h"
 #include "client/linux/minidump_writer/minidump_writer.h"
 #include "client/linux/minidump_writer/minidump_writer_unittest_utils.h"
 #include "common/linux/eintr_wrapper.h"
 #include "common/linux/file_id.h"
 #include "common/linux/ignore_ret.h"
 #include "common/linux/safe_readlink.h"
+#include "common/scoped_ptr.h"
 #include "common/tests/auto_tempdir.h"
 #include "common/tests/file_utils.h"
 #include "common/using_std_string.h"
 #include "google_breakpad/processor/minidump.h"
-#include "processor/scoped_ptr.h"
 
 using namespace google_breakpad;
 
 // Length of a formatted GUID string =
 // sizeof(MDGUID) * 2 + 4 (for dashes) + 1 (null terminator)
 const int kGUIDStringSize = 37;
 
 namespace {
+
 typedef testing::Test MinidumpWriterTest;
-}
+
+const char kMDWriterUnitTestFileName[] = "/minidump-writer-unittest";
 
 TEST(MinidumpWriterTest, SetupWithPath) {
   int fds[2];
   ASSERT_NE(-1, pipe(fds));
 
   const pid_t child = fork();
   if (child == 0) {
     close(fds[1]);
@@ -76,23 +77,23 @@ TEST(MinidumpWriterTest, SetupWithPath) 
     syscall(__NR_exit);
   }
   close(fds[0]);
 
   ExceptionHandler::CrashContext context;
   memset(&context, 0, sizeof(context));
 
   AutoTempDir temp_dir;
-  string templ = temp_dir.path() + "/minidump-writer-unittest";
+  string templ = temp_dir.path() + kMDWriterUnitTestFileName;
   // Set a non-zero tid to avoid tripping asserts.
   context.tid = 1;
   ASSERT_TRUE(WriteMinidump(templ.c_str(), child, &context, sizeof(context)));
   struct stat st;
-  ASSERT_EQ(stat(templ.c_str(), &st), 0);
-  ASSERT_GT(st.st_size, 0u);
+  ASSERT_EQ(0, stat(templ.c_str(), &st));
+  ASSERT_GT(st.st_size, 0);
 
   close(fds[1]);
 }
 
 TEST(MinidumpWriterTest, SetupWithFD) {
   int fds[2];
   ASSERT_NE(-1, pipe(fds));
 
@@ -105,24 +106,24 @@ TEST(MinidumpWriterTest, SetupWithFD) {
     syscall(__NR_exit);
   }
   close(fds[0]);
 
   ExceptionHandler::CrashContext context;
   memset(&context, 0, sizeof(context));
 
   AutoTempDir temp_dir;
-  string templ = temp_dir.path() + "/minidump-writer-unittest";
+  string templ = temp_dir.path() + kMDWriterUnitTestFileName;
   int fd = open(templ.c_str(), O_CREAT | O_WRONLY, S_IRWXU);
   // Set a non-zero tid to avoid tripping asserts.
   context.tid = 1;
   ASSERT_TRUE(WriteMinidump(fd, child, &context, sizeof(context)));
   struct stat st;
-  ASSERT_EQ(stat(templ.c_str(), &st), 0);
-  ASSERT_GT(st.st_size, 0u);
+  ASSERT_EQ(0, stat(templ.c_str(), &st));
+  ASSERT_GT(st.st_size, 0);
 
   close(fds[1]);
 }
 
 // Test that mapping info can be specified when writing a minidump,
 // and that it ends up in the module list of the minidump.
 TEST(MinidumpWriterTest, MappingInfo) {
   int fds[2];
@@ -172,17 +173,17 @@ TEST(MinidumpWriterTest, MappingInfo) {
   close(fds[0]);
 
   ExceptionHandler::CrashContext context;
   memset(&context, 0, sizeof(context));
   ASSERT_EQ(0, getcontext(&context.context));
   context.tid = child;
 
   AutoTempDir temp_dir;
-  string templ = temp_dir.path() + "/minidump-writer-unittest";
+  string templ = temp_dir.path() + kMDWriterUnitTestFileName;
 
   // Add information about the mapped memory.
   MappingInfo info;
   info.start_addr = kMemoryAddress;
   info.size = memory_size;
   info.offset = 0;
   strcpy(info.name, kMemoryName);
 
@@ -233,17 +234,17 @@ TEST(MinidumpWriterTest, MappingInfo) {
 // existing mappings that are wholly contained within the specified
 // range.
 TEST(MinidumpWriterTest, MappingInfoContained) {
   int fds[2];
   ASSERT_NE(-1, pipe(fds));
 
   // These are defined here so the parent can use them to check the
   // data from the minidump afterwards.
-  const u_int32_t memory_size = sysconf(_SC_PAGESIZE);
+  const int32_t memory_size = sysconf(_SC_PAGESIZE);
   const char* kMemoryName = "a fake module";
   const u_int8_t kModuleGUID[sizeof(MDGUID)] = {
     0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77,
     0x88, 0x99, 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF
   };
   char module_identifier_buffer[kGUIDStringSize];
   FileID::ConvertIdentifierToString(kModuleGUID,
                                     module_identifier_buffer,
@@ -290,17 +291,17 @@ TEST(MinidumpWriterTest, MappingInfoCont
     syscall(__NR_exit);
   }
   close(fds[0]);
 
   ExceptionHandler::CrashContext context;
   memset(&context, 0, sizeof(context));
   context.tid = 1;
 
-  string dumpfile = temp_dir.path() + "/minidump-writer-unittest";
+  string dumpfile = temp_dir.path() + kMDWriterUnitTestFileName;
 
   // Add information about the mapped memory. Report it as being larger than
   // it actually is.
   MappingInfo info;
   info.start_addr = kMemoryAddress - memory_size;
   info.size = memory_size * 3;
   info.offset = 0;
   strcpy(info.name, kMemoryName);
@@ -330,21 +331,18 @@ TEST(MinidumpWriterTest, MappingInfoCont
   EXPECT_EQ(info.size, module->size());
   EXPECT_EQ(kMemoryName, module->code_file());
   EXPECT_EQ(module_identifier, module->debug_identifier());
 
   close(fds[1]);
 }
 
 TEST(MinidumpWriterTest, DeletedBinary) {
-  static const int kNumberOfThreadsInHelperProgram = 1;
-  char kNumberOfThreadsArgument[2];
-  sprintf(kNumberOfThreadsArgument, "%d", kNumberOfThreadsInHelperProgram);
-
-  string helper_path(GetHelperBinary());
+  const string kNumberOfThreadsArgument = "1";
+  const string helper_path(GetHelperBinary());
   if (helper_path.empty()) {
     FAIL() << "Couldn't find helper binary";
     exit(1);
   }
 
   // Copy binary to a temp file.
   AutoTempDir temp_dir;
   string binpath = temp_dir.path() + "/linux-dumper-unittest-helper";
@@ -361,51 +359,51 @@ TEST(MinidumpWriterTest, DeletedBinary) 
     close(fds[0]);
 
     // Pass the pipe fd and the number of threads as arguments.
     char pipe_fd_string[8];
     sprintf(pipe_fd_string, "%d", fds[1]);
     execl(binpath.c_str(),
           binpath.c_str(),
           pipe_fd_string,
-          kNumberOfThreadsArgument,
+          kNumberOfThreadsArgument.c_str(),
           NULL);
   }
   close(fds[1]);
   // Wait for the child process to signal that it's ready.
   struct pollfd pfd;
   memset(&pfd, 0, sizeof(pfd));
   pfd.fd = fds[0];
   pfd.events = POLLIN | POLLERR;
 
   const int r = HANDLE_EINTR(poll(&pfd, 1, 1000));
   ASSERT_EQ(1, r);
   ASSERT_TRUE(pfd.revents & POLLIN);
   uint8_t junk;
   const int nr = HANDLE_EINTR(read(fds[0], &junk, sizeof(junk)));
-  ASSERT_EQ(sizeof(junk), nr);
+  ASSERT_EQ(static_cast<ssize_t>(sizeof(junk)), nr);
   close(fds[0]);
 
   // Child is ready now.
   // Unlink the test binary.
   unlink(binpath.c_str());
 
   ExceptionHandler::CrashContext context;
   memset(&context, 0, sizeof(context));
 
-  string templ = temp_dir.path() + "/minidump-writer-unittest";
+  string templ = temp_dir.path() + kMDWriterUnitTestFileName;
   // Set a non-zero tid to avoid tripping asserts.
   context.tid = 1;
   ASSERT_TRUE(WriteMinidump(templ.c_str(), child_pid, &context,
                             sizeof(context)));
   kill(child_pid, SIGKILL);
 
   struct stat st;
-  ASSERT_EQ(stat(templ.c_str(), &st), 0);
-  ASSERT_GT(st.st_size, 0u);
+  ASSERT_EQ(0, stat(templ.c_str(), &st));
+  ASSERT_GT(st.st_size, 0);
 
   Minidump minidump(templ.c_str());
   ASSERT_TRUE(minidump.Read());
 
   // Check that the main module filename is correct.
   MinidumpModuleList* module_list = minidump.GetModuleList();
   ASSERT_TRUE(module_list);
   const MinidumpModule* module = module_list->GetMainModule();
@@ -463,17 +461,17 @@ TEST(MinidumpWriterTest, AdditionalMemor
 
   // This needs a valid context for minidump writing to work, but getting
   // a useful one from the child is too much work, so just use one from
   // the parent since the child is just a forked copy anyway.
   ASSERT_EQ(0, getcontext(&context.context));
   context.tid = child;
 
   AutoTempDir temp_dir;
-  string templ = temp_dir.path() + "/minidump-writer-unittest";
+  string templ = temp_dir.path() + kMDWriterUnitTestFileName;
   unlink(templ.c_str());
 
   MappingList mappings;
   AppMemoryList memory_list;
 
   // Add the memory region to the list of memory to be included.
   AppMemory app_memory;
   app_memory.ptr = memory;
@@ -496,8 +494,264 @@ TEST(MinidumpWriterTest, AdditionalMemor
   EXPECT_EQ(kMemorySize, region->GetSize());
 
   // Verify memory contents.
   EXPECT_EQ(0, memcmp(region->GetMemory(), memory, kMemorySize));
 
   delete[] memory;
   close(fds[1]);
 }
+
+// Test that an invalid thread stack pointer still results in a minidump.
+TEST(MinidumpWriterTest, InvalidStackPointer) {
+  int fds[2];
+  ASSERT_NE(-1, pipe(fds));
+
+  const pid_t child = fork();
+  if (child == 0) {
+    close(fds[1]);
+    char b;
+    HANDLE_EINTR(read(fds[0], &b, sizeof(b)));
+    close(fds[0]);
+    syscall(__NR_exit);
+  }
+  close(fds[0]);
+
+  ExceptionHandler::CrashContext context;
+
+  // This needs a valid context for minidump writing to work, but getting
+  // a useful one from the child is too much work, so just use one from
+  // the parent since the child is just a forked copy anyway.
+  ASSERT_EQ(0, getcontext(&context.context));
+  context.tid = child;
+
+  // Fake the child's stack pointer for its crashing thread.  NOTE: This must
+  // be an invalid memory address for the child process (stack or otherwise).
+#if defined(__i386)
+  // Try 1MB below the current stack.
+  uintptr_t invalid_stack_pointer =
+      reinterpret_cast<uintptr_t>(&context) - 1024*1024;
+  context.context.uc_mcontext.gregs[REG_ESP] = invalid_stack_pointer;
+#elif defined(__x86_64)
+  // Try 1MB below the current stack.
+  uintptr_t invalid_stack_pointer =
+      reinterpret_cast<uintptr_t>(&context) - 1024*1024;
+  context.context.uc_mcontext.gregs[REG_RSP] = invalid_stack_pointer;
+#elif defined(__ARM_EABI__)
+  // Try 1MB below the current stack.
+  uintptr_t invalid_stack_pointer =
+      reinterpret_cast<uintptr_t>(&context) - 1024*1024;
+  context.context.uc_mcontext.arm_sp = invalid_stack_pointer;
+#else
+# error "This code has not been ported to your platform yet."
+#endif
+
+  AutoTempDir temp_dir;
+  string templ = temp_dir.path() + kMDWriterUnitTestFileName;
+  // NOTE: In previous versions of Breakpad, WriteMinidump() would fail if
+  // presented with an invalid stack pointer.
+  ASSERT_TRUE(WriteMinidump(templ.c_str(), child, &context, sizeof(context)));
+
+  // Read the minidump. Ensure that the memory region is present
+  Minidump minidump(templ.c_str());
+  ASSERT_TRUE(minidump.Read());
+
+  // TODO(ted.mielczarek,mkrebs): Enable this part of the test once
+  // https://breakpad.appspot.com/413002/ is committed.
+#if 0
+  // Make sure there's a thread without a stack.  NOTE: It's okay if
+  // GetThreadList() shows the error: "ERROR: MinidumpThread has a memory
+  // region problem".
+  MinidumpThreadList* dump_thread_list = minidump.GetThreadList();
+  ASSERT_TRUE(dump_thread_list);
+  bool found_empty_stack = false;
+  for (int i = 0; i < dump_thread_list->thread_count(); i++) {
+    MinidumpThread* thread = dump_thread_list->GetThreadAtIndex(i);
+    ASSERT_TRUE(thread->thread() != NULL);
+    // When the stack size is zero bytes, GetMemory() returns NULL.
+    if (thread->GetMemory() == NULL) {
+      found_empty_stack = true;
+      break;
+    }
+  }
+  // NOTE: If you fail this, first make sure that "invalid_stack_pointer"
+  // above is indeed set to an invalid address.
+  ASSERT_TRUE(found_empty_stack);
+#endif
+
+  close(fds[1]);
+}
+
+// Test that limiting the size of the minidump works.
+TEST(MinidumpWriterTest, MinidumpSizeLimit) {
+  static const int kNumberOfThreadsInHelperProgram = 40;
+
+  char number_of_threads_arg[3];
+  sprintf(number_of_threads_arg, "%d", kNumberOfThreadsInHelperProgram);
+
+  string helper_path(GetHelperBinary());
+  if (helper_path.empty()) {
+    FAIL() << "Couldn't find helper binary";
+    exit(1);
+  }
+
+  int fds[2];
+  ASSERT_NE(-1, pipe(fds));
+
+  pid_t child_pid = fork();
+  if (child_pid == 0) {
+    // In child process.
+    close(fds[0]);
+
+    // Pass the pipe fd and the number of threads as arguments.
+    char pipe_fd_string[8];
+    sprintf(pipe_fd_string, "%d", fds[1]);
+    execl(helper_path.c_str(),
+          helper_path.c_str(),
+          pipe_fd_string,
+          number_of_threads_arg,
+          NULL);
+  }
+  close(fds[1]);
+
+  // Wait for all child threads to indicate that they have started
+  for (int threads = 0; threads < kNumberOfThreadsInHelperProgram; threads++) {
+    struct pollfd pfd;
+    memset(&pfd, 0, sizeof(pfd));
+    pfd.fd = fds[0];
+    pfd.events = POLLIN | POLLERR;
+
+    const int r = HANDLE_EINTR(poll(&pfd, 1, 1000));
+    ASSERT_EQ(1, r);
+    ASSERT_TRUE(pfd.revents & POLLIN);
+    uint8_t junk;
+    ASSERT_EQ(read(fds[0], &junk, sizeof(junk)), 
+              static_cast<ssize_t>(sizeof(junk)));
+  }
+  close(fds[0]);
+
+  // There is a race here because we may stop a child thread before
+  // it is actually running the busy loop. Empirically this sleep
+  // is sufficient to avoid the race.
+  usleep(100000);
+
+  // Child and its threads are ready now.
+
+
+  off_t normal_file_size;
+  int total_normal_stack_size = 0;
+  AutoTempDir temp_dir;
+
+  // First, write a minidump with no size limit.
+  {
+    string normal_dump = temp_dir.path() +
+        "/minidump-writer-unittest.dmp";
+    ASSERT_TRUE(WriteMinidump(normal_dump.c_str(), -1,
+                              child_pid, NULL, 0,
+                              MappingList(), AppMemoryList()));
+    struct stat st;
+    ASSERT_EQ(0, stat(normal_dump.c_str(), &st));
+    ASSERT_GT(st.st_size, 0);
+    normal_file_size = st.st_size;
+
+    Minidump minidump(normal_dump.c_str());
+    ASSERT_TRUE(minidump.Read());
+    MinidumpThreadList* dump_thread_list = minidump.GetThreadList();
+    ASSERT_TRUE(dump_thread_list);
+    for (unsigned int i = 0; i < dump_thread_list->thread_count(); i++) {
+      MinidumpThread* thread = dump_thread_list->GetThreadAtIndex(i);
+      ASSERT_TRUE(thread->thread() != NULL);
+      // When the stack size is zero bytes, GetMemory() returns NULL.
+      MinidumpMemoryRegion* memory = thread->GetMemory();
+      ASSERT_TRUE(memory != NULL);
+      total_normal_stack_size += memory->GetSize();
+    }
+  }
+
+  // Second, write a minidump with a size limit big enough to not trigger
+  // anything.
+  {
+    // Set size limit arbitrarily 1MB larger than the normal file size -- such
+    // that the limiting code will not kick in.
+    const off_t minidump_size_limit = normal_file_size + 1024*1024;
+
+    string same_dump = temp_dir.path() +
+        "/minidump-writer-unittest-same.dmp";
+    ASSERT_TRUE(WriteMinidump(same_dump.c_str(), minidump_size_limit,
+                              child_pid, NULL, 0,
+                              MappingList(), AppMemoryList()));
+    struct stat st;
+    ASSERT_EQ(0, stat(same_dump.c_str(), &st));
+    // Make sure limiting wasn't actually triggered.  NOTE: If you fail this,
+    // first make sure that "minidump_size_limit" above is indeed set to a
+    // large enough value -- the limit-checking code in minidump_writer.cc
+    // does just a rough estimate.
+    ASSERT_EQ(normal_file_size, st.st_size);
+  }
+
+  // Third, write a minidump with a size limit small enough to be triggered.
+  {
+    // Set size limit to some arbitrary amount, such that the limiting code
+    // will kick in.  The equation used to set this value was determined by
+    // simply reversing the size-limit logic a little bit in order to pick a
+    // size we know will trigger it.  The definition of
+    // kLimitAverageThreadStackLength here was copied from class
+    // MinidumpWriter in minidump_writer.cc.
+    static const unsigned kLimitAverageThreadStackLength = 8 * 1024;
+    off_t minidump_size_limit = kNumberOfThreadsInHelperProgram *
+        kLimitAverageThreadStackLength;
+    // If, in reality, each of the threads' stack is *smaller* than
+    // kLimitAverageThreadStackLength, the normal file size could very well be
+    // smaller than the arbitrary limit that was just set.  In that case,
+    // either of these numbers should trigger the size-limiting code, but we
+    // might as well pick the smallest.
+    if (normal_file_size < minidump_size_limit)
+      minidump_size_limit = normal_file_size;
+
+    string limit_dump = temp_dir.path() +
+        "/minidump-writer-unittest-limit.dmp";
+    ASSERT_TRUE(WriteMinidump(limit_dump.c_str(), minidump_size_limit,
+                              child_pid, NULL, 0,
+                              MappingList(), AppMemoryList()));
+    struct stat st;
+    ASSERT_EQ(0, stat(limit_dump.c_str(), &st));
+    ASSERT_GT(st.st_size, 0);
+    // Make sure the file size is at least smaller than the original.  If this
+    // fails because it's the same size, then the size-limit logic didn't kick
+    // in like it was supposed to.
+    EXPECT_LT(st.st_size, normal_file_size);
+
+    Minidump minidump(limit_dump.c_str());
+    ASSERT_TRUE(minidump.Read());
+    MinidumpThreadList* dump_thread_list = minidump.GetThreadList();
+    ASSERT_TRUE(dump_thread_list);
+    int total_limit_stack_size = 0;
+    for (unsigned int i = 0; i < dump_thread_list->thread_count(); i++) {
+      MinidumpThread* thread = dump_thread_list->GetThreadAtIndex(i);
+      ASSERT_TRUE(thread->thread() != NULL);
+      // When the stack size is zero bytes, GetMemory() returns NULL.
+      MinidumpMemoryRegion* memory = thread->GetMemory();
+      ASSERT_TRUE(memory != NULL);
+      total_limit_stack_size += memory->GetSize();
+    }
+
+    // Make sure stack size shrunk by at least 1KB per extra thread.  The
+    // definition of kLimitBaseThreadCount here was copied from class
+    // MinidumpWriter in minidump_writer.cc.
+    // Note: The 1KB is arbitrary, and assumes that the thread stacks are big
+    // enough to shrink by that much.  For example, if each thread stack was
+    // originally only 2KB, the current size-limit logic wouldn't actually
+    // shrink them because that's the size to which it tries to shrink.  If
+    // you fail this part of the test due to something like that, the test
+    // logic should probably be improved to account for your situation.
+    const unsigned kLimitBaseThreadCount = 20;
+    const unsigned kMinPerExtraThreadStackReduction = 1024;
+    const int min_expected_reduction = (kNumberOfThreadsInHelperProgram -
+        kLimitBaseThreadCount) * kMinPerExtraThreadStackReduction;
+    EXPECT_LT(total_limit_stack_size,
+              total_normal_stack_size - min_expected_reduction);
+  }
+
+  // Kill the helper program.
+  kill(child_pid, SIGKILL);
+}
+
+}  // namespace
--- a/toolkit/crashreporter/google-breakpad/src/client/mac/Framework/Breakpad.mm
+++ b/toolkit/crashreporter/google-breakpad/src/client/mac/Framework/Breakpad.mm
@@ -37,27 +37,40 @@
 #endif
 
 #define DEBUGLOG if (gDebugLog) fprintf
 #define IGNORE_DEBUGGER "BREAKPAD_IGNORE_DEBUGGER"
 
 #import "client/mac/Framework/Breakpad.h"
 
 #import <Foundation/Foundation.h>
-#import <sys/stat.h>
-#import <sys/sysctl.h>
+#include <pthread.h>
+#include <sys/stat.h>
+#include <sys/sysctl.h>
 
 #import "client/mac/crash_generation/Inspector.h"
 #import "client/mac/handler/exception_handler.h"
 #import "client/mac/Framework/Breakpad.h"
 #import "client/mac/Framework/OnDemandServer.h"
 #import "client/mac/handler/protected_memory_allocator.h"
 #import "common/mac/MachIPC.h"
 #import "common/mac/SimpleStringDictionary.h"
 
+#ifndef __EXCEPTIONS
+// This file uses C++ try/catch (but shouldn't). Duplicate the macros from
+// <c++/4.2.1/exception_defines.h> allowing this file to work properly with
+// exceptions disabled even when other C++ libraries are used. #undef the try
+// and catch macros first in case libstdc++ is in use and has already provided
+// its own definitions.
+#undef try
+#define try       if (true)
+#undef catch
+#define catch(X)  if (false)
+#endif  // __EXCEPTIONS
+
 using google_breakpad::KeyValueEntry;
 using google_breakpad::MachPortSender;
 using google_breakpad::MachReceiveMessage;
 using google_breakpad::MachSendMessage;
 using google_breakpad::ReceivePort;
 using google_breakpad::SimpleStringDictionary;
 using google_breakpad::SimpleStringDictionaryIterator;
 
--- a/toolkit/crashreporter/google-breakpad/src/client/mac/handler/dynamic_images.cc
+++ b/toolkit/crashreporter/google-breakpad/src/client/mac/handler/dynamic_images.cc
@@ -36,16 +36,17 @@ extern "C" { // needed to compile on Leo
 }
 
 #include <assert.h>
 #include <AvailabilityMacros.h>
 #include <dlfcn.h>
 #include <mach/task_info.h>
 #include <sys/sysctl.h>
 #include <TargetConditionals.h>
+#include <unistd.h>
 
 #include <algorithm>
 #include <string>
 #include <vector>
 
 #include "breakpad_nlist_64.h"
 
 #if !TARGET_OS_IPHONE
--- a/toolkit/crashreporter/google-breakpad/src/client/mac/handler/exception_handler.cc
+++ b/toolkit/crashreporter/google-breakpad/src/client/mac/handler/exception_handler.cc
@@ -22,29 +22,42 @@
 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
-#include <map>
 #include <mach/exc.h>
 #include <mach/mig.h>
 #include <pthread.h>
 #include <signal.h>
 #include <TargetConditionals.h>
 
+#include <map>
+
 #include "client/mac/handler/exception_handler.h"
 #include "client/mac/handler/minidump_generator.h"
 #include "common/mac/macho_utilities.h"
 #include "common/mac/scoped_task_suspend-inl.h"
 #include "google_breakpad/common/minidump_exception_mac.h"
 
+#ifndef __EXCEPTIONS
+// This file uses C++ try/catch (but shouldn't). Duplicate the macros from
+// <c++/4.2.1/exception_defines.h> allowing this file to work properly with
+// exceptions disabled even when other C++ libraries are used. #undef the try
+// and catch macros first in case libstdc++ is in use and has already provided
+// its own definitions.
+#undef try
+#define try       if (true)
+#undef catch
+#define catch(X)  if (false)
+#endif  // __EXCEPTIONS
+
 #ifndef USE_PROTECTED_ALLOCATIONS
 #if TARGET_OS_IPHONE
 #define USE_PROTECTED_ALLOCATIONS 1
 #else
 #define USE_PROTECTED_ALLOCATIONS 0
 #endif
 #endif
 
--- a/toolkit/crashreporter/google-breakpad/src/client/mac/handler/exception_handler.h
+++ b/toolkit/crashreporter/google-breakpad/src/client/mac/handler/exception_handler.h
@@ -36,17 +36,17 @@
 #ifndef CLIENT_MAC_HANDLER_EXCEPTION_HANDLER_H__
 #define CLIENT_MAC_HANDLER_EXCEPTION_HANDLER_H__
 
 #include <mach/mach.h>
 #include <TargetConditionals.h>
 
 #include <string>
 
-#include "processor/scoped_ptr.h"
+#include "common/scoped_ptr.h"
 
 #if !TARGET_OS_IPHONE
 #include "client/mac/crash_generation/crash_generation_client.h"
 #endif
 
 namespace google_breakpad {
 
 using std::string;
--- a/toolkit/crashreporter/google-breakpad/src/client/windows/crash_generation/client_info.h
+++ b/toolkit/crashreporter/google-breakpad/src/client/windows/crash_generation/client_info.h
@@ -28,18 +28,18 @@
 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
 #ifndef CLIENT_WINDOWS_CRASH_GENERATION_CLIENT_INFO_H__
 #define CLIENT_WINDOWS_CRASH_GENERATION_CLIENT_INFO_H__
 
 #include <Windows.h>
 #include <DbgHelp.h>
 #include "client/windows/common/ipc_protocol.h"
+#include "common/scoped_ptr.h"
 #include "google_breakpad/common/minidump_format.h"
-#include "processor/scoped_ptr.h"
 
 namespace google_breakpad {
 
 class CrashGenerationServer;
 
 // Abstraction for a crash client process.
 class ClientInfo {
  public:
--- a/toolkit/crashreporter/google-breakpad/src/client/windows/crash_generation/crash_generation.gyp
+++ b/toolkit/crashreporter/google-breakpad/src/client/windows/crash_generation/crash_generation.gyp
@@ -29,33 +29,33 @@
 
 {
   'includes': [
     '../build/common.gypi',
   ],
   'targets': [
     {
       'target_name': 'crash_generation_server',
-      'type': '<(library)',
+      'type': 'static_library',
       'sources': [
         'client_info.cc',
         'crash_generation_server.cc',
         'minidump_generator.cc',
         'client_info.h',
         'crash_generation_client.h',
         'crash_generation_server.h',
         'minidump_generator.h',
       ],
       'dependencies': [
         '../breakpad_client.gyp:common'
       ],
     },
     {
       'target_name': 'crash_generation_client',
-      'type': '<(library)',
+      'type': 'static_library',
       'include_dirs': [
         '<(DEPTH)',
       ],
       'sources': [
         'crash_generation_client.h',
         'crash_generation_client.cc',
         'crash_generation_server.h',
       ],
--- a/toolkit/crashreporter/google-breakpad/src/client/windows/crash_generation/crash_generation_client.h
+++ b/toolkit/crashreporter/google-breakpad/src/client/windows/crash_generation/crash_generation_client.h
@@ -30,17 +30,17 @@
 #ifndef CLIENT_WINDOWS_CRASH_GENERATION_CRASH_GENERATION_CLIENT_H_
 #define CLIENT_WINDOWS_CRASH_GENERATION_CRASH_GENERATION_CLIENT_H_
 
 #include <windows.h>
 #include <dbghelp.h>
 #include <string>
 #include <utility>
 #include "client/windows/common/ipc_protocol.h"
-#include "processor/scoped_ptr.h"
+#include "common/scoped_ptr.h"
 
 namespace google_breakpad {
 
 struct CustomClientInfo;
 
 // Abstraction of client-side implementation of out of process
 // crash generation.
 //
--- a/toolkit/crashreporter/google-breakpad/src/client/windows/crash_generation/crash_generation_server.cc
+++ b/toolkit/crashreporter/google-breakpad/src/client/windows/crash_generation/crash_generation_server.cc
@@ -27,17 +27,17 @@
 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
 #include "client/windows/crash_generation/crash_generation_server.h"
 #include <windows.h>
 #include <cassert>
 #include <list>
 #include "client/windows/common/auto_critical_section.h"
-#include "processor/scoped_ptr.h"
+#include "common/scoped_ptr.h"
 
 #include "client/windows/crash_generation/client_info.h"
 
 namespace google_breakpad {
 
 // Output buffer size.
 static const size_t kOutBufferSize = 64;
 
--- a/toolkit/crashreporter/google-breakpad/src/client/windows/crash_generation/crash_generation_server.h
+++ b/toolkit/crashreporter/google-breakpad/src/client/windows/crash_generation/crash_generation_server.h
@@ -29,17 +29,17 @@
 
 #ifndef CLIENT_WINDOWS_CRASH_GENERATION_CRASH_GENERATION_SERVER_H__
 #define CLIENT_WINDOWS_CRASH_GENERATION_CRASH_GENERATION_SERVER_H__
 
 #include <list>
 #include <string>
 #include "client/windows/common/ipc_protocol.h"
 #include "client/windows/crash_generation/minidump_generator.h"
-#include "processor/scoped_ptr.h"
+#include "common/scoped_ptr.h"
 
 namespace google_breakpad {
 class ClientInfo;
 
 // Abstraction for server side implementation of out-of-process crash
 // generation protocol for Windows platform only. It generates Windows
 // minidump files for client processes that request dump generation. When
 // the server is requested to start listening for clients (by calling the
--- a/toolkit/crashreporter/google-breakpad/src/client/windows/handler/exception_handler.cc
+++ b/toolkit/crashreporter/google-breakpad/src/client/windows/handler/exception_handler.cc
@@ -39,16 +39,19 @@
 #include "client/windows/handler/exception_handler.h"
 #include "common/windows/guid_string.h"
 
 namespace google_breakpad {
 
 static const int kWaitForHandlerThreadMs = 60000;
 static const int kExceptionHandlerThreadInitialStackSize = 64 * 1024;
 
+// As documented on MSDN, on failure SuspendThread returns (DWORD) -1
+static const DWORD kFailedToSuspendThread = static_cast<DWORD>(-1);
+
 // This is passed as the context to the MinidumpWriteDump callback.
 typedef struct {
   AppMemoryList::const_iterator iter;
   AppMemoryList::const_iterator end;
 } MinidumpCallbackContext;
 
 vector<ExceptionHandler*>* ExceptionHandler::handler_stack_ = NULL;
 LONG ExceptionHandler::handler_stack_index_ = 0;
@@ -742,27 +745,27 @@ bool ExceptionHandler::WriteMinidump(con
 bool ExceptionHandler::WriteMinidumpForChild(HANDLE child,
                                              DWORD child_blamed_thread,
                                              const wstring& dump_path,
                                              MinidumpCallback callback,
                                              void* callback_context) {
   EXCEPTION_RECORD ex;
   CONTEXT ctx;
   EXCEPTION_POINTERS exinfo = { NULL, NULL };
-  DWORD last_suspend_count = -1;
+  DWORD last_suspend_count = kFailedToSuspendThread;
   HANDLE child_thread_handle = OpenThread(THREAD_GET_CONTEXT |
                                           THREAD_QUERY_INFORMATION |
                                           THREAD_SUSPEND_RESUME,
                                           FALSE,
                                           child_blamed_thread);
   // This thread may have died already, so not opening the handle is a
   // non-fatal error.
   if (child_thread_handle != NULL) {
     last_suspend_count = SuspendThread(child_thread_handle);
-    if (last_suspend_count >= 0) {
+    if (last_suspend_count != kFailedToSuspendThread) {
       ctx.ContextFlags = CONTEXT_ALL;
       if (GetThreadContext(child_thread_handle, &ctx)) {
         memset(&ex, 0, sizeof(ex));
         ex.ExceptionCode = EXCEPTION_BREAKPOINT;
 #if defined(_M_IX86)
         ex.ExceptionAddress = reinterpret_cast<PVOID>(ctx.Eip);
 #elif defined(_M_X64)
         ex.ExceptionAddress = reinterpret_cast<PVOID>(ctx.Rip);
@@ -775,17 +778,17 @@ bool ExceptionHandler::WriteMinidumpForC
 
   ExceptionHandler handler(dump_path, NULL, callback, callback_context,
                            HANDLER_NONE);
   bool success = handler.WriteMinidumpWithExceptionForProcess(
       child_blamed_thread,
       exinfo.ExceptionRecord ? &exinfo : NULL,
       NULL, child, false);
 
-  if (last_suspend_count >= 0) {
+  if (last_suspend_count != kFailedToSuspendThread) {
     ResumeThread(child_thread_handle);
   }
 
   CloseHandle(child_thread_handle);
 
   if (callback) {
     success = callback(handler.dump_path_c_, handler.next_minidump_id_c_,
                        callback_context, NULL, NULL, success);
--- a/toolkit/crashreporter/google-breakpad/src/client/windows/handler/exception_handler.gyp
+++ b/toolkit/crashreporter/google-breakpad/src/client/windows/handler/exception_handler.gyp
@@ -29,17 +29,17 @@
 
 {
   'includes': [
     '../build/common.gypi',
   ],
   'targets': [
     {
       'target_name': 'exception_handler',
-      'type': '<(library)',
+      'type': 'static_library',
       'sources': [
         "exception_handler.cc",
         "exception_handler.h",
       ],
       'dependencies': [
         '../breakpad_client.gyp:common',
         '../crash_generation/crash_generation.gyp:crash_generation_server',
       ]
--- a/toolkit/crashreporter/google-breakpad/src/client/windows/handler/exception_handler.h
+++ b/toolkit/crashreporter/google-breakpad/src/client/windows/handler/exception_handler.h
@@ -66,18 +66,18 @@
 #pragma warning( disable : 4530 )
 
 #include <list>
 #include <string>
 #include <vector>
 
 #include "client/windows/common/ipc_protocol.h"
 #include "client/windows/crash_generation/crash_generation_client.h"
+#include "common/scoped_ptr.h"
 #include "google_breakpad/common/minidump_format.h"
-#include "processor/scoped_ptr.h"
 
 namespace google_breakpad {
 
 using std::vector;
 using std::wstring;
 
 // These entries store a list of memory regions that the client wants included
 // in the minidump.
--- a/toolkit/crashreporter/google-breakpad/src/client/windows/sender/crash_report_sender.gyp
+++ b/toolkit/crashreporter/google-breakpad/src/client/windows/sender/crash_report_sender.gyp
@@ -29,17 +29,17 @@
 
 {
   'includes': [
     '../build/common.gypi',
   ],
   'targets': [
     {
       'target_name': 'crash_report_sender',
-      'type': '<(library)',
+      'type': 'static_library',
       'sources': [
         'crash_report_sender.cc',
         'crash_report_sender.h',
       ],
       'dependencies': [
         '../breakpad_client.gyp:common'
       ],
     },
--- a/toolkit/crashreporter/google-breakpad/src/client/windows/unittests/client_tests.gyp
+++ b/toolkit/crashreporter/google-breakpad/src/client/windows/unittests/client_tests.gyp
@@ -31,18 +31,20 @@
   'includes': [
     '../build/common.gypi',
   ],
   'targets': [
     {
       'target_name': 'client_tests',
       'type': 'executable',
       'sources': [
+        'exception_handler_test.h',
         'exception_handler_test.cc',
         'exception_handler_death_test.cc',
+        'exception_handler_nesting_test.cc',
         'minidump_test.cc',
         'dump_analysis.cc',
         'dump_analysis.h',
         'crash_generation_server_test.cc'
       ],
       'dependencies': [
         'testing.gyp:gtest',
         'testing.gyp:gmock',
--- a/toolkit/crashreporter/google-breakpad/src/client/windows/unittests/dump_analysis.cc
+++ b/toolkit/crashreporter/google-breakpad/src/client/windows/unittests/dump_analysis.cc
@@ -26,18 +26,18 @@
 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
 #include <windows.h>
 #include <objbase.h>
 #include <dbghelp.h>
 
-#include "dump_analysis.h"  // NOLINT
-#include "gtest/gtest.h"
+#include "client/windows/unittests/dump_analysis.h"  // NOLINT
+#include "testing/gtest/include/gtest/gtest.h"
 
 DumpAnalysis::~DumpAnalysis() {
   if (dump_file_view_ != NULL) {
     EXPECT_TRUE(::UnmapViewOfFile(dump_file_view_));
     ::CloseHandle(dump_file_mapping_);
     dump_file_mapping_ = NULL;
   }
 
--- a/toolkit/crashreporter/google-breakpad/src/client/windows/unittests/dump_analysis.h
+++ b/toolkit/crashreporter/google-breakpad/src/client/windows/unittests/dump_analysis.h
@@ -25,17 +25,17 @@
 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
 #ifndef CLIENT_WINDOWS_UNITTESTS_DUMP_ANALYSIS_H_
 #define CLIENT_WINDOWS_UNITTESTS_DUMP_ANALYSIS_H_
 
-#include "../crash_generation/minidump_generator.h"
+#include "client/windows/crash_generation/minidump_generator.h"
 
 // Convenience to get to the PEB pointer in a TEB.
 struct FakeTEB {
   char dummy[0x30];
   void* peb;
 };
 
 class DumpAnalysis {
--- a/toolkit/crashreporter/google-breakpad/src/client/windows/unittests/exception_handler_death_test.cc
+++ b/toolkit/crashreporter/google-breakpad/src/client/windows/unittests/exception_handler_death_test.cc
@@ -30,21 +30,22 @@
 #include <windows.h>
 #include <dbghelp.h>
 #include <strsafe.h>
 #include <objbase.h>
 #include <shellapi.h>
 
 #include <string>
 
-#include "../../../breakpad_googletest_includes.h"
-#include "../../../../common/windows/string_utils-inl.h"
-#include "../crash_generation/crash_generation_server.h"
-#include "../handler/exception_handler.h"
-#include "../../../../google_breakpad/processor/minidump.h"
+#include "breakpad_googletest_includes.h"
+#include "client/windows/crash_generation/crash_generation_server.h"
+#include "client/windows/handler/exception_handler.h"
+#include "client/windows/unittests/exception_handler_test.h"
+#include "common/windows/string_utils-inl.h"
+#include "google_breakpad/processor/minidump.h"
 
 namespace {
 
 using std::wstring;
 using namespace google_breakpad;
 
 const wchar_t kPipeName[] = L"\\\\.\\pipe\\BreakpadCrashTest\\TestCaseServer";
 const char kSuccessIndicator[] = "success";
@@ -117,16 +118,20 @@ TEST_F(ExceptionHandlerDeathTest, InProc
   // reexecuted in the child process, we don't have to worry about
   // the semantics of the exception handler being inherited/not
   // inherited across CreateProcess().
   ASSERT_TRUE(DoesPathExist(temp_path_));
   google_breakpad::ExceptionHandler *exc =
     new google_breakpad::ExceptionHandler(
     temp_path_, NULL, &MinidumpWrittenCallback, NULL,
     google_breakpad::ExceptionHandler::HANDLER_ALL);
+
+  // Disable GTest SEH handler
+  testing::DisableExceptionHandlerInScope disable_exception_handler;
+
   int *i = NULL;
   ASSERT_DEATH((*i)++, kSuccessIndicator);
   delete exc;
 }
 
 static bool gDumpCallbackCalled = false;
 
 void clientDumpCallback(void *dump_context,
@@ -136,16 +141,20 @@ void clientDumpCallback(void *dump_conte
 }
 
 void ExceptionHandlerDeathTest::DoCrashAccessViolation() {
   google_breakpad::ExceptionHandler *exc =
     new google_breakpad::ExceptionHandler(
     temp_path_, NULL, NULL, NULL,
     google_breakpad::ExceptionHandler::HANDLER_ALL, MiniDumpNormal, kPipeName,
     NULL);
+
+  // Disable GTest SEH handler
+  testing::DisableExceptionHandlerInScope disable_exception_handler;
+
   // Although this is executing in the child process of the death test,
   // if it's not true we'll still get an error rather than the crash
   // being expected.
   ASSERT_TRUE(exc->IsOutOfProcess());
   int *i = NULL;
   printf("%d\n", (*i)++);
 }
 
@@ -247,16 +256,19 @@ wstring find_minidump_in_directory(const
 
 TEST_F(ExceptionHandlerDeathTest, InstructionPointerMemory) {
   ASSERT_TRUE(DoesPathExist(temp_path_));
   google_breakpad::ExceptionHandler *exc =
       new google_breakpad::ExceptionHandler(
           temp_path_, NULL, NULL, NULL,
           google_breakpad::ExceptionHandler::HANDLER_ALL);
 
+  // Disable GTest SEH handler
+  testing::DisableExceptionHandlerInScope disable_exception_handler;
+
   // Get some executable memory.
   const u_int32_t kMemorySize = 256;  // bytes
   const int kOffset = kMemorySize / 2;
   // This crashes with SIGILL on x86/x86-64/arm.
   const unsigned char instructions[] = { 0xff, 0xff, 0xff, 0xff };
   char* memory = reinterpret_cast<char*>(VirtualAlloc(NULL,
                                                       kMemorySize,
                                                       MEM_COMMIT | MEM_RESERVE,
@@ -329,16 +341,19 @@ TEST_F(ExceptionHandlerDeathTest, Instru
 
 TEST_F(ExceptionHandlerDeathTest, InstructionPointerMemoryMinBound) {
   ASSERT_TRUE(DoesPathExist(temp_path_));
   google_breakpad::ExceptionHandler *exc =
       new google_breakpad::ExceptionHandler(
           temp_path_, NULL, NULL, NULL,
           google_breakpad::ExceptionHandler::HANDLER_ALL);
 
+  // Disable GTest SEH handler
+  testing::DisableExceptionHandlerInScope disable_exception_handler;
+
   SYSTEM_INFO sSysInfo;         // Useful information about the system
   GetSystemInfo(&sSysInfo);     // Initialize the structure.
 
   const u_int32_t kMemorySize = 256;  // bytes
   const DWORD kPageSize = sSysInfo.dwPageSize;
   const int kOffset = 0;
   // This crashes with SIGILL on x86/x86-64/arm.
   const unsigned char instructions[] = { 0xff, 0xff, 0xff, 0xff };
@@ -416,16 +431,19 @@ TEST_F(ExceptionHandlerDeathTest, Instru
 
 TEST_F(ExceptionHandlerDeathTest, InstructionPointerMemoryMaxBound) {
   ASSERT_TRUE(DoesPathExist(temp_path_));
   google_breakpad::ExceptionHandler *exc =
       new google_breakpad::ExceptionHandler(
           temp_path_, NULL, NULL, NULL,
           google_breakpad::ExceptionHandler::HANDLER_ALL);
 
+  // Disable GTest SEH handler
+  testing::DisableExceptionHandlerInScope disable_exception_handler;
+
   SYSTEM_INFO sSysInfo;         // Useful information about the system
   GetSystemInfo(&sSysInfo);     // Initialize the structure.
 
   const DWORD kPageSize = sSysInfo.dwPageSize;
   // This crashes with SIGILL on x86/x86-64/arm.
   const unsigned char instructions[] = { 0xff, 0xff, 0xff, 0xff };
   const int kOffset = kPageSize - sizeof(instructions);
   // Get some executable memory. Specifically, reserve two pages,
new file mode 100755
--- /dev/null
+++ b/toolkit/crashreporter/google-breakpad/src/client/windows/unittests/exception_handler_nesting_test.cc
@@ -0,0 +1,327 @@
+// Copyright 2012, Google Inc.
+// All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//     * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//     * Redistributions in binary form must reproduce the above
+// copyright notice, this list of conditions and the following disclaimer
+// in the documentation and/or other materials provided with the
+// distribution.
+//     * Neither the name of Google Inc. nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+#include <windows.h>
+
+#include <string>
+
+#include "breakpad_googletest_includes.h"
+#include "client/windows/handler/exception_handler.h"
+#include "client/windows/unittests/exception_handler_test.h"
+
+namespace {
+
+const char kFoo[] = "foo";
+const char kBar[] = "bar";
+
+const char kStartOfLine[] = "^";
+const char kEndOfLine[] = "$";
+
+const char kFilterReturnsTrue[] = "filter_returns_true";
+const char kFilterReturnsFalse[] = "filter_returns_false";
+
+const char kCallbackReturnsTrue[] = "callback_returns_true";
+const char kCallbackReturnsFalse[] = "callback_returns_false";
+
+bool DoesPathExist(const wchar_t *path_name) {
+  DWORD flags = GetFileAttributes(path_name);
+  if (flags == INVALID_FILE_ATTRIBUTES) {
+    return false;
+  }
+  return true;
+}
+
+// A callback function to run before Breakpad performs any substantial
+// processing of an exception.  A FilterCallback is called before writing
+// a minidump.  context is the parameter supplied by the user as
+// callback_context when the handler was created.  exinfo points to the
+// exception record, if any; assertion points to assertion information,
+// if any.
+//
+// If a FilterCallback returns true, Breakpad will continue processing,
+// attempting to write a minidump.  If a FilterCallback returns false,
+// Breakpad will immediately report the exception as unhandled without
+// writing a minidump, allowing another handler the opportunity to handle it.
+template <bool filter_return_value>
+bool CrashHandlerFilter(void* context,
+                        EXCEPTION_POINTERS* exinfo,
+                        MDRawAssertionInfo* assertion) {
+  if (filter_return_value) {
+    fprintf(stderr, kFilterReturnsTrue);
+  } else {
+    fprintf(stderr, kFilterReturnsFalse);
+  }
+  fflush(stderr);
+
+  return filter_return_value;
+}
+
+// A callback function to run after the minidump has been written.
+// minidump_id is a unique id for the dump, so the minidump
+// file is <dump_path>\<minidump_id>.dmp.  context is the parameter supplied
+// by the user as callback_context when the handler was created.  exinfo
+// points to the exception record, or NULL if no exception occurred.
+// succeeded indicates whether a minidump file was successfully written.
+// assertion points to information about an assertion if the handler was
+// invoked by an assertion.
+//
+// If an exception occurred and the callback returns true, Breakpad will treat
+// the exception as fully-handled, suppressing any other handlers from being
+// notified of the exception.  If the callback returns false, Breakpad will
+// treat the exception as unhandled, and allow another handler to handle it.
+// If there are no other handlers, Breakpad will report the exception to the
+// system as unhandled, allowing a debugger or native crash dialog the
+// opportunity to handle the exception.  Most callback implementations
+// should normally return the value of |succeeded|, or when they wish to
+// not report an exception of handled, false.  Callbacks will rarely want to
+// return true directly (unless |succeeded| is true).
+//
+// For out-of-process dump generation, dump path and minidump ID will always
+// be NULL. In case of out-of-process dump generation, the dump path and
+// minidump id are controlled by the server process and are not communicated
+// back to the crashing process.
+template <bool callback_return_value>
+bool MinidumpWrittenCallback(const wchar_t* dump_path,
+                             const wchar_t* minidump_id,
+                             void* context,
+                             EXCEPTION_POINTERS* exinfo,
+                             MDRawAssertionInfo* assertion,
+                             bool succeeded) {
+  bool rv = false;
+  if (callback_return_value &&
+      succeeded &&
+      DoesPathExist(dump_path)) {
+    rv = true;
+    fprintf(stderr, kCallbackReturnsTrue);
+  } else {
+    fprintf(stderr, kCallbackReturnsFalse);
+  }
+  fflush(stderr);
+
+  return rv;
+}
+
+
+void DoCrash(const char *message) {
+  if (message) {
+    fprintf(stderr, "%s", message);
+    fflush(stderr);
+  }
+  int *i = NULL;
+  (*i)++;
+
+  ASSERT_TRUE(false);
+}
+
+void InstallExceptionHandlerAndCrash(bool install_filter,
+                                     bool filter_return_value,
+                                     bool install_callback,
+                                     bool callback_return_value) {
+  wchar_t temp_path[MAX_PATH] = { '\0' };
+  GetTempPath(MAX_PATH, temp_path);
+
+  ASSERT_TRUE(DoesPathExist(temp_path));
+  google_breakpad::ExceptionHandler exc(
+      temp_path,
+      install_filter ? 
+        (filter_return_value ?
+          &CrashHandlerFilter<true> :
+          &CrashHandlerFilter<false>) :
+        NULL,
+      install_callback ?
+        (callback_return_value ?
+          &MinidumpWrittenCallback<true> :
+          &MinidumpWrittenCallback<false>) :
+        NULL,
+      NULL,  // callback_context
+      google_breakpad::ExceptionHandler::HANDLER_EXCEPTION);
+
+  // Disable GTest SEH handler
+  testing::DisableExceptionHandlerInScope disable_exception_handler;
+
+  DoCrash(NULL);
+}
+
+TEST(AssertDeathSanity, Simple) {
+  ASSERT_DEATH(DoCrash(NULL), "");
+}
+
+TEST(AssertDeathSanity, Regex) {
+  ASSERT_DEATH(DoCrash(kFoo),
+    std::string(kStartOfLine) +
+      std::string(kFoo) +
+      std::string(kEndOfLine));
+
+  ASSERT_DEATH(DoCrash(kBar), 
+    std::string(kStartOfLine) +
+      std::string(kBar) +
+      std::string(kEndOfLine));
+}
+
+TEST(ExceptionHandlerCallbacks, FilterTrue_No_Callback) {
+  ASSERT_DEATH(
+    InstallExceptionHandlerAndCrash(true,    // install_filter
+                                    true,    // filter_return_value
+                                    false,   // install_callback
+                                    false),  // callback_return_value
+    std::string(kStartOfLine) +
+      std::string(kFilterReturnsTrue) +
+      std::string(kEndOfLine));
+}
+
+TEST(ExceptionHandlerCallbacks, FilterTrue_Callback) {
+  ASSERT_DEATH(
+    InstallExceptionHandlerAndCrash(true,    // install_filter
+                                    true,    // filter_return_value
+                                    true,    // install_callback
+                                    false),  // callback_return_value
+    std::string(kStartOfLine) +
+      std::string(kFilterReturnsTrue) +
+      std::string(kCallbackReturnsFalse) +
+      std::string(kEndOfLine));
+}
+
+TEST(ExceptionHandlerCallbacks, FilterFalse_No_Callback) {
+  ASSERT_DEATH(
+    InstallExceptionHandlerAndCrash(true,    // install_filter
+                                    false,   // filter_return_value
+                                    false,   // install_callback
+                                    false),  // callback_return_value
+    std::string(kStartOfLine) +
+      std::string(kFilterReturnsFalse) +
+      std::string(kEndOfLine));
+}
+
+// Callback shouldn't be executed when filter returns false
+TEST(ExceptionHandlerCallbacks, FilterFalse_Callback) {
+  ASSERT_DEATH(
+    InstallExceptionHandlerAndCrash(true,    // install_filter
+                                    false,   // filter_return_value
+                                    true,    // install_callback
+                                    false),  // callback_return_value
+    std::string(kStartOfLine) +
+      std::string(kFilterReturnsFalse) +
+      std::string(kEndOfLine));
+}
+
+TEST(ExceptionHandlerCallbacks, No_Filter_No_Callback) {
+  ASSERT_DEATH(
+    InstallExceptionHandlerAndCrash(false,   // install_filter
+                                    true,    // filter_return_value
+                                    false,   // install_callback
+                                    false),  // callback_return_value
+    std::string(kStartOfLine) +
+      std::string(kEndOfLine));
+}
+
+TEST(ExceptionHandlerCallbacks, No_Filter_Callback) {
+  ASSERT_DEATH(
+    InstallExceptionHandlerAndCrash(false,   // install_filter
+                                    true,    // filter_return_value
+                                    true,    // install_callback
+                                    false),  // callback_return_value
+    std::string(kStartOfLine) +
+      std::string(kCallbackReturnsFalse) +
+      std::string(kEndOfLine));
+}
+
+
+TEST(ExceptionHandlerNesting, Skip_From_Inner_Filter) {
+  wchar_t temp_path[MAX_PATH] = { '\0' };
+  GetTempPath(MAX_PATH, temp_path);
+
+  ASSERT_TRUE(DoesPathExist(temp_path));
+  google_breakpad::ExceptionHandler exc(
+      temp_path,
+      &CrashHandlerFilter<true>,
+      &MinidumpWrittenCallback<false>,
+      NULL,  // callback_context
+      google_breakpad::ExceptionHandler::HANDLER_EXCEPTION);
+
+  ASSERT_DEATH(
+    InstallExceptionHandlerAndCrash(true,   // install_filter
+                                    false,  // filter_return_value
+                                    true,   // install_callback
+                                    true),  // callback_return_value
+    std::string(kStartOfLine) +
+      std::string(kFilterReturnsFalse) +    // inner filter
+      std::string(kFilterReturnsTrue) +     // outer filter
+      std::string(kCallbackReturnsFalse) +  // outer callback
+      std::string(kEndOfLine));
+}
+
+TEST(ExceptionHandlerNesting, Skip_From_Inner_Callback) {
+  wchar_t temp_path[MAX_PATH] = { '\0' };
+  GetTempPath(MAX_PATH, temp_path);
+
+  ASSERT_TRUE(DoesPathExist(temp_path));
+  google_breakpad::ExceptionHandler exc(
+      temp_path,
+      &CrashHandlerFilter<true>,
+      &MinidumpWrittenCallback<false>,
+      NULL,  // callback_context
+      google_breakpad::ExceptionHandler::HANDLER_EXCEPTION);
+
+  ASSERT_DEATH(
+    InstallExceptionHandlerAndCrash(true,    // install_filter
+                                    true,    // filter_return_value
+                                    true,    // install_callback
+                                    false),  // callback_return_value
+    std::string(kStartOfLine) +
+      std::string(kFilterReturnsTrue) +      // inner filter
+      std::string(kCallbackReturnsFalse) +   // inner callback
+      std::string(kFilterReturnsTrue) +      // outer filter
+      std::string(kCallbackReturnsFalse) +   // outer callback
+      std::string(kEndOfLine));
+}
+
+TEST(ExceptionHandlerNesting, Handled_By_Inner_Handler) {
+  wchar_t temp_path[MAX_PATH] = { '\0' };
+  GetTempPath(MAX_PATH, temp_path);
+
+  ASSERT_TRUE(DoesPathExist(temp_path));
+  google_breakpad::ExceptionHandler exc(
+      temp_path,
+      &CrashHandlerFilter<true>,
+      &MinidumpWrittenCallback<true>,
+      NULL,  // callback_context
+      google_breakpad::ExceptionHandler::HANDLER_EXCEPTION);
+
+  ASSERT_DEATH(
+    InstallExceptionHandlerAndCrash(true,   // install_filter
+                                    true,   // filter_return_value
+                                    true,   // install_callback
+                                    true),  // callback_return_value
+    std::string(kStartOfLine) +
+      std::string(kFilterReturnsTrue) +    // inner filter
+      std::string(kCallbackReturnsTrue) +  // inner callback
+      std::string(kEndOfLine));
+}
+
+}  // namespace
--- a/toolkit/crashreporter/google-breakpad/src/client/windows/unittests/exception_handler_test.cc
+++ b/toolkit/crashreporter/google-breakpad/src/client/windows/unittests/exception_handler_test.cc
@@ -22,30 +22,45 @@
 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
+#include "client/windows/unittests/exception_handler_test.h"
+
 #include <windows.h>
 #include <dbghelp.h>
 #include <strsafe.h>
 #include <objbase.h>
 #include <shellapi.h>
 
 #include <string>
 
-#include "../../../breakpad_googletest_includes.h"
-#include "../../../../common/windows/string_utils-inl.h"
-#include "../../../../google_breakpad/processor/minidump.h"
-#include "../crash_generation/crash_generation_server.h"
-#include "../handler/exception_handler.h"
-#include "dump_analysis.h"  // NOLINT
+#include "breakpad_googletest_includes.h"
+#include "client/windows/crash_generation/crash_generation_server.h"
+#include "client/windows/handler/exception_handler.h"
+#include "client/windows/unittests/dump_analysis.h"  // NOLINT
+#include "common/windows/string_utils-inl.h"
+#include "google_breakpad/processor/minidump.h"
+
+namespace testing {
+
+DisableExceptionHandlerInScope::DisableExceptionHandlerInScope() {
+  catch_exceptions_ = GTEST_FLAG(catch_exceptions);
+  GTEST_FLAG(catch_exceptions) = false;
+}
+
+DisableExceptionHandlerInScope::~DisableExceptionHandlerInScope() {
+  GTEST_FLAG(catch_exceptions) = catch_exceptions_;
+}
+
+}  // namespace testing
 
 namespace {
 
 using std::wstring;
 using namespace google_breakpad;
 
 const wchar_t kPipeName[] = L"\\\\.\\pipe\\BreakpadCrashTest\\TestCaseServer";
 const char kSuccessIndicator[] = "success";
@@ -356,16 +371,20 @@ TEST_F(ExceptionHandlerTest, PureVirtual
 // Test that writing a minidump produces a valid minidump containing
 // some expected structures.
 TEST_F(ExceptionHandlerTest, WriteMinidumpTest) {
   ExceptionHandler handler(temp_path_,
                            NULL,
                            DumpCallback,
                            NULL,
                            ExceptionHandler::HANDLER_ALL);
+
+  // Disable GTest SEH handler
+  testing::DisableExceptionHandlerInScope disable_exception_handler;
+
   ASSERT_TRUE(handler.WriteMinidump());
   ASSERT_FALSE(dump_file.empty());
 
   string minidump_filename;
   ASSERT_TRUE(WindowsStringUtils::safe_wcstombs(dump_file,
                                                 &minidump_filename));
 
   // Read the minidump and verify some info.
@@ -391,16 +410,19 @@ TEST_F(ExceptionHandlerTest, AdditionalM
   }
 
   ExceptionHandler handler(temp_path_,
                            NULL,
                            DumpCallback,
                            NULL,
                            ExceptionHandler::HANDLER_ALL);
 
+  // Disable GTest SEH handler
+  testing::DisableExceptionHandlerInScope disable_exception_handler;
+
   // Add the memory region to the list of memory to be included.
   handler.RegisterAppMemory(memory, kMemorySize);
   ASSERT_TRUE(handler.WriteMinidump());
   ASSERT_FALSE(dump_file.empty());
 
   string minidump_filename;
   ASSERT_TRUE(WindowsStringUtils::safe_wcstombs(dump_file,
                                                 &minidump_filename));
@@ -442,16 +464,19 @@ TEST_F(ExceptionHandlerTest, AdditionalM
   }
 
   ExceptionHandler handler(temp_path_,
                            NULL,
                            DumpCallback,
                            NULL,
                            ExceptionHandler::HANDLER_ALL);
 
+  // Disable GTest SEH handler
+  testing::DisableExceptionHandlerInScope disable_exception_handler;
+
   // Add the memory region to the list of memory to be included.
   handler.RegisterAppMemory(memory, kMemorySize);
 
   // ...and then remove it
   handler.UnregisterAppMemory(memory);
 
   ASSERT_TRUE(handler.WriteMinidump());
   ASSERT_FALSE(dump_file.empty());
new file mode 100755
--- /dev/null
+++ b/toolkit/crashreporter/google-breakpad/src/client/windows/unittests/exception_handler_test.h
@@ -0,0 +1,61 @@
+// Copyright 2012, Google Inc.
+// All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//     * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//     * Redistributions in binary form must reproduce the above
+// copyright notice, this list of conditions and the following disclaimer
+// in the documentation and/or other materials provided with the
+// distribution.
+//     * Neither the name of Google Inc. nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+#ifndef CLIENT_WINDOWS_UNITTESTS_EXCEPTION_HANDLER_TEST_H_
+#define CLIENT_WINDOWS_UNITTESTS_EXCEPTION_HANDLER_TEST_H_
+
+namespace testing {
+
+// By default, GTest (on Windows) installs a SEH filter (and a handler) before
+// starting to run all the tests in order to avoid test interruptions is some
+// of the tests are crashing.  Unfortunately, this functionality prevents the
+// execution to reach the UnhandledExceptionFilter installed by Google-Breakpad
+// ExceptionHandler so in order to test the Google-Breakpad exception handling
+// code the exception handling done by GTest must be disabled.
+// Usage:
+//
+//  google_breakpad::ExceptionHandler exc(...);
+//
+//  // Disable GTest SEH handler
+//  testing::DisableExceptionHandlerInScope disable_exception_handler;
+//  ...
+//  ASSERT_DEATH( ... some crash ...);
+//
+class DisableExceptionHandlerInScope {
+ public:
+  DisableExceptionHandlerInScope();
+  ~DisableExceptionHandlerInScope();
+
+ private:
+  bool catch_exceptions_;
+};
+
+}  // namespace testing
+
+#endif  // CLIENT_WINDOWS_UNITTESTS_EXCEPTION_HANDLER_TEST_H_
--- a/toolkit/crashreporter/google-breakpad/src/client/windows/unittests/minidump_test.cc
+++ b/toolkit/crashreporter/google-breakpad/src/client/windows/unittests/minidump_test.cc
@@ -26,18 +26,18 @@
 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
 #include <windows.h>
 #include <objbase.h>
 #include <dbghelp.h>
 
-#include "../crash_generation/minidump_generator.h"
-#include "dump_analysis.h"  // NOLINT
+#include "client/windows/crash_generation/minidump_generator.h"
+#include "client/windows/unittests/dump_analysis.h"  // NOLINT
 
 #include "gtest/gtest.h"
 
 namespace {
 
 // Minidump with stacks, PEB, TEB, and unloaded module list.
 const MINIDUMP_TYPE kSmallDumpType = static_cast<MINIDUMP_TYPE>(
     MiniDumpWithProcessThreadData |  // Get PEB and TEB.
--- a/toolkit/crashreporter/google-breakpad/src/client/windows/unittests/testing.gyp
+++ b/toolkit/crashreporter/google-breakpad/src/client/windows/unittests/testing.gyp
@@ -31,17 +31,17 @@
   'includes': [
     '../build/common.gypi',
   ],
   'target_defaults': {
   },
   'targets': [
     {
       'target_name': 'gtest',
-      'type': '<(library)',
+      'type': 'static_library',
       'include_dirs': [
         '<(DEPTH)/testing/include',
         '<(DEPTH)/testing/gtest',
         '<(DEPTH)/testing/gtest/include',
       ],
       'sources': [
         '<(DEPTH)/testing/gtest/src/gtest-all.cc',
       ],
@@ -49,17 +49,17 @@
         'include_dirs': [
           '<(DEPTH)/testing/include',
           '<(DEPTH)/testing/gtest/include',
         ]
       },
     },
     {
       'target_name': 'gmock',
-      'type': '<(library)',
+      'type': 'static_library',
       'include_dirs': [
         '<(DEPTH)/testing/include',
         '<(DEPTH)/testing/',
         '<(DEPTH)/testing/gtest',
         '<(DEPTH)/testing/gtest/include',
       ],
       'sources': [
         '<(DEPTH)/testing/src/gmock-all.cc',
--- a/toolkit/crashreporter/google-breakpad/src/common/dwarf/dwarf2diehandler.cc
+++ b/toolkit/crashreporter/google-breakpad/src/common/dwarf/dwarf2diehandler.cc
@@ -52,18 +52,17 @@ DIEDispatcher::~DIEDispatcher() {
 bool DIEDispatcher::StartCompilationUnit(uint64 offset, uint8 address_size,
                                          uint8 offset_size, uint64 cu_length,
                                          uint8 dwarf_version) {
   return root_handler_->StartCompilationUnit(offset, address_size,
                                              offset_size, cu_length,
                                              dwarf_version);
 }
 
-bool DIEDispatcher::StartDIE(uint64 offset, enum DwarfTag tag,
-                             const AttributeList& attrs) {
+bool DIEDispatcher::StartDIE(uint64 offset, enum DwarfTag tag) {
   // The stack entry for the parent of this DIE, if there is one.
   HandlerStack *parent = die_handlers_.empty() ? NULL : &die_handlers_.top();
 
   // Does this call indicate that we're done receiving the parent's
   // attributes' values?  If so, call its EndAttributes member function.
   if (parent && parent->handler_ && !parent->reported_attributes_end_) {
     parent->reported_attributes_end_ = true;
     if (!parent->handler_->EndAttributes()) {
@@ -77,27 +76,27 @@ bool DIEDispatcher::StartDIE(uint64 offs
     }
   }
 
   // Find a handler for this DIE.
   DIEHandler *handler;
   if (parent) {
     if (parent->handler_)
       // Ask the parent to find a handler.
-      handler = parent->handler_->FindChildHandler(offset, tag, attrs);
+      handler = parent->handler_->FindChildHandler(offset, tag);
     else
       // No parent handler means we're not interested in any of our
       // children.
       handler = NULL;
   } else {
     // This is the root DIE.  For a non-root DIE, the parent's handler
     // decides whether to visit it, but the root DIE has no parent
     // handler, so we have a special method on the root DIE handler
     // itself to decide.
-    if (root_handler_->StartRootDIE(offset, tag, attrs))
+    if (root_handler_->StartRootDIE(offset, tag))
       handler = root_handler_;
     else
       handler = NULL;
   }
 
   // Push a handler stack entry for this new handler. As an
   // optimization, we don't push NULL-handler entries on top of other
   // NULL-handler entries; we just let the oldest such entry stand for
--- a/toolkit/crashreporter/google-breakpad/src/common/dwarf/dwarf2diehandler.h
+++ b/toolkit/crashreporter/google-breakpad/src/common/dwarf/dwarf2diehandler.h
@@ -234,22 +234,20 @@ class DIEHandler {
 
   // If EndAttributes returns true to indicate that some of the DIE's
   // children might be of interest, then we apply this function to
   // each of the DIE's children.  If it returns a handler object, then
   // we use that to visit the child DIE.  If it returns NULL, we skip
   // that child DIE (and all its descendants).
   //
   // OFFSET is the offset of the child; TAG indicates what kind of DIE
-  // it is; and ATTRS is the list of attributes the DIE will have, and
-  // their forms (their values are not provided).
+  // it is.
   //
   // The default definition skips all children.
-  virtual DIEHandler *FindChildHandler(uint64 offset, enum DwarfTag tag,
-                                       const AttributeList &attrs) {
+  virtual DIEHandler *FindChildHandler(uint64 offset, enum DwarfTag tag) {
     return NULL;
   }
 
   // When we are done processing a DIE, we call this member function.
   // This happens after the EndAttributes call, all FindChildHandler
   // calls (if any), and all operations on the children themselves (if
   // any). We call Finish on every handler --- even if EndAttributes
   // returns false.
@@ -275,34 +273,32 @@ class RootDIEHandler: public DIEHandler 
   // For the root DIE handler only, we pass the offset, tag and
   // attributes of the compilation unit's root DIE.  This is the only
   // way the root DIE handler can find the root DIE's tag.  If this
   // function returns true, we will visit the root DIE using the usual
   // DIEHandler methods; otherwise, we skip the entire compilation
   // unit.
   //
   // The default definition elects to visit the root DIE.
-  virtual bool StartRootDIE(uint64 offset, enum DwarfTag tag,
-                            const AttributeList& attrs) { return true; }
+  virtual bool StartRootDIE(uint64 offset, enum DwarfTag tag) { return true; }
 };
 
 class DIEDispatcher: public Dwarf2Handler {
  public:
   // Create a Dwarf2Handler which uses ROOT_HANDLER as the handler for
   // the compilation unit's root die, as described for the DIEHandler
   // class.
   DIEDispatcher(RootDIEHandler *root_handler) : root_handler_(root_handler) { }
   // Destroying a DIEDispatcher destroys all active handler objects
   // except the root handler.
   ~DIEDispatcher();
   bool StartCompilationUnit(uint64 offset, uint8 address_size,
                             uint8 offset_size, uint64 cu_length,
                             uint8 dwarf_version);
-  bool StartDIE(uint64 offset, enum DwarfTag tag,
-                const AttributeList &attrs);
+  bool StartDIE(uint64 offset, enum DwarfTag tag);
   void ProcessAttributeUnsigned(uint64 offset,
                                 enum DwarfAttribute attr,
                                 enum DwarfForm form,
                                 uint64 data);
   void ProcessAttributeSigned(uint64 offset,
                               enum DwarfAttribute attr,
                               enum DwarfForm form,
                               int64 data);
--- a/toolkit/crashreporter/google-breakpad/src/common/dwarf/dwarf2diehandler_unittest.cc
+++ b/toolkit/crashreporter/google-breakpad/src/common/dwarf/dwarf2diehandler_unittest.cc
@@ -46,17 +46,16 @@ using ::testing::_;
 using ::testing::ContainerEq;
 using ::testing::ElementsAreArray;
 using ::testing::Eq;
 using ::testing::InSequence;
 using ::testing::Return;
 using ::testing::Sequence;
 using ::testing::StrEq;
 
-using dwarf2reader::AttributeList;
 using dwarf2reader::DIEDispatcher;
 using dwarf2reader::DIEHandler;
 using dwarf2reader::DwarfAttribute;
 using dwarf2reader::DwarfForm;
 using dwarf2reader::DwarfTag;
 using dwarf2reader::RootDIEHandler;
 
 class MockDIEHandler: public DIEHandler {
@@ -69,18 +68,17 @@ class MockDIEHandler: public DIEHandler 
                void(DwarfAttribute, DwarfForm, uint64));
   MOCK_METHOD4(ProcessAttributeBuffer,
                void(DwarfAttribute, DwarfForm, const char *, uint64));
   MOCK_METHOD3(ProcessAttributeString,
                void(DwarfAttribute, DwarfForm, const string &));
   MOCK_METHOD3(ProcessAttributeSignature,
                void(DwarfAttribute, DwarfForm, uint64));
   MOCK_METHOD0(EndAttributes, bool());
-  MOCK_METHOD3(FindChildHandler, DIEHandler *(uint64, DwarfTag,
-                                              const AttributeList &));
+  MOCK_METHOD2(FindChildHandler, DIEHandler *(uint64, DwarfTag));
   MOCK_METHOD0(Finish, void());
 };
 
 class MockRootDIEHandler: public RootDIEHandler {
  public:
   MOCK_METHOD3(ProcessAttributeUnsigned,
                void(DwarfAttribute, DwarfForm, uint64));
   MOCK_METHOD3(ProcessAttributeSigned,
@@ -89,21 +87,20 @@ class MockRootDIEHandler: public RootDIE
                void(DwarfAttribute, DwarfForm, uint64));
   MOCK_METHOD4(ProcessAttributeBuffer,
                void(DwarfAttribute, DwarfForm, const char *, uint64));
   MOCK_METHOD3(ProcessAttributeString,
                void(DwarfAttribute, DwarfForm, const string &));
   MOCK_METHOD3(ProcessAttributeSignature,
                void(DwarfAttribute, DwarfForm, uint64));
   MOCK_METHOD0(EndAttributes, bool());
-  MOCK_METHOD3(FindChildHandler, DIEHandler *(uint64, DwarfTag,
-                                              const AttributeList &));
+  MOCK_METHOD2(FindChildHandler, DIEHandler *(uint64, DwarfTag));
   MOCK_METHOD0(Finish, void());
   MOCK_METHOD5(StartCompilationUnit, bool(uint64, uint8, uint8, uint64, uint8));
-  MOCK_METHOD3(StartRootDIE, bool(uint64, DwarfTag, const AttributeList &));
+  MOCK_METHOD2(StartRootDIE, bool(uint64, DwarfTag));
 };
 
 // If the handler elects to skip the compilation unit, the dispatcher
 // should tell the reader so.
 TEST(Dwarf2DIEHandler, SkipCompilationUnit) {
   Sequence s;
   MockRootDIEHandler mock_root_handler;
   DIEDispatcher die_dispatcher(&mock_root_handler);
@@ -124,107 +121,92 @@ TEST(Dwarf2DIEHandler, SkipCompilationUn
 
 // If the handler elects to skip the root DIE, the dispatcher should
 // tell the reader so.
 TEST(Dwarf2DIEHandler, SkipRootDIE) {
   Sequence s;
   MockRootDIEHandler mock_root_handler;
   DIEDispatcher die_dispatcher(&mock_root_handler);
 
-  AttributeList mock_attribute_list;
-  mock_attribute_list.push_back(make_pair(dwarf2reader::DW_AT_name,
-                                          dwarf2reader::DW_FORM_string));
-
   EXPECT_CALL(mock_root_handler,
               StartCompilationUnit(0xde8994029fc8b999LL, 0xf4, 0x02,
                                    0xb00febffa76e2b2bLL, 0x5c))
       .InSequence(s)
       .WillOnce(Return(true));
   EXPECT_CALL(mock_root_handler,
-              StartRootDIE(0x7d08242b4b510cf2LL, (DwarfTag) 0xb4f98da6,
-                           ContainerEq(mock_attribute_list)))
+              StartRootDIE(0x7d08242b4b510cf2LL, (DwarfTag) 0xb4f98da6))
       .InSequence(s)
       .WillOnce(Return(false));
 
   EXPECT_TRUE(die_dispatcher.StartCompilationUnit(0xde8994029fc8b999LL, 
                                                   0xf4, 0x02,
                                                   0xb00febffa76e2b2bLL, 0x5c));
   EXPECT_FALSE(die_dispatcher.StartDIE(0x7d08242b4b510cf2LL,
-                                       (DwarfTag) 0xb4f98da6,
-                                       mock_attribute_list));
+                                       (DwarfTag) 0xb4f98da6));
   die_dispatcher.EndDIE(0x7d08242b4b510cf2LL);
 }
 
 // If the handler elects to skip the root DIE's children, the
 // dispatcher should tell the reader so --- and avoid deleting the
 // root handler.
 TEST(Dwarf2DIEHandler, SkipRootDIEChildren) {
   MockRootDIEHandler mock_root_handler;
   DIEDispatcher die_dispatcher(&mock_root_handler);
 
-  AttributeList mock_attribute_list;
-
   {
     InSequence s;
 
     EXPECT_CALL(mock_root_handler,
                 StartCompilationUnit(0x15d6897480cc65a7LL, 0x26, 0xa0,
                                      0x09f8bf0767f91675LL, 0xdb))
       .WillOnce(Return(true));
     EXPECT_CALL(mock_root_handler,
-                StartRootDIE(0x7d08242b4b510cf2LL, (DwarfTag) 0xb4f98da6,
-                             ContainerEq(mock_attribute_list)))
+                StartRootDIE(0x7d08242b4b510cf2LL, (DwarfTag) 0xb4f98da6))
       .WillOnce(Return(true));
     // Please don't tell me about my children.
     EXPECT_CALL(mock_root_handler, EndAttributes())
       .WillOnce(Return(false));
     EXPECT_CALL(mock_root_handler, Finish())
       .WillOnce(Return());
   }
 
   EXPECT_TRUE(die_dispatcher.StartCompilationUnit(0x15d6897480cc65a7LL,
                                                   0x26, 0xa0,
                                                   0x09f8bf0767f91675LL, 0xdb));
   EXPECT_TRUE(die_dispatcher.StartDIE(0x7d08242b4b510cf2LL,
-                                      (DwarfTag) 0xb4f98da6,
-                                      mock_attribute_list));
+                                      (DwarfTag) 0xb4f98da6));
   EXPECT_FALSE(die_dispatcher.StartDIE(0x435150ceedccda18LL,
-                                       (DwarfTag) 0xc3a17bba,
-                                       mock_attribute_list));
+                                       (DwarfTag) 0xc3a17bba));
   die_dispatcher.EndDIE(0x435150ceedccda18LL);
   die_dispatcher.EndDIE(0x7d08242b4b510cf2LL);
 }
 
 // The dispatcher should pass attribute values through to the die
 // handler accurately.
 TEST(Dwarf2DIEHandler, PassAttributeValues) {
   MockRootDIEHandler mock_root_handler;
   DIEDispatcher die_dispatcher(&mock_root_handler);
 
-  AttributeList mock_attribute_list;
-  mock_attribute_list.push_back(make_pair(dwarf2reader::DW_AT_name,
-                                          dwarf2reader::DW_FORM_string));
   const char buffer[10] = { 0x24, 0x24, 0x35, 0x9a, 0xca,
                             0xcf, 0xa8, 0x84, 0xa7, 0x18 };
   string str = "\xc8\x26\x2e\x0d\xa4\x9c\x37\xd6\xfb\x1d";
 
   // Set expectations.
   {
     InSequence s;
 
     // We'll like the compilation unit header.
     EXPECT_CALL(mock_root_handler,
                 StartCompilationUnit(0x8d42aed77cfccf3eLL, 0x89, 0xdc,
                                      0x2ecb4dc778a80f21LL, 0x66))
       .WillOnce(Return(true));
 
     // We'll like the root DIE.
     EXPECT_CALL(mock_root_handler,
-                StartRootDIE(0xe2222da01e29f2a9LL, (DwarfTag) 0x9829445c,
-                             ContainerEq(mock_attribute_list)))
+                StartRootDIE(0xe2222da01e29f2a9LL, (DwarfTag) 0x9829445c))
       .WillOnce(Return(true));
 
     // Expect some attribute values.
     EXPECT_CALL(mock_root_handler,
                 ProcessAttributeUnsigned((DwarfAttribute) 0x1cc0bfed,
                                          (DwarfForm) 0x424f1468,
                                          0xa592571997facda1ULL))
       .WillOnce(Return());
@@ -250,33 +232,32 @@ TEST(Dwarf2DIEHandler, PassAttributeValu
       .WillOnce(Return());
     EXPECT_CALL(mock_root_handler,
                 ProcessAttributeSignature((DwarfAttribute) 0x58790d72,
                                           (DwarfForm) 0x4159f138,
                                           0x94682463613e6a5fULL))
       .WillOnce(Return());
     EXPECT_CALL(mock_root_handler, EndAttributes())
       .WillOnce(Return(true));
-    EXPECT_CALL(mock_root_handler, FindChildHandler(_, _, _))
+    EXPECT_CALL(mock_root_handler, FindChildHandler(_, _))
       .Times(0);
     EXPECT_CALL(mock_root_handler, Finish())
       .WillOnce(Return());
   }
 
   // Drive the dispatcher.
 
   // Report the CU header.
   EXPECT_TRUE(die_dispatcher.StartCompilationUnit(0x8d42aed77cfccf3eLL,
                                                   0x89, 0xdc,
                                                   0x2ecb4dc778a80f21LL,
                                                   0x66));
   // Report the root DIE.
   EXPECT_TRUE(die_dispatcher.StartDIE(0xe2222da01e29f2a9LL,
-                                      (DwarfTag) 0x9829445c,
-                                      mock_attribute_list));
+                                      (DwarfTag) 0x9829445c));
 
   // Report some attribute values.
   die_dispatcher.ProcessAttributeUnsigned(0xe2222da01e29f2a9LL,
                                           (DwarfAttribute) 0x1cc0bfed,
                                           (DwarfForm) 0x424f1468,
                                           0xa592571997facda1ULL);
   die_dispatcher.ProcessAttributeSigned(0xe2222da01e29f2a9LL,
                                         (DwarfAttribute) 0x43694dc9,
@@ -304,63 +285,42 @@ TEST(Dwarf2DIEHandler, PassAttributeValu
 }
 
 TEST(Dwarf2DIEHandler, FindAndSkipChildren) {
   MockRootDIEHandler mock_root_handler;
   MockDIEHandler *mock_child1_handler = new(MockDIEHandler);
   MockDIEHandler *mock_child3_handler = new(MockDIEHandler);
   DIEDispatcher die_dispatcher(&mock_root_handler);
 
-  AttributeList root_attribute_list;
-  root_attribute_list.push_back(make_pair((DwarfAttribute) 0xb01185df,
-                                          (DwarfForm) 0xbc97cee8));
-  AttributeList child1_attribute_list;
-  child1_attribute_list.push_back(make_pair((DwarfAttribute) 0x41014e43,
-                                            (DwarfForm) 0x63155f4c));
-  AttributeList grandchild1_attribute_list;
-  grandchild1_attribute_list.push_back(make_pair((DwarfAttribute) 0xf72f823c,
-                                                 (DwarfForm) 0x0ff6a201));
-  AttributeList greatgrandchild1_attribute_list;
-  greatgrandchild1_attribute_list
-    .push_back(make_pair((DwarfAttribute) 0xbe66e5f0, (DwarfForm) 0xb4b24ff7));
-  AttributeList child2_attribute_list;
-  child1_attribute_list.push_back(make_pair((DwarfAttribute) 0xf22df14c,
-                                            (DwarfForm) 0x20676e7d));
-  AttributeList child3_attribute_list;
-  child3_attribute_list.push_back(make_pair((DwarfAttribute) 0xe8bf1201,
-                                            (DwarfForm) 0x53a5b7a8));
-
   {
     InSequence s;
 
     // We'll like the compilation unit header.
     EXPECT_CALL(mock_root_handler,
                 StartCompilationUnit(0x9ec1e6d05e434a0eLL, 0xeb, 0x21,
                                      0x47dd3c764275a216LL, 0xa5))
       .WillOnce(Return(true));
 
     // Root DIE.
     {
       EXPECT_CALL(mock_root_handler,
-                  StartRootDIE(0x15f0e06bdfe3c372LL, (DwarfTag) 0xf5d60c59,
-                               ContainerEq(root_attribute_list)))
+                  StartRootDIE(0x15f0e06bdfe3c372LL, (DwarfTag) 0xf5d60c59))
         .WillOnce(Return(true));
       EXPECT_CALL(mock_root_handler,
                   ProcessAttributeSigned((DwarfAttribute) 0xf779a642,
                                          (DwarfForm) 0x2cb63027,
                                          0x18e744661769d08fLL))
         .WillOnce(Return());
       EXPECT_CALL(mock_root_handler, EndAttributes())
         .WillOnce(Return(true));
 
       // First child DIE.
       EXPECT_CALL(mock_root_handler,
                   FindChildHandler(0x149f644f8116fe8cLL,
-                                   (DwarfTag) 0xac2cbd8c,
-                                   ContainerEq(child1_attribute_list)))
+                                   (DwarfTag) 0xac2cbd8c))
         .WillOnce(Return(mock_child1_handler));
       {
         EXPECT_CALL(*mock_child1_handler,
                     ProcessAttributeSigned((DwarfAttribute) 0xa6fd6f65,
                                            (DwarfForm) 0xe4f64c41,
                                            0x1b04e5444a55fe67LL))
           .WillOnce(Return());
         EXPECT_CALL(*mock_child1_handler, EndAttributes())
@@ -369,25 +329,23 @@ TEST(Dwarf2DIEHandler, FindAndSkipChildr
         EXPECT_CALL(*mock_child1_handler, Finish())
           .WillOnce(Return());
       }
 
       // Second child DIE.  Root handler will decline to return a handler
       // for this child.
       EXPECT_CALL(mock_root_handler,
                   FindChildHandler(0x97412be24875de9dLL,
-                                   (DwarfTag) 0x505a068b,
-                                   ContainerEq(child2_attribute_list)))
+                                   (DwarfTag) 0x505a068b))
         .WillOnce(Return((DIEHandler *) NULL));
 
       // Third child DIE.
       EXPECT_CALL(mock_root_handler,
                   FindChildHandler(0x753c964c8ab538aeLL,
-                                   (DwarfTag) 0x8c22970e,
-                                   ContainerEq(child3_attribute_list)))
+                                   (DwarfTag) 0x8c22970e))
         .WillOnce(Return(mock_child3_handler));
       {
         EXPECT_CALL(*mock_child3_handler,
                     ProcessAttributeSigned((DwarfAttribute) 0x4e2b7cfb,
                                            (DwarfForm) 0x610b7ae1,
                                            0x3ea5c609d7d7560fLL))
           .WillOnce(Return());
         EXPECT_CALL(*mock_child3_handler, EndAttributes())
@@ -406,65 +364,59 @@ TEST(Dwarf2DIEHandler, FindAndSkipChildr
 
   // Report the CU header.
   EXPECT_TRUE(die_dispatcher
               .StartCompilationUnit(0x9ec1e6d05e434a0eLL, 0xeb, 0x21,
                                     0x47dd3c764275a216LL, 0xa5));
   // Report the root DIE.
   {
     EXPECT_TRUE(die_dispatcher.StartDIE(0x15f0e06bdfe3c372LL,
-                                        (DwarfTag) 0xf5d60c59,
-                                        root_attribute_list));
+                                        (DwarfTag) 0xf5d60c59));
     die_dispatcher.ProcessAttributeSigned(0x15f0e06bdfe3c372LL,
                                           (DwarfAttribute) 0xf779a642,
                                           (DwarfForm) 0x2cb63027,
                                           0x18e744661769d08fLL);
 
     // First child DIE.
     {
       EXPECT_TRUE(die_dispatcher.StartDIE(0x149f644f8116fe8cLL,
-                                          (DwarfTag) 0xac2cbd8c,
-                                          child1_attribute_list));
+                                          (DwarfTag) 0xac2cbd8c));
       die_dispatcher.ProcessAttributeSigned(0x149f644f8116fe8cLL,
                                             (DwarfAttribute) 0xa6fd6f65,
                                             (DwarfForm) 0xe4f64c41,
                                             0x1b04e5444a55fe67LL);
 
       // First grandchild DIE.  Will be skipped.
       {
         EXPECT_FALSE(die_dispatcher.StartDIE(0xd68de1ee0bd29419LL,
-                                            (DwarfTag) 0x22f05a15,
-                                            grandchild1_attribute_list));
+                                            (DwarfTag) 0x22f05a15));
         // First great-grandchild DIE.  Will be skipped without being
         // mentioned to any handler.
         {
           EXPECT_FALSE(die_dispatcher
                        .StartDIE(0xb3076285d25cac25LL,
-                                 (DwarfTag) 0xcff4061b,
-                                 greatgrandchild1_attribute_list));
+                                 (DwarfTag) 0xcff4061b));
           die_dispatcher.EndDIE(0xb3076285d25cac25LL);          
         }
         die_dispatcher.EndDIE(0xd68de1ee0bd29419LL);
       }
       die_dispatcher.EndDIE(0x149f644f8116fe8cLL);
     }
 
     // Second child DIE.  Root handler will decline to find a handler for it.
     {
       EXPECT_FALSE(die_dispatcher.StartDIE(0x97412be24875de9dLL,
-                                           (DwarfTag) 0x505a068b,
-                                           child2_attribute_list));
+                                           (DwarfTag) 0x505a068b));
       die_dispatcher.EndDIE(0x97412be24875de9dLL);
     }
     
     // Third child DIE.
     {
       EXPECT_TRUE(die_dispatcher.StartDIE(0x753c964c8ab538aeLL,
-                                          (DwarfTag) 0x8c22970e,
-                                          child3_attribute_list));
+                                          (DwarfTag) 0x8c22970e));
       die_dispatcher.ProcessAttributeSigned(0x753c964c8ab538aeLL,
                                             (DwarfAttribute) 0x4e2b7cfb,
                                             (DwarfForm) 0x610b7ae1,
                                             0x3ea5c609d7d7560fLL);
       die_dispatcher.EndDIE(0x753c964c8ab538aeLL);
     }
     
     // Finish the root DIE (and thus the CU).
@@ -473,51 +425,47 @@ TEST(Dwarf2DIEHandler, FindAndSkipChildr
 }
 
 // The DIEDispatcher destructor is supposed to delete all handlers on
 // the stack, except for the root.
 TEST(Dwarf2DIEHandler, FreeHandlersOnStack) {
   MockRootDIEHandler mock_root_handler;
   MockDIEHandler *mock_child_handler = new(MockDIEHandler);
   MockDIEHandler *mock_grandchild_handler = new(MockDIEHandler);
-  AttributeList empty_attribute_list;
 
   {
     InSequence s;
 
     // We'll like the compilation unit header.
     EXPECT_CALL(mock_root_handler,
                 StartCompilationUnit(0x87b41ba8381cd71cLL, 0xff, 0x89,
                                      0x76d392ff393ddda2LL, 0xbf))
       .WillOnce(Return(true));
 
     // Root DIE.
     {
       EXPECT_CALL(mock_root_handler,
-                  StartRootDIE(0xbf13b761691ddc91LL, (DwarfTag) 0x98980361,
-                               ContainerEq(empty_attribute_list)))
+                  StartRootDIE(0xbf13b761691ddc91LL, (DwarfTag) 0x98980361))
         .WillOnce(Return(true));
       EXPECT_CALL(mock_root_handler, EndAttributes())
         .WillOnce(Return(true));
       
       // Child DIE.
       EXPECT_CALL(mock_root_handler,
                   FindChildHandler(0x058f09240c5fc8c9LL,
-                                   (DwarfTag) 0x898bf0d0,
-                                   ContainerEq(empty_attribute_list)))
+                                   (DwarfTag) 0x898bf0d0))
         .WillOnce(Return(mock_child_handler));
       {
         EXPECT_CALL(*mock_child_handler, EndAttributes())
           .WillOnce(Return(true));
 
         // Grandchild DIE.
         EXPECT_CALL(*mock_child_handler,
                     FindChildHandler(0x32dc00c9945dc0c8LL,
-                                     (DwarfTag) 0x2802d007,
-                                     ContainerEq(empty_attribute_list)))
+                                     (DwarfTag) 0x2802d007))
           .WillOnce(Return(mock_grandchild_handler));
         {
           EXPECT_CALL(*mock_grandchild_handler,
                       ProcessAttributeSigned((DwarfAttribute) 0x4e2b7cfb,
                                              (DwarfForm) 0x610b7ae1,
                                              0x3ea5c609d7d7560fLL))
             .WillOnce(Return());
 
@@ -543,30 +491,27 @@ TEST(Dwarf2DIEHandler, FreeHandlersOnSta
   
   // Report the CU header.
   EXPECT_TRUE(die_dispatcher
               .StartCompilationUnit(0x87b41ba8381cd71cLL, 0xff, 0x89,
                                     0x76d392ff393ddda2LL, 0xbf));
   // Report the root DIE.
   {
     EXPECT_TRUE(die_dispatcher.StartDIE(0xbf13b761691ddc91LL,
-                                        (DwarfTag) 0x98980361,
-                                        empty_attribute_list));
+                                        (DwarfTag) 0x98980361));
 
     // Child DIE.
     {
       EXPECT_TRUE(die_dispatcher.StartDIE(0x058f09240c5fc8c9LL,
-                                          (DwarfTag) 0x898bf0d0,
-                                          empty_attribute_list));
+                                          (DwarfTag) 0x898bf0d0));
 
       // Grandchild DIE.
       {
         EXPECT_TRUE(die_dispatcher.StartDIE(0x32dc00c9945dc0c8LL,
-                                            (DwarfTag) 0x2802d007,
-                                            empty_attribute_list));
+                                            (DwarfTag) 0x2802d007));
         die_dispatcher.ProcessAttributeSigned(0x32dc00c9945dc0c8LL,
                                               (DwarfAttribute) 0x4e2b7cfb,
                                               (DwarfForm) 0x610b7ae1,
                                               0x3ea5c609d7d7560fLL);
 
         // Stop the traversal abruptly, so that there will still be
         // handlers on the stack when the dispatcher is destructed.
 
--- a/toolkit/crashreporter/google-breakpad/src/common/dwarf/dwarf2reader.cc
+++ b/toolkit/crashreporter/google-breakpad/src/common/dwarf/dwarf2reader.cc
@@ -495,17 +495,17 @@ void CompilationUnit::ProcessDIEs() {
       const uint64 offset = die_stack.top();
       die_stack.pop();
       handler_->EndDIE(offset);
       continue;
     }
 
     const Abbrev& abbrev = abbrevs_->at(static_cast<size_t>(abbrev_num));
     const enum DwarfTag tag = abbrev.tag;
-    if (!handler_->StartDIE(absolute_offset, tag, abbrev.attributes)) {
+    if (!handler_->StartDIE(absolute_offset, tag)) {
       dieptr = SkipDIE(dieptr, abbrev);
     } else {
       dieptr = ProcessDIE(absolute_offset, dieptr, abbrev);
     }
 
     if (abbrev.has_children) {
       die_stack.push(absolute_offset);
     } else {
--- a/toolkit/crashreporter/google-breakpad/src/common/dwarf/dwarf2reader.h
+++ b/toolkit/crashreporter/google-breakpad/src/common/dwarf/dwarf2reader.h
@@ -337,18 +337,17 @@ class Dwarf2Handler {
   // .debug_info section. Return false if you would like to skip this
   // compilation unit.
   virtual bool StartCompilationUnit(uint64 offset, uint8 address_size,
                                     uint8 offset_size, uint64 cu_length,
                                     uint8 dwarf_version) { return false; }
 
   // Start to process a DIE at OFFSET from the beginning of the .debug_info
   // section. Return false if you would like to skip this DIE.
-  virtual bool StartDIE(uint64 offset, enum DwarfTag tag,
-                        const AttributeList& attrs) { return false; }
+  virtual bool StartDIE(uint64 offset, enum DwarfTag tag) { return false; }
 
   // Called when we have an attribute with unsigned data to give to our
   // handler. The attribute is for the DIE at OFFSET from the beginning of the
   // .debug_info section. Its name is ATTR, its form is FORM, and its value is
   // DATA.
   virtual void ProcessAttributeUnsigned(uint64 offset,
                                         enum DwarfAttribute attr,
                                         enum DwarfForm form,
--- a/toolkit/crashreporter/google-breakpad/src/common/dwarf/dwarf2reader_die_unittest.cc
+++ b/toolkit/crashreporter/google-breakpad/src/common/dwarf/dwarf2reader_die_unittest.cc
@@ -45,17 +45,16 @@
 #include "google_breakpad/common/breakpad_types.h"
 
 using google_breakpad::test_assembler::Endianness;
 using google_breakpad::test_assembler::Label;
 using google_breakpad::test_assembler::Section;
 using google_breakpad::test_assembler::kBigEndian;
 using google_breakpad::test_assembler::kLittleEndian;
 
-using dwarf2reader::AttributeList;
 using dwarf2reader::ByteReader;
 using dwarf2reader::CompilationUnit;
 using dwarf2reader::Dwarf2Handler;
 using dwarf2reader::DwarfAttribute;
 using dwarf2reader::DwarfForm;
 using dwarf2reader::DwarfHasChild;
 using dwarf2reader::DwarfTag;
 using dwarf2reader::ENDIANNESS_BIG;
@@ -71,18 +70,17 @@ using testing::Test;
 using testing::TestWithParam;
 using testing::_;
 
 class MockDwarf2Handler: public Dwarf2Handler {
  public:
   MOCK_METHOD5(StartCompilationUnit, bool(uint64 offset, uint8 address_size,
                                           uint8 offset_size, uint64 cu_length,
                                           uint8 dwarf_version));
-  MOCK_METHOD3(StartDIE, bool(uint64 offset, enum DwarfTag tag,
-                              const AttributeList& attrs));
+  MOCK_METHOD2(StartDIE, bool(uint64 offset, enum DwarfTag tag));
   MOCK_METHOD4(ProcessAttributeUnsigned, void(uint64 offset,
                                               DwarfAttribute attr,
                                               enum DwarfForm form,
                                               uint64 data));
   MOCK_METHOD4(ProcessAttributeSigned, void(uint64 offset,
                                             enum DwarfAttribute attr,
                                             enum DwarfForm form,
                                             int64 data));
@@ -110,17 +108,17 @@ struct DIEFixture {
 
   DIEFixture() {
     // Fix the initial offset of the .debug_info and .debug_abbrev sections.
     info.start() = 0;
     abbrevs.start() = 0;
 
     // Default expectations for the data handler.
     EXPECT_CALL(handler, StartCompilationUnit(_, _, _, _, _)).Times(0);
-    EXPECT_CALL(handler, StartDIE(_, _, _)).Times(0);
+    EXPECT_CALL(handler, StartDIE(_, _)).Times(0);
     EXPECT_CALL(handler, ProcessAttributeUnsigned(_, _, _, _)).Times(0);
     EXPECT_CALL(handler, ProcessAttributeSigned(_, _, _, _)).Times(0);
     EXPECT_CALL(handler, ProcessAttributeReference(_, _, _, _)).Times(0);
     EXPECT_CALL(handler, ProcessAttributeBuffer(_, _, _, _, _)).Times(0);
     EXPECT_CALL(handler, ProcessAttributeString(_, _, _, _)).Times(0);
     EXPECT_CALL(handler, EndDIE(_)).Times(0);
   }
 
@@ -181,17 +179,17 @@ TEST_P(DwarfHeader, Header) {
 
   {
     InSequence s;
     EXPECT_CALL(handler,
                 StartCompilationUnit(0, GetParam().address_size,
                                      GetParam().format_size, _,
                                      GetParam().version))
         .WillOnce(Return(true));
-    EXPECT_CALL(handler, StartDIE(_, dwarf2reader::DW_TAG_compile_unit, _))
+    EXPECT_CALL(handler, StartDIE(_, dwarf2reader::DW_TAG_compile_unit))
         .WillOnce(Return(true));
     EXPECT_CALL(handler, ProcessAttributeString(_, dwarf2reader::DW_AT_name, 
                                                 dwarf2reader::DW_FORM_string,
                                                 "sam"))
         .WillOnce(Return());
     EXPECT_CALL(handler, EndDIE(_))
         .WillOnce(Return());
   }
@@ -257,17 +255,17 @@ struct DwarfFormsFixture: public DIEFixt
   void ExpectBeginCompilationUnit(const DwarfHeaderParams &params,
                                   DwarfTag tag, uint64 offset=0) {
     EXPECT_CALL(handler,
                 StartCompilationUnit(offset, params.address_size,
                                      params.format_size, _,
                                      params.version))
         .InSequence(s)
         .WillOnce(Return(true));
-    EXPECT_CALL(handler, StartDIE(_, tag, _))
+    EXPECT_CALL(handler, StartDIE(_, tag))
         .InSequence(s)
         .WillOnce(Return(true));
   }
 
   void ExpectEndCompilationUnit() {
     EXPECT_CALL(handler, EndDIE(_))
         .InSequence(s)
         .WillOnce(Return());
--- a/toolkit/crashreporter/google-breakpad/src/common/dwarf/functioninfo.cc
+++ b/toolkit/crashreporter/google-breakpad/src/common/dwarf/functioninfo.cc
@@ -116,18 +116,17 @@ bool CUFunctionInfoHandler::StartCompila
   return true;
 }
 
 
 // For function info, we only care about subprograms and inlined
 // subroutines. For line info, the DW_AT_stmt_list lives in the
 // compile unit tag.
 
-bool CUFunctionInfoHandler::StartDIE(uint64 offset, enum DwarfTag tag,
-                                     const AttributeList& attrs) {
+bool CUFunctionInfoHandler::StartDIE(uint64 offset, enum DwarfTag tag) {
   switch (tag) {
     case DW_TAG_subprogram:
     case DW_TAG_inlined_subroutine: {
       current_function_info_ = new FunctionInfo;
       current_function_info_->lowpc = current_function_info_->highpc = 0;
       current_function_info_->name = "";
       current_function_info_->line = 0;
       current_function_info_->file = "";
--- a/toolkit/crashreporter/google-breakpad/src/common/dwarf/functioninfo.h
+++ b/toolkit/crashreporter/google-breakpad/src/common/dwarf/functioninfo.h
@@ -130,18 +130,17 @@ class CUFunctionInfoHandler: public Dwar
   // always return true.
 
   virtual bool StartCompilationUnit(uint64 offset, uint8 address_size,
                                     uint8 offset_size, uint64 cu_length,
                                     uint8 dwarf_version);
 
   // Start to process a DIE at OFFSET from the beginning of the
   // .debug_info section.  We only care about function related DIE's.
-  virtual bool StartDIE(uint64 offset, enum DwarfTag tag,
-                        const AttributeList& attrs);
+  virtual bool StartDIE(uint64 offset, enum DwarfTag tag);
 
   // Called when we have an attribute with unsigned data to give to
   // our handler.  The attribute is for the DIE at OFFSET from the
   // beginning of the .debug_info section, has a name of ATTR, a form of
   // FORM, and the actual data of the attribute is in DATA.
   virtual void ProcessAttributeUnsigned(uint64 offset,
                                         enum DwarfAttribute attr,
                                         enum DwarfForm form,
--- a/toolkit/crashreporter/google-breakpad/src/common/dwarf_cu_to_module.cc
+++ b/toolkit/crashreporter/google-breakpad/src/common/dwarf_cu_to_module.cc
@@ -380,17 +380,18 @@ string DwarfCUToModule::GenericDIEHandle
 }
 
 // A handler class for DW_TAG_subprogram DIEs.
 class DwarfCUToModule::FuncHandler: public GenericDIEHandler {
  public:
   FuncHandler(CUContext *cu_context, DIEContext *parent_context,
               uint64 offset)
       : GenericDIEHandler(cu_context, parent_context, offset),
-        low_pc_(0), high_pc_(0), abstract_origin_(NULL), inline_(false) { }
+        low_pc_(0), high_pc_(0), high_pc_form_(dwarf2reader::DW_FORM_addr),
+        abstract_origin_(NULL), inline_(false) { }
   void ProcessAttributeUnsigned(enum DwarfAttribute attr,
                                 enum DwarfForm form,
                                 uint64 data);
   void ProcessAttributeSigned(enum DwarfAttribute attr,
                               enum DwarfForm form,
                               int64 data);
   void ProcessAttributeReference(enum DwarfAttribute attr,
                                  enum DwarfForm form,
@@ -399,32 +400,37 @@ class DwarfCUToModule::FuncHandler: publ
   bool EndAttributes();
   void Finish();
 
  private:
   // The fully-qualified name, as derived from name_attribute_,
   // specification_, parent_context_.  Computed in EndAttributes.
   string name_;
   uint64 low_pc_, high_pc_; // DW_AT_low_pc, DW_AT_high_pc
+  DwarfForm high_pc_form_; // DW_AT_high_pc can be length or address.
   const AbstractOrigin* abstract_origin_;
   bool inline_;
 };
 
 void DwarfCUToModule::FuncHandler::ProcessAttributeUnsigned(
     enum DwarfAttribute attr,
     enum DwarfForm form,
     uint64 data) {
   switch (attr) {
     // If this attribute is present at all --- even if its value is
     // DW_INL_not_inlined --- then GCC may cite it as someone else's
     // DW_AT_abstract_origin attribute.
     case dwarf2reader::DW_AT_inline:      inline_  = true; break;
 
     case dwarf2reader::DW_AT_low_pc:      low_pc_  = data; break;
-    case dwarf2reader::DW_AT_high_pc:     high_pc_ = data; break;
+    case dwarf2reader::DW_AT_high_pc:
+      high_pc_form_ = form;
+      high_pc_ = data;
+      break;
+
     default:
       GenericDIEHandler::ProcessAttributeUnsigned(attr, form, data);
       break;
   }
 }
 
 void DwarfCUToModule::FuncHandler::ProcessAttributeSigned(
     enum DwarfAttribute attr,
@@ -468,16 +474,21 @@ bool DwarfCUToModule::FuncHandler::EndAt
   name_ = ComputeQualifiedName();
   if (name_.empty() && abstract_origin_) {
     name_ = abstract_origin_->name;
   }
   return true;
 }
 
 void DwarfCUToModule::FuncHandler::Finish() {
+  // Make high_pc_ an address, if it isn't already.
+  if (high_pc_form_ != dwarf2reader::DW_FORM_addr) {
+    high_pc_ += low_pc_;
+  }
+
   // Did we collect the information we need?  Not all DWARF function
   // entries have low and high addresses (for example, inlined
   // functions that were never used), but all the ones we're
   // interested in cover a non-empty range of bytes.
   if (low_pc_ < high_pc_) {
     // Create a Module::Function based on the data we've gathered, and
     // add it to the functions_ list.
     Module::Function *func = new Module::Function;
@@ -506,32 +517,30 @@ void DwarfCUToModule::FuncHandler::Finis
 // A handler for DIEs that contain functions and contribute a
 // component to their names: namespaces, classes, etc.
 class DwarfCUToModule::NamedScopeHandler: public GenericDIEHandler {
  public:
   NamedScopeHandler(CUContext *cu_context, DIEContext *parent_context,
                     uint64 offset)
       : GenericDIEHandler(cu_context, parent_context, offset) { }
   bool EndAttributes();
-  DIEHandler *FindChildHandler(uint64 offset, enum DwarfTag tag,
-                               const AttributeList &attrs);
+  DIEHandler *FindChildHandler(uint64 offset, enum DwarfTag tag);
 
  private:
   DIEContext child_context_; // A context for our children.
 };
 
 bool DwarfCUToModule::NamedScopeHandler::EndAttributes() {
   child_context_.name = ComputeQualifiedName();
   return true;
 }
 
 dwarf2reader::DIEHandler *DwarfCUToModule::NamedScopeHandler::FindChildHandler(
     uint64 offset,
-    enum DwarfTag tag,
-    const AttributeList &/*attrs*/) {
+    enum DwarfTag tag) {
   switch (tag) {
     case dwarf2reader::DW_TAG_subprogram:
       return new FuncHandler(cu_context_, &child_context_, offset);
     case dwarf2reader::DW_TAG_namespace:
     case dwarf2reader::DW_TAG_class_type:
     case dwarf2reader::DW_TAG_structure_type:
     case dwarf2reader::DW_TAG_union_type:
       return new NamedScopeHandler(cu_context_, &child_context_, offset);
@@ -609,17 +618,17 @@ void DwarfCUToModule::WarningReporter::U
 
 void DwarfCUToModule::WarningReporter::UnnamedFunction(uint64 offset) {
   CUHeading();
   fprintf(stderr, "%s: warning: function at offset 0x%llx has no name\n",
           filename_.c_str(), offset);
 }
 
 DwarfCUToModule::DwarfCUToModule(FileContext *file_context,
-                                 LineToModuleFunctor *line_reader,
+                                 LineToModuleHandler *line_reader,
                                  WarningReporter *reporter)
     : line_reader_(line_reader), has_source_line_info_(false) { 
   cu_context_ = new CUContext(file_context, reporter);
   child_context_ = new DIEContext();
 }
 
 DwarfCUToModule::~DwarfCUToModule() {
   delete cu_context_;
@@ -652,28 +661,35 @@ void DwarfCUToModule::ProcessAttributeUn
     default:
       break;
   }
 }
 
 void DwarfCUToModule::ProcessAttributeString(enum DwarfAttribute attr,
                                              enum DwarfForm form,
                                              const string &data) {
-  if (attr == dwarf2reader::DW_AT_name)
-    cu_context_->reporter->SetCUName(data);
+  switch (attr) {
+    case dwarf2reader::DW_AT_name:
+      cu_context_->reporter->SetCUName(data);
+      break;
+    case dwarf2reader::DW_AT_comp_dir:
+      line_reader_->StartCompilationUnit(data);
+      break;
+    default:
+      break;
+  }
 }
 
 bool DwarfCUToModule::EndAttributes() {
   return true;
 }
 
 dwarf2reader::DIEHandler *DwarfCUToModule::FindChildHandler(
     uint64 offset,
-    enum DwarfTag tag,
-    const AttributeList &/*attrs*/) {
+    enum DwarfTag tag) {
   switch (tag) {
     case dwarf2reader::DW_TAG_subprogram:
       return new FuncHandler(cu_context_, child_context_, offset);
     case dwarf2reader::DW_TAG_namespace:
     case dwarf2reader::DW_TAG_class_type:
     case dwarf2reader::DW_TAG_structure_type:
     case dwarf2reader::DW_TAG_union_type:
       return new NamedScopeHandler(cu_context_, child_context_, offset);
@@ -731,18 +747,18 @@ void DwarfCUToModule::ReadSourceLines(ui
     return;
   }
   const char *section_start = map_entry->second.first;
   uint64 section_length = map_entry->second.second;
   if (offset >= section_length) {
     cu_context_->reporter->BadLineInfoOffset(offset);
     return;
   }
-  (*line_reader_)(section_start + offset, section_length - offset,
-                  cu_context_->file_context->module, &lines_);
+  line_reader_->ReadProgram(section_start + offset, section_length - offset,
+                            cu_context_->file_context->module, &lines_);
 }
 
 namespace {
 // Return true if ADDRESS falls within the range of ITEM.
 template <class T>
 inline bool within(const T &item, Module::Address address) {
   // Because Module::Address is unsigned, and unsigned arithmetic
   // wraps around, this will be false if ADDRESS falls before the
@@ -973,16 +989,15 @@ void DwarfCUToModule::Finish() {
 bool DwarfCUToModule::StartCompilationUnit(uint64 offset,
                                            uint8 address_size,
                                            uint8 offset_size,
                                            uint64 cu_length,
                                            uint8 dwarf_version) {
   return dwarf_version >= 2;
 }
 
-bool DwarfCUToModule::StartRootDIE(uint64 offset, enum DwarfTag tag,
-                                   const AttributeList& /*attrs*/) {
+bool DwarfCUToModule::StartRootDIE(uint64 offset, enum DwarfTag tag) {
   // We don't deal with partial compilation units (the only other tag
   // likely to be used for root DIE).
   return tag == dwarf2reader::DW_TAG_compile_unit;
 }
 
 } // namespace google_breakpad
--- a/toolkit/crashreporter/google-breakpad/src/common/dwarf_cu_to_module.h
+++ b/toolkit/crashreporter/google-breakpad/src/common/dwarf_cu_to_module.h
@@ -45,17 +45,16 @@
 #include "common/module.h"
 #include "common/dwarf/bytereader.h"
 #include "common/dwarf/dwarf2diehandler.h"
 #include "common/dwarf/dwarf2reader.h"
 #include "common/using_std_string.h"
 
 namespace google_breakpad {
 
-using dwarf2reader::AttributeList;
 using dwarf2reader::DwarfAttribute;
 using dwarf2reader::DwarfForm;
 using dwarf2reader::DwarfLanguage;
 using dwarf2reader::DwarfTag;
 
 // Populate a google_breakpad::Module with DWARF debugging information.
 //
 // An instance of this class can be provided as a handler to a
@@ -88,31 +87,37 @@ class DwarfCUToModule: public dwarf2read
 
     // The Module to which we're contributing definitions.
     Module *module;
 
     // Inter-compilation unit data used internally by the handlers.
     FilePrivate *file_private;
   };
 
-  // An abstract base class for functors that handle DWARF line data
+  // An abstract base class for handlers that handle DWARF line data
   // for DwarfCUToModule. DwarfCUToModule could certainly just use
   // dwarf2reader::LineInfo itself directly, but decoupling things
   // this way makes unit testing a little easier.
-  class LineToModuleFunctor {
+  class LineToModuleHandler {
    public:
-    LineToModuleFunctor() { }
-    virtual ~LineToModuleFunctor() { }
+    LineToModuleHandler() { }
+    virtual ~LineToModuleHandler() { }
+
+    // Called at the beginning of a new compilation unit, prior to calling
+    // ReadProgram(). compilation_dir will indicate the path that the
+    // current compilation unit was compiled in, consistent with the
+    // DW_AT_comp_dir DIE.
+    virtual void StartCompilationUnit(const string& compilation_dir) = 0;
 
     // Populate MODULE and LINES with source file names and code/line
     // mappings, given a pointer to some DWARF line number data
     // PROGRAM, and an overestimate of its size. Add no zero-length
     // lines to LINES.
-    virtual void operator()(const char *program, uint64 length,
-                            Module *module, vector<Module::Line> *lines) = 0;
+    virtual void ReadProgram(const char *program, uint64 length,
+                             Module *module, vector<Module::Line> *lines) = 0;
   };
 
   // The interface DwarfCUToModule uses to report warnings. The member
   // function definitions for this class write messages to stderr, but
   // you can override them if you'd like to detect or report these
   // conditions yourself.
   class WarningReporter {
    public:
@@ -182,42 +187,40 @@ class DwarfCUToModule: public dwarf2read
 
   // Create a DWARF debugging info handler for a compilation unit
   // within FILE_CONTEXT. This uses information received from the
   // dwarf2reader::CompilationUnit DWARF parser to populate
   // FILE_CONTEXT->module. Use LINE_READER to handle the compilation
   // unit's line number data. Use REPORTER to report problems with the
   // data we find.
   DwarfCUToModule(FileContext *file_context,
-                  LineToModuleFunctor *line_reader,
+                  LineToModuleHandler *line_reader,
                   WarningReporter *reporter);
   ~DwarfCUToModule();
 
   void ProcessAttributeSigned(enum DwarfAttribute attr,
                               enum DwarfForm form,
                               int64 data);
   void ProcessAttributeUnsigned(enum DwarfAttribute attr,
                                 enum DwarfForm form,
                                 uint64 data);
   void ProcessAttributeString(enum DwarfAttribute attr,
                               enum DwarfForm form,
                               const string &data);
   bool EndAttributes();
-  DIEHandler *FindChildHandler(uint64 offset, enum DwarfTag tag,
-                               const AttributeList &attrs);
+  DIEHandler *FindChildHandler(uint64 offset, enum DwarfTag tag);
 
   // Assign all our source Lines to the Functions that cover their
   // addresses, and then add them to module_.
   void Finish();
 
   bool StartCompilationUnit(uint64 offset, uint8 address_size,
                             uint8 offset_size, uint64 cu_length,
                             uint8 dwarf_version);
-  bool StartRootDIE(uint64 offset, enum DwarfTag tag,
-                    const AttributeList& attrs);
+  bool StartRootDIE(uint64 offset, enum DwarfTag tag);
 
  private:
 
   // Used internally by the handler. Full definitions are in
   // dwarf_cu_to_module.cc.
   struct FilePrivate;
   struct Specification;
   struct CUContext;
@@ -245,18 +248,18 @@ class DwarfCUToModule: public dwarf2read
   void AssignLinesToFunctions();
 
   // The only reason cu_context_ and child_context_ are pointers is
   // that we want to keep their definitions private to
   // dwarf_cu_to_module.cc, instead of listing them all here. They are
   // owned by this DwarfCUToModule: the constructor sets them, and the
   // destructor deletes them.
 
-  // The functor to use to handle line number data.
-  LineToModuleFunctor *line_reader_;
+  // The handler to use to handle line number data.
+  LineToModuleHandler *line_reader_;
 
   // This compilation unit's context.
   CUContext *cu_context_;
 
   // A context for our children.
   DIEContext *child_context_;
 
   // True if this compilation unit has source line information.
--- a/toolkit/crashreporter/google-breakpad/src/common/dwarf_cu_to_module_unittest.cc
+++ b/toolkit/crashreporter/google-breakpad/src/common/dwarf_cu_to_module_unittest.cc
@@ -37,17 +37,16 @@
 
 #include "breakpad_googletest_includes.h"
 #include "common/dwarf_cu_to_module.h"
 #include "common/using_std_string.h"
 
 using std::make_pair;
 using std::vector;
 
-using dwarf2reader::AttributeList;
 using dwarf2reader::DIEHandler;
 using dwarf2reader::DwarfTag;
 using dwarf2reader::DwarfAttribute;
 using dwarf2reader::DwarfForm;
 using dwarf2reader::DwarfInline;
 using dwarf2reader::RootDIEHandler;
 using google_breakpad::DwarfCUToModule;
 using google_breakpad::Module;
@@ -58,24 +57,21 @@ using ::testing::Invoke;
 using ::testing::Return;
 using ::testing::Test;
 using ::testing::TestWithParam;
 using ::testing::Values;
 using ::testing::ValuesIn;
 
 // Mock classes.
 
-class MockLineToModuleFunctor: public DwarfCUToModule::LineToModuleFunctor {
+class MockLineToModuleHandler: public DwarfCUToModule::LineToModuleHandler {
  public:
-  MOCK_METHOD4(mock_apply, void(const char *program, uint64 length,
-                                Module *module, vector<Module::Line> *lines));
-  void operator()(const char *program, uint64 length,
-                  Module *module, vector<Module::Line> *lines) {
-    mock_apply(program, length, module, lines);
-  }
+  MOCK_METHOD1(StartCompilationUnit, void(const string& compilation_dir));
+  MOCK_METHOD4(ReadProgram, void(const char* program, uint64 length,
+                                 Module *module, vector<Module::Line> *lines));
 };
 
 class MockWarningReporter: public DwarfCUToModule::WarningReporter {
  public:
   MockWarningReporter(const string &filename, uint64 cu_offset)
       : DwarfCUToModule::WarningReporter(filename, cu_offset) { }
   MOCK_METHOD1(SetCUName, void(const string &name));
   MOCK_METHOD2(UnknownSpecification, void(uint64 offset, uint64 target));
@@ -98,20 +94,20 @@ class CUFixtureBase {
   //   vector<Module::Line> lines;
   //   AppendLinesFunctor appender(lines);
   //
   // then doing:
   //
   //   appender(line_program, length, module, line_vector);
   //
   // will append lines to the end of line_vector.  We can use this with
-  // MockLineToModuleFunctor like this:
+  // MockLineToModuleHandler like this:
   //
-  //   MockLineToModuleFunctor l2m;
-  //   EXPECT_CALL(l2m, mock_apply(_,_,_,_))
+  //   MockLineToModuleHandler l2m;
+  //   EXPECT_CALL(l2m, ReadProgram(_,_,_,_))
   //       .WillOnce(DoAll(Invoke(appender), Return()));
   //
   // in which case calling l2m with some line vector will append lines.
   class AppendLinesFunctor {
    public:
     AppendLinesFunctor(const vector<Module::Line> *lines) : lines_(lines) { }
     void operator()(const char *program, uint64 length,
                     Module *module, vector<Module::Line> *lines) {
@@ -139,27 +135,28 @@ class CUFixtureBase {
     EXPECT_CALL(reporter_, MissingSection(_)).Times(0);
     EXPECT_CALL(reporter_, BadLineInfoOffset(_)).Times(0);
     EXPECT_CALL(reporter_, UncoveredFunction(_)).Times(0);
     EXPECT_CALL(reporter_, UncoveredLine(_)).Times(0);
     EXPECT_CALL(reporter_, UnnamedFunction(_)).Times(0);
 
     // By default, expect the line program reader not to be invoked. We
     // may override this in StartCU.
-    EXPECT_CALL(line_reader_, mock_apply(_,_,_,_)).Times(0);
+    EXPECT_CALL(line_reader_, StartCompilationUnit(_)).Times(0);
+    EXPECT_CALL(line_reader_, ReadProgram(_,_,_,_)).Times(0);
 
     // The handler will consult this section map to decide what to
     // pass to our line reader.
     file_context_.section_map[".debug_line"] = make_pair(dummy_line_program_,
                                                          dummy_line_size_);
   }
 
   // Add a line with the given address, size, filename, and line
   // number to the end of the statement list the handler will receive
-  // when it invokes its LineToModuleFunctor. Call this before calling
+  // when it invokes its LineToModuleHandler. Call this before calling
   // StartCU.
   void PushLine(Module::Address address, Module::Address size,
                 const string &filename, int line_number);
 
   // Use LANGUAGE for the compilation unit. More precisely, arrange
   // for StartCU to pass the compilation unit's root DIE a
   // DW_AT_language attribute whose value is LANGUAGE.
   void SetLanguage(dwarf2reader::DwarfLanguage language) {
@@ -172,43 +169,42 @@ class CUFixtureBase {
 
   // Call the handler this.root_handler_'s StartCompilationUnit and
   // StartRootDIE member functions, passing it appropriate attributes as
   // determined by prior calls to PushLine and SetLanguage. Leave
   // this.root_handler_ ready to hear about children: call
   // this.root_handler_.EndAttributes, but not this.root_handler_.Finish.
   void StartCU();
 
-  // Add some strange attributes/form pairs to the end of ATTRS.
-  void PushBackStrangeAttributes(dwarf2reader::AttributeList *attrs);
-
   // Have HANDLER process some strange attribute/form/value triples.
-  // These will match those promised by PushBackStrangeAttributes.
   void ProcessStrangeAttributes(dwarf2reader::DIEHandler *handler);
 
   // Start a child DIE of PARENT with the given tag and name. Leave
   // the handler ready to hear about children: call EndAttributes, but
   // not Finish.
   DIEHandler *StartNamedDIE(DIEHandler *parent, DwarfTag tag,
                             const string &name);
  
   // Start a child DIE of PARENT with the given tag and a
   // DW_AT_specification attribute whose value is SPECIFICATION. Leave
   // the handler ready to hear about children: call EndAttributes, but
   // not Finish. If NAME is non-zero, use it as the DW_AT_name
   // attribute.
   DIEHandler *StartSpecifiedDIE(DIEHandler *parent, DwarfTag tag,
                                 uint64 specification, const char *name = NULL);
  
-  // Define a function as a child of PARENT with the given name,
-  // address, and size. Call EndAttributes and Finish; one cannot
-  // define children of the defined function's DIE.
+  // Define a function as a child of PARENT with the given name, address, and
+  // size. If high_pc_form is DW_FORM_addr then the DW_AT_high_pc attribute
+  // will be written as an address; otherwise it will be written as the
+  // function's size. Call EndAttributes and Finish; one cannot define
+  // children of the defined function's DIE.
   void DefineFunction(DIEHandler *parent, const string &name,
                       Module::Address address, Module::Address size,
-                      const char* mangled_name);
+                      const char* mangled_name,
+                      DwarfForm high_pc_form = dwarf2reader::DW_FORM_addr);
 
   // Create a declaration DIE as a child of PARENT with the given
   // offset, tag and name. If NAME is the empty string, don't provide
   // a DW_AT_name attribute. Call EndAttributes and Finish.
   void DeclarationDIE(DIEHandler *parent, uint64 offset,
                       DwarfTag tag, const string &name,
                       const string &mangled_name);
 
@@ -268,23 +264,27 @@ class CUFixtureBase {
   // If this is not DW_LANG_none, we'll pass it as a DW_AT_language
   // attribute to the compilation unit. This defaults to DW_LANG_none.
   dwarf2reader::DwarfLanguage language_;
 
   // If this is true, report DW_AT_language as a signed value; if false,
   // report it as an unsigned value.
   bool language_signed_;
 
+  // If this is not empty, we'll give the CU a DW_AT_comp_dir attribute that
+  // indicates the path that this compilation unit was compiled in.
+  string compilation_dir_;
+
   // If this is not empty, we'll give the CU a DW_AT_stmt_list
   // attribute that, when passed to line_reader_, adds these lines to the
   // provided lines array.
   vector<Module::Line> lines_;
 
   // Mock line program reader.
-  MockLineToModuleFunctor line_reader_;
+  MockLineToModuleHandler line_reader_;
   AppendLinesFunctor appender_;
   static const char dummy_line_program_[];
   static const size_t dummy_line_size_;
   
   MockWarningReporter reporter_;
   DwarfCUToModule root_handler_;
 
  private:
@@ -308,50 +308,46 @@ void CUFixtureBase::PushLine(Module::Add
   l.address = address;
   l.size = size;
   l.file = module_.FindFile(filename);
   l.number = line_number;
   lines_.push_back(l);
 }
 
 void CUFixtureBase::StartCU() {
+  if (!compilation_dir_.empty())
+    EXPECT_CALL(line_reader_,
+                StartCompilationUnit(compilation_dir_)).Times(1);
+
   // If we have lines, make the line reader expect to be invoked at
   // most once. (Hey, if the handler can pass its tests without
   // bothering to read the line number data, that's great.)
   // Have it add the lines passed to PushLine. Otherwise, leave the 
   // initial expectation (no calls) in force.
   if (!lines_.empty())
     EXPECT_CALL(line_reader_,
-                mock_apply(&dummy_line_program_[0], dummy_line_size_,
-                           &module_, _))
+                ReadProgram(&dummy_line_program_[0], dummy_line_size_,
+                            &module_, _))
         .Times(AtMost(1))
         .WillOnce(DoAll(Invoke(appender_), Return()));
 
   ASSERT_TRUE(root_handler_
               .StartCompilationUnit(0x51182ec307610b51ULL, 0x81, 0x44,
                                     0x4241b4f33720dd5cULL, 3));
   {
-    dwarf2reader::AttributeList attrs;
-    attrs.push_back(make_pair(dwarf2reader::DW_AT_name,
-                              dwarf2reader::DW_FORM_strp));
-    if (!lines_.empty())
-      attrs.push_back(make_pair(dwarf2reader::DW_AT_stmt_list,
-                                dwarf2reader::DW_FORM_ref4));
-    if (language_ != dwarf2reader::DW_LANG_none)
-      attrs.push_back(make_pair(dwarf2reader::DW_AT_language,
-                                language_signed_
-                                ? dwarf2reader::DW_FORM_sdata 
-                                : dwarf2reader::DW_FORM_udata));
     ASSERT_TRUE(root_handler_.StartRootDIE(0x02e56bfbda9e7337ULL,
-                                           dwarf2reader::DW_TAG_compile_unit,
-                                           attrs));
+                                           dwarf2reader::DW_TAG_compile_unit));
   }
   root_handler_.ProcessAttributeString(dwarf2reader::DW_AT_name,
                                        dwarf2reader::DW_FORM_strp,
                                        "compilation-unit-name");
+  if (!compilation_dir_.empty())
+    root_handler_.ProcessAttributeString(dwarf2reader::DW_AT_comp_dir,
+                                         dwarf2reader::DW_FORM_strp,
+                                         compilation_dir_);
   if (!lines_.empty())
     root_handler_.ProcessAttributeUnsigned(dwarf2reader::DW_AT_stmt_list,
                                            dwarf2reader::DW_FORM_ref4,
                                            0);
   if (language_ != dwarf2reader::DW_LANG_none) {
     if (language_signed_)
       root_handler_.ProcessAttributeSigned(dwarf2reader::DW_AT_language,
                                            dwarf2reader::DW_FORM_sdata,
@@ -359,30 +355,16 @@ void CUFixtureBase::StartCU() {
     else
       root_handler_.ProcessAttributeUnsigned(dwarf2reader::DW_AT_language,
                                              dwarf2reader::DW_FORM_udata,
                                              language_);
   }
   ASSERT_TRUE(root_handler_.EndAttributes());
 }
 
-void CUFixtureBase::PushBackStrangeAttributes(
-    dwarf2reader::AttributeList *attrs) {
-  attrs->push_back(make_pair((DwarfAttribute) 0xf560dead,
-                             (DwarfForm) 0x4106e4db));
-  attrs->push_back(make_pair((DwarfAttribute) 0x85380095,
-                             (DwarfForm) 0x0f16fe87));
-  attrs->push_back(make_pair((DwarfAttribute) 0xf7f7480f,
-                             (DwarfForm) 0x829e038a));
-  attrs->push_back(make_pair((DwarfAttribute) 0xa55ffb51,
-                             (DwarfForm) 0x2f43b041));
-  attrs->push_back(make_pair((DwarfAttribute) 0x2fde304a,
-                             (DwarfForm) 0x895ffa23));
-}
-
 void CUFixtureBase::ProcessStrangeAttributes(
     dwarf2reader::DIEHandler *handler) {
   handler->ProcessAttributeUnsigned((DwarfAttribute) 0xf560dead,
                                     (DwarfForm) 0x4106e4db,
                                     0xa592571997facda1ULL);
   handler->ProcessAttributeSigned((DwarfAttribute) 0x85380095,
                                   (DwarfForm) 0x0f16fe87,
                                   0x12602a4e3bf1f446LL);
@@ -396,22 +378,18 @@ void CUFixtureBase::ProcessStrangeAttrib
   handler->ProcessAttributeString((DwarfAttribute) 0x2f43b041,
                                   (DwarfForm) 0x895ffa23,
                                   "strange string");
 }
 
 DIEHandler *CUFixtureBase::StartNamedDIE(DIEHandler *parent,
                                          DwarfTag tag,
                                          const string &name) {
-  dwarf2reader::AttributeList attrs;
-  attrs.push_back(make_pair(dwarf2reader::DW_AT_name,
-                            dwarf2reader::DW_FORM_strp));
-  PushBackStrangeAttributes(&attrs);
   dwarf2reader::DIEHandler *handler
-    = parent->FindChildHandler(0x8f4c783c0467c989ULL, tag, attrs);
+    = parent->FindChildHandler(0x8f4c783c0467c989ULL, tag);
   if (!handler)
     return NULL;
   handler->ProcessAttributeString(dwarf2reader::DW_AT_name,
                                   dwarf2reader::DW_FORM_strp,
                                   name);
   ProcessStrangeAttributes(handler);
   if (!handler->EndAttributes()) {
     handler->Finish();
@@ -421,24 +399,18 @@ DIEHandler *CUFixtureBase::StartNamedDIE
     
   return handler;
 }
 
 DIEHandler *CUFixtureBase::StartSpecifiedDIE(DIEHandler *parent,
                                              DwarfTag tag,
                                              uint64 specification,
                                              const char *name) {
-  dwarf2reader::AttributeList attrs;
-  if (name)
-    attrs.push_back(make_pair(dwarf2reader::DW_AT_name,
-                              dwarf2reader::DW_FORM_strp));