Skip to content

Commit

Permalink
backout patch for bug 378463 due to bustage
Browse files Browse the repository at this point in the history
  • Loading branch information
sayrer committed May 2, 2007
1 parent cd0a799 commit 4c0b506
Show file tree
Hide file tree
Showing 9 changed files with 44 additions and 230 deletions.
34 changes: 5 additions & 29 deletions Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -134,39 +134,16 @@ ifdef MOZ_PROFILE
/bin/find $(DIST) -name "*.dbg" -exec mv {} $(DIST)/$(BUILDID) \;
endif # MOZ_PROFILE
endif # MOZILLA_OFFICIAL
endif # WINNT

ifeq ($(OS_ARCH),WINNT)
SYM_FIND_CMD := /bin/find . -path dist -prune -o -name "*.exe" \
-o -name "*.dll" -o -name "*.EXE" | sed "s/\.[^\.]*$$/\.pdb/"
# we want to copy PDB files on Windows
MAKE_SYM_STORE_ARGS := -c
DUMP_SYMS_BIN := $(topsrcdir)/toolkit/airbag/tools/win32/dump_syms.exe
endif
ifeq ($(OS_ARCH),Darwin)
# need to pass arch flags for universal builds
ifdef UNIVERSAL_BINARY
MAKE_SYM_STORE_ARGS := -a "ppc i386"
SYM_DIST := $(DIST)/universal
else
MAKE_SYM_STORE_ARGS := -a $(OS_TEST)
SYM_DIST := $(DIST)
endif
# |file| is stupid on universal binaries, it produces one line of output
# for the file, and one line of output for each architecture contained within.
SYM_FIND_CMD := find -L $(SYM_DIST) -type f -a -perm -100 -o -name "*.dylib" \
| xargs file -L | grep "Mach-O" | grep -v "for architecture" | cut -f1 -d':'
DUMP_SYMS_BIN := $(DIST)/host/bin/dump_syms
endif

buildsymbols:
ifdef MOZ_DEBUG_SYMBOLS
ifdef MOZ_AIRBAG
echo building symbol store
mkdir -p $(DIST)/crashreporter-symbols/$(BUILDID)
$(SYM_FIND_CMD) | \
xargs $(topsrcdir)/toolkit/airbag/tools/make_symbol_store.pl \
$(MAKE_SYM_STORE_ARGS) $(DUMP_SYMS_BIN) \
/bin/find . -path "./dist" -prune -o -name "*.exe" \
-o -name "*.dll" -o -name "*.EXE" | sed "s/\.[^\.]*$$/\.pdb/" | \
xargs $(topsrcdir)/toolkit/airbag/tools/make_symbol_store.pl -c \
$(topsrcdir)/toolkit/airbag/tools/win32/dump_syms.exe \
$(DIST)/crashreporter-symbols/$(BUILDID) > \
$(DIST)/crashreporter-symbols/$(BUILDID)/$(MOZ_APP_NAME)-$(MOZ_APP_VERSION)-$(OS_ARCH)-$(BUILDID)-symbols.txt
echo packing symbols
Expand All @@ -185,16 +162,15 @@ ifdef MOZ_AIRBAG
endif
endif

ifeq ($(OS_ARCH),WINNT)
signnss:
ifdef MOZILLA_OFFICIAL
echo signing NSS libs
cd $(DIST)/bin; ./shlibsign.exe -v -i softokn3.dll
cd $(DIST)/bin; ./shlibsign.exe -v -i freebl3.dll
endif # MOZILLA_OFFICIAL

BUILDID = $(shell cat $(DEPTH)/config/build_number)
deliver: splitsymbols rebase signnss

endif # WINNT

BUILDID = $(shell cat $(DEPTH)/config/build_number)
4 changes: 2 additions & 2 deletions build/macosx/universal/flight.mk
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,9 @@ postflight_all:
# a universal binary too early, before the unified bits have been staged.
# Set SIGN_NSS= to skip shlibsign.
$(MAKE) -C $(OBJDIR_PPC)/$(INSTALLER_DIR) \
UNIVERSAL_BINARY= SIGN_NSS= PKG_SKIP_STRIP=1 stage-package
UNIVERSAL_BINARY= SIGN_NSS= stage-package
$(MAKE) -C $(OBJDIR_X86)/$(INSTALLER_DIR) \
UNIVERSAL_BINARY= SIGN_NSS= PKG_SKIP_STRIP=1 stage-package
UNIVERSAL_BINARY= SIGN_NSS= stage-package
# Remove .chk files that may have been copied from the NSS build. These will
# cause unify to warn or fail if present. New .chk files that are
# appropriate for the merged libraries will be generated when the universal
Expand Down
9 changes: 3 additions & 6 deletions toolkit/airbag/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -61,12 +61,9 @@ ifeq ($(OS_ARCH),WINNT)
endif

ifeq ($(OS_ARCH),Darwin)
DIRS += \
airbag/src/common/ \
airbag/src/common/mac \
airbag/src/client/mac/handler \
airbag/src/tools/mac/dump_syms \
$(NULL)
DIRS += airbag/src/common/mac \
airbag/src/client/mac/handler \
$(NULL)
endif

DIRS += client
Expand Down
65 changes: 0 additions & 65 deletions toolkit/airbag/airbag/src/common/Makefile.in

This file was deleted.

29 changes: 12 additions & 17 deletions toolkit/airbag/airbag/src/common/mac/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -43,29 +43,24 @@ 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)/../..

# 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 \
$(NULL)
CPPSRCS = \
file_id.cc \
macho_id.cc \
macho_walker.cc \
string_utilities.cc \
../string_conversion.cc \
$(NULL)

CMSRCS = \
HTTPMultipartUpload.m \
$(NULL)
CMSRCS = \
HTTPMultipartUpload.m \
$(NULL)

