bug 465329 - sync to breakpad revision 299 (just the mozilla changes). r=bsmedberg
authorTed Mielczarek <ted.mielczarek@gmail.com>
Tue, 25 Nov 2008 12:03:26 -0500
changeset 22510 681b46e69db218090bb5211360c7db584009e0f9
parent 22509 7aa964f60934c55c5bcead514a92f93e2427ea72
child 22511 31281697c16617d0cc7cd1e809169244f385eaa8
push idunknown
push userunknown
push dateunknown
reviewersbsmedberg
bugs465329
milestone1.9.2a1pre
bug 465329 - sync to breakpad revision 299 (just the mozilla changes). r=bsmedberg
toolkit/crashreporter/Makefile.in
toolkit/crashreporter/google-breakpad/src/client/windows/Makefile.in
toolkit/crashreporter/google-breakpad/src/client/windows/crash_generation/Makefile.in
toolkit/crashreporter/google-breakpad/src/common/mac/Makefile.in
toolkit/crashreporter/google-breakpad/src/common/mac/dwarf/Makefile.in
toolkit/crashreporter/google-breakpad/src/tools/mac/dump_syms/Makefile.in
toolkit/crashreporter/google-breakpad/src/tools/mac/dump_syms/dump_syms_tool.m
toolkit/crashreporter/test/Makefile.in
toolkit/xre/Makefile.in
--- a/toolkit/crashreporter/Makefile.in
+++ b/toolkit/crashreporter/Makefile.in
@@ -49,19 +49,22 @@ REQUIRES = \
 	xpcom \
 	string \
 	$(NULL)
 
 DIRS = \
 	$(NULL)
 
 ifeq  ($(OS_ARCH),WINNT)
-	DIRS += google-breakpad/src/common/windows \
-		google-breakpad/src/client/windows \
-		$(NULL)
+DIRS += \
+  google-breakpad/src/common/windows \
+  google-breakpad/src/client/windows/handler \
+  google-breakpad/src/client/windows/sender \
+  google-breakpad/src/client/windows/crash_generation \
+  $(NULL)
 endif
 
 ifeq ($(OS_ARCH),Darwin)
 CMMSRCS = mac_utils.mm
 
 DIRS += \
   google-breakpad/src/common \
   google-breakpad/src/common/mac \
deleted file mode 100755
--- a/toolkit/crashreporter/google-breakpad/src/client/windows/Makefile.in
+++ /dev/null
@@ -1,46 +0,0 @@
-# ***** BEGIN LICENSE BLOCK *****
-# Version: MPL 1.1/GPL 2.0/LGPL 2.1
-#
-# The contents of this file are subject to the Mozilla Public License Version
-# 1.1 (the "License"); you may not use this file except in compliance with
-# the License. You may obtain a copy of the License at
-# http://www.mozilla.org/MPL/
-#
-# Software distributed under the License is distributed on an "AS IS" basis,
-# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
-# for the specific language governing rights and limitations under the
-# License.
-#
-# The Original Code is Mozilla Breakpad integration
-#
-# The Initial Developer of the Original Code is
-# Ted Mielczarek <ted.mielczarek@gmail.com>
-# Portions created by the Initial Developer are Copyright (C) 2006
-# the Initial Developer. All Rights Reserved.
-#
-# Contributor(s):
-#
-# Alternatively, the contents of this file may be used under the terms of
-# either the GNU General Public License Version 2 or later (the "GPL"), or
-# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
-# in which case the provisions of the GPL or the LGPL are applicable instead
-# of those above. If you wish to allow use of your version of this file only
-# under the terms of either the GPL or the LGPL, and not to allow others to
-# use your version of this file under the terms of the MPL, indicate your
-# decision by deleting the provisions above and replace them with the notice
-# and other provisions required by the GPL or the LGPL. If you do not delete
-# the provisions above, a recipient may use your version of this file under
-# the terms of any one of the MPL, the GPL or the LGPL.
-#
-# ***** END LICENSE BLOCK *****
-
-DEPTH		= ../../../../../..
-topsrcdir	= @top_srcdir@
-srcdir		= @srcdir@
-VPATH		= @srcdir@
-
-include $(DEPTH)/config/autoconf.mk
-
-DIRS = handler sender
-
-include $(topsrcdir)/config/rules.mk
new file mode 100644
--- /dev/null
+++ b/toolkit/crashreporter/google-breakpad/src/client/windows/crash_generation/Makefile.in
@@ -0,0 +1,60 @@
+# ***** BEGIN LICENSE BLOCK *****
+# Version: MPL 1.1/GPL 2.0/LGPL 2.1
+#
+# The contents of this file are subject to the Mozilla Public License Version
+# 1.1 (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+# http://www.mozilla.org/MPL/
+#
+# Software distributed under the License is distributed on an "AS IS" basis,
+# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+# for the specific language governing rights and limitations under the
+# License.
+#
+# The Original Code is Mozilla Breakpad integration
+#
+# The Initial Developer of the Original Code is
+# The Mozilla Foundation
+# Portions created by the Initial Developer are Copyright (C) 2008
+# the Initial Developer. All Rights Reserved.
+#
+# Contributor(s):
+# Ted Mielczarek <ted.mielczarek@gmail.com>
+#
+# Alternatively, the contents of this file may be used under the terms of
+# either the GNU General Public License Version 2 or later (the "GPL"), or
+# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+# in which case the provisions of the GPL or the LGPL are applicable instead
+# of those above. If you wish to allow use of your version of this file only
+# under the terms of either the GPL or the LGPL, and not to allow others to
+# use your version of this file under the terms of the MPL, indicate your
+# decision by deleting the provisions above and replace them with the notice
+# and other provisions required by the GPL or the LGPL. If you do not delete
+# the provisions above, a recipient may use your version of this file under
+# the terms of any one of the MPL, the GPL or the LGPL.
+#
+# ***** END LICENSE BLOCK *****
+
+DEPTH		= ../../../../../../..
+topsrcdir	= @top_srcdir@
+srcdir		= @srcdir@
+VPATH		= @srcdir@
+
+include $(DEPTH)/config/autoconf.mk
+
+MODULE		= crash_generation
+LIBRARY_NAME	= crash_generation_s
+
+LOCAL_INCLUDES 	= -I$(srcdir)/../../..
+DEFINES += -DUNICODE -D_UNICODE
+
+#XXX: We're not currently building the other parts,
+# which would only be needed on the server side of the equation.
+CPPSRCS		= \
+		crash_generation_client.cc \
+		$(NULL)
+
+# need static lib
+FORCE_STATIC_LIB = 1
+
+include $(topsrcdir)/config/rules.mk
--- a/toolkit/crashreporter/google-breakpad/src/common/mac/Makefile.in
+++ b/toolkit/crashreporter/google-breakpad/src/common/mac/Makefile.in
@@ -42,16 +42,18 @@ VPATH		= @srcdir@
 include $(DEPTH)/config/autoconf.mk
 
 MODULE		= breakpad_mac_common
 LIBRARY_NAME	= breakpad_mac_common_s
 HOST_LIBRARY_NAME = host_breakpad_mac_common_s
 
 LOCAL_INCLUDES 	= -I$(srcdir)/../..
 
+DIRS = dwarf
+
 # This is a little weird, but we're building a host and a target lib here.
 # The host lib is used for dump_syms, and the target lib for the
 # crash reporter client.  Therefore, we don't need all the srcs in both.
 CPPSRCS	= \
   file_id.cc \
   macho_id.cc \
   macho_walker.cc \
   string_utilities.cc \
new file mode 100644
--- /dev/null
+++ b/toolkit/crashreporter/google-breakpad/src/common/mac/dwarf/Makefile.in
@@ -0,0 +1,61 @@
+# ***** BEGIN LICENSE BLOCK *****
+# Version: MPL 1.1/GPL 2.0/LGPL 2.1
+#
+# The contents of this file are subject to the Mozilla Public License Version
+# 1.1 (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+# http://www.mozilla.org/MPL/
+#
+# Software distributed under the License is distributed on an "AS IS" basis,
+# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+# for the specific language governing rights and limitations under the
+# License.
+#
+# The Original Code is Mozilla Breakpad integration
+#
+# The Initial Developer of the Original Code is
+# The Mozilla Foundation
+# Portions created by the Initial Developer are Copyright (C) 2008
+# the Initial Developer. All Rights Reserved.
+#
+# Contributor(s):
+# Ted Mielczarek <ted.mielczarek@gmail.com>
+#
+# Alternatively, the contents of this file may be used under the terms of
+# either the GNU General Public License Version 2 or later (the "GPL"), or
+# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+# in which case the provisions of the GPL or the LGPL are applicable instead
+# of those above. If you wish to allow use of your version of this file only
+# under the terms of either the GPL or the LGPL, and not to allow others to
+# use your version of this file under the terms of the MPL, indicate your
+# decision by deleting the provisions above and replace them with the notice
+# and other provisions required by the GPL or the LGPL. If you do not delete
+# the provisions above, a recipient may use your version of this file under
+# the terms of any one of the MPL, the GPL or the LGPL.
+#
+# ***** END LICENSE BLOCK *****
+
+DEPTH		= ../../../../../../..
+topsrcdir	= @top_srcdir@
+srcdir		= @srcdir@
+VPATH		= @srcdir@
+
+include $(DEPTH)/config/autoconf.mk
+
+MODULE		= breakpad_mac_dwarf
+HOST_LIBRARY_NAME = host_breakpad_mac_dwarf_s
+
+LOCAL_INCLUDES 	= -I$(srcdir)/../../..
+
+HOST_CPPSRCS = \
+  bytereader.cc \
+  dwarf2reader.cc \
+  functioninfo.cc \
+  $(NULL)
+
+HOST_CXXFLAGS += -funsigned-char
+
+# need static lib
+FORCE_STATIC_LIB = 1
+
+include $(topsrcdir)/config/rules.mk
--- a/toolkit/crashreporter/google-breakpad/src/tools/mac/dump_syms/Makefile.in
+++ b/toolkit/crashreporter/google-breakpad/src/tools/mac/dump_syms/Makefile.in
@@ -43,22 +43,23 @@ include $(DEPTH)/config/autoconf.mk
 
 HOST_PROGRAM = dump_syms
 
 LOCAL_INCLUDES 	= \
   -I$(srcdir)/../../.. \
   -I$(srcdir)/../../../common/mac \
   $(NULL)
 