HOST_CPPSRCS = $(CPPSRCS)
CSRCS = \
../convert_UTF.c

HOST_CMMSRCS = \
dump_syms.mm \
$(NULL)

# need static lib
FORCE_STATIC_LIB = 1
Expand Down
68 changes: 0 additions & 68 deletions toolkit/airbag/airbag/src/tools/mac/dump_syms/Makefile.in

This file was deleted.

64 changes: 22 additions & 42 deletions toolkit/airbag/tools/make_symbol_store.pl
Original file line number Diff line number Diff line change
Expand Up @@ -35,49 +35,41 @@
#
# ***** END LICENSE BLOCK *****
#
# Usage: make_symbol_store.pl <params> <dump_syms path> <symbol store path>
# <debug info files>
# Runs dump_syms on each debug info file specified on the command line,
# Usage: make_symbol_store.pl <params> <dump_syms path> <symbol store path> <pdb files>
# Runs dump_syms on each pdb file specified on the command line,
# then places the resulting symbol file in the proper directory
# structure in the symbol store path. Accepts multiple files
# structure in the symbol store path. Accepts multiple pdb files
# on the command line, so can be called as part of a pipe using
# find <dir> | xargs make_symbol_store.pl <dump_syms> <storepath>
# find <dir> -name "*.pdb" | xargs make_symbol_store.pl <dump_syms> <storepath>
# Parameters accepted:
# -c : Copy debug info files to the same directory structure
# as sym files
# -a "<archs>" : Run dump_syms -a <arch> for each space separated
# cpu architecture in <archs> (only on OS X)
# -c : Copy pdb files to the same directory structure as sym files

use FileHandle;
use File::Path;
use File::Copy;
use File::Basename;

print "Usage: make_symbol_store.pl <params>" .
"<dump_syms path> <storepath> <debug info files>\n"
and exit if scalar @ARGV < 3;
print "Usage: make_symbol_store.pl <dump_syms path> <storepath> <pdb files>>\n" and exit if scalar @ARGV < 3;

# Given a symbol file generated by dump_syms,
# and a directory to store the resulting symbol path,
# move the symbol file into the directory structure
# expected by the breakpad processor. For details, see:
# http://google-breakpad.googlecode.com/svn/trunk/src/processor/simple_symbol_supplier.h
# expected by the airbag processor:
# file.pdb/GUID+age/file.sym
sub rename_symbol_file
{
my ($symbol_file, $dest_path) = @_;
my $fh = FileHandle->new($symbol_file, "r");
return "" unless $fh;

my $line = <$fh>;
return "" unless $line;
$line =~ s/\s*$//;
$fh->close();
return "" unless $line =~ m/^MODULE/;

# the first line of a sym file looks like:
# MODULE os cpu identifier debug_file
my ($guid,$dbgfile) = (split(/ +/, $line))[3..4];
my $newpath = $dest_path . "/" . $dbgfile . "/" . $guid;
my ($guid,$age,$dbgfile) = (split(/ +/, $line))[1..3];
$guid =~ s/\-//g;
my $newpath = $dest_path . "/" . $dbgfile . "/" . uc($guid . $age);
eval { mkpath($newpath) };
return "" if $@;

Expand All @@ -93,36 +85,24 @@ sub rename_symbol_file
return "";
}

my $copy_dbg = 0;
my @archs = ('');
while (@ARGV && $ARGV[0] =~ m/^-/) {
my $arg = shift;
if ($arg eq '-c') {
$copy_dbg = 1;
}
elsif ($arg eq '-a') {
@archs = (split(/\s+/, shift));
}
my $copy_pdbs = 0;
if($ARGV[0] eq '-c') {
$copy_pdbs = 1;
shift;
}

my $dump_syms = shift;
my $symbol_path = shift;
foreach my $dbgfile (@ARGV) {
next unless -f $dbgfile;
# get filename without path or .pdb extension, if it exists
my ($sf) = fileparse($dbgfile, ".pdb");
foreach my $pdbfile (@ARGV) {
next unless -f $pdbfile;
my ($sf) = fileparse($pdbfile, ".pdb");
my $symfile = $symbol_path . "/" . $sf . ".sym";
foreach my $arch (@archs) {
my $a = '';
$a = "-a $arch" if $arch ne '';
system("${dump_syms} ${a} ${dbgfile} > ${symfile}");
my $newpath = rename_symbol_file $symfile, $symbol_path;
if ($copy_dbg && $newpath ne "") {
system("$dump_syms $pdbfile > $symfile");
my $newpath = rename_symbol_file $symfile, $symbol_path;
if($copy_pdbs && $newpath ne "") {
my $out = $newpath;
$out =~ s/^$symbol_path//;
$out =~ s|^/||;
print "$out/${sf}.pdb\n";
copy($dbgfile, $newpath);
}
copy($pdbfile, $newpath);
}
}
Binary file modified toolkit/airbag/tools/win32/dump_syms.exe
Binary file not shown.
1 change: 0 additions & 1 deletion toolkit/xre/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,6 @@ endif
ifeq ($(OS_ARCH),Darwin)
SHARED_LIBRARY_LIBS += \
$(DEPTH)/toolkit/airbag/airbag/src/client/mac/handler/$(LIB_PREFIX)exception_handler_s.$(LIB_SUFFIX) \
$(DEPTH)/toolkit/airbag/airbag/src/common/$(LIB_PREFIX)breakpad_common_s.$(LIB_SUFFIX) \
$(DEPTH)/toolkit/airbag/airbag/src/common/mac/$(LIB_PREFIX)breakpad_mac_common_s.$(LIB_SUFFIX)
endif
endif
Expand Down

0 comments on commit 4c0b506

Please sign in to comment.