-HOST_CMSRCS = \
-  dump_syms_tool.m \
+HOST_CMMSRCS = \
+  dump_syms_tool.mm \
   $(NULL)
 
 HOST_LIBS += \
   $(DEPTH)/toolkit/crashreporter/google-breakpad/src/common/mac/$(LIB_PREFIX)host_breakpad_mac_common_s.$(LIB_SUFFIX) \
+  $(DEPTH)/toolkit/crashreporter/google-breakpad/src/common/mac/dwarf/$(LIB_PREFIX)host_breakpad_mac_dwarf_s.$(LIB_SUFFIX) \
   $(DEPTH)/toolkit/crashreporter/google-breakpad/src/common/$(LIB_PREFIX)host_breakpad_common_s.$(LIB_SUFFIX) \
   $(NULL)
 
 HOST_LDFLAGS += \
   -framework Foundation \
   -lcrypto \
   $(NULL)
 
deleted file mode 100644
--- a/toolkit/crashreporter/google-breakpad/src/tools/mac/dump_syms/dump_syms_tool.m
+++ /dev/null
@@ -1,142 +0,0 @@
-// Copyright (c) 2006, 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.
-
-// dump_syms_tool.m: Command line tool that uses the DumpSymbols class.
-// TODO(waylonis): accept stdin
-
-#include <unistd.h>
-#include <mach-o/arch.h>
-
-#include "dump_syms.h"
-#include "common/mac/macho_utilities.h"
-
-typedef struct {
-  NSString *srcPath;
-  NSString *arch;
-  NSString *uuidStr;
-  BOOL result;
-} Options;
-
-//=============================================================================
-static void Start(Options *options) {
-  DumpSymbols *dump = [[DumpSymbols alloc]
-    initWithContentsOfFile:options->srcPath];
-  
-  if (!dump) {
-    fprintf(stderr, "%s is not a valid Mach-o file\n",
-            [options->srcPath fileSystemRepresentation]);
-    options->result = NO;
-    return;
-  }
-
-  if (![dump setArchitecture:options->arch]) {
-    fprintf(stderr, "Architecture: %s not available in %s\n", 
-            [options->arch UTF8String],
-            [options->srcPath fileSystemRepresentation]);
-    options->result = NO;
-    return;
-  }
-  
-  options->result = [dump writeSymbolFile:@"-"];
-}
-
-//=============================================================================
-static void Usage(int argc, const char *argv[]) {
-  fprintf(stderr, "Output a Breakpad symbol file from a Mach-o file.\n");
-  fprintf(stderr, "Usage: %s [-a ppc|i386|x86] <Mach-o file>\n",
-          argv[0]);
-  fprintf(stderr, "\t-a: Architecture type [default: native]\n");
-  fprintf(stderr, "\t-h: Usage\n");
-  fprintf(stderr, "\t-?: Usage\n");
-}
-
-//=============================================================================
-static void SetupOptions(int argc, const char *argv[], Options *options) {
-  extern int optind;
-  const NXArchInfo *localArchInfo = NXGetLocalArchInfo();
-  char ch;
-
-  if (localArchInfo) {
-    if (localArchInfo->cputype & CPU_ARCH_ABI64)
-      options->arch = (localArchInfo->cputype == CPU_TYPE_POWERPC64) ? @"ppc64":
-        @"x86_64";
-    else
-      options->arch = (localArchInfo->cputype == CPU_TYPE_POWERPC) ? @"ppc" :
-        @"x86";
-  }
-
-  while ((ch = getopt(argc, (char * const *)argv, "a:h?")) != -1) {
-    switch (ch) {
-      case 'a':
-        if (strcmp("ppc", optarg) == 0)
-          options->arch = @"ppc";
-        else if (strcmp("x86", optarg) == 0 || strcmp("i386", optarg) == 0)
-          options->arch = @"x86";
-        else if (strcmp("ppc64", optarg) == 0)
-          options->arch = @"ppc64";
-        else if (strcmp("x86_64", optarg) == 0)
-          options->arch = @"x86_64";
-        else {
-          fprintf(stderr, "%s: Invalid architecture: %s\n", argv[0], optarg);
-          Usage(argc, argv);
-          exit(1);
-        }
-          break;
-      case '?':
-      case 'h':
-        Usage(argc, argv);
-        exit(0);
-        break;
-    }
-  }
-  
-  if ((argc - optind) != 1) {
-    fprintf(stderr, "Must specify Mach-o file\n");
-    Usage(argc, argv);
-    exit(1);
-  }
-
-  options->srcPath = [[NSFileManager defaultManager]
-    stringWithFileSystemRepresentation:argv[optind]
-                                length:strlen(argv[optind])];
-}
-
-//=============================================================================
-int main (int argc, const char * argv[]) {
-  NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
-  Options options;
-
-  bzero(&options, sizeof(Options));
-  SetupOptions(argc, argv, &options);
-  Start(&options);
-
-  [pool release];
-
-  return !options.result;
-}
--- a/toolkit/crashreporter/test/Makefile.in
+++ b/toolkit/crashreporter/test/Makefile.in
@@ -64,16 +64,17 @@ LIBS = \
 
 MOZILLA_INTERNAL_API = 1
 
 include $(topsrcdir)/config/rules.mk
 
 ifeq ($(OS_ARCH),WINNT)
 LIBS += \
 	$(DEPTH)/toolkit/crashreporter/google-breakpad/src/client/windows/handler/$(LIB_PREFIX)exception_handler_s.$(LIB_SUFFIX) \
+	$(DEPTH)/toolkit/crashreporter/google-breakpad/src/client/windows/crash_generation/$(LIB_PREFIX)crash_generation_s.$(LIB_SUFFIX) \
 	$(DEPTH)/toolkit/crashreporter/google-breakpad/src/common/windows/$(LIB_PREFIX)breakpad_windows_common_s.$(LIB_SUFFIX)
 LIBS += $(call expand_libname shell32)
 OS_LIBS += $(call EXPAND_LIBNAME,ole32)
 endif
 
 ifeq ($(OS_ARCH),Darwin)
 OS_LIBS += -framework Cocoa -lcrypto
 LIBS += \
--- a/toolkit/xre/Makefile.in
+++ b/toolkit/xre/Makefile.in
@@ -169,16 +169,17 @@ SHARED_LIBRARY_LIBS += $(DEPTH)/widget/s
 LOCAL_INCLUDES += -I$(topsrcdir)/widget/src/xremoteclient
 endif
 
 ifdef MOZ_CRASHREPORTER
 SHARED_LIBRARY_LIBS += $(DEPTH)/toolkit/crashreporter/$(LIB_PREFIX)exception_handler_s.$(LIB_SUFFIX)
 ifeq ($(OS_ARCH),WINNT)
 SHARED_LIBRARY_LIBS += \
 	$(DEPTH)/toolkit/crashreporter/google-breakpad/src/client/windows/handler/$(LIB_PREFIX)exception_handler_s.$(LIB_SUFFIX) \
+	$(DEPTH)/toolkit/crashreporter/google-breakpad/src/client/windows/crash_generation/$(LIB_PREFIX)crash_generation_s.$(LIB_SUFFIX) \
 	$(DEPTH)/toolkit/crashreporter/google-breakpad/src/common/windows/$(LIB_PREFIX)breakpad_windows_common_s.$(LIB_SUFFIX)
 endif
 
 ifeq ($(OS_ARCH),Darwin)
 SHARED_LIBRARY_LIBS += \
 	$(DEPTH)/toolkit/crashreporter/google-breakpad/src/client/$(LIB_PREFIX)minidump_file_writer_s.$(LIB_SUFFIX) \
 	$(DEPTH)/toolkit/crashreporter/google-breakpad/src/client/mac/handler/$(LIB_PREFIX)exception_handler_s.$(LIB_SUFFIX) \
 	$(DEPTH)/toolkit/crashreporter/google-breakpad/src/common/$(LIB_PREFIX)breakpad_common_s.$(LIB_SUFFIX) \